GET /api/hosts
List all hosts.

參數

參數名字 描述
search
選填

Filter results


Value:

Must be String

order
選填

Sort results


Value:

Must be String

page
選填

編頁結果


Value:

Must be String

per_page
選填

每個請求的項目數量


Value:

Must be String


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

參數

參數名字 描述
id
必填

Value:

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
必填

Value:

Must be a Hash

host[name]
必填

Value:

Must be String

host[environment_id]
選填

若主機是個受管理的主機,並且值不是由主機群組所繼承的話便需要


Value:

Must be String

host[ip]
選填

若是使用一個含有 DHCP 協定的子網路則不需要


Value:

Must be String

host[mac]
選填

屬於裸機的受管理主機需要,若是虛擬機器則不需要


Value:

Must be String

host[architecture_id]
選填

若主機是個受管理的主機,並且值不是由主機群組所繼承的話便需要


Value:

Must be a number.

host[domain_id]
選填

若主機是個受管理的主機,並且值不是由主機群組所繼承的話便需要


Value:

Must be a number.

host[realm_id]
選填

Value:

Must be a number.

host[puppet_proxy_id]
選填

Value:

Must be a number.

host[puppet_class_ids]
選填

Value:

Must be an array of any type

host[operatingsystem_id]
選填

若主機是個受管理的主機,並且值不是由主機群組所繼承的話便需要


Value:

Must be String

host[medium_id]
選填

若不是基於映像檔的佈建,而主機受管理並且值並非由主機群組所繼承的話便需要


Value:

Must be String

host[ptable_id]
選填

若主機是個受管理的主機,並且尚未定義自訂分割區的話便需要


Value:

Must be a number.

host[subnet_id]
選填

若主機是個受管理的主機,並且值不是由主機群組所繼承的話便需要


Value:

Must be a number.

host[compute_resource_id]
選填

nil 代表主機為裸機


Value:

Must be a number.

host[root_pass]
選填

若主機是個受管理的主機,並且值不是由主機群組或是設定中的預設密碼所繼承的話便需要


Value:

Must be String

host[model_id]
選填

Value:

Must be a number.

host[hostgroup_id]
選填

Value:

Must be a number.

host[owner_id]
選填

Value:

Must be a number.

host[puppet_ca_proxy_id]
選填

Value:

Must be a number.

host[image_id]
選填

Value:

Must be a number.

host[host_parameters_attributes]
選填

Host's parameters (array or indexed hash)


Value:

Must be an Array of nested elements

host[host_parameters_attributes][name]
必填

Name of the parameter


Value:

Must be String

host[host_parameters_attributes][value]
必填

Parameter value


Value:

Must be String

host[build]
選填

Value:

Must be 'true' or 'false'

host[enabled]
選填

Value:

Must be 'true' or 'false'

host[provision_method]
選填

Value:

Must be String

host[managed]
選填

True/False 標記代表主機是否受管理。請注意:這個值也能決定是否需要數個參數


Value:

Must be 'true' or 'false'

host[progress_report_id]
選填

用來追蹤協調流程任務狀態的 UUID,GET /api/orchestration/:UUID/tasks


Value:

Must be String

host[comment]
選填

有關於這部主機的額外資訊


Value:

Must be String

host[capabilities]
選填

Value:

Must be String

host[compute_profile_id]
選填

Value:

Must be a number.

host[compute_attributes]
選填

Value:

Must be a Hash


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

參數

參數名字 描述
id
必填

Value:

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

host
必填

Value:

Must be a Hash

host[name]
選填

Value:

Must be String

host[environment_id]
選填

Value:

Must be String

host[ip]
選填

not required if using a subnet with dhcp proxy


Value:

Must be String

host[mac]
選填

not required if its a virtual machine


Value:

Must be String

host[architecture_id]
選填

Value:

Must be a number.

host[domain_id]
選填

Value:

Must be a number.

host[puppet_proxy_id]
選填

Value:

Must be a number.

host[operatingsystem_id]
選填

Value:

Must be String

host[puppet_class_ids]
選填

Value:

Must be an array of any type

host[medium_id]
選填

Value:

Must be a number.

host[ptable_id]
選填

Value:

Must be a number.

host[subnet_id]
選填

Value:

Must be a number.

host[compute_resource_id]
選填

Value:

Must be a number.

host[sp_subnet_id]
選填

Value:

Must be a number.

host[model_id]
選填

Value:

Must be a number.

host[hostgroup_id]
選填

Value:

Must be a number.

host[owner_id]
選填

Value:

Must be a number.

host[puppet_ca_proxy_id]
選填

Value:

Must be a number.

host[image_id]
選填

Value:

Must be a number.

host[host_parameters_attributes]
選填

Value:

Must be an array of any type

host[build]
選填

Value:

Must be 'true' or 'false'

host[enabled]
選填

Value:

Must be 'true' or 'false'

host[provision_method]
選填

Value:

Must be String

host[managed]
選填

Value:

Must be 'true' or 'false'

host[progress_report_id]
選填

用來追蹤協調流程任務狀態的 UUID,GET /api/orchestration/:UUID/tasks


Value:

Must be String

host[capabilities]
選填

Value:

Must be String

host[compute_attributes]
選填

Value:

Must be a Hash


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

參數

參數名字 描述
id
必填

Value:

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
必填

Value:

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