GET /api/hosts
列出所有主機

GET /api/hostgroups/:hostgroup_id/hosts
列出主機群組的所有主機

GET /api/locations/:location_id/hosts
列出各個位置中的主機

GET /api/organizations/:organization_id/hosts
列出各個組織中的主機

GET /api/environments/:environment_id/hosts
列出各個環境中的主機

參數

參數名字 描述
hostgroup_id
選填

主機群組的 ID

Validations:

  • Must be String

location_id
選填

位置 ID

Validations:

  • Must be String

organization_id
選填

組織 ID

Validations:

  • Must be String

environment_id
選填

環境的 ID

Validations:

  • Must be String

search
選填

篩選結果

Validations:

  • Must be String

order
選填

排序結果

Validations:

  • Must be String

page
選填

編頁結果

Validations:

  • Must be String

per_page
選填

每個請求的項目數量

Validations:

  • Must be String


GET /api/hosts/:id
顯示主機

參數

參數名字 描述
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
建立主機

參數

參數名字 描述
host
必填

Validations:

  • Must be a Hash

host[name]
必填

Validations:

  • Must be String

host[environment_id]
選填 , 允許空值

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

Validations:

  • Must be String

host[ip]
選填 , 允許空值

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

Validations:

  • Must be String

host[mac]
選填 , 允許空值

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

Validations:

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

host[medium_id]
選填 , 允許空值

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

Validations:

  • Must be String

host[ptable_id]
選填 , 允許空值

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

Validations:

  • Must be a number.

host[subnet_id]
選填 , 允許空值

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

Validations:

  • Must be a number.

host[compute_resource_id]
選填 , 允許空值

nil 代表主機為裸機

Validations:

  • Must be a number.

host[root_pass]
選填 , 允許空值

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

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[owner_type]
選填 , 允許空值

主機的擁有者類型

Validations:

  • Must be one of: User, Usergroup.

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]
選填 , 允許空值

The method used to provision the host. Possible provision_methods may be build (基於網路), image (基於映像檔)

Validations:

  • Must be String

host[managed]
選填 , 允許空值

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

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[interfaces_attributes]
選填 , 允許空值

Host's network interfaces.

Validations:

  • Must be an Array of nested elements

host[interfaces_attributes][mac]
選填 , 允許空值

MAC address of interface. Required for managed interfaces on bare metal.

Validations:

  • Must be String

host[interfaces_attributes][ip]
選填 , 允許空值

介面卡的 IP 位址

Validations:

  • Must be String

host[interfaces_attributes][type]
選填 , 允許空值

Interface type, e.g. bmc. Default is interface

Validations:

  • Must be one of: interface, bmc, bond, bridge.

host[interfaces_attributes][name]
選填 , 允許空值

Interface's DNS name

Validations:

  • Must be String

host[interfaces_attributes][subnet_id]
選填 , 允許空值

介面卡的 Foremane 子網路 ID

Validations:

  • Must be Fixnum

host[interfaces_attributes][domain_id]
選填 , 允許空值

Foreman domain ID of interface. Required for primary interfaces on managed hosts.

Validations:

  • Must be Fixnum

host[interfaces_attributes][identifier]
選填 , 允許空值

裝置辨識子,例如 eth0 或 eth1.1

Validations:

  • Must be String

host[interfaces_attributes][managed]
選填 , 允許空值

這個介面卡是否應該透過 DHCP 和 DNS 智慧型代理伺服器管理,以及它是否應該在佈建時進行配置?

Validations:

  • Must be ‘true’ or ‘false’ or ‘1’ or ‘0’

host[interfaces_attributes][primary]
選填 , 允許空值

Should this interface be used for constructing the FQDN of the host? Each managed hosts needs to have one primary interface.

Validations:

  • Must be ‘true’ or ‘false’ or ‘1’ or ‘0’

host[interfaces_attributes][provision]
選填 , 允許空值

Should this interface be used for TFTP of PXELinux (or SSH for image-based hosts)? Each managed hosts needs to have one provision interface.

Validations:

  • Must be ‘true’ or ‘false’ or ‘1’ or ‘0’

host[interfaces_attributes][username]
選填 , 允許空值

僅適用於 BMC 介面卡。

Validations:

  • Must be String

host[interfaces_attributes][password]
選填 , 允許空值

僅適用於 BMC 介面卡。

Validations:

  • Must be String

host[interfaces_attributes][provider]
選填 , 允許空值

介面卡供應者,例如 IPMI。僅適用於 BMC 介面卡。

Validations:

  • Must be one of: IPMI.

host[interfaces_attributes][virtual]
選填 , 允許空值

別名或 VLAN 裝置

Validations:

  • Must be ‘true’ or ‘false’ or ‘1’ or ‘0’

host[interfaces_attributes][tag]
選填 , 允許空值

VLAN 標籤,這個屬性擁有比子網路 VLAN ID 更高的優先權。僅適用於虛擬介面卡。

Validations:

  • Must be String

host[interfaces_attributes][attached_to]
選填 , 允許空值

辨識此介面卡的辨識子,例如 eth1。僅適用於虛擬介面卡。

Validations:

  • Must be String

host[interfaces_attributes][mode]
選填 , 允許空值

介面的綁定模式,例如 balance-rr。僅用於綁定介面。

Validations:

  • Must be one of: balance-rr, active-backup, balance-xor, broadcast, 802.3ad, balance-tlb, balance-alb.

host[interfaces_attributes][attached_devices]
選填 , 允許空值

Identifiers of attached interfaces, e.g. `['eth1', 'eth2']`. For bond interfaces those are the slaves. Only for bond and bridges interfaces.

Validations:

  • Must be an array of any type

host[interfaces_attributes][bond_options]
選填 , 允許空值

以空格區隔開的選項,例如 miimon=100。僅適用於 bond 介面卡。

Validations:

  • Must be String

host[interfaces_attributes][compute_attributes]
選填 , 允許空值

Additional compute resource specific attributes for the interface.

Validations:

  • Must be Hash

host[compute_attributes]
選填 , 允許空值

Additional compute resource specific attributes.

Validations:

  • Must be Hash


PUT /api/hosts/:id
更新主機

參數

參數名字 描述
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]
選填 , 允許空值

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

Validations:

  • Must be String

host[mac]
選填 , 允許空值

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

Validations:

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

host[medium_id]
選填 , 允許空值

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

Validations:

  • Must be String

host[ptable_id]
選填 , 允許空值

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

Validations:

  • Must be a number.

host[subnet_id]
選填 , 允許空值

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

Validations:

  • Must be a number.

host[compute_resource_id]
選填 , 允許空值

nil 代表主機為裸機

Validations:

  • Must be a number.

host[root_pass]
選填 , 允許空值

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

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[owner_type]
選填 , 允許空值

主機的擁有者類型

Validations:

  • Must be one of: User, Usergroup.

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]
選填 , 允許空值

The method used to provision the host. Possible provision_methods may be build (基於網路), image (基於映像檔)

Validations:

  • Must be String

host[managed]
選填 , 允許空值

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

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[interfaces_attributes]
選填 , 允許空值

Host's network interfaces.

Validations:

  • Must be an Array of nested elements

host[interfaces_attributes][mac]
選填 , 允許空值

MAC address of interface. Required for managed interfaces on bare metal.

Validations:

  • Must be String

host[interfaces_attributes][ip]
選填 , 允許空值

介面卡的 IP 位址

Validations:

  • Must be String

host[interfaces_attributes][type]
選填 , 允許空值

Interface type, e.g. bmc. Default is interface

Validations:

  • Must be one of: interface, bmc, bond, bridge.

host[interfaces_attributes][name]
選填 , 允許空值

Interface's DNS name

Validations:

  • Must be String

host[interfaces_attributes][subnet_id]
選填 , 允許空值

介面卡的 Foremane 子網路 ID

Validations:

  • Must be Fixnum

host[interfaces_attributes][domain_id]
選填 , 允許空值

Foreman domain ID of interface. Required for primary interfaces on managed hosts.

Validations:

  • Must be Fixnum

host[interfaces_attributes][identifier]
選填 , 允許空值

裝置辨識子,例如 eth0 或 eth1.1

Validations:

  • Must be String

host[interfaces_attributes][managed]
選填 , 允許空值

這個介面卡是否應該透過 DHCP 和 DNS 智慧型代理伺服器管理,以及它是否應該在佈建時進行配置?

Validations:

  • Must be ‘true’ or ‘false’ or ‘1’ or ‘0’

host[interfaces_attributes][primary]
選填 , 允許空值

Should this interface be used for constructing the FQDN of the host? Each managed hosts needs to have one primary interface.

Validations:

  • Must be ‘true’ or ‘false’ or ‘1’ or ‘0’

host[interfaces_attributes][provision]
選填 , 允許空值

Should this interface be used for TFTP of PXELinux (or SSH for image-based hosts)? Each managed hosts needs to have one provision interface.

Validations:

  • Must be ‘true’ or ‘false’ or ‘1’ or ‘0’

host[interfaces_attributes][username]
選填 , 允許空值

僅適用於 BMC 介面卡。

Validations:

  • Must be String

host[interfaces_attributes][password]
選填 , 允許空值

僅適用於 BMC 介面卡。

Validations:

  • Must be String

host[interfaces_attributes][provider]
選填 , 允許空值

介面卡供應者,例如 IPMI。僅適用於 BMC 介面卡。

Validations:

  • Must be one of: IPMI.

host[interfaces_attributes][virtual]
選填 , 允許空值

別名或 VLAN 裝置

Validations:

  • Must be ‘true’ or ‘false’ or ‘1’ or ‘0’

host[interfaces_attributes][tag]
選填 , 允許空值

VLAN 標籤,這個屬性擁有比子網路 VLAN ID 更高的優先權。僅適用於虛擬介面卡。

Validations:

  • Must be String

host[interfaces_attributes][attached_to]
選填 , 允許空值

辨識此介面卡的辨識子,例如 eth1。僅適用於虛擬介面卡。

Validations:

  • Must be String

host[interfaces_attributes][mode]
選填 , 允許空值

介面的綁定模式,例如 balance-rr。僅用於綁定介面。

Validations:

  • Must be one of: balance-rr, active-backup, balance-xor, broadcast, 802.3ad, balance-tlb, balance-alb.

host[interfaces_attributes][attached_devices]
選填 , 允許空值

Identifiers of attached interfaces, e.g. `['eth1', 'eth2']`. For bond interfaces those are the slaves. Only for bond and bridges interfaces.

Validations:

  • Must be an array of any type

host[interfaces_attributes][bond_options]
選填 , 允許空值

以空格區隔開的選項,例如 miimon=100。僅適用於 bond 介面卡。

Validations:

  • Must be String

host[interfaces_attributes][compute_attributes]
選填 , 允許空值

Additional compute resource specific attributes for the interface.

Validations:

  • Must be Hash

host[compute_attributes]
選填 , 允許空值

Additional compute resource specific attributes.

Validations:

  • Must be Hash


DELETE /api/hosts/:id
刪除主機

參數

參數名字 描述
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 configuration 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.


GET /api/hosts/:id/status/:type
取得主機的狀態

Returns string representing a host status of a given type

參數

參數名字 描述
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.

type
必填

status type, can be one of

  • global

  • configuration

  • build

Validations:

  • Must be one of: HostStatus::Global, configuration, build.


GET /api/hosts/:id/vm_compute_attributes
Get vm attributes of host

Return the host's compute attributes that can be used to create a clone of this VM

參數

參數名字 描述
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.


PUT /api/hosts/:id/puppetrun
強制 Puppet 代理程式在主機上執行

參數

參數名字 描述
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.


PUT /api/hosts/:id/disassociate
解除主機與 VM 的相聯性

參數

參數名字 描述
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.


PUT /api/hosts/:id/power
在主機上執行一項電源作業

參數

參數名字 描述
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.

power_action
必填

電源動作,有效的動作為(on/start)、(off/stop)、(soft/reboot)、(cycle/reset)、(state/status)

Validations:

  • Must be String


PUT /api/hosts/:id/boot
從特定裝置啟動主機

參數

參數名字 描述
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.

device
必填

開機裝置,有效裝置為磁碟、cdrom、pxe、bios

Validations:

  • Must be String


POST /api/hosts/facts
上傳主機的詳情,並視需求建立主機

參數

參數名字 描述
name
必填

主機的主機名稱

Validations:

  • Must be String

facts
必填

包含主機詳情的雜湊

Validations:

  • Must be Hash

certname
選填

選用性:主機的憑證名稱

Validations:

  • Must be String

type
選填

選用性:欲建立之主機的 STI 類型

Validations:

  • Must be String


PUT /api/hosts/:id/rebuild_config
Rebuild orchestration config

參數

參數名字 描述
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.


GET /api/hosts/:id/template/:kind
Preview rendered provisioning template content

參數

參數名字 描述
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.

kind
必填

Template kinds, available values:

Validations:

  • Must be String