Alert template
==============

get\_\ *alert_template*
-----------------------

**コードサンプル**

.. code:: shell


   #  You can also use wget

   curl -X GET https://PEM-SERVER-IP/api/v14/alert/template/ \
     -H Accept: application/json \
     -H X-Auth-Token: string

.. code:: python

   import requests
   headers = {
     Accept: application/json,
     X-Auth-Token: string
   }

   r = requests.get(https://PEM-SERVER-IP/api/v14/alert/template/, headers = headers)

   print(r.json())

.. code:: javascript


   const headers = {
     Accept:application/json,
     X-Auth-Token:string
   };

   fetch(https://PEM-SERVER-IP/api/v14/alert/template/,
   {
     method: GET,

     headers: headers
   })
   .then(function(res) {
       return res.json();
   }).then(function(body) {
       console.log(body);
   });

``GET /alert/template/``

アラートテンプレートを取得します。

パラメーター
^^^^^^^^^^^^

.. csv-table::
  :header: Name,In,Type,Required,Description
  :widths: 11,7,7,7,17
  :align: left
  :class: longtable

  X-Auth-Token,header,string,true,承認トークン

**応答例**

.. raw:: html

   <Details summary="200 Response">

.. code:: json

   [
     {
       "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"
     }
   ]

.. raw:: html

   </Details>

応答
^^^^

.. csv-table::
  :header: Status,Meaning,Description,Schema
  :widths: 15,12,12,20
  :align: left
  :class: longtable

  200,:ref:`コマンドラインからのサーバーインストーラーの呼び出し<コマンドラインからのサーバーインストーラーの呼び出し>` ,成功した応答,Inline

レスポンススキーマ
^^^^^^^^^^^^^^^^^^

ステータスコード **200**

.. csv-table::
  :header: Name,Type,Required,Restrictions,Description
  :widths: 12,8,8,8,12
  :align: left
  :class: longtable

  *anonymous*,\ :ref:`Query information <Schemas>` ],false,none,なし
  » name,string,false,none,アラートテンプレートの名前。注 このプロパティは、POST要求の必須パラメーターです。
  » description,string,false,none,アラートテンプレートの説明。注 このプロパティは、POST要求の必須パラメーターです。
  » object_type,integer,false,none,このアラートテンプレートを適用するオブジェクトのタイプを定義します。 <ul><li>システム全体のアラートテンプレートは<b>50</b>です。</li><li>エージェントに適用されるアラートテンプレートは<b>100</b>です。</li> <li>管理対象サーバーに適用されるアラートテンプレートは<b>200</b>です。</li><li>特定の監視対象サーバーのデータベースに適用されるアラートテンプレートは<b>300</b>です。 </li><li>管理対象サーバーの特定のデータベースのスキーマに適用されるアラートテンプレートは<b>400</b>です。</li><li>特定のスキーマのテーブルに適用されるアラートテンプレート</li><li>監視対象サーバー上のデータベースの特定のスキーマのインデックスに適用されるアラートテンプレートは<b>600</b>です。 >.</li><li>監視対象サーバー上のデータベースの特定のスキーマのシーケンスに適用できるアラートテンプレートは<b>700</b>です。</li><li>に適用できるアラートテンプレート監視対象サーバー上のデータベースの特定のスキーマのファンクションは<b>800</b>です。</li></ul>注 このプロパティは、POST要求の必須パラメーターです。
  » param_names,[string],false,none,パラメーターの名前を定義します。
  » param_types,string,false,none,パラメーターのタイプを定義します。例 INTEGER/STRING..
  » params_units,[string],false,none,パラメーターに使用される単位を定義します。例 'DAYS'、'True or False'、'Hours'、'Minutes'など
  » sql,string,false,none,しきい値に到達したことを示す数値を取得するためのSQLクエリー。パラメーター化される場合があります。注 このプロパティは、POST要求の必須パラメーターです。
  » applicable_on_server,string,false,none,テンプレートを適用する監視対象サーバーの種類を指定します。使用可能な値は、ALL、POSTGRES_SERVER、およびADVANCED_SERVERです。注 このプロパティは、POST要求の必須パラメーターです。
  » default_check_frequency,integer,false,none,このテンプレートで定義されたアラートをチェックする頻度を分単位で定義します。注 このプロパティは、POST要求の必須パラメーターです。
  » default_history_retention,integer,false,none,このタイプのアラートの履歴保持期間を日単位で定義します。注 このプロパティは、POST要求の必須パラメーターです。
  » probe_dependency_list,[string],false,none,アラートテンプレートが依存するプローブのリストを定義します。
  » threshold_unit,string,false,none,MB/kB/秒/日/...などの、しきい値の計算に使用される単位 この値は、GUIでのみ使用されます。
  » is_system_template,boolean,false,none,指定されたテンプレートがシステム定義であるかユーザー定義であるかを判断します。注このプロパティは、POST/PUT要求には適用されません。
  » is_auto_create,boolean,false,none,エージェントまたはサーバーがPEMに追加されたらすぐにアラートを作成するかどうかを決定します。注 エージェントおよびサーバーレベル、つまりobject_type 100および200でのみサポートされています。
  » operator,string,false,none,しきい値を比較する演算子。エージェントおよびサーバーレベル、つまりobject_type 100および200でのみサポートされています。
  » low_threshold_value,number,false,none,低しきい値。エージェントおよびサーバーレベル、つまりobject_type 100および200でのみサポートされています。
  » medium_threshold_value,number,false,none,中しきい値。エージェントおよびサーバーレベル、つまりobject_type 100および200でのみサポートされています。
  » high_threshold_value,number,false,none,高しきい値。エージェントおよびサーバーレベル、つまりobject_type 100および200でのみサポートされています。
  » info_sql,string,false,none,ダッシュボードのアラートに関する詳細情報を提供するSQLクエリーを指定します。

列挙値
''''''

.. csv-table::
  :header: Property,Value
  :widths: 25,25
  :align: left
  :class: longtable

  applicable_on_server,ALL
  applicable_on_server,POSTGRES_SERVER
  applicable_on_server,ADVANCED_SERVER
  operator,>
  operator,&lt;

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

post\_\ *alert_template*
------------------------

**コードサンプル**

.. code:: shell


   #  You can also use wget

   curl -X POST https://PEM-SERVER-IP/api/v14/alert/template/ \
     -H Content-Type: application/json \
     -H X-Auth-Token: string

.. code:: python

   import requests
   headers = {
     Content-Type: application/json,
     X-Auth-Token: string
   }

   r = requests.post(https://PEM-SERVER-IP/api/v14/alert/template/, headers = headers)

   print(r.json())

.. code:: javascript

   const inputBody = {
     "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"
   };
   const headers = {
     Content-Type:application/json,
     X-Auth-Token:string
   };

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

``POST /alert/template/``

アラートテンプレートを作成します。

**ボディパラメーター**

.. code:: json

   {
     "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"
   }

.. _パラメーター-1:

パラメーター
^^^^^^^^^^^^

.. csv-table::
  :header: Name,In,Type,Required,Description
  :widths: 11,7,7,7,17
  :align: left
  :class: longtable

  X-Auth-Token,header,string,true,承認トークン
  body,body,:ref:`AlertTemplatePost<AlertTemplatePost>` ,true,なし

**応答例**

.. _応答-1:

応答
^^^^

.. csv-table::
  :header: Status,Meaning,Description,Schema
  :widths: 15,12,12,20
  :align: left
  :class: longtable

  200,:ref:`コマンドラインからのサーバーインストーラーの呼び出し<コマンドラインからのサーバーインストーラーの呼び出し>` ,ステータス200,None

.. _レスポンススキーマ-1:

レスポンススキーマ
^^^^^^^^^^^^^^^^^^

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

get\_\ *alert_template*\ {id}
-----------------------------

**コードサンプル**

.. code:: shell


   #  You can also use wget

   curl -X GET https://PEM-SERVER-IP/api/v14/alert/template/{id} \
     -H Accept: application/json \
     -H X-Auth-Token: string

.. code:: python

   import requests
   headers = {
     Accept: application/json,
     X-Auth-Token: string
   }

   r = requests.get(https://PEM-SERVER-IP/api/v14/alert/template/{id}, headers = headers)

   print(r.json())

.. code:: javascript


   const headers = {
     Accept:application/json,
     X-Auth-Token:string
   };

   fetch(https://PEM-SERVER-IP/api/v14/alert/template/{id},
   {
     method: GET,

     headers: headers
   })
   .then(function(res) {
       return res.json();
   }).then(function(body) {
       console.log(body);
   });

``GET /alert/template/{id}``

IDで識別されるアラートテンプレートを取得します。

.. _パラメーター-2:

パラメーター
^^^^^^^^^^^^

.. csv-table::
  :header: Name,In,Type,Required,Description
  :widths: 11,7,7,7,17
  :align: left
  :class: longtable

  id,path,integer,true,アラートテンプレートID
  X-Auth-Token,header,string,true,承認トークン

**応答例**

.. raw:: html

   <Details summary="200 Response">

.. code:: json

   {
     "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"
   }

.. raw:: html

   </Details>

.. _応答-2:

応答
^^^^

.. csv-table::
  :header: Status,Meaning,Description,Schema
  :widths: 15,12,12,20
  :align: left
  :class: longtable

  200,:ref:`コマンドラインからのサーバーインストーラーの呼び出し<コマンドラインからのサーバーインストーラーの呼び出し>` ,成功した応答,:ref:`AlertTemplateParams<AlertTemplateParams>` 

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

put\_\ *alert_template*\ {id}
-----------------------------

**コードサンプル**

.. code:: shell


   #  You can also use wget

   curl -X PUT https://PEM-SERVER-IP/api/v14/alert/template/{id} \
     -H Content-Type: application/json \
     -H X-Auth-Token: string

.. code:: python

   import requests
   headers = {
     Content-Type: application/json,
     X-Auth-Token: string
   }

   r = requests.put(https://PEM-SERVER-IP/api/v14/alert/template/{id}, headers = headers)

   print(r.json())

.. code:: javascript

   const inputBody = {
     "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"
   };
   const headers = {
     Content-Type:application/json,
     X-Auth-Token:string
   };

   fetch(https://PEM-SERVER-IP/api/v14/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}``

アラートテンプレートを更新します。

**ボディパラメーター**

.. code:: json

   {
     "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"
   }

.. _パラメーター-3:

パラメーター
^^^^^^^^^^^^

.. csv-table::
  :header: Name,In,Type,Required,Description
  :widths: 11,7,7,7,17
  :align: left
  :class: longtable

  id,path,integer,true,アラートテンプレートID
  X-Auth-Token,header,string,true,承認トークン
  body,body,:ref:`AlertTemplatePut<AlertTemplatePut>` ,true,なし

**応答例**

.. _応答-3:

応答
^^^^

.. csv-table::
  :header: Status,Meaning,Description,Schema
  :widths: 15,12,12,20
  :align: left
  :class: longtable

  200,:ref:`コマンドラインからのサーバーインストーラーの呼び出し<コマンドラインからのサーバーインストーラーの呼び出し>` ,ステータス200,None

.. _レスポンススキーマ-2:

レスポンススキーマ
^^^^^^^^^^^^^^^^^^

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

delete\_\ *alert_template*\ {id}
--------------------------------

**コードサンプル**

.. code:: shell


   #  You can also use wget

   curl -X DELETE https://PEM-SERVER-IP/api/v14/alert/template/{id} \
     -H X-Auth-Token: string

.. code:: python

   import requests
   headers = {
     X-Auth-Token: string
   }

   r = requests.delete(https://PEM-SERVER-IP/api/v14/alert/template/{id}, headers = headers)

   print(r.json())

.. code:: javascript


   const headers = {
     X-Auth-Token:string
   };

   fetch(https://PEM-SERVER-IP/api/v14/alert/template/{id},
   {
     method: DELETE,

     headers: headers
   })
   .then(function(res) {
       return res.json();
   }).then(function(body) {
       console.log(body);
   });

``DELETE /alert/template/{id}``

アラートテンプレートを削除します。

.. _パラメーター-4:

パラメーター
^^^^^^^^^^^^

.. csv-table::
  :header: Name,In,Type,Required,Description
  :widths: 11,7,7,7,17
  :align: left
  :class: longtable

  id,path,integer,true,アラートテンプレートID
  X-Auth-Token,header,string,true,承認トークン

**応答例**

.. _応答-4:

応答
^^^^

.. csv-table::
  :header: Status,Meaning,Description,Schema
  :widths: 15,12,12,20
  :align: left
  :class: longtable

  200,:ref:`コマンドラインからのサーバーインストーラーの呼び出し<コマンドラインからのサーバーインストーラーの呼び出し>` ,削除が成功しました。,None

.. _レスポンススキーマ-3:

レスポンススキーマ
^^^^^^^^^^^^^^^^^^

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