跳到正文

Quake主机索引聚合统计可聚合字段列表

接口说明

返回 quake_host(主机维度网络测绘资产)索引中支持作为聚合维度的字段名列表。该列表即 POST /api/v3/aggregation/quake_host 聚合接口 aggregation_list 参数的合法取值范围。 调用方在执行主机聚合统计前,应先调用本接口拿到可聚合字段清单,再据此构造聚合请求,避免传入不支持的字段。

请求地址

https://api.f.360.cn/api/v3/aggregation/quake_host/aggregation_list

请求方法

GET

请求参数

参数名类型位置是否必填示例值说明
—————本接口无请求参数

响应参数

名称类型示例值描述
codeInteger | String0响应状态码,0 为正常,其他为异常
messageStringSuccessful.响应状态信息
dataArray(String)["ip","port",...]可聚合字段名称列表
metaObject{}元信息

data 字段说明

字段标识说明
ipIP 地址
port端口号
service服务名称
product产品名称
os操作系统
asnASN 编号
org组织名称
isp运营商
province省份(英文)
province_cn省份(中文)
country国家(英文)
country_cn国家(中文)
country_code国家代码
city城市(英文)
city_cn城市(中文)
district区县(英文)
district_cn区县(中文)
province_of_china中国省份

请求示例

支持cUrl、Python、Java、PHP、Go语言的请求,示例如下

#!/usr/bin/env bash
set -euo pipefail

APPID=""  # apikey
SECRET=""  # salt
URL="https://api.f.360.cn/api/v3/aggregation/quake_host/aggregation_list"
BODY=""

NONCE=$(printf '%08d' $((RANDOM % 100000000)))
TIMESTAMP=$(date +%s)
BODY_MD5=$(printf '%s' "$BODY" | openssl dgst -md5 -hex | awk '{print $NF}')
SIGNATURE=$(printf '%s' "${BODY_MD5}${APPID}${NONCE}${TIMESTAMP}${SECRET}" | openssl dgst -md5 -hex | awk '{print $NF}')
SIGNATURE=${SIGNATURE:16}

curl --location --request GET "$URL" \
  --header "Content-Type: application/json" \
  --header "X-360-Key: ${APPID}" \
  --header "X-360-Nonce: ${NONCE}" \
  --header "X-360-Timestamp: ${TIMESTAMP}" \
  --header "X-360-Signature: ${SIGNATURE}"

响应示例

业务正常响应

{
    "code": 0,
    "message": "Successful.",
    "data": [
        "ip", "port", "service", "product", "os", "asn", "org",
        "isp", "province", "province_cn", "country", "country_cn",
        "country_code", "city", "city_cn", "district", "district_cn",
        "province_of_china"
    ],
    "meta": {}
}

业务异常响应

{
    "code": "q3005",
    "message": "调用API过于频繁",
    "data": {},
    "meta": {}
}
{
    "code": "GC00105", 
    "src": "apiholder",
    "msg": "appid over field"
}