GET /api/subnets
Liste des sous-réseaux

GET /api/domains/:domain_id/subnets
Liste des sous-réseaux d'un domaine

GET /api/locations/:location_id/subnets
Liste des sous-réseaux par emplacement

GET /api/organizations/:organization_id/subnets
Liste des sous-réseaux par organisation

Exemples

GET /api/subnets
200
{
  "total": 7,
  "subtotal": 7,
  "page": 1,
  "per_page": 20,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },
  "results": [
    {
      "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": "2019-09-11 14:46:33 UTC",
      "updated_at": "2019-09-11 14:46:33 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
    },
    {
      "network": "3.3.4.0",
      "network_type": "IPv4",
      "cidr": 24,
      "mask": "255.255.255.0",
      "priority": null,
      "vlanid": 42,
      "mtu": 1496,
      "gateway": null,
      "dns_primary": null,
      "dns_secondary": null,
      "from": null,
      "to": null,
      "created_at": "2019-09-11 14:46:33 UTC",
      "updated_at": "2019-09-11 14:46:33 UTC",
      "ipam": "None",
      "boot_mode": "DHCP",
      "id": 298486374,
      "name": "two",
      "description": null,
      "network_address": "3.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": null,
      "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": null,
      "template": null
    },
    {
      "network": "3.3.4.3",
      "network_type": "IPv4",
      "cidr": 24,
      "mask": "255.255.255.0",
      "priority": null,
      "vlanid": 43,
      "mtu": 1500,
      "gateway": null,
      "dns_primary": null,
      "dns_secondary": null,
      "from": null,
      "to": null,
      "created_at": "2019-09-11 14:46:33 UTC",
      "updated_at": "2019-09-11 14:46:33 UTC",
      "ipam": "None",
      "boot_mode": "DHCP",
      "id": 113629430,
      "name": "three",
      "description": null,
      "network_address": "3.3.4.3/24",
      "dhcp_id": 980190962,
      "dhcp_name": "DHCP Proxy",
      "tftp_id": 298486374,
      "tftp_name": "TFTP Proxy",
      "httpboot_id": null,
      "httpboot_name": null,
      "dns_id": null,
      "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": null,
      "template": null
    },
    {
      "network": "3.3.5.0",
      "network_type": "IPv4",
      "cidr": 24,
      "mask": "255.255.255.0",
      "priority": null,
      "vlanid": 44,
      "mtu": 9000,
      "gateway": null,
      "dns_primary": null,
      "dns_secondary": null,
      "from": null,
      "to": null,
      "created_at": "2019-09-11 14:46:33 UTC",
      "updated_at": "2019-09-11 14:46:33 UTC",
      "ipam": "None",
      "boot_mode": "DHCP",
      "id": 281110143,
      "name": "four",
      "description": null,
      "network_address": "3.3.5.0/24",
      "dhcp_id": null,
      "dhcp_name": null,
      "tftp_id": 298486374,
      "tftp_name": "TFTP Proxy",
      "httpboot_id": null,
      "httpboot_name": null,
      "dns_id": null,
      "template_id": null,
      "template_name": null,
      "dhcp": null,
      "tftp": {
        "name": "TFTP Proxy",
        "id": 298486374,
        "url": "http://somewhere.else"
      },
      "httpboot": null,
      "dns": null,
      "template": null
    },
    {
      "network": "2001:db10:7::",
      "network_type": "IPv6",
      "cidr": 64,
      "mask": "ffff:ffff:ffff:ffff::",
      "priority": null,
      "vlanid": 44,
      "mtu": 9000,
      "gateway": null,
      "dns_primary": null,
      "dns_secondary": null,
      "from": null,
      "to": null,
      "created_at": "2019-09-11 14:46:33 UTC",
      "updated_at": "2019-09-11 14:46:33 UTC",
      "ipam": "None",
      "boot_mode": "DHCP",
      "id": 374648174,
      "name": "seven",
      "description": null,
      "network_address": "2001:db10:7::/64",
      "dhcp_id": null,
      "dhcp_name": null,
      "tftp_id": null,
      "tftp_name": null,
      "httpboot_id": null,
      "httpboot_name": null,
      "dns_id": 113629430,
      "template_id": null,
      "template_name": null,
      "dhcp": null,
      "tftp": null,
      "httpboot": null,
      "dns": {
        "name": "DNS Proxy",
        "id": 113629430,
        "url": "http://else.where:45671"
      },
      "template": null
    },
    {
      "network": "2001:db10::",
      "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-09-11 14:46:33 UTC",
      "updated_at": "2019-09-11 14:46:33 UTC",
      "ipam": "None",
      "boot_mode": "DHCP",
      "id": 51848956,
      "name": "six",
      "description": null,
      "network_address": "2001:db10::/64",
      "dhcp_id": null,
      "dhcp_name": null,
      "tftp_id": null,
      "tftp_name": null,
      "httpboot_id": null,
      "httpboot_name": null,
      "dns_id": 113629430,
      "template_id": null,
      "template_name": null,
      "dhcp": null,
      "tftp": null,
      "httpboot": null,
      "dns": {
        "name": "DNS Proxy",
        "id": 113629430,
        "url": "http://else.where:45671"
      },
      "template": null
    },
    {
      "network": "10.0.0.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:33 UTC",
      "updated_at": "2019-09-11 14:46:33 UTC",
      "ipam": "None",
      "boot_mode": "DHCP",
      "id": 1018350795,
      "name": "five",
      "description": null,
      "network_address": "10.0.0.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
    }
  ]
}

Paramètres

Nom du paramètre Description
domain_id
optionel

ID du domaine

Validations:

  • Must be a String

location_id
optionel

Tri par emplacement

Validations:

  • Must be a Integer

organization_id
optionel

Tri par organisation

Validations:

  • Must be a Integer

search
optionel

filtrer les résultats

Validations:

  • Must be a String

order
optionel

Champ et sens de tri, ex: ‘id DESC’

Validations:

  • Must be a String

page
optionel

Numéro de la page, commençant par 1

Validations:

  • Must be a number.

per_page
optionel

Nombre de résultats par page à renvoyer

Validations:

  • Must be a number.

Rechercher les champs

Nom du champ Type Valeurs possibles
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
Afficher un sous-réseau

Exemples

GET /api/subnets/1018350796-subnet237
200
{
  "network": "25.231.160.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:33 UTC",
  "updated_at": "2019-09-11 14:46:33 UTC",
  "ipam": "None",
  "boot_mode": "DHCP",
  "id": 1018350796,
  "name": "subnet237",
  "description": null,
  "network_address": "25.231.160.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": [],
  "locations": [
    {
      "id": 255093256,
      "name": "Location 1",
      "title": "Location 1",
      "description": null
    }
  ],
  "organizations": [
    {
      "id": 447626438,
      "name": "Organization 1",
      "title": "Organization 1",
      "description": null
    }
  ]
}

Paramètres

Nom du paramètre Description
location_id
optionel

Tri par emplacement

Validations:

  • Must be a Integer

organization_id
optionel

Tri par organisation

Validations:

  • Must be a Integer

id
requis

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
optionel

Afficher les valeurs de paramètre masquées

Validations:

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


POST /api/subnets
Créer un sous-réseau

Exemples

POST /api/subnets
{
  "subnet": {
    "name": "QA2",
    "network_type": "IPv4",
    "network": "10.35.2.27",
    "mask": "255.255.255.0",
    "subnet_parameters_attributes": [
      {
        "name": "foo",
        "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": "2019-09-11 14:46:34 UTC",
  "updated_at": "2019-09-11 14:46:34 UTC",
  "ipam": "None",
  "boot_mode": "DHCP",
  "id": 1018350798,
  "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": "2019-09-11 14:46:34 UTC",
      "updated_at": "2019-09-11 14:46:34 UTC",
      "id": 767575241,
      "name": "foo",
      "parameter_type": null,
      "value": "bar"
    }
  ],
  "locations": [],
  "organizations": []
}

Paramètres

Nom du paramètre Description
location_id
optionel

Tri par emplacement

Validations:

  • Must be a Integer

organization_id
optionel

Tri par organisation

Validations:

  • Must be a Integer

subnet
requis

Validations:

  • Must be a Hash

subnet[name]
requis

Nom du sous-réseau

Validations:

  • Must be a String

subnet[description]
optionel , nil autorisé

Description du sous-réseau

Validations:

  • Must be a String

subnet[network_type]
optionel , nil autorisé

Type ou protocole, IPv4 ou IPv6, par défaut IPv4

Validations:

  • Must be one of: IPv4, IPv6.

subnet[network]
requis

Réseau du sous-réseau

Validations:

  • Must be a String

subnet[mask]
requis

masque de sous-réseau

Validations:

  • Must be a String

subnet[gateway]
optionel , nil autorisé

Passerelle du sous réseau

Validations:

  • Must be a String

subnet[dns_primary]
optionel , nil autorisé

DNS primaire pour ce sous-réseau

Validations:

  • Must be a String

subnet[dns_secondary]
optionel , nil autorisé

DNS secondaire pour ce sous-réseau

Validations:

  • Must be a String

subnet[ipam]
optionel , nil autorisé

Mode d’autosuggestion d’adresse IP pour ce sous-réseau. Les valeurs possibles sont “DHCP”, “Internal DB” et “None”.

Validations:

  • Must be a String

subnet[from]
optionel , nil autorisé

Adresse IP de début pour l’auto suggestion d’IP

Validations:

  • Must be a String

subnet[to]
optionel , nil autorisé

Adresse IP de fin pour l’autosuggestion d’adresse IP

Validations:

  • Must be a String

subnet[vlanid]
optionel , nil autorisé

ID VLAN de ce sous-réseau

Validations:

  • Must be a String

subnet[mtu]
optionel , nil autorisé

MTU pour ce sous réseau

Validations:

  • Must be a Integer

subnet[domain_ids]
optionel , nil autorisé

Domaines qui incluent ce sous-réseau

Validations:

  • Must be an array of any type

subnet[dhcp_id]
optionel , nil autorisé

ID Proxy DHCP à utiliser avec ce sous-réseau

Validations:

  • Must be a number.

subnet[tftp_id]
optionel , nil autorisé

ID Proxy TFTP à utiliser pour ce sous-réseau

Validations:

  • Must be a number.

subnet[httpboot_id]
optionel , nil autorisé

ID de proxy HTTPBoot à utiliser dans ce sous-réseau

Validations:

  • Must be a number.

subnet[dns_id]
optionel , nil autorisé

ID Proxy DNS à utiliser pour ce sous-réseau

Validations:

  • Must be a number.

subnet[template_id]
optionel , nil autorisé

ID de proxy HTTP(S) de modèle à utiliser au sein de ce sous-réseau

Validations:

  • Must be a number.

subnet[boot_mode]
optionel , nil autorisé

Mode de démarrage par défaut pour les interfaces de ce sous-réseau. Les valeurs possibles sont “Static” et “DHCP”

Validations:

  • Must be a String

subnet[subnet_parameters_attributes]
optionel , nil autorisé

Tableau de paramètres (nom, valeur)

Validations:

  • Must be an array of any type

subnet[location_ids]
optionel , nil autorisé

REMPLACER les emplacements par les id donnés

Validations:

  • Must be an array of any type

subnet[organization_ids]
optionel , nil autorisé

REMPLACER les organisations qui ont les ID suivants

Validations:

  • Must be an array of any type


PUT /api/subnets/:id
Mise à jour d'un sous-réseau

Exemples

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

Paramètres

Nom du paramètre Description
location_id
optionel

Tri par emplacement

Validations:

  • Must be a Integer

organization_id
optionel

Tri par organisation

Validations:

  • Must be a Integer

id
requis

Identifiant numérique du sous-réseau

Validations:

  • Must be a number.

subnet
requis

Validations:

  • Must be a Hash

subnet[name]
optionel

Nom du sous-réseau

Validations:

  • Must be a String

subnet[description]
optionel , nil autorisé

Description du sous-réseau

Validations:

  • Must be a String

subnet[network_type]
optionel , nil autorisé

Type ou protocole, IPv4 ou IPv6, par défaut IPv4

Validations:

  • Must be one of: IPv4, IPv6.

subnet[network]
optionel

Réseau du sous-réseau

Validations:

  • Must be a String

subnet[mask]
optionel

masque de sous-réseau

Validations:

  • Must be a String

subnet[gateway]
optionel , nil autorisé

Passerelle du sous réseau

Validations:

  • Must be a String

subnet[dns_primary]
optionel , nil autorisé

DNS primaire pour ce sous-réseau

Validations:

  • Must be a String

subnet[dns_secondary]
optionel , nil autorisé

DNS secondaire pour ce sous-réseau

Validations:

  • Must be a String

subnet[ipam]
optionel , nil autorisé

Mode d’autosuggestion d’adresse IP pour ce sous-réseau. Les valeurs possibles sont “DHCP”, “Internal DB” et “None”.

Validations:

  • Must be a String

subnet[from]
optionel , nil autorisé

Adresse IP de début pour l’auto suggestion d’IP

Validations:

  • Must be a String

subnet[to]
optionel , nil autorisé

Adresse IP de fin pour l’autosuggestion d’adresse IP

Validations:

  • Must be a String

subnet[vlanid]
optionel , nil autorisé

ID VLAN de ce sous-réseau

Validations:

  • Must be a String

subnet[mtu]
optionel , nil autorisé

MTU pour ce sous réseau

Validations:

  • Must be a Integer

subnet[domain_ids]
optionel , nil autorisé

Domaines qui incluent ce sous-réseau

Validations:

  • Must be an array of any type

subnet[dhcp_id]
optionel , nil autorisé

ID Proxy DHCP à utiliser avec ce sous-réseau

Validations:

  • Must be a number.

subnet[tftp_id]
optionel , nil autorisé

ID Proxy TFTP à utiliser pour ce sous-réseau

Validations:

  • Must be a number.

subnet[httpboot_id]
optionel , nil autorisé

ID de proxy HTTPBoot à utiliser dans ce sous-réseau

Validations:

  • Must be a number.

subnet[dns_id]
optionel , nil autorisé

ID Proxy DNS à utiliser pour ce sous-réseau

Validations:

  • Must be a number.

subnet[template_id]
optionel , nil autorisé

ID de proxy HTTP(S) de modèle à utiliser au sein de ce sous-réseau

Validations:

  • Must be a number.

subnet[boot_mode]
optionel , nil autorisé

Mode de démarrage par défaut pour les interfaces de ce sous-réseau. Les valeurs possibles sont “Static” et “DHCP”

Validations:

  • Must be a String

subnet[subnet_parameters_attributes]
optionel , nil autorisé

Tableau de paramètres (nom, valeur)

Validations:

  • Must be an array of any type

subnet[location_ids]
optionel , nil autorisé

REMPLACER les emplacements par les id donnés

Validations:

  • Must be an array of any type

subnet[organization_ids]
optionel , nil autorisé

REMPLACER les organisations qui ont les ID suivants

Validations:

  • Must be an array of any type


DELETE /api/subnets/:id
Supprimer un sous-réseau

Exemples

DELETE /api/subnets/281110143-four
{
  "subnet": {}
}
200
{
  "id": 281110143,
  "network": "3.3.5.0",
  "mask": "255.255.255.0",
  "priority": null,
  "name": "four",
  "vlanid": 44,
  "created_at": "2019-09-11T14:46:33.538Z",
  "updated_at": "2019-09-11T14:46:33.538Z",
  "dhcp_id": null,
  "tftp_id": 298486374,
  "gateway": null,
  "dns_primary": null,
  "dns_secondary": null,
  "from": null,
  "to": null,
  "dns_id": null,
  "boot_mode": "DHCP",
  "ipam": "None",
  "description": null,
  "mtu": 9000,
  "template_id": null,
  "httpboot_id": null,
  "to_label": "four (3.3.5.0/24)",
  "type": "Subnet::Ipv4"
}

Paramètres

Nom du paramètre Description
location_id
optionel

Tri par emplacement

Validations:

  • Must be a Integer

organization_id
optionel

Tri par organisation

Validations:

  • Must be a Integer

id
requis

Identifiant numérique du sous-réseau

Validations:

  • Must be a number.


GET /api/subnets/:id/freeip
Fournir une adresse IP non utilisée dans le sous-réseaux

Exemples

GET /api/subnets/1018351020-subnet515/freeip
200
{
  "freeip": "192.168.2.10",
  "errors": {}
}

Paramètres

Nom du paramètre Description
location_id
optionel

Tri par emplacement

Validations:

  • Must be a Integer

organization_id
optionel

Tri par organisation

Validations:

  • Must be a Integer

id
requis

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
optionel

Adresse MAC pour réutiliser l’IP de cet hôte

Validations:

  • Must be a String

excluded_ips
optionel

Les adresses IP qui devraient être exclues des suggestions.

Validations:

  • Must be an array of any type