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.
URI
POST /v2/{project_id}/desktop-pools
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
No |
String |
User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
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. Create a desktop in the specified AZ. If this parameter is not specified, the default AZ is used. |
product_id |
Yes |
String |
Package ID. |
flavor_id |
No |
String |
Product specification ID. This parameter is mandatory when the AZ is an edge AZ. |
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 SecurityGroup 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 |
Tags. |
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. |
resource_spec_code |
No |
String |
Specifications. |
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. |
user_group |
Yes |
String |
Specifies the user permission group to which the desktop user belongs.
|
created_at |
No |
String |
Creation time. The value is in UTC format, for example, 2022-05-11T11:45:42.000Z. |
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 |
When the number of idle desktops is less than the value of this parameter, desktops are automatically created. |
once_auto_created |
No |
Integer |
Number of desktops that can be automatically created at a time. |
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 description. |
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 description. |
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 description. |
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 description. |
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 description. |
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
{ "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