All Products
Search
Document Center

Server Load Balancer:ModifyLoadBalancerInstanceChargeType

Last Updated:Mar 02, 2026

Changes the metering method of a pay-as-you-go Classic Load Balancer (CLB) instance.

Operation description

Note
  • For pay-as-you-go CLB instances, you can only change the metering method from pay-by-specification to pay-by-LCU. You cannot change the metering method from pay-by-LCU to pay-by-specification.

  • This operation can change the metering method of only one instance at a time.

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

slb:ModifyLoadBalancerInstanceChargeType

update

*LoadBalancer

acs:slb:{#regionId}:{#accountId}:loadbalancer/{#loadbalancerId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID of the CLB instance.

You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou

LoadBalancerId

string

Yes

The ID of the CLB instance.

lb-bp1b3jus5hpenznuu****

InternetChargeType

string

No

The metering method of Internet data transfer after the change.

Valid value: paybytraffic.

Note
  • If the value of the InstanceChargeType parameter is set to PayByCLCU, only pay-by-data-transfer is supported.

  • When you change the metering method, the new metering method takes effect at 00:00:00 the next day.

paybytraffic

InstanceChargeType

string

Yes

The metering method of the instance after the change.

Valid value: PayByCLCU. Only pay-by-LCU is supported.

PayByCLCU

LoadBalancerSpec

string

No

The specification of the CLB instance.

You do not need to set this parameter. For pay-as-you-go CLB instances, you can only change the metering method from pay-by-specification to pay-by-LCU. You cannot change the metering method from pay-by-LCU to pay-by-specification.

slb.s1.small

Bandwidth

integer

No

The maximum bandwidth of the Internet-facing CLB instance that is billed on a pay-by-bandwidth basis.

You do not need to set this parameter. The metering method of Internet data transfer for pay-by-LCU instances supports only pay-by-traffic.

5

Response elements

Element

Type

Description

Example

object

RequestId

string

The ID of the request.

365F4154-92F6-4AE4-92F8-7FF34B540710

Examples

Success response

JSON format

{
  "RequestId": "365F4154-92F6-4AE4-92F8-7FF34B540710"
}

Error codes

HTTP status code

Error code

Error message

Description

400 OperationFailed.UnpaidBillsExist The account has unpaid bills. Please pay your overdue bill first.
400 Operation.NotAllowed Operation Denied. Unfinished order exists.
400 PAYFOR.ACCOUNT_MONEY_VALIDATE_ERROR Your channel partner account does not have sufficient funds, please contact your channel partner to recharge the account.
400 OperationDenied.PayByCLCU The operation is not allowed because the instanceChargeType of loadbalancer is PayByCLCU.
400 IllegalParam.InstanceChargeType The parameter InstanceChargeType is illegal.
400 IllegalParam.InternetChargeType The parameter InternetChargeType is illegal.
400 InvalidAction.RegionNotSupport The region does not support this action.
400 MissingParam.LoadBalancerSpec The param LoadBalancerSpec is required.
400 OperationDenied.PayBySpec The operation is not allowed because the instanceChargeType of loadbalancer is PayBySpec.
400 InvalidParameterBandwidth The specified Bandwidth is invalid.
400 InvalidParameter The specified LoadBalancerSpec is invalid.
400 Forbidden.LcuToSpec User does not have permission modify InstanceChargeType to spec.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.