查看高级源配置接口

更新时间:2023-12-15 10:32:58

适用产品

应用安全加速解决方案、IPv6一体化解决方案、电商安全加速解决方案、金融安全加速解决方案、政企安全加速解决方案、应用安全解决方案、区块链安全加速解决方案、IPv6安全加速解决方案、点播分发、直播分发、移动加速、网页加速、下载分发、全站加速

接口描述

通过接口查询客户高级源配置

  • 调用URL: https://open.chinanetcenter.com/api/basicconfig/advancedsource/*
  • 调用方法:GET
  • 限制说明:1)加速域名必须已备案完成。 2)加速域名必须不包含如下信息: a)出售药物和管制刀具类,含有不法言论、信息。 b)视频类加速域名必须有视听许可证;博客论坛或社区类加速域名必须有BBS专项审批资质。 c)接口请求和返回结果接受xml和json格式。

调用频率

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

请求参数

Body 参数

XML
参数名称描述
domain-name/domain-idString
需要查询配置的域名或域名id

返回参数

Body 参数

XML&JSON
参数名称描述
origin-ipString
回源地址,可以是IP或域名。 1、IP以分号分隔,支持多个。 2、域名只能输入一个。IP与域名不能同时输入。 3、限制最大不能超过500个字符长度。
plan-advanced-sourcesString
域名是否有规划高级源配置 true:表示域名有规划高级源配置 false:表示域名无高级源配置规划
use-advanced-sourcesString
是否开启高级源配置,此项必填。 true:开启 false:不开启 如果要清空配置可以传入false.
advanced-sourcescomplex
高级源配置标签 注意:表示需要设置高级源配置时,此项必填
advanced-sourcecomplex
高级源配置,表示一条高级源。客户可以配置多条高级源内容。
advanced-source-strategiescomplex
高级源扩展配置,可以指定一条高级源配置下多个IP时,访问策略。支持多个,
advanced-source-strategystring
高级源扩展配置,可以指定一条高级源配置下多个IP时一种访问策略,多种策略可以多个参数 port:用请求端口回源 primary:主源轮询(需要与技术支持同事确认) standby:备源轮询(需要与技术支持同事确认)
areascomplex
设置高级源的区域。
areastring
一组区域配置,如果有多个则,参数多个。
adv-ipsstring
一个区域下配置回源IP信息,如果一个区域有多个IP则有多组
adv-ipString
一组IP信息
ipString
回源IP。支持IP或域名;如果是IP支持IPV4和IPv6,值只能一个
priorityint
层级。指定这个回源IP的层级,不输入默认一层
weightint
权重。指定这个回源IP的权重,不输入默认10
source-hoststring
回源host,支持ip和域名,值只支持一个(动态源不支持)
authorization-methodstring
鉴权方式,可选值OSS、TOS、Amazon S3
use-dynamic-sourcesString
是否开启动态源 true:开启 false:不开启 清空:网页加速、全站加速默认为开启;其他服务默认为关闭
default-source-hostString
回源请求Host
src-portString
回源请求端口

错误码

错误代码(code)描述(message)HTTP状态码语义
NoSuchOperatorThe specified operator does not exist.404操作者不存在
NoSuchCustomerThe specified customer name does not exist.404客户名对应客户不存在
NoSuchCustomerThe specified customer id does not exist.404客户id对应客户不存在
NoSuchRequestIDThe specified request id does not exist.404请求id为空
DuplicatedRequestIDThe specified request id already exist.400请求id重复
NoSpecifiedDomainYou must specified domain.400请求的域名为空
NoSuchDomainThe specified domain does not exist.404域名不属于当前客户
DomainNotRestoredThe domain you are trying to cancel has not been restored.409域名已取消加速需要重新启用

示例

JSON
XML
JSON2
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://open.chinanetcenter.com/api/basicconfig/advancedsource/a1.example.com" \
-X "GET" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json" \
-H "Content-Type:application/json"
返回示例
复制代码 复制成功
HTTP/1.1 200 OK
Server: openresty/1.11.2.2
Date: Fri, 24 May 2019 06:32:39 GMT
Content-Type: application/json;charset=utf-8
Content-Length: 488
Connection: keep-alive
App-Name: service_confApi
x-cnc-request-id: e189da67-333d-4795
{
    "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",
    "plan-advanced-sources":true,
    "use-advanced-sources":true,
    "use-dynamic-sources":"false",
    "advanced-sources":[
        {
            "advanced-source-strategies":[
                "primary",
                "standby"
            ],
            "areas":[
                "Global",
                "Japan"
            ],
            "adv-ips":[
                {
                    "ip":"127.0.1.1",
                    "priority":"1",
                    "weight":"10",
                    "source-host": "sourcehost1.example.com"
                },
                {
                    "ip":"127.0.2.1",
                    "priority":"2",
                    "weight":"9",
                    "source-host": "sourcehost2.example.com"
                }
            ]
        },
        {
            "advanced-source-strategies":[
                "standby"
            ],
            "areas":[
                "China"
            ],
            "adv-ips":[
                {
                    "ip":"127.0.5.1",
                    "priority":"2",
                    "weight":"9",
                    "source-host": "sourcehost1.example.com"
                },
                {
                    "ip":"127.0.4.1",
                    "priority":"1",
                    "weight":"10",
                    "source-host": "sourcehost2.example.com"
                }
            ]
        }
    ]
}
本篇文档内容对您是否有帮助?
有帮助
我要反馈
提交成功!非常感谢您的反馈,我们会继续努力做到更好!