• 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 Clusters in a Specific Project

Obtaining Information About Clusters in a Specific Project

Function

This API is used to obtain information about clusters in a specified project.

URI

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

Table 1 describes the parameters of the API.

Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Project 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.

items

Table 2

-

Example response:

{
    "kind": "Cluster",
    "apiVersion": "v3",
    "items": [
        {
            "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:26:14.457426 +0000 UTC"
            },
            "spec": {
                "type": "VirtualMachine",
                "flavor": "cce.s1.small",
                "version": "v1.11.3-r1",
                "description": "thisisademocluster",
                "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.129:5443",
                    "external_otc": "https://40c54866-38c5-11e9-b246-0255ac101413.cce.eu-de.otc.t-systems.com"
                }
            }
        },
        {
            "kind": "Cluster",
            "apiVersion": "v3",
            "metadata": {
                "name": "cluster-test",
                "uid": "7ae1e7b5-370d-11e9-b246-0255ac101413",
                "creationTimestamp": "2019-02-23 01:51:04.723868 +0000 UTC",
                "updateTimestamp": "2019-02-25 03:25:18.170095 +0000 UTC"
            },
            "spec": {
                "type": "VirtualMachine",
                "flavor": "cce.s1.small",
                "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",
                "reason": "Operation timed out",
                "message": "process time exceed expect",
                "endpoints": {
                    "internal": "https://192.168.0.33:5443",
                    "external_otc": "https://7ae1e7b5-370d-11e9-b246-0255ac101413.cce.eu-de.otc.t-systems.com"
                }
            }
        },
        {
            "kind": "Cluster",
            "apiVersion": "v3",
            "metadata": {
                "name": "mycluster-baremetal",
                "uid": "6594768f-35d7-11e9-b246-0255ac101413",
                "creationTimestamp": "2019-02-21 12:51:24.998018 +0000 UTC",
                "updateTimestamp": "2019-02-21 12:58:02.371215 +0000 UTC"
            },
            "spec": {
                "type": "BareMetal",
                "flavor": "cce.t1.small",
                "version": "v1.11.3-r1",
                "hostNetwork": {
                    "vpc": "14a729d4-c35c-4e7b-ac8c-851d11f4a8e3",
                    "subnet": "2800b885-9592-423a-9ed6-cf9aee2f6f23",
                    "highwaySubnet": "9ba51d95-04fa-4d18-9f8e-c681c96c5b9e"
                },
                "containerNetwork": {
                    "mode": "underlay_ipvlan",
                    "cidr": "172.17.0.0/16"
                },
                "authentication": {
                    "mode": "x509",
                    "authenticatingProxy": {}
                },
                "billingMode": 0
            },
            "status": {
                "phase": "Available",
                "endpoints": {
                    "internal": "https://172.16.0.26:5443",
                    "external_otc": "https://6594768f-35d7-11e9-b246-0255ac101413.cce.eu-de.otc.t-systems.com"
                }
            }
        }
    ]
}

Status Code

Table 3 describes the status code of the API.

Table 3 Status code

Status Code

Description

200

Information about clusters in the specified project is successfully obtained.

For details about error status codes, see Status Codes.