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

參數

參數名字 描述
search
選填

篩選結果

Validations:

  • Must be String

order
選填

排序結果

Validations:

  • Must be String

page
選填

編頁結果

Validations:

  • Must be String

per_page
選填

每個請求的項目數量

Validations:

  • Must be String


GET /api/v2/discovered_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/v2/discovered_hosts
建立測試用的搜尋主機(使用 /facts 來建立新主機)

參數

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

Validations:

  • Must be a Hash

discovered_host[name]
必填

Validations:

  • Must be String

discovered_host[ip]
必填

Validations:

  • Must be String

discovered_host[mac]
必填

Validations:

  • Must be String

discovered_host[pxe_loader]
選填 , 允許空值

DHCP filename option (Grub2 or PXELinux by default)

Validations:

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


PUT /api/v2/discovered_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.

discovered_host
選填 , 允許空值

Validations:

  • Must be a Hash

discovered_host[name]
選填 , 允許空值

Validations:

  • Must be String

discovered_host[environment_id]
選填 , 允許空值

Validations:

  • Must be String

discovered_host[ip]
選填 , 允許空值

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

Validations:

  • Must be String

discovered_host[mac]
選填 , 允許空值

若是虛擬機器則不需要

Validations:

  • Must be String

discovered_host[architecture_id]
選填 , 允許空值

Validations:

  • Must be a number.

discovered_host[domain_id]
選填 , 允許空值

Validations:

  • Must be a number.

discovered_host[puppet_proxy_id]
選填 , 允許空值

Validations:

  • Must be a number.

discovered_host[puppet_class_ids]
選填 , 允許空值

Validations:

  • Must be an array of any type

discovered_host[operatingsystem_id]
選填 , 允許空值

Validations:

  • Must be String

discovered_host[medium_id]
選填 , 允許空值

Validations:

  • Must be a number.

discovered_host[ptable_id]
選填 , 允許空值

Validations:

  • Must be a number.

discovered_host[subnet_id]
選填 , 允許空值

Validations:

  • Must be a number.

discovered_host[sp_subnet_id]
選填 , 允許空值

Validations:

  • Must be a number.

discovered_host[model_id]
選填 , 允許空值

Validations:

  • Must be a number.

discovered_host[hostgroup_id]
選填 , 允許空值

Validations:

  • Must be a number.

discovered_host[owner_id]
選填 , 允許空值

Validations:

  • Must be a number.

discovered_host[puppet_ca_proxy_id]
選填 , 允許空值

Validations:

  • Must be a number.

discovered_host[image_id]
選填 , 允許空值

Validations:

  • Must be a number.

discovered_host[host_parameters_attributes]
選填 , 允許空值

Validations:

  • Must be an array of any type

discovered_host[build]
選填 , 允許空值

Validations:

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

discovered_host[enabled]
選填 , 允許空值

Validations:

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

discovered_host[provision_method]
選填 , 允許空值

Validations:

  • Must be String

discovered_host[managed]
選填 , 允許空值

Validations:

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

discovered_host[progress_report_id]
選填 , 允許空值

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

Validations:

  • Must be String

discovered_host[capabilities]
選填 , 允許空值

Validations:

  • Must be String

discovered_host[root_pass]
選填 , 允許空值

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

Validations:

  • Must be String

discovered_host[pxe_loader]
選填 , 允許空值

DHCP filename option (Grub2 or PXELinux by default)

Validations:

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


DELETE /api/v2/discovered_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.


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

參數

參數名字 描述
facts
必填

包含主機詳情的雜湊,其中有最基本的詳情:discovery_bootif、macaddress_eth0、ipaddress、ipaddress_eth0、interfaces:eth0(大部分範例中,主介面的名稱都是 eth0)

Validations:

  • Must be Hash


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

參數

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


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


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

參數

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


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

參數

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


PUT /api/v2/discovered_hosts/reboot_all
重新啟動所有已發現的主機