云容器实例 CCI-查询指定namespace下的Pods:响应示例

时间:2023-12-01 17:06:48

响应示例

状态码: 200

OK

{
  "apiVersion" : "v1",
  "items" : [ {
    "metadata" : {
      "annotations" : {
        "cri.cci.io/container-type" : "secure-container",
        "kubernetes.io/availablezone" : "dc1",
        "network.alpha.kubernetes.io/network" : "[{\"name\":\"namespace-test-dc1-default-network\",\"interface\":\"eth0\",\"network_plane\":\"default\"}]"
      },
      "creationTimestamp" : "2018-09-03T12:26:12Z",
      "labels" : {
        "name" : "pod-test"
      },
      "name" : "pod-test",
      "namespace" : "namespace-test",
      "resourceVersion" : "5030610",
      "selfLink" : "/api/v1/namespaces/namespace-test/pods/pod-test",
      "uid" : "8b985a27-af74-11e8-9d5d-c88d83be759f"
    },
    "spec" : {
      "containers" : [ {
        "image" : "redis",
        "imagePullPolicy" : "Always",
        "name" : "test",
        "resources" : {
          "limits" : {
            "cpu" : "500m",
            "memory" : "1Gi"
          },
          "requests" : {
            "cpu" : "500m",
            "memory" : "1Gi"
          }
        },
        "terminationMessagePath" : "/dev/termination-log",
        "terminationMessagePolicy" : "File"
      } ],
      "dnsPolicy" : "ClusterFirst",
      "imagePullSecrets" : [ {
        "name" : "imagepull-secret"
      } ],
      "nodeName" : "c0dd6256-195a-e811-90a2-10c17294fcbc",
      "restartPolicy" : "Always",
      "schedulerName" : "default-scheduler",
      "securityContext" : { },
      "tolerations" : [ {
        "effect" : "NoExecute",
        "key" : "node.kubernetes.io/not-ready",
        "operator" : "Exists",
        "tolerationSeconds" : 300
      }, {
        "effect" : "NoExecute",
        "key" : "node.kubernetes.io/unreachable",
        "operator" : "Exists",
        "tolerationSeconds" : 300
      } ]
    },
    "status" : {
      "conditions" : [ {
        "lastProbeTime" : null,
        "lastTransitionTime" : "2018-09-03T12:26:12Z",
        "status" : "True",
        "type" : "Initialized"
      }, {
        "lastProbeTime" : null,
        "lastTransitionTime" : "2018-09-03T12:26:16Z",
        "status" : "True",
        "type" : "Ready"
      }, {
        "lastProbeTime" : null,
        "lastTransitionTime" : "2018-09-03T12:26:12Z",
        "status" : "True",
        "type" : "PodScheduled"
      } ],
      "containerStatuses" : [ {
        "containerID" : "docker://aee55d8dedb8371f96aa5d5116f69a53bf1cb23afe1802567c24081514d3b048",
        "image" : "redis",
        "imageID" : "docker-pullable://redis@sha256:3ab7046bd035a47aa06963d8240651d00b57e82dab07ba374ad01f84dfa1230c",
        "lastState" : { },
        "name" : "test",
        "ready" : true,
        "restartCount" : 0,
        "state" : {
          "running" : {
            "startedAt" : "2018-09-03T12:26:16Z"
          }
        }
      } ],
      "phase" : "Running",
      "podIP" : "192.168.245.185",
      "qosClass" : "Guaranteed",
      "startTime" : "2018-09-03T12:26:12Z"
    }
  } ],
  "kind" : "PodList",
  "metadata" : {
    "resourceVersion" : "5032373",
    "selfLink" : "/api/v1/namespaces/namespace-test/pods"
  }
}
support.huaweicloud.com/api-cci/listCoreV1NamespacedPod.html