ModifyDesktopChargeType

更新时间:
复制 MD 格式

Changes the billing method of a cloud desktop to subscription or pay-as-you-go.

Operation description

  • Before calling this operation, ensure you understand the billing methods for cloud desktops. For more information, see billing overview.

  • Ensure the cloud desktop is in the running or stopped state and has no overdue payments.

  • After you pay for the order, the system begins to convert the billing method. While the desktop is in the updating state, you cannot perform other operations, such as starting, stopping, or changing its configuration.

When you convert from subscription to pay-as-you-go, refund limits apply. For more information, see Convert Subscription to Pay-As-You-Go.

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

ecd:ModifyDesktopChargeType

update

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID. You can call the DescribeRegions operation to query the regions supported by Elastic Desktop Service.

cn-hangzhou

ChargeType

string

No

The new billing method.

Valid values:

  • PostPaid :

    Changes the billing method from subscription to pay-as-you-go.

  • PrePaid :

    Changes the billing method from pay-as-you-go to subscription.

PrePaid

Period

integer

No

The subscription duration. This parameter is required only when you set the ChargeType parameter to PrePaid. The unit of the duration is specified by the PeriodUnit parameter.

  • If you set the PeriodUnit parameter to Week, you can set this parameter only to 1.

  • If you set the PeriodUnit parameter to Month, you can set this parameter to 1, 2, 3, or 6.

  • If you set the PeriodUnit parameter to Year, you can set this parameter to 1, 2, 3, 4, or 5.

1

PeriodUnit

string

No

The unit of the subscription duration.

Valid values:

  • Month :

    month. This is the default value.

  • Year :

    year

  • Week :

    week

Month

AutoPay

boolean

No

Specifies whether to enable automatic payment.

Valid values:

  • true :

    Enables automatic payment. Make sure that your account has a sufficient balance. Otherwise, an unpaid order is generated. This is the default value.

  • false :

    Generates an order but does not complete the payment. You can log on to the console and complete the payment in the Orders section of the User Center. Use the order ID that is returned by this operation to complete the payment.

false

DesktopId

array

Yes

The IDs of the cloud desktops. You can specify 1 to 20 IDs.

ecd-gx2x1dhsmucyy****

string

No

The ID of the cloud desktop.

["ecd-gx2x1dhsmucyy****"]

PromotionId

string

No

The promotion ID.

50003836003****

UseDuration

integer

No

Note

This parameter is in invitational preview and is not publicly available.

sample

ResellerOwnerUid

integer

No

Response elements

Element

Type

Description

Example

object

The response parameters.

OrderId

string

The ID of the order.

123456789

RequestId

string

The request ID.

1CBAFFAB-B697-4049-A9B1-67E1FC5F****

DesktopId

array

The IDs of the cloud desktops.

string

The ID of the cloud desktop.

["ecd-gx2x1dhsmucyy****"]

TaskId

string

Examples

Success response

JSON format

{
  "OrderId": "123456789",
  "RequestId": "1CBAFFAB-B697-4049-A9B1-67E1FC5F****",
  "DesktopId": [
    "[\"ecd-gx2x1dhsmucyy****\"]"
  ],
  "TaskId": ""
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.