EDB Postgres Enterprise Manager REST APIs v6.0: Export Custom Alert Templates v10.2
post__alert_custom_export_
Code samples
# You can also use wget curl -X POST https://PEM-SERVER-IP/api/v6/alert/custom/export/ \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'X-Auth-Token: string'
import requests headers = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-Auth-Token': 'string' } r = requests.post('https://PEM-SERVER-IP/api/v6/alert/custom/export/', headers = headers) print(r.json())
const inputBody = '{ "alert_templates": [ 0 ] }'; const headers = { 'Content-Type':'application/json', 'Accept':'application/json', 'X-Auth-Token':'string' }; fetch('https://PEM-SERVER-IP/api/v6/alert/custom/export/', { method: 'POST', body: inputBody, headers: headers }) .then(function(res) { return res.json(); }).then(function(body) { console.log(body); });
POST /alert/custom/export/
Export custom alert templates
Body parameter
{ "alert_templates": [ 0 ] }
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
X-Auth-Token | header | string | true | Token of authorization |
body | body | CustomAlertTemplateExportData | true | none |
Example responses
200 Response
[ { "version": 1, "alert_templates": [ { "name": "string", "description": "string", "reference_id": "string", "default_history_retention": 0, "object_type": 0, "sql": "string", "applicable_on_server": "ALL", "default_check_frequency": 0, "threshold_unit": "string", "is_system_template": true, "is_auto_create": true, "thresholds": [ 0 ], "operator": ">", "high_threshold_value": "string", "medium_threshold_value": "string", "low_threshold_value": "string", "info_sql": "string", "probes": [ { "probe_name": "string", "collection_method": "w", "enabled": true, "target_type": 0, "any_server_version": true, "interval": 0, "lifetime": 0, "discard_history": true, "platform": "string", "probe_code": "string", "probe_columns": [ { "pc_name": "string", "pc_data_type": "bigint", "pc_unit": "string", "pc_col_type": "m", "pc_graphable": true, "pc_calc_pit": true, "pc_pit_default": true } ], "alternate_code": [ { "server_version_id": 0, "server_probe_code": "string" } ], "internal_name": "string" } ] } ] } ]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful response | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [CustomAlertTemplateExportResponseData] | false | none | none |
» version | integer | false | none | Version of the alert template export. |
» alert_templates | [AlertImportExportTemplate] | false | none | none |
»» name | string | false | none | Name of the alert template. NOTE: It is a mandatory parameter for the POST request. |
»» description | string | false | none | Description about the alert template. NOTE: It is a mandatory parameter for the POST request. |
»» reference_id | string | false | none | Internal identifier for the alert template. |
»» default_history_retention | integer | false | none | Defines the history retention period in days for this type of alerts. NOTE: It is a mandatory parameter for the POST request. |
»» object_type | integer | false | none | Defines the type of the object on which this alert template is applicable to.
|
»» sql | string | false | none | SQL query, possibly parameterized, to get a numeric indicating threshold reached. NOTE: It is a mandatory parameter for the POST request. |
»» applicable_on_server | string | false | none | Template is applicable on which type of monitored server. Possible values are ALL, POSTGRES_SERVER, ADVANCED_SERVER. NOTE: It is a mandatory parameter for the POST request. |
»» default_check_frequency | integer | false | none | Defines how frequently to check for the alert defined from this template (in minutes). NOTE: It is a mandatory parameter for the POST request. |
»» threshold_unit | string | false | none | Unit in which threshold is calculated; purely for GUI, like MB/kB/seconds/days/... |
»» is_system_template | boolean | false | none | Defines whether the given template is system defined or user defined. NOTE: It is not applicable for the the POST/PUT requests. |
»» is_auto_create | boolean | false | none | Whether alert should be created as soon as agent or server is added to pem. |
»» thresholds | [number] | false | none | Default threshold values. Values in the thresholds array must be in the sorted order based on the operator. |
»» operator | string | false | none | Operator to compare threshold values. |
»» high_threshold_value | string | false | none | High threshold value. |
»» medium_threshold_value | string | false | none | Medium threshold value. |
»» low_threshold_value | string | false | none | Low threshold value. |
»» info_sql | string | false | none | Specify the SQL query that will provide the detailed information about that alert on Dashboard. |
»» probes | [allOf] | false | none | none |
allOf
Name | Type | Required | Restrictions | Description | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
»»» anonymous | CustomProbePostData | false | none | none | ||||||||||||||||||||||||||
»»»» probe_name | string | false | none | Name of the probe. | ||||||||||||||||||||||||||
»»»» collection_method | string | false | none | Defines the method of statistics collection. PEM supports three methods for custom made probes. i.e. SQL, WMI, Batch/Shell script.
| ||||||||||||||||||||||||||
»»»» enabled | boolean | false | none | Defines whether the probe is enabled/disabled by default. | ||||||||||||||||||||||||||
»»»» target_type | integer | false | none | Defines the type of the object on which the probe is applicable to.
| ||||||||||||||||||||||||||
»»»» any_server_version | boolean | false | none | Defines whether this probe is applicable to any version of Postgres variant. For more details, please follow the documenation. | ||||||||||||||||||||||||||
»»»» interval | integer | false | none | Defines how frequently the probe will collect the statistics (in seconds). | ||||||||||||||||||||||||||
»»»» lifetime | integer | false | none | Defines the history data retention time (in days). It does not have any effect, if 'discard_history' is set to true. | ||||||||||||||||||||||||||
»»»» discard_history | boolean | false | none | Defines whether to discard the history data. It will not store the history of the data for this probe, when 'discard_history' is set to false. | ||||||||||||||||||||||||||
»»»» platform | string | false | none | Defines on which platform this probe can run on. It is only applicable to an agent level probe. | ||||||||||||||||||||||||||
»»»» probe_code | string | false | none | A SQL/Batch script/Shell script/WMI script to collect the statistics as per definition of the code. | ||||||||||||||||||||||||||
»»»» probe_columns | [object] | false | none | none | ||||||||||||||||||||||||||
»»»»» pc_name | string | false | none | Name of the column | ||||||||||||||||||||||||||
»»»»» pc_data_type | string | false | none | Data type of the column. Supported datatypes are:
| ||||||||||||||||||||||||||
»»»»» pc_unit | string | false | none | Returns the unit of the column. | ||||||||||||||||||||||||||
»»»»» pc_col_type | string | false | none | Returns the columns is part of the primary key of the internal table, or not. 'k' stands for a key column, and 'm' stands for a member/normal column. | ||||||||||||||||||||||||||
»»»»» pc_graphable | boolean | false | none | Returns whether the data of the column is graphable on a chart, or not. | ||||||||||||||||||||||||||
»»»»» pc_calc_pit | boolean | false | none | Returns whether server calculates the point-in-time for the metric data for this column. | ||||||||||||||||||||||||||
»»»»» pc_pit_default | boolean | false | none | Returns the metric is stored by point-in-time by default. Please refer the 'Custom Probes' section in the documentation for detailed information. | ||||||||||||||||||||||||||
»»»» alternate_code | [AlternateServerProbeCode] | false | none | none | ||||||||||||||||||||||||||
»»»»» server_version_id | integer | false | none | Server version id for the support monitored server
| ||||||||||||||||||||||||||
»»»»» server_probe_code | string | false | none | SQL query to run on the specified server version |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»»» anonymous | object | false | none | none |
»»»» internal_name | string | false | none | Internal name of the probe from the system where probe was exported. |
Enumerated Values
Property | Value |
---|---|
applicable_on_server | ALL |
applicable_on_server | POSTGRES_SERVER |
applicable_on_server | ADVANCED_SERVER |
operator | > |
operator | < |
collection_method | w |
collection_method | b |
collection_method | s |
pc_data_type | bigint |
pc_data_type | char |
pc_data_type | decimal |
pc_data_type | double precision |
pc_data_type | integer |
pc_data_type | numeric |
pc_data_type | real |
pc_data_type | text |
pc_data_type | text[] |
pc_data_type | timestamp |
pc_data_type | timestamptz |
pc_col_type | m |
pc_col_type | k |
Info
This operation does not require authentication
- On this page
- post__alert_custom_export_