Create a Host for an Inventory

post

/api/v2/inventories/{id}/hosts/

Make a POST request to this resource with the following host fields to create a new host associated with this inventory.

  • name: Name of this host. (string, required)
  • description: Optional description of this host. (string, default="")

  • enabled: Is this host online and available for running jobs? (boolean, default=True)

  • instance_id: The value used by the remote inventory source to uniquely identify the host (string, default="")
  • variables: Host variables in JSON or YAML format. (json, default=``)

Remove Inventory Hosts:

Make a POST request to this resource with id and disassociate fields to delete the associated host.

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

Request

Supported Media Types
Path Parameters
Body ()
Root Schema : Host
Type: object
Show Source
Back to Top

Response

Supported Media Types

201 Response

Body ()
Root Schema : Host
Type: object
Show Source
Back to Top