GET /api/v2/discovered_hosts
列出所有發現的主機

參數

參數名字 描述
search
選填

篩選結果


Value:

Must be String

order
選填

排序結果


Value:

Must be String

page
選填

編頁結果


Value:

Must be String

per_page
選填

每個請求的項目數量


Value:

Must be String


GET /api/v2/discovered_hosts/:id
顯示發現的主機

參數

參數名字 描述
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/v2/discovered_hosts
Create a discovered host for testing (use /facts to create new hosts)

參數

參數名字 描述
discovered_host
選填 , 允許空值

Value:

Must be a Hash

discovered_host[name]
必填

Value:

Must be String

discovered_host[ip]
必填

Value:

Must be String

discovered_host[mac]
必填

Value:

Must be String


PUT /api/v2/discovered_hosts/:id
佈建一部已發現的主機

參數

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

discovered_host
選填 , 允許空值

Value:

Must be a Hash

discovered_host[name]
選填 , 允許空值

Value:

Must be String

discovered_host[environment_id]
選填 , 允許空值

Value:

Must be String

discovered_host[ip]
選填 , 允許空值

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


Value:

Must be String

discovered_host[mac]
選填 , 允許空值

若是虛擬機器則不需要


Value:

Must be String

discovered_host[architecture_id]
選填 , 允許空值

Value:

Must be a number.

discovered_host[domain_id]
選填 , 允許空值

Value:

Must be a number.

discovered_host[puppet_proxy_id]
選填 , 允許空值

Value:

Must be a number.

discovered_host[puppet_class_ids]
選填 , 允許空值

Value:

Must be an array of any type

discovered_host[operatingsystem_id]
選填 , 允許空值

Value:

Must be String

discovered_host[medium_id]
選填 , 允許空值

Value:

Must be a number.

discovered_host[ptable_id]
選填 , 允許空值

Value:

Must be a number.

discovered_host[subnet_id]
選填 , 允許空值

Value:

Must be a number.

discovered_host[sp_subnet_id]
選填 , 允許空值

Value:

Must be a number.

discovered_host[model_id]
選填 , 允許空值

Value:

Must be a number.

discovered_host[hostgroup_id]
選填 , 允許空值

Value:

Must be a number.

discovered_host[owner_id]
選填 , 允許空值

Value:

Must be a number.

discovered_host[puppet_ca_proxy_id]
選填 , 允許空值

Value:

Must be a number.

discovered_host[image_id]
選填 , 允許空值

Value:

Must be a number.

discovered_host[host_parameters_attributes]
選填 , 允許空值

Value:

Must be an array of any type

discovered_host[build]
選填 , 允許空值

Value:

Must be 'true' or 'false'

discovered_host[enabled]
選填 , 允許空值

Value:

Must be 'true' or 'false'

discovered_host[provision_method]
選填 , 允許空值

Value:

Must be String

discovered_host[managed]
選填 , 允許空值

Value:

Must be 'true' or 'false'

discovered_host[progress_report_id]
選填 , 允許空值

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


Value:

Must be String

discovered_host[capabilities]
選填 , 允許空值

Value:

Must be String

discovered_host[root_pass]
選填 , 允許空值

若值並非從主機群組或設定中的預設密碼所繼承的話則需要


Value:

Must be String


DELETE /api/v2/discovered_hosts/:id
刪除發現的主機

參數

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


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

參數

參數名字 描述
facts
必填

hash containing facts for the host with minimum set of facts: discovery_bootif, macaddress_eth0, ipaddress, ipaddress_eth0, interfaces: eth0 (example in case primary interface is named eth0)


Value:

Must be Hash


POST /api/v2/discovered_hosts/:id/auto_provision
針對於一部發現的主機執行規則

參數

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


POST /api/v2/discovered_hosts/auto_provision_all
針對於所有目前已發現的主機執行規則


PUT /api/v2/discovered_hosts/:id/refresh_facts
刷新一部已發現之主機的詳情

參數

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


PUT /api/v2/discovered_hosts/:id/reboot
重新啟動一部已發現的主機

參數

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


PUT /api/v2/discovered_hosts/reboot_all
Rebooting all discovered hosts