API Clusters
API Clusters
Section intitulée « API Clusters »Endpoints pour créer, lister, modifier et supprimer des clusters.
Lister les clusters
Section intitulée « Lister les clusters »GET /v1/clustersParamètres query :
| Paramètre | Type | Description |
|---|---|---|
page | number | Page (défaut: 1) |
per_page | number | Résultats par page (défaut: 20) |
status | string | Filtrer par statut |
Réponse 200 OK :
{ "items": [ { "id": "cls_abc123", "name": "production", "status": "running", "phase": "managed", "control_planes": 3, "workers": 5, "node_size": "large", "node_count": 8, "endpoint": "https://cls-abc123.k8s.deployme.cloud:6443", "kubernetes_version": "v1.31.0", "created_at": "2026-03-01T10:00:00Z", "updated_at": "2026-03-01T10:05:00Z" } ], "total": 1, "page": 1, "per_page": 20}Créer un cluster
Section intitulée « Créer un cluster »POST /v1/clustersBody :
{ "name": "production", "control_planes": 3, "workers": 5, "node_size": "large", "phase": "managed"}| Champ | Type | Requis | Description |
|---|---|---|---|
name | string | Oui | Nom du cluster (alphanumérique, tirets) |
control_planes | number | Oui | Nombre de control planes (1 ou 3) |
workers | number | Oui | Nombre de workers (1+) |
node_size | string | Oui | small, medium, large, xlarge |
phase | string | Non | managed (défaut), onpremise, baremetal |
infra_id | string | Non | ID de l’infra cible (requis si phase != managed) |
Réponse 201 Created :
{ "id": "cls_abc123", "name": "production", "status": "provisioning", "phase": "managed", "control_planes": 3, "workers": 5, "node_size": "large", "created_at": "2026-03-15T14:30:00Z"}Récupérer un cluster
Section intitulée « Récupérer un cluster »GET /v1/clusters/{cluster_id}Réponse 200 OK : Objet cluster complet (voir format ci-dessus).
Modifier un cluster
Section intitulée « Modifier un cluster »PATCH /v1/clusters/{cluster_id}Body :
{ "workers": 8}Seuls les champs workers et node_size sont modifiables après création.
Supprimer un cluster
Section intitulée « Supprimer un cluster »DELETE /v1/clusters/{cluster_id}Réponse 204 No Content
Récupérer le kubeconfig
Section intitulée « Récupérer le kubeconfig »GET /v1/clusters/{cluster_id}/kubeconfigRéponse 200 OK : Fichier YAML kubeconfig en texte brut.
curl -H "Authorization: Bearer TOKEN" \ https://api.deployme.cloud/v1/clusters/cls_abc123/kubeconfig \ -o kubeconfig.yamlStatuts possibles
Section intitulée « Statuts possibles »| Statut | Description |
|---|---|
provisioning | En cours de création |
running | Cluster opérationnel |
scaling | Ajout ou retrait de nodes en cours |
upgrading | Mise à jour Kubernetes en cours |
error | Erreur lors d’une opération |
deleting | Suppression en cours |