查询Pod的状态
更新时间:2020-01-03
接口描述
查询Pod的状态。 |
请求结构
GET /api/v1/{namespace}/pods/{name} HTTP/1.1
Host: bec.bdcloudapi.com
Content-Type: application/json; charset=utf-8
Authorization: authorization string
请求头域
除公共头域外,无其它特殊头域。
请求参数
表1 Path参数描述
参数 | 类型 | 参数位置 | 描述 | 是否必须 |
---|---|---|---|---|
name | String | URI参数 | Name of the Pod. | 必须 |
namespace | String | URI参数 | Object name and auth scope, such as for teams and projects. | 必须 |
表1 Query参数描述
参数 | 类型 | 描述 | 是否必须 |
---|---|---|---|
pretty | String | If 'true', then the output is pretty printed. | 非必须 |
exact | String | Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'. | 非必须 |
export | String | Should this value be exported. Export strips fields that a user cannot specify. | 非必须 |
响应头域
除公共头域外,无其它特殊头域。
响应参数
响应参数的详细描述请参见 数据结构 表
错误码
请参照前文的网关错误码和平台错误码。
请求示例
GET /api/v1/namespaces/test-namespace/pods/test-pod/status HTTP/1.1
Host: bec.bdcloudapi.com
Content-Type: application/json; charset=utf-8
Authorization: bce-auth-v1/318857a8f08b11e9845ca7e54775a0c2/2019-10-17T03:07:21Z/1800/host/212eef8cfe1ac94be56c4afedb9360bba621ef646c3c8288971d36801d70501a
响应示例
{
"conditions": [
{
"lastProbeTime": null,
"lastTransitionTime": 1575549353000,
"message": null,
"reason": null,
"status": "True",
"type": "Initialized"
},
{
"lastProbeTime": null,
"lastTransitionTime": 1575549375000,
"message": null,
"reason": null,
"status": "True",
"type": "Ready"
},
{
"lastProbeTime": null,
"lastTransitionTime": 1575549375000,
"message": null,
"reason": null,
"status": "True",
"type": "ContainersReady"
},
{
"lastProbeTime": null,
"lastTransitionTime": 1575549353000,
"message": null,
"reason": null,
"status": "True",
"type": "PodScheduled"
}
],
"containerStatuses": [
{
"containerID": "containerd://71405312ee08f4157bd3379021fd4d3cd461de1e2780c7b895f525647b8798ee",
"image": "docker.io/library/centos:centos7",
"imageID": "docker.io/library/centos@sha256:4a701376d03f6b39b8c2a8f4a8e499441b0d567f9ab9d58e4991de4472fb813c",
"lastState": {
"running": null,
"terminated": null,
"waiting": null
},
"name": "container01",
"ready": true,
"restartCount": 0,
"state": {
"running": {
"startedAt": 1575549374000
},
"terminated": null,
"waiting": null
}
}
],
"hostIP": "121.227.168.8",
"initContainerStatuses": null,
"message": null,
"nominatedNodeName": null,
"phase": "Running",
"podIP": "10.244.1.27",
"qosClass": "Guaranteed",
"reason": null,
"startTime": 1575549353000
}