Queries desktops.
Function
Queries desktop VMs.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
URI
GET /v2/{project_id}/desktops
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
user_name |
No |
String |
User to whom the desktop belongs. |
computer_name |
No |
String |
Desktop name. |
desktop_ip |
No |
String |
Desktop IP address. |
offset |
No |
Integer |
Start position for pagination query. The value starts from 0. |
limit |
No |
Integer |
Pagination query. The value ranges from 0 to 1000 and defaults to 1000. |
pool_id |
No |
String |
Desktop pool ID. Use commas (,) to separate multiple desktop pool IDs. |
enterprise_project_id |
No |
String |
Enterprise project ID. |
desktop_type |
No |
String |
Desktop type. If this parameter is left empty, all desktops are queried. Use commas (,) to separate multiple types.
|
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. It can be obtained by calling the IAM API that is used to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
Content-Type |
No |
String |
MIME type of the request body. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
total_count |
Integer |
Total number of desktops. |
desktops |
Array of SimpleDesktopInfo objects |
Desktop information. |
Parameter |
Type |
Description |
---|---|---|
desktop_id |
String |
Desktop ID. |
computer_name |
String |
Computer name. |
created |
String |
Creation time. |
ip_address |
String |
Desktop IP address. |
user_name |
String |
Username. |
attach_user_infos |
Array of AttachInstancesUserInfo objects |
List of users to whom desktops have been assigned. |
user_group |
String |
Permission group. |
sid |
String |
SID of the desktop. |
ou_name |
String |
OU name. |
enterprise_project_id |
String |
Enterprise project ID. |
in_maintenance_mode |
Boolean |
In administrator maintenance mode or not. |
Parameter |
Type |
Description |
---|---|---|
user_id |
String |
User ID. |
user_name |
String |
User to which a desktop belongs. After a desktop is assigned, the user can log in to the desktop. Only uppercase letters, lowercase letters, digits, hyphens (-), and underscores (_) are allowed. When the domain type is LITE_AD, the value contains 1 to 20 characters starting with a lowercase or uppercase letter. When the domain type is LOCAL_AD, the value contains 1 to 20 characters starting with a lowercase or uppercase letter or digit. |
user_group |
String |
User group to which the desktop user belongs.
|
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code, which is returned upon failure. |
error_msg |
String |
Error description. |
Status code: 401
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code, which is returned upon failure. |
error_msg |
String |
Error description. |
Status code: 403
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code, which is returned upon failure. |
error_msg |
String |
Error description. |
Status code: 404
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code, which is returned upon failure. |
error_msg |
String |
Error description. |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code, which is returned upon failure. |
error_msg |
String |
Error description. |
Example Requests
/v2/bcae3e673fd04716a3b9dacdf58ca336/desktops
Example Responses
Status code: 200
Response to the request for querying cloud desktops.
{ "total_count" : 2, "desktops" : [ { "desktop_id" : "a6f6e2d1-cc62-46f3-865b-9ae6ae0afde0", "computer_name" : "ZRYUAN107", "created" : "2022-02-23 04:02:07", "ip_address" : "10.0.9.25", "user_name" : "zryuan1", "user_group" : "administrators", "sid" : "3db90102-d11d-4d13-9a96-104696d3c6a3", "in_maintenance_mode" : false }, { "desktop_id" : "248077ea-bb64-4e58-b5e8-6b686600920e", "computer_name" : "CHENYC01", "created" : "2022-02-22 12:14:59", "ip_address" : "10.0.9.103", "user_name" : "chenyc", "user_group" : "administrators", "sid" : "352cf09d-ee15-4ef1-aa49-8d673972b4e6", "in_maintenance_mode" : true } ] }
Status Codes
Status Code |
Description |
---|---|
200 |
Response to the request for querying cloud desktops. |
400 |
The request cannot be understood by the server due to malformed syntax. |
401 |
Authentication failed. |
403 |
You do not have required permissions. |
404 |
No resource 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