# api状态
# 获取集群中所有API的列表
# 请求 URL:
http://host:port/heycloud/api/monitor/api/list
# 请求方式:
- GET
# 请求 Header:
字段 | 类型 | 是否必选 | 说明 |
---|---|---|---|
x-heycloud-account-id | String | 否 | 用户的唯一标识符 |
x-heycloud-admin-session | String | 是 | 用户登录后获得的访问令牌 |
# 请求示例
GET http://host:port/heycloud/api/monitor/api/list
# 正确响应示例:
{
"result": [
{
"id": "3336eb1a-7b4d-4db6-85c6-4bf70d90893f",
"title": "基础功能",
"name": "base",
"createdAt": "2021-02-01T02:20:36.735Z"
},
{
"id": "adbef970-5eec-4fcc-ba3c-f7df8ba97375",
"title": "数据导入导出",
"name": "io",
"createdAt": "2021-02-01T02:20:36.735Z"
},
{
"id": "7805b259-9f1c-4f5e-9736-cde1f608638a",
"title": "渲染引擎",
"name": "render",
"createdAt": "2021-02-01T02:20:36.735Z"
}
]
}
# 错误响应示例:
{
"error": "ERROR",
"message": "错误信息",
}
# 获取集群中所有API的概览
# 请求 URL:
http://host:port/heycloud/api/monitor/api/summary
# 请求方式:
- GET
# 请求 Header:
字段 | 类型 | 是否必选 | 说明 |
---|---|---|---|
x-heycloud-account-id | String | 否 | 用户的唯一标识符 |
x-heycloud-admin-session | String | 是 | 用户登录后获得的访问令牌 |
# 请求示例
GET http://host:port/heycloud/api/monitor/api/summary
# 正确响应示例:
{
"result": [
{
"id": "3336eb1a-7b4d-4db6-85c6-4bf70d90893f",
"title": "基础功能",
"name": "base",
"metrics": {
"available": 1
}
},
{
"id": "adbef970-5eec-4fcc-ba3c-f7df8ba97375",
"title": "数据导入导出",
"name": "io",
"metrics": {
"available": 1
}
},
{
"id": "7805b259-9f1c-4f5e-9736-cde1f608638a",
"title": "渲染引擎",
"name": "render",
"metrics": {
"available": 1
}
}
]
}
# 错误响应示例:
{
"error": "ERROR",
"message": "错误信息",
}
# 获取某个API的状态
# 请求 URL:
http://host:port/heycloud/api/monitor/api/:apiId/status
# 请求方式:
- GET
# 请求 Header:
字段 | 类型 | 是否必选 | 说明 |
---|---|---|---|
x-heycloud-account-id | String | 否 | 用户的唯一标识符 |
x-heycloud-admin-session | String | 是 | 用户登录后获得的访问令牌 |
# 请求参数:
参数名称 | 类型 | 是否必须 | 默认值 | 说明 |
---|---|---|---|---|
apiId | String | 是 | - | Api ID |
# 请求示例
GET http://host:port/heycloud/api/monitor/api/xxxxx/status
# 正确响应示例:
{
"result": [
{
"id": "3336eb1a-7b4d-4db6-85c6-4bf70d90893f",
"title": "基础功能",
"name": "base",
"createdAt": "2021-02-01T02:20:36.735Z",
"metrics": {
"probe": {
"duration": 0.0142411,
"success": "1"
}
}
}
]
}
# 错误响应示例:
{
"error": "ERROR",
"message": "错误信息",
}
# 获取所有集群中API的历史信息,默认返回之前一个小时的历史
# 请求 URL:
http://host:port/heycloud/api/monitor/api/:apiId/history
# 请求方式:
- GET
# 请求 Header:
字段 | 类型 | 是否必选 | 说明 |
---|---|---|---|
x-heycloud-account-id | String | 否 | 用户的唯一标识符 |
x-heycloud-admin-session | String | 是 | 用户登录后获得的访问令牌 |
# 请求参数:
字段 | 可选值 | 类型 | 是否必选 | 说明 |
---|---|---|---|---|
apiId | - | String | 是 | Api ID |
start | - | Number | 是 | 开始的 UNIX 时间戳,其单位为秒,默认值为当前之前一个小时 |
end | - | Number | 是 | 结束的 UNIX 时间戳,其单位为秒,默认值为当前时间 |
step | - | Number | 是 | 采样的间隔,单位秒,默认值为 60 |
# 请求示例
GET http://host:port/heycloud/api/monitor/api/xxxxx/history?start=xxx&end=xxx&step=xxx
# 正确响应示例:
{
"result": [
{
"id": "3336eb1a-7b4d-4db6-85c6-4bf70d90893f",
"title": "基础功能",
"name": "base",
"createdAt": "2021-02-01T02:20:36.735Z",
"metrics": {
"probe": {
"duration": [
{
"time": 1612148901.743,
"value": 0.0060116
},
{
"time": 1612148961.743,
"value": 0.0055341
}
],
"success": [
{
"time": 1612148901.743,
"value": 0.0060116
},
{
"time": 1612148961.743,
"value": 0.0055341
},
{
"time": 1612149021.743,
"value": 0.0074531
}
]
}
}
}
]
}
# 错误响应示例:
{
"error": "ERROR",
"message": "错误信息",
}