Creates cloud computers. If you specify end users when you create cloud computers, the cloud computers are assigned to the end users after the cloud computers are created.
Operation description
Before you create cloud computers, complete the following preparations:
-
An office network (formerly called workspace) and users are created. For more information, see:
- Convenience office network: CreateSimpleOfficeSite and CreateUsers .
- Active Directory (AD) office network: CreateADConnectorOfficeSite and Create an AD user.
-
Make sure a cloud computer template exists. If no cloud computer template exists, call the CreateBundle operation to create a template.
-
Make sure a policy exists. If no policy exists, call the CreatePolicyGroup operation to create a policy.
If you want the cloud computers to automatically execute a custom command script, you can use the UserCommands
field to configure a custom command.
Debugging
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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
ecd:CreateDesktops | create |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The region ID. You can call the DescribeRegions operation to query the most recent region list. | cn-hangzhou |
GroupId | string | No | The ID of the cloud computer pool. | dg-boyczi8enfyc5**** |
BundleId | string | Yes | The ID of the cloud computer template. | b-je9hani001wfn**** |
DesktopName | string | No | The name of the cloud computer. The name must meet the following requirements:
| testDesktopName |
UserName | string | No | Note
This parameter is not publicly available.
| To be hidden. |
VpcId | string | No | Note
This parameter is not publicly available.
| To be hidden. |
Amount | integer | No | The number of cloud computers that you want to create. Valid values: 1 to 300. Default value: 1. | 1 |
DirectoryId | string | No | Note
This parameter is not publicly available.
| To be hidden. |
OfficeSiteId | string | Yes | The office network ID. | cn-hangzhou+os-c5cy7q578s8jc**** |
PolicyGroupId | string | Yes | The ID of the policy. | system-all-enabled-policy |
ChargeType | string | No | The billing method of the cloud computers. Default value: PostPaid. Valid values:
| PrePaid |
Period | integer | No | The subscription duration of the cloud desktop that you want to create. The unit is specified by the
| 1 |
PeriodUnit | string | No | The unit of the subscription duration. | Month |
AutoPay | boolean | No | Specifies whether to enable automatic payment. | false |
AutoRenew | boolean | No | Specifies whether to enable auto-renewal. This parameter takes effect only when the ChargeType parameter is set to PrePaid. | false |
PromotionId | string | No | The ID of the sales promotion. | 23141 |
UserAssignMode | string | No | How the cloud computers are assigned. Note
If you do not specify the EndUserId parameter, the cloud computers are not assigned to end users after the cloud computers are created.
Default value: ALL. Valid values:
| ALL |
Hostname | string | No | The custom hostnames of the cloud computers. This parameter is valid only if the office network is an AD office network and the operating system type of the cloud computers is Windows. The hostnames must meet the following requirements:
When you create multiple cloud computers, you can use the
| testhost |
EndUserId | array | No | The IDs of the end users to which you want to assign the cloud computers. You can specify 1 to 100 IDs. | |
string | No | The ID of an end user to which you want to assign the cloud computer.
| test1 | |
Tag | array<object> | No | The tags that you want to add to the cloud desktop. | |
object | No | The tag that you want to add. | ||
Key | string | No | The key of the tag. You can specify 1 to 20 keys for a tag. | TestKey |
Value | string | No | The value of the tag. You can specify 1 to 20 values for a tag. | TestValue |
DesktopNameSuffix | boolean | No | Specifies whether to automatically add suffixes to the names of cloud computers when you create multiple cloud computers at the same time. Default value: true. Valid values:
| false |
VolumeEncryptionEnabled | boolean | No | Specifies whether to enable disk encryption. | false |
VolumeEncryptionKey | string | No | The ID of the Key Management Service (KMS) key that you want to use when disk encryption is enabled. You can call the ListKeys operation to obtain a list of KMS keys. | 08c33a6f-4e0a-4a1b-a3fa-7ddfa1d4**** |
DesktopMemberIp | string | No | The private IP address of the cloud computer. | 10.0.0.1 |
UserCommands | array<object> | No | Details about the custom command scripts. | |
object | No | The custom command script of the user. | ||
ContentEncoding | string | No | The encoding mode of the command content. Valid values:
| Base64 |
Content | string | No | The command content. | bmV3LWl0ZW0gZDpcdGVzdF91c2VyX2NvbW1hbmRzLnR4dCAtdHlwZSBm**** |
ContentType | string | No | The language type of the command. Valid values:
| RunPowerShellScript |
BundleModels | array<object> | No | The cloud computer templates. | |
object | No | The desktop template that you want to use. | ||
BundleId | string | No | The ID of a cloud computer template. | b-je9hani001wfn**** |
Amount | integer | No | The number of cloud computers that you want to create. Valid values: 1 to 300. Default value: null. | 1 |
EndUserIds | array | No | The IDs of the end users to whom the cloud computer are assigned. | |
string | No | The name of an end user. | Alice | |
DesktopName | string | No | The name of the cloud computer. The name must meet the following requirements:
| testDesktopName |
Hostname | string | No | The custom hostnames of the cloud computers. This parameter is valid only if the office network is an AD office network and the operating system type of the cloud computers is Windows. The hostnames must meet the following requirements:
When you create multiple cloud computers, you can use the
| testhost |
VolumeEncryptionEnabled | boolean | No | Specifies whether to enable disk encryption. | false |
VolumeEncryptionKey | string | No | The ID of the Key Management Service (KMS) key that is used when disk encryption is enabled. You can call the ListKeys operation to query the list of KMS keys. | 08c33a6f-4e0a-4a1b-a3fa-7ddfa1d4**** |
DesktopTimers | array<object> | No | The details of the scheduled task on cloud computers. | |
object | No | |||
TimerType | string | No | The type of the scheduled task. | NoOperationReboot |
CronExpression | string | No | The cron expression for the scheduled task. Note
The time must be in UTC. For example, for 24:00 (UTC+8), you must set the value to 0 0 16 ? * 1,2,3,4,5,6,7
| 0 40 7 ? * 1,2,3,4,5,6,7 |
Interval | integer | No | The interval at which cloud computers are created. Unit: minutes. | 10 |
Enforce | boolean | No | Specifies whether to forcibly execute the scheduled task. Valid values:
| True |
ResetType | string | No | The reset type of the cloud computers. Valid values:
| RESET_TYPE_SYSTEM |
OperationType | string | No | The operations that scheduled tasks support. This parameter is valid only when TimerType is set to NoConnect. Valid values:
| Shutdown |
AllowClientSetting | boolean | No | Specifies whether to allow the end user to configure the scheduled task. | true |
MonthDesktopSetting | object | No | Note
This parameter is not publicly available.
| |
UseDuration | integer | No | Note
This parameter is not publicly available.
| null |
BuyerId | long | No | Note
This parameter is not publicly available.
| null |
DesktopId | string | No | Note
This parameter is not publicly available.
| null |
Response parameters
Examples
Sample success responses
JSON
format
{
"OrderId": "123456789",
"RequestId": "1CBAFFAB-B697-4049-A9B1-67E1FC5F****",
"DesktopId": [
"[\"ecd-gx2x1dhsmucyy****\"]"
]
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidEncryptionKey.Missing | Parameter VolumeEncryptionKey is missing. | When the disk encryption function is enabled, the encryption key cannot be empty. |
400 | InvalidEncryptionKey.NotAuthorized | Eds service cannot access the given VolumeEncryptionKey. | Unable to access unauthorized encryption keys |
400 | InvalidEncryptionKey.NotFound | The specified VolumeEncryptionKey is not found. | The specified encryption key could not be found |
400 | InvalidImageStatus.NotValid | The specified image status is not valid. | The status of the specified image is unavailable and cannot be created. |
400 | InvalidImageVersion.NotSupported | The specified image version is no longer supported. | The specified image version is no longer supported. Please select another image. |
400 | InvalidMemberIp.DesktopAmount | The desktop amount need to be 1. | When you specify an IP to create a desktop, the number of desktops can only be 1 |
400 | InvalidPolicyGroup.Status | The target policy group is being created. Please try again later. | - |
400 | Protocol.NotAllowed | Procotol of the image is not allowed. | The protocol type of the image is not supported. Check the image ID. |
400 | ExistedHostname | The specified hostname is existed on the domain. | The specified hostname already exists in the current workspace |
400 | HostnameCannotCustomizeForLinux | Customizing hostname is not supported for Linux desktop. | The custom hostname feature does not support Linux desktops |
400 | IncorrectDirectoryStatus | Only registered directory can create desktop. | Workspace status error, only desktop creation with registered workspace is supported |
400 | IncorrectDirectoryType | The protocol type of directory and desktop do not match. | The protocol types of the specified workspace and the target desktop do not match, please check |
400 | InvalidAmount | The specified Amount is not a valid value. | The specified quantity is illegal |
400 | InvalidAmount.NotTimesOfUsers | The specified Amount is notmatch EndUserId size. | The number of desktops specified is not equal to the number of users to be assigned, please re-specify |
400 | InvalidDesktopBundle.NotFound | The specified param BundleId is not found. | Specified BundleId not found |
400 | InvalidDirectoryId.NotFound | The specified param DirectoryId is not found. | Unable to find workspace ID, please check workspace |
400 | InvalidDirectoryType.NotSupported | The specified DirectoryType is not supported. | Specified |
400 | InvalidEncryptionEnabled.Invalid | The parameter VolumeEncryptionEnabled is invalid. | When specifying the encryption key, you need to turn on the disk encryption function. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-07-22 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2024-04-29 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2023-11-21 | The Error code has changed. The request parameters of the API has changed | View Change Details |
2023-11-15 | The Error code has changed | View Change Details |
2023-11-15 | The Error code has changed | View Change Details |
2023-05-24 | The request parameters of the API has changed | View Change Details |
2023-05-24 | The request parameters of the API has changed | View Change Details |
2023-04-24 | The request parameters of the API has changed | View Change Details |
2023-03-14 | The request parameters of the API has changed | View Change Details |
2022-08-08 | The request parameters of the API has changed | View Change Details |