GET /api/subnets
List of subnets

GET /api/domains/:domain_id/subnets
List of subnets for a domain

GET /api/locations/:location_id/subnets
List of subnets per location

GET /api/organizations/:organization_id/subnets
List of subnets per organization

Examples

GET /api/locations/447626440/subnets
200
{
  "total": 1,
  "subtotal": 1,
  "page": 1,
  "per_page": 20,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },
  "results": [
    {
      "network": "127.216.154.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": "2018-11-15 19:01:33 UTC",
      "updated_at": "2018-11-15 19:01:33 UTC",
      "ipam": "None",
      "boot_mode": "DHCP",
      "id": 1018350796,
      "name": "subnet3",
      "description": null,
      "network_address": "127.216.154.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
    }
  ]
}

Params

Param name Description
domain_id
optional

ID of domain

Validations:

  • Must be a String

location_id
optional

Scope by locations

Validations:

  • Must be a Integer

organization_id
optional

Scope by organizations

Validations:

  • Must be a Integer

search
optional

filter results

Validations:

  • Must be a String

order
optional

Sort field and order, eg. ‘id DESC’

Validations:

  • Must be a String

page
optional

paginate results

Validations:

  • Must be a String

per_page
optional

number of entries per request

Validations:

  • Must be a String

Search fields

Field name Type Possible values
boot_mode string
dns_primary string
dns_secondary string
domain string
gateway string
ipam string
location string
location_id integer
mask string
mtu integer
name text
network string
organization string
organization_id integer
params text
type string
vlanid integer

GET /api/subnets/:id
Show a subnet

Examples

GET /api/subnets/980190962-one
200
{
  "network": "2.3.4.0",
  "network_type": "IPv4",
  "cidr": 24,
  "mask": "255.255.255.0",
  "priority": null,
  "vlanid": 41,
  "mtu": 1500,
  "gateway": null,
  "dns_primary": null,
  "dns_secondary": null,
  "from": null,
  "to": null,
  "created_at": "2018-11-15 19:01:27 UTC",
  "updated_at": "2018-11-15 19:01:27 UTC",
  "ipam": "None",
  "boot_mode": "DHCP",
  "id": 980190962,
  "name": "one",
  "description": null,
  "network_address": "2.3.4.0/24",
  "dhcp_id": 980190962,
  "dhcp_name": "DHCP Proxy",
  "tftp_id": 298486374,
  "tftp_name": "TFTP Proxy",
  "httpboot_id": null,
  "httpboot_name": null,
  "dns_id": 113629430,
  "template_id": null,
  "template_name": null,
  "dhcp": {
    "name": "DHCP Proxy",
    "id": 980190962,
    "url": "https://somewhere.net:8443"
  },
  "tftp": {
    "name": "TFTP Proxy",
    "id": 298486374,
    "url": "http://somewhere.else"
  },
  "httpboot": null,
  "dns": {
    "name": "DNS Proxy",
    "id": 113629430,
    "url": "http://else.where:45671"
  },
  "template": null,
  "domains": [
    {
      "id": 22495316,
      "name": "mydomain.net"
    }
  ],
  "interfaces": [],
  "parameters": [],
  "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

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.

show_hidden_parameters
optional

Display hidden parameter values

Validations:

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


POST /api/subnets
Create a subnet

Examples

POST /api/subnets
{
  "subnet": {
    "name": "QA2",
    "network_type": "IPv4",
    "network": "10.35.2.27",
    "mask": "255.255.255.0",
    "subnet_parameters_attributes": [
      {
        "name": "mQlPmcGHjX,pievygiEM2,餷錔惌谡銍悻騚銀送跷,҆Ѐӄ҄эҬ҄ӳӯѰ,<hr>UrzMjyavWK</hr>,ãÍïûýÞÔÆîÊ,1244362608,𫎢住𩀡𤝀䓿𨉩谖𗩒軉賢,^[.:=!:#]}",
        "value": "bar"
      }
    ]
  }
}
201
{
  "network": "10.35.2.27",
  "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": "2018-11-15 19:01:32 UTC",
  "updated_at": "2018-11-15 19:01:32 UTC",
  "ipam": "None",
  "boot_mode": "DHCP",
  "id": 1018350796,
  "name": "QA2",
  "description": null,
  "network_address": "10.35.2.27/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": "2018-11-15 19:01:32 UTC",
      "updated_at": "2018-11-15 19:01:32 UTC",
      "id": 767575239,
      "name": "mQlPmcGHjX,pievygiEM2,餷錔惌谡銍悻騚銀送跷,҆Ѐӄ҄эҬ҄ӳӯѰ,<hr>UrzMjyavWK</hr>,ãÍïûýÞÔÆîÊ,1244362608,𫎢住𩀡𤝀䓿𨉩谖𗩒軉賢,^[.:=!:#]}",
      "value": "bar"
    }
  ],
  "locations": [],
  "organizations": []
}

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

subnet
required

Validations:

  • Must be a Hash

subnet[name]
required

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]
required

Subnet network

Validations:

  • Must be a String

subnet[mask]
required

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


PUT /api/subnets/:id
Update a subnet

Examples

PUT /api/subnets/1018350796
{
  "subnet": {
    "subnet_parameters_attributes": [
      {
        "name": "foo",
        "value": "new_value"
      }
    ]
  }
}
200
{
  "network": "36.82.40.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": "2018-11-15 19:01:32 UTC",
  "updated_at": "2018-11-15 19:01:32 UTC",
  "ipam": "None",
  "boot_mode": "DHCP",
  "id": 1018350796,
  "name": "subnet1",
  "description": null,
  "network_address": "36.82.40.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": "2018-11-15 19:01:32 UTC",
      "updated_at": "2018-11-15 19:01:32 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


DELETE /api/subnets/:id
Delete a subnet

Examples

DELETE /api/subnets/51848956
{
  "subnet": {}
}
200
{
  "id": 51848956,
  "network": "2001:db10::",
  "mask": "ffff:ffff:ffff:ffff::",
  "priority": null,
  "name": "six",
  "vlanid": null,
  "created_at": "2018-11-15T19:01:27.660Z",
  "updated_at": "2018-11-15T19:01:27.660Z",
  "dhcp_id": null,
  "tftp_id": null,
  "gateway": null,
  "dns_primary": null,
  "dns_secondary": null,
  "from": null,
  "to": null,
  "dns_id": 113629430,
  "boot_mode": "DHCP",
  "ipam": "None",
  "description": null,
  "mtu": 1500,
  "template_id": null,
  "httpboot_id": null,
  "to_label": "six (2001:db10::/64)",
  "type": "Subnet::Ipv6"
}

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.


GET /api/subnets/:id/freeip
Provides an unused IP address in this subnet

Examples

GET /api/subnets/1018350796-subnet8/freeip
200
{
  "freeip": null,
  "errors": {}
}

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

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.

mac
optional

MAC address to reuse the IP for this host

Validations:

  • Must be a String

excluded_ips
optional

IP addresses that should be excluded from suggestion

Validations:

  • Must be an array of any type