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
- application/json
Path Parameters
Root Schema : Host
Type:
Show Source
object-
ansible_facts_modified:
string(date-time)
Title:
Ansible facts modifiedRead Only:trueThe date and time ansible_facts was last modified. -
created:
string
Title:
CreatedRead Only:true -
description:
string
Title:
Description -
enabled:
boolean
Title:
EnabledDefault Value:trueIs this host online and available for running jobs? -
has_active_failures:
string
Title:
Has active failuresRead Only:true -
has_inventory_sources:
string
Title:
Has inventory sourcesRead Only:true -
id:
integer
Title:
IDRead Only:true -
instance_id:
string
Title:
Instance idMaximum Length:1024The value used by the remote inventory source to uniquely identify the host -
inventory(required):
integer
Title:
Inventory -
last_job:
string
Title:
Last jobRead Only:true -
last_job_host_summary:
integer
Title:
Last job host summaryRead Only:true -
modified:
string
Title:
ModifiedRead Only:true -
name(required):
string
Title:
NameMinimum Length:1Maximum Length:512 - related: string
-
summary_fields:
string
Title:
Summary fieldsRead Only:true -
type:
string
Title:
TypeRead Only:true -
url:
string
Title:
UrlRead Only:true -
variables:
string
Title:
VariablesHost variables in JSON or YAML format.
Response
Supported Media Types
- application/json
201 Response
Root Schema : Host
Type:
Show Source
object-
ansible_facts_modified:
string(date-time)
Title:
Ansible facts modifiedRead Only:trueThe date and time ansible_facts was last modified. -
created:
string
Title:
CreatedRead Only:true -
description:
string
Title:
Description -
enabled:
boolean
Title:
EnabledDefault Value:trueIs this host online and available for running jobs? -
has_active_failures:
string
Title:
Has active failuresRead Only:true -
has_inventory_sources:
string
Title:
Has inventory sourcesRead Only:true -
id:
integer
Title:
IDRead Only:true -
instance_id:
string
Title:
Instance idMaximum Length:1024The value used by the remote inventory source to uniquely identify the host -
inventory(required):
integer
Title:
Inventory -
last_job:
string
Title:
Last jobRead Only:true -
last_job_host_summary:
integer
Title:
Last job host summaryRead Only:true -
modified:
string
Title:
ModifiedRead Only:true -
name(required):
string
Title:
NameMinimum Length:1Maximum Length:512 - related: string
-
summary_fields:
string
Title:
Summary fieldsRead Only:true -
type:
string
Title:
TypeRead Only:true -
url:
string
Title:
UrlRead Only:true -
variables:
string
Title:
VariablesHost variables in JSON or YAML format.