Changes the billing method of a cloud desktop. You can change the billing method only from pay-as-you-go to subscription.

Description

  • Before you call this operation, make sure that you are familiar with the billing methods of cloud desktops in Elastic Desktop Service (EDS). For more information, see Billing overview.
  • Before you call this operation, make sure that the cloud desktop that you want to manage is in the Running or Stopped state and no overdue payments of the cloud desktop are generated.
  • After the order payment is completed, the system starts to change the billing method of the cloud desktop. During the change, you cannot perform operations, such as starting or stopping the cloud desktop, and changing configurations of the cloud desktop.

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

Parameter Type Required Example Description
Action String Yes ModifyDesktopChargeType

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

DesktopId.N RepeatList Yes ecd-gx2x1dhsmucyy****

The ID of cloud desktop N. You can specify one or more cloud desktop IDs. Valid values of N: 1 to 20.

RegionId String Yes cn-hangzhou

The ID of the region.

ChargeType String No PrePaid

The billing method that you want to change for the cloud desktop. You can change only a pay-as-you-go cloud desktop to a subscription cloud desktop. Valid value: PrePaid.

Period Integer No 1

The subscription duration when you change a pay-as-you-go cloud desktop to a subscription cloud desktop. The unit is specified by the PeriodUnit parameter. The Period parameter takes effect and is required only when the ChargeType parameter is set to PrePaid.

  • If the PeriodUnit parameter is set to Week, the valid value of the Period parameter is 1.
  • If the PeriodUnit parameter is set to Month, the valid values of the Period parameter are 1, 2, 3, and 6.
  • If the PeriodUnit parameter is set to Year, the valid values of the Period parameter are 1, 2, 3, 4, and 5.
PeriodUnit String No Month

The unit of the subscription duration when you change a pay-as-you-go cloud desktop to a subscription cloud desktop. Valid values:

  • Week
  • Month
  • Year

Default value: Month.

AutoPay Boolean No false

Specifies whether to enable automatic payment when you change a pay-as-you-go cloud desktop to a subscription cloud desktop. Valid values:

  • true: enables automatic payment. Make sure that you have sufficient balance in your account. Otherwise, abnormal orders are generated.
  • false: generates an order. However, no payment is completed. You can log on to the EDS console and complete the payment based on the order ID on the Orders page.

Default value: true.

Response parameters

Parameter Type Example Description
DesktopId List ["ecd-gx2x1dhsmucyy****"]

The ID of cloud desktop. If multiple cloud desktops are created at a time, multiple cloud desktop IDs are returned.

OrderId String 123456789

The ID of the order.

RequestId String 3EB7FCEE-D731-4948-85A3-4B2C341CA983

The ID of the request.

Examples

Sample requests

https://ecd.cn-hangzhou.aliyuncs.com/?Action=ModifyDesktopChargeType
&DesktopId.1=ecd-gx2x1dhsmucyy****
&RegionId=cn-hangzhou
&ChargeType=PrePaid
&Period=1
&<Common request parameters>

Sample success responses

XML format

<ModifyDesktopChargeTypeResponse>
      <RequestId>3EB7FCEE-D731-4948-85A3-4B2C341CA983</RequestId>
      <DesktopId>["ecd-gx2x1dhsmucyy****"]</DesktopId>
      <OrderId>123456789</OrderId>
</ModifyDesktopChargeTypeResponse>

JSON format

{
    "RequestId": "3EB7FCEE-D731-4948-85A3-4B2C341CA983",
    "DesktopId": "[\"ecd-gx2x1dhsmucyy****\"]",
    "OrderId": "123456789"
}