Querying the Desktop Usage Duration
Function
Query the desktop usage duration.
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}/desktops/statistics/used
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
Content-Type |
No |
String |
MIME type of the request body. |
X-Auth-Token |
Yes |
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 |
---|---|---|---|
desktop_ids |
No |
Array of strings |
Desktop ID set. |
start_time |
No |
String |
Start time. The format is yyyy-MM-dd (UTC time). If this parameter is not specified, data of the latest 15 days is queried by default. Data of a maximum of 31 days can be queried. |
end_time |
No |
String |
End time. The format is yyyy-MM-dd (UTC time). If this parameter is not specified, data of the latest 15 days is queried by default. Data of a maximum of 31 days can be queried. |
desktop_username |
No |
String |
If the username of the desktop is specified, only the usage time of the user is queried. |
offset |
No |
Integer |
Start position of the data record to be returned. This parameter is used for pagination query. The value ranges from 0 to 2000. The default value is 0. |
limit |
No |
Integer |
Number of information items to be returned in the query result. This parameter is used for pagination query. The value ranges from 0 to 100. The default value is 100. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
desktop_used_info_list |
Array of DesktopUsedHoursInfo objects |
Desktop usage information (divided by desktop ID). |
total_count |
Integer |
Total number. |
Parameter |
Type |
Description |
---|---|---|
desktop_id |
String |
Desktop ID. |
desktop_username |
String |
User. |
used_info_list |
Array of DesktopUsedInfo objects |
List of desktop usage time. |
Parameter |
Type |
Description |
---|---|---|
date |
String |
Date. The format is yyyy-MM-dd (UTC time). |
use_time |
String |
Total online duration, in hours. The value is accurate to two decimal places, for example, 1.32. |
Status code: default
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code, which is returned upon failure. |
error_msg |
String |
Error description. |
Example Requests
None
Example Responses
Status code: 200
Response to the request for querying the desktop usage duration.
{ "desktop_used_info_list" : [ { "desktop_id" : "c6e6dbd7-c950-471d-a6a7-01d0fb62f450", "used_info_list" : [ { "date" : "2022-12-09", "use_time" : 12.62 }, { "date" : "2022-12-10", "use_time" : 2.62 }, { "date" : "2022-12-11", "use_time" : 1.02 }, { "date" : "2022-12-12", "use_time" : 0 }, { "date" : "2022-12-13", "use_time" : 0 }, { "date" : "2022-12-14", "use_time" : 3.87 }, { "date" : "2022-12-15", "use_time" : 3.56 } ] }, { "desktop_id" : "d5367f84-1d64-498e-9b92-093002ac6ce9", "used_info_list" : [ { "date" : "2022-12-09", "use_time" : 10.56 }, { "date" : "2022-12-10", "use_time" : 1.38 }, { "date" : "2022-12-11", "use_time" : 0 }, { "date" : "2022-12-12", "use_time" : 0 }, { "date" : "2022-12-13", "use_time" : 0 }, { "date" : "2022-12-14", "use_time" : 3.87 }, { "date" : "2022-12-15", "use_time" : 3.56 } ] } ], "total_count" : 2 }
Status Codes
Status Code |
Description |
---|---|
200 |
Response to the request for querying the desktop usage duration. |
default |
Error response. |
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