新增/修改卡片
POST
https://api.flashcat.cloud/api/v2/firemap/flexible/card/upsert
最后修改时间:2024-03-15 06:55:19
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.flashcat.cloud/api/v2/firemap/flexible/card/upsert' \
--header 'FC-WORKSPACE-ID: 1963865361927' \
--header 'Content-Type: application/json' \
--data-raw '{
"id": 1714,
"name": "自定义模块指标-测试",
"owners": [],
"firemap_type": "module",
"order": 0,
"business_id": 1281,
"business_name": "v2_测试",
"group_id": 0,
"group_name": "",
"data_source_type": "prometheus",
"data_source_ids": [
241
],
"metrics": [
{
"metric": "alive",
"name": "实例存活率",
"settings": {
"prometheus.promql": "sum ( up { container =~ \"grafana\" } ) by ( container ) / count ( up { container =~ \"grafana\" } ) by ( container ) * 100"
},
"aggregation": "min"
},
{
"metric": "cpu",
"name": "CPU使用率",
"settings": {
"prometheus.promql": "sum ( irate ( container_cpu_usage_seconds_total { container =~ \"grafana\" } [5m] ) * 100 ) by ( pod )"
},
"aggregation": "max"
},
{
"metric": "mem",
"name": "MEM使用率",
"settings": {
"prometheus.promql": "sum ( container_memory_usage_bytes { container =~ \"grafana\", namespace = \"monitoring\" } ) by ( pod, container ) / sum ( container_spec_memory_limit_bytes { container =~ \"grafana\", namespace = \"monitoring\" } ) by ( pod, container ) * 100"
},
"aggregation": "max"
}
],
"thresholds": [
{
"metric": "alive",
"threshold": 101,
"operator": "<",
"logic": "",
"normalize": "percentage"
}
],
"multi_thresholds": [
{
"thresholds": [
{
"metric": "alive",
"threshold": 101,
"operator": "<",
"logic": "",
"normalize": "percentage"
},
"severity": 1
]
}
]
}'
响应示例响应示例
{
"request_id": "string",
"data": 0
}
请求参数
Header 参数
Content-Type
string
必需
示例值:
application/json
FC-WORKSPACE-ID
string
必需
示例值:
1963865361927
Body 参数application/json