流媒体直播

启用单加速域名

更新时间:2025-07-02 17:07:46

启用某个状态为“禁用”的加速域名,使用已有的配置提供加速服务。

  • 限制说明:·启用加速域名后,域名的enabled状态变更为true。 ·域名对应的服务单状态如果不正确,或域名处于非法状态,无法正常调用该接口启用加速域名。
  • 单用户调用频率:300/5min
  • 适用产品:应用性能管理、静态加速、动态加速、流媒体直播、流媒体点播、互动直播、Flood Shield、Flood Shield 2.0
API鉴权说明详见:API鉴权概览

请求参数

Path 参数

参数名称描述
*domainInteger
加速域名或域名ID

返回参数

Body 参数

参数名称描述
codeString
错误代码,当HTTPStatus不为202时出现,表示当前请求调用的错误类型
messageString
响应信息,成功时为success
httpStatusInteger
httpstatus=202;   表示成功调用新增域名接口,可使用header中的x-cnc-request-id查看当前新增域名的部署情况
x-cnc-request-idString
唯一标示的id,用于查询每次请求的任务 (适用全部接口)

错误码

错误代码(code)描述(message)HTTP状态码语义
NoSuchDomainThe specified domain name does not exist.400指定的域名不存在
ForbiddenDomain name has been deleted403域名已被删除
DomainNotDisabledThe domain name is enabled and cannot be enabled again.409域名已启用,不能再次启用。
DomainCanNotEnableDomain name cannot be enabled409域名不能启用
WRONG_OPERATORThe author cannot operate the domain name400提交人不能操作域名
NULL_DOMAIN_NAMENo domain name400没有域名
PARAM_INVALIDParameter {0} null or illegal400参数{0}为空或非法
CustomerNoOwnDomaincustomer not own domain name[{0}]400域名不属于该客户
InvalidParameterNo domain was specified.400当id或者域名没有传入的时候
DOMAIN_EXCEEDS_ENABLE_VALIDITY_PERIODThe domain has been disabled for a long time, and the historical configuration may not work. To avoid the risk, please delete the domain first, then recreate a new one. Domain Names:{0}400域名禁用时间过长(超过3个月),为避免重启域名后原配置不生效,请删除该域名后重新新增域名并进行相关配置

示例

JSON
XML
JSON
请求示例
复制代码 复制成功
#!/bin/bash
username="example_username"
apiKey="example_apiKey"
date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"`
password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64`
curl -i --url "https://api.cdnetworks.com/api/domain/123344/enable" \
-X "PUT" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json"
返回示例
复制代码 复制成功
HTTP/1.1 202 Accepted
Date: Fri, 17 May 2017 06:33:26 GMT
Content-Type: application/json;charset=utf-8
x-cnc-request-id:c54cbbb4-19fe-407a-930c-3988b62ed2fd
 {"message":"success"}
本篇文档内容对您是否有帮助?
有帮助
我要反馈
提交成功!非常感谢您的反馈,我们会继续努力做到更好!