Home / API Documentation / Operations center / Alert templates / View alarm template details

View alarm template details

Requests

HTTP request

GET /apis/aiops.alauda.io/v1beta1/alerttemplates/{name}

read the specified AlertTemplate

Path parameters

Name Type Required Description
name string Truename of the AlertTemplate

Query parameters

Name Type Required Description
resourceVersion string FalseWhen specified: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.
pretty string FalseIf 'true', then the output is pretty printed.

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

Other status codes

Status code: 401

Unauthorized