启用某个状态为“禁用”的加速域名,使用已有的配置提供加速服务。
参数名称 | 描述 |
---|---|
*domainIdInteger | 加速域名在系统中对应的ID
注意:
1. 参看请求示例中的url,123344对应的就是domain-id
2. 可以通过【获取域名配置】和【获取域名列表】接口查询到domain-id |
参数名称 | 描述 |
---|---|
code | 错误代码,当HTTPStatus不为202时出现,表示当前请求调用的错误类型 |
message | 响应信息,成功时为success |
http status code | httpstatus=202; 表示成功调用新增域名接口,可使用header中的x-cnc-request-id查看当前新增域名的部署情况 |
x-cnc-request-id | 唯一标示的id,用于查询每次请求的任务 (适用全部接口) |
错误代码(code) | 描述(message) | HTTP状态码 | 语义 |
---|---|---|---|
NoSuchDomain | The specified domain does not exist. | 400 | 指定的域名不存在 |
Forbidden | The domain is being deleted | 403 | 域名已被删除 |
DomainNotDisabled | The domain you are trying to enable has not been disabled. | 409 | 域名已启用,不能再次启用。 |
DomainCanNotEnable | Domain cannot enable. | 409 | 域名不能启用 |
WRONG_OPERATOR | Operator [$operator] can not deal with domain name [$domainName]. | 400 | 提交人不能操作域名 |
NULL_DOMAIN_NAME | No domain. | 400 | 没有域名 |
PARAM_INVALID | param: {0} is null or invalid. | 400 | 参数{0}为空或非法 |
CustomerNoOwnDomain | customer not own domain name[{0}] | 400 | 域名不属于该客户 |
InvalidParameter | No domain was specified. | 400 | 当id或者域名没有传入的时候 |
DOMAIN_EXCEEDS_ENABLE_VALIDITY_PERIOD | The domain has been disabled for a long time(more than 3 months), 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个月),为避免重启域名后原配置不生效,请删除该域名后重新新增域名并进行相关配置 |
#!/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"}