Files
notes/work/移动杭研/业务梳理/HCDN/HCDN 接口文档(初稿).md
T
2026-03-01 01:43:46 +08:00

18 KiB
Raw Blame History

在线地址:toB命中率及穿透率统计分析 (qq.com)

1 查询命中率

接口地址 /pdga/toB/hit-rate/query

请求方式 POST

请求格式 application/json


请求参数

参数名 类型 是否必填 描述
startTime String 查询的开始时间,格式为 yyyy-MM-dd HH:mm:ss
endTime String 查询的结束时间,格式为 yyyy-MM-dd HH:mm:ss
granularity String 时间粒度,枚举值:5m5 分钟),1h(小时),1d(天)
domain String 加速域名
protocolType String 协议类型,枚举值:HTTPHTTPS

请求示例

{
    "startTime": "2024-08-14 00:00:00",
    "endTime": "2024-08-14 23:00:00",
    "granularity": "5m",
    "domain": "example.com",
    "protocolType": "HTTPS"
}

响应参数

参数名 类型 描述
status String 请求的结果状态,success 表示成功,error 表示失败
errCode Integer 错误码,0 表示成功,其他值表示错误(具体错误码见错误码表)
message String 详细描述请求结果的信息,通常用于错误时说明原因
maxTime String 返回命中率最高时刻的时间,格式为 yyyy-MM-dd HH:mm:ss
maxHitRate Double 返回的最大命中率值,四舍五入两位小数(单位:%)
hitRateList Array 时间区间内的命中率列表,包含时间点及对应的命中率值

hitRateList 字段详情

参数名 类型 描述
time String 对应的时间点,格式为 yyyy-MM-dd HH:mm:ss
value Double 对应时间点的命中率值,四舍五入两位小数(单位:%)

响应示例

{
    "status": "success",
    "errCode": 0,
    "message": "请求成功。",
    "maxTime": "2024-08-14 12:00:00",
    "maxHitRate": 69.76,
    "hitRateList": [
        {
            "time": "2024-08-14 12:00:00",
            "value": 69.76
        },
        {
            "time": "2024-08-14 12:05:00",
            "value": 69.76
        },
        {
            "time": "2024-08-14 12:10:00",
            "value": 69.64
        },
        {
            "time": "2024-08-14 12:15:00",
            "value": 69.53
        },
        {
            "time": "2024-08-14 12:20:00",
            "value": 69.41
        },
        {
            "time": "2024-08-14 12:25:00",
            "value": 69.3
        },
        {
            "time": "2024-08-14 12:30:00",
            "value": 69.19
        },
        {
            "time": "2024-08-14 12:35:00",
            "value": 69.08
        },
        {
            "time": "2024-08-14 12:40:00",
            "value": 68.97
        },
        {
            "time": "2024-08-14 12:45:00",
            "value": 68.86
        },
        {
            "time": "2024-08-14 12:50:00",
            "value": 68.75
        },
        {
            "time": "2024-08-14 12:55:00",
            "value": 68.64
        }
    ]
}

说明

  • startTimeendTime 必须指定,且 endTime 必须晚于 startTime
  • granularity 决定了返回的时间间隔数据,分别为 5 分钟、1 小时或 1 天的命中率数据。
  • domain 为选填项,查询指定域名的命中率。
  • 响应中的 maxHitRate 为时间区间内的最大命中率,maxTime 为其对应的时间点。
  • status 字段用于快速标识请求的整体结果,而 message 字段提供详细说明。

2 查询调度次数

接口地址 /pdga/toB/scheduling-count/query

请求方式 POST

请求格式 application/json


请求参数

参数名 类型 是否必填 描述
startTime String 查询的开始时间,格式为 yyyy-MM-dd HH:mm:ss
endTime String 查询的结束时间,格式为 yyyy-MM-dd HH:mm:ss
granularity String 时间粒度,枚举值:5m5 分钟),1h(小时),1d(天)
domain String 加速域名
protocolType String 协议类型,枚举值:HTTPHTTPS

请求示例

{
    "startTime": "2024-08-14 00:00:00",
    "endTime": "2024-08-14 23:00:00",
    "granularity": "5m",
    "domain": "example.com",
    "protocolType": "HTTPS"
}

响应参数

参数名 类型 描述
status String 请求的结果状态,success 表示成功,error 表示失败
errCode Integer 错误码,0 表示成功,其他值表示错误(具体错误码见错误码表)
message String 详细描述请求结果的信息,通常用于错误时说明原因
peakTime String 返回调度次数峰值时刻的时间,格式为 yyyy-MM-dd HH:mm:ss
peakTotalCount Long 返回的峰值调度次数
peakHitCount Long 返回的峰值命中次数
peakBackCount Long 返回的峰值回源次数
countList Array 时间区间内的调度次数列表,包含时间点及对应的调度次数、命中次数、回源次数

countList 字段详情

参数名 类型 描述
time String 对应的时间点,格式为 yyyy-MM-dd HH:mm:ss
total Long 对应时间点的总调度次数
hit Long 对应时间点的命中次数
back Long 对应时间点的回源次数

响应示例

{
    "status": "success",
    "errCode": 0,
    "message": "请求成功。",
    "peakTime": "2024-08-14 12:55:00",
    "peakTotalCount": 3540,
    "peakHitCount": 2430,
    "peakBackCount": 1110,
    "countList": [
        {
            "time": "2024-08-14 12:00:00",
            "total": 3340,
            "hit": 2330,
            "back": 1010
        },
        {
            "time": "2024-08-14 12:05:00",
            "total": 3340,
            "hit": 2330,
            "back": 1010
        },
        {
            "time": "2024-08-14 12:10:00",
            "total": 3360,
            "hit": 2340,
            "back": 1020
        },
        {
            "time": "2024-08-14 12:15:00",
            "total": 3380,
            "hit": 2350,
            "back": 1030
        },
        {
            "time": "2024-08-14 12:20:00",
            "total": 3400,
            "hit": 2360,
            "back": 1040
        },
        {
            "time": "2024-08-14 12:25:00",
            "total": 3420,
            "hit": 2370,
            "back": 1050
        },
        {
            "time": "2024-08-14 12:30:00",
            "total": 3440,
            "hit": 2380,
            "back": 1060
        },
        {
            "time": "2024-08-14 12:35:00",
            "total": 3460,
            "hit": 2390,
            "back": 1070
        },
        {
            "time": "2024-08-14 12:40:00",
            "total": 3480,
            "hit": 2400,
            "back": 1080
        },
        {
            "time": "2024-08-14 12:45:00",
            "total": 3500,
            "hit": 2410,
            "back": 1090
        },
        {
            "time": "2024-08-14 12:50:00",
            "total": 3520,
            "hit": 2420,
            "back": 1100
        },
        {
            "time": "2024-08-14 12:55:00",
            "total": 3540,
            "hit": 2430,
            "back": 1110
        }
    ]
}

说明

  • startTimeendTime 必须指定,且 endTime 必须晚于 startTime
  • granularity 决定了返回的时间间隔数据,分别为 5 分钟、1 小时或 1 天的调度次数数据。
  • domain 为选填项,查询指定域名的调度次数。
  • 响应中的 peakTotalCount 为时间区间内的峰值调度次数,peakTime 为其对应的时间点。
  • status 字段用于快速标识请求的整体结果,而 message 字段提供详细说明。

3 查询穿透率

接口地址 /pdga/toB/penetration-rate/query

请求方式 POST

请求格式 application/json


请求参数

参数名 类型 是否必填 描述
startTime String 查询的开始时间,格式为 yyyy-MM-dd HH:mm:ss
endTime String 查询的结束时间,格式为 yyyy-MM-dd HH:mm:ss
granularity String 时间粒度,枚举值:5m5 分钟),1h(小时),1d(天)
natType String NAT 类型,枚举值:0(没有 NAT),1(全锥型),2IP 受限型),3(端口受限型),4(对称型)

请求示例

{
    "startTime": "2024-08-21 00:00:00",
    "endTime": "2024-08-21 08:00:00",
    "granularity": "5m",
    "natType": 1
}

响应参数

参数名 类型 描述
status String 请求的结果状态,success 表示成功,error 表示失败
errCode Integer 错误码,0 表示成功,其他值表示错误(具体错误码见错误码表)
message String 详细描述请求结果的信息,通常用于错误时说明原因
maxTime String 返回穿透成功率最高时刻的时间,格式为 yyyy-MM-dd HH:mm:ss
maxPenetrationRate Double 返回的最大穿透成功率值(单位:%
penetrationRateList Array 时间区间内的穿透成功率列表,包含时间点及对应的穿透成功率值

penetrationRateList 字段详情

参数名 类型 描述
time String 对应的时间点,格式为 yyyy-MM-dd HH:mm:ss
value Double 对应时间点的穿透成功率值(单位:%

响应示例

{
    "status": "success",
    "errCode": 0,
    "message": "请求成功。",
    "maxTime": "2024-08-14 12:00:00",
    "maxPenetrationRate": 69.76,
    "penetrationRateList": [
        {
            "time": "2024-08-14 12:00:00",
            "value": 69.76
        },
        {
            "time": "2024-08-14 12:05:00",
            "value": 69.76
        },
        {
            "time": "2024-08-14 12:10:00",
            "value": 69.64
        },
        {
            "time": "2024-08-14 12:15:00",
            "value": 69.53
        },
        {
            "time": "2024-08-14 12:20:00",
            "value": 69.41
        },
        {
            "time": "2024-08-14 12:25:00",
            "value": 69.3
        },
        {
            "time": "2024-08-14 12:30:00",
            "value": 69.19
        },
        {
            "time": "2024-08-14 12:35:00",
            "value": 69.08
        },
        {
            "time": "2024-08-14 12:40:00",
            "value": 68.97
        },
        {
            "time": "2024-08-14 12:45:00",
            "value": 68.86
        },
        {
            "time": "2024-08-14 12:50:00",
            "value": 68.75
        },
        {
            "time": "2024-08-14 12:55:00",
            "value": 68.64
        }
    ]
}

说明

  • startTimeendTime 必须指定,且 endTime 必须晚于 startTime
  • granularity 决定了返回的时间间隔数据,分别为 5 分钟、1 小时或 1 天的穿透成功率数据。
  • natType 为选填项,用于指定不同的 NAT 类型进行穿透成功率的查询。
  • 响应中的 maxPenetrationRate 为时间区间内的最大穿透成功率,maxTime 为其对应的时间点。
  • status 字段用于快速标识请求的整体结果,而 message 字段提供详细说明。

4 调度穿透次数查询接口

接口地址 /pdga/toB/penetration-count/query

请求方式 POST

请求格式 application/json


请求参数

参数名 类型 是否必填 描述
startTime String 查询的开始时间,格式为 yyyy-MM-dd HH:mm:ss
endTime String 查询的结束时间,格式为 yyyy-MM-dd HH:mm:ss
granularity String 时间粒度,枚举值:5m5 分钟),1h(小时),1d(天)
natType String NAT 类型,枚举值:0(没有 NAT),1(全锥型),2IP 受限型),3(端口受限型),4(对称型)

请求示例

{
    "startTime": "2024-08-21 00:00:00",
    "endTime": "2024-08-21 08:00:00",
    "granularity": "5m",
    "natType": 1
}

响应参数

参数名 类型 描述
status String 请求的结果状态,success 表示成功,error 表示失败
errCode Integer 错误码,0 表示成功,其他值表示错误(具体错误码见错误码表)
message String 详细描述请求结果的信息,通常用于错误时说明原因
peakTime String 返回穿透次数峰值时刻的时间,格式为 yyyy-MM-dd HH:mm:ss
peakTotalCount Long 返回的峰值穿透次数
peakSuccessCount Long 返回的峰值穿透成功次数
peakFailureCount Long 返回的峰值穿透失败次数
countList Array 时间区间内的穿透次数列表,包含时间点及对应的总穿透次数、穿透成功次数、穿透失败次数

countList 字段详情

参数名 类型 描述
time String 对应的时间点,格式为 yyyy-MM-dd HH:mm:ss
total Long 对应时间点的总穿透次数
success Long 对应时间点的穿透成功次数
failure Long 对应时间点的穿透失败次数

响应示例

{
    "status": "success",
    "errCode": 0,
    "message": "请求成功。",
    "peakTime": "2024-08-14 12:55:00",
    "peakTotalCount": 3540,
    "peakSuccessCount": 2430,
    "peakFailureCount": 1110,
    "countList": [
        {
            "time": "2024-08-14 12:00:00",
            "total": 3340,
            "success": 2330,
            "failure": 1010
        },
        {
            "time": "2024-08-14 12:05:00",
            "total": 3340,
            "success": 2330,
            "failure": 1010
        },
        {
            "time": "2024-08-14 12:10:00",
            "total": 3360,
            "success": 2340,
            "failure": 1020
        },
        {
            "time": "2024-08-14 12:15:00",
            "total": 3380,
            "success": 2350,
            "failure": 1030
        },
        {
            "time": "2024-08-14 12:20:00",
            "total": 3400,
            "success": 2360,
            "failure": 1040
        },
        {
            "time": "2024-08-14 12:25:00",
            "total": 3420,
            "success": 2370,
            "failure": 1050
        },
        {
            "time": "2024-08-14 12:30:00",
            "total": 3440,
            "success": 2380,
            "failure": 1060
        },
        {
            "time": "2024-08-14 12:35:00",
            "total": 3460,
            "success": 2390,
            "failure": 1070
        },
        {
            "time": "2024-08-14 12:40:00",
            "total": 3480,
            "success": 2400,
            "failure": 1080
        },
        {
            "time": "2024-08-14 12:45:00",
            "total": 3500,
            "success": 2410,
            "failure": 1090
        },
        {
            "time": "2024-08-14 12:50:00",
            "total": 3520,
            "success": 2420,
            "failure": 1100
        },
        {
            "time": "2024-08-14 12:55:00",
            "total": 3540,
            "success": 2430,
            "failure": 1110
        }
    ]
}

说明

  • startTimeendTime 必须指定,且 endTime 必须晚于 startTime
  • granularity 决定了返回的时间间隔数据,分别为 5 分钟、1 小时或 1 天的穿透成功率数据。
  • natType 为选填项,用于指定不同的 NAT 类型进行穿透成功率的查询。
  • 响应中的 maxPenetrationRate 为时间区间内的最大穿透成功率,maxTime 为其对应的时间点。
  • status 字段用于快速标识请求的整体结果,而 message 字段提供详细说明。

错误码表

错误码 描述
0 成功
1001 参数缺失或格式错误
1002 时间区间不合法
1003 数据查询失败