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

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

响应示例

状态码: 200

OK

{
  "apiVersion" : "v1",
  "items" : [ {
    "metadata" : {
      "creationTimestamp" : "2018-09-03T11:20:56Z",
      "labels" : {
        "addonmanager.kubernetes.io/mode" : "Reconcile",
        "app" : "kube-dns",
        "kubernetes.io/cluster-service" : "true",
        "kubernetes.io/name" : "KubeDNS"
      },
      "name" : "kube-dns",
      "namespace" : "namespace-test",
      "resourceVersion" : "5016792",
      "selfLink" : "/api/v1/namespaces/namespace-test/services/kube-dns",
      "uid" : "6d356f18-af6b-11e8-b6ef-f898ef6c78b4"
    },
    "spec" : {
      "clusterIP" : "10.247.189.43",
      "ports" : [ {
        "name" : "dns",
        "port" : 53,
        "protocol" : "UDP",
        "targetPort" : 5353
      }, {
        "name" : "dns-tcp",
        "port" : 53,
        "protocol" : "TCP",
        "targetPort" : 5353
      } ],
      "selector" : {
        "app" : "kube-dns"
      },
      "sessionAffinity" : "None",
      "type" : "ClusterIP"
    },
    "status" : {
      "loadBalancer" : { }
    }
  }, {
    "metadata" : {
      "creationTimestamp" : "2018-09-04T00:45:36Z",
      "labels" : {
        "app" : "redis"
      },
      "name" : "redis",
      "namespace" : "namespace-test",
      "resourceVersion" : "5146412",
      "selfLink" : "/api/v1/namespaces/namespace-test/services/redis",
      "uid" : "d6a1ce79-afdb-11e8-b6ef-f898ef6c78b4"
    },
    "spec" : {
      "clusterIP" : "10.247.212.210",
      "ports" : [ {
        "name" : "service0",
        "port" : 8080,
        "protocol" : "TCP",
        "targetPort" : 80
      } ],
      "selector" : {
        "app" : "redis"
      },
      "sessionAffinity" : "None",
      "type" : "ClusterIP"
    },
    "status" : {
      "loadBalancer" : { }
    }
  } ],
  "kind" : "ServiceList",
  "metadata" : {
    "resourceVersion" : "5147871",
    "selfLink" : "/api/v1/namespaces/namespace-test/services"
  }
}
support.huaweicloud.com/api-cci/listCoreV1NamespacedService.html