Generate kubeconfig for a cluster
POSThttps://api.astropulse.io/api/v1/clusters/:clusterId/kubeconfig/generate
Generates a new kubeconfig file for a specific Kubernetes cluster
Request
Path Parameters
clusterId stringrequired
Cluster ID
Header Parameters
X-Astro-API-Key stringrequired
APIKey
Responses
- 200
- 400
- 401
- 403
- 404
- 409
- 429
- 500
Kubeconfig generated successfully
- application/json
- Schema
- Example (auto)
Schema
data object
idstring
messagestring
statusstring
{
"data": {
"clusterName": "string",
"credentials": {
"data": {},
"type": "dynamic"
},
"duration": -9223372036854776000
},
"id": "string",
"message": "string",
"status": "string"
}
Invalid cluster ID
- application/json
- Schema
- Example (auto)
Schema
body object
{
"body": {
"details": {},
"error": "Resource not found",
"error_code": "NOT_FOUND",
"status": 404,
"trace_id": "trace-5e6f7g8h9i"
}
}
Missing or invalid API key
- application/json
- Schema
- Example (auto)
Schema
body object
{
"body": {
"details": {},
"error": "Resource not found",
"error_code": "NOT_FOUND",
"status": 404,
"trace_id": "trace-5e6f7g8h9i"
}
}
User does not have permission to generate kubeconfig
- application/json
- Schema
- Example (auto)
Schema
body object
{
"body": {
"details": {},
"error": "Resource not found",
"error_code": "NOT_FOUND",
"status": 404,
"trace_id": "trace-5e6f7g8h9i"
}
}
Cluster not found
- application/json
- Schema
- Example (auto)
Schema
body object
{
"body": {
"details": {},
"error": "Resource not found",
"error_code": "NOT_FOUND",
"status": 404,
"trace_id": "trace-5e6f7g8h9i"
}
}
Cluster is not in a valid state for kubeconfig generation
- application/json
- Schema
- Example (auto)
Schema
body object
{
"body": {
"details": {},
"error": "Resource not found",
"error_code": "NOT_FOUND",
"status": 404,
"trace_id": "trace-5e6f7g8h9i"
}
}
Rate limit exceeded
- application/json
- Schema
- Example (auto)
Schema
body object
{
"body": {
"details": {},
"error": "Resource not found",
"error_code": "NOT_FOUND",
"status": 404,
"trace_id": "trace-5e6f7g8h9i"
}
}
Internal server error
- application/json
- Schema
- Example (auto)
Schema
body object
{
"body": {
"details": {},
"error": "Resource not found",
"error_code": "NOT_FOUND",
"status": 404,
"trace_id": "trace-5e6f7g8h9i"
}
}
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.astropulse.io/api/v1/clusters/:clusterId/kubeconfig/generate");
request.Headers.Add("Accept", "application/json");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());