CDN Pro
获取已部署到演练或生产环境的加速项目对应的加速域名列表。
Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试
参数名称 | 类型 | 必填 | 描述 |
---|---|---|---|
offset | Integer | 否 | 默认值: 0 取值范围:>= 0 查询起始位置。 |
limit | Integer | 否 | 默认值: 100 取值范围:<= 200 每次查询的最大条数。 |
target | String | 否 | 取值范围: all, staging, production 默认值: all 根据部署环境来查询加速域名。默认情况下,查询部署到演练和生产环境下的所有域名。 |
参数名称 | 类型 | 描述 |
---|---|---|
hostnames | List | 加速域名列表。 |
hostname | String | 加速域名。 |
propertyInProduction | String | 如果加速域名对应的加速项目已部署到生产环境,则该字段返回该加速项目的相关信息。如果加速项目未部署到生产环境,则该字段返回'null'。 |
propertyInStaging | String | 如果加速域名对应的加速项目已部署到演练环境,则该字段返回该加速项目的相关信息。如果加速项目未部署到演练环境,则该字段返回'null'。 |
count | Integer | 取值范围: >= 0 加速域名总数。 |
错误代码(code) | 描述(message) | HTTP状态码 | 语义 |
---|---|---|---|
InvalidListLimit | The value of limit should be between 1 and 200, inclusive. | 400 | limit参数取值必须在1-200之间。 |
InvalidListOffset | The offset must be a valid non-negative integer. | 400 | offset参数取值必须是>=0的整数。 |
InvalidTarget | Invalid target query parameter. Only 'all', 'staging', or 'production' are allowed. | 400 | target参数取值无效。必须是'all', 'staging' 或 'production'。 |
#!/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/cdn/hostnames" \ -X "GET" \ -u "$username:$password" \ -H "Date: $date" \ -H "Accept: application/json"
{ "count": 2, "hostnames": [ { "hostname": "domain.com", "propertyInProduction": null, "propertyInStaging": { "propertyId": "5cada91cd9dd84000130da50", "version": 2 } }, { "hostname": "abc.domain.com", "propertyInProduction": { "propertyId": "5cb667af05208e0001394be4", "version": 1 }, "propertyInStaging": { "propertyId": "5cf05122fbe79a0001bcf01f", "version": 1 } } ] }