EDB Postgres Enterprise Manager REST APIs v11.0: Alert template v10.2
get__alert_template_
Code samples
# You can also use wget curl -X GET https://PEM-SERVER-IP/api/v11/alert/template/ \ -H 'Accept: application/json' \ -H 'X-Auth-Token: string'
import requests headers = { 'Accept': 'application/json', 'X-Auth-Token': 'string' } r = requests.get('https://PEM-SERVER-IP/api/v11/alert/template/', headers = headers) print(r.json())
const headers = { 'Accept':'application/json', 'X-Auth-Token':'string' }; fetch('https://PEM-SERVER-IP/api/v11/alert/template/', { method: 'GET', headers: headers }) .then(function(res) { return res.json(); }).then(function(body) { console.log(body); });
GET /alert/template/
Gets Alert templates.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
X-Auth-Token | header | string | true | Token of authorization |
Example responses
200 Response
[ { "name": "string", "description": "string", "default_history_retention": 0, "object_type": 0, "sql": "string", "applicable_on_server": "ALL", "default_check_frequency": 0, "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
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful response | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [AlertTemplate] | false | none | none |
» name | string | false | none | Name of the alert template. NOTE: This property is a mandatory parameter for a POST request. |
» description | string | false | none | Description of the alert template. NOTE: This property is a mandatory parameter for a POST request. |
» default_history_retention | integer | false | none | Defines the history retention period in days for this type of alerts. NOTE: This property is a mandatory parameter for a POST request. |
» object_type | integer | false | none | Defines the type of the object to which this alert template applies.
|
» sql | string | false | none | SQL query, possibly parameterized, to get a numeric value indicating threshold reached. NOTE: This property is a mandatory parameter for a POST request. |
» applicable_on_server | string | false | none | Specifies 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_frequency | integer | false | none | Defines how frequently (in minutes) to check for the alert defined in this template. NOTE: This property is a mandatory parameter for a POST request. |
» threshold_unit | string | false | none | Units used to calculate the threshold, such as MB/kB/seconds/days/... This value is only used for the GUI. |
» is_system_template | boolean | false | none | Determines whether the given template is system-defined or user-defined. NOTE: This property is not applicable for POST/PUT requests. |
» is_auto_create | boolean | false | none | Determines 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. |
» operator | string | false | none | Operator to compare threshold values.Only supported for Agent and Server level i.e object_type 100 and 200 respectively. |
» low_threshold_value | number | false | none | Low threshold value.Only supported for Agent and Server level i.e object_type 100 and 200 respectively. |
» medium_threshold_value | number | false | none | Medium threshold value.Only supported for Agent and Server level i.e object_type 100 and 200 respectively. |
» high_threshold_value | number | false | none | High threshold value.Only supported for Agent and Server level i.e object_type 100 and 200 respectively. |
» info_sql | string | false | none | Specifies the SQL query that provides detailed information about the alert on the dashboard. |
Enumerated Values
Property | Value |
---|---|
applicable_on_server | ALL |
applicable_on_server | POSTGRES_SERVER |
applicable_on_server | ADVANCED_SERVER |
operator | > |
operator | < |
Info
This operation does not require authentication
post__alert_template_
Code samples
# You can also use wget curl -X POST https://PEM-SERVER-IP/api/v11/alert/template/ \ -H 'Content-Type: application/json' \ -H 'X-Auth-Token: string'
import requests headers = { 'Content-Type': 'application/json', 'X-Auth-Token': 'string' } r = requests.post('https://PEM-SERVER-IP/api/v11/alert/template/', headers = headers) print(r.json())
const inputBody = '{ "name": "string", "description": "string", "default_history_retention": 0, "object_type": 0, "sql": "string", "applicable_on_server": "ALL", "default_check_frequency": 0, "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" }'; const headers = { 'Content-Type':'application/json', 'X-Auth-Token':'string' }; fetch('https://PEM-SERVER-IP/api/v11/alert/template/', { method: 'POST', body: inputBody, headers: headers }) .then(function(res) { return res.json(); }).then(function(body) { console.log(body); });
POST /alert/template/
Creates alert template.
Body parameter
{ "name": "string", "description": "string", "default_history_retention": 0, "object_type": 0, "sql": "string", "applicable_on_server": "ALL", "default_check_frequency": 0, "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
Name | In | Type | Required | Description |
---|---|---|---|---|
X-Auth-Token | header | string | true | Token of authorization |
body | body | AlertTemplate | true | none |
Example responses
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Status 200 | None |
Response Schema
Info
This operation does not require authentication
get__alert_template_{id}
Code samples
# You can also use wget curl -X GET https://PEM-SERVER-IP/api/v11/alert/template/{id} \ -H 'Accept: application/json' \ -H 'X-Auth-Token: string'
import requests headers = { 'Accept': 'application/json', 'X-Auth-Token': 'string' } r = requests.get('https://PEM-SERVER-IP/api/v11/alert/template/{id}', headers = headers) print(r.json())
const headers = { 'Accept':'application/json', 'X-Auth-Token':'string' }; fetch('https://PEM-SERVER-IP/api/v11/alert/template/{id}', { method: 'GET', headers: headers }) .then(function(res) { return res.json(); }).then(function(body) { console.log(body); });
GET /alert/template/{id}
Gets alert template identified by the ID.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Alert template ID |
X-Auth-Token | header | string | true | Token of authorization |
Example responses
200 Response
{ "name": "string", "description": "string", "default_history_retention": 0, "object_type": 0, "sql": "string", "applicable_on_server": "ALL", "default_check_frequency": 0, "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
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful response | AlertTemplate |
Info
This operation does not require authentication
put__alert_template_{id}
Code samples
# You can also use wget curl -X PUT https://PEM-SERVER-IP/api/v11/alert/template/{id} \ -H 'Content-Type: application/json' \ -H 'X-Auth-Token: string'
import requests headers = { 'Content-Type': 'application/json', 'X-Auth-Token': 'string' } r = requests.put('https://PEM-SERVER-IP/api/v11/alert/template/{id}', headers = headers) print(r.json())
const inputBody = '{ "name": "string", "description": "string", "default_history_retention": 0, "object_type": 0, "sql": "string", "applicable_on_server": "ALL", "default_check_frequency": 0, "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" }'; const headers = { 'Content-Type':'application/json', 'X-Auth-Token':'string' }; fetch('https://PEM-SERVER-IP/api/v11/alert/template/{id}', { method: 'PUT', body: inputBody, headers: headers }) .then(function(res) { return res.json(); }).then(function(body) { console.log(body); });
PUT /alert/template/{id}
Updates alert template.
Body parameter
{ "name": "string", "description": "string", "default_history_retention": 0, "object_type": 0, "sql": "string", "applicable_on_server": "ALL", "default_check_frequency": 0, "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
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Alert template ID |
X-Auth-Token | header | string | true | Token of authorization |
body | body | AlertTemplate | true | none |
Example responses
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Status 200 | None |
Response Schema
Info
This operation does not require authentication
delete__alert_template_{id}
Code samples
# You can also use wget curl -X DELETE https://PEM-SERVER-IP/api/v11/alert/template/{id} \ -H 'X-Auth-Token: string'
import requests headers = { 'X-Auth-Token': 'string' } r = requests.delete('https://PEM-SERVER-IP/api/v11/alert/template/{id}', headers = headers) print(r.json())
const headers = { 'X-Auth-Token':'string' }; fetch('https://PEM-SERVER-IP/api/v11/alert/template/{id}', { method: 'DELETE', headers: headers }) .then(function(res) { return res.json(); }).then(function(body) { console.log(body); });
DELETE /alert/template/{id}
Deletes the alert template.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Alert template ID |
X-Auth-Token | header | string | true | Token of authorization |
Example responses
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful deletion | None |
Response Schema
Info
This operation does not require authentication