POST - Create a subnet

Purpose

This API call configures a DHCP server to manage a specific subnet and assign IP addresses within a defined range for a cluster environment.

Request URL 

Method: POST

https://{appconsole_IP}:{9443}/api/dhcp/subnet_data/

Request Headers

The following headers must be included in the API request for successful authentication and data submission:

Authorization: DDI Central's OAuth implementation uses the Bearer authentication scheme. Hence, while making API calls, access_token obtained via the OAuth 2.0 Client Credentials Grant must be included in the Authorization header of API requests. This token verifies the client’s identity and ensures appropriate permissions for accessing resources.

The Authorization Header follows the format below:

headers = { "Authorization": "Bearer {bearer_tk}" }


Content-Type: Required in the header to indicate the media type of the resource being sent. It helps the server at the receiving end understand how to process the transmitted request body.

The Content-Type Header follows the format below:

headers ={ "Content-Type": "application/json" }

Request Body

  • cluster_name*  string
    •  The name of the cluster where this DHCP configuration will be applied.
  • dhcp_server_address*  string
    •  The IP address of the DHCP server that will manage and distribute IP addresses to clients within the specified network.
  • network_address*  string
    •  The base IP address of the subnet which is paired with a prefix value to define the subnet.
  • prefix*  int
    •  Specifies the subnet mask in CIDR notation which determines the range of IP addresses available within the subnet.
  • dhcp_type*  string
    •  Specifies the type of DHCP server which is a common open-source DHCP server software.
  • scope_name*  string
    •  The name given to this IP allocation scope. The scope usually defines a specific set of IP address ranges to be managed by the DHCP server for a particular purpose or segment.
  • shared_network_name  string
    •  Defines a shared network configuration name which can be used when multiple subnets are part of the same logical network, allowing the DHCP server to assign IP addresses across these subnets.
    • The value can be basicTrial, professionalTrial, mailPremiumTrial, or free.
  • supernet_address*  string
    •  Specifies a larger network range that this subnet falls within.
  • vlan_dict*  string
    •  Contains a dictionary with VLAN (Virtual Local Area Network) information. In this example, it has a single entry:
  • vlan_id*  string
    •  Specifies the VLAN identifier. This allows the DHCP server to assign IP addresses within a specific VLAN.
  • range*  string
    •  Defines the range of IP addresses to be assigned to clients within this scope.
  • lease_duration*  string
    •  Specifies the duration for which an IP lease is valid before it expires.

 

- Mandatory parameter.

 

 

Sample Request

Copied
Copied
{
     "cluster_name":"local-cluster",
     "dhcp_server_address":"192.168.220.172",
     "network_address":"5.56.11.0",
     "prefix":24,
     "dhcp_type":"dhcpd",
     "scope_name":"newcs",
     "shared_network_name":"newshared",
     "supernet_address":"5.56.0.0/16",
     "vlan_dict":{
        "vlan_id":43
     },
     "range":{
        "start":"5.56.11.10",
        "end":"5.56.11.30"
     },
     "lease_duration":"8.00:00:00"
  }

Sample Response

Copied
Copied{
     "id":5443,
     "network_address":"5.56.11.0",
     "dhcp_type":"dhcpd",
     "prefix":24,
     "subnet_description":null,
     "netmask":"255.255.255.0",
     "range":{
        "start":"5.56.11.10",
        "end":"5.56.11.30"
     },
     "scope_name":"newcs",
     "state":"Active",
     "lease_duration":"8.00:00:00",
     "is_multicast_scope":false,
     "cluster_name":"local-cluster",
     "dhcp_server_address":"192.168.220.172",
     "shared_network_name":"newshared",
     "supernet_address":"5.56.0.0/16",
     "vlan_dict":{
        "id":16,
        "vlan_id":43,
        "vlan_name":"vlan24",
        "dhcp_type":"dhcpd"
     }
  }