查看告警模版详情
请求信息
请求行
GET /apis/aiops.alauda.io/v1beta1/alerttemplates/{name}
查看指定的告警模板的详细信息。
请求行参数
名称 | 类型 | 是否必填项 | 描述 |
---|---|---|---|
name | string | 是 | 告警模板的名称。 |
请求参数
名称 | 类型 | 是否必填项 | 描述 |
---|---|---|---|
resourceVersion | string | 否 | 如果未设置,则基于 quorum-read 标志从远程存储返回结果;如果它是 0,那么我们只是返回我们目前在缓存,没有保证;如果设置为非零,那么结果至少与给定的 resourceVersion 一样为最新的值。 |
pretty | string | 否 | 如果为 true,则会将返回结果输出成适合打印的格式。 |
返回信息
Content-Type
application/json
,
application/yaml
状态码: 200
OK
返回体示例
AlertTemplate 是 AlertTemplate API 的结构。
{
"apiVersion": "aiops.alauda.io/v1beta1",
"kind": "AlertTemplate",
"metadata": {
"annotations": {
"alert.cpaas.io/notifications": "[]",
"cpaas.io/creator": "admin@cpaas.io",
"cpaas.io/description": "abc",
"cpaas.io/operator": "admin@cpaas.io",
"cpaas.io/updated-at": "2021-06-23T06:03:06Z"
},
"creationTimestamp": "2021-06-10T02:50:48Z",
"generation": 2,
"labels": {
"cpaas.io/kind": "cluster"
},
"managedFields": [
{
"apiVersion": "aiops.alauda.io/v1beta1",
"fieldsType": "FieldsV1",
"fieldsV1": {
"f:metadata": {
"f:annotations": {
".": {},
"f:alert.cpaas.io/notifications": {},
"f:cpaas.io/description": {},
"f:cpaas.io/updated-at": {}
},
"f:labels": {
".": {},
"f:cpaas.io/kind": {}
}
},
"f:spec": {
".": {},
"f:templates": {}
}
},
"manager": "Mozilla",
"operation": "Update",
"time": "2021-06-23T06:03:06Z"
}
],
"name": "test",
"resourceVersion": "33873778",
"selfLink": "/apis/aiops.alauda.io/v1beta1/alerttemplates/test",
"uid": "9eda692f-1483-4fec-8017-c5a908a961ec"
},
"spec": {
"templates": [
{
"annotations": {},
"compare": "\u003e",
"expr": "",
"labels": {
"severity": "High"
},
"metric": {
"queries": [
{
"aggregator": "origin",
"labels": [
{
"name": "__name__",
"type": "EQUAL",
"value": "cluster.cpu.utilization"
}
],
"range": 0
}
]
},
"metric_name": "cluster.cpu.utilization",
"name": "cluster.cpu.utilization-lxijs",
"notifications": [],
"query": "",
"threshold": 0.5,
"wait": 30
}
]
}
}
返回体说明
名称 | 类型 | 描述 |
---|---|---|
apiVersion | string | 查看公共参数 |
kind | string | 查看公共参数 |
metadata | object | 查看公共参数 |
spec | object |
spec 包含了模板资源的规范参数。
字段路径:spec |
spec.templates | array |
告警模板的列表。
字段路径:spec.templates |
spec.templates[] | object |
模板项。
字段路径:spec.templates[] |
templates[].compare | string |
模板对比信息。
字段路径:spec.templates[].compare |
templates[].metric | object |
告警的指标信息。
字段路径:spec.templates[].metric |
metric.queries | array |
指标的查询条件。
字段路径:spec.templates[].metric.queries |
metric.queries[] | object |
查询项。
字段路径:spec.templates[].metric.queries[] |
queries[].aggregator | string |
聚合方式。⽀持以下几种⽅方式:avg:平均值;max:最⼤值;min:最小值。
字段路径:spec.templates[].metric.queries[].aggregator |
queries[].labels | array |
告警对象的标签。由键、值组成的监控数据查询条件。
字段路径:spec.templates[].metric.queries[].labels |
queries[].labels[] | object |
查询到的标签项。
字段路径:spec.templates[].metric.queries[].labels[] |
labels[].name | string |
组合查询条件中包含的键。
字段路径:spec.templates[].metric.queries[].labels[].name |
labels[].value | string |
组合查询条件中键对应的值,为资源对象的实际属性值。
字段路径:spec.templates[].metric.queries[].labels[].value |
queries[].range | integer |
聚合时间,单位:秒。与聚合算法配合使用,默认为 60s,即使用查询时间前 60 秒内数据进行聚合。
字段路径:spec.templates[].metric.queries[].range |
templates[].name | string |
告警范围。
字段路径:spec.templates[].name |
templates[].notifications | array |
被该告警触发的通知的信息。
字段路径:spec.templates[].notifications |
templates[].threshold | number |
告警阈值。
字段路径:spec.templates[].threshold |
templates[].wait | integer |
持续时间,单位:秒。
字段路径:spec.templates[].wait |