Update the alarm template
Requests
HTTP request
PUT /apis/aiops.alauda.io/v1beta1/alerttemplates/{name}
replace the specified AlertTemplate
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
| name | string | True | name of the AlertTemplate |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
| dryRun | string | False | When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed |
| fieldManager | string | False | fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. |
| pretty | string | False | If 'true', then the output is pretty printed. |
Request body
Content-Type
application/json,
application/yaml
Sample request
alertTemplates is the Schema for the 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/updated-at": "2021-06-23T06:03:05.420Z"
},
"creationTimestamp": "2021-06-10T02:50:48Z",
"generation": 1,
"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:labels": {
".": {},
"f:cpaas.io/kind": {}
}
},
"f:spec": {
".": {},
"f:templates": {}
}
},
"manager": "Mozilla",
"operation": "Update",
"time": "2021-06-10T02:50:48Z"
}
],
"name": "test",
"resourceVersion": "8435436",
"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
}
]
}
}Parmeters
| Name | Type | Required | Description |
|---|---|---|---|
| apiVersion | string | True | See common parameters |
| kind | string | True | See common parameters |
| metadata | object | True | See common parameters |
| spec | object | True |
spec contains specification parameters for a template resource
Path: spec |
| spec.templates | array | True |
templates is a list of alert template
Path: spec.templates |
| spec.templates[] | object | True |
template item
Path: spec.templates[] |
| templates[].compare | string | True |
compare of a template
Path: spec.templates[].compare |
| templates[].metric | object | True |
metric info for this alert
Path: spec.templates[].metric |
| metric.queries | array | True |
queries array for this metric
Path: spec.templates[].metric.queries |
| metric.queries[] | object | True |
a query item
Path: spec.templates[].metric.queries[] |
| queries[].aggregator | string | True |
aggregator functions
Path: spec.templates[].metric.queries[].aggregator |
| queries[].labels | array | True |
labels for alert object
Path: spec.templates[].metric.queries[].labels |
| queries[].labels[] | object | True |
labels item for a query
Path: spec.templates[].metric.queries[].labels[] |
| labels[].name | string | True |
label name
Path: spec.templates[].metric.queries[].labels[].name |
| labels[].value | string | True |
label value
Path: spec.templates[].metric.queries[].labels[].value |
| queries[].range | integer | True |
aggregate range
Path: spec.templates[].metric.queries[].range |
| templates[].name | string | True |
alert range
Path: spec.templates[].name |
| templates[].notifications | array | True |
notifications triggered by this alert
Path: spec.templates[].notifications |
| templates[].threshold | number | True |
alert threshold
Path: spec.templates[].threshold |
| templates[].wait | integer | True |
time of duration
Path: spec.templates[].wait |
Responses
Content-Type
application/json,
application/yaml
Status code: 200
OK
Sample response
alertTemplates is the Schema for the 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
}
]
}
}Parameters
| Name | Type | Description |
|---|---|---|
| apiVersion | string | See common parameters |
| kind | string | See common parameters |
| metadata | object | See common parameters |
| spec | object |
spec contains specification parameters for a template resource
Path: spec |
| spec.templates | array |
templates is a list of alert template
Path: spec.templates |
| spec.templates[] | object |
template item
Path: spec.templates[] |
| templates[].compare | string |
compare of a template
Path: spec.templates[].compare |
| templates[].metric | object |
metric info for this alert
Path: spec.templates[].metric |
| metric.queries | array |
queries array for this metric
Path: spec.templates[].metric.queries |
| metric.queries[] | object |
a query item
Path: spec.templates[].metric.queries[] |
| queries[].aggregator | string |
aggregator functions
Path: spec.templates[].metric.queries[].aggregator |
| queries[].labels | array |
labels for alert object
Path: spec.templates[].metric.queries[].labels |
| queries[].labels[] | object |
labels item for a query
Path: spec.templates[].metric.queries[].labels[] |
| labels[].name | string |
label name
Path: spec.templates[].metric.queries[].labels[].name |
| labels[].value | string |
label value
Path: spec.templates[].metric.queries[].labels[].value |
| queries[].range | integer |
aggregate range
Path: spec.templates[].metric.queries[].range |
| templates[].name | string |
alert range
Path: spec.templates[].name |
| templates[].notifications | array |
notifications triggered by this alert
Path: spec.templates[].notifications |
| templates[].threshold | number |
alert threshold
Path: spec.templates[].threshold |
| templates[].wait | integer |
time of duration
Path: spec.templates[].wait |