CreateBandwidthPackage

Updated at:

Creates a specified bandwidth plan.

Operation description

To use Global Accelerator (GA) for network acceleration, you must create a basic bandwidth plan. Basic bandwidth plans support the following bandwidth types:

  • Standard acceleration bandwidth: By default, both the acceleration area and the area where the endpoint is deployed are in the Chinese mainland. The accelerated service is deployed on Alibaba Cloud.

  • Enhanced acceleration bandwidth: By default, both the acceleration area and the area where the endpoint is deployed are in the Chinese mainland. This type can accelerate both Alibaba Cloud and non-Alibaba Cloud public network services.

  • Premium acceleration bandwidth: By default, both the acceleration area and the area where the endpoint is deployed are outside the Chinese mainland. This type can accelerate both Alibaba Cloud and non-Alibaba Cloud public network services. To accelerate network access for users in the Chinese mainland, you must select Hong Kong (China) as the acceleration region.

When you call this operation, take note of the following items:

  • The CreateBandwidthPackage operation is asynchronous. The system returns a bandwidth plan ID, but the bandwidth plan is not yet created. The creation task is still running in the background. You can call DescribeBandwidthPackage to query the status of the bandwidth plan:

    • If the bandwidth plan is in the init state, the bandwidth plan is being created. In this state, you can only perform query operations.

    • If the bandwidth plan is in the active state, the bandwidth plan is created.

  • You cannot call the CreateBandwidthPackage operation to concurrently create bandwidth plans for the same Global Accelerator (GA) instance.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ga:CreateBandwidthPackage

create

*BandwidthPackage

acs:ga:{#regionId}:{#accountId}:bandwidthpackage/*

  • ga:BandwidthPackageType
None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID of the Global Accelerator (GA) instance. Set the value to cn-hangzhou.

cn-hangzhou

Bandwidth

integer

Yes

The bandwidth value of the bandwidth plan. Unit: Mbit/s. Valid values: 2 to 2000.

2

Duration

string

No

The subscription duration.

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

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

This parameter is required if ChargeType is set to PREPAY.

1

PricingCycle

string

No

The billing cycle. Valid values:

  • Month: billed by month.

  • Year: billed by year.

This parameter is required if ChargeType is set to PREPAY.

Month

AutoPay

boolean

No

Specifies whether to enable automatic payment. Valid values:

  • false (default): disables automatic payment. After an order is generated, you must go to the User Center to complete the payment.

  • true: enables automatic payment. The system automatically pays the order.

false

ClientToken

string

No

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. The client token can contain only ASCII characters.

Note

If you do not specify this parameter, the system automatically uses the RequestId of the API request as the ClientToken. The RequestId of each API request is unique.

123e4567****

Type

string

Yes

The type of the bandwidth plan. Valid values:

  • Basic: basic bandwidth plan.

  • CrossDomain: cross-border acceleration bandwidth plan.

Only Basic is supported on the China site.

Basic

BandwidthType

string

No

The bandwidth type. Valid values:

  • Basic: standard acceleration bandwidth.

  • Enhanced: enhanced acceleration bandwidth.

  • Advanced: premium acceleration bandwidth.

This parameter is required if Type is set to Basic.

Basic

AutoUseCoupon

string

No

Specifies whether to use a coupon for automatic payment of the bill. Valid values:

  • true: yes.

  • false (default): no.

Note

This parameter takes effect only when AutoPay is set to true.

false

Ratio

integer

No

The guaranteed proportion for the 95th percentile billing method. Valid values: 30 to 100.

Note

This parameter takes effect only when BillingType is set to PayBY95.

30

BillingType

string

No

The pay-as-you-go billing method. Valid values:

  • PayByTraffic (default): pay-by-data-transfer.

  • PayBY95: pay-by-95th-percentile-bandwidth. The pay-by-95th-percentile-bandwidth billing method is not enabled by default. To use this billing method, contact your account manager.

Note

This parameter takes effect only when ChargeType is set to POSTPAY.

PayByTraffic

ChargeType

string

No

The billing method. Valid values:

  • PREPAY (default): subscription.

  • POSTPAY: pay-as-you-go. The pay-as-you-go billing method is not enabled by default. To use this billing method, contact your account manager.

PREPAY

CbnGeographicRegionIdA

string

No

Area A for the cross-border acceleration bandwidth plan. Set the value to China-mainland (the Chinese mainland).

This parameter is supported only on the International site.

China-mainland

CbnGeographicRegionIdB

string

No

Area B for the cross-border acceleration bandwidth plan. Set the value to Global.

This parameter is supported only on the International site.

Global

PromotionOptionNo

string

No

The coupon code.

Note

This parameter is applicable only to the International site.

50003298014****

AutoRenew

boolean

No

Specifies whether to enable auto-renewal. Valid values:

  • true: yes.

  • false (default): no.

false

AutoRenewDuration

integer

No

The auto-renewal duration. Unit: months.

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

Note

This parameter takes effect only when AutoRenew is set to true.

1

ResourceGroupId

string

No

The ID of the resource group.

rg-aekzrnd67gq****

Tag

array<object>

No

The tags of the bandwidth plan.

object

No

The tags of the bandwidth plan.

Key

string

No

The tag key of the bandwidth plan. The tag key cannot be an empty string.

The tag key can be up to 64 characters in length, and cannot start with aliyun or acs:. It cannot contain http:// or https://.

You can specify up to 20 tag keys.

tag-key

Value

string

No

The tag value of the bandwidth plan. The tag value can be an empty string.

The tag value can be up to 128 characters in length, and cannot start with aliyun or acs:. It cannot contain http:// or https://.

You can specify up to 20 tag values.

tag-value

Response elements

Element

Type

Description

Example

object

The returned information.

BandwidthPackageId

string

The ID of the bandwidth plan.

gbwp-bp1sgzldyj6b4q7cx****

OrderId

string

The order ID.

If you do not enable automatic payment, go to the User Center to complete the payment. This parameter is returned only when ChargeType is set to PREPAY, which indicates the subscription billing method. If AutoPay is set to false, which indicates that automatic payment is disabled, go to the User Center to complete the payment.

208257****

RequestId

string

The request ID.

4B6DBBB0-2D01-4C6A-A384-4129266E6B78

Examples

Success response

JSON format

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

Error codes

HTTP status code

Error code

Error message

Description

400 COMMODITY.INVALID_COMPONENT The bandwidth parameter is incorrect or out of range
400 MissingParameter.BandwidthType You must specify BandwidthType. You must specify BandwidthType.
500 UnknownError An error occurred while processing your request. Please try again. If the error persists, please submit a ticket. An error occurred while the request was being processed. Try again later.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.