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

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.

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

ParameterTypeRequiredExampleDescription
RegionIdStringYescn-hangzhou

The region ID of the CLB instance.

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

ActionStringYesModifyLoadBalancerInstanceChargeType

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

LoadBalancerIdStringYeslb-bp1b3jus5hpenznuu****

The ID of the CLB instance.

InternetChargeTypeStringNopaybytraffic

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

The metering method of the instance after the change.

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

LoadBalancerSpecStringNoslb.s1.small

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.

BandwidthIntegerNo5

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.

Response parameters

ParameterTypeExampleDescription
RequestIdString365F4154-92F6-4AE4-92F8-7FF34B540710

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?RegionId=cn-hangzhou
&Action=ModifyLoadBalancerInstanceChargeType
&LoadBalancerId=lb-bp1b3jus5hpenznuu****
&InternetChargeType=paybytraffic
&InstanceChargeType=PayByCLCU
&Common request parameters

Sample success responses

XML format

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

<ModifyLoadBalancerInstanceChargeTypeResponse>
    <RequestId>365F4154-92F6-4AE4-92F8-7FF34B540710</RequestId>
</ModifyLoadBalancerInstanceChargeTypeResponse>

JSON format

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

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

Error codes

HttpCodeError codeError messageDescription
400OperationFailed.UnpaidBillsExistThe account has unpaid bills. Please pay your overdue bill first.The error message returned because you cannot perform the operation when a you have an overdue payment in your account. Settle the overdue payment and try again.
400Operation.NotAllowedOperation Denied. Unfinished order exists.The error message returned because a pending order exists.
400Operation.NotAllowedOperation Denied. Unfinished purchase exists.The error message returned because the payment of an order is not completed.
400Operation.NotAllowedOperation Denied. Prepay instance only permitted to modify internet bandwidth.The error message returned because you can modify only the maximum bandwidth of an Internet-facing CLB instance that uses the subscription billing method.
400Operation.NotAllowedOperation Denied. Prepay instance only permitted to increase internet bandwidth.The error message returned because you can upgrade only the maximum bandwidth of an Internet-facing CLB instance that uses the subscription billing method.
400Operation.NotAllowedOperation Denied. The Purchase status of the instance is not valid.The error message returned because the value of a parameter in the CLB order is invalid.
400OperationDenied.PayByCLCUThe operation is not allowed because the instanceChargeType of loadbalancer is PayByCLCU.The error message returned because the metering method of the CLB instance is pay-by-LCU.
400IllegalParam.InstanceChargeTypeThe parameter InstanceChargeType is illegal.The error message returned because the value of the InstanceChargeType parameter is invalid.
400IllegalParam.InternetChargeTypeThe parameter InternetChargeType is illegal.The error message returned because the value of the InternetChargeType parameter is invalid.
400InvalidAction.RegionNotSupportThe region does not support this action.The error message returned because the parameter is not supported in the current region.
400MissingParam.LoadBalancerSpecThe param LoadBalancerSpec is required.The error message returned because LoadBalancerSpec is not set.
400OperationDenied.PayBySpecThe operation is not allowed because the instanceChargeType of loadbalancer is PayBySpec.The error message returned because the metering method of the CLB instance is pay-by-LCU.
400InvalidParameterThe specified LoadBalancerSpec is invalid.The error message returned because the value of the LoadBalancerSpec parameter is invalid. Check the parameter value and try again.
400Forbidden.LcuToSpecUser does not have permission modify InstanceChargeType to spec.The error message returned because you cannot change the metering method of the CLB instance from pay-by-LCU to pay-by-specification.

For a list of error codes, see Service error codes.