容器引擎相关接口

创建应用

创建一个或多个微服务的集合。

描述

  • 一个应用或一组应用(通过标签归类)组成一个完整的业务功能。
  • 每个应用由一个或多个微服务组成,每个微服务可以独立启动、运行、治理。

URI

POST /cks/apps/v1/applications

请求参数

名称 是否必须 描述
displayName 是 长度不超过85,中文、英文、数字开头,包括中横线组成,不能以中划线结尾
tag 否 请输入或选择标签,标签可以是多个,最多10个(不填时默认为空)
description 否 长度不超过1000(不填时默认为空)

返回参数

名称 位置 类型 是否必须 描述
id body Integer 是 UUID
name body String 是 应用名称
displayName body String 是 应用显示名称
tag body String 是 应用标签
description body String 是 应用描述
ownerId body Integer 是 应用所有者ID
creatorId body Integer 是 应用创建者ID
ownerGroup body String 是 应用所属组
createdTime body String 是 应用创建时间
updatedTime body String 是 应用更新时间
deletedTime body String 是 应用删除时间

示例

  • Sample Request(请求):
POST /cks/apps/v1/applications
  • 请求Body:
{"displayName":"app-29z84fqn","tag":"instance","description":"应用实例创建"}
  • Sample Response(响应):

  • json格式

{
  "updatedTime": "2019-07-12T02:43:47Z",
  "displayName": "app-29z84fqn",
  "creatorId": 0,
  "creatorName": "iopdev",
  "ownerGroup": "group-cloud-operator",
  "description": "应用实例创建",
  "ownerId": 0,
  "requestId": "f20858cf-faac-4134-9d02-f5875ff2901d",
  "name": "app-5kdnbzhb",
  "namespace": "",
  "createdTime": "2019-07-12T02:43:47Z",
  "id": 6610,
  "tag": "instance",
  "deletedTime": "0001-01-01T00:00:00Z",
  "appenvSpec": null
}

错误码

以下为本接口特有的错误码。

错误代码 错误信息 Http状态码
201.999400 请求数据格式失败,读取请求数据失败 400
201.011001 创建应用失败 500

应用遍历

描述

  • 获取应用列表

URI

GET /cks/apps/v1/applications

返回参数

名称 是否必须 描述
id 是 UUID
name 是 应用名称
displayName 是 应用显示名称
namespace 是 命名空间编码
tag 是 应用标签
description 是 应用描述
ownerId 是 应用所有者ID
creatorId 是 应用创建者ID
ownerGroup 是 应用所属组
createdTime 是 应用创建时间
updatedTime 是 应用更新时间
deletedTime 是 应用删除时间
appenvSpec 是 应用实例列表

示例

  • Sample Request(请求):
GET /cks/apps/v1/applications
  • Sample Response(响应):

  • json格式

{
  "data": [
    {
      "updatedTime": "2019-07-09T06:02:58Z",
      "displayName": "test",
      "creatorId": 0,
      "creatorName": "iopdev",
      "ownerGroup": "group-cloud-operator",
      "description": "",
      "ownerId": 0,
      "name": "app-lzdpcqhj",
      "namespace": "",
      "createdTime": "2019-07-09T06:02:58Z",
      "id": 6570,
      "tag": "ceshi",
      "deletedTime": "0001-01-01T00:00:00Z",
      "appenvSpec": [
        {
          "serviceType": "",
          "containerImageId": "container-001#registry.cluster11.com:5000/trident_iopdev/yuio@sha256:f04288efc7e65a84be74d4fc63e235ac3c6c603cf832e442e0bd3f240b10a91b",
          "virtualService": {
            "metadata": {
              "creationTimestamp": null
            },
            "spec": {}
          },
          "displayName": "app-kehys",
          "creatorId": 0,
          "creatorName": "iopdev",
          "routePathMatchType": "",
          "type": "DeploymentImage",
          "ownerId": 0,
          "accessMode": "domain",
          "deploymentSpec": null,
          "routeruleSpec": null,
          "environmentId": "9439c591-b8c9-486d-8793-8d8f8eb9f292",
          "deploymentDetail": null,
          "createdTime": "2019-07-10T06:12:04Z",
          "id": 5528,
          "servicePort": null,
          "tag": "",
          "cronJobDetail": null,
          "releaseStrategyType": "RollingUpdate",
          "deletedTime": "0001-01-01T00:00:00Z",
          "containerImage": "container-001#registry.cluster11.com:5000/trident_iopdev/yuio:poiu",
          "serviceSpec": null,
          "updatedTime": "2019-07-10T06:12:04Z",
          "appName": "app-lzdpcqhj",
          "replicas": 1,
          "ownerGroupId": "group-cloud-operator",
          "softPackageImage": "",
          "routeSubDomain": "",
          "routeHost": "",
          "ingressSpec": {},
          "isCreateRoute": false,
          "podSpec": {
            "containers": null
          },
          "serviceName": "",
          "routePath": "",
          "autoSwitchTraffic": "1",
          "name": "app-kehys",
          "namespace": "default",
          "serviceList": null,
          "statefulsetDetail": null
        }
      ]
    }
  ],
  "requestId": "d3bfcfb4-d4c5-4401-9c89-8412ad271832"
}

错误码

以下为本接口特有的错误码。

错误代码 错误信息 Http状态码
201.011904 查询应用数据失败 500

应用详情

描述

  • 获取应用的详细信息

URI

GET /cks/apps/v1/applications/{id}

请求参数

名称 是否必须 描述
id 是 应用ID

返回参数

名称 位置 类型 是否必须 描述
id body Integer 是 UUID
name body String 是 应用名称
displayName body String 是 应用显示名称
namespace body String 是 命名空间编码
tag body String 是 应用标签
description body String 是 应用描述
ownerId body Integer 是 应用所有者ID
creatorId body Integer 是 应用创建者ID
ownerGroup body String 是 应用所属组
createdTime body String 是 应用创建时间
updatedTime body String 是 应用更新时间
deletedTime body String 是 应用删除时间
appenvSpec body Object(appenvSpec列表) 是 应用实例列表

示例

  • Sample Request(请求):
GET /cks/apps/v1/applications/201808201435602
  • Sample Response(响应):

  • json格式:

{
  "updatedTime": "2019-07-09T08:13:21Z",
  "displayName": "xj20190708",
  "creatorId": 0,
  "creatorName": "iopdev",
  "ownerGroup": "group-cloud-operator",
  "description": "",
  "ownerId": 0,
  "requestId": "c581e100-2e06-4038-9f48-ed6654baa96c",
  "name": "app-29z84fqn",
  "namespace": "",
  "createdTime": "2019-07-09T08:13:21Z",
  "id": 6574,
  "tag": "xjtest",
  "deletedTime": "0001-01-01T00:00:00Z",
  "appenvSpec": [
    {
      "serviceType": "",
      "containerImageId": "container-001#registry.cluster11.com:5000/trident_iopdev/nginx@sha256:c662b511116086245e66993e5f4199b3d11a3f6a57d184a61c8928d8cae51cb3",
      "virtualService": {
        "metadata": {
          "uid": "78545ed2-a440-11e9-9d8d-6c92bf743ff6",
          "resourceVersion": "265175624",
          "name": "app-y5v4b-default-gateway",
          "namespace": "default",
          "creationTimestamp": "2019-07-12T01:00:41Z",
          "annotations": {
            "cloud.inspur.com/defaultsvc": "true"
          },
          "selfLink": "/apis/networking.istio.io/v1alpha3/namespaces/default/virtualservices/app-y5v4b-default-gateway",
          "labels": {
            "app": "app-y5v4b",
            "user_group": "group-cloud-operator",
            "application": "app-29z84fqn",
            "appinstance": "app-y5v4b",
            "app-y5v4b-default-svc": "service",
            "scope": "gateway",
            "user": "iopdev"
          }
        },
        "apiVersion": "networking.istio.io/v1alpha3",
        "kind": "VirtualService",
        "spec": {
          "gateways": [
            "default.istio-system.svc.cluster.local"
          ],
          "hosts": [
            "app-y5v4b-default.10.110.25.114.xip.io"
          ],
          "http": [
            {
              "route": [
                {
                  "destination": {
                    "port": {
                      "number": 161
                    },
                    "host": "app-y5v4b-default-svc.default.svc.cluster.local",
                    "subset": "rollingupdate"
                  }
                }
              ],
              "match": [
                {
                  "uri": {
                    "prefix": "/"
                  }
                }
              ]
            }
          ]
        }
      },
      "displayName": "app-y5v4b",
      "creatorId": 0,
      "creatorName": "iopdev",
      "routePathMatchType": "",
      "type": "DeploymentImage",
      "ownerId": 0,
      "accessMode": "domain",
      "deploymentSpec": null,
      "routeruleSpec": null,
      "environmentId": "9439c591-b8c9-486d-8793-8d8f8eb9f292",
      "deploymentDetail": [
        {
          "newReplicaSet": {
            "containerImages": [
              {
                "containerName": "container-001",
                "containerImage": "registry.cluster11.com:5000/trident_iopdev/nginx@sha256:c662b511116086245e66993e5f4199b3d11a3f6a57d184a61c8928d8cae51cb3"
              }
            ],
            "typeMeta": {
              "kind": "replicaset"
            },
            "objectMeta": {
              "name": "app-y5v4b-6b567c5876",
              "namespace": "default",
              "creationTimestamp": "2019-07-12T01:00:34Z",
              "annotations": {
                "deployment.inspur.com/role": "rollingupdate",
                "deployment.kubernetes.io/max-replicas": "2",
                "sidecar.istio.io/inject": "true",
                "deployment.kubernetes.io/revision": "1",
                "deployment.kubernetes.io/desired-replicas": "1",
                "kubernetes.io/change-cause": "应用初始化部署"
              },
              "labels": {
                "app": "app-y5v4b",
                "user_group": "group-cloud-operator",
                "application": "app-29z84fqn",
                "appinstance": "app-y5v4b",
                "pod-template-hash": "2612371432",
                "user": "iopdev",
                "version": "rollingupdate",
                "deployment": "app-y5v4b"
              }
            },
            "pods": {
              "running": 1,
              "current": 1,
              "desired": 1,
              "pending": 0,
              "warnings": [],
              "failed": 0,
              "succeeded": 0
            },
            "initContainerImages": null
          },
          "statusInfo": {
            "unavailable": 0,
            "replicas": 1,
            "available": 1,
            "updated": 1
          },
          "eventList": {
            "listMeta": {
              "totalItems": 0
            },
            "events": null
          },
          "replicas": 1,
          "podList": {
            "listMeta": {
              "totalItems": 0
            },
            "pods": null,
            "cumulativeMetrics": null,
            "errors": null,
            "status": {
              "running": 0,
              "pending": 0,
              "failed": 0,
              "succeeded": 0
            }
          },
          "rollingUpdateStrategy": {
            "maxSurge": "25%",
            "maxUnavailable": "25%"
          },
          "oldReplicaSetList": {
            "listMeta": {
              "totalItems": 0
            },
            "replicaSets": null,
            "cumulativeMetrics": null,
            "errors": null,
            "status": {
              "running": 0,
              "pending": 0,
              "failed": 0,
              "succeeded": 0
            }
          },
          "typeMeta": {
            "kind": "deployment"
          },
          "objectMeta": {
            "name": "app-y5v4b",
            "namespace": "default",
            "creationTimestamp": "2019-07-12T01:00:33Z",
            "annotations": {
              "deployment.inspur.com/role": "rollingupdate",
              "sidecar.istio.io/inject": "true",
              "deployment.kubernetes.io/revision": "1",
              "kubernetes.io/change-cause": "应用初始化部署"
            },
            "labels": {
              "app": "app-y5v4b",
              "user_group": "group-cloud-operator",
              "application": "app-29z84fqn",
              "appinstance": "app-y5v4b",
              "user": "iopdev",
              "version": "rollingupdate",
              "deployment": "app-y5v4b"
            }
          },
          "selector": {
            "app": "app-y5v4b",
            "user_group": "group-cloud-operator",
            "application": "app-29z84fqn",
            "appinstance": "app-y5v4b",
            "user": "iopdev",
            "version": "rollingupdate",
            "deployment": "app-y5v4b"
          },
          "revisionHistoryLimit": 10,
          "minReadySeconds": 0,
          "strategy": "RollingUpdate",
          "horizontalPodAutoscalerList": {
            "horizontalpodautoscalers": null,
            "listMeta": {
              "totalItems": 0
            },
            "errors": null
          },
          "errors": []
        }
      ],
      "createdTime": "2019-07-12T01:00:41Z",
      "id": 5535,
      "servicePort": null,
      "tag": "",
      "cronJobDetail": null,
      "releaseStrategyType": "RollingUpdate",
      "deletedTime": "0001-01-01T00:00:00Z",
      "containerImage": "container-001#registry.cluster11.com:5000/trident_iopdev/nginx:latest",
      "serviceSpec": null,
      "updatedTime": "2019-07-12T01:00:41Z",
      "appName": "app-29z84fqn",
      "replicas": 1,
      "ownerGroupId": "group-cloud-operator",
      "softPackageImage": "",
      "routeSubDomain": "",
      "routeHost": "",
      "ingressSpec": {},
      "isCreateRoute": false,
      "podSpec": {
        "containers": null
      },
      "serviceName": "",
      "routePath": "",
      "autoSwitchTraffic": "1",
      "name": "app-y5v4b",
      "namespace": "default",
      "serviceList": null,
      "statefulsetDetail": null
    }
  ]
}

错误码

以下为本接口特有的错误码。

错误代码 错误信息 Http状态码
201.011905 查询应用数据失败 500

删除应用

描述

  • 删除一个应用

URI

DELETE /cks/apps/v1/applications/{id}

请求参数

名称 是否必须 描述
id 是 UUID

示例

  • Sample Request(请求):
DELETE /cks/apps/v1/applications/201808201435602
  • Sample Response(响应):
  • json格式

错误码

以下为本接口特有的错误码。

错误代码 错误信息 Http状态码
201.011905 删除应用数据失败 500

发布应用实例

创建一个应用实例。

描述

  • 一个应用实例可以通过指定程序包或一个镜像创建,每个应用实例包含一个服务或多个服务。
  • 可简单的配置发布策略,实现应用的滚动发布、蓝绿发布或灰度发布。 在高级配置中可以指定应用本身所需的环境变量、卷、资源限额等信息以及服务路由信息。

URI

POST /cks/apps/v1/clusters/{clusterId}/instances

请求参数

名称 是否必须 描述
clusterId 是 集群ID
displayName 否 此应用实例的显示名称
name 否 此应用实例的名称
appName 是 此应用实例所属应用的名称
namespace 是 此应用实例所在的命名空间
containerImage 否 此应用实例使用的镜像的名称(不填时按照编码寻找)
containerImageId 是 此应用实例使用的镜像的编码
releaseStrategyType 否 此应用实例的发布策略(滚动发布/蓝绿发布/灰度发布)
replicas 是 此应用实例的副本数(1—20)
podSpec 是 此应用实例的描述
servicePort 是 服务端口(端口范围1~65535,协议TCP或UDP,可输入多个端口,以英文逗号分隔,如:80:TCP)
environmentId 是 此应用实例所属集群的ID
routeHost 否 域名前缀(域名默认采用xip.io格式,格式为:服务名+命名空间+外网IP+xip.io)
routeSubDomain 是 域名后缀
accessMode 是 访问方式(表示将工作负载暴露给集群外,从公网通过域名访问到工作负载的方式)

返回参数

名称 位置 类型 是否必须 描述
id body Integer 是 UUID
name body String 是 此应用实例的名称
displayName body String 是 此应用实例的显示名称
appName body String 是 此应用实例所属应用的名称
namespace body String 是 此应用实例所在的命名空间
environmentId body String 是 此应用实例所属集群的ID
accessMode body String 是 访问方式(表示将工作负载暴露给集群外,从公网通过域名访问到工作负载的方式)
ownerId body Integer 是 此应用实例所有者的ID
creatorId body Integer 是 此应用实例创建者的ID
ownerGroup body String 是 此应用实例所属组
createdTime body String 是 此应用实例创建时间
updatedTime body String 是 此应用实例更新时间
deletedTime body String 是 此应用实例删除时间
containerImage body String 否 此应用实例使用的镜像的名称
containerImageId body String 是 此应用实例使用的镜像的编码
releaseStrategyType body String 否 发布策略(滚动发布/蓝绿发布/灰度发布)
replicas body Integer 是 副本数(1—20)
podSpec body Object(PodSpec) 是 此应用实例的描述
servicePort body Object(ServicePort) 是 服务端口(端口范围1~65535,协议TCP或UDP,可输入多个端口,以英文逗号分隔,如:80:TCP

示例

  • Sample Request(请求):
POST /cks/apps/v1/clusters/9439c591-b8c9-486d-8793-8d8f8eb9f292/instances
  • 请求Body:
{
  "autoSwitchTraffic": "1",
  "displayName": "app-s65ag",
  "name": "app-s65ags",
  "namespace": "default",
  "appName": "app-6qfcq7f6",
  "containerImage": "container-001#registry.cluster11.com:5000/trident_iopdev/iot-streammgr:4.5-beta",
  "containerImageId": "container-001#registry.cluster11.com:5000/trident_iopdev/iot-streammgr@sha256:4e54cf9be83458973f4102f9b768f31fe3f0466f0c65adb555fea586a6e5de62",
  "releaseStrategyType": "RollingUpdate",
  "replicas": 1,
  "podSpec": {
    "restartPolicy": "Always",
    "affinity": {
      "nodeAffinity": {

      },
      "podAffinity": {

      },
      "podAntiAffinity": {

      }
    },
    "containers": [
      {
        "image": "registry.cluster11.com:5000/trident_iopdev/iot-streammgr@sha256:4e54cf9be83458973f4102f9b768f31fe3f0466f0c65adb555fea586a6e5de62",
        "ports": [
          {
            "containerPort": 80,
            "protocol": "TCP"
          }
        ],
        "volumeMounts": [

        ],
        "name": "container-001"
      }
    ],
    "initContainers": [

    ],
    "volumes": [

    ]
  },
  "serviceType": "ClusterIP",
  "volumeMount": {
    "pvcMount": [

    ],
    "dynamicMount": [

    ],
    "staticMount": [

    ]
  },
  "servicePort": [
    {
      "targetPort": 80,
      "protocol": "TCP"
    }
  ],
  "environmentId": "9439c591-b8c9-486d-8793-8d8f8eb9f292",
  "type": "DeploymentImage",
  "routeHost": "",
  "routeSubDomain": ".10.110.25.114.xip.io",
  "accessMode": "domain"
}
  • Sample Response(响应):

  • json格式

{
  "serviceType": "ClusterIP",
  "containerImageId": "container-001#registry.cluster11.com:5000/trident_iopdev/iot-streammgr@sha256:4e54cf9be83458973f4102f9b768f31fe3f0466f0c65adb555fea586a6e5de62",
  "volumeMount": {},
  "virtualService": {
    "metadata": {
      "creationTimestamp": null
    },
    "spec": {}
  },
  "displayName": "app-s65ag",
  "creatorId": 0,
  "creatorName": "iopdev",
  "routePathMatchType": "",
  "type": "DeploymentImage",
  "ownerId": 0,
  "accessMode": "domain",
  "deploymentSpec": [
    {
      "serviceType": "ClusterIP",
      "imagePullPolicy": "Always",
      "cpuRequirement": null,
      "podManagementPolicy": "",
      "variables": null,
      "containerCommandArgs": null,
      "isExternal": false,
      "softPackageName": "",
      "replicas": 1,
      "softPackageImage": "",
      "description": null,
      "annotations": [
        {
          "value": "应用初始化部署",
          "key": "kubernetes.io/change-cause"
        },
        {
          "value": "rollingupdate",
          "key": "deployment.inspur.com/role"
        },
        {
          "value": "true",
          "key": "sidecar.istio.io/inject"
        }
      ],
      "statefulsetUpdateType": "",
      "podSpec": {
        "imagePullSecrets": [
          {
            "name": "trident-iopdev-registry"
          }
        ],
        "containers": [
          {
            "image": "registry.cluster11.com:5000/trident_iopdev/iot-streammgr@sha256:4e54cf9be83458973f4102f9b768f31fe3f0466f0c65adb555fea586a6e5de62",
            "imagePullPolicy": "Always",
            "name": "container-001",
            "resources": {},
            "ports": [
              {
                "protocol": "TCP",
                "name": "bqdr2-tcp-80",
                "containerPort": 80
              }
            ]
          }
        ],
        "restartPolicy": "Always",
        "affinity": {
          "nodeAffinity": {},
          "podAffinity": {},
          "podAntiAffinity": {}
        }
      },
      "serviceName": "",
      "containerCommand": null,
      "portMappings": [
        {
          "protocol": "TCP",
          "port": 15684,
          "name": "http-15684-80-hknff",
          "targetPort": 80,
          "nodePort": 0
        }
      ],
      "labels": [
        {
          "value": "app-s65ags",
          "key": "app"
        },
        {
          "value": "app-6qfcq7f6",
          "key": "application"
        },
        {
          "value": "app-s65ags",
          "key": "appinstance"
        },
        {
          "value": "group-cloud-operator",
          "key": "user_group"
        },
        {
          "value": "iopdev",
          "key": "user"
        },
        {
          "value": "rollingupdate",
          "key": "version"
        },
        {
          "value": "app-s65ags",
          "key": "deployment"
        }
      ],
      "imagePullSecret": "trident-iopdev-registry",
      "name": "app-s65ags",
      "namespace": "default",
      "memoryRequirement": null,
      "runAsPrivileged": false,
      "containerImage": "container-001#registry.cluster11.com:5000/trident_iopdev/iot-streammgr:4.5-beta"
    }
  ],
  "routeruleSpec": null,
  "environmentId": "9439c591-b8c9-486d-8793-8d8f8eb9f292",
  "requestId": "80ebcf1a-64d1-4433-9e3d-225f80084fb2",
  "deploymentDetail": null,
  "createdTime": "2019-07-15T06:43:41Z",
  "id": 5559,
  "servicePort": [
    {
      "protocol": "TCP",
      "port": 15684,
      "name": "http-15684-80-hknff",
      "targetPort": 80
    }
  ],
  "tag": "",
  "cronJobDetail": null,
  "releaseStrategyType": "RollingUpdate",
  "deletedTime": "0001-01-01T00:00:00Z",
  "containerImage": "container-001#registry.cluster11.com:5000/trident_iopdev/iot-streammgr:4.5-beta",
  "serviceSpec": null,
  "updatedTime": "2019-07-15T06:43:41Z",
  "appName": "app-6qfcq7f6",
  "replicas": 1,
  "ownerGroupId": "group-cloud-operator",
  "softPackageImage": "",
  "routeSubDomain": ".10.110.25.114.xip.io",
  "routeHost": "",
  "ingressSpec": {},
  "isCreateRoute": false,
  "podSpec": {
    "containers": [
      {
        "image": "registry.cluster11.com:5000/trident_iopdev/iot-streammgr@sha256:4e54cf9be83458973f4102f9b768f31fe3f0466f0c65adb555fea586a6e5de62",
        "imagePullPolicy": "Always",
        "name": "container-001",
        "resources": {},
        "ports": [
          {
            "protocol": "TCP",
            "name": "bqdr2-tcp-80",
            "containerPort": 80
          }
        ]
      }
    ],
    "restartPolicy": "Always",
    "affinity": {
      "nodeAffinity": {},
      "podAffinity": {},
      "podAntiAffinity": {}
    }
  },
  "serviceName": "",
  "routePath": "",
  "autoSwitchTraffic": "1",
  "name": "app-s65ags",
  "namespace": "default",
  "serviceList": null,
  "statefulsetDetail": null
}

错误码

以下为本接口特有的错误码。

错误代码 错误信息 Http状态码 说明
204.001902 获取集群信息失败 500 连接集群失败
201.999400 请求数据格式失败,读取请求数据失败 400 请求数据格式有误
201.012001 创建应用实例失败 500 应用容器数量为0,请至少创建1个应用容器
201.012003 容器数量已达配额上限 500 容器数量超过最大可建容器数量
201.012002 创建应用实例失败 500 获取卷详细信息失败,卷名已存在等原因
201.019001 连接集群失败,无法创建服务 500 集群连接异常
201.013021 连接集群失败,无法创建无状态负载 500 集群连接异常
201.012005 负载数量已达配额上限,无法创建实例 500 负载数量已达最大可创建负载数量
201.016001 连接集群失败,无法创建有状态负载 500 集群连接异常
201.012901 保存应用实例数据失败 500 数据库保存数据失败

实例遍历

条件查询应用实例列表。

描述

  • 可以根据不同的集群和不同的名称空间进行应用实例列表查询
  • 可以根据应用实例名称和所属应用的名称查询应用实例

URI

GET /cks/apps/v1/clusters/{clusterId}/instances?namespace=&appName=&appenvName=

请求参数

名称 是否必须 描述
clusterId 是 待查询的应用实例所属集群ID
appenvName 否 待查询的应用实例的名称(不填时默认选择全部)
appName 否 待查询的应用实例所属应用的名称(不填时默认选择全部)
namespace 否 待查询的应用实例所在的命名空间(不填时默认选择全部)

返回参数

名称 位置 类型 是否必须 描述
Object body Object(InstanceSpec列表) 是 应用实例列表

示例

  • Sample Request(请求):
GET /cks/apps/v1/clusters/9439c591-b8c9-486d-8793-8d8f8eb9f292/instances?namespace=&appName=&appenvName=
  • Sample Response(响应):

  • json格式

{
  "data": [
    {
      "serviceType": "",
      "containerImageId": "container-001#registry.cluster11.com:5000/trident_iopdev/nginx@sha256:8ae79811f8d183544805d5e20a06dcb2d735e2712c11ce602babe18f58f82e3f",
      "virtualService": {
        "metadata": {
          "creationTimestamp": null
        },
        "spec": {}
      },
      "displayName": "app-4891x",
      "creatorId": 0,
      "creatorName": "iopdev",
      "routePathMatchType": "",
      "type": "DeploymentImage",
      "ownerId": 0,
      "accessMode": "cluster",
      "deploymentSpec": null,
      "routeruleSpec": null,
      "environmentId": "9439c591-b8c9-486d-8793-8d8f8eb9f292",
      "deploymentDetail": null,
      "createdTime": "2019-07-09T06:49:34Z",
      "id": 5521,
      "servicePort": null,
      "tag": "",
      "cronJobDetail": null,
      "releaseStrategyType": "RollingUpdate",
      "deletedTime": "0001-01-01T00:00:00Z",
      "containerImage": "container-001#registry.cluster11.com:5000/trident_iopdev/nginx:test",
      "serviceSpec": null,
      "updatedTime": "2019-07-09T08:16:02Z",
      "appName": "app-5552s5lz",
      "replicas": 1,
      "ownerGroupId": "group-cloud-operator",
      "softPackageImage": "",
      "routeSubDomain": "",
      "routeHost": "",
      "ingressSpec": {},
      "isCreateRoute": false,
      "podSpec": {
        "containers": null
      },
      "serviceName": "",
      "routePath": "",
      "autoSwitchTraffic": "1",
      "name": "app-4891x",
      "namespace": "default",
      "serviceList": null,
      "statefulsetDetail": null
    }
  ],
  "requestId": "d13976f6-3de3-41ab-b8a7-8ead5e479ecd"
}

错误码

以下为本接口特有的错误码。

| 错误代码 | 错误信息 | Http状态码 | | 错误代码 | 错误信息 | Http状态码 | 删除实例 |----------|----------|------------| | 204.001902 |获取集群信息失败 |500 | | 201.012905 |查询应用实例数据失败 |500 |

实例详情

获取某个应用实例的详情信息。

描述

  • 通过应用实例的ID获取该应用实例的详情信息

URI

GET /cks/apps/v1/clusters/{clusterId}/instances/{id}

请求参数

名称 是否必须 描述
clusterId 是 待查询的应用实例所在集群ID
id 是 待查询的应用实例的UUID
type 是 待查询的应用实例的类型(无状态/有状态)

返回参数

名称 位置 类型 是否必须 描述
id body Integer 是 UUID
name body String 是 此应用实例的名称
displayName body String 是 此应用实例的显示名称
appName body String 是 此应用实例所属应用的名称
namespace body String 是 命名空间
environmentId body String 是 此应用实例所在集群的ID
accessMode body String 是 访问方式(表示将工作负载暴露给集群外,从公网通过域名访问到工作负载的方式)
ownerId body Integer 是 此应用实例所有者的ID
creatorId body Integer 是 此应用实例创建者的ID
ownerGroup body String 是 此应用实例所属组
createdTime body String 是 此应用实例创建时间
updatedTime body String 是 此应用实例更新时间
deletedTime body String 是 此应用实例删除时间
containerImage body String 否 此应用实例所用镜像的名称
containerImageId body String 是 此应用实例所用镜像的编码
releaseStrategyType body String 否 此应用实例的发布策略(滚动发布/蓝绿发布/灰度发布)
replicas body Integer 是 此应用实例的副本数(1-20)
podSpec body Object(PodSpec) 是 此应用实例的描述
serviceList body Object(ServicePort) 是 服务列表
virtualService body Object(VirtualService) 否 服务路由
deploymentDetail body Object(DeploymentDetail) 是 部署详情

示例

  • Sample Request(请求):
GET /cks/apps/v1/clusters/9439c591-b8c9-486d-8793-8d8f8eb9f292/instances/5542
  • Sample Response(响应):

  • json格式

{
  "serviceType": "",
  "containerImageId": "container-001#registry.cluster11.com:5000/trident_iopdev/iot-streammgr@sha256:4e54cf9be83458973f4102f9b768f31fe3f0466f0c65adb555fea586a6e5de62",
  "virtualService": {
    "metadata": {
      "creationTimestamp": null
    },
    "spec": {}
  },
  "displayName": "app-ddqxa",
  "creatorId": 0,
  "creatorName": "iopdev",
  "routePathMatchType": "",
  "type": "DeploymentImage",
  "ownerId": 0,
  "accessMode": "domain",
  "deploymentSpec": null,
  "routeruleSpec": null,
  "environmentId": "9439c591-b8c9-486d-8793-8d8f8eb9f292",
  "requestId": "405abe18-9a71-40d7-950b-cb66a51659b2",
  "deploymentDetail": [
    {
      "newReplicaSet": {
        "containerImages": [
          {
            "containerName": "container-001",
            "containerImage": "trident_iopdev/iot-streammgr@sha256:4e54cf9be83458973f4102f9b768f31fe3f0466f0c65adb555fea586a6e5de62"
          }
        ],
        "typeMeta": {
          "kind": "replicaset"
        },
        "objectMeta": {
          "name": "app-ddqxa-5f957bbdd9",
          "namespace": "default",
          "creationTimestamp": "2019-07-12T03:36:53Z",
          "annotations": {
            "deployment.inspur.com/role": "rollingupdate",
            "deployment.kubernetes.io/max-replicas": "2",
            "sidecar.istio.io/inject": "true",
            "deployment.kubernetes.io/revision": "3",
            "deployment.kubernetes.io/desired-replicas": "1",
            "kubernetes.io/change-cause": "手动触发更新"
          },
          "labels": {
            "app": "app-ddqxa",
            "user_group": "group-cloud-operator",
            "application": "app-qn22mvcn",
            "appinstance": "app-ddqxa",
            "pod-template-hash": "1951366885",
            "user": "iopdev",
            "version": "rollingupdate",
            "deployment": "app-ddqxa"
          }
        },
        "pods": {
          "running": 1,
          "current": 1,
          "desired": 1,
          "pending": 0,
          "warnings": [],
          "failed": 0,
          "succeeded": 0
        },
        "initContainerImages": null
      },
      "statusInfo": {
        "unavailable": 0,
        "replicas": 1,
        "available": 1,
        "updated": 1
      },
      "eventList": {
        "listMeta": {
          "totalItems": 0
        },
        "events": []
      },
      "replicas": 1,
      "podList": {
        "listMeta": {
          "totalItems": 1
        },
        "pods": [
          {
            "nodeName": "slave2",
            "typeMeta": {
              "kind": "pod"
            },
            "podStatus": {
              "podPhase": "Running",
              "containerStates": [
                {
                  "running": {
                    "startedAt": "2019-07-12T06:22:22Z"
                  }
                },
                {
                  "running": {
                    "startedAt": "2019-07-12T03:37:00Z"
                  }
                }
              ],
              "status": "Running"
            },
            "restartCount": 21,
            "objectMeta": {
              "name": "app-ddqxa-5f957bbdd9-zgbjs",
              "namespace": "default",
              "creationTimestamp": "2019-07-12T03:36:53Z",
              "annotations": {
                "sidecar.istio.io/status": "{\"version\":\"b64ff87990d99becd4433f619b4b51b0913453430ba4ab54dfce844f9d37f1dc\",\"initContainers\":[\"istio-init\"],\"containers\":[\"istio-proxy\"],\"volumes\":[\"istio-envoy\",\"istio-certs\"],\"imagePullSecrets\":null}",
                "deployment.inspur.com/role": "rollingupdate",
                "cluster.inspur.com/container-image": "{\"container-001\":\"registry.cluster11.com:5000/trident_iopdev/iot-streammgr:0.1.0\"}",
                "sidecar.istio.io/inject": "true",
                "kubernetes.io/change-cause": "应用初始化部署"
              },
              "labels": {
                "app": "app-ddqxa",
                "user_group": "group-cloud-operator",
                "application": "app-qn22mvcn",
                "appinstance": "app-ddqxa",
                "pod-template-hash": "1951366885",
                "user": "iopdev",
                "version": "rollingupdate",
                "deployment": "app-ddqxa"
              }
            },
            "warnings": [],
            "metrics": null
          }
        ],
        "cumulativeMetrics": [],
        "errors": [],
        "status": {
          "running": 0,
          "pending": 0,
          "failed": 0,
          "succeeded": 0
        }
      },
      "rollingUpdateStrategy": {
        "maxSurge": "25%",
        "maxUnavailable": "25%"
      },
      "oldReplicaSetList": {
        "listMeta": {
          "totalItems": 0
        },
        "replicaSets": [],
        "cumulativeMetrics": [],
        "errors": [],
        "status": {
          "running": 0,
          "pending": 0,
          "failed": 0,
          "succeeded": 0
        }
      },
      "typeMeta": {
        "kind": "deployment"
      },
      "objectMeta": {
        "name": "app-ddqxa",
        "namespace": "default",
        "creationTimestamp": "2019-07-12T02:34:54Z",
        "annotations": {
          "deployment.inspur.com/role": "rollingupdate",
          "sidecar.istio.io/inject": "true",
          "deployment.kubernetes.io/revision": "3",
          "kubernetes.io/change-cause": "手动触发更新"
        },
        "labels": {
          "app": "app-ddqxa",
          "user_group": "group-cloud-operator",
          "application": "app-qn22mvcn",
          "appinstance": "app-ddqxa",
          "user": "iopdev",
          "version": "rollingupdate",
          "deployment": "app-ddqxa"
        }
      },
      "selector": {
        "app": "app-ddqxa",
        "user_group": "group-cloud-operator",
        "application": "app-qn22mvcn",
        "appinstance": "app-ddqxa",
        "user": "iopdev",
        "version": "rollingupdate",
        "deployment": "app-ddqxa"
      },
      "revisionHistoryLimit": 10,
      "minReadySeconds": 0,
      "strategy": "RollingUpdate",
      "horizontalPodAutoscalerList": {
        "horizontalpodautoscalers": [],
        "listMeta": {
          "totalItems": 0
        },
        "errors": []
      },
      "errors": []
    }
  ],
  "createdTime": "2019-07-12T02:34:54Z",
  "id": 5542,
  "servicePort": null,
  "tag": "",
  "cronJobDetail": null,
  "releaseStrategyType": "RollingUpdate",
  "deletedTime": "0001-01-01T00:00:00Z",
  "containerImage": "container-001#registry.cluster11.com:5000/trident_iopdev/iot-streammgr:0.1.0",
  "serviceSpec": null,
  "updatedTime": "2019-07-12T03:36:53Z",
  "appName": "app-qn22mvcn",
  "replicas": 1,
  "ownerGroupId": "group-cloud-operator",
  "softPackageImage": "",
  "routeSubDomain": "",
  "routeHost": "",
  "ingressSpec": {},
  "isCreateRoute": false,
  "podSpec": {
    "containers": null
  },
  "serviceName": "",
  "routePath": "",
  "autoSwitchTraffic": "1",
  "name": "app-ddqxa",
  "namespace": "default",
  "serviceList": {
    "metadata": {
      "resourceVersion": "265308479",
      "selfLink": "/api/v1/namespaces/default/services"
    },
    "items": [
      {
        "metadata": {
          "uid": "a1e18d6c-a44d-11e9-9d8d-6c92bf743ff6",
          "resourceVersion": "265214692",
          "name": "app-ddqxa-default-svc",
          "namespace": "default",
          "creationTimestamp": "2019-07-12T02:34:54Z",
          "annotations": {
            "cloud.inspur.com/defaultsvc": "true"
          },
          "selfLink": "/api/v1/namespaces/default/services/app-ddqxa-default-svc",
          "labels": {
            "app": "app-ddqxa",
            "user_group": "group-cloud-operator",
            "application": "app-qn22mvcn",
            "appinstance": "app-ddqxa",
            "user": "iopdev"
          }
        },
        "spec": {
          "sessionAffinity": "None",
          "selector": {
            "app": "app-ddqxa",
            "user_group": "group-cloud-operator",
            "application": "app-qn22mvcn",
            "appinstance": "app-ddqxa",
            "user": "iopdev"
          },
          "ports": [
            {
              "protocol": "TCP",
              "port": 11730,
              "name": "http-11730-80-xcgbc",
              "targetPort": 80
            }
          ],
          "type": "ClusterIP",
          "clusterIP": "158.158.44.52"
        },
        "status": {
          "loadBalancer": {}
        }
      }
    ]
  },
  "statefulsetDetail": null
}

错误码

以下为本接口特有的错误码。

错误代码 错误信息 Http状态码
204.001902 获取集群信息失败 500
201.016902 连接集群失败,无法获取有状态负载信息 500
201.013002 连接集群失败,无法获取无状态负载信息 500
201.019004 连接集群失败,无法获取服务信息 500

删除实例

根据应用实例ID删除某个应用实例的信息。

描述

删除应用实例

  • 删除该应用实例相关的数据库元数据和k8s资源。

URI

DELETE /cks/apps/v1/clusters/{clusterId}/instances/{id}

请求参数

名称 是否必须 描述
id 是 待删除的应用实例的UUID
clusterId 是 待删除的应用实例所在集群的ID

返回参数

示例

  • Sample Request(请求):
DELETE /cks/apps/v1/clusters/9439c591-b8c9-486d-8793-8d8f8eb9f292/instances/5542
  • Sample Response(响应):
  • json格式

错误码

以下为本接口特有的错误码。

错误代码 错误信息 Http状态码
201.012907 查询应用实例数据失败 500

获取应用实例访问地址

获取某个应用实例的访问地址。

描述

根据应用实例名称查询该应用实例的访问地址

URI

GET cks/servicemesh/v1/clusters/{clusterId}/namespaces/{namespace}/applications/{application}/instances/{instance}/accessaddresses

请求参数

名称 位置 类型 是否必须 描述
clusterId path String 是 待查询应用实例所在集群的ID
namespace path String 是 待查询应用实例所在的命名空间
application path String 是 待查询应用实例所属应用的名称
instance path String 是 待查询应用实例的名称

返回参数

名称 位置 类型 是否必须 描述
地址列表 body List<NetAddress> 是 访问地址列表

示例

  • Sample Request(请求):
GET /cks/servicemesh/v1/clusters/ab38a4a7-8044-4d2b-9847-c92deaf7401e/namespaces/default/applications/app-4zk8k66r/instances/app-4zk8k66r-instance-c6chbx5g/accessaddresses
  • Sample Response(响应):

  • json格式

{
  "data": [
    {
      "netAddress": "app-akevt-default.10.110.25.114.xip.io/",
      "matchMode": "prefix"
    }
  ],
  "requestId": "a9625e2c-c111-41f5-83ab-667b537a8157"
}

返回值

请参考通用请求返回值

错误码

以下为本接口特有的错误码。

错误代码 错误信息 Http状态码 说明
201.018002 获取数据失败,请检查k8s集群环境 500 集群连接异常

微服务遍历

描述

  • 获取微服务列表

URI

GET /cks/core/v1/clusters/{clusterId}/services?namespace=

请求参数

名称 是否必须 描述
clusterId 是 待查询的微服务所在集群的ID
namespace 否 待查询的微服务所在命名空间的编码(不填时默认选择全部命名空间)
appName 否 待查询的微服务所属应用的名称(不填时默认选择全部应用)

返回参数

名称 位置 类型 是否必须 描述
apiVersion body String 是 APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values.
kind body String 是 Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated.
metadata body Object(ListMeta) 是 Standard list metadata
items body Object(VirtualService列表) 是 应用标签

示例

  • Sample Request(请求):
GET /cks/core/v1/clusters/42804627-fe2e-4411-9101-93fcdee85a7f/services?namespace=
  • Sample Response(响应):

  • json格式

{
  "metadata": {
    "resourceVersion": "265297134",
    "selfLink": "/apis/networking.istio.io/v1alpha3/namespaces/iop-test/virtualservices"
  },
  "apiVersion": "networking.istio.io/v1alpha3",
  "kind": "VirtualServiceList",
  "requestId": "d632930e-5fe9-4716-8ac4-9b6bff95ea3b",
  "items": [
    {
      "metadata": {
        "uid": "6fba53e6-a2c2-11e9-9d8d-6c92bf743ff6",
        "resourceVersion": "263915797",
        "name": "app-w7rbk-default-mesh",
        "namespace": "default",
        "creationTimestamp": "2019-07-10T03:25:59Z",
        "annotations": {
          "cloud.inspur.com/defaultsvc": "true"
        },
        "selfLink": "/apis/networking.istio.io/v1alpha3/namespaces/default/virtualservices/app-w7rbk-default-mesh",
        "labels": {
          "app": "app-w7rbk",
          "user_group": "group-cloud-operator",
          "application": "app-5552s5lz",
          "appinstance": "app-w7rbk",
          "scope": "mesh",
          "app-w7rbk-default-svc": "service",
          "user": "iopdev"
        }
      },
      "apiVersion": "networking.istio.io/v1alpha3",
      "kind": "VirtualService",
      "spec": {
        "gateways": [
          "mesh"
        ],
        "hosts": [
          "app-w7rbk-default-svc.default.svc.cluster.local"
        ],
        "http": [
          {
            "route": [
              {
                "destination": {
                  "port": {
                    "number": 771
                  },
                  "host": "app-w7rbk-default-svc.default.svc.cluster.local",
                  "subset": "rollingupdate"
                }
              }
            ]
          }
        ]
      }
    }
  ]
}

错误码

以下为本接口特有的错误码。

错误代码 错误信息 Http状态码
201.018001 命名空间不能为空 400
201.018002 获取数据失败,请确认集群信息 500
201.018003 获取数据失败,数据转换异常 …

微服务详情

描述

  • 获取微服务详情

URI

GET /cks/core/v1/clusters/{clusterId}/namespaces/{namespace}/services/{name}

请求参数

名称 是否必须 描述
clusterId 是 待查询的微服务所在集群的ID
namespace 是 待查询的微服务所在的命名空间
name 是 待查询的微服务的名称

返回参数

名称 位置 类型 是否必须 描述
apiVersion body String 是 APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values.
kind body String 是 Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated.
metadata body Object(ObjectMeta) 是 Standard metadata
spec body Object(VirtualServiceSpec) 是 Virtual Service

示例

  • Sample Request(请求):
GET /cks/core/v1/clusters/42804627-fe2e-4411-9101-93fcdee85a7f/namespaces/default/services/test-install1574426541847-kibana
  • Sample Response(响应):

  • json格式

{
  "metadata": {
    "uid": "0d1304d8-a470-11e9-9d8d-6c92bf743ff6",
    "resourceVersion": "265315089",
    "name": "app-akevt-default-mesh",
    "namespace": "default",
    "creationTimestamp": "2019-07-12T06:41:17Z",
    "annotations": {
      "cloud.inspur.com/defaultsvc": "true"
    },
    "selfLink": "/apis/networking.istio.io/v1alpha3/namespaces/default/virtualservices/app-akevt-default-mesh",
    "labels": {
      "app": "app-akevt",
      "user_group": "group-cloud-operator",
      "application": "app-h9wh2m74",
      "appinstance": "app-akevt",
      "scope": "mesh",
      "app-akevt-default-svc": "service",
      "user": "iopdev"
    }
  },
  "apiVersion": "networking.istio.io/v1alpha3",
  "kind": "VirtualService",
  "requestId": "800f55ac-66cc-404c-8a56-de5e8dd00b5c",
  "spec": {
    "gateways": [
      "mesh"
    ],
    "hosts": [
      "app-akevt-default-svc.default.svc.cluster.local"
    ],
    "http": [
      {
        "route": [
          {
            "destination": {
              "port": {
                "number": 19777
              },
              "host": "app-akevt-default-svc.default.svc.cluster.local",
              "subset": "rollingupdate"
            }
          }
        ]
      }
    ]
  }
}

错误码

以下为本接口特有的错误码。

错误代码 错误信息 Http状态码
201.018009 微服务不存在 404
201.018010 获取VirtualService失败,请确认集群信息 500
201.018005 获取VirtualService失败,数据转换错误 500

路由遍历

描述

  • 获取微服务路由列表

URI

GET /cks/servicemesh/v1/clusters/{clusterId}/virtualservices?namespace={namespace}&scope=gateway

请求参数

名称 是否必须 描述
clusterId 是 待查询的微服务所在集群的ID
scope 是 范围(固定传入值gateway)
namespace 否 待查询的微服务所在命名空间的编码(不填时默认选择所有命名空间)
appName 否 待查询的微服务所属应用的名称(不填时默认选择所有应用)

返回参数

名称 位置 类型 是否必须 描述
apiVersion body String 是 APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values.
kind body String 是 Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated.
metadata body Object(ListMeta) 是 Standard list metadata
items body Object(VirtualService列表) 是 应用标签

示例

  • Sample Request(请求):
GET /cks/servicemesh/v1/clusters/42804627-fe2e-4411-9101-93fcdee85a7f/virtualservices?namespace=&scope=gateway&appName=
  • Sample Response(响应):

  • json格式

{
  "metadata": {
    "resourceVersion": "265242629",
    "selfLink": "/apis/networking.istio.io/v1alpha3/namespaces/iop-test/virtualservices"
  },
  "apiVersion": "networking.istio.io/v1alpha3",
  "kind": "VirtualServiceList",
  "requestId": "e177527b-7c72-40b1-85af-8e599cba841c",
  "items": [
    {
      "metadata": {
        "uid": "6fbb5569-a2c2-11e9-9d8d-6c92bf743ff6",
        "resourceVersion": "263915800",
        "name": "app-w7rbk-default-gateway",
        "namespace": "default",
        "creationTimestamp": "2019-07-10T03:25:59Z",
        "annotations": {
          "cloud.inspur.com/defaultsvc": "true"
        },
        "selfLink": "/apis/networking.istio.io/v1alpha3/namespaces/default/virtualservices/app-w7rbk-default-gateway",
        "labels": {
          "app": "app-w7rbk",
          "user_group": "group-cloud-operator",
          "application": "app-5552s5lz",
          "appinstance": "app-w7rbk",
          "scope": "gateway",
          "app-w7rbk-default-svc": "service",
          "user": "iopdev"
        }
      },
      "apiVersion": "networking.istio.io/v1alpha3",
      "kind": "VirtualService",
      "spec": {
        "gateways": [
          "default.istio-system.svc.cluster.local"
        ],
        "hosts": [
          "app-w7rbk-default.10.110.25.114.xip.io"
        ],
        "http": [
          {
            "route": [
              {
                "destination": {
                  "port": {
                    "number": 771
                  },
                  "host": "app-w7rbk-default-svc.default.svc.cluster.local",
                  "subset": "rollingupdate"
                }
              }
            ],
            "match": [
              {
                "uri": {
                  "prefix": "/"
                }
              }
            ]
          }
        ]
      }
    }
  ]
}

错误码

以下为本接口特有的错误码。

错误代码 错误信息 Http状态码
201.018001 命名空间不能为空 400
201.018002 获取数据失败,请确认集群信息 500
201.018003 获取数据失败,数据转换异常 …

路由详情

描述

  • 获取微服务的路由详情

URI

GET /cks/servicemesh/v1/clusters/{clusterId}/namespaces/{namespace}/virtualservices/{name}

请求参数

名称 位置 类型 是否必须 描述
clusterId path String 是 待查询的微服务所在集群的ID
namespace path String 是 待查询的微服务所在命名空间的编码
name path String 是 服务路由名称

返回参数

名称 位置 类型 是否必须 描述
apiVersion body String 是 APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values.
kind body String 是 Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated.
metadata body Object(ObjectMeta) 是 Standard metadata
spec body Object(VirtualServiceSpec) 是 Virtual Service

示例

  • Sample Request(请求):
GET /cks/servicemesh/v1/clusters/42804627-fe2e-4411-9101-93fcdee85a7f/namespaces/default/virtualservices/app-lpqzckxs-instance-p6ffbkcc-default-gateway
  • Sample Response(响应):

  • json格式

{
  "metadata": {
    "uid": "8fa9cd35-a44f-11e9-9d8d-6c92bf743ff6",
    "resourceVersion": "265220797",
    "name": "app-qjcrx-default-gateway",
    "namespace": "default",
    "creationTimestamp": "2019-07-12T02:48:43Z",
    "annotations": {
      "cloud.inspur.com/defaultsvc": "true"
    },
    "selfLink": "/apis/networking.istio.io/v1alpha3/namespaces/default/virtualservices/app-qjcrx-default-gateway",
    "labels": {
      "app": "app-qjcrx",
      "app-qjcrx-default-svc": "service",
      "user_group": "group-cloud-operator",
      "application": "app-dtqq5rcj",
      "appinstance": "app-qjcrx",
      "scope": "gateway",
      "user": "iopdev"
    }
  },
  "apiVersion": "networking.istio.io/v1alpha3",
  "kind": "VirtualService",
  "requestId": "ebd4dce6-98e5-4d5b-bb9b-71539a6c5976",
  "spec": {
    "gateways": [
      "default.istio-system.svc.cluster.local"
    ],
    "hosts": [
      "app-qjcrx-default.10.110.25.114.xip.io"
    ],
    "http": [
      {
        "route": [
          {
            "destination": {
              "port": {
                "number": 10396
              },
              "host": "app-qjcrx-default-svc.default.svc.cluster.local",
              "subset": "rollingupdate"
            }
          }
        ],
        "match": [
          {
            "uri": {
              "prefix": "/"
            }
          }
        ]
      }
    ]
  }
}

错误码

以下为本接口特有的错误码。

错误代码 错误信息 Http状态码
201.018009 微服务不存在 404
201.018010 获取VirtualService失败,请确认集群信息 500
201.018005 获取VirtualService失败,数据转换错误 500

创建集群

描述

  • 通过openApi方式创建集群

URI

POST /cks/cluster/v1/cluster-orders

请求参数

名称 位置 类型 是否必须 描述
orderSource body String 是 订单来源,必须为"openApi"
arch body String 是 架构,如x86
availabilityZone body String 是 可用区
billType body String 是 账单类型,可选"hourlySettlement","monthly"
clusterDisplayName body String 是 集群展示名称
clusterName body String 是 集群名称
dockerVersion body String 是 docker版本,支持18.06.1-ce
eipAddress body String 否 弹性ip
eipId body String 否 弹性ip的id
k8sSize body Int 是 集群节点规模大小,可选50、200、500
k8sVersion body String 是 k8s的版本
monitorEbsCode body String 否 监控盘类型
keyPairName body String 否 密钥对
monitorFlag body String 否 是否开启监控
packageCode body String 是 套餐编码
packageName body String 是 套餐名称
password body String 否 节点密码
regionCode body String 是 区域编码
regionName body String 是 区域名称
rewardActivity body String 否 优惠券
totalMoney body String 否 总共花费
useIstio body bool 是 是否使用istio
userDataPath body String 否 数据盘节点挂载目录,不能使用"/"根目录等
vpcId body String 是 vpc的编码
vpcSubnetId body String 是 vpc子网的编码
vpcSubnetName body String 是 vpc子网的名称
workerMaxPodNum body Int 是 工作节点最大pod数目
workerNum body Int 是 工作节点的数量
workerSpec body String 是 工作节点的规格
workerSysDiscsize body Int 是 工作节点系统盘大小
workerSysDisktype body String 是 工作节点系统盘类型
totalMoney body String 否 总共花费
imageId body String 是 虚机镜像Id
osVersion body String 是 虚机镜像版本信息(Ubuntu-18.04、UOS-20-SP3)
componentParams body Object(ComponentParam列表) 否 组件参数

返回参数

名称 位置 类型 是否必须 描述
code body String 是 返回码,"0"为成功,其他失败
message body String 是 返回信息

示例

  • Sample Request(请求):
POST /cluster/v1/cluster-orders
  • 请求Body:
{
    orderSource: "openApi"
    arch: "x86"
    availabilityZone: "cn-north-3a"
    billType: "hourlySettlement"
    clusterDisplayName: "CKS-20200729142707-804"
    clusterName: "CKS-20200729142707-804"
    dockerVersion: "18.06.1-ce"
    eipAddress: "117.73.3.65"
    eipId: "9a970706-8341-47f6-ad8e-a0238d8c5c21"
    imageId: "ff6ff1ff-ae7b-48cf-ad0b-4c7e27ffa82e"
    osVersion: "Ubuntu-18.04"
    k8sSize: 50
    k8sVersion: "1.14.3.1"
    keyPairName: null
    monitorEbsCode: "SATA"
    monitorFlag: true
    packageCode: "ice_std_4C8G"
    packageName: "S1.xlarge.2"
    password: "Cks123456"
    regionCode: "cn-north-3"
    regionName: "华北三"
    rewardActivity: ""
    totalMoney: "3.4418"
    useIstio: true
    userDataPath: "/data"
    vpcId: "vpc0000000197"
    vpcSubnetId: "a4cfddf4-ae16-4b65-b307-edb1aa889360"
    vpcSubnetName: "test2"
    workerMaxPodNum: 50
    workerNum: 1
    workerSpec: "4/8"
    workerSysDiscsize: 100
    workerSysDisktype: ""
    componentParams: [
        {
            name: "istio", 
            version: "1.1.2-5", 
            images: {}, 
            depend: ["helm"], 
            parameters: {},
        },
    ]
}
  • Sample Response(响应):

  • json格式

{
  "code": "0",
  "message": "创建订单成功!",
  "result": {
    "key": ""
  }
}

错误码

以下为本接口特有的错误码。

错误代码 错误信息 Http状态码

删除集群

描述

  • 通过集群Id删除集群

URI

DELETE /cks/cluster/v1/cluster-orders/{clusterId}

请求参数

名称 位置 类型 是否必须 描述
clusterId path String 是 集群id

返回参数

名称 位置 类型 是否必须 描述

示例

  • Sample Request(请求):
DELETE /cks/cluster/v1/cluster-orders/74e7db31-f37f-49ec-93bd-639716357a17
  • 请求Body:


  • Sample Response(响应):

  • json格式

null

错误码

以下为本接口特有的错误码。

错误代码 错误信息 Http状态码

扩容集群

描述

  • 通过openApi方式扩容集群

URI

PUT /cks/cluster/v1/cluster-orders/{clusterId}

请求参数

名称 位置 类型 是否必须 描述
clusterId path String 是 集群id
arch body String 是 cpu架构
billType body String 是 账单类型
clusterId body String 是 集群id
keyPairName body String 否 密钥对
packageCode body String 是 套餐编码
packageName body String 是 套餐名称
password body String 是 节点密码
totalMoney body String 是 总费用
workerNum body integer 是 现有节点数量
workerScaleUpNum body integer 是 扩容节点数量
workerSpec body String 是 节点规格
workerSysDiscsize body integer 是 节点系统盘大小

返回参数

名称 位置 类型 是否必须 描述
code body String 是 返回码,"0"为成功,其他失败
message body String 是 返回信息

示例

  • Sample Request(请求):
PUT /cks/cluster/v1/cluster-orders/85d449e3-a0d8-4e0e-9aef-eba200e0ae9d
  • 请求Body:
{
arch: "x86"
billType: "hourlySettlement"
clusterId: "85d449e3-a0d8-4e0e-9aef-eba200e0ae9d"
keyPairName: null
packageCode: "ice_std_4C8G"
packageName: "S1.xlarge.2"
password: "Cks123456"
totalMoney: "4.1186"
workerNum: 2
workerScaleUpNum: 1
workerSpec: "4/8"
workerSysDiscsize: 100
}
  • Sample Response(响应):

  • json格式

{
  "code": "0",
  "message": "创建订单成功!",
  "result": {
    "key": ""
  }
}

错误码

以下为本接口特有的错误码。

错误代码 错误信息 Http状态码

缩容集群

描述

  • 移出某个节点

URI

DELETE /cks/cluster/v1/cluster-orders/{clusterId}/nodes/{nodeId}

请求参数

名称 位置 类型 是否必须 描述
clusterId path String 是 集群id
nodeId path String 是 节点id

返回参数

名称 位置 类型 是否必须 描述
code body String 是 返回码,"0"为成功,其他失败
message body String 是 返回信息

示例

  • Sample Request(请求):
DELETE /cks/cluster/v1/cluster-orders/85d449e3-a0d8-4e0e-9aef-eba200e0ae9d/nodes/c83f0d10-5418-4c43-bbb2-95ceac492df4
  • 请求Body:


  • Sample Response(响应):

  • json格式

{
  "code": "0",
  "message": "创建订单成功!",
  "result": {
    "key": ""
  }
}

错误码

以下为本接口特有的错误码。

错误代码 错误信息 Http状态码

集群列表

描述

  • 获取所有的集群信息

URI

GET /cks/core/v1/clusters

请求参数

无

返回参数

名称 位置 类型 是否必须 描述
id body String 是 集群id
name body String 是 集群名称
displayName body String 是 集群展示名称
status body String 是 集群状态
eip body String 是 弹性ip
externalIp body String 是 外网ip
useIstio body String 否 是否使用istio
useSlb body String 否 是否使用负载均衡
isShared body String 否 是否是共享集群
arch body String 是 cpu架构信息
k8sVersion body String 是 k8s版本信息

示例

  • Sample Request(请求):
GET /cks/core/v1/clusters
  • Sample Response(响应):

  • json格式

 [
  {
   "id": "b52636d4-6b3b-4d44-b9ed-0429a933bfb0",
   "name": "CKS-20200727174143-240",
   "displayName": "the-cluster-for-xujingsong",
   "status": "running",
   "eip": "117.73.10.56",
   "externalIp": "192.168.202.179",
   "useIstio": true,
   "useSlb": true,
   "isShared": "0",
   "arch": "x64",
   "k8sVersion": "1.20.0"
  },
  ]

错误码

以下为本接口特有的错误码。

错误代码 错误信息 Http状态码
201.002010 获取数据失败,请确认集群信息 500

集群概览

描述

  • 获取集群的概览信息

URI

GET /cks/cluster/v1/clusters/overview

请求参数

名称 位置 类型 是否必须 描述
size param String 否 每页大小
index param String 否 页码
name param String 否 集群名称
status param String 否 集群状态

返回参数

名称 位置 类型 是否必须 描述
totalCount body integer 是 总共数量
recordsFiltered body integer 是 过滤数量
result body Object(List<Cluster>) 是 节点列表

示例

  • Sample Request(请求):
GET /cks/cluster/v1/clusters/overview?size=6&index=1&name=&status=
  • Sample Response(响应):

  • json格式

 "totalCount": 7,
  "recordsFiltered": 6,
  "result": [
    {
      "uuid": "035bd268-8b1d-402d-b306-5734baba35db",
      "name": "CKS-20200728210656-770",
      "displayName": "CKS-20200728210656-770",
      "user": "inspurtest14",
      "status": "installing",
      "createTime": "2020-07-28T21:07:42+08:00",
      "updateTime": 1595941825335,
      "workerNum": 1,
      "goodWorker": 0,
      "floatingIp": "-",
      "prometheusPort": "-",
      "cpuUsed": "-",
      "cpuTotal": "-",
      "memUsed": "-",
      "memTotal": "-",
      "goodNodes": 0,
      "totalNodes": 4,
      "k8sSize": 50,
      "k8sVersion": "1.14.3.1",
      "dockerVersion": "18.09.8",
      "billType": "hourlySettlement",
      "billStartTime": "",
      "billEndTime": "",
      "eipId": "",
      "eip": "",
      "isShared": "0",
      "isHosted": "0",
      "isWokerMountDataDisk": true
    },
    {
      "uuid": "b52636d4-6b3b-4d44-b9ed-0429a933bfb0",
      "name": "CKS-20200727174143-240",
      "displayName": "the-cluster-for-xujingsong",
      "user": "inspurtest14",
      "status": "running",
      "createTime": "2020-07-27T17:44:23+08:00",
      "updateTime": 1596258452355,
      "workerNum": 2,
      "goodWorker": 2,
      "floatingIp": "-",
      "prometheusPort": "-",
      "cpuUsed": "-",
      "cpuTotal": "-",
      "memUsed": "-",
      "memTotal": "-",
      "goodNodes": 5,
      "totalNodes": 5,
      "k8sSize": 50,
      "k8sVersion": "1.14.3.1",
      "dockerVersion": "18.09.8",
      "billType": "monthly",
      "billStartTime": "2020-07-28 00:00:00",
      "billEndTime": "2020-08-28 00:00:00",
      "eipId": "d468f345-886e-4834-9755-b61ae62bc346",
      "eip": "117.73.10.56",
      "isShared": "0",
      "isHosted": "0",
      "isWokerMountDataDisk": true
    },]

错误码

以下为本接口特有的错误码。

错误代码 错误信息 Http状态码
201.002010 获取数据失败,请确认集群信息 500

集群详情

描述

  • 获取一个集群的详情信息

URI

GET /cks/cluster/v1/clusters/{clusterId}

请求参数

名称 位置 类型 是否必须 描述
clusterId path String 是 集群环境ID

返回参数

名称 位置 类型 是否必须 描述
uuid body String 是 集群id
name body String 是 集群名称
displayName body String 是 展示名称
user body String 是 用户名
status body String 是 集群状态
k8sVersion body String 是 kubernetes版本号
dockerVersion body String 是 docker版本号
k8sServiceIpRange body String 是 k8s服务ip地址段
k8sPodIpRange body String 是 k8spodip地址段
workerNum body Integer 是 节点数量
k8sSize body Integer 是 集群规模
billType body String 是 账单类型
vpc body String 是 vpc名称
vpcSubnetId body String 是 vpc子网id
eipId body String 是 弹性ip的id
clusterIps body String 是 集群地址
billStartTime body String 否 账单开始时间
billEndTime body String 否 账单到期时间
remainMonth body String 否 剩余月数
eip body String 是 弹性ip的地址
useIstio body String 是 是否使用istio
createTime body String 是 创建时间
isShared body String 是 是否是共享集群

示例

  • Sample Request(请求):
GET /cks/core/v1/clusters/13e72529-0225-4462-a3ee-7dc4b21e8bfb/nodes
  • Sample Response(响应):

  • json格式

{
 "metadata": {
  "selfLink": "/api/v1/nodes",
  "resourceVersion": "7332"
 },
 "items": [
  {
   "metadata": {
    "name": "slave1",
    "selfLink": "/api/v1/nodes/slave1",
    "uid": "3cc014a2-c4d6-11ea-8cda-fa163ed83fc9",
    "resourceVersion": "7301",
    "creationTimestamp": "2020-07-13T06:58:20Z",
    "labels": {
     "beta.kubernetes.io/arch": "amd64",
     "beta.kubernetes.io/os": "linux",
     "kubernetes.io/arch": "amd64",
     "kubernetes.io/hostname": "slave1",
     "kubernetes.io/os": "linux",
     "node-role.kubernetes.io/node": "true"
    },
    "annotations": {
     "node.alpha.kubernetes.io/ttl": "0",
     "node.beta.kubernetes.io/instance-id": "1b705524-ff08-4ec9-afce-9c3720183397",
     "node.beta.kubernetes.io/node-resources": "4C/8G/100G"
    }
   },
   "allocatedResources": {
    "cpuRequests": 2810,
    "cpuRequestsFraction": 70.25,
    "cpuLimits": 9500,
    "cpuLimitsFraction": 237.5,
    "cpuCapacity": 4000,
    "memoryRequests": 4705962496,
    "memoryRequestsFraction": 57.66999451869417,
    "memoryLimits": 17326717952,
    "memoryLimitsFraction": 212.33312636216976,
    "memoryCapacity": 8160157696,
    "allocatedPods": 23,
    "podCapacity": 50,
    "podFraction": 46
   },
   "spec": {},
   "status": {
    "capacity": {
     "cpu": "4",
     "ephemeral-storage": "102947748Ki",
     "hugepages-1Gi": "0",
     "hugepages-2Mi": "0",
     "memory": "7968904Ki",
     "pods": "50"
    },
    "allocatable": {
     "cpu": "3400m",
     "ephemeral-storage": "97704868Ki",
     "hugepages-1Gi": "0",
     "hugepages-2Mi": "0",
     "memory": "6944616Ki",
     "pods": "50"
    },
    "conditions": [
     {
      "type": "NetworkUnavailable",
      "status": "False",
      "lastHeartbeatTime": "2020-07-13T07:02:52Z",
      "lastTransitionTime": "2020-07-13T07:02:52Z",
      "reason": "CalicoIsUp",
      "message": "Calico is running on this node"
     },
     {
      "type": "MemoryPressure",
      "status": "False",
      "lastHeartbeatTime": "2020-07-13T07:49:24Z",
      "lastTransitionTime": "2020-07-13T06:58:20Z",
      "reason": "KubeletHasSufficientMemory",
      "message": "kubelet has sufficient memory available"
     },
     {
      "type": "DiskPressure",
      "status": "False",
      "lastHeartbeatTime": "2020-07-13T07:49:24Z",
      "lastTransitionTime": "2020-07-13T06:58:20Z",
      "reason": "KubeletHasNoDiskPressure",
      "message": "kubelet has no disk pressure"
     },
     {
      "type": "PIDPressure",
      "status": "False",
      "lastHeartbeatTime": "2020-07-13T07:49:24Z",
      "lastTransitionTime": "2020-07-13T06:58:20Z",
      "reason": "KubeletHasSufficientPID",
      "message": "kubelet has sufficient PID available"
     },
     {
      "type": "Ready",
      "status": "True",
      "lastHeartbeatTime": "2020-07-13T07:49:24Z",
      "lastTransitionTime": "2020-07-13T07:22:54Z",
      "reason": "KubeletReady",
      "message": "kubelet is posting ready status. AppArmor enabled"
     }
    ],
    "addresses": [
     {
      "type": "InternalIP",
      "address": "192.168.202.133"
     },
     {
      "type": "Hostname",
      "address": "slave1"
     }
    ],
    "daemonEndpoints": {
     "kubeletEndpoint": {
      "Port": 10250
     }
    },
    "nodeInfo": {
     "machineID": "baff2a34ece3474eb19aff48aad941bc",
     "systemUUID": "1b705524-ff08-4ec9-afce-9c3720183397",
     "bootID": "f70937b2-04dc-4b9b-aec0-5d3c8d8745c6",
     "kernelVersion": "5.0.0-29-generic",
     "osImage": "Ubuntu 18.04.3 LTS",
     "containerRuntimeVersion": "docker://18.9.8",
     "kubeletVersion": "v1.14.3",
     "kubeProxyVersion": "v1.14.3",
     "operatingSystem": "linux",
     "architecture": "amd64"
    },
    "images": [
     {
      "names": [
       "registry.inspurcloud.cn/library/cke/kubernetes/hyperkube-amd64@sha256:b24948092eaa70a715708ff70db44ec36463cce4bae32e7edf279f703ab64c52",
       "registry.inspurcloud.cn/library/cke/kubernetes/hyperkube-amd64:v1.14.3-11"
      ],
      "sizeBytes": 547316726
     },
     {
      "names": [
       "registry.inspurcloud.cn/library/plover/istio/kubectl@sha256:e18531c94c3d1ddb8a9ea821459d036619e8872b3c76b7d4fa0c8d0d5f944074",
       "registry.inspurcloud.cn/library/plover/istio/kubectl:1.1.2"
      ],
      "sizeBytes": 471734065
     },

    ]
   },
   "use": {
    "useCPU": "3.284883823",
    "useMemory": "2.370441436767578"
   }
  }
 ]
}

错误码

以下为本接口特有的错误码。

错误代码 错误信息 Http状态码
201.002010 获取数据失败,请确认集群信息 500

集群绑定弹性IP

描述

  • 为集群绑定弹性IP

URI

POST /cks/cluster/v1/clusters/addeip

请求参数

名称 位置 类型 是否必须 描述
clusterId body String 是 集群id
eipId body String 是 弹性ip的id
eipAddress body String 是 弹性ip的地址

返回参数

名称 位置 类型 是否必须 描述

示例

  • Sample Request(请求):
POST /cks/cluster/v1/clusters/addeip
  • 请求Body:
{
clusterId: "85d449e3-a0d8-4e0e-9aef-eba200e0ae9d"
eipAddress: "117.73.8.77"
eipId: "2c41a906-6928-40b2-9bf3-00d0b75659d5"
}
  • Sample Response(响应):

  • json格式

null

错误码

以下为本接口特有的错误码。

错误代码 错误信息 Http状态码

集群解绑弹性IP

描述

  • 为集群解绑弹性IP

URI

POST /cks/cluster/v1/clusters/removeeip

请求参数

名称 位置 类型 是否必须 描述
clusterId body String 是 集群id
eipId body String 是 弹性ip的id

返回参数

名称 位置 类型 是否必须 描述

示例

  • Sample Request(请求):
POST /cks/cluster/v1/clusters/removeeip
  • 请求Body:
{
clusterId: "85d449e3-a0d8-4e0e-9aef-eba200e0ae9d"
eipId: "2c41a906-6928-40b2-9bf3-00d0b75659d5"
}
  • Sample Response(响应):

  • json格式

null

错误码

以下为本接口特有的错误码。

错误代码 错误信息 Http状态码

节点列表

描述

  • 获取一个集群的工作节点列表

URI

GET /cks/core/v1/clusters/{clusterId}/nodes

请求参数

名称 位置 类型 是否必须 描述
clusterId path String 是 集群环境ID

返回参数

名称 位置 类型 是否必须 描述
metadata body Object(ObjectMeta) 是 Standard metadata
items body Object(List<Node>) 是 节点列表

示例

  • Sample Request(请求):
GET /cks/core/v1/clusters/13e72529-0225-4462-a3ee-7dc4b21e8bfb/nodes
  • Sample Response(响应):

  • json格式

{
 "metadata": {
  "selfLink": "/api/v1/nodes",
  "resourceVersion": "7332"
 },
 "items": [
  {
   "metadata": {
    "name": "slave1",
    "selfLink": "/api/v1/nodes/slave1",
    "uid": "3cc014a2-c4d6-11ea-8cda-fa163ed83fc9",
    "resourceVersion": "7301",
    "creationTimestamp": "2020-07-13T06:58:20Z",
    "labels": {
     "beta.kubernetes.io/arch": "amd64",
     "beta.kubernetes.io/os": "linux",
     "kubernetes.io/arch": "amd64",
     "kubernetes.io/hostname": "slave1",
     "kubernetes.io/os": "linux",
     "node-role.kubernetes.io/node": "true"
    },
    "annotations": {
     "node.alpha.kubernetes.io/ttl": "0",
     "node.beta.kubernetes.io/instance-id": "1b705524-ff08-4ec9-afce-9c3720183397",
     "node.beta.kubernetes.io/node-resources": "4C/8G/100G"
    }
   },
   "allocatedResources": {
    "cpuRequests": 2810,
    "cpuRequestsFraction": 70.25,
    "cpuLimits": 9500,
    "cpuLimitsFraction": 237.5,
    "cpuCapacity": 4000,
    "memoryRequests": 4705962496,
    "memoryRequestsFraction": 57.66999451869417,
    "memoryLimits": 17326717952,
    "memoryLimitsFraction": 212.33312636216976,
    "memoryCapacity": 8160157696,
    "allocatedPods": 23,
    "podCapacity": 50,
    "podFraction": 46
   },
   "spec": {},
   "status": {
    "capacity": {
     "cpu": "4",
     "ephemeral-storage": "102947748Ki",
     "hugepages-1Gi": "0",
     "hugepages-2Mi": "0",
     "memory": "7968904Ki",
     "pods": "50"
    },
    "allocatable": {
     "cpu": "3400m",
     "ephemeral-storage": "97704868Ki",
     "hugepages-1Gi": "0",
     "hugepages-2Mi": "0",
     "memory": "6944616Ki",
     "pods": "50"
    },
    "conditions": [
     {
      "type": "NetworkUnavailable",
      "status": "False",
      "lastHeartbeatTime": "2020-07-13T07:02:52Z",
      "lastTransitionTime": "2020-07-13T07:02:52Z",
      "reason": "CalicoIsUp",
      "message": "Calico is running on this node"
     },
     {
      "type": "MemoryPressure",
      "status": "False",
      "lastHeartbeatTime": "2020-07-13T07:49:24Z",
      "lastTransitionTime": "2020-07-13T06:58:20Z",
      "reason": "KubeletHasSufficientMemory",
      "message": "kubelet has sufficient memory available"
     },
     {
      "type": "DiskPressure",
      "status": "False",
      "lastHeartbeatTime": "2020-07-13T07:49:24Z",
      "lastTransitionTime": "2020-07-13T06:58:20Z",
      "reason": "KubeletHasNoDiskPressure",
      "message": "kubelet has no disk pressure"
     },
     {
      "type": "PIDPressure",
      "status": "False",
      "lastHeartbeatTime": "2020-07-13T07:49:24Z",
      "lastTransitionTime": "2020-07-13T06:58:20Z",
      "reason": "KubeletHasSufficientPID",
      "message": "kubelet has sufficient PID available"
     },
     {
      "type": "Ready",
      "status": "True",
      "lastHeartbeatTime": "2020-07-13T07:49:24Z",
      "lastTransitionTime": "2020-07-13T07:22:54Z",
      "reason": "KubeletReady",
      "message": "kubelet is posting ready status. AppArmor enabled"
     }
    ],
    "addresses": [
     {
      "type": "InternalIP",
      "address": "192.168.202.133"
     },
     {
      "type": "Hostname",
      "address": "slave1"
     }
    ],
    "daemonEndpoints": {
     "kubeletEndpoint": {
      "Port": 10250
     }
    },
    "nodeInfo": {
     "machineID": "baff2a34ece3474eb19aff48aad941bc",
     "systemUUID": "1b705524-ff08-4ec9-afce-9c3720183397",
     "bootID": "f70937b2-04dc-4b9b-aec0-5d3c8d8745c6",
     "kernelVersion": "5.0.0-29-generic",
     "osImage": "Ubuntu 18.04.3 LTS",
     "containerRuntimeVersion": "docker://18.9.8",
     "kubeletVersion": "v1.14.3",
     "kubeProxyVersion": "v1.14.3",
     "operatingSystem": "linux",
     "architecture": "amd64"
    },
    "images": [
     {
      "names": [
       "registry.inspurcloud.cn/library/cke/kubernetes/hyperkube-amd64@sha256:b24948092eaa70a715708ff70db44ec36463cce4bae32e7edf279f703ab64c52",
       "registry.inspurcloud.cn/library/cke/kubernetes/hyperkube-amd64:v1.14.3-11"
      ],
      "sizeBytes": 547316726
     },
     {
      "names": [
       "registry.inspurcloud.cn/library/plover/istio/kubectl@sha256:e18531c94c3d1ddb8a9ea821459d036619e8872b3c76b7d4fa0c8d0d5f944074",
       "registry.inspurcloud.cn/library/plover/istio/kubectl:1.1.2"
      ],
      "sizeBytes": 471734065
     },

    ]
   },
   "use": {
    "useCPU": "3.284883823",
    "useMemory": "2.370441436767578"
   }
  }
 ]
}

错误码

以下为本接口特有的错误码。

错误代码 错误信息 Http状态码
201.002010 获取数据失败,请确认集群信息 500

节点详情

描述

  • 获取一个集群的某个工作节点的详情信息

URI

GET /cks/core/v1/clusters/{clusterId}/nodes/{nodeName}

请求参数

名称 位置 类型 是否必须 描述
clusterId path String 是 集群环境ID

返回参数

名称 位置 类型 是否必须 描述
metadata body Object(ObjectMeta) 是 Standard metadata
items body Object(List<Node>) 是 节点列表

示例

  • Sample Request(请求):
GET /cks/core/v1/clusters/13e72529-0225-4462-a3ee-7dc4b21e8bfb/nodes/slave1
  • Sample Response(响应):

  • json格式

{
 "objectMeta": {
  "name": "slave1",
  "labels": {
   "beta.kubernetes.io/arch": "amd64",
   "beta.kubernetes.io/os": "linux",
   "kubernetes.io/arch": "amd64",
   "kubernetes.io/hostname": "slave1",
   "kubernetes.io/os": "linux",
   "node-role.kubernetes.io/node": "true"
  },
  "annotations": {
   "node.alpha.kubernetes.io/ttl": "0",
   "node.beta.kubernetes.io/instance-id": "0a06e522-73f0-4aae-8131-b1865fbfac6b",
   "node.beta.kubernetes.io/node-resources": "8C/32G/200G"
  },
  "creationTimestamp": "2020-01-10T14:40:55Z"
 },
 "typeMeta": {
  "kind": "node"
 },
 "phase": "",
 "allocatedResources": {
  "cpuRequests": 3230,
  "cpuRequestsFraction": 40.375,
  "cpuLimits": 7060,
  "cpuLimitsFraction": 88.25,
  "cpuCapacity": 8000,
  "memoryRequests": 13646168064,
  "memoryRequestsFraction": 40.456727511532584,
  "memoryLimits": 6557111296,
  "memoryLimitsFraction": 19.439835690203637,
  "memoryCapacity": 33730281472,
  "allocatedPods": 16,
  "podCapacity": 110,
  "podFraction": 14.545454545454545
 },
 "podCIDR": "10.151.1.0/24",
 "providerID": "",
 "unschedulable": false,
 "nodeInfo": {
  "machineID": "a87d37f9c4d74e9eb672b97b5dd0c818",
  "systemUUID": "0A06E522-73F0-4AAE-8131-B1865FBFAC6B",
  "bootID": "90f7ea29-7d1b-4b20-a2bc-3df080251bfd",
  "kernelVersion": "4.15.0-45-generic",
  "osImage": "Ubuntu 18.04.2 LTS",
  "containerRuntimeVersion": "docker://18.6.3",
  "kubeletVersion": "v1.14.3",
  "kubeProxyVersion": "v1.14.3",
  "operatingSystem": "linux",
  "architecture": "amd64"
 },
 "conditions": [
  {
   "type": "NetworkUnavailable",
   "status": "False",
   "lastProbeTime": "2020-04-30T14:48:23Z",
   "lastTransitionTime": "2020-04-30T14:48:23Z",
   "reason": "CalicoIsUp",
   "message": "Calico is running on this node"
  },
  {
   "type": "MemoryPressure",
   "status": "False",
   "lastProbeTime": "2020-08-24T09:40:58Z",
   "lastTransitionTime": "2020-06-22T16:21:10Z",
   "reason": "KubeletHasSufficientMemory",
   "message": "kubelet has sufficient memory available"
  },
  {
   "type": "DiskPressure",
   "status": "False",
   "lastProbeTime": "2020-08-24T09:40:58Z",
   "lastTransitionTime": "2020-06-22T16:21:10Z",
   "reason": "KubeletHasNoDiskPressure",
   "message": "kubelet has no disk pressure"
  },
  {
   "type": "PIDPressure",
   "status": "False",
   "lastProbeTime": "2020-08-24T09:40:58Z",
   "lastTransitionTime": "2020-06-22T16:21:10Z",
   "reason": "KubeletHasSufficientPID",
   "message": "kubelet has sufficient PID available"
  },
  {
   "type": "Ready",
   "status": "True",
   "lastProbeTime": "2020-08-24T09:40:58Z",
   "lastTransitionTime": "2020-06-22T16:21:10Z",
   "reason": "KubeletReady",
   "message": "kubelet is posting ready status. AppArmor enabled"
  }
 ],
 "containerImages": [
  "kingproxj/python-serviceless@sha256:6e67ef2be22c5b8cb2755f1f76bb7c0afd7d1622652434f4434ac9a69114076c",
  "snoopylovecatty/es@sha256:e2386ddc70a6f02770e05967e39f9a9a0b0346875f91aefe7c04c79577f89d2b",
  "snoopylovecatty/es:latest",
  "registry.inspurcloud.cn/library/iop/gcr.io/google-containers/hyperkube@sha256:b4c0d9771bf28a716d0003fbb6c4abc42f445dc3e6ce4fad0c5de57eae9f6982",
  "registry.inspurcloud.cn/library/iop/gcr.io/google-containers/hyperkube:v1.14.3.5",
  "registry.inspurcloud.cn/library/elasticsearch/elasticsearch-oss@sha256:dc3a3331e7cf01175a214e8b5ebfade2a8736044d5f38d205a553988392b8d84",
  "registry.inspurcloud.cn/library/elasticsearch/elasticsearch-oss:6.4.0",
  "docker.elastic.co/kibana/kibana@sha256:b64d22a2ff6652797ae42b1e695cc65b6cbb339b307f501c6e06b931eb563c68",
  "docker.elastic.co/kibana/kibana:5.6.4",
  "registry.inspurcloud.cn/picp_inspurtest14/hub-maven8@sha256:429ebca0f7036dd5793f0a16188ebab45dd31de9bf4185b058423344f006e499",
  "registry.inspurcloud.cn/library/cke/kubernetes/hyperkube-amd64@sha256:b24948092eaa70a715708ff70db44ec36463cce4bae32e7edf279f703ab64c52",
  "registry.inspurcloud.cn/library/cke/kubernetes/hyperkube-amd64:v1.14.3-11",
  "registry.inspurcloud.cn/library/iop/gcr.io/google-containers/hyperkube@sha256:893430e683277ab6e038dbb330d77610df8d592f8efac6758c058c649436eb93",
  "registry.inspurcloud.cn/library/iop/gcr.io/google-containers/hyperkube:v1.14.3-9",
  "registry.inspurcloud.cn/library/iop/gcr.io/google-containers/hyperkube@sha256:a6acdfd5fd9a84c979dee517b0c04316bbbc74586fee7faab790d59d6844635e",
  "registry.inspurcloud.cn/library/iop/gcr.io/google-containers/hyperkube:v1.14.3-7",
  "registry.inspurcloud.cn/library/plover/istio/kubectl@sha256:e18531c94c3d1ddb8a9ea821459d036619e8872b3c76b7d4fa0c8d0d5f944074",
  "registry.inspurcloud.cn/library/plover/istio/kubectl:1.1.2",
  "registry.inspurcloud.cn/library/db/mysql@sha256:49f6cb7658627d9e8cd3ef2952579e230be85e05b4b7911119a4d8eb5eb7a2d8",
  "registry.inspurcloud.cn/library/db/mysql:5.7.22",
  "registry.inspurcloud.cn/picp_inspurtest14/library/iop/antrea/antrea-ubuntu@sha256:f63b7cb0d025525a0c97f5c4bc6329d46932236eb9f87d6d0361e3d04a35bc0c",
  "registry.inspurcloud.cn/picp_inspurtest14/library/iop/antrea/antrea-ubuntu:v0.5.0",
  "registry.inspurcloud.cn/library/plover/istio/galley@sha256:6a2c687277881cac5a14f68be1e58cca5b76068f2ac1cccb61ec44578af5b215",
  "registry.inspurcloud.cn/library/plover/istio/galley:1.1.2",
  "registry.inspurcloud.cn/library/plover/istio/proxyv2@sha256:fb2fb815c30edace74ea59f68978cd4c798b823b5ac059f138a1a1667ecae278",
  "registry.inspurcloud.cn/library/plover/istio/proxyv2:1.1.2.1",
  "registry.inspurcloud.cn/library/common/grafana@sha256:8b6d7378dcada01c0d391ddcac7b7cf517fbb6e5c1ab3844048e0808f59c5b97",
  "registry.inspurcloud.cn/library/common/grafana:6.0.2",
  "kingproxj/demo-go-show@sha256:b338494d9198f9ac5329cb5abb07d1f642a370f0d6950548f8da78ee48cd527b",
  "registry.inspurcloud.cn/library/iop/quay.io/calico/node-amd64@sha256:24258a33488dbb39c4c54260a43e4d8c7b16283d53dfcc757ba6580ea833a87a",
  "registry.inspurcloud.cn/library/iop/quay.io/calico/node-amd64:v3.8.0",
  "registry.inspurcloud.cn/service/lma/fluentd@sha256:51da4804d9185ec394a58452d80bd7eb464cff4c7b6171688e5b08b393742a3a",
  "registry.inspurcloud.cn/service/lma/fluentd:1.7.4-2",
  "registry.inspurcloud.cn/library/iop/cke/ntpd/ntpd-amd64@sha256:edb8657e014bd2cd0b947136e396737e978c2ac5aa2dcea6ae78325e87528448",
  "registry.inspurcloud.cn/library/iop/cke/ntpd/ntpd-amd64:v4.2.8",
  "registry.inspurcloud.cn/library/iop/quay.io/calico/cni-amd64@sha256:0dfb30856abb7fa3b4dc747a2fc240adc32030b960740948b0951624a5be14e3",
  "registry.inspurcloud.cn/library/iop/quay.io/calico/cni-amd64:v3.8.0",
  "registry.inspurcloud.cn/library/iop/fluentd-plugin@sha256:092ea4d8b888ab8746cd517cc6831ce550ad46df4498a6d820429933417201ad",
  "registry.inspurcloud.cn/library/iop/fluentd-plugin:v2.3.1",
  "registry.inspurcloud.cn/library/cke/provisioner/local-static-provisioner@sha256:ec2e890f3a0df72b992934475ba1a001a653a9cfecad3d579a355f7108f0ae1a",
  "registry.inspurcloud.cn/library/cke/provisioner/local-static-provisioner:v2.3.3-3",
  "registry.inspurcloud.cn/library/iop/nginx@sha256:ec3b09634ad6b611e2e0969a3c0f2a66658ce5b1d3c18706442f0e54cf1d68f6",
  "registry.inspurcloud.cn/library/iop/nginx:1.17.5",
  "registry.inspurcloud.cn/library/plover/istio/proxy_init@sha256:ee3ddf3851108066abdc19f87c6c29c1f6a1c2b276965526b28891f2d024c9f5",
  "registry.inspurcloud.cn/library/plover/istio/proxy_init:1.1.2",
  "snoopylovecatty/prometheus@sha256:844c154f3953c26a9f68d6ba5dc0b00b918ac6e7d644ea2823db318749b6e6b0",
  "snoopylovecatty/prometheus:latest",
  "registry.inspurcloud.cn/library/plover/istio/mixer@sha256:1e8450f7dc7d08e7383e85ba0ec08811a8b12a4df349bc5e70599a135d0495fb",
  "registry.inspurcloud.cn/library/plover/istio/mixer:1.1.2",
  "jimmysong/knative-serving-cmd-autoscaler@sha256:93b85073d198e610ea3080ac01d536b084cdff1d73df261adeea3289689ad6e3",
  "jimmysong/knative-serving-cmd-autoscaler:0.9",
  "jimmysong/knative-serving-cmd-controller@sha256:3821caa8985147fb0a1f05ffbdfc5ca24b55ba9bf172e8a844f2ba178c3a783e",
  "jimmysong/knative-serving-cmd-controller:0.9",
  "registry.inspurcloud.cn/library/plover/istio/citadel@sha256:fdb7f00c49ed2e078925ab799c730fd0e90f8c455bd0e4eea7de1c958bcba7e8",
  "registry.inspurcloud.cn/library/plover/istio/citadel:1.1.2",
  "jimmysong/knative-serving-cmd-activator@sha256:85f0344d07f7deb40bac2250663f6172a9fc0c73b03ac6189b26793862b6425d",
  "jimmysong/knative-serving-cmd-activator:0.9",
  "jimmysong/knative-serving-cmd-autoscaler-hpa@sha256:99376fc1a6dd22c4f4484b09fe9a91bdc1557a0bf1039d6c25dc5757e33a20f9",
  "jimmysong/knative-serving-cmd-autoscaler-hpa:0.9",
  "snoopylovecatty/knative-serving-activator@sha256:0fe93a23a9a4d5ae8aeabe98ab18931ab533cdc9b8ffde040759182386cbcac9",
  "snoopylovecatty/knative-serving-activator:latest",
  "jimmysong/knative-serving-cmd-networking-istio@sha256:55b26c29fbda2c7820126b37a99f73134e2ded9264528e8f1f2abc9f24fcd059",
  "jimmysong/knative-serving-cmd-networking-istio:0.9",
  "jimmysong/knative-serving-cmd-webhook@sha256:bdb9a9baa7103c16663313931e942a4be9b0b89a9eec3a76318f16f8dc8245da",
  "jimmysong/knative-serving-cmd-webhook:0.9",
  "snoopylovecatty/knative-serving-queue@sha256:aa1e72e3e00685ca646691c4f3b09e1ff99b0dc15e5a16efba8d23d506218e9e",
  "snoopylovecatty/knative-serving-queue:latest",
  "jimmysong/knative-serving-cmd-queue@sha256:067ae0828698bbfddfe8744c75fc0a6995221333af34a29c26aea7ea57103b7c",
  "jimmysong/knative-serving-cmd-queue:0.9",
  "snoopylovecatty/kube-rbac-proxy@sha256:d3372eb162bf62105cda9c22d985aeac48602174682316e192c40fd19e52a1fc",
  "quay.io/coreos/kube-rbac-proxy@sha256:7d0a3a7d959c5318a9449b87058414065bfbe51c83182d707e34f49f5ecfe141",
  "snoopylovecatty/kube-rbac-proxy:latest",
  "quay.io/coreos/kube-rbac-proxy:v0.3.0",
  "quay.io/coreos/kube-state-metrics@sha256:f053462579a86ff5b14941635b659089dae31e207472b72551d5f7339b143a54",
  "quay.io/coreos/kube-state-metrics:v1.3.0",
  "registry.inspurcloud.cn/library/iop/iop_containers/node-exporter@sha256:3c42a1967c65c53fdf7256f900925e848a765931a572fac32cc8b9165feb380c",
  "registry.inspurcloud.cn/library/iop/iop_containers/node-exporter:v0.16.0",
  "snoopylovecatty/prometheus-node-exporter@sha256:86f3cafaa6c572d5e05ff7ff23ca7f022fed1f0f461b7daba8ef52da2faf4e37",
  "quay.io/prometheus/node-exporter@sha256:0c7dd2350bed76fce17dff8bd2a2ac599bc989c7328eb77b0751b8024cf0457d",
  "snoopylovecatty/prometheus-node-exporter:latest",
  "quay.io/prometheus/node-exporter:v0.15.2",
  "alpine@sha256:66790a2b79e1ea3e1dabac43990c54aca5d1ddf268d9a5a0285e4167c8b24475",
  "alpine:3.6",
  "registry.inspurcloud.cn/library/iop/busybox@sha256:179cf024c8a22f1621ea012bfc84b0df7e393cb80bf3638ac80e30d23e69147f",
  "registry.inspurcloud.cn/library/iop/busybox:latest",
  "registry.inspurcloud.cn/library/iop/gcr.io/google_containers/pause-amd64@sha256:759c3f0f6493093a9043cc813092290af69029699ade0e3dbe024e968fcb7cca",
  "registry.inspurcloud.cn/library/iop/gcr.io/google_containers/pause-amd64:3.1",
  "snoopylovecatty/helloworld@sha256:92c7f9c92844bbbb5d0a101b22f7c2a7949e40f8ea90c8b3bc396879d95e899a"
 ],
 "podList": {
  "listMeta": {
   "totalItems": 16
  },
  "cumulativeMetrics": [],
  "status": {
   "running": 0,
   "pending": 0,
   "failed": 0,
   "succeeded": 0
  },
  "pods": [
   {
    "objectMeta": {
     "name": "app-wdvri-elasticsearch-data-0",
     "namespace": "es",
     "labels": {
      "app": "elasticsearch",
      "component": "data",
      "controller-revision-hash": "app-wdvri-elasticsearch-data-5d78758998",
      "cpuLimit": "2000",
      "cpuRequest": "1000",
      "deployment": "app-wdvri",
      "memoryLimit": "0",
      "memoryRequest": "8589934592",
      "release": "app-wdvri",
      "statefulset.kubernetes.io/pod-name": "app-wdvri-elasticsearch-data-0",
      "user": "inspurcloud-productdepartment",
      "user_group": "group-inspurcloud-productdepartment"
     },
     "creationTimestamp": "2020-02-14T10:20:08Z"
    },
    "typeMeta": {
     "kind": "pod"
    },
    "podStatus": {
     "status": "Running",
     "podPhase": "Running",
     "containerStates": [
      {
       "running": {
        "startedAt": "2020-02-14T10:21:07Z"
       }
      }
     ]
    },
    "restartCount": 0,
    "metrics": null,
    "warnings": [],
    "nodeName": "slave1"
   },
   {
    "objectMeta": {
     "name": "app-wdvri-elasticsearch-master-0",
     "namespace": "es",
     "labels": {
      "app": "elasticsearch",
      "component": "master",
      "controller-revision-hash": "app-wdvri-elasticsearch-master-785854b654",
      "cpuLimit": "2000",
      "cpuRequest": "1000",
      "deployment": "app-wdvri",
      "memoryLimit": "0",
      "memoryRequest": "4294967296",
      "release": "app-wdvri",
      "statefulset.kubernetes.io/pod-name": "app-wdvri-elasticsearch-master-0",
      "user": "inspurcloud-productdepartment",
      "user_group": "group-inspurcloud-productdepartment"
     },
     "creationTimestamp": "2020-01-19T02:04:45Z"
    },
    "typeMeta": {
     "kind": "pod"
    },
    "podStatus": {
     "status": "Running",
     "podPhase": "Running",
     "containerStates": [
      {
       "running": {
        "startedAt": "2020-01-20T02:40:48Z"
       }
      }
     ]
    },
    "restartCount": 0,
    "metrics": null,
    "warnings": [],
    "nodeName": "slave1"
   },
   {
    "objectMeta": {
     "name": "grafana-79cd9fcdf6-tqjnp",
     "namespace": "istio-system",
     "labels": {
      "app": "grafana",
      "chart": "grafana",
      "cpuLimit": "0",
      "cpuRequest": "10",
      "heritage": "Tiller",
      "memoryLimit": "0",
      "memoryRequest": "0",
      "pod-template-hash": "79cd9fcdf6",
      "release": "istio"
     },
     "annotations": {
      "scheduler.alpha.kubernetes.io/critical-pod": "",
      "sidecar.istio.io/inject": "false"
     },
     "creationTimestamp": "2020-01-10T14:51:34Z"
    },
    "typeMeta": {
     "kind": "pod"
    },
    "podStatus": {
     "status": "Running",
     "podPhase": "Running",
     "containerStates": [
      {
       "running": {
        "startedAt": "2020-01-10T14:52:04Z"
       }
      }
     ]
    },
    "restartCount": 0,
    "metrics": null,
    "warnings": [],
    "nodeName": "slave1"
   },
   {
    "objectMeta": {
     "name": "istio-citadel-5777f95b8f-5sq4s",
     "namespace": "istio-system",
     "labels": {
      "app": "security",
      "chart": "security",
      "cpuLimit": "0",
      "cpuRequest": "10",
      "heritage": "Tiller",
      "istio": "citadel",
      "memoryLimit": "0",
      "memoryRequest": "0",
      "pod-template-hash": "5777f95b8f",
      "release": "istio"
     },
     "annotations": {
      "scheduler.alpha.kubernetes.io/critical-pod": "",
      "sidecar.istio.io/inject": "false"
     },
     "creationTimestamp": "2020-01-10T14:51:38Z"
    },
    "typeMeta": {
     "kind": "pod"
    },
    "podStatus": {
     "status": "Running",
     "podPhase": "Running",
     "containerStates": [
      {
       "running": {
        "startedAt": "2020-01-10T14:52:03Z"
       }
      }
     ]
    },
    "restartCount": 0,
    "metrics": null,
    "warnings": [],
    "nodeName": "slave1"
   },
   {
    "objectMeta": {
     "name": "istio-galley-6544d5b78c-dzgmf",
     "namespace": "istio-system",
     "labels": {
      "app": "galley",
      "chart": "galley",
      "cpuLimit": "0",
      "cpuRequest": "10",
      "heritage": "Tiller",
      "istio": "galley",
      "memoryLimit": "0",
      "memoryRequest": "0",
      "pod-template-hash": "6544d5b78c",
      "release": "istio"
     },
     "annotations": {
      "scheduler.alpha.kubernetes.io/critical-pod": "",
      "sidecar.istio.io/inject": "false"
     },
     "creationTimestamp": "2020-08-16T19:31:15Z"
    },
    "typeMeta": {
     "kind": "pod"
    },
    "podStatus": {
     "status": "Running",
     "podPhase": "Running",
     "containerStates": [
      {
       "running": {
        "startedAt": "2020-08-16T19:31:24Z"
       }
      }
     ]
    },
    "restartCount": 0,
    "metrics": null,
    "warnings": [],
    "nodeName": "slave1"
   },
   {
    "objectMeta": {
     "name": "istio-ingressgateway-76778bbd4d-4gx7f",
     "namespace": "istio-system",
     "labels": {
      "app": "istio-ingressgateway",
      "chart": "gateways",
      "cpuLimit": "0",
      "cpuRequest": "10",
      "heritage": "Tiller",
      "istio": "ingressgateway",
      "memoryLimit": "0",
      "memoryRequest": "0",
      "pod-template-hash": "76778bbd4d",
      "release": "istio"
     },
     "annotations": {
      "scheduler.alpha.kubernetes.io/critical-pod": "",
      "sidecar.istio.io/inject": "false"
     },
     "creationTimestamp": "2020-01-10T14:51:34Z"
    },
    "typeMeta": {
     "kind": "pod"
    },
    "podStatus": {
     "status": "Running",
     "podPhase": "Running",
     "containerStates": [
      {
       "running": {
        "startedAt": "2020-01-10T14:52:22Z"
       }
      }
     ]
    },
    "restartCount": 0,
    "metrics": null,
    "warnings": [],
    "nodeName": "slave1"
   },
   {
    "objectMeta": {
     "name": "istio-policy-685b76fcbd-5jzpl",
     "namespace": "istio-system",
     "labels": {
      "app": "policy",
      "chart": "mixer",
      "cpuLimit": "0",
      "cpuRequest": "110",
      "heritage": "Tiller",
      "istio": "mixer",
      "istio-mixer-type": "policy",
      "memoryLimit": "0",
      "memoryRequest": "0",
      "pod-template-hash": "685b76fcbd",
      "release": "istio"
     },
     "annotations": {
      "scheduler.alpha.kubernetes.io/critical-pod": "",
      "sidecar.istio.io/inject": "false"
     },
     "creationTimestamp": "2020-06-26T06:52:24Z"
    },
    "typeMeta": {
     "kind": "pod"
    },
    "podStatus": {
     "status": "Running",
     "podPhase": "Running",
     "containerStates": [
      {
       "running": {
        "startedAt": "2020-06-26T06:52:42Z"
       }
      },
      {
       "running": {
        "startedAt": "2020-06-26T06:52:38Z"
       }
      }
     ]
    },
    "restartCount": 0,
    "metrics": null,
    "warnings": [],
    "nodeName": "slave1"
   },
   {
    "objectMeta": {
     "name": "kibana-logging-7cb6b64bff-dwg2g",
     "namespace": "knative-monitoring",
     "labels": {
      "app": "kibana-logging",
      "cpuLimit": "1000",
      "cpuRequest": "100",
      "memoryLimit": "0",
      "memoryRequest": "0",
      "pod-template-hash": "7cb6b64bff"
     },
     "creationTimestamp": "2020-02-07T13:46:39Z"
    },
    "typeMeta": {
     "kind": "pod"
    },
    "podStatus": {
     "status": "Running",
     "podPhase": "Running",
     "containerStates": [
      {
       "running": {
        "startedAt": "2020-02-12T18:54:43Z"
       }
      }
     ]
    },
    "restartCount": 0,
    "metrics": null,
    "warnings": [],
    "nodeName": "slave1"
   },
   {
    "objectMeta": {
     "name": "kube-state-metrics-5cd9695cdf-kpgb6",
     "namespace": "knative-monitoring",
     "labels": {
      "app": "kube-state-metrics",
      "cpuLimit": "140",
      "cpuRequest": "120",
      "memoryLimit": "115343360",
      "memoryRequest": "73400320",
      "pod-template-hash": "5cd9695cdf"
     },
     "creationTimestamp": "2020-02-07T13:46:39Z"
    },
    "typeMeta": {
     "kind": "pod"
    },
    "podStatus": {
     "status": "Failed",
     "podPhase": "Pending",
     "containerStates": [
      {
       "waiting": {
        "reason": "ImagePullBackOff",
        "message": "Back-off pulling image \"k8s.gcr.io/addon-resizer:1.7\""
       }
      },
      {
       "running": {
        "startedAt": "2020-02-07T13:47:04Z"
       }
      },
      {
       "running": {
        "startedAt": "2020-02-07T13:47:08Z"
       }
      },
      {
       "running": {
        "startedAt": "2020-02-12T14:38:01Z"
       }
      }
     ]
    },
    "restartCount": 0,
    "metrics": null,
    "warnings": [
     {
      "objectMeta": {
       "creationTimestamp": null
      },
      "typeMeta": {},
      "message": "Failed to pull image \"k8s.gcr.io/addon-resizer:1.7\": rpc error: code = Unknown desc = Error response from daemon: Get https://k8s.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)",
      "sourceComponent": "",
      "sourceHost": "",
      "object": "",
      "count": 0,
      "firstSeen": null,
      "lastSeen": null,
      "reason": "Failed",
      "type": "Warning"
     }
    ],
    "nodeName": "slave1"
   },
   {
    "objectMeta": {
     "name": "node-exporter-q4tbt",
     "namespace": "knative-monitoring",
     "labels": {
      "app": "node-exporter",
      "controller-revision-hash": "84d8bdcdf9",
      "cpuLimit": "220",
      "cpuRequest": "110",
      "memoryLimit": "94371840",
      "memoryRequest": "52428800",
      "pod-template-generation": "1"
     },
     "creationTimestamp": "2020-01-15T01:06:46Z"
    },
    "typeMeta": {
     "kind": "pod"
    },
    "podStatus": {
     "status": "Running",
     "podPhase": "Running",
     "containerStates": [
      {
       "running": {
        "startedAt": "2020-01-15T01:07:14Z"
       }
      },
      {
       "running": {
        "startedAt": "2020-01-15T01:07:07Z"
       }
      }
     ]
    },
    "restartCount": 0,
    "metrics": null,
    "warnings": [],
    "nodeName": "slave1"
   },
   {
    "objectMeta": {
     "name": "antrea-agent-xsjzd",
     "namespace": "kube-system",
     "labels": {
      "app": "antrea",
      "component": "antrea-agent",
      "controller-revision-hash": "5d66bd5d8c",
      "cpuLimit": "0",
      "cpuRequest": "0",
      "memoryLimit": "0",
      "memoryRequest": "0",
      "pod-template-generation": "1"
     },
     "creationTimestamp": "2020-04-26T04:36:36Z"
    },
    "typeMeta": {
     "kind": "pod"
    },
    "podStatus": {
     "status": "Running",
     "podPhase": "Running",
     "containerStates": [
      {
       "running": {
        "startedAt": "2020-04-26T04:37:05Z"
       }
      },
      {
       "running": {
        "startedAt": "2020-04-26T04:37:08Z"
       }
      }
     ]
    },
    "restartCount": 0,
    "metrics": null,
    "warnings": [],
    "nodeName": "slave1"
   },
   {
    "objectMeta": {
     "name": "calico-node-mvscn",
     "namespace": "kube-system",
     "labels": {
      "controller-revision-hash": "79bc6b8cd6",
      "cpuLimit": "1000",
      "cpuRequest": "150",
      "k8s-app": "calico-node",
      "memoryLimit": "4294967296",
      "memoryRequest": "67108864",
      "pod-template-generation": "1"
     },
     "annotations": {
      "kubespray.etcd-cert/serial": "3C098BB05F053BF650B3A42532A03708A438BD1B"
     },
     "creationTimestamp": "2020-04-30T14:48:05Z"
    },
    "typeMeta": {
     "kind": "pod"
    },
    "podStatus": {
     "status": "Running",
     "podPhase": "Running",
     "containerStates": [
      {
       "running": {
        "startedAt": "2020-04-30T14:48:21Z"
       }
      }
     ]
    },
    "restartCount": 0,
    "metrics": null,
    "warnings": [],
    "nodeName": "slave1"
   },
   {
    "objectMeta": {
     "name": "kube-proxy-slave1",
     "namespace": "kube-system",
     "labels": {
      "cpuLimit": "500",
      "cpuRequest": "500",
      "k8s-app": "kube-proxy",
      "memoryLimit": "2000000000",
      "memoryRequest": "536870912"
     },
     "annotations": {
      "kubernetes.io/config.hash": "678a444ac5e2f23f791c700db19a48d0",
      "kubernetes.io/config.mirror": "678a444ac5e2f23f791c700db19a48d0",
      "kubernetes.io/config.seen": "2020-06-18T23:38:21.749229657+08:00",
      "kubernetes.io/config.source": "file",
      "kubespray.kube-proxy-cert/serial": "37656E2017A7CC554432A147BF70BBD5F78D9A46"
     },
     "creationTimestamp": "2020-06-18T15:39:04Z"
    },
    "typeMeta": {
     "kind": "pod"
    },
    "podStatus": {
     "status": "Running",
     "podPhase": "Running",
     "containerStates": [
      {
       "running": {
        "startedAt": "2020-06-18T15:38:49Z"
       }
      }
     ]
    },
    "restartCount": 0,
    "metrics": null,
    "warnings": [],
    "nodeName": "slave1"
   },
   {
    "objectMeta": {
     "name": "localpv-provisioner-ds-8rhb8",
     "namespace": "kube-system",
     "labels": {
      "app": "localpv-provisioner",
      "controller-revision-hash": "c454bcd5d",
      "cpuLimit": "0",
      "cpuRequest": "0",
      "memoryLimit": "0",
      "memoryRequest": "0",
      "pod-template-generation": "1"
     },
     "creationTimestamp": "2020-06-18T15:35:39Z"
    },
    "typeMeta": {
     "kind": "pod"
    },
    "podStatus": {
     "status": "Running",
     "podPhase": "Running",
     "containerStates": [
      {
       "running": {
        "startedAt": "2020-06-18T15:36:11Z"
       }
      }
     ]
    },
    "restartCount": 0,
    "metrics": null,
    "warnings": [],
    "nodeName": "slave1"
   },
   {
    "objectMeta": {
     "name": "ntp-cw6v2",
     "namespace": "kube-system",
     "labels": {
      "controller-revision-hash": "cf4b5844d",
      "cpuLimit": "0",
      "cpuRequest": "0",
      "k8s-app": "ntp",
      "memoryLimit": "0",
      "memoryRequest": "0",
      "pod-template-generation": "1"
     },
     "creationTimestamp": "2020-03-24T13:08:04Z"
    },
    "typeMeta": {
     "kind": "pod"
    },
    "podStatus": {
     "status": "Running",
     "podPhase": "Running",
     "containerStates": [
      {
       "running": {
        "startedAt": "2020-03-24T13:08:59Z"
       }
      }
     ]
    },
    "restartCount": 0,
    "metrics": null,
    "warnings": [],
    "nodeName": "slave1"
   },
   {
    "objectMeta": {
     "name": "node-exporter-q4k5d",
     "namespace": "monitoring",
     "labels": {
      "app": "node-exporter",
      "controller-revision-hash": "694cc6b6dc",
      "cpuLimit": "200",
      "cpuRequest": "100",
      "memoryLimit": "52428800",
      "memoryRequest": "31457280",
      "pod-template-generation": "1"
     },
     "creationTimestamp": "2020-01-10T14:47:44Z"
    },
    "typeMeta": {
     "kind": "pod"
    },
    "podStatus": {
     "status": "Running",
     "podPhase": "Running",
     "containerStates": [
      {
       "running": {
        "startedAt": "2020-01-10T14:47:59Z"
       }
      }
     ]
    },
    "restartCount": 0,
    "metrics": null,
    "warnings": [],
    "nodeName": "slave1"
   }
  ],
  "errors": []
 },
 "eventList": {
  "listMeta": {
   "totalItems": 0
  },
  "events": []
 },
 "addresses": [
  {
   "type": "InternalIP",
   "address": "192.168.0.10"
  },
  {
   "type": "Hostname",
   "address": "slave1"
  }
 ],
 "errors": [],
 "use": {
  "useCPU": "0.348155835",
  "useMemory": "5.600669860839844"
 }
}

错误码

以下为本接口特有的错误码。

错误代码 错误信息 Http状态码
201.002010 获取数据失败,请确认集群信息 500

命名空间列表

描述

  • 获取一个集群的命名空间列表信息

URI

GET /cks/core/v1/clusters/{clusterId}/user-namespaces

请求参数

名称 位置 类型 是否必须 描述
clusterId path String 是 集群环境ID

返回参数

名称 位置 类型 是否必须 描述
listMeta body Object(ObjectMeta) 是 Standard metadata
namespaces body Object(List<Node>) 是 命名空间列表

示例

  • Sample Request(请求):
GET /cks/core/v1/clusters/13e72529-0225-4462-a3ee-7dc4b21e8bfb/nodes
  • Sample Response(响应):

  • json格式

{
 "listMeta": {
  "totalItems": 2
 },
 "namespaces": [
  {
   "objectMeta": {
    "name": "default",
    "labels": {
     "storageclass-displayname": "incloud-disk",
     "storageclass-name": "incloud-disk-sc"
    },
    "annotations": {
     "displayName": "default"
    },
    "creationTimestamp": "2020-07-21T08:45:34Z"
   },
   "typeMeta": {
    "kind": "namespace"
   },
   "resourceQuotaList": {
    "listMeta": {
     "totalItems": 0
    },
    "items": []
   },
   "phase": "Active",
   "use": null
  },
  {
   "objectMeta": {
    "name": "kubeedge",
    "annotations": {
     "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"v1\",\"kind\":\"Namespace\",\"metadata\":{\"annotations\":{},\"name\":\"kubeedge\"}}\n"
    },
    "creationTimestamp": "2020-08-07T03:46:22Z"
   },
   "typeMeta": {
    "kind": "namespace"
   },
   "resourceQuotaList": {
    "listMeta": {
     "totalItems": 0
    },
    "items": []
   },
   "phase": "Active",
   "use": null
  }
 ],
 "errors": []
}

错误码

以下为本接口特有的错误码。

错误代码 错误信息 Http状态码
201.002010 获取数据失败,请确认集群信息 500

命名空间详情

描述

  • 获取一个集群的某个命名空间信息

URI

GET /cks/core/v1/clusters/{clusterId}/namespaces/{namespace}

请求参数

名称 位置 类型 是否必须 描述
clusterId path String 是 集群环境ID
namespace path String 是 命名空间的名称

返回参数

名称 位置 类型 是否必须 描述
objectMeta body Object(ObjectMeta) 是 Standard metadata
phase body String 是 命名空间状态
isIsolate body Bool 是 是否被隔离
resourceQuotaList body Object(List<Node>) 是 资源配额列表
resourceLimits body Object(List<Node>) 是 资源限制列表
roleBindingName body String 是 角色绑定名称
typeMeta body Object(ObjectMeta) 是 Standard metadata

示例

  • Sample Request(请求):
GET /cks/core/v1/clusters/7d604d87-3560-4457-8d71-d6ae0274be6f/namespaces/default
  • Sample Response(响应):

  • json格式

{
 "objectMeta": {
  "name": "default",
  "labels": {
   "storageclass-displayname": "incloud-disk",
   "storageclass-name": "incloud-disk-sc"
  },
  "annotations": {
   "displayName": "default"
  },
  "creationTimestamp": "2020-07-21T08:45:34Z"
 },
 "typeMeta": {
  "kind": "namespace"
 },
 "phase": "Active",
 "eventList": {
  "listMeta": {
   "totalItems": 1
  },
  "events": [
   {
    "objectMeta": {
     "name": "csi-hostpath-pvc.162a2950a5241cc5",
     "namespace": "default",
     "creationTimestamp": "2020-08-11T08:27:24Z"
    },
    "typeMeta": {
     "kind": "event"
    },
    "message": "waiting for a volume to be created, either by external provisioner \"csi-hostpath\" or manually created by system administrator",
    "sourceComponent": "persistentvolume-controller",
    "sourceHost": "",
    "object": "",
    "count": 1001,
    "firstSeen": "2020-08-11T08:27:24Z",
    "lastSeen": "2020-08-11T12:37:24Z",
    "reason": "ExternalProvisioning",
    "type": "Normal"
   }
  ]
 },
 "resourceQuotaList": {
  "listMeta": {
   "totalItems": 0
  },
  "items": []
 },
 "resourceLimits": [],
 "errors": [],
 "isIsolate": false,
 "roleBindingName": "default-psp"
}

错误码

以下为本接口特有的错误码。

错误代码 错误信息 Http状态码
201.002010 获取数据失败,请确认集群信息 500

创建命名空间

描述

  • 为某个集群创建一个命名空间

URI

POST /cks/core/v1/clusters/{clusterId}/namespaces

请求参数

名称 位置 类型 是否必须 描述
clusterId path String 是 集群环境ID
IsIsolate body String 是 是否隔离网络
displayName body String 是 展示名称
environment body String 是 集群环境ID
name body String 是 命名空间名称
resourceQuotaSpec body Object(resourceQuota) 否 资源配额规格
rolebindingSpec body Object(rolebindingSpec) 否 角色绑定规格

返回参数

名称 位置 类型 是否必须 描述

示例

  • Sample Request(请求):
GET /cks/core/v1/clusters/7d604d87-3560-4457-8d71-d6ae0274be6f/namespaces

{
IsIsolate: false
cephStorageConfigSpec: {name: ["csi-hostpath-sc"]}
displayName: "说好的一起呢"
environment: "7d604d87-3560-4457-8d71-d6ae0274be6f"
name: "test"
resourceQuotaSpec: {cpu: 2, cpuLimits: 2, cpuRequests: 2, memory: 2048, memoryLimits: 2048, memoryRequests: 2048,…}
rolebindingSpec: {name: "default-psp"}
}
  • Sample Response(响应):

  • json格式



错误码

以下为本接口特有的错误码。

错误代码 错误信息 Http状态码
201.002010 获取数据失败,请确认集群信息 500

删除命名空间

描述

  • 删除某个集群的一个命名空间

URI

DELETE /cks/core/v1/clusters/{clusterId}/namespaces/{namespace}

请求参数

名称 位置 类型 是否必须 描述
clusterId path String 是 集群环境ID
namespace path String 是 命名空间名称

返回参数

名称 位置 类型 是否必须 描述

示例

  • Sample Request(请求):
DELETE /cks/core/v1/clusters/7d604d87-3560-4457-8d71-d6ae0274be6f/namespaces/test
  • Sample Response(响应):

  • json格式



错误码

以下为本接口特有的错误码。

错误代码 错误信息 Http状态码
201.002010 获取数据失败,请确认集群信息 500