• Cloud Container Engine

cce
  1. Help Center
  2. Cloud Container Engine
  3. API Reference 2.0
  4. API
  5. Cluster Management
  6. Obtaining Information About a Specified Cluster

Obtaining Information About a Specified Cluster

Function

This API is used to obtain information about a specified cluster.

URI

GET /api/v3/projects/{project_id}/clusters/{cluster_id}

Table 1 describes the parameters of the API.

Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Project ID.

cluster_id

Yes

Cluster ID.

Request

N/A

Response

Response parameters:

Table 2 describes the response parameters.

Table 2 Response parameters

Parameter

Type

Description

kind

String

API type. The value is fixed to Cluster.

apiVersion

String

API version. The value is fixed to v3.

metadata

Table 9

-

spec

Table 3

-

status

Table 5

-

Table 3 Data structure of the spec field

Parameter

Type

Description

type

String

Cluster type.

flavor

String

Cluster flavors. Currently supported flavors include:
  • cce.s1.small: small-scale single cluster (up to 50 nodes)
  • cce.s1.medium: medium-scale single cluster (up to 200 nodes)
  • cce.s1.large: large-scale single cluster (up to 1000 nodes)
  • cce.s2.small: small-scale HA cluster (up to 50 nodes)
  • cce.s2.medium: medium-scale HA cluster (up to 200 nodes)
  • cce.s2.large: large-scale HA cluster (up to 1000 nodes)
  • cce.t1.small: small-scale single physical machine cluster (up to 10 nodes)
  • cce.t1.medium: medium-scale single physical machine cluster (up to 100 nodes)
  • cce.t1.large: large-scale single physical machine cluster (up to 500 nodes)
  • cce.t2.small: small-scale HA physical machine cluster (up to 10 nodes)
  • cce.t2.medium: medium-scale HA physical machine cluster (up to 100 nodes)
  • cce.t2.large: large-scale HA physical machine cluster (up to 500 nodes)

version

String

Cluster version.

Value: v1.9.10-r2 or v1.11.3-r1.

NOTE:

If this parameter is not set, the latest version will be used.

description

String

Cluster description.

hostNetwork

Table 4

Node network parameters.

containerNetwork

Table 7

Container network parameters.

authentication

Table 11

Configurations of the cluster authentication mode.

billingMode

Integer

Billing mode of the cluster. Currently, only pay-per-use is supported.

extendParam

String

Extended field.

Table 4 Data structure of the hostNetwork field

Parameter

Mandatory

Type

Description

vpc

Yes

String

ID of the VPC where a node will be created.

subnet

Yes

String

ID of the subnet where a node will be created.

highwaySubnet

No

NOTICE:

This parameter must be specified when you create a bare metal cluster.

String

ID of the high-speed network where a bare metal node will be created. For details on how to obtain this value, see (Optional) Creating a High-Speed Network.

Table 5 Data structure of the status field

Parameter

Type

Description

phase

String

Cluster status.

endpoints

Table 6

Access address of the kube-apiserver in the cluster.

Table 6 Data structure of the endpoint field

Parameter

Type

Description

internal

String

Internal network address.

external

String

External network address.

external_otc

String

Endpoint of the cluster to be accessed through API Gateway.

Example response:

{
    "kind": "Cluster",
    "apiVersion": "v3",
    "metadata": {
        "name": "mycluster-demo",
        "uid": "40c54866-38c5-11e9-b246-0255ac101413",
        "creationTimestamp": "2019-02-25 06:19:05.789462 +0000 UTC",
        "updateTimestamp": "2019-02-25 06:21:50.214687 +0000 UTC"
    },
    "spec": {
        "type": "VirtualMachine",
        "flavor": "cce.s1.medium",
        "version": "v1.11.3-r1",
        "hostNetwork": {
            "vpc": "a8cc62dc-acc2-47d0-9bfb-3b1d776c520b",
            "subnet": "6d9e5355-85af-4a89-af28-243edb700db6"
        },
        "containerNetwork": {
            "mode": "overlay_l2",
            "cidr": "172.16.0.0/16"
        },
        "authentication": {
            "mode": "x509",
            "authenticatingProxy": {}
        },
        "billingMode": 0
    },
    "status": {
        "phase": "Available",
        "endpoints": {
            "internal": "https://192.168.0.68:5443",
            "external_otc": "https://a140174a-2f3e-11e9-9f91-0255ac101405.cce.eu-de.otc.t-systems.com"
        }
    }
}

Status Code

Table 7 describes the status code of the API.

Table 7 Status code

Status Code

Description

200

Information about the specified cluster is successfully obtained.

For details about error status codes, see Status Codes.