If you no longer need reserved IP addresses, you can release them so that VMware Aria Automation can use them for deployment.

This procedure shows how to request specific IP addresses to release.

Prerequisites

  • Verify that all general prerequisites and prerequisites for the Automation Assembler Infrastructure as a Service (IaaS) service have been satisfied. See Prerequisites for API Use Case Examples.
  • Verify that you have the ID of the network IP range that includes the IP addresses that you want to release. See Query for IP Addresses.
  • Verify that you know the IPv4 or IPv6 addresses that you want to release. The IP addresses must all be the same type. Releasing a mix of IPv4 and IPv6 addresses in the same request is not supported. See Allocate IP Addresses.

Procedure

  1. Assign the variable for the network IP range ID.
    ip_range_id='<your_network_ip_range_id>'
  2. Release the IP addresses.
    The following request releases two IP addresses.
    • Specify either IPv4 or IPv6 addresses.
    • To release more IP addresses, provide the IP addresses in the payload.
      Note: No more than 100 IP addresses can be released in a single API call.
    curl --location --request POST \
      $url/iaas/api/network-ip-ranges/$ip_range_id/ip-addresses/release?apiVersion=$api_version \
      -H "Authorization: Bearer $access_token" \
      -H 'Content-Type: application/json' \
      -d '{
         "ipAddresses":["<ipv_address_1>", "<ipv_address_2>"]
    }'
    Examine the response for the self link to track the request.
  3. Assign the self link variable.
    selfLink_id='example-selfLink-alphanumeric-string'
  4. Use the selfLink variable to track the request.
    curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $access_token" "$url/iaas/api/request-tracker/$selfLink_id?apiVersion=$api_version" | jq "."
    The IP addresses are released, when the response includes "status": "FINISHED".

Example: Release IP addresses within an IP range

To release IP addresses, make a request with the network IP range and specify the IP addresses to release.

Assign variables.

Note: If your organization uses an API service that is hosted outside of the United States, your URL variable must include a country abbreviation. See Regional Endpoints for VMware Aria Automation APIs.
$ url='https://api.mgmt.cloud.vmware.com'
$ api_version='2021-07-15'
$ ip_range_id='4e6b700c-5d07-4247-b0c7-ae13d1d7188a'

Release two IPv4 addresses.

curl --location --request POST \
  $url/iaas/api/network-ip-ranges/$ip_range_id/ip-addresses/release?apiVersion=$api_version \
  -H "Authorization: Bearer $access_token" \
  -H 'Content-Type: application/json' \
  -d '{
     "ipAddresses":["196.192.2.19", "196.192.2.20"]
}'

The response provides a selfLink for tracking.

{
    "progress": 1,
    "status": "INPROGRESS",
    "name": "IP Address Release Task",
    "id": "452bb595-ca0f-4685-8fcc-8bd6321bf7c6",
    "selfLink": "/iaas/api/request-tracker/452bb595-ca0f-4685-8fcc-8bd6321bf7c6"
}

Assign the selfLink variable.

selfLink_id= '452bb595-ca0f-4685-8fcc-8bd6321bf7c6'

Track the request.

curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $access_token" "$url/iaas/api/request-tracker/$selfLink_id?apiVersion=$api_version" | jq "."

The IP addresses are released, when the response includes "status": "FINISHED".

{
    "progress": 100,
    "status": "FINISHED",
    "resources": [
        "/iaas/api/network-ip-ranges/4e6b700c-5d07-4247-b0c7-ae13d1d7188a/ip-addresses/3f08cabe-fedf-4e9b-96f6-d3bf69016cc4",
        "/iaas/api/network-ip-ranges/4e6b700c-5d07-4247-b0c7-ae13d1d7188a/ip-addresses/ca287794-c06b-401c-9626-0b8f5f75d1c2"
    ],
    "name": "IP Address Release Task",
    "id": "452bb595-ca0f-4685-8fcc-8bd6321bf7c6",
    "selfLink": "/iaas/api/request-tracker/452bb595-ca0f-4685-8fcc-8bd6321bf7c6"
}