ホストの更新
put
/api/v2/hosts/{id}/
このリソースに対してPUTまたはPATCHリクエストを行って、このホストを更新します。 次のフィールドを変更できます。
name
: このホストの名前。(文字列、必須)description
: このホストのオプションの説明。(文字列、デフォルト=""
)inventory
: (id、必須)enabled
: このホストがオンラインで、ジョブの実行に使用できるかどうか。(ブール、デフォルト=True
)instance_id
: ホストを一意に識別するためにリモート・インベントリ・ソースによって使用される値(文字列、デフォルト=""
)variables
: JSONまたはYAML形式のホスト変数。(json、デフォルト=``)
PUTリクエストの場合は、リクエストにすべてのフィールドを含めます。
リクエスト
サポートされているメディア・タイプ
- application/json
パス・パラメータ
問合せパラメータ
- search(オプション): 文字列
検索条件。
ルート・スキーマ : schema
例:
{
"description":"Hello world",
"name":"New name"
}
レスポンス
サポートされているメディア・タイプ
- application/json
200レスポンス
レスポンスの例(application/json)
{
"ansible_facts_modified":null,
"created":"2018-02-01T08:00:00.000000Z",
"description":"Hello world",
"enabled":true,
"has_active_failures":false,
"has_inventory_sources":false,
"id":1,
"instance_id":"",
"inventory":1,
"last_job":null,
"last_job_host_summary":null,
"modified":"2018-02-01T08:00:00.000000Z",
"name":"New name",
"related":{
"activity_stream":"/api/v2/hosts/1/activity_stream/",
"ad_hoc_command_events":"/api/v2/hosts/1/ad_hoc_command_events/",
"ad_hoc_commands":"/api/v2/hosts/1/ad_hoc_commands/",
"all_groups":"/api/v2/hosts/1/all_groups/",
"ansible_facts":"/api/v2/hosts/1/ansible_facts/",
"groups":"/api/v2/hosts/1/groups/",
"inventory":"/api/v2/inventories/1/",
"inventory_sources":"/api/v2/hosts/1/inventory_sources/",
"job_events":"/api/v2/hosts/1/job_events/",
"job_host_summaries":"/api/v2/hosts/1/job_host_summaries/",
"smart_inventories":"/api/v2/hosts/1/smart_inventories/",
"variable_data":"/api/v2/hosts/1/variable_data/"
},
"summary_fields":{
"groups":{
"count":1,
"results":[
{
"id":1,
"name":"single-group"
}
]
},
"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
},
"recent_jobs":[
],
"user_capabilities":{
"delete":true,
"edit":true
}
},
"type":"host",
"url":"/api/v2/hosts/1/",
"variables":""
}
403レスポンス
レスポンスの例(application/json)
{
"detail":"You do not have permission to perform this action."
}