查询Pod的状态
更新时间:2020-01-03
接口描述
查询Pod的状态。 |
请求结构
Plain Text
1GET /api/v1/{namespace}/pods/{name} HTTP/1.1
2Host: bec.bdcloudapi.com
3Content-Type: application/json; charset=utf-8
4Authorization: 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. | 非必须 |
响应头域
除公共头域外,无其它特殊头域。
响应参数
响应参数的详细描述请参见 数据结构 表
错误码
请参照前文的网关错误码和平台错误码。
请求示例
Plain Text
1GET /api/v1/namespaces/test-namespace/pods/test-pod/status HTTP/1.1
2Host: bec.bdcloudapi.com
3Content-Type: application/json; charset=utf-8
4Authorization: bce-auth-v1/318857a8f08b11e9845ca7e54775a0c2/2019-10-17T03:07:21Z/1800/host/212eef8cfe1ac94be56c4afedb9360bba621ef646c3c8288971d36801d70501a
响应示例
Plain Text
1{
2 "conditions": [
3 {
4 "lastProbeTime": null,
5 "lastTransitionTime": 1575549353000,
6 "message": null,
7 "reason": null,
8 "status": "True",
9 "type": "Initialized"
10 },
11 {
12 "lastProbeTime": null,
13 "lastTransitionTime": 1575549375000,
14 "message": null,
15 "reason": null,
16 "status": "True",
17 "type": "Ready"
18 },
19 {
20 "lastProbeTime": null,
21 "lastTransitionTime": 1575549375000,
22 "message": null,
23 "reason": null,
24 "status": "True",
25 "type": "ContainersReady"
26 },
27 {
28 "lastProbeTime": null,
29 "lastTransitionTime": 1575549353000,
30 "message": null,
31 "reason": null,
32 "status": "True",
33 "type": "PodScheduled"
34 }
35 ],
36 "containerStatuses": [
37 {
38 "containerID": "containerd://71405312ee08f4157bd3379021fd4d3cd461de1e2780c7b895f525647b8798ee",
39 "image": "docker.io/library/centos:centos7",
40 "imageID": "docker.io/library/centos@sha256:4a701376d03f6b39b8c2a8f4a8e499441b0d567f9ab9d58e4991de4472fb813c",
41 "lastState": {
42 "running": null,
43 "terminated": null,
44 "waiting": null
45 },
46 "name": "container01",
47 "ready": true,
48 "restartCount": 0,
49 "state": {
50 "running": {
51 "startedAt": 1575549374000
52 },
53 "terminated": null,
54 "waiting": null
55 }
56 }
57 ],
58 "hostIP": "121.227.168.8",
59 "initContainerStatuses": null,
60 "message": null,
61 "nominatedNodeName": null,
62 "phase": "Running",
63 "podIP": "10.244.1.27",
64 "qosClass": "Guaranteed",
65 "reason": null,
66 "startTime": 1575549353000
67}