• Cloud Container Engine

cce
  1. Help Center
  2. Cloud Container Engine
  3. API Reference 2.0
  4. API
  5. Cluster Management
  6. Obtaining Cluster Certificates

Obtaining Cluster Certificates

Function

This API is used to obtain the certificate of a specified cluster.

URI

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

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

Resource type. This parameter must be set to Config.

apiVersion

String

API version. This parameter is fixed to v1.

preferences

-

This parameter is not in use and left blank by default.

clusters

Table 3

Cluster list.

users

Table 5

-

contexts

Table 7

Context list.

current-context

String

The current context.

Table 3 Data structure of the Clusters field

Parameter

Type

Description

name

String

Cluster name. This parameter is fixed to internalCluster.

cluster

Table 4

Cluster information.

Table 4 Data structure of the Cluster field

Parameter

Type

Description

server

String

Server IP address.

certificate-authority-data

Byte array

Certificate data.

Table 5 Data structure of the users field

Parameter

Type

Description

name

String

This parameter is fixed to user.

user

Table 6

Certificate and ClientKey information of a specified user.

Table 6 Data structure of the user field

Parameter

Type

Description

client-certificate-data

Byte array

Client certificate.

client-key-data

Byte array

Client key data, containing the PEM data of the TLS key file of the client.

Table 7 Data structure of the Contexts field

Parameter

Type

Description

name

String

This parameter is fixed to internal.

context

Table 8

Context information.

Table 8 Data structure of the Context field

Parameter

Type

Description

cluster

String

This parameter is fixed to internalCluster.

user

String

This parameter is fixed to user.

Example response:

{
    "kind": "Config",
    "apiVersion": "v1",
    "preferences": {},
    "clusters": [
        {
            "name": "internalCluster",
            "cluster": {
                "server": "https://192.168.1.7:5443",
                "certificate-authority-data": ""
            }
        }
    ],
    "users": [
        {
            "name": "user",
            "user": {
                "client-certificate-data": "",
                "client-key-data": ""
            }
        }
    ],
    "contexts": [
        {
            "name": "internal",
            "context": {
                "cluster": "internalCluster",
                "user": "user"
            }
        }
    ],
    "current-context": "internal"
}

Status Code

Table 9 describes the status code of the API.

Table 9 Status code

Status Code

Description

200

The certificate of the specified cluster is obtained successfully.

For details about error status codes, see Status Codes.