curl --location 'https://api.flashcat.cloud/api/v2/firemap/flexible/card/upsert' \
--header 'X-User-Token: YOUR_USER_TOKEN' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhY2Nlc3NfdXVpZCI6IjM2ZTRjZjI3LWI4OWYtNDFlZS04ZDhmLWZiMjdhMmZlZGIzOSIsImF1dGhvcml6ZWQiOnRydWUsImV4cCI6MTc3NTExMTEyMywidXNlcl9pZGVudGl0eSI6IjEtcm9vdCJ9.IwPWDg92AjjvuUTGplaXgpexmOSsONx73M7Y7pOI_vE' \
--header 'Content-Type: application/json' \
--data '{
"id": 0,
"name": "Prometheus CPU 使用率",
"owners": [
"ops"
],
"firemap_type": "function",
"business_id": 123,
"business_name": "核心业务",
"group_id": 456,
"group_name": "服务状态",
"data_source_type": "prometheus",
"data_source_ids": [
1
],
"metrics": [
{
"metric_idx": "A",
"metric": "cpu_usage",
"name": "CPU 使用率",
"mode": 0,
"layout_number": 0,
"unit": "%",
"settings": {
"prometheus.promql": "sum(rate(container_cpu_usage_seconds_total{namespace=\"prod\"}[5m]))"
}
}
],
"multi_thresholds": [
{
"severity": 2,
"mode": 0,
"thresholds": [
{
"metric": "cpu_usage",
"operator": ">",
"threshold": 80,
"limit": 3,
"aggregation": "avg"
}
]
}
],
"window_seconds": 300,
"delay_seconds": 60
}'