General
Create a Cluster Configuration
Creates a new ClusterConfig
POST
/
v2.5
/
api
/
k8s
/
clusters
cURL
curl -sk -X POST "https://<controller>/v2.5/api/k8s/clusters" \
-H "Authorization: cid <CID>"import requests
url = "https://<controller>/v2.5/api/k8s/clusters"
headers = {"Authorization": "cid <CID>"}
response = requests.post(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
)
func main() {
req, _ := http.NewRequest("POST", "https://<controller>/v2.5/api/k8s/clusters", nil)
req.Header.Set("Authorization", "cid <CID>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
}{
"cluster_id": "cluster_id",
"credential": {
"kube_config": "kube_config"
},
"gateway_tunnel_enabled": true,
"id": "id",
"resource": {
"account_id": "account_id",
"compartment": "compartment",
"name": "name",
"platform": "platform",
"project": "project",
"public": true,
"region": "region",
"tags": [
{
"key": "key",
"value": "value"
},
{
"key": "key",
"value": "value"
}
],
"version": "version",
"vpc_id": "vpc_id"
}
}{
"errors": [
{
"message": "message",
"path": "path"
},
{
"message": "message",
"path": "path"
}
],
"message": "message"
}{
"message": "message"
}{
"message": "<string>"
}Headers
Controller ID in the format: cid .
Example:
"cid <CID>"
Body
application/json
ClusterConfig object
Show child attributes
Show child attributes
Example:
{ "kube_config": "kube_config" }
Show child attributes
Show child attributes
Example:
{
"account_id": "account_id",
"account_name": "account_name",
"compartment": "compartment",
"name": "name",
"network_mode": "OVERLAY",
"platform": "platform",
"project": "project",
"public": true,
"region": "region",
"tags": [
{ "key": "key", "value": "value" },
{ "key": "key", "value": "value" }
],
"version": "version",
"vpc_id": "vpc_id"
}
Response
Successful operation
Show child attributes
Show child attributes
Example:
{ "kube_config": "kube_config" }
Show child attributes
Show child attributes
Example:
{
"account_id": "account_id",
"account_name": "account_name",
"compartment": "compartment",
"name": "name",
"network_mode": "OVERLAY",
"platform": "platform",
"project": "project",
"public": true,
"region": "region",
"tags": [
{ "key": "key", "value": "value" },
{ "key": "key", "value": "value" }
],
"version": "version",
"vpc_id": "vpc_id"
}
Was this page helpful?
⌘I
cURL
curl -sk -X POST "https://<controller>/v2.5/api/k8s/clusters" \
-H "Authorization: cid <CID>"import requests
url = "https://<controller>/v2.5/api/k8s/clusters"
headers = {"Authorization": "cid <CID>"}
response = requests.post(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
)
func main() {
req, _ := http.NewRequest("POST", "https://<controller>/v2.5/api/k8s/clusters", nil)
req.Header.Set("Authorization", "cid <CID>")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println(resp.Status)
}{
"cluster_id": "cluster_id",
"credential": {
"kube_config": "kube_config"
},
"gateway_tunnel_enabled": true,
"id": "id",
"resource": {
"account_id": "account_id",
"compartment": "compartment",
"name": "name",
"platform": "platform",
"project": "project",
"public": true,
"region": "region",
"tags": [
{
"key": "key",
"value": "value"
},
{
"key": "key",
"value": "value"
}
],
"version": "version",
"vpc_id": "vpc_id"
}
}{
"errors": [
{
"message": "message",
"path": "path"
},
{
"message": "message",
"path": "path"
}
],
"message": "message"
}{
"message": "message"
}{
"message": "<string>"
}