文档首页> 华为云UCS> API参考> API> 容器舰队> 获取容器舰队列表
更新时间:2023-12-22 GMT+08:00
分享

获取容器舰队列表

功能介绍

获取所有容器舰队信息

URI

GET /v1/clustergroups

表1 Query参数

参数

是否必选

参数类型

描述

limit

Integer

分页获取列表时,页的大小,默认为-1

offset

Integer

分页获取列表时,起始偏移量,默认为0

order_by

String

分页获取列表时,排序参数,支持 create_at 和 update_at

order

String

分页获取列表时,排序方向,支持 desc 和 asc

请求参数

表2 请求Header参数

参数

是否必选

参数类型

描述

X-Auth-Token

String

身份认证信息

最小长度:1

最大长度:16384

响应参数

状态码: 200

表3 响应Body参数

参数

参数类型

描述

items

Array of ClusterGroup objects

容器舰队列表信息

total

Integer

所有页的结果的总数

表4 ClusterGroup

参数

参数类型

描述

kind

String

kind

apiVersion

String

apiVersion

metadata

ObjectMeta object

metadata

spec

ClusterGroupSpec object

clustergroup spec

status

ClusterGroupStatus object

clustergroup status

表5 ObjectMeta

参数

参数类型

描述

uid

String

集群ID

name

String

集群名称。

labels

Map<String,String>

标签

creationTimestamp

String

创建时间。它以 RFC3339 形式表示,采用 UTC。

updateTimestamp

String

更新时间戳

表6 ClusterGroupSpec

参数

参数类型

描述

ruleNamespaces

Array of strings

权限策略关联的命名空间列表

federationId

String

舰队启用联邦ID

description

String

描述信息

dnsSuffix

Array of strings

舰队对应联邦的DNS后缀,开启联邦后可见

federationExpirationTimestamp

String

联邦到期时间戳

policyId

String

策略管理id

federationVersion

String

舰队启用联邦的版本

表7 ClusterGroupStatus

参数

参数类型

描述

conditions

Array of ClusterGroupCondition objects

舰队启用联邦或权限策略信息

表8 ClusterGroupCondition

参数

参数类型

描述

type

String

类型。

  • Federation:舰队启用联邦状态类型

  • Policy:权限策略

status

String

舰队启用的联邦或权限策略的状态

reason

String

状态原因

message

String

状态信息

lastTransitionTime

String

状态更新时间

请求示例

响应示例

状态码: 200

返回容器舰队列表信息

{
  "items" : [ {
    "kind" : "ClusterGroup",
    "apiVersion" : "v1",
    "metadata" : {
      "name" : "cluster-test",
      "uid" : "bffbb35b-7949-11ee-886c-0255ac100037",
      "creationTimestamp" : "2023-11-02 06:33:35.558128 +0000 UTC",
      "updateTimestamp" : "2023-11-14 06:20:20.446476 +0000 UTC"
    },
    "spec" : {
      "federationId" : "e2f27cc6-82b5-11ee-84e3-0255ac100032",
      "federationVersion" : "v1.7.0-t1109",
      "dnsSuffix" : [ "www.oidc.com" ]
    },
    "status" : {
      "conditions" : [ {
        "type" : "Federation",
        "status" : "Unavailable",
        "reason" : "FederationUnavailable",
        "message" : "component volcano-scheduler is unhealthy",
        "lastTransitionTime" : "0001-01-01T00:00:00Z"
      } ]
    }
  }, {
    "kind" : "ClusterGroup",
    "apiVersion" : "v1",
    "metadata" : {
      "name" : "cluster-dev",
      "uid" : "4557ad49-22bf-11ee-b0c9-0255ac10004b",
      "creationTimestamp" : "2023-07-15 03:25:39.253589 +0000 UTC",
      "updateTimestamp" : "2023-10-19 11:52:14.509405 +0000 UTC"
    },
    "spec" : { },
    "status" : { }
  }, {
    "kind" : "ClusterGroup",
    "apiVersion" : "v1",
    "metadata" : {
      "name" : "test0131",
      "uid" : "108f5981-a105-11ed-a23e-0255ac100032",
      "creationTimestamp" : "2023-01-31 01:17:44.309185 +0000 UTC",
      "updateTimestamp" : "2023-06-29 01:02:28.78095 +0000 UTC"
    },
    "spec" : { },
    "status" : { }
  } ],
  "total" : 3
}

状态码

状态码

描述

200

返回容器舰队列表信息

400

客户端请求错误,服务器无法执行请求

403

服务器拒绝执行请求

500

服务器内部错误

错误码

请参见错误码

分享:

    相关文档

    相关产品