操作记录
更新时间:2026-07-23
接口总览
| 接口名称 | 说明 | 方法 | 路径 |
|---|---|---|---|
| DescribeClusterOperations | 查询集群操作记录 | POST | /v2/bcc/cluster/operation/list |
| DescribeServiceOperations | 查询服务操作记录 | POST | /v2/bcc/service/actionrecord/list |
| DescribeScalingActivities | 查询弹性伸缩日志 | POST | /v2/bcc/autoScaling/cluster/[clusterId]/executions/list |
DescribeClusterOperations 查询集群操作记录
接口描述
分页查询集群级别的操作记录(如创建、扩容、释放等订单操作)。
请求结构
Plain Text
1POST /v2/bcc/cluster/operation/list HTTP/1.1
2Content-Type: application/json
3
4{
5 "clusterId": clusterId,
6 "pageNo": pageNo,
7 "pageSize": pageSize
8}
请求参数
| 名称 | 类型 | 是否必须 | 参数位置 | 参数描述 |
|---|---|---|---|---|
| clusterId | String | 是 | RequestBody | 集群 ID |
| pageNo | Int | 否 | RequestBody | 页码,默认为 1 |
| pageSize | Int | 否 | RequestBody | 每页数量,默认为 10 |
响应参数
| 参数名 | 参数类型 | 参数描述 |
|---|---|---|
| success | Boolean | 请求是否成功 |
| status | Int | HTTP 状态码 |
| page.pageNo | Int | 当前页码 |
| page.pageSize | Int | 每页数量 |
| page.totalCount | Int | 总记录数 |
| page.orderBy | String | 排序字段(本接口不返回,固定为空) |
| page.order | String | 排序方向(本接口不返回,固定为空) |
| page.result | List |
集群操作记录列表 |
请求示例
JSON
1{
2 "clusterId": "0181b994-576a-4a00-b04e-f6fa9d5eee48",
3 "pageNo": 1,
4 "pageSize": 10
5}
响应示例
JSON
1{
2 "success": true,
3 "status": 200,
4 "page": {
5 "pageNo": 1,
6 "pageSize": 10,
7 "totalCount": 1,
8 "result": [
9 {
10 "orderId": "orderid",
11 "status": "success",
12 "startTime": "2026-06-16T12:32:32Z",
13 "opType": "NEW",
14 "spentTime": 4,
15 "operator": "root",
16 "cancelable": false,
17 "operationId": "",
18 "hint": ""
19 }
20 ]
21 }
22}
DescribeServiceOperations 查询服务操作记录
接口描述
分页查询服务级别的操作记录(启停、配置下发等)。
请求结构
Plain Text
1POST /v2/bcc/service/actionrecord/list HTTP/1.1
2Content-Type: application/json
3
4{
5 "clusterId": clusterId,
6 "serviceName": serviceName,
7 "startTime": startTime,
8 "status": status,
9 "keyword": keyword,
10 "keywordType": keywordType,
11 "orderBy": orderBy,
12 "order": order,
13 "pageNo": pageNo,
14 "pageSize": pageSize
15}
请求参数
| 名称 | 类型 | 是否必须 | 参数位置 | 参数描述 | |
|---|---|---|---|---|---|
| clusterId | String | 是 | RequestBody | 集群 ID | |
| serviceName | String | 否 | RequestBody | 服务名称,默认为空,取值为 ALL(所有服务),SPARK/HDFS 等 | |
| startTime | Time | 否 | RequestBody | 起始时间,默认为空;UTC 时间,示例 2026-06-10T07:34:45.591Z | |
| status | String | 否 | RequestBody | 按状态过滤,默认为空,取值为 ALL(所有状态),success/fail/pending | |
| keywordType | String | 否 | RequestBody | 搜索类型,默认为空,取值为 actionType(操作类型),operatorName(操作人) | |
| keyword | String | 否 | RequestBody | 搜索关键字,actionType 时,为 操作 + 服务名,比如 "RESTART SPARK" | |
| orderBy | String | 否 | RequestBody | 排序字段 | |
| order | String | 否 | RequestBody | 排序方向 | |
| pageNo | Int | 否 | RequestBody | 页码,默认为 1 | |
| pageSize | Int | 否 | RequestBody | 每页数量,默认为 10 |
响应参数
| 参数名 | 参数类型 | 参数描述 |
|---|---|---|
| success | Boolean | 请求是否成功 |
| status | Int | HTTP 状态码 |
| page.pageNo | Int | 当前页码 |
| page.pageSize | Int | 每页数量 |
| page.totalCount | Int | 总记录数 |
| page.orderBy | String | 排序字段 |
| page.order | String | 排序方向 |
| page.result | List |
服务操作记录列表 |
请求示例
JSON
1{
2 "clusterId": "0181b994-576a-4a00-b04e-f6fa9d5eee48",
3 "serviceName": "ALL",
4 "startTime": "2026-06-10T07:34:45.591Z",
5 "status": "ALL",
6 "keywordType": "actionType",
7 "keyword": "RestartService",
8 "orderBy": "startTime",
9 "order": "DESC",
10 "pageNo": 1,
11 "pageSize": 10
12}
响应示例
JSON
1{
2 "success": true,
3 "status": 200,
4 "page": {
5 "pageNo": 1,
6 "pageSize": 10,
7 "totalCount": 1,
8 "result": [
9 {
10 "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
11 "shortId": "a1b2c3d4",
12 "action": "RestartService",
13 "actionDesc": "重启服务",
14 "status": "success",
15 "statusDesc": "成功",
16 "operatorUserId": "root",
17 "operatorUserName": "root",
18 "startTime": "2026-06-16T12:32:32Z",
19 "spentTime": 12,
20 "description": ""
21 }
22 ]
23 }
24}
DescribeScalingActivities 查询弹性伸缩日志
接口描述
查询集群弹性伸缩的执行日志。
请求结构
Plain Text
1POST /v2/bcc/autoScaling/cluster/[clusterId]/executions/list HTTP/1.1
请求参数
| 名称 | 类型 | 是否必须 | 参数位置 | 参数描述 |
|---|---|---|---|---|
| clusterId | String | 是 | URL | 集群 ID |
响应参数
注意:本接口直接返回 result 数组,未使用分页结构。
| 参数名 | 参数类型 | 参数描述 |
|---|---|---|
| success | Boolean | 请求是否成功 |
| status | Int | HTTP 状态码 |
| result | List |
弹性伸缩日志列表 |
请求示例
Plain Text
1POST /v2/bcc/autoScaling/cluster/0181b994-576a-4a00-b04e-f6fa9d5eee48/executions/list HTTP/1.1
响应示例
JSON
1{
2 "success": true,
3 "status": 200,
4 "result": [
5 {
6 "policyId": "policy-001",
7 "policyName": "scale-out-on-cpu",
8 "policyAction": "EXPAND",
9 "policyStepNum": 2,
10 "policyType": "MONITOR",
11 "startTime": "2026-06-16T12:32:32Z",
12 "endTime": "2026-06-16T12:33:10Z",
13 "status": "Success",
14 "instancesNumAfterExecution": 5,
15 "before_exec_instance_num": 3,
16 "monitorIndicator": "CPU_UTILIZATION",
17 "monitorThreshold": 80
18 }
19 ]
20}
错误返回码
| HTTP Status | Code | Message | 说明 |
|---|---|---|---|
| 400 | MalformedJSON | The JSON provided is not well-formed | 请求体不是合法 JSON,参数绑定失败 |
| 400 | InvalidParameter | Invalid request parameter | 请求参数不合法(如 pageNo / pageSize 取值非法、cluster_id 缺失等) |
| 401 | Unauthorized | Check unauthorized | 身份未认证或认证失败 |
| 403 | AccessDenied | Access denied, please contact your administrator | 无 ReadPermission / ReadClusterPermission 权限,IAM 或 Console 鉴权拒绝 |
| 404 | ClusterNotFound | The cluster not found | clusterId 对应的集群不存在(DescribeScalingActivities 在校验集群存在性时可能返回) |
| 404 | ASLogNotFound | Auto scaling log not found | 未找到对应的弹性伸缩日志记录 |
| 429 | RequestLimited | Request frequency is too high, please slow down and try again later | 请求频率过高,被限流 |
| 500 | InternalError | Internal Server Error | 服务内部错误(如数据库查询失败、依赖服务异常等) |
| 503 | ServiceUnavailable | Service is unavailable | 依赖的下游服务不可用 |
评价此篇文章
