EDB Postgres Enterprise Manager REST APIs v14.0: Export Custom Alert Templates v10.2

post__alert_custom_export_

Code samples

POST /alert/custom/export/

Exports custom alert templates.

Body parameter

{
  "alert_templates": [
    0
  ]
}

Parameters

NameInTypeRequiredDescription
X-Auth-TokenheaderstringtrueToken of authorization
bodybodyCustomAlertTemplateExportDatatruenone

Example responses

200 Response
{
  "version": 0,
  "items": [
    {
      "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,
              "any_extension_version": true,
              "extension_name": "string",
              "interval": 0,
              "lifetime": 0,
              "discard_history": true,
              "platform": "unix",
              "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",
                  "extension_version": 0
                }
              ],
              "internal_name": "string"
            }
          ]
        }
      ]
    }
  ]
}

Responses

StatusMeaningDescriptionSchema
200OKSuccessful responseInline

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» versionintegerfalsenoneExport version id
» items[CustomAlertTemplateExportResponseData]falsenonenone
»» versionintegerfalsenoneVersion of the alert template export
»» alert_templates[AlertImportExportTemplate]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.
»»» reference_idstringfalsenoneInternal identifier for the alert template
»»» 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.
»»» 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.
»»» sqlstringfalsenoneSQL query, possibly parameterized, to get a numeric value indicating the 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, ADVANCED_SERVER. NOTE: This property is a mandatory parameter for a POST request.
»»» default_check_frequencyintegerfalsenoneSpecifies how frequently (in minutes) to check for the alert that this template defines. NOTE: This property is a mandatory parameter for a POST request.
»»» 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..
»»» thresholds[number]falsenoneDefault threshold values. Values in the thresholds array must be in a sorted order based on the operator.
»»» operatorstringfalsenoneOperator to compare threshold values
»»» high_threshold_valuestringfalsenoneHigh threshold value
»»» medium_threshold_valuestringfalsenoneMedium threshold value
»»» low_threshold_valuestringfalsenoneLow threshold value
»»» info_sqlstringfalsenoneDefines the SQL query that provides detailed information about the alert on the dashboard.
»»» probes[allOf]falsenonenone

allOf

NameTypeRequiredRestrictionsDescription
»»»» anonymousCustomProbePostDatafalsenonenone
»»»»» probe_namestringfalsenoneName of the probe
»»»»» collection_methodstringfalsenoneDefines the method of statistics collection. PEM supports three methods for custom made probes: SQL, WMI, or batch/shell script.
  • 'w' stands for WMI script.
    This type of script only applies to the Windows platform, and the target_type is 100 (for agent).
  • 'b' stands for batch/shell script. The 'target_type' for this script is always 100 (agent). This script behaves as a batch script on Windows and a shell script on other platforms.
  • 's' stands for SQL script. The 'target_type' is always 200 (server), 300 (database), 400 (schema), 500 (table), 600 (index), 700 (sequence), 800 (function), 900 (view) or 1000 (extension).
»»»»» enabledbooleanfalsenoneDetermines whether whether the probe is enabled/disabled by default.
»»»»» target_typeintegerfalsenoneDefines the type of the object to which the probe applies.
  • A probe with target_type 100 is responsible for collecting statistics for an agent.
  • A probe with target_type 200 is responsible for collecting statistics for a monitored server.
  • A probe with target_type 300 is responsible for collecting statistics for a database.
  • A probe with target_type 400 is responsible for collecting statistics for a schema.
  • A probe with target_type 500 is responsible for collecting statistics for a table.
  • A probe with target_type 600 is responsible for collecting statistics for a index.
  • A probe with target_type 700 is responsible for collecting statistics for a sequence.
  • A probe with target_type 800 is responsible for collecting statistics for a function.
  • A probe with target_type 900 is responsible for collecting statistics for a view.
  • A probe with target_type 1000 is responsible for collecting statistics for a extension.
»»»»» any_server_versionbooleanfalsenoneDetermines whether this probe applies to any version of a Postgres variant. For more details, please consult the documentation.
»»»»» any_extension_versionbooleanfalsenoneDetermines whether this probe applies to any version of a Extension variant. For more details, please consult the documentation.
»»»»» extension_namestringfalsenoneName of the extension.
    Valid names are edbspl , plpgsql , hstore , pldbgapi , edb_dblink_oci , edb_dblink_libpq , sslutils .
»»»»» intervalintegerfalsenoneDefines how frequently the probe collects statistics (in seconds).Must be greater than or equal to 10
»»»»» lifetimeintegerfalsenoneDefines the history data retention time (in days). Valid range is 1-365. This value does not have any effect if 'discard_history' is set to true.
»»»»» discard_historybooleanfalsenoneDefines whether to discard history data. When 'discard_history' is set to false, no history data is stored for this probe.
»»»»» platformstringfalsenoneDefines the platform where this probe can run. This value only applies to an agent-level probe.
»»»»» probe_codestringfalsenoneA SQL/Batch script/Shell script/WMI script to collect the statistics as per definition of the code.
»»»»» probe_columns[object]falsenonenone
»»»»»» pc_namestringfalsenoneColumn name
»»»»»» pc_data_typestringfalsenoneData type of the column.
Supported datatypes are:
      bigint
      char
      decimal
      double precision
      integer
      numeric
      real
      text
      text[]
      timestamp
      timestamptz
»»»»»» pc_unitstringfalsenoneReturns the unit of the column.
»»»»»» pc_col_typestringfalsenoneReturns the columns as 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_graphablebooleanfalsenoneDetermines whether the data of the column can be graphed on a chart.
»»»»»» pc_calc_pitbooleanfalsenoneDetermines whether the server calculates point-in-time for metric data for this column.
»»»»»» pc_pit_defaultbooleanfalsenoneDetermines whether metric data is stored by point-in-time by default. Please refer to the 'Custom Probes' section in the documentation for detailed information.
»»»»» alternate_code[AlternateServerProbeCode]falsenonenone
»»»»»» server_version_idintegerfalsenoneServer version ID for the monitored server
server_version_idDatabase Server
10905PostgreSQL 9.5
10906PostgreSQL 9.6
11000PostgreSQL 10
11100PostgreSQL 11
11200PostgreSQL 12
11300PostgreSQL 13
20905Postgres Plus Advanced Server 9.5
20906Postgres Plus Advanced Server 9.6
21000EDB Postgres Advanced Server 10
21100EDB Postgres Advanced Server 11
21200EDB Postgres Advanced Server 12
21300EDB Postgres Advanced Server 13
»»»»»» server_probe_codestringfalsenoneSQL query to run on the specified server version
»»»»»» extension_versionintegerfalsenoneSpecifies the extension version. Valid for extension target type

and

NameTypeRequiredRestrictionsDescription
»»»» anonymousobjectfalsenonenone
»»»»» internal_namestringfalsenoneInternal name of the probe from the system where probe was exported
Enumerated Values
PropertyValue
applicable_on_serverALL
applicable_on_serverPOSTGRES_SERVER
applicable_on_serverADVANCED_SERVER
operator>
operator<
collection_methodw
collection_methodb
collection_methods
platformunix
platformwindows
pc_data_typebigint
pc_data_typechar
pc_data_typedecimal
pc_data_typedouble precision
pc_data_typeinteger
pc_data_typenumeric
pc_data_typereal
pc_data_typetext
pc_data_typetext[]
pc_data_typetimestamp
pc_data_typetimestamptz
pc_col_typem
pc_col_typek
Info

This operation does not require authentication