インベントリの更新
patch
/api/v2/inventories/{id}/
このリソースに対してPUTまたはPATCHリクエストを行って、このインベントリを更新します。 次のフィールドを変更できます。
name
: このインベントリの名前。(文字列、必須)description
: このインベントリのオプションの説明。(文字列、デフォルト=""
)organization
: このインベントリを含む組織。(id、必須)kind
: 表されているインベントリの種類。(選択)""
: ホストに、このインベントリへの直接リンクがあります。(デフォルト)smart
: host_filterプロパティを使用して生成されたインベントリのホスト。
host_filter
: このインベントリのホストに適用されるフィルタ。(文字列、デフォルト=""
)variables
: JSONまたはYAML形式のインベントリ変数。(json、デフォルト=``)
PATCHリクエストの場合は、変更中のフィールドのみを含めます。
リクエスト
サポートされているメディア・タイプ
- application/json
パス・パラメータ
問合せパラメータ
- search: string
検索条件。
ルート・スキーマ : schema
例:
{
"name":"newname",
"variables":"---"
}
レスポンス
サポートされているメディア・タイプ
- application/json
200レスポンス
レスポンスの例(application/json)
{
"created":"2018-02-01T08:00:00.000000Z",
"description":"",
"has_active_failures":false,
"has_inventory_sources":true,
"host_filter":null,
"hosts_with_active_failures":"0",
"id":"1",
"inventory_sources_with_failures":"0",
"kind":"",
"modified":"2018-02-01T08:00:00.000000Z",
"name":"newname",
"organization":"1",
"pending_deletion":false,
"related":{
"access_list":"/api/v2/inventories/1/access_list/",
"activity_stream":"/api/v2/inventories/1/activity_stream/",
"ad_hoc_commands":"/api/v2/inventories/1/ad_hoc_commands/",
"copy":"/api/v2/inventories/1/copy/",
"groups":"/api/v2/inventories/1/groups/",
"hosts":"/api/v2/inventories/1/hosts/",
"instance_groups":"/api/v2/inventories/1/instance_groups/",
"inventory_sources":"/api/v2/inventories/1/inventory_sources/",
"job_templates":"/api/v2/inventories/1/job_templates/",
"object_roles":"/api/v2/inventories/1/object_roles/",
"organization":"/api/v2/organizations/1/",
"root_groups":"/api/v2/inventories/1/root_groups/",
"script":"/api/v2/inventories/1/script/",
"tree":"/api/v2/inventories/1/tree/",
"update_inventory_sources":"/api/v2/inventories/1/update_inventory_sources/",
"variable_data":"/api/v2/inventories/1/variable_data/"
},
"summary_fields":{
"object_roles":{
"adhoc_role":{
"description":"May run ad hoc commands on the inventory",
"id":"18",
"name":"Ad Hoc"
},
"admin_role":{
"description":"Can manage all aspects of the inventory",
"id":"16",
"name":"Admin"
},
"read_role":{
"description":"May view settings for the inventory",
"id":"20",
"name":"Read"
},
"update_role":{
"description":"May update the inventory",
"id":"17",
"name":"Update"
},
"use_role":{
"description":"Can use the inventory in a job template",
"id":"19",
"name":"Use"
}
},
"organization":{
"description":"test-org-desc",
"id":"1",
"name":"test-org"
},
"user_capabilities":{
"adhoc":true,
"copy":true,
"delete":true,
"edit":true
}
},
"total_groups":"0",
"total_hosts":"0",
"total_inventory_sources":"1",
"type":"inventory",
"url":"/api/v2/inventories/1/",
"variables":"---"
}