機械翻訳について

インベントリのグループの作成

post

/api/v2/inventories/{id}/groups/

次のグループ・フィールドを指定してこのリソースに対してPOSTリクエストを行って、このインベントリに関連付けられる新しいグループを作成します。

  • name: このグループの名前。(文字列、必須)
  • description: このグループのオプションの説明。(文字列、デフォルト="")

  • variables: JSONまたはYAML形式のグループ変数。(json、デフォルト=``)

インベントリ・グループの削除:

idおよびdisassociateフィールドを指定してこのリソースに対してPOSTリクエストを行って、関連付けられているグループを削除します。

{
    "id": 123,
    "disassociate": true
}

リクエスト

サポートされているメディア・タイプ
パス・パラメータ
本文()
ルート・スキーマ : schema
例:
{
    "description":"Hello world",
    "name":"New name"
}
先頭に戻る

レスポンス

サポートされているメディア・タイプ

201レスポンス

本文
レスポンスの例(application/json)
{
    "created":"2018-02-01T08:00:00.000000Z",
    "description":"Hello world",
    "id":1,
    "inventory":1,
    "modified":"2018-02-01T08:00:00.000000Z",
    "name":"New name",
    "related":{
        "activity_stream":"/api/v2/groups/1/activity_stream/",
        "ad_hoc_commands":"/api/v2/groups/1/ad_hoc_commands/",
        "all_hosts":"/api/v2/groups/1/all_hosts/",
        "children":"/api/v2/groups/1/children/",
        "hosts":"/api/v2/groups/1/hosts/",
        "inventory":"/api/v2/inventories/1/",
        "inventory_sources":"/api/v2/groups/1/inventory_sources/",
        "job_events":"/api/v2/groups/1/job_events/",
        "job_host_summaries":"/api/v2/groups/1/job_host_summaries/",
        "potential_children":"/api/v2/groups/1/potential_children/",
        "variable_data":"/api/v2/groups/1/variable_data/"
    },
    "summary_fields":{
        "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":{
            "copy":true,
            "delete":true,
            "edit":true
        }
    },
    "type":"group",
    "url":"/api/v2/groups/1/",
    "variables":""
}

400レスポンス

本文
レスポンスの例(application/json)
{
    "inventory":{
        "detail":"Cannot create Group for Smart Inventory"
    }
}

403レスポンス

本文
レスポンスの例(application/json)
{
    "detail":"You do not have permission to perform this action."
}
先頭に戻る