IBM Cloud Docs
Deleting public address ranges

Deleting public address ranges

Public Address Ranges for VPC is only available for evaluation and testing purposes for users with special access.

You can delete public address ranges with the console, CLI, and API.

Deleting public address ranges in the console

To delete public address ranges in the IBM Cloud console, follow these steps:

  1. From the IBM Cloud console, Select the Navigation menu Menu icon, then click Infrastructure VPC icon > Network > Public address ranges. The Public address ranges for VPC page appears.
  2. Highlight the row of the address range in the table, then click Delete from the Actions menu Actions icon.
  3. Click Delete to confirm that you want to delete this address range from the VPC.

Deleting public address ranges from the CLI

To delete public address ranges from the command line, follow these steps:

  1. Set up your CLI environment.

  2. Log in to your CLI environments. After you enter the password, the system prompts which account and region that you want to use:

    ibmcloud login --sso
    
  3. Enable the following feature flag:

    export IBMCLOUD_IS_FEATURE_PUBLIC_ADDRESS_RANGE=true
    

    You'll receive a notification in the command line when updates to the IBM Cloud CLI and its plug-ins are available. It's important to keep your CLI up to date to access the latest commands. To check the current version of all installed plug-ins, run ibmcloud plugin list.

  4. Run the following command:

    ibmcloud is public-address-range-delete [PUBLIC_ADDRESS_RANGE1…, PUBLIC_ADDRESS_RANGE2…] [-f, --force][--output JSON] [-q, --quiet]
    

    Where:

    PUBLIC_ADDRESS_RANGE
    The ID or name of the public address range to delete.
    -f, --force
    Force the operation without confirmation.
    --output
    The output format, only JSON is supported. One of: JSON.
    -q, --quiet
    Suppress verbose output.

Command example

Delete the public address range $par-id:

ibmcloud is public-address-range-delete $par-id

Deleting public address ranges with the API

To delete a public address range with the API, follow these steps:

  1. Set up your API environment.

  2. Store the following values in variables to be used in the API command:

    For example: version (string): The API version, in format YYYY-MM-DD.

  3. When all variables are initiated, you can delete a public address range from a specific VPC as follows:

    curl -sX DELETE \
             "$e/v1/public_address_ranges/$par-id?version=$dt&generation=2" \
             -H "Authorization: Bearer $iam_token"
    

Related links