Creates a bandwidth plan.

Description

To use Global Accelerator (GA) for acceleration, you must purchase a basic bandwidth plan. A basic bandwidth plan supports the following bandwidth types:

  • Basic: Both the default acceleration region and the default service region are in the Chinese mainland. The accelerated service is deployed on Alibaba Cloud.
  • Enhanced: Both the default acceleration region and the default service region are in the Chinese mainland. The accelerated service can be deployed on and off Alibaba Cloud.
  • Premium: Both the default acceleration region and the default service region are in the Chinese mainland. The accelerated service can be deployed on and off Alibaba Cloud. If you want to accelerate data transfer from clients in the Chinese mainland, you must select China (Hong Kong) as the acceleration region.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateBandwidthPackage

The operation that you want to perform. Set the value to CreateBandwidthPackage.

RegionId String Yes cn-hangzhou

The ID of the region where the GA instance is deployed. Set the value to cn-hangzhou.

Bandwidth Integer Yes 2

The bandwidth of the bandwidth plan. Unit: Mbit/s.

Valid values: 2 to 2000.

Duration String No 1

The subscription duration.

  • If the PricingCycle parameter is set to Month, the valid values for the Duration parameter are 1 to 9.
  • If the PricingCycle parameter is set to Year, the valid values for the Duration parameter are 1 to 3.

If ChargeType is set to PREPAY, this parameter is required.

PricingCycle String No Month

The billing cycle. Valid values:

  • Month: billed on a monthly basis.
  • Year: billed on an annual basis.

If ChargeType is set to PREPAY, this parameter is required.

AutoPay Boolean No false

Specifies whether to automatically complete the payment. Valid values:

  • false (default): disables automatic payment. If you select this option, you must go to the Order Center to complete the payment after an order is generated.
  • true: enables automatic payment. Payments are automatically completed.
ClientToken String No 123e4567****

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must make sure that it is unique among different requests. ClientToken can contain only ASCII characters.

Note If you do not set this parameter, the system automatically uses RequestId as ClientToken. RequestId of each API request may be different.
Type String Yes Basic

The type of the bandwidth plan. Valid values:

  • Basic: a basic bandwidth plan
  • CrossDomain: a cross-region acceleration bandwidth plan

If you call this operation on the Alibaba Cloud China site, only Basic is supported.

BandwidthType String No Basic

The type of the bandwidth. Valid values:

  • Basic: basic
  • Enhanced: enhanced
  • Advanced: premium

If Type is set to Basic, this parameter is required.

AutoUseCoupon String No false

Specifies whether to automatically pay bills by using coupons. Valid values:

  • true: yes
  • false (default): no
    Note This parameter is required only if AutoPay is set to true.
Ratio Integer No 30

The percentage of the minimum bandwidth guaranteed if the pay-by-95th-percentile-bandwidth metering method is used. Valid values: 30 to 100.

Note This parameter is required only if BillingType is set to PayBY95.
BillingType String No PayByTraffic

The metering method that is used when you use the pay-as-you-go billing method. Valid values:

  • PayByTraffic (default): pay-by-data-transfer
  • PayBY95: pay-by-95th-percentile

The pay-by-95th-percentile metering method is available only for users that are added to the whitelist. To use this feature, submit a ticket.

ChargeType String No PREPAY

The billing method of the bandwidth plan. Valid values:

  • PREPAY (default): subscription
  • POSTPAY: pay-as-you-go

The pay-as-you-go billing method is available only for users that are added to the whitelist. To use this feature, submit a ticket.

CbnGeographicRegionIdA String No China-mainland

Area A to be connected. Set the value to China-mainland.

You can set this parameter only if you call this operation on the Alibaba Cloud International site.

CbnGeographicRegionIdB String No Global

Area B to be connected. Set the value to Global.

You can set this parameter only if you call this operation on the Alibaba Cloud International site.

AutoRenew Boolean No false

Specifies whether to enable auto-renewal for the bandwidth plan. Valid values:

  • true: yes
  • false (default): no
AutoRenewDuration Integer No 1

The auto-renewal period. Unit: months.

Valid values: 1 to 12. Default value: 1.

Note This parameter is required only if AutoRenew is set to true.

Response parameters

Parameter Type Example Description
RequestId String 4B6DBBB0-2D01-4C6A-A384-4129266E6B78

The ID of the request.

BandwidthPackageId String gbwp-bp1sgzldyj6b4q7cx****

The ID of the bandwidth plan.

OrderId String 208257****

The ID of the order.

If bills are not automatically paid, you must go to the Order Center to complete the payments.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateBandwidthPackage
&RegionId=cn-hangzhou
&Bandwidth=2
&Duration=1
&PricingCycle=Month
&AutoPay=false
&ClientToken=123e4567****
&Type=Basic
&BandwidthType=Basic
&AutoUseCoupon=false
&Ratio=30
&BillingType=PayByTraffic
&ChargeType=PREPAY
&CbnGeographicRegionIdA=China-mainland
&CbnGeographicRegionIdB=Global
&AutoRenew=false
&AutoRenewDuration=1
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateBandwidthPackageResponse>
    <RequestId>4B6DBBB0-2D01-4C6A-A384-4129266E6B78</RequestId>
    <BandwidthPackageId>gbwp-bp1sgzldyj6b4q7cx****</BandwidthPackageId>
    <OrderId>208257****</OrderId>
</CreateBandwidthPackageResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "4B6DBBB0-2D01-4C6A-A384-4129266E6B78",
  "BandwidthPackageId" : "gbwp-bp1sgzldyj6b4q7cx****",
  "OrderId" : "208257****"
}

Error codes

HttpCode Error code Error message Description
400 MissingParameter.BandwidthType You must specify BandwidthType. The error message returned because BandwidthType is not set.

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