示例

POST /api/hostgroups
{
  "hostgroup": {
    "name": "TestHostgroup",
    "parameters": [
      {
        "name": "foo",
        "value": "bar",
        "hidden_value": true
      }
    ]
  }
}
201
{
  "subnet_id": null,
  "subnet_name": null,
  "operatingsystem_id": null,
  "operatingsystem_name": null,
  "domain_id": null,
  "domain_name": null,
  "environment_id": null,
  "environment_name": null,
  "compute_profile_id": null,
  "compute_profile_name": null,
  "ancestry": null,
  "parent_id": null,
  "parent_name": null,
  "ptable_id": null,
  "ptable_name": null,
  "medium_id": null,
  "medium_name": null,
  "pxe_loader": null,
  "subnet6_id": null,
  "subnet6_name": null,
  "compute_resource_id": null,
  "compute_resource_name": null,
  "architecture_id": null,
  "architecture_name": null,
  "realm_id": null,
  "realm_name": null,
  "created_at": "2019-11-07 08:34:25 UTC",
  "updated_at": "2019-11-07 08:34:25 UTC",
  "id": 928644300,
  "name": "TestHostgroup",
  "title": "TestHostgroup",
  "description": null,
  "puppet_proxy_id": null,
  "puppet_proxy_name": null,
  "puppet_ca_proxy_id": null,
  "puppet_ca_proxy_name": null,
  "puppet_proxy": null,
  "puppet_ca_proxy": null,
  "parameters": [],
  "template_combinations": [],
  "puppetclasses": [],
  "config_groups": [],
  "all_puppetclasses": [],
  "locations": [],
  "organizations": []
}

參數

參數名字 描述
location_id
選填

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
選填

Set the current organization context for the request

Validations:

  • Must be a Integer

hostgroup
必填

Validations:

  • Must be a Hash

hostgroup[name]
必填

主機群組的名稱

Validations:

  • Must be a String

hostgroup[description]
選填 , 允許空值

Host group description

Validations:

  • Must be a String

hostgroup[parent_id]
選填 , 允許空值

主機群組的父 ID

Validations:

  • Must be a number.

hostgroup[environment_id]
選填 , 允許空值

環境 ID

Validations:

  • Must be a number.

hostgroup[compute_profile_id]
選填 , 允許空值

運算設定檔 ID

Validations:

  • Must be a number.

hostgroup[compute_resource_id]
選填 , 允許空值

Compute resource ID

Validations:

  • Must be a number.

hostgroup[operatingsystem_id]
選填 , 允許空值

作業系統 ID

Validations:

  • Must be a number.

hostgroup[architecture_id]
選填 , 允許空值

架構 ID

Validations:

  • Must be a number.

hostgroup[pxe_loader]
選填 , 允許空值

DHCP filename option (Grub2/PXELinux by default)

Validations:

  • Must be one of: None, PXELinux BIOS, PXELinux UEFI, Grub UEFI, Grub2 BIOS, Grub2 ELF, Grub2 UEFI, Grub2 UEFI SecureBoot, Grub2 UEFI HTTP, Grub2 UEFI HTTPS, Grub2 UEFI HTTPS SecureBoot, iPXE Embedded, iPXE UEFI HTTP, iPXE Chain BIOS, iPXE Chain UEFI.

hostgroup[medium_id]
選填 , 允許空值

媒體 ID

Validations:

  • Must be a number.

hostgroup[ptable_id]
選填 , 允許空值

分割表 ID

Validations:

  • Must be a number.

hostgroup[subnet_id]
選填 , 允許空值

子網路 ID

Validations:

  • Must be a number.

hostgroup[subnet6_id]
選填 , 允許空值

Subnet IPv6 ID

Validations:

  • Must be a number.

hostgroup[domain_id]
選填 , 允許空值

網域 ID

Validations:

  • Must be a number.

hostgroup[realm_id]
選填 , 允許空值

領域類型

Validations:

  • Must be a number.

hostgroup[config_group_ids]
選填 , 允許空值

IDs of associated config groups

Validations:

  • Must be an array of any type

hostgroup[group_parameters_attributes]
選填 , 允許空值

Array of parameters

Validations:

  • Must be an Array of nested elements

hostgroup[group_parameters_attributes][name]
必填

參數名稱

Validations:

  • Must be a String

hostgroup[group_parameters_attributes][value]
必填

參數值

Validations:

  • Must be a String

hostgroup[group_parameters_attributes][parameter_type]
選填 , 允許空值

Type of value

Validations:

  • Must be one of: string, boolean, integer, real, array, hash, yaml, json.

hostgroup[group_parameters_attributes][hidden_value]
選填 , 允許空值

Validations:

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

hostgroup[puppet_proxy_id]
選填 , 允許空值

Puppet 代理 ID

Validations:

  • Must be a number.

hostgroup[puppet_ca_proxy_id]
選填 , 允許空值

Puppet CA 代理 ID

Validations:

  • Must be a number.

hostgroup[root_pass]
選填 , 允許空值

在已佈建主機上的 root 密碼

Validations:

  • Must be a String

hostgroup[location_ids]
選填 , 允許空值

將位置取代為特定 ID

Validations:

  • Must be an array of any type

hostgroup[organization_ids]
選填 , 允許空值

將組織取代為特定 ID。

Validations:

  • Must be an array of any type