GET /api/hosts
List all hosts.

参数

参数名字 描述
search
选填

Filter results

Validations:

  • Must be a String

order
选填

Sort results

Validations:

  • Must be a String

page
选填

编页结果

Validations:

  • Must be a String

per_page
选填

每个请求中的条目数

Validations:

  • Must be a 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 a String

host[location_id]
必填

如果启用位置则需填写。

Validations:

  • Must be a number.

host[organization_id]
必填

如果启用机构则需要填写

Validations:

  • Must be a number.

host[environment_id]
选填

如果已管理主机,且数值不是从主机组中继承,则需填写。

Validations:

  • Must be a String

host[ip]
选填

IPv4 地址

Validations:

  • Must be a String

host[ip6]
选填

IPv6 地址

Validations:

  • Must be a String

host[mac]
选填

如果管理的主机为裸机则需要填写,如果为虚拟机,则不需要。

Validations:

  • Must be a String

host[architecture_id]
选填

如果已管理主机,且数值不是从主机组中继承,则需填写。

Validations:

  • Must be a number.

host[domain_id]
选填

如果已管理主机,且数值不是从主机组中继承,则需填写。

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]
选填

如果已管理主机,且数值不是从主机组中继承,则需填写。

Validations:

  • Must be a String

host[medium_id]
选填

如果不是基于置备的映像,且用于管理主机,同时数值不是来自主机组,则需要填写。

Validations:

  • Must be a String

host[pxe_loader]
选填

DHCP 文件名选项

Validations:

  • Must be one of: None, PXELinux BIOS, PXELinux UEFI, Grub UEFI, Grub UEFI SecureBoot, Grub2 UEFI, Grub2 UEFI SecureBoot.

host[ptable_id]
选填

如果已管理主机,且未定义自定义分区,则需填写。

Validations:

  • Must be a number.

host[subnet_id]
选填

IPv4 subnet

Validations:

  • Must be a number.

host[subnet6_id]
选填

IPv6 subnet

Validations:

  • Must be a number.

host[compute_resource_id]
选填

nil 说明主机是裸机

Validations:

  • Must be a number.

host[root_pass]
选填

如果已管理主机,且数值不是从主机组或设置中的默认密码继承,则需填写。

Validations:

  • Must be a 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]
选填

主机参数(阵列或索引哈希)

Validations:

  • Must be an Array of nested elements

host[host_parameters_attributes][name]
必填

参数名称

Validations:

  • Must be a String

host[host_parameters_attributes][value]
必填

参数值

Validations:

  • Must be a String

host[build]
选填

Validations:

  • Must be one of: true, false, 1, 0

host[enabled]
选填

Validations:

  • Must be one of: true, false, 1, 0

host[provision_method]
选填

Validations:

  • Must be a String

host[managed]
选填

用来表示主机被管理或没有被管理的 True/False 标签。注:这个值还决定是否需要一些参数。

Validations:

  • Must be one of: true, false, 1, 0

host[progress_report_id]
选填

用来跟踪业务流程任务状态的 UUID,GET /api/orchestration/:UUID/tasks

Validations:

  • Must be a String

host[comment]
选填

有关主机的附加信息

Validations:

  • Must be a String

host[capabilities]
选填

Validations:

  • Must be a 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 a String

host[environment_id]
选填

Validations:

  • Must be a String

host[ip]
选填

IPv4 address, not required if using a subnet with dhcp proxy

Validations:

  • Must be a String

host[ip6]
选填

IPv6 地址

Validations:

  • Must be a String

host[mac]
选填

not required if its a virtual machine

Validations:

  • Must be a 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 a 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]
选填

IPv4 subnet

Validations:

  • Must be a number.

host[subnet6_id]
选填

IPv6 subnet

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 one of: true, false, 1, 0

host[enabled]
选填

Validations:

  • Must be one of: true, false, 1, 0

host[provision_method]
选填

Validations:

  • Must be a String

host[managed]
选填

Validations:

  • Must be one of: true, false, 1, 0

host[progress_report_id]
选填

用来跟踪业务流程任务状态的 UUID,GET /api/orchestration/:UUID/tasks

Validations:

  • Must be a String

host[capabilities]
选填

Validations:

  • Must be a 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
获取主机状态

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.