Removes public IP addresses from a NAT bandwidth package.

Before you call RemoveBandwidthPackageIps to remove public IP addresses, note the following:

  • You cannot remove all public IP addresses from a NAT bandwidth package. If you include all IP addresses in the request, the request fails.
  • You cannot delete an IP address that is not included in the target NAT bandwidth package.
  • You cannot delete an IP address occupied by a DNAT entry or SNAT entry.

This API can be called only if you purchased a NAT bandwidth package before January 26, 2018. If your account does not have a NAT bandwidth package purchased before January 26, 2018, you can associate an Elastic IP Address (EIP).

For more information, see AssociateEipAddress.

Make the API call

You can use OpenAPI Explorer to make API calls, search for API calls, perform debugging, and generate SDK example code.

Request parameters

Parameter Type Required? Example value Description
Action String Yes RemoveBandwidthPackageIps

The name of this action. Value: RemoveBandwidthPackageIps

BandwidthPackageId String Yes bwp-s6lmotmkkxxxxxxxx

The ID of the NAT bandwidth package to which the public IP addresses to be removed belongs.

RegionId String Yes cn-hangzhou

The ID of the region to which the NAT bandwidth package belongs.

To query the region ID, call DescribeRegions.

RemovedIpAddresses.N RepeatList Yes 116.xx.xx.28

The list of the public IP addresses to be removed. Value range of N: 1 to 20

ClientToken String No SHAww112344jhsxxxx

The client token that guarantees the idempotency of the request.

The value of this parameter is generated by a client. It is unique among all requests and can contain a maximum of 64 ASCII characters.

For more information about idempotency, see How to ensure idempotency?

Response parameters

Parameter Type Example value Description
RequestId String 7D275A59-1EB0-4775-8A20-2A47055EAC5C

The ID of the request.

Examples

Request example


https://vpc.aliyuncs.com/?Action=RemoveBandwidthPackageIps
&BandwidthPackageId=bwp-s6lmotmkkxxxxxxxx
&RegionId=cn-hangzhou
&RemovedIpAddresses.1=116.xx.xx.28
&<CommonParameters>

Response example

XML format

<RemoveBandwidthPackageIpsResponse>
      <RequestId>7D275A59-1EB0-4775-8A20-2A47055EAC5C</RequestId>
    </RemoveBandwidthPackageIpsResponse>

JSON format

{
	"RequestId":"7D275A59-1EB0-4775-8A20-2A47055EAC5C"
}

Errors

HTTP status code Error code Error message Description
404 InvalidRegionId.NotFound The specified RegionId does not exist in our records. The specified region ID does not exist.
404 invalidRemovedIpAddresses.NotFound Some of the specified value of RemovedIpAddress not found in specified BandwidthPackage. Some specified IP addresses are not included in the target NAT bandwidth package.
400 InvalidIpCount.ValueNotSupported Can not remove all ips of the bandwidthPackage. You cannot remove all IP addresses in the NAT bandwidth package.
400 InvalidRemovedIpAddresses.NotFound Some of remove ip is not natPublicIp. Some specified IP addresses are not public IP addresses of the NAT Gateway and cannot be removed.
400 DependencyViolation.ForwardEntry The ip has been used by ForwardEntry. The IP address is being used by a forwarding rule. Delete the rule first.
400 DependencyViolation.SnatEntry The ip has been used by SnatEntry. The IP address is being used by an SNAT rule. Delete the rule first.
404 BandwidthPackage.FinancialLocked The specified BandwidthPackage has been Financail Lock. The specified NAT bandwidth package is locked due to an overdue payment.

For a list of error codes, visit the API Error Center.