获取日志配置列表

更新时间:2023-04-04 20:34:01

适用产品

CDN Pro

接口描述

获取已创建的日志配置列表。

推荐使用 Open API在线调试

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

请求参数

Params 参数

参数名称描述
searchString
根据域名查询相关的日志配置。
offsetInteger
默认值: 0 取值范围: >= 0 查询起始位置。
limitInteger
默认值: 100 取值范围: <= 200 每次查询的最大条数。

返回参数

Body 参数

参数名称描述
logConfigsList
日志配置列表。
logConfigIdInteger
日志配置唯一标识ID。可用该ID查询,更新或删除日志配置。
hostnamesList
适用该日志配置的域名列表。每个域名必须是完整的FQDN域名如domain.com,或者是带星号的泛域名如*.domain.com。如果该日志配置适用于所有域名,则直接用星号*表示。
descriptionString
日志配置描述信息。
lastUpdateTimeString
日志配置最近一次更新时间,以RFC 3339日期格式展示。
creationTimeString
日志配置创建时间,以RFC 3339日期格式展示。
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或者正整数。

示例

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/report/logConfigs" \
-X "GET" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept: application/json"
返回示例
复制代码 复制成功
{
    "logConfigs": [
        {
            "logConfigId": 1,
            "hostnames": [
                "domain1.com"
            ],
            "description": "Special log configuration",
            "creationTime": "2021-12-14T22:48:08Z",
            "lastUpdateTime": "2021-12-14T22:48:08Z"
        },
        {
            "logConfigId": 2,
            "hostnames": [
                "domain2.com",
                "domain3.com"
            ],
            "description": "another log configuration",
            "creationTime": "2021-12-13T12:48:08Z",
            "lastUpdateTime": "2021-13-15T22:48:08Z"
        }
    ],
    "count": 2
}
本篇文档内容对您是否有帮助?
有帮助
我要反馈
提交成功!非常感谢您的反馈,我们会继续努力做到更好!