Creates a NAT bandwidth package.

A NAT Gateway 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 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 need to attach an EIP. 

Debug

By using API Explorer, you can easily debug APIs, automatically generate SDK code examples, and quickly search for APIs.

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 1000.

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 to be used.

RegionId String Yes cn-hangzhou

The region to which the NAT Gateway belongs.

To query the region ID, call DescribeRegions.

ClientToken String No she11234556664566

A client token used to guarantee the idempotence of requests.

This parameter value is generated by the client and must be unique. It must be 1 to 64 ASCII characters in length.

Description String No The description of the bandwidth package

The description of the NAT bandwidth package.

The description must be 2 to 256 characters in length. The description must start with a letter. It cannot start with http:// or https://.

ISP String No BGP

Valid value: BGP.

InternetChargeType String No PayByBandwidth

The Internet billing method. Valid values:

  • PayByTraffic: Billing based on traffic
Name String No The name of the bandwidth package

The name of the NAT bandwidth package.

The name must be 2 to 128 characters in length and can letters, numbers, underscores (_), and hyphens (-). The name must start with a letter, but cannot start with http://  or https://.

Zone String No cn-shanghai-a

The zone of the NAT bandwidth package.

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

Note If the NAT bandwidth package and the backend ECS instance are not in the same zone, the latency of the connection between them is unchanged; if they are in 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"
    }
    

Error codes

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.
400 MissingParameter Miss mandatory parameter. The 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 specified zone of the IP address is incorrect.
400 QuotaExceeded.BandwidthPackageIps The specified ipCount exceeded quota. The quota of IP addresses has been reached. To increase the quota, open a ticket.
400 QuotaExceeded.BandwidthPackageCountOnNatGateway BandwidthPackage count limit on one NatGateway exceeded. The quota of shared bandwidth packages has been reached. You can create up to four shared bandwidth packages for a NAT Gateway.
400 InvalidParameter.Name.Malformed The specified Name is not valid. The name is invalid.
400 InvalidParameter.Description.Malformed The specified Description is not valid. The description is invalid.
400 InvalidParameter.BandwidthPackage.n.ISP.ValueNotSupport The specified ISP of BandwidthPackage is not valid. The ISP of the shared bandwidth package is invalid.
400 ZONE_NO_AVAILABLE_IP The Zone have no available ip. There are no available IP addresses in this zone.
404 NATGW_NOT_EXIST The NatGateway not exist. The specified NAT Gateway does not exist.

See common error codes