Examples

POST /api/subnets
{
  "subnet": {
    "name": "QA2",
    "network_type": "IPv6",
    "network": "2001:db8::",
    "mask": "ffff:ffff:ffff:ffff::",
    "ipam": "None"
  }
}
201
{
  "network": "2001:db8::",
  "network_type": "IPv6",
  "cidr": 64,
  "mask": "ffff:ffff:ffff:ffff::",
  "priority": null,
  "vlanid": null,
  "mtu": 1500,
  "gateway": null,
  "dns_primary": null,
  "dns_secondary": null,
  "from": null,
  "to": null,
  "created_at": "2019-11-07 08:38:14 UTC",
  "updated_at": "2019-11-07 08:38:14 UTC",
  "ipam": "None",
  "boot_mode": "DHCP",
  "id": 1018350830,
  "name": "QA2",
  "description": null,
  "network_address": "2001:db8::/64",
  "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": [],
  "locations": [],
  "organizations": []
}

Params

Param Name Description
location_id
Optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
Optional

Set the current organization context for the request

Validations:

  • Must be a Integer

subnet
Required

Validations:

  • Must be a Hash

subnet[name]
Required

Subnet name

Validations:

  • Must be a String

subnet[description]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

Subnet description

Validations:

  • Must be a String

subnet[network_type]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

Type or protocol, IPv4 or IPv6, defaults to IPv4

Validations:

  • Must be one of: IPv4, IPv6.

subnet[network]
Required

Subnet network

Validations:

  • Must be a String

subnet[mask]
Required

Nätmask för detta subnät

Validations:

  • Must be a String

subnet[gateway]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

Subnet gateway

Validations:

  • Must be a String

subnet[dns_primary]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

Primary DNS for this subnet

Validations:

  • Must be a String

subnet[dns_secondary]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

Secondary DNS for this subnet

Validations:

  • Must be a String

subnet[ipam]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

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

Validations:

  • Must be a String

subnet[from]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

Starting IP Address for IP auto suggestion

Validations:

  • Must be a String

subnet[to]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

Ending IP Address for IP auto suggestion

Validations:

  • Must be a String

subnet[vlanid]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

VLAN ID for this subnet

Validations:

  • Must be a String

subnet[mtu]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

MTU for this subnet

Validations:

  • Must be a Integer

subnet[domain_ids]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

Domäner där detta subnet är med.

Validations:

  • Must be an array of any type

subnet[dhcp_id]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

DHCP Proxy ID to use within this subnet

Validations:

  • Must be a number.

subnet[tftp_id]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

TFTP Proxy ID to use within this subnet

Validations:

  • Must be a number.

subnet[httpboot_id]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

HTTPBoot Proxy ID to use within this subnet

Validations:

  • Must be a number.

subnet[dns_id]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

DNS Proxy ID to use within this subnet

Validations:

  • Must be a number.

subnet[template_id]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

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

Validations:

  • Must be a number.

subnet[boot_mode]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

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

Validations:

  • Must be a String

subnet[subnet_parameters_attributes]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

Lista med parametrar (namn, värde)

Validations:

  • Must be an array of any type

subnet[location_ids]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

REPLACE locations with given ids

Validations:

  • Must be an array of any type

subnet[organization_ids]
Optional , <span class="translation_missing" title="translation missing: sv-SE.apipie.nil_allowed">Nil Allowed</span>

REPLACE organizations with given ids.

Validations:

  • Must be an array of any type