{"base_path":null,"components":null,"consumes":"[\"application/json\"]","definitions":{"BaseResponse":{"description":"API响应基类","properties":{"error_code":{"description":"错误码。","maxLength":12,"minLength":0,"type":"string"},"error_msg":{"description":"错误描述。","maxLength":1000,"minLength":0,"type":"string"}}},"DesktopUsedHoursInfo":{"description":"桌面使用时间信息。","properties":{"desktop_id":{"description":"桌面Id。","readOnly":true,"type":"string"},"desktop_username":{"description":"使用的用户。","readOnly":true,"type":"string"},"used_info_list":{"description":"桌面使用时间列表。","items":{"$ref":"#/definitions/DesktopUsedInfo"},"maxItems":2000,"minItems":0,"type":"array","x-maxLength":2000,"x-minLength":0}}},"DesktopUsedInfo":{"description":"桌面使用时间。","properties":{"date":{"description":"日期,格式:yyyy-MM-dd(UTC时间)。","readOnly":true,"type":"string"},"use_time":{"description":"总共在线时间单位:小时数(h),精确到两位小数,如:1.32。","readOnly":true,"type":"string"}}},"ListUsedDesktopInfoReq":{"description":"查询使用桌面时长请求。","properties":{"desktop_ids":{"description":"桌面id集合。","items":{"maxLength":255,"minLength":0,"type":"string"},"maxItems":2000,"minItems":0,"type":"array"},"desktop_username":{"description":"若传桌面的用户名,则查询使用时间只有该用户的使用时间。","maxLength":255,"minLength":0,"type":"string"},"end_time":{"description":"结束时间,格式:yyyy-MM-dd(UTC时间,不传查默认最近15天)最多查31天数据。","maxLength":255,"minLength":0,"type":"string"},"group_by_type":{"default":"DAY","description":"统计方式,不传则默认按天。可选值为:\n- DAY: 按天。\n- HOUR: 按小时。","enum":["DAY","HOUR"],"maxLength":55,"minLength":0,"type":"string"},"limit":{"description":"查询结果中想要返回的信息条目数量,用于分页查询,取值范围0-100,默认值100。","maximum":100,"minimum":0,"type":"integer"},"offset":{"description":"从查询结果中的第几条数据开始返回,用于分页查询,取值范围0-2000,默认从0开始。","maximum":2000,"minimum":0,"type":"integer"},"start_time":{"description":"开始时间,格式:yyyy-MM-dd(UTC时间,不传查默认最近15天)最多查31天数据。","maxLength":255,"minLength":0,"type":"string"}}},"ListUsedDesktopInfoRsp":{"description":"查询使用桌面使用时长响应。","properties":{"desktop_used_info_list":{"description":"桌面使用信息(以桌面Id划分)。","items":{"$ref":"#/definitions/DesktopUsedHoursInfo"},"maxItems":2000,"minItems":0,"type":"array","x-maxLength":2000,"x-minLength":0},"total_count":{"description":"总数。","format":"int32","maximum":2000,"minimum":0,"type":"integer"}}}},"description":null,"group_id":"7383c32d5d5e4d0481c071faeb994404","host":"workspace.cn-north-4.myhuaweicloud.com","id":"eff382dcad1441b0be87c644e646a956","info_version":"v2","method":"post","name":"ListUsedDesktopInfo","parameters":{},"paths":{"/v2/{project_id}/desktops/statistics/used":{"post":{"description":"查询使用桌面的时长。","operationId":"ListUsedDesktopInfo","parameters":[{"description":"项目ID。","in":"path","maxLength":255,"minLength":1,"name":"project_id","required":true,"type":"string","x-example":"2b31ed520xxxxxxebedb6e57xxxxxxxx"},{"description":"发送的实体的MIME类型。","in":"header","maxLength":255,"minLength":1,"name":"Content-Type","required":false,"type":"string","x-example":"application/json"},{"description":"用户Token。\n通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)。","in":"header","maxLength":40000,"minLength":1,"name":"X-Auth-Token","required":true,"type":"string","x-example":"MIIDkgYJKoZIhvcNAQcCoIIDgzCCXXXXXX...","x-is-registered":"N"},{"description":"查询使用桌面的时长请求。","in":"body","name":"ListUsedDesktopInfoRequestBody","required":false,"schema":{"$ref":"#/definitions/ListUsedDesktopInfoReq"}}],"responses":{"200":{"description":"查询使用桌面的时长响应。","examples":{"application/json":{"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}},"schema":{"$ref":"#/definitions/ListUsedDesktopInfoRsp"}},"default":{"description":"错误响应。","schema":{"$ref":"#/definitions/BaseResponse"}}},"schemes":["https"],"summary":"查询使用桌面的时长","tags":["DesktopStatistics"],"x-apiexplorer-hide":"N","x-apig-group":"public","x-apigateway-request-type":"public","x-is-registered":"Y","x-request-examples-text-1":{"desktop_ids":["c6e6dbd7-c950-471d-a6a7-01d0fb62f450","d5367f84-1d64-498e-9b92-093002ac6ce9"],"end_time":"2022-12-15","start_time":"2022-12-09"},"x-support-sdk":"Y"}}},"product_short":"Workspace","region_id":"cn-north-4","schemes":["HTTPS"],"security_definitions":null,"summary":"查询使用桌面的时长","tags":"桌面统计","uri":null,"version":"2.0"}