All Products
Search
Document Center

ENS:ModifyInstanceChargeType

Last Updated:Jul 26, 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

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
ens:ModifyInstanceChargeTypeupdate
  • Instance
    acs:ens:*:{#accountId}:instance/{#InstanceId}
    none
none

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: enables auto-renewal for the instance.

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. Valid values:

Month

Day

Enumeration Value:
  • 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 messageDescription
400VALIDATE.MODULE.FAILEDRequired module is not selected.Required module is not selected.
400ens.interface.errorFailed to call API.-
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
2024-06-13The Error code has changedView Change Details