Creating a range of addresses attached to a subnet

Create a range of addresses that are attached to a subnet.

An API is available first to create a range of addresses from an IP range or a list of host names and then to attach those addresses to a subnet.

URI /deployment/resources/subnets/<subnetUUID>/addresses
Method POST or PUT
Request body JSON
Returns 201 Success
4xx There were problems creating the addresses. The returned error message contains details about the cause of the failure.
500 The system encountered an internal error while processing the request.

You can use either an IP range or a list of host names to specify the list of addresses to create.

To provide an IP range:

{
   "address_range": { 
        "from": "100.100.100.0", 
        "to": "100.100.100.10"
   }
}

To provide a list of host names:

{
   "address_range": { 
        "hostnames": ["hostname1", "hostname2"]
   }
}

A successful PUT or POST operation returns a 200 HTTP response code to the caller. The response body contains the JSON representation of the list of addresses that are created and attached to the specified subnet.

Each address that is created inherits the virtual data center field from the subnet to which it is attached, if any.

The ip_version field is automatically set based on the format of the IP range (ipv4 or ipv6), if an IP range is specified. An IP range is not required.

If a list of host names is used to create the range of addresses, the ip_version field is not automatically computed. When the ip_version is not explicitly provided in the response body, the field is set to null.

The two above basic structures are mutually exclusive. It is not possible to specify both the “hostnames” attributes and the “to”, “from” ones.

In addition to the hostnames, from, and to attributes, you can also specify the following fields:
name
The name that is assigned to the created addresses is built following this rule: name_<counter>, where <counter> starts at 0 and is increased for each new address in the range.
description
A general description.
ip_version
Allowed values include ipv4 or ipv4.
is_public
Allowed values include true or false.

The following example details a complete request body that contains all fields:

{
   "address_range": { 
        "name": "My name", 
        "description": "My description", 
        "from": "100.100.100.0", 
        "to": "100.100.100.10",
        "is_public": "true"
   }
}