查询已部署加速域名列表

更新时间:2023-04-04 20:26:59

适用产品

CDN Pro

接口描述

获取已部署到演练或生产环境的加速项目对应的加速域名列表。

推荐使用 Open API在线调试

Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试

请求参数

Params 参数

参数名称描述
offsetInteger
默认值: 0 取值范围:>= 0 查询起始位置。
limitInteger
默认值: 100 取值范围:<= 200 每次查询的最大条数。
targetString
取值范围: all, staging, production 默认值: all 根据部署环境来查询加速域名。默认情况下,查询部署到演练和生产环境下的所有域名。

返回参数

Body 参数

参数名称描述
hostnamesList
加速域名列表。
hostnameString
加速域名。
propertyInProductionString
如果加速域名对应的加速项目已部署到生产环境,则该字段返回该加速项目的相关信息。如果加速项目未部署到生产环境,则该字段返回'null'。
propertyInStagingString
如果加速域名对应的加速项目已部署到演练环境,则该字段返回该加速项目的相关信息。如果加速项目未部署到演练环境,则该字段返回'null'。
countInteger
取值范围: >= 0 加速域名总数。

错误码

错误代码(code)描述(message)HTTP状态码语义
InvalidListLimitThe value of limit should be between 1 and 200, inclusive.400limit参数取值必须在1-200之间。
InvalidListOffsetThe offset must be a valid non-negative integer.400offset参数取值必须是>=0的整数。
InvalidTargetInvalid target query parameter. Only 'all', 'staging', or 'production' are allowed.400target参数取值无效。必须是'all', 'staging' 或 'production'。

示例

200
400
200
请求示例
复制代码 复制成功
#!/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
            }
        }
    ]
}
本篇文档内容对您是否有帮助?
有帮助
我要反馈
提交成功!非常感谢您的反馈,我们会继续努力做到更好!