Issue kubeconfig
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({ttl: 3600})
};
fetch('https://api.example.com/v1/regions/{region}/compute/clusters/{clusterId}/kubeconfigs', 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/{clusterId}/kubeconfigs"
payload := strings.NewReader("{\n \"ttl\": 3600\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/{clusterId}/kubeconfigs \
--header 'Content-Type: application/json' \
--data '{
"ttl": 3600
}'import requests
url = "https://api.example.com/v1/regions/{region}/compute/clusters/{clusterId}/kubeconfigs"
payload = { "ttl": 3600 }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"kubeconfig": "<string>",
"expiresAt": "2023-11-07T05:31:56Z"
}
}Clusters
Issue kubeconfig
Generate a kubeconfig for cluster access
POST
/
v1
/
regions
/
{region}
/
compute
/
clusters
/
{clusterId}
/
kubeconfigs
Issue kubeconfig
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({ttl: 3600})
};
fetch('https://api.example.com/v1/regions/{region}/compute/clusters/{clusterId}/kubeconfigs', 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/{clusterId}/kubeconfigs"
payload := strings.NewReader("{\n \"ttl\": 3600\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/{clusterId}/kubeconfigs \
--header 'Content-Type: application/json' \
--data '{
"ttl": 3600
}'import requests
url = "https://api.example.com/v1/regions/{region}/compute/clusters/{clusterId}/kubeconfigs"
payload = { "ttl": 3600 }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"kubeconfig": "<string>",
"expiresAt": "2023-11-07T05:31:56Z"
}
}Was this page helpful?