示例

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]
选填 , 允许空值

子网描述

Validations:

  • Must be a String

subnet[network_type]
选填 , 允许空值

类型或协议,值为 IPv4 或 IPv6,默认为 IPv4

Validations:

  • Must be one of: IPv4, IPv6.

subnet[network]
选填

子网网络

Validations:

  • Must be a String

subnet[mask]
选填

子网掩码

Validations:

  • Must be a String

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

Validations:

  • Must be a Integer

subnet[domain_ids]
选填 , 允许空值

该部分子网的域名

Validations:

  • Must be an array of any type

subnet[dhcp_id]
选填 , 允许空值

要在此子网中使用的 DHCP 代理 ID

Validations:

  • Must be a number.

subnet[tftp_id]
选填 , 允许空值

要在此子网中使用的 TFTP 代理 ID

Validations:

  • Must be a number.

subnet[httpboot_id]
选填 , 允许空值

要在此子网中使用的 HTTPBoot 代理 ID

Validations:

  • Must be a number.

subnet[dns_id]
选填 , 允许空值

要在此子网中使用的 DNS 代理 ID

Validations:

  • Must be a number.

subnet[template_id]
选填 , 允许空值

要在此子网中使用的模板 HTTP 代理服务器 ID

Validations:

  • Must be a number.

subnet[boot_mode]
选填 , 允许空值

分配给这个子网接口的默认引导模式,有效值为 “Static”,“DHCP”。

Validations:

  • Must be a String

subnet[subnet_parameters_attributes]
选填 , 允许空值

参数阵列(name,value)

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