EDB Postgres Enterprise Manager REST APIs v14.0: Alert template v10.2

get__alert_template_

Code samples

GET /alert/template/

Gets Alert templates.

Parameters

NameInTypeRequiredDescription
X-Auth-TokenheaderstringtrueToken of authorization

Example responses

200 Response
[
  {
    "name": "string",
    "description": "string",
    "object_type": 0,
    "param_names": [
      "string"
    ],
    "param_types": "string",
    "params_units": [
      "string"
    ],
    "sql": "string",
    "applicable_on_server": "ALL",
    "default_check_frequency": 0,
    "default_history_retention": 0,
    "probe_dependency_list": [
      "string"
    ],
    "threshold_unit": "string",
    "is_system_template": false,
    "is_auto_create": true,
    "operator": ">",
    "low_threshold_value": 0,
    "medium_threshold_value": 0,
    "high_threshold_value": 0,
    "info_sql": "string"
  }
]

Responses

StatusMeaningDescriptionSchema
200OKSuccessful responseInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
anonymous[AlertTemplate]falsenonenone
» namestringfalsenoneName of the alert template. NOTE: This property is a mandatory parameter for a POST request.
» descriptionstringfalsenoneDescription of the alert template. NOTE: This property is a mandatory parameter for a POST request.
» object_typeintegerfalsenoneDefines the type of the object to which this alert template applies.
  • A system-wide alert template is 50.
  • An alert template applicable to an agent is 100.
  • An alert template applicable to a managed server is 200.
  • An alert template applicable to a database for a particular monitored server is 300.
  • An alert template applicable to a schema on a particular database for the managed server is 400.
  • An alert template applicable to a table on a particular schema for the database on a monitored server is 500.
  • An alert template applicable to an index on a particular schema for the database on a monitored server is 600.
  • An alert template applicable to a sequence on a particular schema for the database on a monitored server is 700.
  • An alert template applicable to a function on a particular schema for the database on a monitored server is 800.
NOTE: This property is a mandatory parameter for a POST request.
» param_names[string]falsenoneDefines the name of parameters.
» param_typesstringfalsenoneDefines the type of parameters. Example: INTEGER/STRING..
» params_units[string]falsenoneDefines the unit used for parameters.Example: 'DAYS','True or False','Hours','Minutes' etc
» sqlstringfalsenoneSQL query, possibly parameterized, to get a numeric value indicating threshold reached. NOTE: This property is a mandatory parameter for a POST request.
» applicable_on_serverstringfalsenoneSpecifies the type of monitored server to which the template applies. Possible values are ALL, POSTGRES_SERVER, and ADVANCED_SERVER. NOTE: This property is a mandatory parameter for a POST request.
» default_check_frequencyintegerfalsenoneDefines how frequently (in minutes) to check for the alert defined in this template. NOTE: This property is a mandatory parameter for a POST request.
» default_history_retentionintegerfalsenoneDefines the history retention period in days for this type of alerts. NOTE: This property is a mandatory parameter for a POST request.
» probe_dependency_list[string]falsenoneDefines the list of probes on which alert template is dependent.
» threshold_unitstringfalsenoneUnits used to calculate the threshold, such as MB/kB/seconds/days/... This value is only used for the GUI.
» is_system_templatebooleanfalsenoneDetermines whether the given template is system-defined or user-defined. NOTE: This property is not applicable for POST/PUT requests.
» is_auto_createbooleanfalsenoneDetermines whether an alert should be created as soon as an agent or server is added to PEM.Note: Only supported for Agent and Server level i.e object_type 100 and 200 respectively.
» operatorstringfalsenoneOperator to compare threshold values.Only supported for Agent and Server level i.e object_type 100 and 200 respectively.
» low_threshold_valuenumberfalsenoneLow threshold value.Only supported for Agent and Server level i.e object_type 100 and 200 respectively.
» medium_threshold_valuenumberfalsenoneMedium threshold value.Only supported for Agent and Server level i.e object_type 100 and 200 respectively.
» high_threshold_valuenumberfalsenoneHigh threshold value.Only supported for Agent and Server level i.e object_type 100 and 200 respectively.
» info_sqlstringfalsenoneSpecifies the SQL query that provides detailed information about the alert on the dashboard.
Enumerated Values
PropertyValue
applicable_on_serverALL
applicable_on_serverPOSTGRES_SERVER
applicable_on_serverADVANCED_SERVER
operator>
operator<
Info

This operation does not require authentication

post__alert_template_

Code samples

POST /alert/template/

Creates alert template.

Body parameter

{
  "name": "string",
  "description": "string",
  "object_type": 0,
  "params": [
    {
      "param_types": "STRING",
      "param_units": "KK",
      "param_names": "param_1"
    }
  ],
  "sql": "string",
  "applicable_on_server": "ALL",
  "default_check_frequency": 0,
  "default_history_retention": 0,
  "probe_dependency_list": [
    {
      "internal_name": "probe_name"
    }
  ],
  "threshold_unit": "string",
  "is_system_template": false,
  "is_auto_create": true,
  "operator": ">",
  "low_threshold_value": 0,
  "medium_threshold_value": 0,
  "high_threshold_value": 0,
  "info_sql": "string"
}

Parameters

NameInTypeRequiredDescription
X-Auth-TokenheaderstringtrueToken of authorization
bodybodyAlertTemplatePosttruenone

Example responses

Responses

StatusMeaningDescriptionSchema
200OKStatus 200None

Response Schema

Info

This operation does not require authentication

get__alert_template_{id}

Code samples

GET /alert/template/{id}

Gets alert template identified by the ID.

Parameters

NameInTypeRequiredDescription
idpathintegertrueAlert template ID
X-Auth-TokenheaderstringtrueToken of authorization

Example responses

200 Response
{
  "name": "string",
  "description": "string",
  "object_type": 0,
  "param_names": [
    "string"
  ],
  "param_types": "string",
  "params_units": [
    "string"
  ],
  "sql": "string",
  "applicable_on_server": "ALL",
  "default_check_frequency": 0,
  "default_history_retention": 0,
  "probe_dependency_list": [
    "string"
  ],
  "threshold_unit": "string",
  "is_system_template": false,
  "is_auto_create": true,
  "operator": ">",
  "low_threshold_value": 0,
  "medium_threshold_value": 0,
  "high_threshold_value": 0,
  "info_sql": "string"
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessful responseAlertTemplate
Info

This operation does not require authentication

put__alert_template_{id}

Code samples

PUT /alert/template/{id}

Updates alert template.

Body parameter

{
  "name": "string",
  "description": "string",
  "sql": "string",
  "applicable_on_server": "ALL",
  "default_check_frequency": 0,
  "default_history_retention": 0,
  "probe_dependency_list": {
    "deleted": [
      {
        "internal_name": "probe_name"
      }
    ],
    "added": [
      {
        "internal_name": "probe_name"
      }
    ]
  },
  "threshold_unit": "string",
  "is_system_template": false,
  "info_sql": "string"
}

Parameters

NameInTypeRequiredDescription
idpathintegertrueAlert template ID
X-Auth-TokenheaderstringtrueToken of authorization
bodybodyAlertTemplatePuttruenone

Example responses

Responses

StatusMeaningDescriptionSchema
200OKStatus 200None

Response Schema

Info

This operation does not require authentication

delete__alert_template_{id}

Code samples

DELETE /alert/template/{id}

Deletes the alert template.

Parameters

NameInTypeRequiredDescription
idpathintegertrueAlert template ID
X-Auth-TokenheaderstringtrueToken of authorization

Example responses

Responses

StatusMeaningDescriptionSchema
200OKSuccessful deletionNone

Response Schema

Info

This operation does not require authentication