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 describes the parameters of this API.
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. |
cluster_id | Yes | Cluster ID. For details about how to obtain the cluster ID, see How to Obtain Parameters in the API URI. |
Request¶
Request parameters:
Table 2 describes the request parameters.
Parameter | Mandatory | Description |
---|---|---|
Content-Type | Yes | Message body type (format). Possible values:
|
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. |
Example request:
N/A
Response¶
Response parameters:
Table 3 describes the 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 object | Cluster list. |
users | users object |
|
contexts | contexts object | Context list. |
current-context | String | Current context. |
Parameter | Type | Description |
---|---|---|
name | String | Cluster name.
|
cluster | cluster object | Cluster information. |
Parameter | Type | Description |
---|---|---|
server | String | Node IP address. |
certificate-authority-data | String | Certificate authorization data. |
Parameter | Type | Description |
---|---|---|
name | String | The value is fixed to user. |
user | user object | Stores the certificate information and ClientKey information of a specified user. |
Parameter | Type | Description |
---|---|---|
client-certificate-data | String | Client certificate. |
client-key-data | String | Contains PEM encoding data from the TLS client key file. |
Parameter | Type | Description |
---|---|---|
name | String | Context name.
|
context | context object | Context information. |
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 describes the status code of this API.
Status Code | Description |
---|---|
200 | Certificates of the specified cluster are successfully obtained. |
For details about error status codes, see Status Code.