文档中心 API文档 启用多加速域名 

启用多加速域名 

更新时间:2023-08-09 15:47:56

适用产品

网页加速、下载分发、动态加速、全站加速、点播分发、直播分发、上传加速、移动加速、上网加速、S-P2P、PCDN、应用性能管理、WEB应用防火墙、BotGuard爬虫管理、WSS、DMS、DDoS云清洗、应用加速、应用安全加速解决方案、IPv6一体化解决方案、电商安全加速解决方案、金融安全加速解决方案、政企安全加速解决方案、应用安全解决方案、区块链安全加速解决方案、IPv6安全加速解决方案

接口描述

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

  • 调用URL: https://open.chinanetcenter.com/api/domain/enable
  • 调用方法:POST
  • 限制说明:·启用加速域名后,域名的enabled状态变更为true。 ·域名对应的服务单状态如果不正确,或域名处于非法状态,无法正常调用该接口启用加速域名。

调用频率

单用户调用频率:300/5min

请求参数

Body 参数

XML
参数名称类型必填描述
domain-list
complex指定启用加速服务的域名列表
domain-name
String加速域名名称,每次启用的域名总数上限为20个,多个域名以逗号分隔

返回参数

Body 参数

XML
参数名称类型描述
http status code
inthttpstatus=202;   表示成功调用接口
x-cnc-request-id
String唯一标示的id,用于查询每次请求的任务 (适用全部接口)
code
String错误代码,当HTTPStatus不为202时出现,表示当前请求调用的错误类型
message
String响应信息,成功时为success

错误码

错误代码(code)描述(message)HTTP状态码语义
DomainNameIsRequiredThe domain name is required.400域名是必须的
WRONG_OPERATORWrong operator [$operator] for the customer.400提交人不对应客户
NoSuchDomainWrong domain id [null].400指定的域名不存在
DOMAIN_EXCEEDS_ENABLE_VALIDITY_PERIODThe 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个月),为避免重启域名后原配置不生效,请删除该域名后重新新增域名并进行相关配置
DomainsExcessiveThe number of domain is excessive once.403域名数量过多
ForbiddenThe domain is being deleted403域名被删除
DomainNotDisabledThe domain you are trying to enable has not been disabled.409您想启用的域名还未被禁用加速服务
InternalErrorWe encountered an internal error. Please try again.500服务器异常,数据获取失败等内部错误

示例

XML
XML
请求示例
复制代码 复制成功
#!/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://open.chinanetcenter.com/api/domain/enable" \
-X "POST" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/xml" \
-d '<?xml version="1.0" encoding="utf-8"?>
<domain-list>
  <domain-name>a1.example1.com</domain-name>
  <domain-name>a2.example2.com</domain-name>
  <domain-name>b1.example1.com</domain-name>
  <domain-name>b2.example2.com</domain-name>
</domain-list>'
返回示例
复制代码 复制成功
HTTP/1.1 202 OK
Date: Fri, 17 May 2017 06:33:26 GMT
Content-Type: application/xml;charset=utf-8
x-cnc-request-id:c54cbbb4-19fe-407a-930c-3988b62ed2fd
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <message>success</message>
</response>
本篇文档内容对您是否有帮助?
有帮助
我要反馈
提交成功!非常感谢您的反馈,我们会继续努力做到更好!