Import Custom Alert Templates#

post_alert_custom_import#

コードサンプル

#  You can also use wget

curl -X POST https://PEM-SERVER-IP/api/v14/alert/custom/import/ \
  -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/v14/alert/custom/import/, headers = headers)

print(r.json())
const inputBody = {
  "version": 1,
  "skip_overwrite": true,
  "skip_overwrite_probe": true,
  "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"
        }
      ]
    }
  ]
};
const headers = {
  Content-Type:application/json,
  Accept:application/json,
  X-Auth-Token:string
};

fetch(https://PEM-SERVER-IP/api/v14/alert/custom/import/,
{
  method: POST,
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

POST /alert/custom/import/

エクスポートされたアラートテンプレートを使用して、カスタムアラートテンプレートをインポートします。

ボディパラメーター

{
  "version": 1,
  "skip_overwrite": true,
  "skip_overwrite_probe": true,
  "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"
        }
      ]
    }
  ]
}

パラメーター#

Name

In

Type

Required

Description

X-Auth-Token

header

string

true

承認トークン

body

body

CustomAlertTemplateImportPostData

true

なし

応答例

[
  {
    "name": "string",
    "status": "string",
    "msg": "string"
  }
]

応答#

Status

Meaning

Description

Schema

200

コマンドラインからのサーバーインストーラーの呼び出し

ステータス200

Inline

レスポンススキーマ#

ステータスコード 200

Name

Type

Required

Restrictions

Description

» name

string

true

none

なし

» status

string

true

none

なし

» msg

string

true

none

なし

注釈

この操作には認証が必要ありません