查询服务详情
此接口用于查询服务的详细信息。
接口描述
通信协议:HTTP
URL:GET /api/v1/overview/platform/:type/:id
传参方式:path
请求参数
字段名 | 类型 | 是否必填 | 说明 |
---|---|---|---|
type | string | 是 | 资源类型。其值为 service 服务 |
id | string | 是 | 资源 ID |
响应参数
字段名 | 类型 | 说明 |
---|---|---|
type | string | 资源类型,其值固定为 service 服务 |
id | string | 资源 ID |
health | boolean | 服务是否健康。true 表示健康,false 表示不健康 |
name | string | 资源名称 |
children | Node[ ] | 节点数据 |
Node
字段名 | 类型 | 说明 |
---|---|---|
nodeId | string | 节点 ID |
nodeName | string | 节点名称 |
status | string | 节点状态。online 表示在线;offline 表示离线 |
children | Container[ ] | 容器数据 |
Container
字段名 | 类型 | 说明 |
---|---|---|
id | string | 资源 ID |
name | string | 资源名称 |
type | string | 资源类型。container 表示容器 |
status | string | 资源状态。running 表示运行;stop 表示停止 |
self | boolean | 是否为当前服务 |
请求示例
curl --location --request GET 'http://localhost:3001/api/v1/overview/platform/service/64edf615-2aaa-4bc6-912a-90195379b3da'
响应示例
{
"status": 200,
"message": "success",
"fieldErrors": null,
"data": {
"id": "64edf615-2aaa-4bc6-912a-90195379b3da",
"name": "test2",
"status": "complete",
"pro_record_id": "79500bdd-77b2-42c7-83ed-29ccc71bdb67",
"type": "service",
"health": true,
"children": [
{
"nodeId": "aa2123c8-2cef-4cdc-9ccf-df094584145b",
"nodeName": "node-base-28",
"status": "running",
"children": [
{
"id": "79500bdd-77b2-42c7-83ed-29ccc71bdb67",
"node_id": "aa2123c8-2cef-4cdc-9ccf-df094584145b",
"container_id": "a5d9503bfe680c3282cc3b80e700883d11f719a9173caff9bff882d37c1b2c38",
"config": "{\"hostname\":\"auto\",\"publish\":[{\"netType\":\"tcp\",\"hostPort\":11211,\"containerPort\":11211}],\"env\":[\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\",\"MEMCACHED_VERSION=1.6.12\",\"MEMCACHED_SHA1=40d43e98f149e13e6c81eee813e6734f23413a01\"],\"cmd\":[\"memcached\"],\"name\":\"auto\",\"restart\":\"no\",\"network\":\"bridge\",\"memory\":0,\"healthCmd\":[]}",
"name": "auto-QelTs-",
"type": "container",
"status": "running",
"self": true
}
]
}
]
}
}
错误码
具体请参见 错误码说明。