Creates a NAT bandwidth package.

A NAT bandwidth package includes a group of public IP addresses and a shared bandwidth. You can create up to four NAT bandwidth packages for a NAT Gateway.

A NAT bandwidth package includes:

  • A shared bandwidth
  • A group of public IP addresses
    Note This action is available only if you purchased a NAT bandwidth package before November 3, 2017. If your account does not have a NAT bandwidth package purchased before November 3, 2017, you can assoicate an Elastic IP Address (EIP).

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 CreateBandwidthPackage

The name of this action.

Value: CreateBandwidthPackage

Bandwidth Integer Yes 5

The bandwidth of the NAT bandwidth package.

Value range: 5 to 100

IpCount Integer Yes 2

The number of public IP addresses in the NAT bandwidth package. Value range: 1 to 50.

NatGatewayId String Yes ngw-7mwb327j1

The ID of the NAT Gateway.

RegionId String Yes cn-hangzhou

The ID of the region to which the NAT bandwidth package belongs. To query the region ID, call DescribeRegions.

ClientToken String No she11234556664566

Optional. The client token that guarantees the idempotence of the request. The value of this parameter is generated by the client and is unique among different requests. The maximum length is 64 ASCII characters.

Description String No The description of the NAT bandwidth package.

Optional. The description of the NAT bandwidth package. The description must be 2 to 256 characters in length. It must start with a letter, but cannot start with http:// or https://.

ISP String No BGP

Optional. The service provider type. Currently, only BGP is supported.

InternetChargeType String No PayByBandwidth

The billing method of the Internet traffic. Value:

  • PayByTraffic: billed according to the traffic consumed
Name String No The name of the NAT bandwidth package.

Optional. The name of the NAT bandwidth package. The name must be 2 to 128 characters in length. It must start with a letter and can contain numbers, periods (.), underscores (_), and hyphens (-). It cannot start with http:// or https://.

Zone String No cn-shanghai-a

Optional. The zone to which the NAT bandwidth package belongs.

If this parameter is not specified, the system randomly allocates a zone.

Note If the NAT bandwidth package and the backend ECS instance belong to different zones, the connection between them is not affected. However, if they belong to the same zone, the latency of the connection between them can be reduced.

Response parameters

Parameter Type Example value Description
BandwidthPackageId String bwp-s6lmotmkk

The ID of the NAT bandwidth package.

RequestId String 54ED4074-3F89-4F11-B166-837DD3E20FE3

The ID of the request.

Examples

Request example


https://vpc.aliyuncs.com/?Action=CreateBandwidthPackage
&Bandwidth=5
&IpCount=2
&NatGatewayId=ngw-7mwb327j1
&RegionId=cn-hangzhou
&<CommonParameters>

Response example

XML format

<CreateBandwidthPackageResponse>
	  <RequestId>2315DEB7-5E92-423A-91F7-4C1EC9AD97C3</RequestId>
          <BandwidthPackageId>bwp-s6lmotmkk</BandwidthPackageId>
</CreateBandwidthPackageResponse>

JSON format

{
	"BandwidthPackageId":"bwp-s6lmotmkk",
	"RequestId":"54ED4074-3F89-4F11-B166-837DD3E20FE3"
}

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 InvalidVpcId.NotFound Specified value of VpcId is not found in our record. The specified VPC does not exist.
400 MissingParameter Miss mandatory parameter. Required parameters are missing.
404 InvalidZoneId.NotFound Specified value of ZoneId is not exists. The specified zone does not exist.
404 InvalidZoneId.NotFound Can not find ZoneId for allocated ip. The zone of the IP address is incorrect.
400 QuotaExceeded.BandwidthPackageIps The specified ipCount exceeded quota. The number of IP addresses has reached the quota.
400 QuotaExceeded.BandwidthPackageCountOnNatGateway BandwidthPackage count limit on one NatGateway exceeded. The number of NAT bandwidth packages has reached the quota. Up to four NAT bandwidth packages can be created for a NAT Gateway.
400 InvalidParameter.Name.Malformed The specified Name is not valid. The specified name is invalid.
400 InvalidParameter.Description.Malformed The specified Description is not valid. The specified description is invalid.
400 InvalidParameter.BandwidthPackage.n.ISP.ValueNotSupport The specified ISP of BandwidthPackage is not valid. The specified ISP is invalid.
400 ZONE_NO_AVAILABLE_IP The Zone have no available ip. No IP addresses are available in the specified zone.
404 NATGW_NOT_EXIST The NatGateway not exist. The specified NAT Gateway does not exist.

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