根据资源实例获取定时任务执行记录列表

接口说明

面向政企版租户开放根据资源实例获取定时任务执行记录列表 业务逻辑:可根据任务类型、执行结果搜索定时任务记录 限流:根据租户实现用户级别的限流,限制为100次每秒


推荐使用API Explorer调试

API Explorer支持接口在线可视化调用,同时自动生成动态代码示例,搭配OpenAPI SDK无需计算签名实现接口快速集成。

URL

POST https://ecloud.10086.cn/api/Computer_api/cem_openapi/ccacem/api/v1/machine/getTaskRecordListByInstanceId

请求参数

Body

参数名称
类型
必填
描述
reqDto
QueryResourceTaskRecordApiReq
是

请求入参

currentPage
integer(int32)
否

当前页

pageSize
integer(int32)
否

分页大小

instanceId
string
是

资源实例id

taskType
string
否

任务类型 shutdown/restart/available

status
string
否

执行结果 成功:success 执行中:processing 等待:waiting 失败:fail

请求示例

POST https://ecloud.10086.cn/api/Computer_api/cem_openapi/ccacem/api/v1/machine/getTaskRecordListByInstanceId
{
	"currentPage":1,
	"pageSize":10,
	"instanceId":"CCA-b4af70ef36574263ab80a2887c416b7a",
	"taskType":"available",
	"status":"fail"
}

返回参数

返回码:200
OK
参数名称
类型
描述
body
PageReturnEntity«QueryResourceTaskRecordApiResp»

请求成功时返回的数据

data
<QueryResourceTaskRecordApiResp> array

数据

instanceId
string

资源实例id

machineId
string

桌面id

policyUid
string

策略id

taskType
string

任务类型

executeTime
string

执行时间

status
string

执行结果

modifiedTime
string

修改时间

createdTime
string

创建时间

totalCount
integer(int32)

总行数

errorCode
string

统一错误码

errorMessage
string

错误码提示信息

requestId
string

每个请求的序列号

state
enum(OK,ERROR,EXCEPTION,FORBIDDEN,REMAINING,TIMEOUT)

返回状态码;返回正常:OK,返回错误:ERROR,返回异常:EXCEPTION,需要告警实现的:ALARM,禁止访问:FORBIDDEN

返回示例

返回码:200
OK
{
	"state":"OK",
	"body":{
		"data":[
			{
				"instanceId":"CCA-b4af70ef36574263ab80a2887c416b7a",
				"machineId":"ed7d4db2-33d7-454c-981d-4f2762f1311c",
				"policyUid":"ro-e4c7847bf8654408880e8578d718da26",
				"taskType":"available",
				"executeTime":"2025-04-14 14:10:00",
				"status":"fail",
				"modifiedTime":"2025-04-14 14:10:06",
				"createdTime":"2025-04-14 14:05:00"
			}
		],
		"totalCount":1
	},
	"errorCode":"200",
	"errorMessage":"",
	"requestId":"e5185533315ea947"
}
本文档内容整理自移动云官方帮助中心(查看原文),仅供参考。