网页加速、下载分发、全站加速、应用安全加速解决方案、IPv6一体化解决方案、电商安全加速解决方案、金融安全加速解决方案、政企安全加速解决方案、应用安全解决方案、区块链安全加速解决方案、IPv6安全加速解决方案、点播分发、直播分发、移动加速
通过接口自助修改高级源配置。允许客户指定区域配置,不同的IP回源,以及多源时候,可以指定策略回源。接口url的*可为域名名称或域名id。
单用户调用频率:300/5min
参数名称 | 类型 | 必填 | 描述 |
---|---|---|---|
origin-ip | String | 否 | 回源地址,可以是IP或域名。 1、IP以分号分隔,支持多个。 2、域名只能输入一个。IP与域名不能同时输入。 3、限制最大不能超过500个字符长度。 |
src-port | Int | 否 | 回源请求端口 |
use-advanced-sources | String | 否 | 是否开启高级源配置,此项必填。 true:开启 false:不开启 如果要清空配置可以传入false. |
detection-port | Int | 否 | 高级源探测端口,开启高级源时(use-advanced-sources=true)才可配置 |
advanced-sources | complex | 否 | 高级源配置标签 注意:表示需要设置高级源配置时,此项必填 |
advanced-source | complex | 否 | 高级源配置,表示一条高级源。客户可以配置多条高级源内容。 |
advanced-source-strategies | complex | 否 | 高级源扩展配置,可以指定一条高级源配置下多个IP时,访问策略。支持多个, |
advanced-source-strategy | string | 否 | 高级源扩展配置,可以指定一条高级源配置下多个IP时一种访问策略,多种策略可以多个参数 使用前需要与技术支持同事确认可选入参 port:用请求端口回源 primary:主源轮询 standby:备源轮询 |
areas | complex | 否 | 需要设置高级源的区域。输入值为区域对应的英文值。一定要有一条全球区域的配置,全球输入Global。如果有 |
area | string | 否 | 一组区域配置,如果有多个则,参数多个。 |
adv-ips | string | 否 | 一个区域下配置回源IP信息,如果一个区域有多个IP则有多组 |
adv-ip | String | 否 | 一组IP信息 |
ip | String | 否 | 回源IP。支持IP或域名;如果是IP支持IPV4和IPv6,值只能一个 |
priority | int | 否 | 层级。指定这个回源IP的层级,不输入默认一层 |
weight | int | 否 | 权重。指定这个回源IP的权重,不输入默认10 |
source-host | string | 否 | 回源host,支持ip和域名,值只支持一个(动态源不支持) (动态源不支持,必须设置use-dynamic-sources=false) |
authorization-method | string | 否 | 鉴权方式,可选值OSS、TOS、Amazon S3 (动态源不支持,必须设置use-dynamic-sources=false) |
use-dynamic-sources | String | 否 | 开启动态源,部分配置项不支持动态源 true:开启 false:不开启 清空:网页加速、全站加速默认为开启;其他服务默认为关闭 |
default-source-host | String | 否 | 回源请求HOST |
参数名称 | 类型 | 描述 |
---|---|---|
http status code | int | httpstatus=202; 表示成功调用新增域名接口,可使用header中的x-cnc-request-id查看当前新增域名的部署情况 |
x-cnc-request-id | String | 唯一标示的id,用于查询每次请求的任务 (适用全部接口) |
Location | String | 用于访问该域名信息的URL,其中domain-id为该域名生成的唯一标示,其值为字符串。 |
code | String | 错误代码,当HTTPStatus不为202时出现,表示当前请求调用的错误类型 |
message | String | 响应信息,成功时为success |
错误代码(code) | 描述(message) | HTTP状态码 | 语义 |
---|---|---|---|
InvalidParameter | The value of use-advanced-sources must be true or false. | 400 | use-advanced-sources不合法 |
InvalidParameter | The strategy is invalid. | 400 | 高级源扩展配置不合法 |
InvalidParameter | The area is invalid. | 400 | area不合法 |
NoSuchOperator | The specified operator does not exist. | 404 | 操作者不存在 |
NoSuchCustomer | The specified customer name does not exist. | 404 | 客户名对应客户不存在 |
NoSuchCustomer | The specified customer id does not exist. | 404 | 客户id对应客户不存在 |
NoSuchRequestID | The specified request id does not exist. | 404 | 请求id为空 |
DuplicatedRequestID | The specified request id already exist. | 400 | 请求id重复 |
NoSpecifiedDomain | You must specified domain. | 400 | 请求的域名为空 |
NoSuchDomain | The specified domain does not exist. | 404 | 域名不属于当前客户 |
DomainNotRestored | The domain you are trying to cancel has not been restored. | 409 | 域名已取消加速需要重新启用 |
InternalError | We encountered an internal error. Please try again. | 500 | 调用UAC接口异常 |
DuplicatedDomainName | The specified domain name must be unique. | 400 | 传入的域名重复 |
InvalidParameter | Domain attribute Origin ip config err. | 400 | 源ip与加速域名不能一致 |
InvalidParameter | Domain attribute Origin ip config err. | 400 | 无效的源ip |
InvalidParameter | Domain attribute Origin ip config err. | 400 | 源ip重复 |
ConfigError | The config advSrc does not access. | 400 | 高级源属性未规划 |
InvalidParameter | Domain attribute Origin ip config err. | 403 | 源ip不可修改 |
ConfigVersionOutOfDate | The specified version is out of date. | 409 | 域名指定版本不是最新版本 |
Forbidden | The domain is being deleted | 403 | 域名挂起中 |
InvalidParameter | The specified use-advanced-sources is invalid. | 400 | 是否开启高级源配置值不合法 |
InvalidParameter | The specified use-dynamic-sources is invalid. | 400 | 是否开启高级源配置值不合法 |
Forbidden | Disallow to change adv advanced-sources before authorization. | 403 | 动态源配置未规划无法修改 |
InvalidParameter | The specified advanced-sources is empty. | 400 | 高级源至少需要一条配置 |
InternalError | We encountered an internal error. Please try again. | 500 | 数据库中不存在全球节点 |
InvalidParameter | The specified areas is empty | 400 | 区域不可为空 |
DuplicatedArea | The specified area must be unique. | 400 | 指定的区域不可重复 |
InvalidParameter | The specified strategy is invalid. | 400 | 高级源扩展配置不合法 |
InvalidParameter | The specified config adv-ips must not empty . | 400 | 区域下配置回源IP信息为空 |
InvalidParameter | The specified ip is empty. | 400 | ip值为空 |
InvalidParameter | The specified ip is invalid. | 400 | ip值不合法 |
DuplicatedIp | The specified ip already exist in advanced-source config. | 400 | 一条高级源配置中ip不可重复 |
InvalidParameter | The priority must in [1,5]. | 400 | 层级的有效值为1到5 |
InvalidParameter | The weight must in [1,99999]. | 400 | 权重的有效值为1到99999 |
RequiredPriorityValueOne | Must contain a priority config value is 1. | 400 | 至少有一条层级为1的配置 |
InvalidParameter | The area is invalid. | 400 | 指定的区域不存在 |
RequiredGlobalArea | Must contain a area config value is Global. | 400 | 至少需要一条全球的配置 |
InternalError | We encountered an internal error. Please try again. | 500 | 系统内部异常 |
InvalidParameter | The specified source-host was invalid. | 400 | source-host的格式错误 ,约束ip(ipv4/ipv6)和域名格式,只输入一个 |
InvalidParameter | The specified authorization-method was invalid. | 400 | authorizationMethod 参数错误,不在字典advSrcAuthorizationMethod配置的扩展值范围内 |
InvalidParameter | The specified default-source-host was invalid. | 400 | default-source-host的格式错误 ,约束ip(ipv4/ipv6)和域名格式,只输入一个 |
#!/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/basicconfig/advancedsource/123344" \ -X "PUT" \ -u "$username:$password" \ -H "Date: $date" \ -H "Accept: application/json" \ -H "Content-Type:application/json" \ -d ' { "origin-ip":"127.0.1.1;127.0.2.1;127.0.4.1;127.0.5.1", "default-source-host":"1.1.1.1", "src-port":"80", "use-advanced-sources":"true", "use-dynamic-sources":"true", "advanced-sources":[ { "advanced-source-strategies":[ "primary", "standby" ], "areas":[ "Global", "Japan" ], "adv-ips":[ { "ip":"127.0.1.1", "priority":"1", "weight":"10" }, { "ip":"127.0.2.1", "priority":"2", "weight":"9" } ] }, { "advanced-source-strategies":[ "standby" ], "areas":[ "China" ], "adv-ips":[ { "ip":"127.0.4.1", "priority":"1", "weight":"10" }, { "ip":"127.0.5.1", "priority":"2", "weight":"9" } ] } ] }'
HTTP/1.1 202 Accepted Server: openresty/1.11.2.2 Date: Fri, 24 May 2019 06:08:47 GMT Content-Type: application/json;charset=utf-8 Content-Length: 31 Connection: keep-alive App-Name: service_confApi x-cnc-request-id: 01f0d3ac-d326-44d3 {"message":"success","code":""}