获取定时任务执行报告
Headers
Authorization: OAuth the-session-uuidCurl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/scheduler/report?startTime=1.5856704E12&intervalTimeUnit=Month&range=4.0&schedulerJobTypes=vmBackup参数列表
名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
startTime | long | query | 报告开始时间 |
| 3.9.0 |
intervalTimeUnit | String | query | 间隔时间单位 |
| 3.9.0 |
range | int | query | 报告时间范围 |
| 3.9.0 |
schedulerJobTypes | List | query | 定时任务类型 |
| 3.9.0 |
systemTags (可选) | List | query |
|
| 3.9.0 |
userTags (可选) | List | query |
|
| 3.9.0 |
API返回
返回示例
{
"successRecords": [
100.0,
99.0,
50.0,
0.0
],
"failureRecords": [
0.0,
1.0,
34.0,
0.0
],
"partialSuccessRecords": [
0.0,
0.0,
16.0,
0.0
],
"waitingRecords": [
0.0,
0.0,
0.0,
100.0
]
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| successRecords | List | 成功记录 | 3.9.0 |
| failureRecords | List | 失败记录 | 3.9.0 |
| partialSuccessRecords | List | 部分成功记录 | 3.9.0 |
| waitingRecords | List | 等待执行完成记录 | 3.9.0 |
| success | boolean | 3.9.0 | |
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 3.9.0 |
| error | ErrorCode | 详情参考error | 3.9.0 |
error
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 3.9.0 |
| description | String | 错误的概要描述 | 3.9.0 |
| details | String | 错误的详细信息 | 3.9.0 |
| elaboration | String | 保留字段,默认为null | 3.9.0 |
| opaque | LinkedHashMap | 保留字段,默认为null | 3.9.0 |
| cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 3.9.0 |
error
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 3.9.0 |
| description | String | 错误的概要描述 | 3.9.0 |
| details | String | 错误的详细信息 | 3.9.0 |
| elaboration | String | 保留字段,默认为null | 3.9.0 |
| opaque | LinkedHashMap | 保留字段,默认为null | 3.9.0 |
| cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 3.9.0 |
SDK示例
Java SDK
GetSchedulerExecutionReportAction action = new GetSchedulerExecutionReportAction();
action.startTime = 1.5856704E12;
action.intervalTimeUnit = "Month";
action.range = 4.0;
action.schedulerJobTypes = asList("vmBackup");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetSchedulerExecutionReportAction.Result res = action.call();Python SDK
GetSchedulerExecutionReportAction action = GetSchedulerExecutionReportAction()
action.startTime = 1.5856704E12
action.intervalTimeUnit = "Month"
action.range = 4.0
action.schedulerJobTypes = [vmBackup]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetSchedulerExecutionReportAction.Result res = action.call()