Agent Job
=========

get\_\ *agent_job*\ {agent_id}
------------------------------

**コードサンプル**

.. code:: shell


   #  You can also use wget

   curl -X GET https://PEM-SERVER-IP/api/v14/agent/job/{agent_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/agent/job/{agent_id}, headers = headers)

   print(r.json())

.. code:: javascript


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

   fetch(https://PEM-SERVER-IP/api/v14/agent/job/{agent_id},
   {
     method: GET,

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

``GET /agent/job/{agent_id}``

agent_idでエージェントレベルの\ ``Jobs`` を取得します。

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

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

  agent_id,path,integer,true,エージェントID
  X-Auth-Token,header,string,true,承認トークン

**応答例**

.. raw:: html

   <Details summary="200 Response">

.. code:: json

   [
     {
       "jobname": "string",
       "jobenabled": true,
       "jobdesc": "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,なし
  » jobname,string,false,none,ジョブの名前。
  » jobenabled,boolean,false,none,ジョブが有効か無効かを判断します。
  » jobdesc,string,false,none,ジョブの説明。

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

post\_\ *agent_job*\ {agent_id}
-------------------------------

**コードサンプル**

.. code:: shell


   #  You can also use wget

   curl -X POST https://PEM-SERVER-IP/api/v14/agent/job/{agent_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.post(https://PEM-SERVER-IP/api/v14/agent/job/{agent_id}, headers = headers)

   print(r.json())

.. code:: javascript

   const inputBody = {
     "jobname": "string",
     "jobenabled": true,
     "jobdesc": "string",
     "jsteps": [],
     "jschedules": [
       {
         "jscname": "string",
         "jscdesc": "string",
         "jscenabled": true,
         "jscstart": "2023-10-09 22:43 +05:30",
         "jscend": "2023-10-11 22:43 +05:30",
         "jscweekdays": "Monday",
         "jscmonthdays": 1,
         "jscmonths": "January",
         "jschours": 0,
         "jscminutes": 0,
         "jscexceptions": [
           {
             "jexdate": "2023-10-19",
             "jextime": "09:39:00"
           }
         ],
         "jsctimezone": "Asia/Calcutta"
       }
     ],
     "notify": "DEFAULT",
     "email_group_id": "string"
   };
   const headers = {
     Content-Type:application/json,
     Accept:application/json,
     X-Auth-Token:string
   };

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

``POST /agent/job/{agent_id}``

エージェントレベルの\ ``Job`` を作成します。

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

.. code:: json

   {
     "jobname": "string",
     "jobenabled": true,
     "jobdesc": "string",
     "jsteps": [],
     "jschedules": [
       {
         "jscname": "string",
         "jscdesc": "string",
         "jscenabled": true,
         "jscstart": "2023-10-09 22:43 +05:30",
         "jscend": "2023-10-11 22:43 +05:30",
         "jscweekdays": "Monday",
         "jscmonthdays": 1,
         "jscmonths": "January",
         "jschours": 0,
         "jscminutes": 0,
         "jscexceptions": [
           {
             "jexdate": "2023-10-19",
             "jextime": "09:39:00"
           }
         ],
         "jsctimezone": "Asia/Calcutta"
       }
     ],
     "notify": "DEFAULT",
     "email_group_id": "string"
   }

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

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

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

  agent_id,path,integer,true,エージェントID
  X-Auth-Token,header,string,true,承認トークン
  body,body,:ref:`AgentJobBodyPost<AgentJobBodyPost>` ,true,なし

**応答例**

.. raw:: html

   <Details summary="201 Response">

.. code:: json

   {
     "id": 0
   }

.. raw:: html

   </Details>

.. _応答-1:

応答
^^^^

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

  201, `Created <https://tools.ietf.org/html/rfc7231#section-6.3.2>`__ ,正常に作成されました,Inline

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

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

ステータスコード **201**

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

  » id,integer,false,none,ジョブのID

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

get\_\ *agent_job*\ {agent_id}\_{job_id}
----------------------------------------

**コードサンプル**

.. code:: shell


   #  You can also use wget

   curl -X GET https://PEM-SERVER-IP/api/v14/agent/job/{agent_id}/{job_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/agent/job/{agent_id}/{job_id}, headers = headers)

   print(r.json())

.. code:: javascript


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

   fetch(https://PEM-SERVER-IP/api/v14/agent/job/{agent_id}/{job_id},
   {
     method: GET,

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

``GET /agent/job/{agent_id}/{job_id}``

agent_idおよびjob_idでエージェントレベルの\ ``Jobs`` を取得します。

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

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

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

  agent_id,path,integer,true,エージェントID
  job_id,path,integer,true,ジョブID
  X-Auth-Token,header,string,true,承認トークン

**応答例**

.. raw:: html

   <Details summary="200 Response">

.. code:: json

   {
     "jobid": 0,
     "jobname": "string",
     "jobenabled": true,
     "jobdesc": "string",
     "jobcreated": "2019-08-24T14:15:22Z",
     "jobchanged": "2019-08-24T14:15:22Z",
     "jlgstatus": "string",
     "jobnextrun": "2019-08-24T14:15:22Z",
     "joblastrun": "2019-08-24T14:15:22Z",
     "is_alert_job": true,
     "notify": "string",
     "email_group_id": "string",
     "jsteps": [],
     "jschedules": [
       {
         "jscid": 0,
         "jscjobid": 0,
         "jscname": "string",
         "jscdesc": "string",
         "jscenabled": true,
         "jscstart": "2019-08-24T14:15:22Z",
         "jscend": "2019-08-24T14:15:22Z",
         "jscweekdays": [
           true
         ],
         "jscmonthdays": [
           true
         ],
         "jscmonths": [
           true
         ],
         "jschours": [
           true
         ],
         "jscminutes": [
           true
         ],
         "jscexceptions": [
           null
         ],
         "jsctimezone": "string"
       }
     ]
   }

.. raw:: html

   </Details>

.. _応答-2:

応答
^^^^

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

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

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

put\_\ *agent_job*\ {agent_id}\_{job_id}
----------------------------------------

**コードサンプル**

.. code:: shell


   #  You can also use wget

   curl -X PUT https://PEM-SERVER-IP/api/v14/agent/job/{agent_id}/{job_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/agent/job/{agent_id}/{job_id}, headers = headers)

   print(r.json())

.. code:: javascript

   const inputBody = {
     "jobname": "string",
     "jobenabled": true,
     "jobdesc": "string",
     "jsteps": {
       "added": [
         {
           "jstname": "string",
           "jstdesc": "string",
           "jstenabled": true,
           "jstkind": true,
           "jstcode": "string",
           "server_id": 0,
           "database_name": "string",
           "jstonerror": "f"
         }
       ],
       "changed": [
         {
           "jstid": 0,
           "jstname": "string",
           "jstdesc": "string",
           "jstenabled": true,
           "jstkind": true,
           "jstcode": "string",
           "server_id": 0,
           "database_name": "string",
           "jstonerror": "f",
           "jstnextrun": "string"
         }
       ]
     },
     "jschedules": {
       "added": [
         {
           "jscname": "string",
           "jscdesc": "string",
           "jscenabled": true,
           "jscstart": "2023-10-09 22:43 +05:30",
           "jscend": "2023-10-11 22:43 +05:30",
           "jscweekdays": "Monday",
           "jscmonthdays": 1,
           "jscmonths": "January",
           "jschours": 0,
           "jscminutes": 0,
           "jscexceptions": [
             {
               "jexdate": "2023-10-19",
               "jextime": "09:39:00"
             }
           ],
           "jsctimezone": "Asia/Calcutta"
         }
       ],
       "changed": [
         {
           "jscid": 0,
           "jscname": "string",
           "jscdesc": "string",
           "jscenabled": true,
           "jscstart": "2023-10-09 22:43 +05:30",
           "jscend": "2023-10-11 22:43 +05:30",
           "jscweekdays": "Monday",
           "jscmonthdays": 1,
           "jscmonths": "January",
           "jschours": 0,
           "jscminutes": 0,
           "jscexceptions": [
             {
               "jexdate": "2023-10-19",
               "jextime": "09:39:00"
             }
           ],
           "jsctimezone": "Asia/Calcutta"
         }
       ]
     },
     "notify": "DEFAULT",
     "email_group_id": "string"
   };
   const headers = {
     Content-Type:application/json,
     X-Auth-Token:string
   };

   fetch(https://PEM-SERVER-IP/api/v14/agent/job/{agent_id}/{job_id},
   {
     method: PUT,
     body: inputBody,
     headers: headers
   })
   .then(function(res) {
       return res.json();
   }).then(function(body) {
       console.log(body);
   });

``PUT /agent/job/{agent_id}/{job_id}``

エージェントレベルの\ ``Job`` を更新します。

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

.. code:: json

   {
     "jobname": "string",
     "jobenabled": true,
     "jobdesc": "string",
     "jsteps": {
       "added": [
         {
           "jstname": "string",
           "jstdesc": "string",
           "jstenabled": true,
           "jstkind": true,
           "jstcode": "string",
           "server_id": 0,
           "database_name": "string",
           "jstonerror": "f"
         }
       ],
       "changed": [
         {
           "jstid": 0,
           "jstname": "string",
           "jstdesc": "string",
           "jstenabled": true,
           "jstkind": true,
           "jstcode": "string",
           "server_id": 0,
           "database_name": "string",
           "jstonerror": "f",
           "jstnextrun": "string"
         }
       ]
     },
     "jschedules": {
       "added": [
         {
           "jscname": "string",
           "jscdesc": "string",
           "jscenabled": true,
           "jscstart": "2023-10-09 22:43 +05:30",
           "jscend": "2023-10-11 22:43 +05:30",
           "jscweekdays": "Monday",
           "jscmonthdays": 1,
           "jscmonths": "January",
           "jschours": 0,
           "jscminutes": 0,
           "jscexceptions": [
             {
               "jexdate": "2023-10-19",
               "jextime": "09:39:00"
             }
           ],
           "jsctimezone": "Asia/Calcutta"
         }
       ],
       "changed": [
         {
           "jscid": 0,
           "jscname": "string",
           "jscdesc": "string",
           "jscenabled": true,
           "jscstart": "2023-10-09 22:43 +05:30",
           "jscend": "2023-10-11 22:43 +05:30",
           "jscweekdays": "Monday",
           "jscmonthdays": 1,
           "jscmonths": "January",
           "jschours": 0,
           "jscminutes": 0,
           "jscexceptions": [
             {
               "jexdate": "2023-10-19",
               "jextime": "09:39:00"
             }
           ],
           "jsctimezone": "Asia/Calcutta"
         }
       ]
     },
     "notify": "DEFAULT",
     "email_group_id": "string"
   }

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

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

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

  agent_id,path,integer,true,エージェントID
  job_id,path,integer,true,ジョブID
  X-Auth-Token,header,string,true,承認トークン
  body,body,:ref:`AgentJobBodyPut<AgentJobBodyPut>` ,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\_\ *agent_job*\ {agent_id}\_{job_id}
-------------------------------------------

**コードサンプル**

.. code:: shell


   #  You can also use wget

   curl -X DELETE https://PEM-SERVER-IP/api/v14/agent/job/{agent_id}/{job_id} \
     -H X-Auth-Token: string

.. code:: python

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

   r = requests.delete(https://PEM-SERVER-IP/api/v14/agent/job/{agent_id}/{job_id}, headers = headers)

   print(r.json())

.. code:: javascript


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

   fetch(https://PEM-SERVER-IP/api/v14/agent/job/{agent_id}/{job_id},
   {
     method: DELETE,

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

``DELETE /agent/job/{agent_id}/{job_id}``

agent_idとjob_idを使用して\ ``Job`` を削除します。

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

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

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

  agent_id,path,integer,true,エージェントID
  job_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::
   この操作には認証が必要ありません
