{
  "tags": [
    "网站监控"
  ],
  "description": "按 `site_id` 聚合黑名单日志的文档数。接口要求登录且不接受查询参数。普通用户仅聚合自身 uid 的记录，管理员聚合全部记录。注意：该接口不筛选 `exp`，因此计数可能包含已过期黑名单；日志库 terms 聚合最多返回 100 个网站桶。",
  "operationId": "user_get_v1_monitor_site_blackip_count",
  "security": [
    {
      "AccessToken": []
    },
    {
      "ApiKey": [],
      "ApiSecret": []
    }
  ],
  "responses": {
    "200": {
      "description": "成功时返回 HTTP 200 的统计数组。当前服务端未对日志库查询异常做业务错误转换。",
      "content": {
        "application/json": {
          "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
          },
          "example": {
            "code": 0,
            "count": 2,
            "data": [
              {
                "site_id": "123",
                "count": 42
              },
              {
                "site_id": "124",
                "count": 8
              }
            ]
          }
        }
      }
    }
  },
  "x-python-handler": "monitor.BlackIpCountAPI",
  "x-python-route-line": 760,
  "x-audience": "user",
  "x-auth": "user",
  "x-reviewed": true,
  "parameters": [],
  "x-itecdn-source-reviewed": true,
  "extensions": [
    {
      "key": "x-python-handler",
      "value": "monitor.BlackIpCountAPI"
    },
    {
      "key": "x-python-route-line",
      "value": 760
    },
    {
      "key": "x-audience",
      "value": "user"
    },
    {
      "key": "x-auth",
      "value": "user"
    },
    {
      "key": "x-reviewed",
      "value": true
    },
    {
      "key": "x-itecdn-source-reviewed",
      "value": true
    }
  ],
  "method": "get",
  "path": "/v1/monitor/site/blackip-count",
  "servers": [
    {
      "url": "https://master.example.invalid",
      "description": "不可调用的示例地址；复制示例后替换为自己的主控域名。"
    }
  ],
  "securitySchemes": {
    "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 同时发送。"
    }
  },
  "info": {
    "title": "itecdn v5 用户 API",
    "version": "5.x",
    "description": "itecdn v5.x Python 主控用户 API。本文档不适用于 v6 或其它实现。"
  },
  "postman": {
    "name": "按网站统计黑名单记录数",
    "description": {
      "content": "按 `site_id` 聚合黑名单日志的文档数。接口要求登录且不接受查询参数。普通用户仅聚合自身 uid 的记录，管理员聚合全部记录。注意：该接口不筛选 `exp`，因此计数可能包含已过期黑名单；日志库 terms 聚合最多返回 100 个网站桶。",
      "type": "text/plain"
    },
    "url": {
      "path": [
        "v1",
        "monitor",
        "site",
        "blackip-count"
      ],
      "host": [
        "{{baseUrl}}"
      ],
      "query": [],
      "variable": []
    },
    "header": [
      {
        "key": "Accept",
        "value": "application/json"
      }
    ],
    "method": "GET",
    "auth": {
      "type": "apikey",
      "apikey": [
        {
          "type": "any",
          "value": "access-token",
          "key": "key"
        },
        {
          "type": "any",
          "value": "{{apiKey}}",
          "key": "value"
        },
        {
          "type": "any",
          "value": "header",
          "key": "in"
        }
      ]
    }
  }
}