Update Inventory Source

post

/api/v2/inventory_sources/{id}/update/

Make a GET request to this resource to determine if the group can be updated from its inventory source. The response will include the following field:

  • can_update: Flag indicating if this inventory source can be updated (boolean, read-only)

Make a POST request to this resource to update the inventory source. If successful, the response status code will be 202. If the inventory source is not defined or cannot be updated, a 405 status code will be returned.

Request

Supported Media Types
Path Parameters
Back to Top

Response

Supported Media Types

201 Response

202 Response

Body
Example Response (application/json)
{
    "canceled_on":null,
    "created":"2018-02-01T08:00:00.000000Z",
    "credential":null,
    "custom_virtualenv":null,
    "description":"",
    "elapsed":0,
    "enabled_value":"",
    "enabled_var":"",
    "event_processing_finished":false,
    "execution_node":"",
    "failed":false,
    "finished":null,
    "host_filter":"",
    "id":1,
    "inventory":1,
    "inventory_source":1,
    "inventory_update":1,
    "job_args":"",
    "job_cwd":"",
    "job_env":{
    },
    "job_explanation":"",
    "launch_type":"manual",
    "license_error":false,
    "modified":"2018-02-01T08:00:00.000000Z",
    "name":"test-inv - single-inv-src",
    "org_host_limit_error":false,
    "overwrite":false,
    "overwrite_vars":false,
    "related":{
        "cancel":"/api/v2/inventory_updates/1/cancel/",
        "credentials":"/api/v2/inventory_updates/1/credentials/",
        "events":"/api/v2/inventory_updates/1/events/",
        "inventory":"/api/v2/inventories/1/",
        "inventory_source":"/api/v2/inventory_sources/1/",
        "notifications":"/api/v2/inventory_updates/1/notifications/",
        "stdout":"/api/v2/inventory_updates/1/stdout/",
        "unified_job_template":"/api/v2/inventory_sources/1/"
    },
    "result_traceback":"",
    "source":"ec2",
    "source_path":"",
    "source_project":null,
    "source_project_update":null,
    "source_script":null,
    "source_vars":"",
    "started":null,
    "status":"pending",
    "summary_fields":{
        "credentials":[
        ],
        "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
        },
        "inventory_source":{
            "source":"ec2",
            "status":"pending"
        },
        "organization":{
            "description":"test-org-desc",
            "id":1,
            "name":"test-org"
        },
        "unified_job_template":{
            "description":"",
            "id":1,
            "name":"single-inv-src",
            "unified_job_type":"inventory_update"
        },
        "user_capabilities":{
            "delete":false,
            "start":false
        }
    },
    "timeout":0,
    "type":"inventory_update",
    "unified_job_template":1,
    "url":"/api/v2/inventory_updates/1/",
    "verbosity":1
}

403 Response

Body
Example Response (application/json)
{
    "detail":"You do not have permission to perform this action."
}
Back to Top