インベントリのアドホック・コマンドの作成
post
/api/v2/inventories/{id}/ad_hoc_commands/
次のアドホック・コマンド・フィールドを指定してこのリソースに対してPOSTリクエストを行って、このインベントリに関連付けられる新しいアドホック・コマンドを作成します。
-
job_type: (選択)run: 実行(デフォルト)check: チェック
-
limit: (文字列、デフォルト="") credential: (id、デフォルト=``)module_name: (選択)command(デフォルト)shellyumaptapt_keyapt_repositoryapt_rpmservicegroupusermountpingselinuxsetupwin_pingwin_servicewin_updateswin_groupwin_user
module_args: (文字列、デフォルト="")forks: (整数、デフォルト=0)verbosity: (選択)0: 0 (標準) (デフォルト)1: 1 (詳細)2: 2 (より詳細)3: 3 (デバッグ)4: 4 (接続デバッグ)5: 5 (WinRMデバッグ)
extra_vars: (文字列、デフォルト="")become_enabled: (ブール、デフォルト=False)diff_mode: (ブール、デフォルト=False)
リクエスト
サポートされているメディア・タイプ
- application/json
パス・パラメータ
ルート・スキーマ : schema
例:
{
"credential":1,
"inventory":1,
"module_args":"uptime",
"module_name":"command"
}レスポンス
サポートされているメディア・タイプ
- application/json
201レスポンス
レスポンスの例(application/json)
{
"become_enabled":false,
"canceled_on":null,
"controller_node":"",
"created":"2018-02-01T08:00:00.000000Z",
"credential":1,
"diff_mode":false,
"elapsed":0,
"execution_node":"",
"extra_vars":"",
"failed":false,
"finished":null,
"forks":0,
"id":2,
"inventory":1,
"job_explanation":"",
"job_type":"run",
"launch_type":"manual",
"limit":"",
"modified":"2018-02-01T08:00:00.000000Z",
"module_args":"uptime",
"module_name":"command",
"name":"command",
"related":{
"activity_stream":"/api/v2/ad_hoc_commands/2/activity_stream/",
"cancel":"/api/v2/ad_hoc_commands/2/cancel/",
"credential":"/api/v2/credentials/1/",
"events":"/api/v2/ad_hoc_commands/2/events/",
"inventory":"/api/v2/inventories/1/",
"notifications":"/api/v2/ad_hoc_commands/2/notifications/",
"relaunch":"/api/v2/ad_hoc_commands/2/relaunch/",
"stdout":"/api/v2/ad_hoc_commands/2/stdout/"
},
"started":null,
"status":"new",
"summary_fields":{
"credential":{
"cloud":false,
"credential_type_id":1,
"description":"",
"id":1,
"kind":"ssh",
"kubernetes":false,
"name":"machine-cred"
},
"inventory":{
"description":"",
"has_active_failures":false,
"has_inventory_sources":false,
"hosts_with_active_failures":0,
"id":1,
"inventory_sources_with_failures":0,
"kind":"",
"name":"test-inv",
"organization_id":1,
"total_groups":0,
"total_hosts":0,
"total_inventory_sources":0
},
"user_capabilities":{
"delete":true,
"start":true
}
},
"type":"ad_hoc_command",
"url":"/api/v2/ad_hoc_commands/2/",
"verbosity":0
}