示例

PUT /api/subnets/1018350799
{
  "subnet": {
    "subnet_parameters_attributes": [
      {
        "name": "new_key",
        "value": "new_value"
      }
    ]
  }
}
200
{
  "network": "6.79.236.0",
  "network_type": "IPv4",
  "cidr": 24,
  "mask": "255.255.255.0",
  "priority": null,
  "vlanid": null,
  "mtu": 1500,
  "gateway": null,
  "dns_primary": null,
  "dns_secondary": null,
  "from": null,
  "to": null,
  "created_at": "2019-09-11 14:46:34 UTC",
  "updated_at": "2019-09-11 14:46:34 UTC",
  "ipam": "None",
  "boot_mode": "DHCP",
  "id": 1018350799,
  "name": "subnet239",
  "description": null,
  "network_address": "6.79.236.0/24",
  "dhcp_id": null,
  "dhcp_name": null,
  "tftp_id": null,
  "tftp_name": null,
  "httpboot_id": null,
  "httpboot_name": null,
  "dns_id": null,
  "template_id": null,
  "template_name": null,
  "dhcp": null,
  "tftp": null,
  "httpboot": null,
  "dns": null,
  "template": null,
  "domains": [],
  "interfaces": [],
  "parameters": [
    {
      "priority": 40,
      "created_at": "2019-09-11 14:46:34 UTC",
      "updated_at": "2019-09-11 14:46:34 UTC",
      "id": 767575243,
      "name": "new_key",
      "parameter_type": null,
      "value": "new_value"
    }
  ],
  "locations": [
    {
      "id": 255093256,
      "name": "Location 1",
      "title": "Location 1",
      "description": null
    }
  ],
  "organizations": [
    {
      "id": 447626438,
      "name": "Organization 1",
      "title": "Organization 1",
      "description": null
    }
  ]
}

參數

參數名字 描述
location_id
選填

位置範圍

Validations:

  • Must be a Integer

organization_id
選填

組織範圍

Validations:

  • Must be a Integer

id
必填

子網路的數字辨識子

Validations:

  • Must be a number.

subnet
必填

Validations:

  • Must be a Hash

subnet[name]
選填

子網路名稱

Validations:

  • Must be a String

subnet[description]
選填 , 允許空值

Subnet description

Validations:

  • Must be a String

subnet[network_type]
選填 , 允許空值

Type or protocol, IPv4 or IPv6, defaults to IPv4

Validations:

  • Must be one of: IPv4, IPv6.

subnet[network]
選填

子網路

Validations:

  • Must be a String

subnet[mask]
選填

這個子網路的網路遮罩

Validations:

  • Must be a String

subnet[gateway]
選填 , 允許空值

Subnet gateway

Validations:

  • Must be a String

subnet[dns_primary]
選填 , 允許空值

這個子網路的主要 DNS

Validations:

  • Must be a String

subnet[dns_secondary]
選填 , 允許空值

這個子網路的次要 DNS

Validations:

  • Must be a String

subnet[ipam]
選填 , 允許空值

這個子網路的 IP 位址自動建議模式,有效的值為「DHCP」、「Internal DB」、「None」

Validations:

  • Must be a String

subnet[from]
選填 , 允許空值

IP 自動建議的起始 IP 位址

Validations:

  • Must be a String

subnet[to]
選填 , 允許空值

IP 自動建議的結尾 IP 位址

Validations:

  • Must be a String

subnet[vlanid]
選填 , 允許空值

這個子網路的 VLAN ID

Validations:

  • Must be a String

subnet[mtu]
選填 , 允許空值

MTU for this subnet

Validations:

  • Must be a Integer

subnet[domain_ids]
選填 , 允許空值

這個子網路所屬於的網域

Validations:

  • Must be an array of any type

subnet[dhcp_id]
選填 , 允許空值

DHCP Proxy ID to use within this subnet

Validations:

  • Must be a number.

subnet[tftp_id]
選填 , 允許空值

TFTP Proxy ID to use within this subnet

Validations:

  • Must be a number.

subnet[httpboot_id]
選填 , 允許空值

HTTPBoot Proxy ID to use within this subnet

Validations:

  • Must be a number.

subnet[dns_id]
選填 , 允許空值

DNS Proxy ID to use within this subnet

Validations:

  • Must be a number.

subnet[template_id]
選填 , 允許空值

Template HTTP(S) Proxy ID to use within this subnet

Validations:

  • Must be a number.

subnet[boot_mode]
選填 , 允許空值

指定給這個子網路的介面卡的預設啟動模式,有效的值為「Static」、「DHCP」

Validations:

  • Must be a String

subnet[subnet_parameters_attributes]
選填 , 允許空值

參數陣列(名稱、值)

Validations:

  • Must be an array of any type

subnet[location_ids]
選填 , 允許空值

將位置取代為特定 ID

Validations:

  • Must be an array of any type

subnet[organization_ids]
選填 , 允許空值

將組織取代為特定 ID。

Validations:

  • Must be an array of any type