浏览拓扑主机
curl --request POST \
--url 'https://api.flashcat.cloud/monit/servicemap/fleet?app_key=' \
--header 'Content-Type: application/json' \
--data '
{
"limit": 50,
"scan_limit": 1000,
"statuses": [
"degraded",
"stale"
],
"agent_versions": [
"v1.2.3"
],
"edge_clusters": [
"edge-a"
],
"capture_modes": [
"ebpf"
]
}
'import requests
url = "https://api.flashcat.cloud/monit/servicemap/fleet?app_key="
payload = {
"limit": 50,
"scan_limit": 1000,
"statuses": ["degraded", "stale"],
"agent_versions": ["v1.2.3"],
"edge_clusters": ["edge-a"],
"capture_modes": ["ebpf"]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
limit: 50,
scan_limit: 1000,
statuses: ['degraded', 'stale'],
agent_versions: ['v1.2.3'],
edge_clusters: ['edge-a'],
capture_modes: ['ebpf']
})
};
fetch('https://api.flashcat.cloud/monit/servicemap/fleet?app_key=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.flashcat.cloud/monit/servicemap/fleet?app_key=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'limit' => 50,
'scan_limit' => 1000,
'statuses' => [
'degraded',
'stale'
],
'agent_versions' => [
'v1.2.3'
],
'edge_clusters' => [
'edge-a'
],
'capture_modes' => [
'ebpf'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.flashcat.cloud/monit/servicemap/fleet?app_key="
payload := strings.NewReader("{\n \"limit\": 50,\n \"scan_limit\": 1000,\n \"statuses\": [\n \"degraded\",\n \"stale\"\n ],\n \"agent_versions\": [\n \"v1.2.3\"\n ],\n \"edge_clusters\": [\n \"edge-a\"\n ],\n \"capture_modes\": [\n \"ebpf\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.flashcat.cloud/monit/servicemap/fleet?app_key=")
.header("Content-Type", "application/json")
.body("{\n \"limit\": 50,\n \"scan_limit\": 1000,\n \"statuses\": [\n \"degraded\",\n \"stale\"\n ],\n \"agent_versions\": [\n \"v1.2.3\"\n ],\n \"edge_clusters\": [\n \"edge-a\"\n ],\n \"capture_modes\": [\n \"ebpf\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flashcat.cloud/monit/servicemap/fleet?app_key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"limit\": 50,\n \"scan_limit\": 1000,\n \"statuses\": [\n \"degraded\",\n \"stale\"\n ],\n \"agent_versions\": [\n \"v1.2.3\"\n ],\n \"edge_clusters\": [\n \"edge-a\"\n ],\n \"capture_modes\": [\n \"ebpf\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"data": {
"items": [
{
"host_id": "host_0123456789abcdef0123456789abcdef",
"agent_version": "v1.2.3",
"edge_cluster": "edge-a",
"servicemap": {
"enabled": true,
"status": "degraded",
"capability_status": "degraded",
"capture_mode": "ebpf",
"snapshot_ready": true,
"authoritative": true,
"graph_available": false,
"freshness_status": "fresh",
"observed_at_ms": 1784635557272,
"received_at_ms": 1784635557272,
"node_count": 46,
"edge_count": 200,
"reason_codes": [
"snapshot_incomplete"
]
}
},
{
"host_id": "host_fedcba9876543210fedcba9876543210",
"agent_version": "v1.2.3",
"edge_cluster": "edge-a",
"servicemap": {
"enabled": true,
"status": "stale",
"capability_status": "running",
"capture_mode": "ebpf",
"snapshot_ready": true,
"authoritative": true,
"graph_available": true,
"freshness_status": "stale",
"observed_at_ms": 1784631957272,
"received_at_ms": 1784631957272,
"node_count": 38,
"edge_count": 152
}
}
],
"coverage": {
"scanned": 80,
"matched": 2,
"returned": 2,
"failed": 0,
"states": {
"active": 0,
"degraded": 1,
"stale": 1,
"initializing": 0,
"disabled": 0,
"unsupported": 0,
"no_data": 0
}
},
"partial": false,
"truncated": false,
"generated_at_ms": 1784635557272
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "InvalidParameter",
"message": "The specified parameter is not valid."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "Unauthorized",
"message": "You are unauthorized."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "RequestTooFrequently",
"message": "Request too frequently."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "InternalError",
"message": "We encountered an internal error, and it has been reported. Please try again later."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "ServiceUnavailable",
"message": "servicemap store is not initialized"
}
}服务拓扑
浏览拓扑主机
浏览账户内启用了服务拓扑能力的主机及其当前采集状态。
POST
/
monit
/
servicemap
/
fleet
浏览拓扑主机
curl --request POST \
--url 'https://api.flashcat.cloud/monit/servicemap/fleet?app_key=' \
--header 'Content-Type: application/json' \
--data '
{
"limit": 50,
"scan_limit": 1000,
"statuses": [
"degraded",
"stale"
],
"agent_versions": [
"v1.2.3"
],
"edge_clusters": [
"edge-a"
],
"capture_modes": [
"ebpf"
]
}
'import requests
url = "https://api.flashcat.cloud/monit/servicemap/fleet?app_key="
payload = {
"limit": 50,
"scan_limit": 1000,
"statuses": ["degraded", "stale"],
"agent_versions": ["v1.2.3"],
"edge_clusters": ["edge-a"],
"capture_modes": ["ebpf"]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
limit: 50,
scan_limit: 1000,
statuses: ['degraded', 'stale'],
agent_versions: ['v1.2.3'],
edge_clusters: ['edge-a'],
capture_modes: ['ebpf']
})
};
fetch('https://api.flashcat.cloud/monit/servicemap/fleet?app_key=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.flashcat.cloud/monit/servicemap/fleet?app_key=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'limit' => 50,
'scan_limit' => 1000,
'statuses' => [
'degraded',
'stale'
],
'agent_versions' => [
'v1.2.3'
],
'edge_clusters' => [
'edge-a'
],
'capture_modes' => [
'ebpf'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.flashcat.cloud/monit/servicemap/fleet?app_key="
payload := strings.NewReader("{\n \"limit\": 50,\n \"scan_limit\": 1000,\n \"statuses\": [\n \"degraded\",\n \"stale\"\n ],\n \"agent_versions\": [\n \"v1.2.3\"\n ],\n \"edge_clusters\": [\n \"edge-a\"\n ],\n \"capture_modes\": [\n \"ebpf\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.flashcat.cloud/monit/servicemap/fleet?app_key=")
.header("Content-Type", "application/json")
.body("{\n \"limit\": 50,\n \"scan_limit\": 1000,\n \"statuses\": [\n \"degraded\",\n \"stale\"\n ],\n \"agent_versions\": [\n \"v1.2.3\"\n ],\n \"edge_clusters\": [\n \"edge-a\"\n ],\n \"capture_modes\": [\n \"ebpf\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.flashcat.cloud/monit/servicemap/fleet?app_key=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"limit\": 50,\n \"scan_limit\": 1000,\n \"statuses\": [\n \"degraded\",\n \"stale\"\n ],\n \"agent_versions\": [\n \"v1.2.3\"\n ],\n \"edge_clusters\": [\n \"edge-a\"\n ],\n \"capture_modes\": [\n \"ebpf\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"data": {
"items": [
{
"host_id": "host_0123456789abcdef0123456789abcdef",
"agent_version": "v1.2.3",
"edge_cluster": "edge-a",
"servicemap": {
"enabled": true,
"status": "degraded",
"capability_status": "degraded",
"capture_mode": "ebpf",
"snapshot_ready": true,
"authoritative": true,
"graph_available": false,
"freshness_status": "fresh",
"observed_at_ms": 1784635557272,
"received_at_ms": 1784635557272,
"node_count": 46,
"edge_count": 200,
"reason_codes": [
"snapshot_incomplete"
]
}
},
{
"host_id": "host_fedcba9876543210fedcba9876543210",
"agent_version": "v1.2.3",
"edge_cluster": "edge-a",
"servicemap": {
"enabled": true,
"status": "stale",
"capability_status": "running",
"capture_mode": "ebpf",
"snapshot_ready": true,
"authoritative": true,
"graph_available": true,
"freshness_status": "stale",
"observed_at_ms": 1784631957272,
"received_at_ms": 1784631957272,
"node_count": 38,
"edge_count": 152
}
}
],
"coverage": {
"scanned": 80,
"matched": 2,
"returned": 2,
"failed": 0,
"states": {
"active": 0,
"degraded": 1,
"stale": 1,
"initializing": 0,
"disabled": 0,
"unsupported": 0,
"no_data": 0
}
},
"partial": false,
"truncated": false,
"generated_at_ms": 1784635557272
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "InvalidParameter",
"message": "The specified parameter is not valid."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "Unauthorized",
"message": "You are unauthorized."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "RequestTooFrequently",
"message": "Request too frequently."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "InternalError",
"message": "We encountered an internal error, and it has been reported. Please try again later."
}
}{
"request_id": "01HK8XQE3Z7JM2NTFQ5YJ8P9R4",
"error": {
"code": "ServiceUnavailable",
"message": "servicemap store is not initialized"
}
}限制说明
| 项目 | 说明 |
|---|---|
| 速率限制 | 每个账户 30 次/分钟;2 次/秒 |
| 权限要求 | 监控对象查看(monit) |
使用说明
- 与其余四个服务拓扑只读接口不同,本接口在服务拓扑存储不可用时会优雅降级:匹配逻辑仍基于清单数据运行,受影响的项通过
servicemap.error_code=status_unavailable及partial=true披露,而不会导致整个请求失败。 cursor是不透明值,请原样传入next_cursor返回的值,不要自行构造或解析。- 在找到
limit个匹配前先达到scan_limit时,会设置truncated=true且仍会返回next_cursor——这与扫描到账户主机末尾不是一回事。 coverage.scanned/matched/returned仅描述本页的扫描情况,不代表账户内主机总量。
授权
在 Flashduty 控制台 账户 → APP Key 中签发的 app_key。调用任何公开 API 时都必须携带。它等同于所属账户的身份凭证,请妥善保管。
请求体
application/json
浏览已启用服务拓扑能力主机的过滤与分页参数。
不透明的分页游标。请原样传入上一次响应中的 next_cursor;首页请省略此字段。
本页最多返回的匹配主机数。默认 50,范围 1~100。
必填范围:
1 <= x <= 100填充本页时最多检查的候选主机数。默认 1000,范围 limit~2000。
必填范围:
x <= 2000筛选处于以下任一状态的主机,最多 20 个值。
Maximum array length:
20可用选项:
active, degraded, stale, initializing, disabled, unsupported, no_data 筛选运行以下任一确切 Agent 版本的主机,最多 20 个值。
Maximum array length:
20筛选属于以下任一确切边缘集群名称的主机,最多 20 个值。
Maximum array length:
20筛选使用以下任一采集模式的主机。unknown 匹配尚未上报采集模式的主机。
Maximum array length:
3可用选项:
ebpf, polling, unknown 此页面对您有帮助吗?
⌘I