curl --location --request POST 'https://api.flashcat.cloud/api/n9e-plus/asset-view' \
--header 'X-User-Token: <api-key>' \
--header 'Content-Type: application/json' \
--data-raw '{
"id": 1,
"name": "服务器监控视图",
"enable": true,
"labels": [
"env=production",
"region=beijing",
"cluster=web-cluster"
],
"note": "用于监控生产环境服务器的资产视图,包含CPU、内存、磁盘等关键指标",
"team_ids": [101, 102, 103],
"public_type": 1,
"view_config": {
"interval": 30,
"timeout": 10,
"instances": {
"promql": "up{job=\"node-exporter\"}",
"primary_keys": ["instance", "job"],
"meta_keys": ["name"]
},
"column_mappings": {
"instance": "实例地址",
"job": "任务名称",
"hostname": "主机名",
"datacenter": "数据中心",
"team": "责任团队"
},
"metrics_render": "table"
},
"datasource_queries": [
{
"match_type": 0,
"op": "in",
"values": [1]
}
],
"dashboard": {
"target": "grafana",
"url": "https://grafana.example.com/d/server-monitoring",
"params": {
"orgId": "1",
"refresh": "30s",
"from": "now-1h",
"to": "now"
}
}
}'