Base URL

文档中引用的所有 URIs 都有以下基础:

https://api.dotcom-monitor.com/config_api_v1/

在本文中,您可以找到使用自定义收集器和 SNMP 计数器的所有类型的操作的 JSON 请求和响应对象、详细字段说明和解释性说明:

获取已登记的柜台资料

请求网址

获取 https://api.dotcom-monitor.com/config_api_v1/ 反信息/获取/{collector_UID}

返回已保存的 JSON(关于类别的 META…)。

路径参数

领域 类型 必填 描述
collector_UID

字符串

true

分配给收集器的收集器 ID。 若要查找 UID 值,请转到配置 > 指标视图收集器编辑收集器 > 收集器> ID。

成功响应

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
{
"GetCounterInfoResult":"{"results":[
{
"CategoryName":"Sample Category 1",
"InstanceList":[
"i-01","i-02",
"_Total",
"sdd"
],
"CounterList":[
"c-01",
"c-02"
]
},
{
"CategoryName":"Sample Category 2",
"InstanceList":[
"b-01",
"b-02",
"_Total"
],
"CounterList":[
"d-01",
"d-02"
]
},
{
"CategoryName":"S001",
"InstanceList":null,
"CounterList":[
"var–1"
]
}
]
}"
}
{ "GetCounterInfoResult":"{"results":[ { "CategoryName":"Sample Category 1", "InstanceList":[ "i-01","i-02", "_Total", "sdd" ], "CounterList":[ "c-01", "c-02" ] }, { "CategoryName":"Sample Category 2", "InstanceList":[ "b-01", "b-02", "_Total" ], "CounterList":[ "d-01", "d-02" ] }, { "CategoryName":"S001", "InstanceList":null, "CounterList":[ "var–1" ] } ] }" }
{
    "GetCounterInfoResult":"{"results":[
        {
            "CategoryName":"Sample Category 1",
            "InstanceList":[
                "i-01","i-02",
                "_Total",
                "sdd"
            ],
            "CounterList":[
                "c-01",
                "c-02"
            ]
        },
        {
            "CategoryName":"Sample Category 2",
            "InstanceList":[
                "b-01",
                "b-02",
                "_Total"
            ],
            "CounterList":[
                "d-01",
                "d-02"
            ]
        },
        {
            "CategoryName":"S001",
            "InstanceList":null,
            "CounterList":[
                "var–1"
            ]
        }
    ]
    }"
}
登记柜台信息

请求网址

邮政 https://api.dotcom-monitor.com/config_api_v1/ 反信息/邮政/{collector_UID}

路径参数

领域 类型 必填 描述
collector_UID

字符串

true

分配给收集器的收集器 ID。 若要查找 UID 值,请转到配置 > 指标视图收集器编辑收集器 > 收集器> ID。
示例 自定义收集器的帖子正文
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
{
"results": [
{
"CategoryName": "Sample Category 1",
"InstanceList": [
"i-01",
"i-02",
"_Total"
],
"CounterList": [
"c-01",
"c-02"
]
},
{
"CategoryName": "Sample Category 2",
"InstanceList": [
"b-01",
"b-02",
"_Total"
],
"CounterList": [
"d-01",
"d-02"
]
}
]
}
{ "results": [ { "CategoryName": "Sample Category 1", "InstanceList": [ "i-01", "i-02", "_Total" ], "CounterList": [ "c-01", "c-02" ] }, { "CategoryName": "Sample Category 2", "InstanceList": [ "b-01", "b-02", "_Total" ], "CounterList": [ "d-01", "d-02" ] } ] }
{
    "results": [
        {
            "CategoryName": "Sample Category 1",
            "InstanceList": [
                "i-01",
                "i-02",
                "_Total"
            ],
            "CounterList": [
                "c-01",
                "c-02"
            ]
        },
        {
            "CategoryName": "Sample Category 2",
            "InstanceList": [
                "b-01",
                "b-02",
                "_Total"
            ],
            "CounterList": [
                "d-01",
                "d-02"
            ]
        }
    ]
}
SNMP 计数器的示例发布正文
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
{
"results":
{
"OIDs":[
"Sample OID 1",
"Sample OID 2"
]
}
}
{ "results": { "OIDs":[ "Sample OID 1", "Sample OID 2" ] } }
{
    "results":
    {
        "OIDs":[
            "Sample OID 1",
            "Sample OID 2"
        ]
    }
}
获取任务列表

请求网址

获取 https://api.dotcom-monitor.com/config_api_v1/tasks/ 反信息/获取/{collector_UID}

返回带有任务列表的 JSON。

路径参数

领域 类型 必填 描述
collector_UID

字符串

true

分配给收集器的收集器 ID。 若要查找 UID 值,请转到配置 > 指标视图收集器编辑收集器 > 收集器> ID。

成功响应

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
{
"Sample Task UID 1": "Sample Counter Path 1",
"Sample Task UID 2": "Sample Counter Path 2"
}
{ "Sample Task UID 1": "Sample Counter Path 1", "Sample Task UID 2": "Sample Counter Path 2" }
{
    "Sample Task UID 1": "Sample Counter Path 1",
    "Sample Task UID 2": "Sample Counter Path 2"
}
发送收集的计数器值

请求网址

POST https://api.dotcom-monitor.com/config_api_v1/ counterinfo/tasks/post/{collector_UID}

路径参数

领域 类型 必填 描述
collector_UID

字符串

true

分配给收集器的收集器 ID。 若要查找 UID 值,请转到配置 > 指标视图收集器编辑收集器 > 收集器> ID。

示例帖子正文

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
{
"Sample Task UID 1": 2343.44,
"Sample Task UID 2": 8292
}
{ "Sample Task UID 1": 2343.44, "Sample Task UID 2": 8292 }
{
    "Sample Task UID 1": 2343.44,
    "Sample Task UID 2": 8292
}