itecdn 5.x用户文档
itecdn 5.x / 用户 API

按网站统计黑名单记录数

GET/v1/monitor/site/blackip-count

按 site_id 聚合黑名单日志的文档数。接口要求登录且不接受查询参数。普通用户仅聚合自身 uid 的记录,管理员聚合全部记录。注意:该接口不筛选 exp,因此计数可能包含已过期黑名单;日志库 terms 聚合最多返回 100 个网站桶。

身份认证

access-token

api-key + api-secret

认证定义
{
  "AccessToken": {
    "type": "apiKey",
    "in": "header",
    "name": "access-token",
    "description": "通过登录接口获得的短期访问令牌。"
  },
  "ApiKey": {
    "type": "apiKey",
    "in": "header",
    "name": "api-key",
    "description": "API Key;必须和 api-secret 同时发送。"
  },
  "ApiSecret": {
    "type": "apiKey",
    "in": "header",
    "name": "api-secret",
    "description": "API Secret;必须和 api-key 同时发送。"
  }
}

请求参数

未定义路径、查询或请求头参数。

响应

HTTP 200

成功时返回 HTTP 200 的统计数组。当前服务端未对日志库查询异常做业务错误转换。

application/json

object

字段类型必填说明与约束
codeinteger必填

0 表示聚合成功。

约束 / 默认值 / 示例
{
  "enum": [
    0
  ]
}
countinteger必填

返回的网站聚合桶数量,不是黑名单总记录数。

约束 / 默认值 / 示例
{
  "minimum": 0,
  "maximum": 100
}
dataarray <object>必填

按日志库 terms 聚合返回的网站统计,最多 100 项。

展开字段结构

按日志库 terms 聚合返回的网站统计,最多 100 项。

数组元素 · object
字段类型必填说明与约束
site_idany必填

日志中的网站 ID 原始值,类型由日志库决定。

countinteger必填

该网站对应的黑名单日志文档数,包含已过期记录。

约束 / 默认值 / 示例
{
  "minimum": 0
}
完整 Schema
{
  "type": "object",
  "required": [
    "code",
    "count",
    "data"
  ],
  "properties": {
    "code": {
      "type": "integer",
      "enum": [
        0
      ],
      "description": "0 表示聚合成功。"
    },
    "count": {
      "type": "integer",
      "minimum": 0,
      "maximum": 100,
      "description": "返回的网站聚合桶数量,不是黑名单总记录数。"
    },
    "data": {
      "type": "array",
      "description": "按日志库 terms 聚合返回的网站统计,最多 100 项。",
      "items": {
        "type": "object",
        "required": [
          "site_id",
          "count"
        ],
        "properties": {
          "site_id": {
            "description": "日志中的网站 ID 原始值,类型由日志库决定。"
          },
          "count": {
            "type": "integer",
            "minimum": 0,
            "description": "该网站对应的黑名单日志文档数,包含已过期记录。"
          }
        },
        "additionalProperties": false
      }
    }
  },
  "additionalProperties": false
}

示例

{
  "code": 0,
  "count": 2,
  "data": [
    {
      "site_id": "123",
      "count": 42
    },
    {
      "site_id": "124",
      "count": 8
    }
  ]
}

cURL 示例

根据文档生成;请替换主控地址、路径参数和凭证,并按上表补充查询参数。

curl --request GET \
  "https://master.example.invalid/v1/monitor/site/blackip-count" \
  --header "access-token: YOUR_ACCESS_TOKEN"

查看完整接口 JSON