All Products
Search
Document Center

ENS:ModifyInstanceChargeType

Last Updated:Apr 16, 2024

Changes the billing method of Edge Node Service (ENS) instances. You can switch between the pay-as-you-go and subscription billing methods for instances. You can also change the billing method for disks that you created with pay-as-you-go instances to subscription.

Operation description

Before you call this operation, make sure that you fully understand the billing methods and pricing of ENS.

The instances must be in the Running or Stopped state, and you have no overdue payments for them.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdsarrayYes

The IDs of the instances.

stringYes

The ID of the instance.

i-5xlrc9wdeo3xxxxxx
InstanceChargeTypestringYes

The new billing method. Valid values:

PrePaid

PostPaid (default)

PostPaid
AutoRenewbooleanNo

Specifies whether to enable auto-renewal when you change the billing method from pay-as-you-go to subscription. Valid values:

true

false

false
PeriodstringNo

The subscription duration. This parameter is required if you set the InstanceChargeType parameter to PrePaid. Valid values:

If the PeriodUnit parameter is set to Day, Period can only be set to 3.

If PeriodUnit is Month, Period can be set to 1 to 9 or 12.

1
PeriodUnitstringNo

The unit of the subscription duration. This parameter is required if you set the InstanceChargeType parameter to PrePaid. Examples:

Month

Day

Valid values:

  • Year
  • Month
  • Day
Month
IncludeDataDisksbooleanNo

Specifies whether to change the billing method of all data disks that are created with the instance to subscription when you change the billing method of the instance from pay-as-you-go to subscription. Valid values:

true

false (default)

true
AutoPaybooleanNo

Specifies whether to enable auto-payment when you change the billing method from pay-as-you-go to subscription. Valid values:

true: enables auto-payment. Make sure that your account has sufficient balance.

false (default): does not enable auto-payment. The order is generated but not paid.

false

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The request ID.

E2CE5821-7A18-5F7B-A18A-1C751B933D2A
InstanceIdsarray

The IDs of the instances.

string

The ID of the instance.

i-5xu1chy7ckxxxx
OrderIdlong

The ID of the order.

21522202681****

Examples

Sample success responses

JSONformat

{
  "RequestId": "E2CE5821-7A18-5F7B-A18A-1C751B933D2A",
  "InstanceIds": [
    "i-5xu1chy7ckxxxx"
  ],
  "OrderId": 0
}

Error codes

HTTP status codeError codeError message
400NoPermissionPermission denied.
400InvalidParameter.%sThe specified field %s invalid. Please check it again.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history