cloud-container-engine/api-ref/source/apis/cluster_management/obtaining_cluster_certificates_deprecated.rst
proposalbot 2490522af3 Changes to cce_api-ref from docs/doc-exports#318 (CCE API for v1.23
CCE API for

Reviewed-by: gtema <artem.goncharov@gmail.com>
Co-authored-by: proposalbot <proposalbot@otc-service.com>
Co-committed-by: proposalbot <proposalbot@otc-service.com>
2022-11-10 10:54:32 +00:00

17 KiB

original_name

cce_02_0359_0.html

Obtaining Cluster Certificates (Deprecated)

Function

This API is used to obtain certificates of a specified cluster in form of kubeconfig file.

URI

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

Table 1 <cce_02_0359_0__table2027961241820> describes the parameters of this API.

Table 1 Description
Parameter Mandatory Description
project_id Yes Project ID. For details about how to obtain the project ID, see How to Obtain Parameters in the API URI <cce_02_0271>.
cluster_id Yes Cluster ID. For details about how to obtain the cluster ID, see How to Obtain Parameters in the API URI <cce_02_0271>.

Request

Request parameters:

Table 2 <cce_02_0359_0__table538113720514> describes the request parameters.

Table 2 Parameters in the request header
Parameter Mandatory Description
Content-Type Yes

Message body type (format). Possible values:

  • application/json;charset=utf-8
  • application/json
X-Auth-Token Yes Requests for calling an API can be authenticated using either a token or AK/SK. If token-based authentication is used, this parameter is mandatory and must be set to a user token. For details on how to obtain a user token, see API Usage Guidelines <cce_02_0344>.

Example request:

N/A

Response

Response parameters:

Table 3 <cce_02_0359_0__table10794441185312> describes the response parameters.

Table 3 Response parameters
Parameter Type Description
kind String API type. The value is fixed at Config and cannot be changed.
apiVersion String API version. The value is fixed at v1 and cannot be changed.
preferences - This field is not used currently and is left unspecified by default.
clusters clusters <cce_02_0359_0__table2157957598> object Cluster list.
users users <cce_02_0359_0__table7846125310316> object -
contexts contexts <cce_02_0359_0__table1653965354> object Context list.
current-context String Current context.
Table 4 Data structure of the clusters field
Parameter Type Description
name String

Cluster name.

  • If the publicIp parameter does not exist (that is, no EIP exists), there is only one cluster in the cluster list, and the value of this parameter is internalCluster.
  • If the publicIp parameter exists (that is, the EIP exists), there is more than one cluster in the cluster list, and the value of this parameter is externalCluster.
cluster cluster <cce_02_0359_0__table519211353218> object Cluster information.
Table 5 Data structure of the cluster field
Parameter Type Description
server String Node IP address.
certificate-authority-data String Certificate authorization data.
Table 6 Data structure of the users field
Parameter Type Description
name String The value is fixed to user.
user user <cce_02_0359_0__table205311581434> object Stores the certificate information and ClientKey information of a specified user.
Table 7 Data structure of the user field
Parameter Type Description
client-certificate-data String Client certificate.
client-key-data String Contains PEM encoding data from the TLS client key file.
Table 8 Data structure of the contexts field
Parameter Type Description
name String

Context name.

  • If the publicIp parameter does not exist (that is, no EIP exists), there is only one cluster in the cluster list, and the value of this parameter is internal.
  • If the publicIp parameter exists (that is, the EIP exists), there is more than one cluster in the cluster list, and the value of this parameter is external.
context context <cce_02_0359_0__table47913919518> object Context information.
Table 9 Data structure of the context field
Parameter Type Description
cluster String Cluster context.
user String User context.

Response example:

{
    "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 10 <cce_02_0359_0__en-us_topic_0079614900_table46761928> describes the status code of this API.

Table 10 Status code
Status Code Description
200 Certificates of the specified cluster are successfully obtained.

For details about error status codes, see Status Code <cce_02_0084>.