Creating a Desktop Pool
Function
Creates and assigns a desktop pool to a user or user group. When the user logs in, the user is bound to one of the desktops.
To use this function, you need to authorize the cloud service by calling the API for enabling the agency function.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
workspace:desktopPools:create
Write
desktopPool *
-
-
- ims:images:get
- ims:images:list
- ims:images:share
- ims:images:updateMemberStatus
- ims:images:deleteMember
- ims:images:addMember
- vpc:networks:get
- vpc:ports:create
- vpc:ports:delete
- vpc:ports:get
- vpc:ports:update
- vpc:securityGroups:get
- vpc:subnets:get
- vpc:vpcs:get
- dss:pools:list
user
-
userGroup
-
-
URI
POST /v2/{project_id}/desktop-pools
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID. |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
name |
Yes |
String |
Desktop pool name, which must be unique. The desktop name can contain 1 to 255 characters, including uppercase letters, lowercase letters, digits, and hyphens (-). |
|
type |
Yes |
String |
Desktop pool type. The options are DYNAMIC (dynamic pool) and STATIC (static pool). |
|
size |
Yes |
Integer |
Desktop pool size: number of desktops to be created in the current desktop pool. |
|
description |
No |
String |
Desktop pool description. |
|
availability_zone |
No |
String |
AZ. Desktops are created in the specified AZ. |
|
product_id |
Yes |
String |
Package ID. |
|
flavor_id |
No |
String |
Product specification ID. |
|
image_type |
Yes |
String |
Specifies the image type. The default value is private. |
|
image_id |
Yes |
String |
Image ID. This parameter is used together with product_id for creating desktops using custom images. |
|
root_volume |
Yes |
VolumeInfo object |
System disk. |
|
data_volumes |
No |
Array of VolumeInfo objects |
Data disks. |
|
vpc_id |
No |
String |
Specifies the VPC ID when the desktop is created. |
|
subnet_ids |
Yes |
Array of strings |
ID of the subnet used for creating a desktop. |
|
security_groups |
No |
Array of SecurityGroupIdInfo objects |
Security group used by the desktop. If no security group is specified, the security group specified in the desktop agent is used by default. |
|
authorized_objects |
No |
Array of AuthorizedObjects objects |
Users or user groups to be authorized. |
|
ou_name |
No |
String |
OU name, which is used for connecting to the AD. An OU must be created in the AD in advance. |
|
tags |
No |
Array of Tag objects |
Tag list. |
|
enterprise_project_id |
No |
String |
Enterprise project ID, which is 0 by default. |
|
disconnected_retention_period |
No |
Integer |
Number of minutes within which the binding relationship between a user and a desktop is retained when the dynamic pool desktop is disconnected. After the binding relationship times out, the user is automatically unbound. |
|
enable_autoscale |
No |
Boolean |
Specifies whether to enable auto scaling for the desktop pool. The value false indicates that auto scaling is disabled, and the value true indicates that auto scaling is enabled. |
|
autoscale_policy |
No |
AutoscalePolicy object |
Auto scaling policy. |
|
desktop_name_policy_id |
No |
String |
Policy ID, which is used to specify the desktop name generation policy. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
id |
No |
String |
Specifies the IDs of the disks to be operated in batches. |
|
type |
Yes |
String |
Desktop data disk type, which must be the same as the disk type provided by the system. |
|
size |
Yes |
Integer |
Disk capacity in GB. |
|
iops |
No |
Integer |
Number of read/write operations performed by an EVS disk per second. |
|
throughput |
No |
Integer |
Amount of data read from and written to an EVS disk per second. |
|
resource_spec_code |
No |
String |
Specifications. |
|
kms_id |
No |
String |
KMS key ID. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
object_type |
Yes |
String |
Enumeration of bound object types. |
|
object_id |
Yes |
String |
User ID or user group ID. |
|
object_name |
Yes |
String |
Username or user group name. |
|
domain |
No |
String |
Domain name of the user/user group. |
|
user_group |
Yes |
String |
Specifies the user permission group to which the desktop user belongs. |
|
created_at |
No |
String |
Creation time. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
key |
Yes |
String |
Specifies the tag key. This parameter cannot be left blank and can contain a maximum of 128 Unicode characters. The value can contain uppercase letters, lowercase letters, digits, hyphens (-), and underscores (_). The value cannot contain the following characters: =*<>,|/. |
|
value |
No |
String |
Value of a tag, which can contain a maximum of 43 Unicode characters. The value can contain uppercase letters, lowercase letters, digits, hyphens (-), and underscores (_). The value cannot contain the following characters: =*<>,|/. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
autoscale_type |
No |
String |
Auto scaling type. The options are as follows: ACCESS_CREATED: created during access; AUTO_CREATED: auto scaling. |
|
max_auto_created |
No |
Integer |
Maximum number of desktops that can be automatically created. |
|
min_idle |
No |
Integer |
Number of reserved idle desktops. |
|
once_auto_created |
No |
Integer |
Number of desktops that can be automatically created at a time. (deprecated) |
|
min_retention |
No |
Integer |
Minimum number of desktops. |
|
idle_retention_duration |
No |
Integer |
Idle desktop reservation duration, in minutes. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
job_id |
String |
ID of the cloud desktop creation task. |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code, which is returned upon failure. |
|
error_msg |
String |
Error message. |
|
error_detail |
String |
Error details. |
|
encoded_authorization_message |
String |
Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason. |
Status code: 401
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code, which is returned upon failure. |
|
error_msg |
String |
Error message. |
|
error_detail |
String |
Error details. |
|
encoded_authorization_message |
String |
Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason. |
Status code: 403
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code, which is returned upon failure. |
|
error_msg |
String |
Error message. |
|
error_detail |
String |
Error details. |
|
encoded_authorization_message |
String |
Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason. |
Status code: 404
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code, which is returned upon failure. |
|
error_msg |
String |
Error message. |
|
error_detail |
String |
Error details. |
|
encoded_authorization_message |
String |
Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason. |
Status code: 500
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Error code, which is returned upon failure. |
|
error_msg |
String |
Error message. |
|
error_detail |
String |
Error details. |
|
encoded_authorization_message |
String |
Encrypted detailed reason for rejection. You can call the API decode-authorization-message of STS to decrypt the reason. |
Example Requests
POST /v2/0bec5db98280d2d02fd6c00c2de791ce/desktop-pools
{
"name" : "POOL01",
"type" : "STATIC",
"size" : 50,
"image_type" : "gold",
"image_id" : "a866298d-67db-44b0-a1f1-9d09bdddc20f",
"root_volume" : {
"type" : "SAS",
"size" : 80
},
"availability_zone" : "az3.manage.x86",
"subnet_ids" : [ "5dee0216-2260-47c2-9368-98a27d910e55" ],
"product_id" : "workspace.c2.large.windows.2"
}
Example Responses
Status code: 200
Response to the request for creating a desktop pool.
{
"job_id" : "3979904c-7beb-4f34-835f-2fa989a5550a"
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Response to the request for creating a desktop pool. |
|
400 |
The request cannot be understood by the server due to malformed syntax. |
|
401 |
Authentication failed. |
|
403 |
No operation permissions. |
|
404 |
No resources found. |
|
500 |
An internal service error occurred. For details about the error code, see the error code description. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot