获取BEC服务详情
更新时间:2021-08-04
接口描述
本接口用于获取指定BEC容器服务的详情。
请求结构
GET /v1/service/{serviceId} HTTP/1.1
Host: bec.baidubce.com
Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 | 类型 | 是否必需 | 参数位置 | 描述 |
---|---|---|---|---|
serviceId | String | 是 | QueryString参数 | BEC服务ID |
响应头域
除公共头域外,无其它特殊头域。
响应参数
参数名称 | 类型 | 描述 |
---|---|---|
result | ServiceDetailsVo | BEC服务详情 |
success | Boolean | 操作是否成功。true:成功;false:失败。 |
错误码
请参照错误返回章节的内容。
请求示例
GET /v1/service/s-gwqqa76g HTTP/1.1
Host: bec.baidubce.com
Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
响应示例
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Date: Wed, 08 Jul 2015 03:28:11 GMT
x-bce-request-id: d8752367-38e8-45e4-b4c7-e53be3137ce5
Server: BWS
{
"createTime": "2019-11-18T11:15:10Z",
"deployInstances": [
{
"region": "EAST_CHINA",
"replicas": 2,
"serviceProvider": "CHINA_TELECOM"
},
{
"region": "EAST_CHINA",
"replicas": 2,
"serviceProvider": "CHINA_MOBILE"
}
],
"lastUpdateTime": null,
"resourceBriefVos": [
{
"containers": [
{
"args": null,
"commands": null,
"cpu": 0,
"envs": null,
"imageAddress": "nginx",
"imageVersion": "latest",
"memory": 0,
"name": "container01",
"ports": null,
"volumeMounts": null,
"workingDir": null
}
],
"createTime": "2019-12-07T14:54:47Z",
"deployInstance": {
"region": "EAST_CHINA",
"replicas": 2,
"serviceProvider": "CHINA_MOBILE"
},
"imageList": [
"nginx:latest"
],
"labels": null,
"lastUpdateTime": null,
"resourceId": "sts-gwqqa76g-1-m",
"resourceName": "afdfa",
"runningPods": 2,
"serviceId": "s-gwqqa76g",
"serviceName": "hdtest",
"status": "RUNNING",
"totalCpu": 2,
"totalMem": 4,
"totalPods": 2
},
{
"containers": [
{
"args": null,
"commands": null,
"cpu": 0,
"envs": null,
"imageAddress": "nginx",
"imageVersion": "latest",
"memory": 0,
"name": "container01",
"ports": null,
"volumeMounts": null,
"workingDir": null
}
],
"createTime": "2019-11-18T03:15:10Z",
"deployInstance": {
"region": "EAST_CHINA",
"replicas": 2,
"serviceProvider": "CHINA_TELECOM"
},
"imageList": [
"nginx:latest"
],
"labels": null,
"lastUpdateTime": null,
"resourceId": "sts-gwqqa76g-1-t",
"resourceName": "afdfa",
"runningPods": 2,
"serviceId": "s-gwqqa76g",
"serviceName": "hdtest",
"status": "RUNNING",
"totalCpu": 2,
"totalMem": 4,
"totalPods": 2
}
],
"serviceId": "s-gwqqa76g",
"serviceName": "hdtest",
"status": "RUNNING",
"totalCpu": 4,
"totalDisk": 0,
"totalMem": 8
}
Model对象定义
ServiceDetailsVo
参数名称 | 类型 | 描述 |
---|---|---|
serviceId | String | BEC服务ID |
serviceName | String | BEC服务名称 |
status | String | 资源状态(STOP、RUNNING、PENDING、TERMINATING、FAILED、SUCCEEDED、UNKNOWN、TERMINATED、WAITING) |
totalCpu | float | CPU总量 |
totalMem | float | 内存总量 |
totalDisk | Integer | 磁盘总量 |
resourceBriefVos | List<ResourceBriefVo> | POD详情 |
deployInstances | List<DeploymentInstance> | 部署实例信息 |
createTime | Timestamp | 创建时间 |
lastUpdateTime | Timestamp | 更新时间 |
DeploymentInstance
参数名称 | 类型 | 描述 |
---|---|---|
region | String | 地域(CENTRAL_CHINA、EAST_CHINA、NORTH_CHINA、SOUTH_CHINA、NORTH_EAST、NORTH_WEST、SOUTH_WEST) |
serviceProvider | String | 服务运营商(CHINA_MOBILE、CHINA_UNICOM、CHINA_TELECOM) |
replicas | Integer | 副本数 |
ResourceBriefVo
参数名称 | 类型 | 描述 |
---|---|---|
serviceId | String | 服务ID |
serviceName | String | 服务名称 |
resourceId | String | 资源ID |
resourceName | String | 资源名称 |
deployInstance | DeploymentInstance | 部署实例信息 |
status | ResourceStatus | 资源状态 |
containers | List<ContainerDetails> | 容器详情 |
createTime | String | 创建时间 |
lastUpdateTime | String | 上次更新时间 |
ResourceStatus
编码 | 描述 |
---|---|
STARTING | 启动中 |
RUNNING | 运行中 |
PENDING | 调度中 |
EXCEPTION | 异常 |
FAILED | 错误 |
UNKNOWN | 未知 |
TERMINATED | 中止 |
WAITING | 等待 |
STOP | 停止 |
BINDING | 绑定中 |
STOPPING | 关机中 |
TERMINATING | 终止中 |
NORMAL | 正常 |