Profiles
========

Manage Profiles API
ドラフトを作成、リスト、更新、公開/ロールバック、およびサーバーとエージェントのプロファイルの再割り当て/削除を行います。

get\_\ *profiles*
-----------------

**コードサンプル**

.. code:: shell


   #  You can also use wget

   curl -X GET https://PEM-SERVER-IP/pem/api/v17/profiles/ \
     -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/pem/api/v17/profiles/, headers = headers)

   print(r.json())

.. code:: javascript

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

   fetch("https://PEM-SERVER-IP/pem/api/v17/profiles/", {
     method: "GET",

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

``GET /profiles/``

*リストプロファイル*

公開されたプロファイルのみの概要リストを返します。公開されたプロファイルの下書きが存在する場合、項目にはそのプロファイルのIDが示され、
’published’はfalseです。応答には、’target_probe_configs’または’target_alert_configs’は含まれません。
``name`` 完全一致または\ ``name_contains``
部分文字列検索クエリパラメーターを介してオプションの名前ベースのフィルタリングをサポートします。

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

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

  X-Auth-Token,header,string,true,認証用のトークン
  name,query,string,false,名前の完全な一致大文字と小文字を区別してプロファイルをフィルタリングします。 name_containsと相互排他的。
  name_contains,query,string,false,部分文字列一致大文字と小文字を区別してプロファイルをフィルタリングします。 nameと相互排他的。

**応答例**

.. raw:: html

   <Details summary="200 Response">

.. code:: json

   [
     {
       "id": 34,
       "name": "Production Agents",
       "description": "Monitoring production agents",
       "target_kind": "a",
       "active_assignments": 0,
       "published": true
     }
   ]

.. raw:: html

   </Details>

応答
^^^^

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

  200,:ref:`コマンドラインからのサーバーインストーラーの呼び出し<コマンドラインからのサーバーインストーラーの呼び出し>` ,成功した応答,Inline
  400, `Bad Request <https://tools.ietf.org/html/rfc7231#section-6.5.1>`__ ,相互排他性違反 `name`または類似の完全一致フィルタと`name_contains`または類似の部分文字列フィルタが両方とも同じ要求で指定されました。フィルタリングは、ペアのうちの1つのみを受け入れます。,Inline

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

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

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

  _anonymous_,\ :ref:`Platform Compatibility <Managing monitoring settings using profiles>` ],false,none,[リスト操作のトリミングされたプロファイル表現形式プローブ/アラート構成配列なし。
  » id,integer,false,none,なし
  » name,string,false,none,なし
  » description,string,false,none,なし
  » target_kind,string,false,none,プロファイルのターゲットタイプサーバーの場合は's'、エージェントの場合は'a'。
  » published,boolean,false,none,コンビニエンスフラグ ステータスが'published'の場合にtrue。
  » active_assignments,integer,false,none,このプロファイルに割り当てられたアクティブなサーバー/エージェントの数。

列挙値
''''''

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

  target_kind,s
  target_kind,a

ステータスコード **400**

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

  » success,integer,false,none,なし
  » errormsg,string,false,none,なし

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

post\_\ *profiles*
------------------

**コードサンプル**

.. code:: shell


   #  You can also use wget

   curl -X POST https://PEM-SERVER-IP/pem/api/v17/profiles/ \
     -H Content-Type: application/json \
     -H Accept: application/json \
     -H X-Auth-Token: string

.. code:: python

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

   r = requests.post(https://PEM-SERVER-IP/pem/api/v17/profiles/, headers = headers)

   print(r.json())

.. code:: javascript

   const inputBody = {
     "name": "Production Servers",
     "description": "Monitoring production database servers",
     "target_kind": "s"
   };
   const headers = {
     Content-Type:application/json,
     Accept:application/json,
     X-Auth-Token:string
   };

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

``POST /profiles/``

*新しいプロフィールを作成する*

指定された名前必須、説明オプショナル、およびtarget_kindオプショナル、サーバーのデフォルト’s’を使用して新しいプロファイルを作成します。プローブと自動作成アラートは、target_kindに基づいて自動的に作成されます。

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

.. code:: json

   {
     "name": "Production Servers",
     "description": "Monitoring production database servers",
     "target_kind": "s"
   }

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

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

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

  X-Auth-Token,header,string,true,承認用トークン
  body,body,object,false,なし
  » name,body,string,true,プロフィール名 必須
  » description,body,string,false,プロファイルの説明オプショナル
  » target_kind,body,string,false,ターゲット種類 サーバーの場合は's'、エージェントの場合は'a'オプショナル、デフォルトは's'

.. _列挙値-1:

列挙値
''''''

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

  » target_kind,s
  » target_kind,a

**応答例**

.. raw:: html

   <Details summary="200 Response">

.. code:: json

   {
     "success": 0,
     "data": "string"
   }

.. raw:: html

   </Details>

.. _応答-1:

応答
^^^^

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

  200,:ref:`コマンドラインからのサーバーインストーラーの呼び出し<コマンドラインからのサーバーインストーラーの呼び出し>` ,プロファイルが正常に作成されました,Inline
  400, `Bad Request <https://tools.ietf.org/html/rfc7231#section-6.5.1>`__ ,悪い要求-必須フィールド'name'が欠落しています,None
  500, `Internal Server Error <https://tools.ietf.org/html/rfc7231#section-6.6.1>`__ ,内部サーバーエラー,None

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

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

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

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

  » success,integer,false,none,なし
  » data,string,false,none,なし

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

get\_\ *profiles*\ {profile_id}
-------------------------------

**コードサンプル**

.. code:: shell


   #  You can also use wget

   curl -X GET https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_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/pem/api/v17/profiles/{profile_id}, headers = headers)

   print(r.json())

.. code:: javascript

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

   fetch("https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}", {
     method: "GET",

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

``GET /profiles/{profile_id}``

*IDでプロフィールを取得*

完全なプローブとアラート構成を含む単一のプロファイルを結果ます。応答には、ブール値の’published’フィールドプロフィールが公開された場合にtrueが含まれます。

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

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

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

  profile_id,path,integer,true,なし
  X-Auth-Token,header,string,true,承認用トークン

**応答例**

.. raw:: html

   <Details summary="200 Response">

.. code:: json

   {
     "id": 0,
     "name": "string",
     "description": "string",
     "target_kind": "s",
     "published": true,
     "parent_id": 0,
     "draft_id": 0,
     "target_probe_configs": [
       {
         "probe_id": 0,
         "probe_name": "string",
         "enabled": true,
         "interval": 0,
         "lifetime": 0,
         "default_enabled": true,
         "default_interval": 0,
         "default_lifetime": 0,
         "target_type": 0,
         "force_enabled": true
       }
     ],
     "target_alert_configs": [
       {
         "id": 0,
         "alert_name": "string",
         "alert_template": 0,
         "description": "string",
         "enabled": true,
         "history_retention": 0,
         "frequency_min": 0,
         "auto_created": true,
         "template_id": "string",
         "params": [],
         "param_names": ["string"],
         "param_types": "string",
         "params_units": ["string"],
         "threshold_unit": "string",
         "operator": "string",
         "low_threshold_value": 0,
         "medium_threshold_value": 0,
         "high_threshold_value": 0,
         "send_email": true,
         "all_alert_enable": true,
         "email_group_id": 0,
         "low_alert_enable": true,
         "low_email_group_id": 0,
         "med_alert_enable": true,
         "med_email_group_id": 0,
         "high_alert_enable": true,
         "high_email_group_id": 0,
         "send_trap": true,
         "snmp_trap_version": 0,
         "low_send_trap": true,
         "med_send_trap": true,
         "high_send_trap": true,
         "cleared_alert_enable": true,
         "execute_script": true,
         "execute_script_on_clear": true,
         "execute_script_on_pem_server": true,
         "script_code": "string",
         "submit_to_nagios": true,
         "override_default_config": true,
         "send_notification": true,
         "low_webhook_ids": [0],
         "med_webhook_ids": [0],
         "high_webhook_ids": [0],
         "cleared_webhook_ids": [0]
       }
     ]
   }

..

   プロファイルが見つかりません

.. code:: json

   {
     "message": "Not found"
   }

.. raw:: html

   </Details>

.. _応答-2:

応答
^^^^

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

  200,:ref:`コマンドラインからのサーバーインストーラーの呼び出し<コマンドラインからのサーバーインストーラーの呼び出し>` ,成功した応答,:ref:`Upgrading SQL Profiler<Upgrading SQL Profiler>` 
  404, `Not Found <https://tools.ietf.org/html/rfc7231#section-6.5.4>`__ ,プロファイルが見つかりません,Inline

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

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

ステータスコード **404**

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

  » message,string,false,none,なし

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

put\_\ *profiles*\ {profile_id}
-------------------------------

**コードサンプル**

.. code:: shell


   #  You can also use wget

   curl -X PUT https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id} \
     -H Content-Type: application/json \
     -H Accept: application/json \
     -H X-Auth-Token: string

.. code:: python

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

   r = requests.put(https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}, headers = headers)

   print(r.json())

.. code:: javascript

   const inputBody = {
     "name": "Production Servers (v2)",
     "description": "Tightened thresholds and probe intervals.",
     "target_probe_configs": {
       "changed": [
         {
           "probe_id": 7,
           "execution_frequency": 5,
           "lifetime": 60
         },
         {
           "probe_id": 15,
           "enabled": true,
           "execution_frequency": 10,
           "lifetime": 30
         }
       ]
     },
     "target_alert_configs": {
       "changed": [
         {
           "id": 101,
           "enabled": true,
           "frequency_min": 2
         },
         {
           "id": 102,
           "operator": ">",
           "low_threshold_value": 70,
           "medium_threshold_value": 85,
           "high_threshold_value": 95
         }
       ],
       "added": [
         {
           "alert_name": "Replication Lag",
           "alert_template": 18,
           "enabled": true,
           "history_retention": 30,
           "frequency_min": 5,
           "operator": ">",
           "medium_threshold_value": 60,
           "high_threshold_value": 120
         }
       ],
       "deleted": [
         {
           "id": 103
         }
       ]
     }
   };
   const headers = {
     Content-Type:application/json,
     Accept:application/json,
     X-Auth-Token:string
   };

   fetch(https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id},
   {
     method: PUT,
     body: inputBody,
     headers: headers
   })
   .then(function(res) {
       return res.json();
   }).then(function(body) {
       console.log(body);
   });

``PUT /profiles/{profile_id}``

*IDでプロフィールを更新する*

‘profile_id’で指定される単一のプロファイルを更新します。メタデータには’name’/’description’を使用します。プローブの場合、
’target_probe_configs.changed’を使用して、既存のプローブ構成のみを変更しますキーはprobe_id、
enabled?、 enabled_by_default?、execute_frequency?、lifetime?。従来の
’use_default_enabled’および’interval’も受け入れます。このエンドポイントを介したプローブの追加はサポートされていません。アラートの場合、変更/追加/削除とともに’target_alert_configs’を使用します削除は、’id’のみを持つオブジェクトを受け入れます。

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

.. code:: json

   {
     "name": "Production Servers (v2)",
     "description": "Tightened thresholds and probe intervals.",
     "target_probe_configs": {
       "changed": [
         {
           "probe_id": 7,
           "execution_frequency": 5,
           "lifetime": 60
         },
         {
           "probe_id": 15,
           "enabled": true,
           "execution_frequency": 10,
           "lifetime": 30
         }
       ]
     },
     "target_alert_configs": {
       "changed": [
         {
           "id": 101,
           "enabled": true,
           "frequency_min": 2
         },
         {
           "id": 102,
           "operator": ">",
           "low_threshold_value": 70,
           "medium_threshold_value": 85,
           "high_threshold_value": 95
         }
       ],
       "added": [
         {
           "alert_name": "Replication Lag",
           "alert_template": 18,
           "enabled": true,
           "history_retention": 30,
           "frequency_min": 5,
           "operator": ">",
           "medium_threshold_value": 60,
           "high_threshold_value": 120
         }
       ],
       "deleted": [
         {
           "id": 103
         }
       ]
     }
   }

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

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

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

  profile_id,path,integer,true,なし
  X-Auth-Token,header,string,true,承認用トークン
  body,body,object,true,なし
  » name,body,string,false,プロファイルの新しい名前オプショナル。
  » description,body,string,false,プロファイルの新しい説明/注意事項オプショナル。
  » target_probe_configs,body,:ref:`ProbeConfigsUpdateOnly<ProbeConfigsUpdateOnly>` ,false,プロファイルIDで更新する場合のプローブ構成のデルタ 'changed'を使用して既存のプローブのみを変更します。このエンドポイントを介したプローブの追加はサポートされていません。
  »» changed,body,\ :ref:`Platform Compatibility <Schemas>` ],false,変更する既存のプローブ構成probe_idで識別されます。
  »»» probe_id,body,integer,true,追加/更新するプローブ識別子。
  »»» enabled,body,boolean,false,プロファイルでこのプローブを有効/無効にします。
  »»» enabled_by_default,body,boolean,false,プローブがデフォルトの有効化に従うかどうか。エイリアス 'use_default_enabled'が受け入れられます。
  »»» execution_frequency,body,integer,false,分単位のプローブ実行頻度。エイリアス'interval'が受け入れられます。
  »»» lifetime,body,integer,false,履歴の保持日数。
  » target_alert_configs,body,:ref:`AlertConfigsDelta<AlertConfigsDelta>` ,false,プロファイル内のアラート構成のデルタ。
  »» changed,body,[allOf],false,既存のアラートを変更します。
  »»» id,body,integer,false,変更するアラートID。
  »»» name,body,string,false,アラート名。
  »»» enabled,body,boolean,false,なし
  »»» history_retention,body,integer,false,なし
  »»» frequency_min,body,integer,false,なし
  »»» operator,body,string,false,なし
  »»» low_threshold_value,body,number,false,なし
  »»» medium_threshold_value,body,number,false,なし
  »»» high_threshold_value,body,number,false,なし
  »»» all_alert_enable,body,boolean,false,なし
  »»» email_group_id,body,integer,false,なし
  »»» low_alert_enable,body,boolean,false,なし
  »»» low_email_group_id,body,integer,false,なし
  »»» med_alert_enable,body,boolean,false,なし
  »»» med_email_group_id,body,integer,false,なし
  »»» high_alert_enable,body,boolean,false,なし
  »»» high_email_group_id,body,integer,false,なし
  »» added,body,\ :ref:`Platform Compatibility <Schemas>` ],false,新しいアラートを追加します。必須フィールドについては、AlertPayloadを参照してください。
  »»» alert_name,body,string,false,アラートの名前。注 このプロパティは、POST要求の必須パラメーターです。
  »»» alert_template,body,integer,false,アラートテンプレートのID。 IDは正の整数値である必要があります。注 このプロパティは、POST要求の必須パラメーターです。
  »»» description,body,string,false,なし
  »»» enabled,body,boolean,false,このアラートを有効/無効にするかどうかを定義します。注 このプロパティは、POST要求の必須パラメーターです。
  »»» history_retention,body,integer,false,このアラートの履歴を保持する日数を指定します。指定できる値は1〜99999です。 注このプロパティは、POST要求の必須パラメーターです。
  »»» frequency_min,body,integer,false,PEMデータベースサーバーでアラートを確認する頻度を分単位で定義します。指定できる値は1〜65534です。 注このプロパティは、POST要求の必須パラメーターです。
  »»» operator,body,string,false,"しきい値をチェックするための演算子を定義します。有効な文字列は>""および""&lt;""です。注 このプロパティは、POST要求の必須パラメーターです。"
  »»» low_threshold_value,body,number,false,低アラートをトリガーするためのしきい値。このプロパティには、有効な整数/浮動小数点値を指定できます。注これはPOST要求の必須パラメーターです。
  »»» medium_threshold_value,body,number,false,中アラートをトリガーするためのしきい値。このプロパティには、有効な整数/浮動小数点値を指定できます。注これはPOST要求の必須パラメーターです。
  »»» high_threshold_value,body,number,false,高度なアラートをトリガーするためのしきい値。このプロパティには、有効な整数/浮動小数点値を指定できます。注これはPOST要求の必須パラメーターです。
  »»» all_alert_enable,body,boolean,false,アラートの状態が変更されたときに、パラメーター 'email_group_id'で指定されたグループにメール通知を送信するかどうかを決定します。
  »»» email_group_id,body,integer,false,アラートの状態が変更されたときに、メール通知の送信先のメールグループを定義します。
  »»» low_alert_enable,body,boolean,false,アラートの状態がLOWに設定されているときに、パラメーター'low_email_group_id'で指定されたグループにメール通知を送信するかどうかを決定します。
  »»» low_email_group_id,body,integer,false,アラートの状態がLOWに変更されたときにメール通知の送信先の電子メールグループを定義します。
  »»» med_alert_enable,body,boolean,false,アラートの状態がMEDIUMに設定されている場合、パラメーター'medium_email_group_id'で指定されたグループにメール通知を送信するかどうかを決定します。
  »»» med_email_group_id,body,integer,false,アラートの状態がMEDIUMに変更されたときにメール通知の送信先のメールグループを定義します。
  »»» high_alert_enable,body,boolean,false,アラートの状態がHIGHに設定されているときに、パラメーター'high_email_group_id'で指定されたグループに電子メール通知を送信するかどうかを決定します。
  »»» high_email_group_id,body,integer,false,アラートの状態がHIGHに変更されたときに電子メール通知の送信先の電子メールグループを定義します。
  »»» send_trap,body,boolean,false,アラートの状態が変更されたときにSNMPトラップ通知を送信するかどうかを決定します。
  »»» snmp_trap_version,body,integer,false,SNMPトラップバージョンを定義します。サポートされているSNMPトラップバージョンは1、2、または3です。
  »»» low_send_trap,body,boolean,false,アラートの状態がLOWに変更されたときにSNMPトラップ通知を送信するかどうかを決定します。
  »»» med_send_trap,body,boolean,false,アラートの状態がMEDIUMに変更されたときにSNMPトラップ通知を送信するかどうかを決定します。
  »»» high_send_trap,body,boolean,false,アラートの状態がHIGHに変化したときにSNMPトラップ通知を送信するかどうかを決定します。
  »»» cleared_alert_enable,body,boolean,false,'クリアアラート'の通知をミュートするかどうかを決定します。
  »»» params,body,\ :ref:`Platform Compatibility <Schemas>` ],false,アラートを確認するためにアラートテンプレートが使用するパラメーター/値のペアのリスト。注 アラートテンプレートには、 allパラメーターを定義する必要があります。
  »»»» paramname,body,string,false,パラメーターの名前。注このプロパティは、アラートテンプレートパラメーターリストに存在する必要があります。例
  »»»» paramvalue,body,string,false,指定されたパラメーターの値
  »»» execute_script,body,boolean,false,アラートの状態がLOW/MEDIUM/HIGHに変更された場合に、提供されたスクリプトを実行するかどうかを決定します。
  »»» execute_script_on_clear,body,boolean,false,アラートの状態がクリアされた場合、提供されたスクリプトを実行するかどうかを決定します。
  »»» execute_script_on_pem_server,body,boolean,false,提供されたスクリプトをPEMホストまたはエージェントがオブジェクトを監視しているホストで実行するかどうかを決定します。
  »»» script_code,body,string,false,実行するシェルまたはバッチスクリプト。詳細については、ドキュメントをご覧ください。
  »»» submit_to_nagios,body,boolean,false,アラートの状態が変更されたときに、nagiosに通知を送信するかどうかを定義します。
  »»» override_default_config,body,boolean,false,デフォルトのWebhook構成をオーバーライドするかどうかを決定します。
  »»» send_notification,body,boolean,false,Webhook送信通知を有効にするかどうかを決定します。
  »»» low_webhook_ids,body,[integer],false,低アラートを構成できるWebhook IDを定義します。
  »»» med_webhook_ids,body,[integer],false,中程度のアラートを構成できるWebhook IDを定義します。
  »»» high_webhook_ids,body,[integer],false,高アラートを構成できるWebhook IDを定義します。
  »»» cleared_webhook_ids,body,[integer],false,クリアされたアラートを構成できるWebhook IDを定義します。
  »» deleted,body,\ :ref:`Platform Compatibility <Schemas>` ],false,IDごとに既存のアラートを削除します。
  »»» id,body,integer,true,削除するアラート構成ID。

.. _列挙値-2:

列挙値
''''''

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

  »»» operator,>
  »»» operator,&lt;
  »»»» paramname,Exclude tables smaller than
  »»»» paramname,mount point
  »»»» paramname,Host IP Address
  »»»» paramname,Time interval to monitor
  »»»» paramname,Time since idle
  »»»» paramname,Per CPU utilization (K%)

**応答例**

.. raw:: html

   <Details summary="無効なJSONボディ">

.. code:: json

   {
     "message": "Invalid JSON body"
   }

.. raw:: html

   </Details>

.. _応答-3:

応答
^^^^

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

  200,:ref:`コマンドラインからのサーバーインストーラーの呼び出し<コマンドラインからのサーバーインストーラーの呼び出し>` ,プロファイルが正常に更新されました,None
  400, `Bad Request <https://tools.ietf.org/html/rfc7231#section-6.5.1>`__ ,無効なJSON本文,None

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

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

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

delete\_\ *profiles*\ {profile_id}
----------------------------------

**コードサンプル**

.. code:: shell


   #  You can also use wget

   curl -X DELETE https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id} \
     -H X-Auth-Token: string

.. code:: python

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

   r = requests.delete(https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}, headers = headers)

   print(r.json())

.. code:: javascript

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

   fetch("https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}", {
     method: "DELETE",

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

``DELETE /profiles/{profile_id}``

*プロフィールを削除する*

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

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

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

  profile_id,path,integer,true,なし
  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

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

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

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

get\_\ *profiles*\ {profile_id}_assigned
----------------------------------------

**コードサンプル**

.. code:: shell


   #  You can also use wget

   curl -X GET https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}/assigned \
     -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/pem/api/v17/profiles/{profile_id}/assigned, headers = headers)

   print(r.json())

.. code:: javascript

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

   fetch("https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}/assigned", {
     method: "GET",

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

``GET /profiles/{profile_id}/assigned``

*プロファイルに割り当てられたサーバーとエージェントを取得する*

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

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

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

  profile_id,path,integer,true,なし
  X-Auth-Token,header,string,true,承認用トークン

**応答例**

.. raw:: html

   <Details summary="200 Response">

.. code:: json

   {
     "servers": ["string"],
     "agents": ["string"]
   }

.. raw:: html

   </Details>

.. _応答-5:

応答
^^^^

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

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

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

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

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

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

  » servers,[string],false,none,なし
  » agents,[string],false,none,なし

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

get\_\ *profiles*\ {profile_id}_draft
-------------------------------------

**コードサンプル**

.. code:: shell


   #  You can also use wget

   curl -X GET https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}/draft \
     -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/pem/api/v17/profiles/{profile_id}/draft, headers = headers)

   print(r.json())

.. code:: javascript

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

   fetch("https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}/draft", {
     method: "GET",

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

``GET /profiles/{profile_id}/draft``

*プロフィールIDでドラフトを取得*

完全なプローブとアラート構成を含む、指定された公開プロファイルIDに関連付けられているドラフトプロファイルを結果ます。応答には、parent_idまたはdraft_idフィールドは含まれません。

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

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

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

  profile_id,path,integer,true,なし
  X-Auth-Token,header,string,true,承認用トークン

**応答例**

.. raw:: html

   <Details summary="200 Response">

.. code:: json

   {
     "id": 0,
     "name": "string",
     "description": "string",
     "target_kind": "s",
     "published": true,
     "target_probe_configs": [
       {
         "probe_id": 0,
         "probe_name": "string",
         "enabled": true,
         "interval": 0,
         "lifetime": 0,
         "default_enabled": true,
         "default_interval": 0,
         "default_lifetime": 0,
         "target_type": 0,
         "force_enabled": true
       }
     ],
     "target_alert_configs": [
       {
         "id": 0,
         "alert_name": "string",
         "alert_template": 0,
         "description": "string",
         "enabled": true,
         "history_retention": 0,
         "frequency_min": 0,
         "auto_created": true,
         "template_id": "string",
         "params": [],
         "param_names": ["string"],
         "param_types": "string",
         "params_units": ["string"],
         "threshold_unit": "string",
         "operator": "string",
         "low_threshold_value": 0,
         "medium_threshold_value": 0,
         "high_threshold_value": 0,
         "send_email": true,
         "all_alert_enable": true,
         "email_group_id": 0,
         "low_alert_enable": true,
         "low_email_group_id": 0,
         "med_alert_enable": true,
         "med_email_group_id": 0,
         "high_alert_enable": true,
         "high_email_group_id": 0,
         "send_trap": true,
         "snmp_trap_version": 0,
         "low_send_trap": true,
         "med_send_trap": true,
         "high_send_trap": true,
         "cleared_alert_enable": true,
         "execute_script": true,
         "execute_script_on_clear": true,
         "execute_script_on_pem_server": true,
         "script_code": "string",
         "submit_to_nagios": true,
         "override_default_config": true,
         "send_notification": true,
         "low_webhook_ids": [0],
         "med_webhook_ids": [0],
         "high_webhook_ids": [0],
         "cleared_webhook_ids": [0]
       }
     ]
   }

..

   プロファイルのドラフトが見つかりません

.. code:: json

   {
     "message": "Not found"
   }

.. raw:: html

   </Details>

.. _応答-6:

応答
^^^^

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

  200,:ref:`コマンドラインからのサーバーインストーラーの呼び出し<コマンドラインからのサーバーインストーラーの呼び出し>` ,成功した応答,:ref:`プロフィールドラフト<プロフィールドラフト>` 
  404, `Not Found <https://tools.ietf.org/html/rfc7231#section-6.5.4>`__ ,プロファイルのドラフトが見つかりませんでした,Inline

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

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

ステータスコード **404**

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

  » message,string,false,none,なし

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

delete\_\ *profiles*\ {profile_id}_rollback
-------------------------------------------

**コードサンプル**

.. code:: shell


   #  You can also use wget

   curl -X DELETE https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}/rollback \
     -H X-Auth-Token: string

.. code:: python

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

   r = requests.delete(https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}/rollback, headers = headers)

   print(r.json())

.. code:: javascript

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

   fetch("https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}/rollback", {
     method: "DELETE",

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

``DELETE /profiles/{profile_id}/rollback``

*プロファイルのロールバックドラフト*

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

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

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

  profile_id,path,integer,true,なし
  X-Auth-Token,header,string,true,承認用トークン

**応答例**

.. _応答-7:

応答
^^^^

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

  200,:ref:`コマンドラインからのサーバーインストーラーの呼び出し<コマンドラインからのサーバーインストーラーの呼び出し>` ,下書きが削除されたか、使用可能なドラフトがありません,None

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

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

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

post\_\ *profiles*\ {profile_id}_publish
----------------------------------------

**コードサンプル**

.. code:: shell


   #  You can also use wget

   curl -X POST https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}/publish \
     -H Accept: application/json \
     -H X-Auth-Token: string

.. code:: python

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

   r = requests.post(https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}/publish, headers = headers)

   print(r.json())

.. code:: javascript

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

   fetch("https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}/publish", {
     method: "POST",

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

``POST /profiles/{profile_id}/publish``

*プロフィールを公開する*

指定されたプロファイルが存在する場合、そのドラフトを公開します。ドラフトが存在しない場合、プロファイルが既に公開されていることを示すメッセージを返します。

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

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

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

  profile_id,path,integer,true,なし
  X-Auth-Token,header,string,true,承認用トークン

**応答例**

.. raw:: html

   <Details summary="プロファイルが見つかりません">

.. code:: json

   {
     "message": "Not found"
   }

.. raw:: html

   </Details>

.. _応答-8:

応答
^^^^

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

  200,:ref:`コマンドラインからのサーバーインストーラーの呼び出し<コマンドラインからのサーバーインストーラーの呼び出し>` ,プロファイルは正常に公開されたか、既に公開されました,None
  404, `Not Found <https://tools.ietf.org/html/rfc7231#section-6.5.4>`__ ,プロファイルが見つかりません,Inline

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

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

ステータスコード **404**

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

  » message,string,false,none,なし

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

post\_\ *profiles*\ {source_id}_clone
-------------------------------------

**コードサンプル**

.. code:: shell


   #  You can also use wget

   curl -X POST https://PEM-SERVER-IP/pem/api/v17/profiles/{source_id}/clone \
     -H Content-Type: application/json \
     -H Accept: application/json \
     -H X-Auth-Token: string

.. code:: python

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

   r = requests.post(https://PEM-SERVER-IP/pem/api/v17/profiles/{source_id}/clone, headers = headers)

   print(r.json())

.. code:: javascript

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

   fetch("https://PEM-SERVER-IP/pem/api/v17/profiles/{source_id}/clone", {
     method: "POST",
     body: inputBody,
     headers: headers,
   })
     .then(function (res) {
       return res.json();
     })
     .then(function (body) {
       console.log(body);
     });

``POST /profiles/{source_id}/clone``

*既存のプロファイルのクローンを作成する*

すべてのプローブとアラート構成をソースからコピーすることにより、新しい公開プロファイルを作成します。ソースは公開されたプロファイルである必要があります。ドラフトのクローン作成は400で拒否されます。クローンはソースから独立しています。parent_idはNULL、ステータスは「published」、アクティブな割り当てはありません。クローンは1つのPEMインスタンス内で発生するため、すべての通知チャネルID電子メールグループ、Webhook
ID、SNMPトラップフィールドはそのままコピーされます。自動作成されたアラートはコピーされ、クローンに削除できません。
‘name’が省略されると、サーバーは’Copy of
’を生成し、名前が公開されたプロファイル間で一意になるまで、’ (2)‘、’
(3)’、…を追加します。

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

.. code:: json

   {}

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

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

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

  source_id,path,integer,true,クローンする公開されたプロファイルのID。
  X-Auth-Token,header,string,true,承認用トークン
  body,body,object,false,なし
  » name,body,string,false,オプショナル。クローンの名前。公開されたプロファイル間で一意である必要があります。そうでない場合、要求は409を返します。省略すると、サーバーは競合回避で'Copy of <source />'を生成します。
  » description,body,string,false,オプショナル。クローンの説明。省略すると、ソースの説明がコピーされます。明示的な空の文字列は説明をクリアします。

**応答例**

.. raw:: html

   <Details summary="プロファイルのクローンが正常に作成されました。">

.. code:: json

   {
     "success": 1,
     "data": {
       "id": 42,
       "name": "Copy of Production Servers",
       "target_kind": "s",
       "description": "Monitoring production database servers"
     }
   }

..

   不正な要求。ソースはドラフトであり、クローンはできません。指定された名前が空である、自動生成された名前が使い果たされた、または
   ‘name’ / ’description’は文字列ではありません。

.. code:: json

   {
     "errormsg": "Cannot clone a draft profile. Publish or rollback the draft first."
   }

..

   ソースプロファイルが見つかりません。

.. code:: json

   {
     "message": "Profile 999 does not exist."
   }

..

   409 レスポンス

.. code:: json

   {
     "message": "string"
   }

.. raw:: html

   </Details>

.. _応答-9:

応答
^^^^

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

  200,:ref:`コマンドラインからのサーバーインストーラーの呼び出し<コマンドラインからのサーバーインストーラーの呼び出し>` ,プロファイルのクローンが正常に作成されました。,Inline
  400, `Bad Request <https://tools.ietf.org/html/rfc7231#section-6.5.1>`__ ,悪い要求。ソースはドラフトであり、クローンはできません。指定された名前が空である、自動生成された名前が使い果たされた、または 'name' / 'description'は文字列ではありません。,Inline
  404, `Not Found <https://tools.ietf.org/html/rfc7231#section-6.5.4>`__ ,ソースプロファイルが見つかりません。,Inline
  409,:ref:`既存のmod_wsgiとの競合<既存のmod_wsgiとの競合>` ,ユーザー指定の'name'は、既存の公開されたプロファイルと競合します。,Inline
  500, `Internal Server Error <https://tools.ietf.org/html/rfc7231#section-6.6.1>`__ ,内部サーバーエラー。,None

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

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

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

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

  » success,integer,false,none,なし
  » data,object,false,none,なし
  »» id,integer,false,none,新しいプロファイルのID。
  »» name,string,false,none,なし
  »» target_kind,string,false,none,ソースから保存。クローン時には変更できません。
  »» description,string¦null,false,none,なし

.. _列挙値-3:

列挙値
''''''

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

  target_kind,s
  target_kind,a

ステータスコード **400**

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

  » errormsg,string,false,none,なし

ステータスコード **404**

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

  » message,string,false,none,なし

ステータスコード **409**

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

  » message,string,false,none,なし

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

delete\_\ *profiles*\ {profile_id}\_{new_profile_id}
----------------------------------------------------

**コードサンプル**

.. code:: shell


   #  You can also use wget

   curl -X DELETE https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}/{new_profile_id} \
     -H X-Auth-Token: string

.. code:: python

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

   r = requests.delete(https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}/{new_profile_id}, headers = headers)

   print(r.json())

.. code:: javascript

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

   fetch(
     "https://PEM-SERVER-IP/pem/api/v17/profiles/{profile_id}/{new_profile_id}",
     {
       method: "DELETE",

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

``DELETE /profiles/{profile_id}/{new_profile_id}``

*プロファイルを削除し、新しいプロファイルに再割り当てします*

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

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

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

  profile_id,path,integer,true,なし
  new_profile_id,path,integer,true,なし
  X-Auth-Token,header,string,true,承認用トークン

**応答例**

.. _応答-10:

応答
^^^^

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

  200,:ref:`コマンドラインからのサーバーインストーラーの呼び出し<コマンドラインからのサーバーインストーラーの呼び出し>` ,プロファイルは正常に削除および再割り当てされました,None

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

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

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

post\_\ *profile_export*
------------------------

**コードサンプル**

.. code:: shell


   #  You can also use wget

   curl -X POST https://PEM-SERVER-IP/pem/api/v17/profile/export/ \
     -H Content-Type: application/json \
     -H Accept: application/json \
     -H X-Auth-Token: string

.. code:: python

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

   r = requests.post(https://PEM-SERVER-IP/pem/api/v17/profile/export/, headers = headers)

   print(r.json())

.. code:: javascript

   const inputBody = {
     "profiles": [
       0
     ]
   };
   const headers = {
     Content-Type:application/json,
     Accept:application/json,
     X-Auth-Token:string
   };

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

``POST /profile/export/``

*プロファイルをJSONバンドルにエクスポートする*

``.pemprf``
JSONバンドルとしてシリアル化された要求されたプロファイルを返します。ドラフトを選択すると、公開された親に透過的に解決されます。すべての電子メール/SNMP/webhook/Nagiosチャネル構成はエクスポート時にストリップされます—ルーティングID
``email_group_id`` 、\ ``*_email_group_id`` 、\ ``* _webhook_ids``
、\ ``snmp_trap_version`` 、\ ``*_send_trap``
および有効化フラグ\ ``send_email`` 、\ ``send_trap``
、\ ``submit_to_nagios`` 、\ ``cleared_alert_enable``
、\ ``send_notification``
、受信者opt2のイネーブルフラグ\ ``cleared_alert_enable``
、\ ``send_notification``
、edb_tran_s_opt2インポート後のUIを介してチャンネルごとに。スクリプトの実行
``execute_script`` 、\ ``execute_script_on_clear``
、\ ``execute_script_on_pem_server`` 、および\ ``script_code``
本体は保持されます。 ``script_code``
には資格情報またはenv固有のパスが含まれる場合があるため、 ``.pemprf``
ファイルを機密ファイルとして扱います。

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

.. code:: json

   {
     "profiles": [0]
   }

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

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

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

  X-Auth-Token,header,string,true,承認用トークン
  body,body,object,true,なし
  » profiles,body,[integer],true,エクスポートするプロファイルID。

**応答例**

.. raw:: html

   <Details summary="200 Response">

.. code:: json

   {
     "version": 0,
     "profiles": [{}]
   }

.. raw:: html

   </Details>

.. _応答-11:

応答
^^^^

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

  200,:ref:`コマンドラインからのサーバーインストーラーの呼び出し<コマンドラインからのサーバーインストーラーの呼び出し>` ,バンドルapplication/jsonをエクスポートします。,Inline
  400, `Bad Request <https://tools.ietf.org/html/rfc7231#section-6.5.1>`__ ,エクスポートするプロファイルがありません、プロファイルIDが見つかりません、孤立したドラフト、または解決されたプロファイルは公開されません。,None
  401, `Unauthorized <https://tools.ietf.org/html/rfc7235#section-3.1>`__ ,ユーザーには`pem_manage_profile`ロールがありません。,None

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

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

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

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

  » version,integer,false,none,エクスポートファイル形式のバージョン。
  » profiles,[object],false,none,なし

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

post\_\ *profile_import*
------------------------

**コードサンプル**

.. code:: shell


   #  You can also use wget

   curl -X POST https://PEM-SERVER-IP/pem/api/v17/profile/import/ \
     -H Content-Type: application/json \
     -H Accept: application/json \
     -H X-Auth-Token: string

.. code:: python

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

   r = requests.post(https://PEM-SERVER-IP/pem/api/v17/profile/import/, headers = headers)

   print(r.json())

.. code:: javascript

   const inputBody = {
     "version": 0,
     "profiles": [
       {}
     ],
     "skip_overwrite": true
   };
   const headers = {
     Content-Type:application/json,
     Accept:application/json,
     X-Auth-Token:string
   };

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

``POST /profile/import/``

*以前にエクスポートしたプロファイルをインポートする*

ファイル内の各プロファイルは独立して処理されます。新しい名前は公開されたとおりに着陸します。名前の競合
デフォルトの\ ``Skipped``
skip_overwrite=trueか、既存のプロファイルの構成をドラフトとして置き換えますskip_overwrite=false
—
ユーザーはUIで[適用]をクリックして公開します。応答は、プロファイルごとに1つの結果を伝送します。statusは\ ``Success``
、\ ``Skipped`` 、または\ ``Failed`` で、 ``msg``
は部分スキップの詳細プローブ/テンプレート参照の欠如を説明します。

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

.. code:: json

   {
     "version": 0,
     "profiles": [{}],
     "skip_overwrite": true
   }

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

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

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

  X-Auth-Token,header,string,true,承認用トークン
  body,body,object,true,なし
  » version,body,integer,true,エクスポートファイル形式のバージョン。ターゲットサーバーでサポートされている必要があります。
  » profiles,body,[object],true,なし
  » skip_overwrite,body,boolean,true,trueの場合、名前の競合により`Skipped`が生成されます。 falseの場合、インポーターは既存のプロファイルにドラフトを作成しますレビューと公開に適用します。

**応答例**

.. raw:: html

   <Details summary="200 Response">

.. code:: json

   {
     "success": 0,
     "result": [
       {
         "name": "string",
         "status": "Success",
         "msg": "string"
       }
     ]
   }

.. raw:: html

   </Details>

.. _応答-12:

応答
^^^^

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

  200,:ref:`コマンドラインからのサーバーインストーラーの呼び出し<コマンドラインからのサーバーインストーラーの呼び出し>` ,プロファイルごとのインポート結果。,Inline
  400, `Bad Request <https://tools.ietf.org/html/rfc7231#section-6.5.1>`__ ,不正なペイロード、skip_overwriteの欠落、またはサポートされていないバージョン。,None
  401, `Unauthorized <https://tools.ietf.org/html/rfc7235#section-3.1>`__ ,ユーザーには`pem_manage_profile`ロールがありません。,None

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

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

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

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

  » success,integer,false,none,なし
  » result,[object],false,none,なし
  »» name,string,false,none,なし
  »» status,string,false,none,なし
  »» msg,string¦null,false,none,なし

.. _列挙値-4:

列挙値
''''''

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

  status,Success
  status,Skipped
  status,Failed

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