GET /api/hosts
List all hosts.

参数

参数名字 描述
search
选填

Filter results

Validations:

  • Must be String

order
选填

Sort results

Validations:

  • Must be String

page
选填

页数

Validations:

  • Must be String

per_page
选填

每个请求中的条目数

Validations:

  • Must be String


GET /api/hosts/:id
Show a host.

参数

参数名字 描述
id
必填

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, dot(.), space, underscore(_), hypen(-) with no leading or trailing space.


POST /api/hosts
Create a host.

参数

参数名字 描述
host
必填

Validations:

  • Must be a Hash

host[name]
必填

Validations:

  • Must be String

host[location_id]
必填

required if locations are enabled

Validations:

  • Must be a number.

host[organization_id]
必填

required if organizations are enabled

Validations:

  • Must be a number.

host[environment_id]
选填

required if host is managed and value is not inherited from host group

Validations:

  • Must be String

host[ip]
选填

如果使用附带 DHCP 代理服务器的子网则不需要

Validations:

  • Must be String

host[mac]
选填

required for managed host that is bare metal, not required if it's a virtual machine

Validations:

  • Must be String

host[architecture_id]
选填

required if host is managed and value is not inherited from host group

Validations:

  • Must be a number.

host[domain_id]
选填

required if host is managed and value is not inherited from host group

Validations:

  • Must be a number.

host[realm_id]
选填

Validations:

  • Must be a number.

host[puppet_proxy_id]
选填

Validations:

  • Must be a number.

host[puppetclass_ids]
选填

Validations:

  • Must be an array of any type

host[operatingsystem_id]
选填

required if host is managed and value is not inherited from host group

Validations:

  • Must be String

host[medium_id]
选填

required if not imaged based provisioning and host is managed and value is not inherited from host group

Validations:

  • Must be String

host[ptable_id]
选填

required if host is managed and custom partition has not been defined

Validations:

  • Must be a number.

host[subnet_id]
选填

required if host is managed and value is not inherited from host group

Validations:

  • Must be a number.

host[compute_resource_id]
选填

nil means host is bare metal

Validations:

  • Must be a number.

host[root_pass]
选填

required if host is managed and value is not inherited from host group or default password in settings

Validations:

  • Must be String

host[model_id]
选填

Validations:

  • Must be a number.

host[hostgroup_id]
选填

Validations:

  • Must be a number.

host[owner_id]
选填

Validations:

  • Must be a number.

host[puppet_ca_proxy_id]
选填

Validations:

  • Must be a number.

host[image_id]
选填

Validations:

  • Must be a number.

host[host_parameters_attributes]
选填

Host's parameters (array or indexed hash)

Validations:

  • Must be an Array of nested elements

host[host_parameters_attributes][name]
必填

Name of the parameter

Validations:

  • Must be String

host[host_parameters_attributes][value]
必填

Parameter value

Validations:

  • Must be String

host[build]
选填

Validations:

  • Must be 'true' or 'false' or '1' or '0'

host[enabled]
选填

Validations:

  • Must be 'true' or 'false' or '1' or '0'

host[provision_method]
选填

Validations:

  • Must be String

host[managed]
选填

True/False flag whether a host is managed or unmanaged. Note: this value also determines whether several parameters are required or not

Validations:

  • Must be 'true' or 'false' or '1' or '0'

host[progress_report_id]
选填

用来跟踪复杂任务状态的 UUID,GET /api/orchestration/:UUID/tasks

Validations:

  • Must be String

host[comment]
选填

本机附加信息

Validations:

  • Must be String

host[capabilities]
选填

Validations:

  • Must be String

host[compute_profile_id]
选填

Validations:

  • Must be a number.

host[compute_attributes]
选填

Validations:

  • Must be a Hash


PUT /api/hosts/:id
Update a host.

参数

参数名字 描述
id
必填

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.

host
必填

Validations:

  • Must be a Hash

host[name]
选填

Validations:

  • Must be String

host[environment_id]
选填

Validations:

  • Must be String

host[ip]
选填

not required if using a subnet with dhcp proxy

Validations:

  • Must be String

host[mac]
选填

not required if its a virtual machine

Validations:

  • Must be String

host[architecture_id]
选填

Validations:

  • Must be a number.

host[domain_id]
选填

Validations:

  • Must be a number.

host[puppet_proxy_id]
选填

Validations:

  • Must be a number.

host[operatingsystem_id]
选填

Validations:

  • Must be String

host[puppetclass_ids]
选填

Validations:

  • Must be an array of any type

host[medium_id]
选填

Validations:

  • Must be a number.

host[ptable_id]
选填

Validations:

  • Must be a number.

host[subnet_id]
选填

Validations:

  • Must be a number.

host[compute_resource_id]
选填

Validations:

  • Must be a number.

host[sp_subnet_id]
选填

Validations:

  • Must be a number.

host[model_id]
选填

Validations:

  • Must be a number.

host[hostgroup_id]
选填

Validations:

  • Must be a number.

host[owner_id]
选填

Validations:

  • Must be a number.

host[puppet_ca_proxy_id]
选填

Validations:

  • Must be a number.

host[image_id]
选填

Validations:

  • Must be a number.

host[host_parameters_attributes]
选填

Validations:

  • Must be an array of any type

host[build]
选填

Validations:

  • Must be 'true' or 'false' or '1' or '0'

host[enabled]
选填

Validations:

  • Must be 'true' or 'false' or '1' or '0'

host[provision_method]
选填

Validations:

  • Must be String

host[managed]
选填

Validations:

  • Must be 'true' or 'false' or '1' or '0'

host[progress_report_id]
选填

用来跟踪复杂任务状态的 UUID,GET /api/orchestration/:UUID/tasks

Validations:

  • Must be String

host[capabilities]
选填

Validations:

  • Must be String

host[compute_attributes]
选填

Validations:

  • Must be a Hash


DELETE /api/hosts/:id
Delete an host.

参数

参数名字 描述
id
必填

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.


GET /api/hosts/:id/status
Get status of host

Return value may either be one of the following:

  • missing

  • failed

  • pending

  • changed

  • unchanged

  • unreported

参数

参数名字 描述
id
必填

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, dot(.), space, underscore(_), hypen(-) with no leading or trailing space.