アドホック・コマンドの取得
get
/api/v2/ad_hoc_commands/{id}/
このリソースに対してGETリクエストを行って、次のフィールドを含む単一のアドホック・コマンド・レコードを取得します。
id: このアドホック・コマンドのデータベースID。(整数)type: このアドホック・コマンドのデータ型。(選択)url: このアドホック・コマンドのURL。(文字列)related: 関連リソースのURLを含むデータ構造。(オブジェクト)summary_fields: 関連リソースの名前/説明を含むデータ構造。 一部のオブジェクトの出力は、パフォーマンス上の理由によって制限される場合があります。(オブジェクト)created: このアドホック・コマンドが作成されたときのタイムスタンプ。(日時)modified: このアドホック・コマンドが最後に変更されたときのタイムスタンプ。(日時)name: このアドホック・コマンドの名前。(文字列)launch_type: (選択)manual: 手動relaunch: 再起動callback: コールバックscheduled: スケジュール済dependency: 依存性workflow: ワークフローwebhook: Webフックsync: 同期scm: SCM更新
status: (選択)new: 新規pending: 保留中waiting: 待機中running: 実行中successful: 成功failed: 失敗error: エラーcanceled: 取消し済
failed: (ブール)started: ジョブが開始のためにキューに入れられた日時。(日時)finished: ジョブの実行が終了した日時。(日時)canceled_on: 取消しリクエストが送信された日時。(日時)elapsed: ジョブが実行された経過時間(秒)。(10進)job_args: (文字列)job_cwd: (文字列)job_env: (json)job_explanation: stdoutを実行および取得できなかった場合のジョブの状態を示すステータス・フィールド(文字列)execution_node: ジョブが実行されたノード。(文字列)controller_node: 分離された実行環境を管理していたインスタンス。(文字列)result_traceback: (文字列)event_processing_finished: この統合ジョブによって生成されたすべてのイベントがデータベースに保存されたかどうかを示します。(ブール)job_type: (選択)run: 実行check: チェック
inventory: (id)limit: (文字列)credential: (id)module_name: (選択)commandshellyumaptapt_keyapt_repositoryapt_rpmservicegroupusermountpingselinuxsetupwin_pingwin_servicewin_updateswin_groupwin_user
module_args: (文字列)forks: (整数)verbosity: (選択)0: 0 (標準)1: 1 (詳細)2: 2 (より詳細)3: 3 (デバッグ)4: 4 (接続デバッグ)5: 5 (WinRMデバッグ)
extra_vars: (文字列)become_enabled: (ブール)diff_mode: (ブール)host_status_counts: 各ステータスに一意に割り当てられたホストの数。(フィールド)
リクエスト
サポートされているメディア・タイプ
- application/json
パス・パラメータ
問合せパラメータ
- search(オプション): 文字列
検索条件。
レスポンス
サポートされているメディア・タイプ
- application/json
200レスポンス
レスポンスの例(application/json)
{
"become_enabled":false,
"canceled_on":null,
"controller_node":"",
"created":"2018-02-01T08:00:00.000000Z",
"credential":null,
"diff_mode":false,
"elapsed":0,
"event_processing_finished":false,
"execution_node":"",
"extra_vars":"",
"failed":false,
"finished":null,
"forks":0,
"host_status_counts":{
},
"id":4,
"inventory":1,
"job_args":"",
"job_cwd":"",
"job_env":{
},
"job_explanation":"",
"job_type":"run",
"launch_type":"manual",
"limit":"",
"modified":"2018-02-01T08:00:00.000000Z",
"module_args":"",
"module_name":"",
"name":"",
"related":{
"activity_stream":"/api/v2/ad_hoc_commands/4/activity_stream/",
"cancel":"/api/v2/ad_hoc_commands/4/cancel/",
"events":"/api/v2/ad_hoc_commands/4/events/",
"inventory":"/api/v2/inventories/1/",
"notifications":"/api/v2/ad_hoc_commands/4/notifications/",
"relaunch":"/api/v2/ad_hoc_commands/4/relaunch/",
"stdout":"/api/v2/ad_hoc_commands/4/stdout/"
},
"result_traceback":"",
"started":null,
"status":"new",
"summary_fields":{
"inventory":{
"description":"",
"has_active_failures":false,
"has_inventory_sources":true,
"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":1
},
"user_capabilities":{
"delete":true,
"start":true
}
},
"type":"ad_hoc_command",
"url":"/api/v2/ad_hoc_commands/4/",
"verbosity":0
}