接口功能介绍
支持批量修改视频直播产品的域名配置。
使用说明
- 修改域名之前,您需要先开通对应产品类型的服务,且保证资源包/按需服务有效;
- 该域名没有在途工单;
- 调用接口成功仅代表成功进入配置下发流程,配置部署需要一些时间,请等待10分钟后通过查询域名配置接口查看配置是否下发完成;
- 单个用户一分钟限制调用10次
- 视频直播产品的域名修改分3种场景,①修改推流域名;②修改拉流域名,且拉流模式为推拉流;③修改拉流域名,且拉流模式为回源拉流;
- 接口的 一级功能为增量更新,二级功能为全量更新 ,如可选择只更新ip_access_control,但ip_access_control下的配置项需全量更新。
接口详情
请求方式:POST
请求路径:/live/domain/batch-update-configuration-information
请求参数
场景1:推流域名配置修改
参数 | 类型 | 名称 | 是否必填 | 说明 |
---|---|---|---|---|
product_code | string | 产品类型 | 是 | 支持:"005":视频直播,创建后不可修改 |
domain | list | 推流域名列表 | 是 | 单次调用域名个数最多不超过20个 |
ip_access_control | object | ip黑白名单 | 否 | 未传代表不修改,有传代表整个object全量修改,包括:开关、ip列表、黑白名单类型 |
ip_access_control.switch | string | 开关 | 是 | 取值:on(开启);off(关闭) |
ip_access_control.type | int | 黑白名单类型 | 否 | 取值:0(黑名单);1(白名单),当ip_access_control.switch = on 时必填 |
ip_access_control.list | list | ip列表 | 否 | 当ip_access_control.switch = on 时必填,支持ipv4、ipv6 |
self_notice | object | 推流回调 | 否 | 不传字段或者传值为null代表不做修改,否则默认整体替换 |
self_notice.switch | int | 推流回调开关 | 是 | 取值:on(开启)、off(关闭); 开启时,推流回调地址、推流回调host、开播通知uri和关播通知uri均必填 |
self_notice.notify_address | string | 推流回调地址 | 否 | 支持ipv4、ipv6和域名 |
self_notice.notify_port | int | 开关播通知的端口 | 否 | 开关播通知的端口,默认80 |
self_notice.notify_host | string | 开关播请求使用的host头 | 否 | 支持ipv4、ipv6和域名 |
self_notice.notify_start_url_path | string | 开播通知uri | 否 | 示例:”/pushstart“ |
self_notice.notify_stop_url_path | string | 关播通知uri | 否 | 示例:”/pushend“ |
time_shift | object | 时移任务 | 否 | 不传字段代表不做修改,否则默认整体替换,只支持配置一个时移任务; |
time_shift.switch | string | 时移开关 | 是 | 取值:on(开启)、off(关闭); |
time_shift.max_playback_time | string | 时移任务回看时长 | 否 | 30s~30d(time格式,30s到30天); 默认一小时,支持的单位: s、m、 h、d |
time_shift.module_id | string | 录制模板id | 是 | 时移需要绑定的录制模板id |
third_push | object | 转推 | 否 | 不传字段或者传值为null代表不做修改,否则默认整体替换 |
third_push.switch | int | 转推开关 | 是 | 取值:on(开启)、off(关闭); |
third_push.push_list | list | 转推列表 | 否 | 开关开启时必填,不支持存在重复的地址、端口、host组合 |
third_push.push_list:origin | string | 转推目标ip或域名 | 是 | 如果是ipv6地址需要加[],示例: [::1] |
third_push.push_list:port | string | 转推目标端口 | 否 | 默认1935 |
third_push.push_list:host | string | 转推使用的请求头host | 否 | 当referer_control.switch = on 时,且referer_control.allow_empty=off时必填 |
场景2:拉流域名配置修改(推拉流场景)
参数 | 类型 | 名称 | 是否必填 | 说明 |
---|---|---|---|---|
product_code | string | 产品类型 | 是 | "005":视频直播,创建后不可修改 |
domain | list | 拉流域名列表 | 是 | 单次调用域名个数最多不超过20个 |
push_stream_domain | string | 关联推流域名 | 否 | 已创建的推流域名 |
ip_access_control | obj | ip黑白名单 | 否 | 未传代表不修改,有传代表整个obj全量修改 包括:开关、ip列表、黑白名单类型 |
ip_access_control.switch | string | 开关 | 是 | 取值:on(开启);off(关闭) |
ip_access_control.type | int | 黑白名单类型 | 否 | 当ip_access_control.switch = on 时,必填 取值:0(黑名单);1(白名单) |
ip_access_control.list | list | ip列表 | 否 | 当ip_access_control.switch = on 时,必填 支持ipv4、ipv6 |
referer_control | obj | 防盗链 | 否 | 未传代表不修改,有传代表整个obj全量修改 包括:开关、是否允许空referer访问、黑白名单类型、referer列表 |
referer_control.switch | string | 开关 | 是 | 取值:on(开启A)、off(关闭) |
referer_control.allow_empty | string | 是否允许空referer访问 | 否 | 当referer_control.switch = on 时,必填 取值:on(开启), off(关闭) |
referer_control.type | int | 类型 | 否 | 当referer_control.switch = on 时,必填 取值:0(黑名单);1(白名单) |
referer_control.list | list | referer列表 | 否 | 当referer_control.switch = on 时必填 |
https_switch | int | 开关 | 否 | 取值:0:关,1:开; |
cert_name | str | 证书名 | 否 | 仅https_switch为1时生效 |
场景3:拉流域名配置修改(拉流回源场景)
参数 | 类型 | 名称 | 是否必填 | 说明 |
---|---|---|---|---|
product_code | string | 产品类型 | 是 | "005":视频直播,创建后不可修改 |
domain | list | 拉流域名列表 | 是 | 单次调用域名个数最多不超过20个 |
rtmp_origin | list | rtmp协议回源参数 | 否 | rtmp_origin,flv_origin,flv_https_origin,hls_http_origin,hls_https_origin为回源功能组 若不修改,则5个参数都不传值;若修改,则5个参数一同修改,修改时这5个参数必填其中一个,可多个。 |
rtmp_origin[*].origin | string | 协议地址 | 是 | 当rtmp_origin有值时,该字段必填,支持ipv4、ipv6、域名 |
flv_origin | list | flv协议http回源参数 | 否 | rtmp_origin,flv_origin,flv_https_origin,hls_http_origin,hls_https_origin为回源功能组 若不修改,则5个参数都不传值;若修改,则5个参数一同修改,修改时这5个参数必填其中一个,可多个。 |
flv_origin[*].origin | string | 协议地址 | 是 | 当flv_origin有值时,必填 支持ipv4、ipv6、域名 |
flv_https_origin | list | flv协议https回源参数 | 否 | rtmp_origin,flv_origin,flv_https_origin,hls_http_origin,hls_https_origin为回源功能组 若不修改,则5个参数都不传值;若修改,则5个参数一同修改,修改时这5个参数必填其中一个,可多个。 |
flv_https_origin*].origin | str | flv协议地址 | 是 | 当flv_https_origin有值时,该字段必填,支持ipv4、ipv6、域名 |
hls_http_origin | list | hls协议回源参数 | 否 | rtmp_origin,flv_origin,flv_https_origin,hls_http_origin,hls_https_origin为回源功能组 若不修改,则5个参数都不传值;若修改,则5个参数一同修改,修改时这5个参数必填其中一个,可多个。 |
hls_http_origin[*].origin | string | 源站 | 是 | 当hls_http_origin有值时,该字段必填,支持ipv4、ipv6、域名 |
hls_https_origin | list | hls协议回源参数 | 否 | rtmp_origin,flv_origin,flv_https_origin,hls_http_origin,hls_https_origin为回源功能组 若不修改,则5个参数都不传值;若修改,则5个参数一同修改,修改时这5个参数必填其中一个,可多个。 |
hls_https_origin*].origin | str | 源站 | 是 | 当hls_https_origin有值时,必填 支持ipv4、ipv6、域名 |
distribution_protocol | string | 播放协议 | 否 | flv,rtmp,hls, 多个以逗号间隔 |
ip_access_control | obj | ip黑白名单 | 否 | 未传代表不修改,有传代表整个obj全量修改 包括:开关、ip列表、黑白名单类型 |
ip_access_control.switch | string | 开关 | 是 | 取值:on(开启);off(关闭) |
ip_access_control.type | int | 黑白名单类型 | 否 | 当ip_access_control.switch = on 时,必填 取值:0(黑名单);1(白名单) |
ip_access_control.list | list | ip列表 | 否 | 当ip_access_control.switch = on 时,必填 支持ipv4、ipv6 |
referer_control | obj | 防盗链 | 否 | 未传代表不修改,有传代表整个obj全量修改 包括:开关、是否允许空referer访问、黑白名单类型、referer列表 |
referer_control.switch | string | 开关 | 是 | 取值:on(开启A)、off(关闭) |
referer_control.allow_empty | string | 是否允许空referer访问 | 否 | 当referer_control.switch = on 时,必填 取值:on(开启), off(关闭) |
referer_control.type | int | 类型 | 否 | 当referer_control.switch = on 时,必填 取值:0(黑名单);1(白名单) |
referer_control.list | list | referer列表 | 否 | 当referer_control.switch = on 时,必填 |
https_switch | int | 开关 | 否 | 取值:0:关,1:开; |
cert_name | str | 证书名 | 否 | 仅https_switch为1时生效 |
响应参数
参数 | 类型 | 说明 |
---|---|---|
code | int | 状态码,成功100000 |
message | string | 描述信息,成功返回success,其他返回异常信息描述 |
示例
请求路径:https://cdnapi-global.ctapi.ctyun.cn/live/domain/batch-update-configuration-information
请求示例
场景1:更新推流域名配置
{
"product_code": "005",
"domain": [
"ctyun.cn",
"ctyun.cn1",
"ctyun.cn2"
],
"ip_access_control": {
"switch": "on",
"list": [
"1.2.3.4",
"5.6.7.8"
],
"type": 1
},
"self_notice": {
"switch": "on",
"notify_address": "1.1.1.1",
"notify_host": "2.2.2.2",
"notify_port": 81,
"notify_start_url_path": "/pushStart",
"notify_stop_url_path": "/pushStop"
},
"time_shift": {
"switch": "on",
"max_playback_time": "32s",
"module_id": "d6aaaa5"
},
"third_push": {
"switch": "on",
"push_list": [
{
"origin": "1.1.1.1",
"host": "ctyun.cn3",
"port": "1935"
}
]
}
}
场景2:拉流域名配置修改(推拉流场景)
{
"product_code": "005",
"domain": [
"ctyun.cn",
"ctyun.cn1",
"ctyun.cn2"
],
"ip_access_control": {
"switch": "on",
"list": [
"1.2.3.4",
"5.6.7.8"
],
"type": 1
},
"referer_control": {
"switch": "on",
"list": [
"1.2.3.4",
"5.6.7.8"
],
"type": 1,
"allow_empty": "on"
},
"https_switch": 1,
"cert_name": "test0308"
}
场景3:拉流域名配置修改(回源拉流场景)
{
"product_code": "005",
"domain": [
"ctyun.cn",
"ctyun.cn1",
"ctyun.cn2"
],
"ip_access_control": {
"switch": "on",
"list": [
"1.2.3.4",
"5.6.7.8"
],
"type": 1
},
"referer_control": {
"switch": "on",
"list": [
"1.2.3.4",
"5.6.7.8"
],
"type": 1,
"allow_empty": "on"
},
"https_switch": 1,
"cert_name": "test0308"
}
正常响应示例
{
"code": 100000,
"message": "success",
"success_number": 3,
"domain_details": [
{
"code": 100000,
"message": "success",
"domain": "ctyun.cn"
},
{
"code": 100000,
"message": "success",
"domain": "ctyun.cn1"
},
{
"code": 100000,
"message": "success",
"domain": "ctyun.cn2"
}
]
}