Create cluster
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
projectId: '<string>',
kubernetesVersion: '<string>',
nodePools: [{name: '<string>', machineType: '<string>', replicas: 123}]
})
};
fetch('https://api.example.com/v1/regions/{region}/compute/clusters', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/regions/{region}/compute/clusters"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"projectId\": \"<string>\",\n \"kubernetesVersion\": \"<string>\",\n \"nodePools\": [\n {\n \"name\": \"<string>\",\n \"machineType\": \"<string>\",\n \"replicas\": 123\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}curl --request POST \
--url https://api.example.com/v1/regions/{region}/compute/clusters \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"projectId": "<string>",
"kubernetesVersion": "<string>",
"nodePools": [
{
"name": "<string>",
"machineType": "<string>",
"replicas": 123
}
]
}
'import requests
url = "https://api.example.com/v1/regions/{region}/compute/clusters"
payload = {
"name": "<string>",
"projectId": "<string>",
"kubernetesVersion": "<string>",
"nodePools": [
{
"name": "<string>",
"machineType": "<string>",
"replicas": 123
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"id": "<string>",
"name": "<string>",
"projectId": "<string>",
"regionId": "<string>",
"kubernetesVersion": "<string>",
"status": "provisioning",
"createdAt": "2023-11-07T05:31:56Z",
"health": {
"status": "healthy",
"lastChecked": "2023-11-07T05:31:56Z"
},
"endpoint": "<string>",
"nodeCount": 123,
"metadata": {},
"updatedAt": "2023-11-07T05:31:56Z"
}
}Clusters
Create cluster
Create a new Kubernetes cluster
POST
/
v1
/
regions
/
{region}
/
compute
/
clusters
Create cluster
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
projectId: '<string>',
kubernetesVersion: '<string>',
nodePools: [{name: '<string>', machineType: '<string>', replicas: 123}]
})
};
fetch('https://api.example.com/v1/regions/{region}/compute/clusters', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/regions/{region}/compute/clusters"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"projectId\": \"<string>\",\n \"kubernetesVersion\": \"<string>\",\n \"nodePools\": [\n {\n \"name\": \"<string>\",\n \"machineType\": \"<string>\",\n \"replicas\": 123\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}curl --request POST \
--url https://api.example.com/v1/regions/{region}/compute/clusters \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"projectId": "<string>",
"kubernetesVersion": "<string>",
"nodePools": [
{
"name": "<string>",
"machineType": "<string>",
"replicas": 123
}
]
}
'import requests
url = "https://api.example.com/v1/regions/{region}/compute/clusters"
payload = {
"name": "<string>",
"projectId": "<string>",
"kubernetesVersion": "<string>",
"nodePools": [
{
"name": "<string>",
"machineType": "<string>",
"replicas": 123
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"id": "<string>",
"name": "<string>",
"projectId": "<string>",
"regionId": "<string>",
"kubernetesVersion": "<string>",
"status": "provisioning",
"createdAt": "2023-11-07T05:31:56Z",
"health": {
"status": "healthy",
"lastChecked": "2023-11-07T05:31:56Z"
},
"endpoint": "<string>",
"nodeCount": 123,
"metadata": {},
"updatedAt": "2023-11-07T05:31:56Z"
}
}Path Parameters
Region identifier
Body
application/json
Was this page helpful?