Create a cluster deployment
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
apiVersion: 'k0rdent.mirantis.com/v1beta1',
kind: 'ClusterDeployment',
metadata: {name: 'my-cluster', namespace: 'kcm-system'},
spec: {}
})
};
fetch('http://localhost:4065/v1/kubernetes/cluster-deployments', 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 := "http://localhost:4065/v1/kubernetes/cluster-deployments"
payload := strings.NewReader("{\n \"apiVersion\": \"k0rdent.mirantis.com/v1beta1\",\n \"kind\": \"ClusterDeployment\",\n \"metadata\": {\n \"name\": \"my-cluster\",\n \"namespace\": \"kcm-system\"\n },\n \"spec\": {}\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 http://localhost:4065/v1/kubernetes/cluster-deployments \
--header 'Content-Type: application/json' \
--data '
{
"apiVersion": "k0rdent.mirantis.com/v1beta1",
"kind": "ClusterDeployment",
"metadata": {
"name": "my-cluster",
"namespace": "kcm-system"
},
"spec": {}
}
'import requests
url = "http://localhost:4065/v1/kubernetes/cluster-deployments"
payload = {
"apiVersion": "k0rdent.mirantis.com/v1beta1",
"kind": "ClusterDeployment",
"metadata": {
"name": "my-cluster",
"namespace": "kcm-system"
},
"spec": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {},
"meta": {
"requestId": "<string>",
"timestamp": "<string>"
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"requestId": "<string>",
"timestamp": "<string>"
}
}Cluster Deployments
Create a cluster deployment
POST
/
v1
/
kubernetes
/
cluster-deployments
Create a cluster deployment
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
apiVersion: 'k0rdent.mirantis.com/v1beta1',
kind: 'ClusterDeployment',
metadata: {name: 'my-cluster', namespace: 'kcm-system'},
spec: {}
})
};
fetch('http://localhost:4065/v1/kubernetes/cluster-deployments', 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 := "http://localhost:4065/v1/kubernetes/cluster-deployments"
payload := strings.NewReader("{\n \"apiVersion\": \"k0rdent.mirantis.com/v1beta1\",\n \"kind\": \"ClusterDeployment\",\n \"metadata\": {\n \"name\": \"my-cluster\",\n \"namespace\": \"kcm-system\"\n },\n \"spec\": {}\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 http://localhost:4065/v1/kubernetes/cluster-deployments \
--header 'Content-Type: application/json' \
--data '
{
"apiVersion": "k0rdent.mirantis.com/v1beta1",
"kind": "ClusterDeployment",
"metadata": {
"name": "my-cluster",
"namespace": "kcm-system"
},
"spec": {}
}
'import requests
url = "http://localhost:4065/v1/kubernetes/cluster-deployments"
payload = {
"apiVersion": "k0rdent.mirantis.com/v1beta1",
"kind": "ClusterDeployment",
"metadata": {
"name": "my-cluster",
"namespace": "kcm-system"
},
"spec": {}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {},
"meta": {
"requestId": "<string>",
"timestamp": "<string>"
}
}{
"success": false,
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"meta": {
"requestId": "<string>",
"timestamp": "<string>"
}
}Query Parameters
Validate without persisting
Available options:
true, false Body
application/json
Raw Kubernetes resource object
Was this page helpful?