インベントリーリストの API エンドポイント
このリソースに GET リクエストを実行して、インベントリーのリストを取得します。
GET /api/v1/inventories/
HTTP 200 OK
Content-Type: application/json
Vary: Accept
Allow: GET, POST, HEAD, OPTIONS
X-API-Time: 0.046s
 
 
返されるデータ構造には以下のものが含まれます。
{
    "count": 0,
    "next": null,
    "previous": null,
    "results": []
}
 
 
count フィールドはクエリーで見つかったインベントリーの合計数を示します。next および previous フィールドは、単一ページに収まらない結果がある場合に、それらの結果へのリンクを提供します。results にはインベントリーレコードが一覧表示されますが、ゼロの場合もあります。
結果
各インベントリーのデータ構造には以下のフィールドが含まれます。
id: インベントリーのデータベース ID (整数) 
type: インベントリーのデータタイプ (複数選択) 
- 
 
 
url: インベントリーの URL (文字列) 
related: 関連リソースの URL のあるデータ構造 (オブジェクト) 
summary_fields: 関連リソースの名前/説明のあるデータ構造 (オブジェクト) 
created: インベントリー作成時のタイムスタンプ (日時) 
modified: インベントリーの最終更新時のタイムスタンプ (日時) 
name: (文字列) 
description: (文字列) 
organization: (フィールド) 
variables: YAML または JSON 形式のインベントリー変数 (文字列) 
has_active_failures: インベントリーのホストが失敗したかどうかを示すフラグ (ブール値) 
total_hosts: インべントリー内のホストの合計数 (整数) 
hosts_with_active_failures: アクティブなエラーのあるインベントリー内のホスト数 (整数) 
total_groups: インべントリー内のグループの合計数 (整数) 
groups_with_active_failures: アクティブなエラーのあるインベントリー内のグループ数 (整数) 
has_inventory_sources: インベントリーに外部のインベントリーソースがあるかどうかを示すフラグ (ブール値) 
total_inventory_sources: インベントリー内で設定される外部インベントリーソースの合計数 (整数) 
inventory_sources_with_failures: エラーのあるこのインベントリー内の外部インベントリーソースの数 (整数) 
 
インベントリーの作成
新規インベントリーを作成するには、以下のインベントリーフィールドを使ってリソースに POST リクエストを実行します。
name: (文字列。必須) 
description: (文字列。デフォルトは "") 
organization: (フィールド。必須) 
variables: YAML または JSON 形式のインベントリー変数 (文字列。デフォルトは "") 
 
オプションエンドポイントの確認
オプションエンドポイント テーブルでは、このエンドポイントのオプションを確認できます。ブラウザー表示が可能な API でエンドポイントを表示している場合は、「オプション」ボタンをクリックすると以下の raw JSON が表示されます。
    
        | name | 
        
            Inventory List
         | 
    
    
        | description | 
        
            # List Inventories: Make a GET request to this resource to retrieve the list of inventories.
         | 
    
    
        | renders | 
        
            
                
                    | 0 | 
                    
                        application/json
                     | 
                 
                
                    | 1 | 
                    
                        text/html
                     | 
                 
             
         | 
    
    
        | parses | 
        
            
         | 
    
    
        | added_in_version | 
        
            1.2
         | 
    
    
        | actions | 
        
            
                
                    | POST | 
                    
                        
                            
                                | name | 
                                
                                    
                                        
                                            | type | 
                                            
                                                string
                                             | 
                                         
                                        
                                            | required | 
                                            
                                                 
                                                    true
                                                 
                                             | 
                                         
                                        
                                            | label | 
                                            
                                                name
                                             | 
                                         
                                        
                                            | max_length | 
                                            
                                                512
                                             | 
                                         
                                     
                                 | 
                             
                            
                                | description | 
                                
                                    
                                        
                                            | type | 
                                            
                                                string
                                             | 
                                         
                                        
                                            | required | 
                                            
                                                 
                                                    false
                                                 
                                             | 
                                         
                                        
                                            | label | 
                                            
                                                description
                                             | 
                                         
                                        
                                            | default | 
                                            
                                                (Empty Text)
                                             | 
                                         
                                     
                                 | 
                             
                            
                                | organization | 
                                
                                    
                                 | 
                             
                            
                                | variables | 
                                
                                    
                                        
                                            | type | 
                                            
                                                string
                                             | 
                                         
                                        
                                            | required | 
                                            
                                                 
                                                    false
                                                 
                                             | 
                                         
                                        
                                            | label | 
                                            
                                                variables
                                             | 
                                         
                                        
                                            | help_text | 
                                            
                                                Inventory variables in JSON or YAML format.
                                             | 
                                         
                                        
                                            | default | 
                                            
                                                (Empty Text)
                                             | 
                                         
                                     
                                 | 
                             
                         
                     | 
                 
                
                    | GET | 
                    
                        
                            
                                | id | 
                                
                                    
                                        
                                            | type | 
                                            
                                                integer
                                             | 
                                         
                                        
                                            | label | 
                                            
                                                ID
                                             | 
                                         
                                        
                                            | help_text | 
                                            
                                                Database ID for this inventory.
                                             | 
                                         
                                     
                                 | 
                             
                            
                                | type | 
                                
                                    
                                        
                                            | type | 
                                            
                                                multiple choice
                                             | 
                                         
                                        
                                            | help_text | 
                                            
                                                Data type for this inventory.
                                             | 
                                         
                                        
                                            | choices | 
                                            
                                                
                                             | 
                                         
                                     
                                 | 
                             
                            
                                | url | 
                                
                                    
                                        
                                            | type | 
                                            
                                                string
                                             | 
                                         
                                        
                                            | help_text | 
                                            
                                                URL for this inventory.
                                             | 
                                         
                                     
                                 | 
                             
                            
                                | related | 
                                
                                    
                                        
                                            | type | 
                                            
                                                object
                                             | 
                                         
                                        
                                            | help_text | 
                                            
                                                Data structure with URLs of related resources.
                                             | 
                                         
                                     
                                 | 
                             
                            
                                | summary_fields | 
                                
                                    
                                        
                                            | type | 
                                            
                                                object
                                             | 
                                         
                                        
                                            | help_text | 
                                            
                                                Data structure with name/description for related resources.
                                             | 
                                         
                                     
                                 | 
                             
                            
                                | created | 
                                
                                    
                                        
                                            | type | 
                                            
                                                datetime
                                             | 
                                         
                                        
                                            | help_text | 
                                            
                                                Timestamp when this inventory was created.
                                             | 
                                         
                                     
                                 | 
                             
                            
                                | modified | 
                                
                                    
                                        
                                            | type | 
                                            
                                                datetime
                                             | 
                                         
                                        
                                            | help_text | 
                                            
                                                Timestamp when this inventory was last modified.
                                             | 
                                         
                                     
                                 | 
                             
                            
                                | name | 
                                
                                    
                                 | 
                             
                            
                                | description | 
                                
                                    
                                        
                                            | type | 
                                            
                                                string
                                             | 
                                         
                                        
                                            | label | 
                                            
                                                description
                                             | 
                                         
                                     
                                 | 
                             
                            
                                | organization | 
                                
                                    
                                 | 
                             
                            
                                | variables | 
                                
                                    
                                        
                                            | type | 
                                            
                                                string
                                             | 
                                         
                                        
                                            | label | 
                                            
                                                variables
                                             | 
                                         
                                        
                                            | help_text | 
                                            
                                                Inventory variables in JSON or YAML format.
                                             | 
                                         
                                     
                                 | 
                             
                            
                                | has_active_failures | 
                                
                                    
                                        
                                            | type | 
                                            
                                                boolean
                                             | 
                                         
                                        
                                            | label | 
                                            
                                                has active failures
                                             | 
                                         
                                        
                                            | help_text | 
                                            
                                                Flag indicating whether any hosts in this inventory have failed.
                                             | 
                                         
                                     
                                 | 
                             
                            
                                | total_hosts | 
                                
                                    
                                        
                                            | type | 
                                            
                                                integer
                                             | 
                                         
                                        
                                            | label | 
                                            
                                                total hosts
                                             | 
                                         
                                        
                                            | help_text | 
                                            
                                                Total mumber of hosts in this inventory.
                                             | 
                                         
                                     
                                 | 
                             
                            
                                | hosts_with_active_failures | 
                                
                                    
                                        
                                            | type | 
                                            
                                                integer
                                             | 
                                         
                                        
                                            | label | 
                                            
                                                hosts with active failures
                                             | 
                                         
                                        
                                            | help_text | 
                                            
                                                Number of hosts in this inventory with active failures.
                                             | 
                                         
                                     
                                 | 
                             
                            
                                | total_groups | 
                                
                                    
                                        
                                            | type | 
                                            
                                                integer
                                             | 
                                         
                                        
                                            | label | 
                                            
                                                total groups
                                             | 
                                         
                                        
                                            | help_text | 
                                            
                                                Total number of groups in this inventory.
                                             | 
                                         
                                     
                                 | 
                             
                            
                                | groups_with_active_failures | 
                                
                                    
                                        
                                            | type | 
                                            
                                                integer
                                             | 
                                         
                                        
                                            | label | 
                                            
                                                groups with active failures
                                             | 
                                         
                                        
                                            | help_text | 
                                            
                                                Number of groups in this inventory with active failures.
                                             | 
                                         
                                     
                                 | 
                             
                            
                                | has_inventory_sources | 
                                
                                    
                                        
                                            | type | 
                                            
                                                boolean
                                             | 
                                         
                                        
                                            | label | 
                                            
                                                has inventory sources
                                             | 
                                         
                                        
                                            | help_text | 
                                            
                                                Flag indicating whether this inventory has any external inventory sources.
                                             | 
                                         
                                     
                                 | 
                             
                            
                                | total_inventory_sources | 
                                
                                    
                                        
                                            | type | 
                                            
                                                integer
                                             | 
                                         
                                        
                                            | label | 
                                            
                                                total inventory sources
                                             | 
                                         
                                        
                                            | help_text | 
                                            
                                                Total number of external inventory sources configured within this inventory.
                                             | 
                                         
                                     
                                 | 
                             
                            
                                | inventory_sources_with_failures | 
                                
                                    
                                        
                                            | type | 
                                            
                                                integer
                                             | 
                                         
                                        
                                            | label | 
                                            
                                                inventory sources with failures
                                             | 
                                         
                                        
                                            | help_text | 
                                            
                                                Number of external inventory sources in this inventory with failures.
                                             | 
                                         
                                     
                                 | 
                             
                         
                     | 
                 
             
         | 
    
    
        | types | 
        
            
         | 
    
    
        | search_fields | 
        
            
         |