Examples

PUT /api/subnets/1018350797
{
  "subnet": {
    "subnet_parameters_attributes": [
      {
        "name": "foo",
        "value": "new_value"
      }
    ]
  }
}
200
{
  "network": "138.13.133.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-02-20 13:35:23 UTC",
  "updated_at": "2019-02-20 13:35:23 UTC",
  "ipam": "None",
  "boot_mode": "DHCP",
  "id": 1018350797,
  "name": "subnet497",
  "description": null,
  "network_address": "138.13.133.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-02-20 13:35:23 UTC",
      "updated_at": "2019-02-20 13:35:23 UTC",
      "id": 767575239,
      "name": "foo",
      "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
    }
  ]
}

Params

Param name Description
location_id
optional

Scope by locations

Validations:

  • Must be a Integer

organization_id
optional

Scope by organizations

Validations:

  • Must be a Integer

id
required

Subnet numeric identifier

Validations:

  • Must be a number.

subnet
required

Validations:

  • Must be a Hash

subnet[name]
optional

Subnet name

Validations:

  • Must be a String

subnet[description]
optional , nil allowed

Subnet description

Validations:

  • Must be a String

subnet[network_type]
optional , nil allowed

Type or protocol, IPv4 or IPv6, defaults to IPv4

Validations:

  • Must be one of: IPv4, IPv6.

subnet[network]
optional

Subnet network

Validations:

  • Must be a String

subnet[mask]
optional

Netmask for this subnet

Validations:

  • Must be a String

subnet[gateway]
optional , nil allowed

Subnet gateway

Validations:

  • Must be a String

subnet[dns_primary]
optional , nil allowed

Primary DNS for this subnet

Validations:

  • Must be a String

subnet[dns_secondary]
optional , nil allowed

Secondary DNS for this subnet

Validations:

  • Must be a String

subnet[ipam]
optional , nil allowed

IP Address auto suggestion mode for this subnet, valid values are “DHCP”, “Internal DB”, “None”

Validations:

  • Must be a String

subnet[from]
optional , nil allowed

Starting IP Address for IP auto suggestion

Validations:

  • Must be a String

subnet[to]
optional , nil allowed

Ending IP Address for IP auto suggestion

Validations:

  • Must be a String

subnet[vlanid]
optional , nil allowed

VLAN ID for this subnet

Validations:

  • Must be a String

subnet[mtu]
optional , nil allowed

MTU for this subnet

Validations:

  • Must be a Integer

subnet[domain_ids]
optional , nil allowed

Domains in which this subnet is part

Validations:

  • Must be an array of any type

subnet[dhcp_id]
optional , nil allowed

DHCP Proxy ID to use within this subnet

Validations:

  • Must be a number.

subnet[tftp_id]
optional , nil allowed

TFTP Proxy ID to use within this subnet

Validations:

  • Must be a number.

subnet[httpboot_id]
optional , nil allowed

HTTPBoot Proxy ID to use within this subnet

Validations:

  • Must be a number.

subnet[dns_id]
optional , nil allowed

DNS Proxy ID to use within this subnet

Validations:

  • Must be a number.

subnet[template_id]
optional , nil allowed

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

Validations:

  • Must be a number.

subnet[boot_mode]
optional , nil allowed

Default boot mode for interfaces assigned to this subnet, valid values are “Static”, “DHCP”

Validations:

  • Must be a String

subnet[subnet_parameters_attributes]
optional , nil allowed

Array of parameters (name, value)

Validations:

  • Must be an array of any type

subnet[location_ids]
optional , nil allowed

REPLACE locations with given ids

Validations:

  • Must be an array of any type

subnet[organization_ids]
optional , nil allowed

REPLACE organizations with given ids.

Validations:

  • Must be an array of any type