Create a new kubernetes cluster
curl --request POST \
--url https://api.ubicloud.com/project/{project_id}/location/{location}/kubernetes-cluster/{kubernetes_cluster_reference} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"version": "<string>",
"worker_size": "<string>",
"cp_nodes": 123,
"worker_nodes": 123
}
'import requests
url = "https://api.ubicloud.com/project/{project_id}/location/{location}/kubernetes-cluster/{kubernetes_cluster_reference}"
payload = {
"version": "<string>",
"worker_size": "<string>",
"cp_nodes": 123,
"worker_nodes": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({version: '<string>', worker_size: '<string>', cp_nodes: 123, worker_nodes: 123})
};
fetch('https://api.ubicloud.com/project/{project_id}/location/{location}/kubernetes-cluster/{kubernetes_cluster_reference}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ubicloud.com/project/{project_id}/location/{location}/kubernetes-cluster/{kubernetes_cluster_reference}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'version' => '<string>',
'worker_size' => '<string>',
'cp_nodes' => 123,
'worker_nodes' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ubicloud.com/project/{project_id}/location/{location}/kubernetes-cluster/{kubernetes_cluster_reference}"
payload := strings.NewReader("{\n \"version\": \"<string>\",\n \"worker_size\": \"<string>\",\n \"cp_nodes\": 123,\n \"worker_nodes\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.post("https://api.ubicloud.com/project/{project_id}/location/{location}/kubernetes-cluster/{kubernetes_cluster_reference}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"version\": \"<string>\",\n \"worker_size\": \"<string>\",\n \"cp_nodes\": 123,\n \"worker_nodes\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ubicloud.com/project/{project_id}/location/{location}/kubernetes-cluster/{kubernetes_cluster_reference}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"version\": \"<string>\",\n \"worker_size\": \"<string>\",\n \"cp_nodes\": 123,\n \"worker_nodes\": 123\n}"
response = http.request(request)
puts response.read_body{
"cp_node_count": 123,
"id": "kcqxhqbg86sj0ng5e9ck5n191z",
"location": "eu-central-h1",
"name": "my-cluster-name",
"node_size": "<string>",
"version": "<string>",
"cp_vms": [
{
"boot_image": "<string>",
"id": "vmhfy8gff8c67hasb0eez2k1pd",
"ip4": "127.0.0.1",
"ip4_enabled": true,
"ip6": "2606:4700:3108::ac42:2835",
"location": "eu-central-h1",
"name": "my-vm-name",
"size": "<string>",
"state": "<string>",
"storage_size_gib": 123,
"unix_user": "<string>"
}
],
"display_state": "<string>",
"nodepools": [
{
"kubernetes_cluster_id": "kcqxhqbg86sj0ng5e9ck5n191z",
"id": "knqxhqbg86sj0ng5e9ck5n191z",
"name": "my-nodepool-name",
"node_count": 123,
"node_size": "<string>",
"vms": [
{
"boot_image": "<string>",
"id": "vmhfy8gff8c67hasb0eez2k1pd",
"ip4": "127.0.0.1",
"ip4_enabled": true,
"ip6": "2606:4700:3108::ac42:2835",
"location": "eu-central-h1",
"name": "my-vm-name",
"size": "<string>",
"state": "<string>",
"storage_size_gib": 123,
"unix_user": "<string>"
}
]
}
],
"services_load_balancer_url": "<string>"
}{
"error": {
"code": 401,
"message": "There was an error logging in",
"type": "InvalidCredentials",
"details": {}
}
}Kubernetes Cluster
Create a new kubernetes cluster
POST
/
project
/
{project_id}
/
location
/
{location}
/
kubernetes-cluster
/
{kubernetes_cluster_reference}
Create a new kubernetes cluster
curl --request POST \
--url https://api.ubicloud.com/project/{project_id}/location/{location}/kubernetes-cluster/{kubernetes_cluster_reference} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"version": "<string>",
"worker_size": "<string>",
"cp_nodes": 123,
"worker_nodes": 123
}
'import requests
url = "https://api.ubicloud.com/project/{project_id}/location/{location}/kubernetes-cluster/{kubernetes_cluster_reference}"
payload = {
"version": "<string>",
"worker_size": "<string>",
"cp_nodes": 123,
"worker_nodes": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({version: '<string>', worker_size: '<string>', cp_nodes: 123, worker_nodes: 123})
};
fetch('https://api.ubicloud.com/project/{project_id}/location/{location}/kubernetes-cluster/{kubernetes_cluster_reference}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ubicloud.com/project/{project_id}/location/{location}/kubernetes-cluster/{kubernetes_cluster_reference}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'version' => '<string>',
'worker_size' => '<string>',
'cp_nodes' => 123,
'worker_nodes' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ubicloud.com/project/{project_id}/location/{location}/kubernetes-cluster/{kubernetes_cluster_reference}"
payload := strings.NewReader("{\n \"version\": \"<string>\",\n \"worker_size\": \"<string>\",\n \"cp_nodes\": 123,\n \"worker_nodes\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.post("https://api.ubicloud.com/project/{project_id}/location/{location}/kubernetes-cluster/{kubernetes_cluster_reference}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"version\": \"<string>\",\n \"worker_size\": \"<string>\",\n \"cp_nodes\": 123,\n \"worker_nodes\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ubicloud.com/project/{project_id}/location/{location}/kubernetes-cluster/{kubernetes_cluster_reference}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"version\": \"<string>\",\n \"worker_size\": \"<string>\",\n \"cp_nodes\": 123,\n \"worker_nodes\": 123\n}"
response = http.request(request)
puts response.read_body{
"cp_node_count": 123,
"id": "kcqxhqbg86sj0ng5e9ck5n191z",
"location": "eu-central-h1",
"name": "my-cluster-name",
"node_size": "<string>",
"version": "<string>",
"cp_vms": [
{
"boot_image": "<string>",
"id": "vmhfy8gff8c67hasb0eez2k1pd",
"ip4": "127.0.0.1",
"ip4_enabled": true,
"ip6": "2606:4700:3108::ac42:2835",
"location": "eu-central-h1",
"name": "my-vm-name",
"size": "<string>",
"state": "<string>",
"storage_size_gib": 123,
"unix_user": "<string>"
}
],
"display_state": "<string>",
"nodepools": [
{
"kubernetes_cluster_id": "kcqxhqbg86sj0ng5e9ck5n191z",
"id": "knqxhqbg86sj0ng5e9ck5n191z",
"name": "my-nodepool-name",
"node_count": 123,
"node_size": "<string>",
"vms": [
{
"boot_image": "<string>",
"id": "vmhfy8gff8c67hasb0eez2k1pd",
"ip4": "127.0.0.1",
"ip4_enabled": true,
"ip6": "2606:4700:3108::ac42:2835",
"location": "eu-central-h1",
"name": "my-vm-name",
"size": "<string>",
"state": "<string>",
"storage_size_gib": 123,
"unix_user": "<string>"
}
]
}
],
"services_load_balancer_url": "<string>"
}{
"error": {
"code": 401,
"message": "There was an error logging in",
"type": "InvalidCredentials",
"details": {}
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
ID of the project
Pattern:
^pj[0-9a-hj-km-np-tv-z]{24}$Example:
"pjkkmx0f2vke4h36nk9cm8v8q0"
The Ubicloud location/region
Example:
"eu-central-h1"
Kubernetes cluster ID or name Resource ID or name
Pattern:
^[a-z0-9](?:[a-z0-9\-]{0,61}[a-z0-9])?$Body
application/json
Response
A KubernetesCluster
Number of control plane nodes
ID of the KubernetesCluster
Pattern:
^kc[0-9a-hj-km-np-tv-z]{24}$Example:
"kcqxhqbg86sj0ng5e9ck5n191z"
Location of the KubernetesCluster
Example:
"eu-central-h1"
Name of the KubernetesCluster
Example:
"my-cluster-name"
Size of each control plane node
Version of the KubernetesCluster
Show child attributes
Show child attributes
State of the KubernetesCluster
Show child attributes
Show child attributes
Services
⌘I