From 334df457ceddca23fbddfd5ea4964423067e5721 Mon Sep 17 00:00:00 2001 From: allanice001 Date: Sat, 8 Nov 2025 10:22:45 +0000 Subject: [PATCH] feat: complete node pool api, sdk and ui Signed-off-by: allanice001 --- docs/docs.go | 2 +- docs/swagger.json | 2 +- docs/swagger.yaml | 986 +++++ internal/api/routes.go | 47 +- internal/app/runtime.go | 3 + internal/bg/bastion.go | 239 +- internal/handlers/dto/node_pools.go | 46 + internal/handlers/dto/servers.go | 12 +- internal/handlers/node_pools.go | 1270 ++++++ internal/handlers/ssh_keys.go | 25 +- internal/models/annotation.go | 1 + internal/models/cluster.go | 29 + internal/models/label.go | 2 +- internal/models/node_pool.go | 23 +- internal/models/server.go | 5 +- sdk/go/.openapi-generator/FILES | 17 + sdk/go/README.md | 26 +- sdk/go/api/openapi.yaml | 1241 +++++- sdk/go/api_node_pools.go | 3615 +++++++++++++++++ sdk/go/client.go | 3 + sdk/go/configuration.go | 6 +- sdk/go/docs/AnnotationsAPI.md | 2 +- sdk/go/docs/ArcherAdminAPI.md | 2 +- sdk/go/docs/AuthAPI.md | 2 +- sdk/go/docs/DtoAttachAnnotationsRequest.md | 56 + sdk/go/docs/DtoAttachLabelsRequest.md | 56 + sdk/go/docs/DtoAttachServersRequest.md | 56 + sdk/go/docs/DtoAttachTaintsRequest.md | 56 + sdk/go/docs/DtoCreateNodePoolRequest.md | 82 + sdk/go/docs/DtoNodePoolResponse.md | 290 ++ sdk/go/docs/DtoUpdateNodePoolRequest.md | 82 + sdk/go/docs/HealthAPI.md | 2 +- sdk/go/docs/LabelsAPI.md | 2 +- sdk/go/docs/MeAPI.md | 2 +- sdk/go/docs/MeAPIKeysAPI.md | 2 +- sdk/go/docs/NodePoolsAPI.md | 1239 ++++++ sdk/go/docs/OrgsAPI.md | 2 +- sdk/go/docs/ServersAPI.md | 2 +- sdk/go/docs/SshAPI.md | 2 +- sdk/go/docs/TaintsAPI.md | 2 +- sdk/go/go.mod | 2 +- .../model_dto_attach_annotations_request.go | 124 + sdk/go/model_dto_attach_labels_request.go | 124 + sdk/go/model_dto_attach_servers_request.go | 124 + sdk/go/model_dto_attach_taints_request.go | 124 + sdk/go/model_dto_create_node_pool_request.go | 160 + sdk/go/model_dto_node_pool_response.go | 448 ++ sdk/go/model_dto_update_node_pool_request.go | 160 + sdk/go/test/api_node_pools_test.go | 264 ++ sdk/ts/.openapi-generator/FILES | 16 + sdk/ts/README.md | 134 +- sdk/ts/docs/AnnotationsApi.md | 2 +- sdk/ts/docs/ArcherAdminApi.md | 2 +- sdk/ts/docs/AuthApi.md | 2 +- sdk/ts/docs/DtoAttachAnnotationsRequest.md | 30 + sdk/ts/docs/DtoAttachLabelsRequest.md | 30 + sdk/ts/docs/DtoAttachServersRequest.md | 30 + sdk/ts/docs/DtoAttachTaintsRequest.md | 30 + sdk/ts/docs/DtoCreateNodePoolRequest.md | 32 + sdk/ts/docs/DtoNodePoolResponse.md | 48 + sdk/ts/docs/DtoServerResponse.md | 4 +- sdk/ts/docs/DtoUpdateNodePoolRequest.md | 32 + sdk/ts/docs/HealthApi.md | 2 +- sdk/ts/docs/LabelsApi.md | 2 +- sdk/ts/docs/MeAPIKeysApi.md | 2 +- sdk/ts/docs/MeApi.md | 2 +- sdk/ts/docs/NodePoolsApi.md | 1366 +++++++ sdk/ts/docs/OrgsApi.md | 2 +- sdk/ts/docs/ServersApi.md | 2 +- sdk/ts/docs/SshApi.md | 2 +- sdk/ts/docs/TaintsApi.md | 2 +- sdk/ts/package.json | 2 +- sdk/ts/src/apis/NodePoolsApi.ts | 1478 +++++++ sdk/ts/src/apis/index.ts | 1 + .../src/models/DtoAttachAnnotationsRequest.ts | 74 + sdk/ts/src/models/DtoAttachLabelsRequest.ts | 73 + sdk/ts/src/models/DtoAttachServersRequest.ts | 73 + sdk/ts/src/models/DtoAttachTaintsRequest.ts | 73 + sdk/ts/src/models/DtoCreateNodePoolRequest.ts | 91 + sdk/ts/src/models/DtoCreateServerRequest.ts | 28 +- sdk/ts/src/models/DtoNodePoolResponse.ts | 187 + sdk/ts/src/models/DtoServerResponse.ts | 28 +- sdk/ts/src/models/DtoUpdateNodePoolRequest.ts | 91 + sdk/ts/src/models/DtoUpdateServerRequest.ts | 28 +- sdk/ts/src/models/index.ts | 7 + sdk/ts/src/runtime.ts | 2 +- terraform-provider-autoglue/go.mod | 2 +- terraform/envs/dev/main.tf | 8 +- ui/src/App.tsx | 2 + ui/src/api/node_pools.ts | 91 + ui/src/api/ssh.ts | 23 +- ui/src/pages/me/me-page.tsx | 5 + ui/src/pages/nodepools/node-pools-page.tsx | 1065 +++++ ui/src/pages/servers/server-page.tsx | 2 +- ui/src/sdk/.openapi-generator/FILES | 16 + ui/src/sdk/apis/NodePoolsApi.ts | 1170 ++++++ ui/src/sdk/apis/index.ts | 1 + ui/src/sdk/docs/AnnotationsApi.md | 2 +- ui/src/sdk/docs/ArcherAdminApi.md | 2 +- ui/src/sdk/docs/AuthApi.md | 2 +- .../sdk/docs/DtoAttachAnnotationsRequest.md | 34 + ui/src/sdk/docs/DtoAttachLabelsRequest.md | 34 + ui/src/sdk/docs/DtoAttachServersRequest.md | 34 + ui/src/sdk/docs/DtoAttachTaintsRequest.md | 34 + ui/src/sdk/docs/DtoCreateNodePoolRequest.md | 36 + ui/src/sdk/docs/DtoNodePoolResponse.md | 52 + ui/src/sdk/docs/DtoServerResponse.md | 4 +- ui/src/sdk/docs/DtoUpdateNodePoolRequest.md | 36 + ui/src/sdk/docs/HealthApi.md | 2 +- ui/src/sdk/docs/LabelsApi.md | 2 +- ui/src/sdk/docs/MeAPIKeysApi.md | 2 +- ui/src/sdk/docs/MeApi.md | 2 +- ui/src/sdk/docs/NodePoolsApi.md | 1435 +++++++ ui/src/sdk/docs/OrgsApi.md | 2 +- ui/src/sdk/docs/ServersApi.md | 2 +- ui/src/sdk/docs/SshApi.md | 2 +- ui/src/sdk/docs/TaintsApi.md | 2 +- .../sdk/models/DtoAttachAnnotationsRequest.ts | 64 + ui/src/sdk/models/DtoAttachLabelsRequest.ts | 64 + ui/src/sdk/models/DtoAttachServersRequest.ts | 64 + ui/src/sdk/models/DtoAttachTaintsRequest.ts | 64 + ui/src/sdk/models/DtoCreateNodePoolRequest.ts | 83 + ui/src/sdk/models/DtoCreateServerRequest.ts | 28 +- ui/src/sdk/models/DtoNodePoolResponse.ts | 156 + ui/src/sdk/models/DtoServerResponse.ts | 28 +- ui/src/sdk/models/DtoUpdateNodePoolRequest.ts | 83 + ui/src/sdk/models/DtoUpdateServerRequest.ts | 28 +- ui/src/sdk/models/index.ts | 7 + ui/src/sdk/runtime.ts | 2 +- ui/src/sdkClient.ts | 6 + 130 files changed, 19675 insertions(+), 187 deletions(-) create mode 100644 internal/handlers/dto/node_pools.go create mode 100644 internal/handlers/node_pools.go create mode 100644 internal/models/cluster.go create mode 100644 sdk/go/api_node_pools.go create mode 100644 sdk/go/docs/DtoAttachAnnotationsRequest.md create mode 100644 sdk/go/docs/DtoAttachLabelsRequest.md create mode 100644 sdk/go/docs/DtoAttachServersRequest.md create mode 100644 sdk/go/docs/DtoAttachTaintsRequest.md create mode 100644 sdk/go/docs/DtoCreateNodePoolRequest.md create mode 100644 sdk/go/docs/DtoNodePoolResponse.md create mode 100644 sdk/go/docs/DtoUpdateNodePoolRequest.md create mode 100644 sdk/go/docs/NodePoolsAPI.md create mode 100644 sdk/go/model_dto_attach_annotations_request.go create mode 100644 sdk/go/model_dto_attach_labels_request.go create mode 100644 sdk/go/model_dto_attach_servers_request.go create mode 100644 sdk/go/model_dto_attach_taints_request.go create mode 100644 sdk/go/model_dto_create_node_pool_request.go create mode 100644 sdk/go/model_dto_node_pool_response.go create mode 100644 sdk/go/model_dto_update_node_pool_request.go create mode 100644 sdk/go/test/api_node_pools_test.go create mode 100644 sdk/ts/docs/DtoAttachAnnotationsRequest.md create mode 100644 sdk/ts/docs/DtoAttachLabelsRequest.md create mode 100644 sdk/ts/docs/DtoAttachServersRequest.md create mode 100644 sdk/ts/docs/DtoAttachTaintsRequest.md create mode 100644 sdk/ts/docs/DtoCreateNodePoolRequest.md create mode 100644 sdk/ts/docs/DtoNodePoolResponse.md create mode 100644 sdk/ts/docs/DtoUpdateNodePoolRequest.md create mode 100644 sdk/ts/docs/NodePoolsApi.md create mode 100644 sdk/ts/src/apis/NodePoolsApi.ts create mode 100644 sdk/ts/src/models/DtoAttachAnnotationsRequest.ts create mode 100644 sdk/ts/src/models/DtoAttachLabelsRequest.ts create mode 100644 sdk/ts/src/models/DtoAttachServersRequest.ts create mode 100644 sdk/ts/src/models/DtoAttachTaintsRequest.ts create mode 100644 sdk/ts/src/models/DtoCreateNodePoolRequest.ts create mode 100644 sdk/ts/src/models/DtoNodePoolResponse.ts create mode 100644 sdk/ts/src/models/DtoUpdateNodePoolRequest.ts create mode 100644 ui/src/api/node_pools.ts create mode 100644 ui/src/pages/nodepools/node-pools-page.tsx create mode 100644 ui/src/sdk/apis/NodePoolsApi.ts create mode 100644 ui/src/sdk/docs/DtoAttachAnnotationsRequest.md create mode 100644 ui/src/sdk/docs/DtoAttachLabelsRequest.md create mode 100644 ui/src/sdk/docs/DtoAttachServersRequest.md create mode 100644 ui/src/sdk/docs/DtoAttachTaintsRequest.md create mode 100644 ui/src/sdk/docs/DtoCreateNodePoolRequest.md create mode 100644 ui/src/sdk/docs/DtoNodePoolResponse.md create mode 100644 ui/src/sdk/docs/DtoUpdateNodePoolRequest.md create mode 100644 ui/src/sdk/docs/NodePoolsApi.md create mode 100644 ui/src/sdk/models/DtoAttachAnnotationsRequest.ts create mode 100644 ui/src/sdk/models/DtoAttachLabelsRequest.ts create mode 100644 ui/src/sdk/models/DtoAttachServersRequest.ts create mode 100644 ui/src/sdk/models/DtoAttachTaintsRequest.ts create mode 100644 ui/src/sdk/models/DtoCreateNodePoolRequest.ts create mode 100644 ui/src/sdk/models/DtoNodePoolResponse.ts create mode 100644 ui/src/sdk/models/DtoUpdateNodePoolRequest.ts diff --git a/docs/docs.go b/docs/docs.go index f7b3792..fdb6dc8 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -5,7 +5,7 @@ package docs import "github.com/swaggo/swag/v2" const docTemplate = `{ - "schemes": {{ marshal .Schemes }},"swagger":"2.0","info":{"description":"{{escape .Description}}","title":"{{.Title}}","contact":{"name":"GlueOps"},"version":"{{.Version}}"},"host":"{{.Host}}","basePath":"{{.BasePath}}","paths":{"/.well-known/jwks.json":{"get":{"description":"Returns the JSON Web Key Set for token verification","produces":["application/json"],"tags":["Auth"],"summary":"Get JWKS","operationId":"getJWKS","responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.JWKS"}}}}},"/admin/archer/jobs":{"get":{"security":[{"BearerAuth":[]}],"description":"Paginated background jobs with optional filters. Search ` + "`" + `q` + "`" + ` may match id, type, error, payload (implementation-dependent).","consumes":["application/json"],"produces":["application/json"],"tags":["ArcherAdmin"],"summary":"List Archer jobs (admin)","operationId":"AdminListArcherJobs","parameters":[{"enum":["queued","running","succeeded","failed","canceled","retrying","scheduled"],"type":"string","description":"Filter by status","name":"status","in":"query"},{"type":"string","description":"Filter by queue name / worker name","name":"queue","in":"query"},{"type":"string","description":"Free-text search","name":"q","in":"query"},{"type":"integer","default":1,"description":"Page number","name":"page","in":"query"},{"maximum":100,"minimum":1,"type":"integer","default":25,"description":"Items per page","name":"page_size","in":"query"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.PageJob"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"forbidden","schema":{"type":"string"}},"500":{"description":"internal error","schema":{"type":"string"}}}},"post":{"security":[{"BearerAuth":[]}],"description":"Create a job immediately or schedule it for the future via ` + "`" + `run_at` + "`" + `.","consumes":["application/json"],"produces":["application/json"],"tags":["ArcherAdmin"],"summary":"Enqueue a new Archer job (admin)","operationId":"AdminEnqueueArcherJob","parameters":[{"description":"Job parameters","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.EnqueueRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.Job"}},"400":{"description":"invalid json or missing fields","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"forbidden","schema":{"type":"string"}},"500":{"description":"internal error","schema":{"type":"string"}}}}},"/admin/archer/jobs/{id}/cancel":{"post":{"security":[{"BearerAuth":[]}],"description":"Set job status to canceled if cancellable. For running jobs, this only affects future picks; wire to Archer if you need active kill.","consumes":["application/json"],"produces":["application/json"],"tags":["ArcherAdmin"],"summary":"Cancel an Archer job (admin)","operationId":"AdminCancelArcherJob","parameters":[{"type":"string","description":"Job ID","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.Job"}},"400":{"description":"invalid job or not cancellable","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"forbidden","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}}}}},"/admin/archer/jobs/{id}/retry":{"post":{"security":[{"BearerAuth":[]}],"description":"Marks the job retriable (DB flip). Swap this for an Archer admin call if you expose one.","consumes":["application/json"],"produces":["application/json"],"tags":["ArcherAdmin"],"summary":"Retry a failed/canceled Archer job (admin)","operationId":"AdminRetryArcherJob","parameters":[{"type":"string","description":"Job ID","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.Job"}},"400":{"description":"invalid job or not eligible","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"forbidden","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}}}}},"/admin/archer/queues":{"get":{"security":[{"BearerAuth":[]}],"description":"Summary metrics per queue (pending, running, failed, scheduled).","consumes":["application/json"],"produces":["application/json"],"tags":["ArcherAdmin"],"summary":"List Archer queues (admin)","operationId":"AdminListArcherQueues","responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/dto.QueueInfo"}}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"forbidden","schema":{"type":"string"}},"500":{"description":"internal error","schema":{"type":"string"}}}}},"/annotations":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns annotations for the organization in X-Org-ID. Filters: ` + "`" + `key` + "`" + `, ` + "`" + `value` + "`" + `, and ` + "`" + `q` + "`" + ` (key contains). Add ` + "`" + `include=node_pools` + "`" + ` to include linked node pools.","consumes":["application/json"],"produces":["application/json"],"tags":["Annotations"],"summary":"List annotations (org scoped)","operationId":"ListAnnotations","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Exact key","name":"key","in":"query"},{"type":"string","description":"Exact value","name":"value","in":"query"},{"type":"string","description":"key contains (case-insensitive)","name":"q","in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/dto.AnnotationResponse"}}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"failed to list annotations","schema":{"type":"string"}}}},"post":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Creates an annotation.","consumes":["application/json"],"produces":["application/json"],"tags":["Annotations"],"summary":"Create annotation (org scoped)","operationId":"CreateAnnotation","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"description":"Annotation payload","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.CreateAnnotationRequest"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/dto.AnnotationResponse"}},"400":{"description":"invalid json / missing fields","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"create failed","schema":{"type":"string"}}}}},"/annotations/{id}":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns one annotation. Add ` + "`" + `include=node_pools` + "`" + ` to include node pools.","consumes":["application/json"],"produces":["application/json"],"tags":["Annotations"],"summary":"Get annotation by ID (org scoped)","operationId":"GetAnnotation","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Annotation ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.AnnotationResponse"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"fetch failed","schema":{"type":"string"}}}},"delete":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Permanently deletes the annotation.","consumes":["application/json"],"produces":["application/json"],"tags":["Annotations"],"summary":"Delete annotation (org scoped)","operationId":"DeleteAnnotation","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Annotation ID (UUID)","name":"id","in":"path","required":true}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"delete failed","schema":{"type":"string"}}}},"patch":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Partially update annotation fields.","consumes":["application/json"],"produces":["application/json"],"tags":["Annotations"],"summary":"Update annotation (org scoped)","operationId":"UpdateAnnotation","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Annotation ID (UUID)","name":"id","in":"path","required":true},{"description":"Fields to update","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.UpdateAnnotationRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.AnnotationResponse"}},"400":{"description":"invalid id / invalid json","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"update failed","schema":{"type":"string"}}}}},"/auth/logout":{"post":{"consumes":["application/json"],"produces":["application/json"],"tags":["Auth"],"summary":"Revoke refresh token family (logout everywhere)","operationId":"Logout","parameters":[{"description":"Refresh token","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.LogoutRequest"}}],"responses":{"204":{"description":"No Content"}}}},"/auth/refresh":{"post":{"consumes":["application/json"],"produces":["application/json"],"tags":["Auth"],"summary":"Rotate refresh token","operationId":"Refresh","parameters":[{"description":"Refresh token","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.RefreshRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.TokenPair"}}}}},"/auth/{provider}/callback":{"get":{"produces":["application/json"],"tags":["Auth"],"summary":"Handle social login callback","operationId":"AuthCallback","parameters":[{"type":"string","description":"google|github","name":"provider","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.TokenPair"}}}}},"/auth/{provider}/start":{"post":{"description":"Returns provider authorization URL for the frontend to redirect","produces":["application/json"],"tags":["Auth"],"summary":"Begin social login","operationId":"AuthStart","parameters":[{"type":"string","description":"google|github","name":"provider","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.AuthStartResponse"}}}}},"/healthz":{"get":{"description":"Returns 200 OK when the service is up","consumes":["application/json"],"produces":["application/json"],"tags":["Health"],"summary":"Basic health check","operationId":"HealthCheck // operationId","responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/handlers.HealthStatus"}}}}},"/labels":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns node labels for the organization in X-Org-ID. Filters: ` + "`" + `key` + "`" + `, ` + "`" + `value` + "`" + `, and ` + "`" + `q` + "`" + ` (key contains). Add ` + "`" + `include=node_pools` + "`" + ` to include linked node groups.","consumes":["application/json"],"produces":["application/json"],"tags":["Labels"],"summary":"List node labels (org scoped)","operationId":"ListLabels","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Exact key","name":"key","in":"query"},{"type":"string","description":"Exact value","name":"value","in":"query"},{"type":"string","description":"Key contains (case-insensitive)","name":"q","in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/dto.LabelResponse"}}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"failed to list node taints","schema":{"type":"string"}}}},"post":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Creates a label.","consumes":["application/json"],"produces":["application/json"],"tags":["Labels"],"summary":"Create label (org scoped)","operationId":"CreateLabel","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"description":"Label payload","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.CreateLabelRequest"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/dto.LabelResponse"}},"400":{"description":"invalid json / missing fields / invalid node_pool_ids","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"create failed","schema":{"type":"string"}}}}},"/labels/{id}":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns one label.","consumes":["application/json"],"produces":["application/json"],"tags":["Labels"],"summary":"Get label by ID (org scoped)","operationId":"GetLabel","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Label ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.LabelResponse"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"fetch failed","schema":{"type":"string"}}}},"delete":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Permanently deletes the label.","consumes":["application/json"],"produces":["application/json"],"tags":["Labels"],"summary":"Delete label (org scoped)","operationId":"DeleteLabel","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Label ID (UUID)","name":"id","in":"path","required":true}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"delete failed","schema":{"type":"string"}}}},"patch":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Partially update label fields.","consumes":["application/json"],"produces":["application/json"],"tags":["Labels"],"summary":"Update label (org scoped)","operationId":"UpdateLabel","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Label ID (UUID)","name":"id","in":"path","required":true},{"description":"Fields to update","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.UpdateLabelRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.LabelResponse"}},"400":{"description":"invalid id / invalid json","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"update failed","schema":{"type":"string"}}}}},"/me":{"get":{"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"produces":["application/json"],"tags":["Me"],"summary":"Get current user profile","operationId":"GetMe","responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/handlers.meResponse"}}}},"patch":{"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["Me"],"summary":"Update current user profile","operationId":"UpdateMe","parameters":[{"description":"Patch profile","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/handlers.updateMeRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/models.User"}}}}},"/me/api-keys":{"get":{"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"produces":["application/json"],"tags":["MeAPIKeys"],"summary":"List my API keys","operationId":"ListUserAPIKeys","responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/handlers.userAPIKeyOut"}}}}},"post":{"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"description":"Returns the plaintext key once. Store it securely on the client side.","consumes":["application/json"],"produces":["application/json"],"tags":["MeAPIKeys"],"summary":"Create a new user API key","operationId":"CreateUserAPIKey","parameters":[{"description":"Key options","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/handlers.createUserKeyRequest"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/handlers.userAPIKeyOut"}}}}},"/me/api-keys/{id}":{"delete":{"security":[{"BearerAuth":[]}],"produces":["application/json"],"tags":["MeAPIKeys"],"summary":"Delete a user API key","operationId":"DeleteUserAPIKey","parameters":[{"type":"string","description":"Key ID (UUID)","name":"id","in":"path","required":true}],"responses":{"204":{"description":"No Content"}}}},"/orgs":{"get":{"security":[{"BearerAuth":[]}],"produces":["application/json"],"tags":["Orgs"],"summary":"List organizations I belong to","operationId":"listMyOrgs","responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/models.Organization"}}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}},"post":{"security":[{"BearerAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["Orgs"],"summary":"Create organization","operationId":"createOrg","parameters":[{"description":"Org payload","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/handlers.orgCreateReq"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/models.Organization"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/utils.ErrorResponse"}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}},"409":{"description":"Conflict","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}}},"/orgs/{id}":{"get":{"security":[{"BearerAuth":[]}],"produces":["application/json"],"tags":["Orgs"],"summary":"Get organization","operationId":"getOrg","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/models.Organization"}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}},"delete":{"security":[{"BearerAuth":[]}],"produces":["application/json"],"tags":["Orgs"],"summary":"Delete organization (owner)","operationId":"deleteOrg","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}},"patch":{"security":[{"BearerAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["Orgs"],"summary":"Update organization (owner/admin)","operationId":"updateOrg","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true},{"description":"Update payload","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/handlers.orgUpdateReq"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/models.Organization"}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}}},"/orgs/{id}/api-keys":{"get":{"security":[{"BearerAuth":[]}],"produces":["application/json"],"tags":["Orgs"],"summary":"List org-scoped API keys (no secrets)","operationId":"listOrgKeys","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/models.APIKey"}}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}},"post":{"security":[{"BearerAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["Orgs"],"summary":"Create org key/secret pair (owner/admin)","operationId":"createOrgKey","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true},{"description":"Key name + optional expiry","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/handlers.orgKeyCreateReq"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/handlers.orgKeyCreateResp"}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}}},"/orgs/{id}/api-keys/{key_id}":{"delete":{"security":[{"BearerAuth":[]}],"produces":["application/json"],"tags":["Orgs"],"summary":"Delete org key (owner/admin)","operationId":"deleteOrgKey","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true},{"type":"string","description":"Key ID (UUID)","name":"key_id","in":"path","required":true}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}}},"/orgs/{id}/members":{"get":{"security":[{"BearerAuth":[]}],"produces":["application/json"],"tags":["Orgs"],"summary":"List members in org","operationId":"listMembers","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/handlers.memberOut"}}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}},"post":{"security":[{"BearerAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["Orgs"],"summary":"Add or update a member (owner/admin)","operationId":"addOrUpdateMember","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true},{"description":"User \u0026 role","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/handlers.memberUpsertReq"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/handlers.memberOut"}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}}},"/orgs/{id}/members/{user_id}":{"delete":{"security":[{"BearerAuth":[]}],"produces":["application/json"],"tags":["Orgs"],"summary":"Remove a member (owner/admin)","operationId":"removeMember","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true},{"type":"string","description":"User ID (UUID)","name":"user_id","in":"path","required":true}],"responses":{"204":{"description":"Removed"},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}}},"/servers":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns servers for the organization in X-Org-ID. Optional filters: status, role.","consumes":["application/json"],"produces":["application/json"],"tags":["Servers"],"summary":"List servers (org scoped)","operationId":"ListServers","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Filter by status (pending|provisioning|ready|failed)","name":"status","in":"query"},{"type":"string","description":"Filter by role","name":"role","in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/dto.ServerResponse"}}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"failed to list servers","schema":{"type":"string"}}}},"post":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Creates a server bound to the org in X-Org-ID. Validates that ssh_key_id belongs to the org.","consumes":["application/json"],"produces":["application/json"],"tags":["Servers"],"summary":"Create server (org scoped)","operationId":"CreateServer","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"description":"Server payload","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.CreateServerRequest"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/dto.ServerResponse"}},"400":{"description":"invalid json / missing fields / invalid status / invalid ssh_key_id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"create failed","schema":{"type":"string"}}}}},"/servers/{id}":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns one server in the given organization.","consumes":["application/json"],"produces":["application/json"],"tags":["Servers"],"summary":"Get server by ID (org scoped)","operationId":"GetServer","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Server ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.ServerResponse"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"fetch failed","schema":{"type":"string"}}}},"delete":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Permanently deletes the server.","consumes":["application/json"],"produces":["application/json"],"tags":["Servers"],"summary":"Delete server (org scoped)","operationId":"DeleteServer","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Server ID (UUID)","name":"id","in":"path","required":true}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"delete failed","schema":{"type":"string"}}}},"patch":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Partially update fields; changing ssh_key_id validates ownership.","consumes":["application/json"],"produces":["application/json"],"tags":["Servers"],"summary":"Update server (org scoped)","operationId":"UpdateServer","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Server ID (UUID)","name":"id","in":"path","required":true},{"description":"Fields to update","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.UpdateServerRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.ServerResponse"}},"400":{"description":"invalid id / invalid json / invalid status / invalid ssh_key_id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"update failed","schema":{"type":"string"}}}}},"/ssh":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns ssh keys for the organization in X-Org-ID.","consumes":["application/json"],"produces":["application/json"],"tags":["Ssh"],"summary":"List ssh keys (org scoped)","operationId":"ListPublicSshKeys","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/dto.SshResponse"}}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"failed to list keys","schema":{"type":"string"}}}},"post":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Generates an RSA or ED25519 keypair, saves it, and returns metadata. For RSA you may set bits (2048/3072/4096). Default is 4096. ED25519 ignores bits.","consumes":["application/json"],"produces":["application/json"],"tags":["Ssh"],"summary":"Create ssh keypair (org scoped)","operationId":"CreateSSHKey","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"description":"Key generation options","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.CreateSSHRequest"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/dto.SshResponse"}},"400":{"description":"invalid json / invalid bits","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"generation/create failed","schema":{"type":"string"}}}}},"/ssh/{id}":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns public key fields. Append ` + "`" + `?reveal=true` + "`" + ` to include the private key PEM.","consumes":["application/json"],"produces":["application/json"],"tags":["Ssh"],"summary":"Get ssh key by ID (org scoped)","operationId":"GetSSHKey","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"SSH Key ID (UUID)","name":"id","in":"path","required":true},{"type":"boolean","description":"Reveal private key PEM","name":"reveal","in":"query"}],"responses":{"200":{"description":"When reveal=true","schema":{"$ref":"#/definitions/dto.SshRevealResponse"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"fetch failed","schema":{"type":"string"}}}},"delete":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Permanently deletes a keypair.","consumes":["application/json"],"produces":["application/json"],"tags":["Ssh"],"summary":"Delete ssh keypair (org scoped)","operationId":"DeleteSSHKey","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"SSH Key ID (UUID)","name":"id","in":"path","required":true}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"delete failed","schema":{"type":"string"}}}}},"/ssh/{id}/download":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Download ` + "`" + `part=public|private|both` + "`" + ` of the keypair. ` + "`" + `both` + "`" + ` returns a zip file.","produces":["application/json"],"tags":["Ssh"],"summary":"Download ssh key files by ID (org scoped)","operationId":"DownloadSSHKey","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header","required":true},{"type":"string","description":"SSH Key ID (UUID)","name":"id","in":"path","required":true},{"enum":["public","private","both"],"type":"string","description":"Which part to download","name":"part","in":"query","required":true}],"responses":{"200":{"description":"file content","schema":{"type":"string"}},"400":{"description":"invalid id / invalid part","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"download failed","schema":{"type":"string"}}}}},"/taints":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns node taints for the organization in X-Org-ID. Filters: ` + "`" + `key` + "`" + `, ` + "`" + `value` + "`" + `, and ` + "`" + `q` + "`" + ` (key contains). Add ` + "`" + `include=node_pools` + "`" + ` to include linked node pools.","consumes":["application/json"],"produces":["application/json"],"tags":["Taints"],"summary":"List node pool taints (org scoped)","operationId":"ListTaints","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Exact key","name":"key","in":"query"},{"type":"string","description":"Exact value","name":"value","in":"query"},{"type":"string","description":"key contains (case-insensitive)","name":"q","in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/dto.TaintResponse"}}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"failed to list node taints","schema":{"type":"string"}}}},"post":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Creates a taint.","consumes":["application/json"],"produces":["application/json"],"tags":["Taints"],"summary":"Create node taint (org scoped)","operationId":"CreateTaint","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"description":"Taint payload","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.CreateTaintRequest"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/dto.TaintResponse"}},"400":{"description":"invalid json / missing fields / invalid node_pool_ids","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"create failed","schema":{"type":"string"}}}}},"/taints/{id}":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["Taints"],"summary":"Get node taint by ID (org scoped)","operationId":"GetTaint","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Taint ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.TaintResponse"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"fetch failed","schema":{"type":"string"}}}},"delete":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Permanently deletes the taint.","consumes":["application/json"],"produces":["application/json"],"tags":["Taints"],"summary":"Delete taint (org scoped)","operationId":"DeleteTaint","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Taint ID (UUID)","name":"id","in":"path","required":true}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"delete failed","schema":{"type":"string"}}}},"patch":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Partially update taint fields.","consumes":["application/json"],"produces":["application/json"],"tags":["Taints"],"summary":"Update node taint (org scoped)","operationId":"UpdateTaint","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Taint ID (UUID)","name":"id","in":"path","required":true},{"description":"Fields to update","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.UpdateTaintRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.TaintResponse"}},"400":{"description":"invalid id / invalid json","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"update failed","schema":{"type":"string"}}}}}},"definitions":{"dto.AnnotationResponse":{"type":"object","properties":{"created_at":{"type":"string"},"id":{"type":"string"},"key":{"type":"string"},"organization_id":{"type":"string"},"updated_at":{"type":"string"},"value":{"type":"string"}}},"dto.AuthStartResponse":{"type":"object","properties":{"auth_url":{"type":"string","example":"https://accounts.google.com/o/oauth2/v2/auth?client_id=..."}}},"dto.CreateAnnotationRequest":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}},"dto.CreateLabelRequest":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}},"dto.CreateSSHRequest":{"type":"object","properties":{"bits":{"description":"Only for RSA","type":"integer"},"comment":{"type":"string","example":"deploy@autoglue"},"name":{"type":"string"},"type":{"description":"\"rsa\" (default) or \"ed25519\"","type":"string"}}},"dto.CreateServerRequest":{"type":"object","properties":{"hostname":{"type":"string"},"private_ip_address":{"type":"string"},"public_ip_address":{"type":"string"},"role":{"type":"string","example":"master|worker|bastion"},"ssh_key_id":{"type":"string"},"ssh_user":{"type":"string"},"status":{"type":"string","example":"pending|provisioning|ready|failed"}}},"dto.CreateTaintRequest":{"type":"object","properties":{"effect":{"type":"string"},"key":{"type":"string"},"value":{"type":"string"}}},"dto.EnqueueRequest":{"type":"object"},"dto.JWK":{"type":"object","properties":{"alg":{"type":"string","example":"RS256"},"e":{"type":"string","example":"AQAB"},"kid":{"type":"string","example":"7c6f1d0a-7a98-4e6a-9dbf-6b1af4b9f345"},"kty":{"type":"string","example":"RSA"},"n":{"type":"string"},"use":{"type":"string","example":"sig"},"x":{"type":"string"}}},"dto.JWKS":{"type":"object","properties":{"keys":{"type":"array","items":{"$ref":"#/definitions/dto.JWK"}}}},"dto.Job":{"type":"object","properties":{"attempts":{"type":"integer","example":0},"created_at":{"type":"string","example":"2025-11-04T09:30:00Z"},"id":{"type":"string","example":"01HF7SZK8Z8WG1M3J7S2Z8M2N6"},"last_error":{"type":"string","example":"error message"},"max_attempts":{"type":"integer","example":3},"payload":{},"queue":{"type":"string","example":"default"},"run_at":{"type":"string","example":"2025-11-04T09:30:00Z"},"status":{"enum":["queued|running|succeeded|failed|canceled|retrying|scheduled"],"allOf":[{"$ref":"#/definitions/dto.JobStatus"}],"example":"queued"},"type":{"type":"string","example":"email.send"},"updated_at":{"type":"string","example":"2025-11-04T09:30:00Z"}}},"dto.JobStatus":{"type":"string","enum":["queued","running","succeeded","failed","canceled","retrying","scheduled"],"x-enum-varnames":["StatusQueued","StatusRunning","StatusSucceeded","StatusFailed","StatusCanceled","StatusRetrying","StatusScheduled"]},"dto.LabelResponse":{"type":"object","properties":{"created_at":{"type":"string"},"id":{"type":"string"},"key":{"type":"string"},"organization_id":{"type":"string"},"updated_at":{"type":"string"},"value":{"type":"string"}}},"dto.LogoutRequest":{"type":"object","properties":{"refresh_token":{"type":"string","example":"m0l9o8rT3t0V8d3eFf..."}}},"dto.PageJob":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/definitions/dto.Job"}},"page":{"type":"integer","example":1},"page_size":{"type":"integer","example":25},"total":{"type":"integer","example":120}}},"dto.QueueInfo":{"type":"object","properties":{"failed":{"type":"integer","example":5},"name":{"type":"string","example":"default"},"pending":{"type":"integer","example":42},"running":{"type":"integer","example":3},"scheduled":{"type":"integer","example":7}}},"dto.RefreshRequest":{"type":"object","properties":{"refresh_token":{"type":"string","example":"m0l9o8rT3t0V8d3eFf..."}}},"dto.ServerResponse":{"type":"object","properties":{"created_at":{"type":"string"},"hostname":{"type":"string"},"id":{"type":"string"},"organization_id":{"type":"string"},"private_ip_address":{"type":"string"},"public_ip_address":{"type":"string"},"role":{"type":"string"},"ssh_key_id":{"type":"string"},"ssh_user":{"type":"string"},"status":{"type":"string"},"updated_at":{"type":"string"}}},"dto.SshResponse":{"type":"object","properties":{"created_at":{"type":"string"},"fingerprint":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"organization_id":{"type":"string"},"public_key":{"type":"string"},"updated_at":{"type":"string"}}},"dto.SshRevealResponse":{"type":"object","properties":{"created_at":{"type":"string"},"fingerprint":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"organization_id":{"type":"string"},"private_key":{"type":"string"},"public_key":{"type":"string"},"updated_at":{"type":"string"}}},"dto.TaintResponse":{"type":"object","properties":{"created_at":{"type":"string"},"effect":{"type":"string"},"id":{"type":"string"},"key":{"type":"string"},"organization_id":{"type":"string"},"updated_at":{"type":"string"},"value":{"type":"string"}}},"dto.TokenPair":{"type":"object","properties":{"access_token":{"type":"string","example":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ij..."},"expires_in":{"type":"integer","example":3600},"refresh_token":{"type":"string","example":"m0l9o8rT3t0V8d3eFf...."},"token_type":{"type":"string","example":"Bearer"}}},"dto.UpdateAnnotationRequest":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}},"dto.UpdateLabelRequest":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}},"dto.UpdateServerRequest":{"type":"object","properties":{"hostname":{"type":"string"},"private_ip_address":{"type":"string"},"public_ip_address":{"type":"string"},"role":{"type":"string","example":"master|worker|bastion"},"ssh_key_id":{"type":"string"},"ssh_user":{"type":"string"},"status":{"type":"string","example":"pending|provisioning|ready|failed"}}},"dto.UpdateTaintRequest":{"type":"object","properties":{"effect":{"type":"string"},"key":{"type":"string"},"value":{"type":"string"}}},"handlers.HealthStatus":{"type":"object","properties":{"status":{"type":"string","example":"ok"}}},"handlers.createUserKeyRequest":{"type":"object","properties":{"expires_in_hours":{"description":"optional TTL","type":"integer"},"name":{"type":"string"}}},"handlers.meResponse":{"type":"object","properties":{"avatar_url":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"display_name":{"type":"string"},"emails":{"type":"array","items":{"$ref":"#/definitions/models.UserEmail"}},"id":{"description":"example: 3fa85f64-5717-4562-b3fc-2c963f66afa6","type":"string","format":"uuid"},"is_admin":{"type":"boolean"},"is_disabled":{"type":"boolean"},"organizations":{"type":"array","items":{"$ref":"#/definitions/models.Organization"}},"primary_email":{"type":"string"},"updated_at":{"type":"string","format":"date-time"}}},"handlers.memberOut":{"type":"object","properties":{"email":{"type":"string"},"role":{"description":"owner/admin/member","type":"string"},"user_id":{"type":"string","format":"uuid"}}},"handlers.memberUpsertReq":{"type":"object","properties":{"role":{"type":"string","example":"member"},"user_id":{"type":"string","format":"uuid"}}},"handlers.orgCreateReq":{"type":"object","properties":{"domain":{"type":"string","example":"acme.com"},"name":{"type":"string","example":"Acme Corp"}}},"handlers.orgKeyCreateReq":{"type":"object","properties":{"expires_in_hours":{"type":"integer","example":720},"name":{"type":"string","example":"automation-bot"}}},"handlers.orgKeyCreateResp":{"type":"object","properties":{"created_at":{"type":"string"},"expires_at":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"org_key":{"description":"shown once:","type":"string"},"org_secret":{"description":"shown once:","type":"string"},"scope":{"description":"\"org\"","type":"string"}}},"handlers.orgUpdateReq":{"type":"object","properties":{"domain":{"type":"string"},"name":{"type":"string"}}},"handlers.updateMeRequest":{"type":"object","properties":{"display_name":{"type":"string"}}},"handlers.userAPIKeyOut":{"type":"object","properties":{"created_at":{"type":"string"},"expires_at":{"type":"string"},"id":{"type":"string","format":"uuid"},"last_used_at":{"type":"string"},"name":{"type":"string"},"plain":{"description":"Shown only on create:","type":"string"},"scope":{"description":"\"user\"","type":"string"}}},"models.APIKey":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid"},"last_used_at":{"type":"string","format":"date-time"},"name":{"type":"string"},"org_id":{"type":"string","format":"uuid"},"prefix":{"type":"string"},"revoked":{"type":"boolean"},"scope":{"type":"string"},"updated_at":{"type":"string","format":"date-time"},"user_id":{"type":"string","format":"uuid"}}},"models.Organization":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time"},"domain":{"type":"string"},"id":{"description":"example: 3fa85f64-5717-4562-b3fc-2c963f66afa6","type":"string","format":"uuid"},"name":{"type":"string"},"updated_at":{"type":"string","format":"date-time"}}},"models.User":{"type":"object","properties":{"avatar_url":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"display_name":{"type":"string"},"id":{"description":"example: 3fa85f64-5717-4562-b3fc-2c963f66afa6","type":"string","format":"uuid"},"is_admin":{"type":"boolean"},"is_disabled":{"type":"boolean"},"primary_email":{"type":"string"},"updated_at":{"type":"string","format":"date-time"}}},"models.UserEmail":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time"},"email":{"type":"string"},"id":{"description":"example: 3fa85f64-5717-4562-b3fc-2c963f66afa6","type":"string","format":"uuid"},"is_primary":{"type":"boolean"},"is_verified":{"type":"boolean"},"updated_at":{"type":"string","format":"date-time"},"user":{"$ref":"#/definitions/models.User"},"user_id":{"type":"string","format":"uuid"}}},"utils.ErrorResponse":{"type":"object","properties":{"code":{"description":"A machine-readable error code, e.g. \"validation_error\"\nexample: validation_error","type":"string"},"message":{"description":"Human-readable message\nexample: slug is required","type":"string"}}}},"securityDefinitions":{"ApiKeyAuth":{"description":"User API key","type":"apiKey","name":"X-API-KEY","in":"header"},"BearerAuth":{"description":"Bearer token authentication","type":"apiKey","name":"Authorization","in":"header"},"OrgKeyAuth":{"description":"Org-level key/secret authentication","type":"apiKey","name":"X-ORG-KEY","in":"header"},"OrgSecretAuth":{"description":"Org-level secret","type":"apiKey","name":"X-ORG-SECRET","in":"header"}}}` + "schemes": {{ marshal .Schemes }},"swagger":"2.0","info":{"description":"{{escape .Description}}","title":"{{.Title}}","contact":{"name":"GlueOps"},"version":"{{.Version}}"},"host":"{{.Host}}","basePath":"{{.BasePath}}","paths":{"/.well-known/jwks.json":{"get":{"description":"Returns the JSON Web Key Set for token verification","produces":["application/json"],"tags":["Auth"],"summary":"Get JWKS","operationId":"getJWKS","responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.JWKS"}}}}},"/admin/archer/jobs":{"get":{"security":[{"BearerAuth":[]}],"description":"Paginated background jobs with optional filters. Search ` + "`" + `q` + "`" + ` may match id, type, error, payload (implementation-dependent).","consumes":["application/json"],"produces":["application/json"],"tags":["ArcherAdmin"],"summary":"List Archer jobs (admin)","operationId":"AdminListArcherJobs","parameters":[{"enum":["queued","running","succeeded","failed","canceled","retrying","scheduled"],"type":"string","description":"Filter by status","name":"status","in":"query"},{"type":"string","description":"Filter by queue name / worker name","name":"queue","in":"query"},{"type":"string","description":"Free-text search","name":"q","in":"query"},{"type":"integer","default":1,"description":"Page number","name":"page","in":"query"},{"maximum":100,"minimum":1,"type":"integer","default":25,"description":"Items per page","name":"page_size","in":"query"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.PageJob"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"forbidden","schema":{"type":"string"}},"500":{"description":"internal error","schema":{"type":"string"}}}},"post":{"security":[{"BearerAuth":[]}],"description":"Create a job immediately or schedule it for the future via ` + "`" + `run_at` + "`" + `.","consumes":["application/json"],"produces":["application/json"],"tags":["ArcherAdmin"],"summary":"Enqueue a new Archer job (admin)","operationId":"AdminEnqueueArcherJob","parameters":[{"description":"Job parameters","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.EnqueueRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.Job"}},"400":{"description":"invalid json or missing fields","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"forbidden","schema":{"type":"string"}},"500":{"description":"internal error","schema":{"type":"string"}}}}},"/admin/archer/jobs/{id}/cancel":{"post":{"security":[{"BearerAuth":[]}],"description":"Set job status to canceled if cancellable. For running jobs, this only affects future picks; wire to Archer if you need active kill.","consumes":["application/json"],"produces":["application/json"],"tags":["ArcherAdmin"],"summary":"Cancel an Archer job (admin)","operationId":"AdminCancelArcherJob","parameters":[{"type":"string","description":"Job ID","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.Job"}},"400":{"description":"invalid job or not cancellable","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"forbidden","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}}}}},"/admin/archer/jobs/{id}/retry":{"post":{"security":[{"BearerAuth":[]}],"description":"Marks the job retriable (DB flip). Swap this for an Archer admin call if you expose one.","consumes":["application/json"],"produces":["application/json"],"tags":["ArcherAdmin"],"summary":"Retry a failed/canceled Archer job (admin)","operationId":"AdminRetryArcherJob","parameters":[{"type":"string","description":"Job ID","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.Job"}},"400":{"description":"invalid job or not eligible","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"forbidden","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}}}}},"/admin/archer/queues":{"get":{"security":[{"BearerAuth":[]}],"description":"Summary metrics per queue (pending, running, failed, scheduled).","consumes":["application/json"],"produces":["application/json"],"tags":["ArcherAdmin"],"summary":"List Archer queues (admin)","operationId":"AdminListArcherQueues","responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/dto.QueueInfo"}}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"forbidden","schema":{"type":"string"}},"500":{"description":"internal error","schema":{"type":"string"}}}}},"/annotations":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns annotations for the organization in X-Org-ID. Filters: ` + "`" + `key` + "`" + `, ` + "`" + `value` + "`" + `, and ` + "`" + `q` + "`" + ` (key contains). Add ` + "`" + `include=node_pools` + "`" + ` to include linked node pools.","consumes":["application/json"],"produces":["application/json"],"tags":["Annotations"],"summary":"List annotations (org scoped)","operationId":"ListAnnotations","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Exact key","name":"key","in":"query"},{"type":"string","description":"Exact value","name":"value","in":"query"},{"type":"string","description":"key contains (case-insensitive)","name":"q","in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/dto.AnnotationResponse"}}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"failed to list annotations","schema":{"type":"string"}}}},"post":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Creates an annotation.","consumes":["application/json"],"produces":["application/json"],"tags":["Annotations"],"summary":"Create annotation (org scoped)","operationId":"CreateAnnotation","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"description":"Annotation payload","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.CreateAnnotationRequest"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/dto.AnnotationResponse"}},"400":{"description":"invalid json / missing fields","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"create failed","schema":{"type":"string"}}}}},"/annotations/{id}":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns one annotation. Add ` + "`" + `include=node_pools` + "`" + ` to include node pools.","consumes":["application/json"],"produces":["application/json"],"tags":["Annotations"],"summary":"Get annotation by ID (org scoped)","operationId":"GetAnnotation","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Annotation ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.AnnotationResponse"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"fetch failed","schema":{"type":"string"}}}},"delete":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Permanently deletes the annotation.","consumes":["application/json"],"produces":["application/json"],"tags":["Annotations"],"summary":"Delete annotation (org scoped)","operationId":"DeleteAnnotation","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Annotation ID (UUID)","name":"id","in":"path","required":true}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"delete failed","schema":{"type":"string"}}}},"patch":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Partially update annotation fields.","consumes":["application/json"],"produces":["application/json"],"tags":["Annotations"],"summary":"Update annotation (org scoped)","operationId":"UpdateAnnotation","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Annotation ID (UUID)","name":"id","in":"path","required":true},{"description":"Fields to update","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.UpdateAnnotationRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.AnnotationResponse"}},"400":{"description":"invalid id / invalid json","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"update failed","schema":{"type":"string"}}}}},"/auth/logout":{"post":{"consumes":["application/json"],"produces":["application/json"],"tags":["Auth"],"summary":"Revoke refresh token family (logout everywhere)","operationId":"Logout","parameters":[{"description":"Refresh token","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.LogoutRequest"}}],"responses":{"204":{"description":"No Content"}}}},"/auth/refresh":{"post":{"consumes":["application/json"],"produces":["application/json"],"tags":["Auth"],"summary":"Rotate refresh token","operationId":"Refresh","parameters":[{"description":"Refresh token","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.RefreshRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.TokenPair"}}}}},"/auth/{provider}/callback":{"get":{"produces":["application/json"],"tags":["Auth"],"summary":"Handle social login callback","operationId":"AuthCallback","parameters":[{"type":"string","description":"google|github","name":"provider","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.TokenPair"}}}}},"/auth/{provider}/start":{"post":{"description":"Returns provider authorization URL for the frontend to redirect","produces":["application/json"],"tags":["Auth"],"summary":"Begin social login","operationId":"AuthStart","parameters":[{"type":"string","description":"google|github","name":"provider","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.AuthStartResponse"}}}}},"/healthz":{"get":{"description":"Returns 200 OK when the service is up","consumes":["application/json"],"produces":["application/json"],"tags":["Health"],"summary":"Basic health check","operationId":"HealthCheck // operationId","responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/handlers.HealthStatus"}}}}},"/labels":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns node labels for the organization in X-Org-ID. Filters: ` + "`" + `key` + "`" + `, ` + "`" + `value` + "`" + `, and ` + "`" + `q` + "`" + ` (key contains). Add ` + "`" + `include=node_pools` + "`" + ` to include linked node groups.","consumes":["application/json"],"produces":["application/json"],"tags":["Labels"],"summary":"List node labels (org scoped)","operationId":"ListLabels","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Exact key","name":"key","in":"query"},{"type":"string","description":"Exact value","name":"value","in":"query"},{"type":"string","description":"Key contains (case-insensitive)","name":"q","in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/dto.LabelResponse"}}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"failed to list node taints","schema":{"type":"string"}}}},"post":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Creates a label.","consumes":["application/json"],"produces":["application/json"],"tags":["Labels"],"summary":"Create label (org scoped)","operationId":"CreateLabel","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"description":"Label payload","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.CreateLabelRequest"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/dto.LabelResponse"}},"400":{"description":"invalid json / missing fields / invalid node_pool_ids","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"create failed","schema":{"type":"string"}}}}},"/labels/{id}":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns one label.","consumes":["application/json"],"produces":["application/json"],"tags":["Labels"],"summary":"Get label by ID (org scoped)","operationId":"GetLabel","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Label ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.LabelResponse"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"fetch failed","schema":{"type":"string"}}}},"delete":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Permanently deletes the label.","consumes":["application/json"],"produces":["application/json"],"tags":["Labels"],"summary":"Delete label (org scoped)","operationId":"DeleteLabel","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Label ID (UUID)","name":"id","in":"path","required":true}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"delete failed","schema":{"type":"string"}}}},"patch":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Partially update label fields.","consumes":["application/json"],"produces":["application/json"],"tags":["Labels"],"summary":"Update label (org scoped)","operationId":"UpdateLabel","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Label ID (UUID)","name":"id","in":"path","required":true},{"description":"Fields to update","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.UpdateLabelRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.LabelResponse"}},"400":{"description":"invalid id / invalid json","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"update failed","schema":{"type":"string"}}}}},"/me":{"get":{"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"produces":["application/json"],"tags":["Me"],"summary":"Get current user profile","operationId":"GetMe","responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/handlers.meResponse"}}}},"patch":{"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["Me"],"summary":"Update current user profile","operationId":"UpdateMe","parameters":[{"description":"Patch profile","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/handlers.updateMeRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/models.User"}}}}},"/me/api-keys":{"get":{"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"produces":["application/json"],"tags":["MeAPIKeys"],"summary":"List my API keys","operationId":"ListUserAPIKeys","responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/handlers.userAPIKeyOut"}}}}},"post":{"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"description":"Returns the plaintext key once. Store it securely on the client side.","consumes":["application/json"],"produces":["application/json"],"tags":["MeAPIKeys"],"summary":"Create a new user API key","operationId":"CreateUserAPIKey","parameters":[{"description":"Key options","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/handlers.createUserKeyRequest"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/handlers.userAPIKeyOut"}}}}},"/me/api-keys/{id}":{"delete":{"security":[{"BearerAuth":[]}],"produces":["application/json"],"tags":["MeAPIKeys"],"summary":"Delete a user API key","operationId":"DeleteUserAPIKey","parameters":[{"type":"string","description":"Key ID (UUID)","name":"id","in":"path","required":true}],"responses":{"204":{"description":"No Content"}}}},"/node-pools":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns node pools for the organization in X-Org-ID.","consumes":["application/json"],"produces":["application/json"],"tags":["NodePools"],"summary":"List node pools (org scoped)","operationId":"ListNodePools","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Name contains (case-insensitive)","name":"q","in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/dto.NodePoolResponse"}}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"failed to list node pools","schema":{"type":"string"}}}},"post":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Creates a node pool. Optionally attach initial servers.","consumes":["application/json"],"produces":["application/json"],"tags":["NodePools"],"summary":"Create node pool (org scoped)","operationId":"CreateNodePool","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"description":"NodePool payload","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.CreateNodePoolRequest"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/dto.NodePoolResponse"}},"400":{"description":"invalid json / missing fields / invalid server_ids","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"create failed","schema":{"type":"string"}}}}},"/node-pools/{id}":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns one node pool. Add ` + "`" + `include=servers` + "`" + ` to include servers.","consumes":["application/json"],"produces":["application/json"],"tags":["NodePools"],"summary":"Get node pool by ID (org scoped)","operationId":"GetNodePool","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Pool ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.NodePoolResponse"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"fetch failed","schema":{"type":"string"}}}},"delete":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Permanently deletes the node pool.","consumes":["application/json"],"produces":["application/json"],"tags":["NodePools"],"summary":"Delete node pool (org scoped)","operationId":"DeleteNodePool","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Pool ID (UUID)","name":"id","in":"path","required":true}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"delete failed","schema":{"type":"string"}}}},"patch":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Partially update node pool fields.","consumes":["application/json"],"produces":["application/json"],"tags":["NodePools"],"summary":"Update node pool (org scoped)","operationId":"UpdateNodePool","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Pool ID (UUID)","name":"id","in":"path","required":true},{"description":"Fields to update","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.UpdateNodePoolRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.NodePoolResponse"}},"400":{"description":"invalid id / invalid json","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"update failed","schema":{"type":"string"}}}}},"/node-pools/{id}/annotations":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["NodePools"],"summary":"List annotations attached to a node pool (org scoped)","operationId":"ListNodePoolAnnotations","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Pool ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/dto.AnnotationResponse"}}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"fetch failed","schema":{"type":"string"}}}},"post":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["NodePools"],"summary":"Attach annotation to a node pool (org scoped)","operationId":"AttachNodePoolAnnotations","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Group ID (UUID)","name":"id","in":"path","required":true},{"description":"Annotation IDs to attach","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.AttachAnnotationsRequest"}}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id / invalid server_ids","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"attach failed","schema":{"type":"string"}}}}},"/node-pools/{id}/annotations/{annotationId}":{"delete":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["NodePools"],"summary":"Detach one annotation from a node pool (org scoped)","operationId":"DetachNodePoolAnnotation","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Pool ID (UUID)","name":"id","in":"path","required":true},{"type":"string","description":"Annotation ID (UUID)","name":"annotationId","in":"path","required":true}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"detach failed","schema":{"type":"string"}}}}},"/node-pools/{id}/labels":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["NodePools"],"summary":"List labels attached to a node pool (org scoped)","operationId":"ListNodePoolLabels","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Label Pool ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/dto.LabelResponse"}}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"fetch failed","schema":{"type":"string"}}}},"post":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["NodePools"],"summary":"Attach labels to a node pool (org scoped)","operationId":"AttachNodePoolLabels","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Pool ID (UUID)","name":"id","in":"path","required":true},{"description":"Label IDs to attach","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.AttachLabelsRequest"}}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id / invalid server_ids","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"attach failed","schema":{"type":"string"}}}}},"/node-pools/{id}/labels/{labelId}":{"delete":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["NodePools"],"summary":"Detach one label from a node pool (org scoped)","operationId":"DetachNodePoolLabel","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Pool ID (UUID)","name":"id","in":"path","required":true},{"type":"string","description":"Label ID (UUID)","name":"labelId","in":"path","required":true}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"detach failed","schema":{"type":"string"}}}}},"/node-pools/{id}/servers":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["NodePools"],"summary":"List servers attached to a node pool (org scoped)","operationId":"ListNodePoolServers","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Pool ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/dto.ServerResponse"}}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"fetch failed","schema":{"type":"string"}}}},"post":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["NodePools"],"summary":"Attach servers to a node pool (org scoped)","operationId":"AttachNodePoolServers","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Pool ID (UUID)","name":"id","in":"path","required":true},{"description":"Server IDs to attach","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.AttachServersRequest"}}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id / invalid server_ids","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"attach failed","schema":{"type":"string"}}}}},"/node-pools/{id}/servers/{serverId}":{"delete":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["NodePools"],"summary":"Detach one server from a node pool (org scoped)","operationId":"DetachNodePoolServer","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Pool ID (UUID)","name":"id","in":"path","required":true},{"type":"string","description":"Server ID (UUID)","name":"serverId","in":"path","required":true}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"detach failed","schema":{"type":"string"}}}}},"/node-pools/{id}/taints":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["NodePools"],"summary":"List taints attached to a node pool (org scoped)","operationId":"ListNodePoolTaints","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Pool ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/dto.TaintResponse"}}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"fetch failed","schema":{"type":"string"}}}},"post":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["NodePools"],"summary":"Attach taints to a node pool (org scoped)","operationId":"AttachNodePoolTaints","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Pool ID (UUID)","name":"id","in":"path","required":true},{"description":"Taint IDs to attach","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.AttachTaintsRequest"}}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id / invalid taint_ids","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"attach failed","schema":{"type":"string"}}}}},"/node-pools/{id}/taints/{taintId}":{"delete":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["NodePools"],"summary":"Detach one taint from a node pool (org scoped)","operationId":"DetachNodePoolTaint","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Pool ID (UUID)","name":"id","in":"path","required":true},{"type":"string","description":"Taint ID (UUID)","name":"taintId","in":"path","required":true}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"detach failed","schema":{"type":"string"}}}}},"/orgs":{"get":{"security":[{"BearerAuth":[]}],"produces":["application/json"],"tags":["Orgs"],"summary":"List organizations I belong to","operationId":"listMyOrgs","responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/models.Organization"}}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}},"post":{"security":[{"BearerAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["Orgs"],"summary":"Create organization","operationId":"createOrg","parameters":[{"description":"Org payload","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/handlers.orgCreateReq"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/models.Organization"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/utils.ErrorResponse"}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}},"409":{"description":"Conflict","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}}},"/orgs/{id}":{"get":{"security":[{"BearerAuth":[]}],"produces":["application/json"],"tags":["Orgs"],"summary":"Get organization","operationId":"getOrg","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/models.Organization"}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}},"delete":{"security":[{"BearerAuth":[]}],"produces":["application/json"],"tags":["Orgs"],"summary":"Delete organization (owner)","operationId":"deleteOrg","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}},"patch":{"security":[{"BearerAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["Orgs"],"summary":"Update organization (owner/admin)","operationId":"updateOrg","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true},{"description":"Update payload","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/handlers.orgUpdateReq"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/models.Organization"}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}}},"/orgs/{id}/api-keys":{"get":{"security":[{"BearerAuth":[]}],"produces":["application/json"],"tags":["Orgs"],"summary":"List org-scoped API keys (no secrets)","operationId":"listOrgKeys","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/models.APIKey"}}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}},"post":{"security":[{"BearerAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["Orgs"],"summary":"Create org key/secret pair (owner/admin)","operationId":"createOrgKey","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true},{"description":"Key name + optional expiry","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/handlers.orgKeyCreateReq"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/handlers.orgKeyCreateResp"}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}}},"/orgs/{id}/api-keys/{key_id}":{"delete":{"security":[{"BearerAuth":[]}],"produces":["application/json"],"tags":["Orgs"],"summary":"Delete org key (owner/admin)","operationId":"deleteOrgKey","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true},{"type":"string","description":"Key ID (UUID)","name":"key_id","in":"path","required":true}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}}},"/orgs/{id}/members":{"get":{"security":[{"BearerAuth":[]}],"produces":["application/json"],"tags":["Orgs"],"summary":"List members in org","operationId":"listMembers","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/handlers.memberOut"}}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}},"post":{"security":[{"BearerAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["Orgs"],"summary":"Add or update a member (owner/admin)","operationId":"addOrUpdateMember","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true},{"description":"User \u0026 role","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/handlers.memberUpsertReq"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/handlers.memberOut"}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}}},"/orgs/{id}/members/{user_id}":{"delete":{"security":[{"BearerAuth":[]}],"produces":["application/json"],"tags":["Orgs"],"summary":"Remove a member (owner/admin)","operationId":"removeMember","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true},{"type":"string","description":"User ID (UUID)","name":"user_id","in":"path","required":true}],"responses":{"204":{"description":"Removed"},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}}},"/servers":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns servers for the organization in X-Org-ID. Optional filters: status, role.","consumes":["application/json"],"produces":["application/json"],"tags":["Servers"],"summary":"List servers (org scoped)","operationId":"ListServers","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Filter by status (pending|provisioning|ready|failed)","name":"status","in":"query"},{"type":"string","description":"Filter by role","name":"role","in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/dto.ServerResponse"}}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"failed to list servers","schema":{"type":"string"}}}},"post":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Creates a server bound to the org in X-Org-ID. Validates that ssh_key_id belongs to the org.","consumes":["application/json"],"produces":["application/json"],"tags":["Servers"],"summary":"Create server (org scoped)","operationId":"CreateServer","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"description":"Server payload","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.CreateServerRequest"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/dto.ServerResponse"}},"400":{"description":"invalid json / missing fields / invalid status / invalid ssh_key_id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"create failed","schema":{"type":"string"}}}}},"/servers/{id}":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns one server in the given organization.","consumes":["application/json"],"produces":["application/json"],"tags":["Servers"],"summary":"Get server by ID (org scoped)","operationId":"GetServer","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Server ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.ServerResponse"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"fetch failed","schema":{"type":"string"}}}},"delete":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Permanently deletes the server.","consumes":["application/json"],"produces":["application/json"],"tags":["Servers"],"summary":"Delete server (org scoped)","operationId":"DeleteServer","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Server ID (UUID)","name":"id","in":"path","required":true}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"delete failed","schema":{"type":"string"}}}},"patch":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Partially update fields; changing ssh_key_id validates ownership.","consumes":["application/json"],"produces":["application/json"],"tags":["Servers"],"summary":"Update server (org scoped)","operationId":"UpdateServer","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Server ID (UUID)","name":"id","in":"path","required":true},{"description":"Fields to update","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.UpdateServerRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.ServerResponse"}},"400":{"description":"invalid id / invalid json / invalid status / invalid ssh_key_id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"update failed","schema":{"type":"string"}}}}},"/ssh":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns ssh keys for the organization in X-Org-ID.","consumes":["application/json"],"produces":["application/json"],"tags":["Ssh"],"summary":"List ssh keys (org scoped)","operationId":"ListPublicSshKeys","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/dto.SshResponse"}}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"failed to list keys","schema":{"type":"string"}}}},"post":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Generates an RSA or ED25519 keypair, saves it, and returns metadata. For RSA you may set bits (2048/3072/4096). Default is 4096. ED25519 ignores bits.","consumes":["application/json"],"produces":["application/json"],"tags":["Ssh"],"summary":"Create ssh keypair (org scoped)","operationId":"CreateSSHKey","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"description":"Key generation options","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.CreateSSHRequest"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/dto.SshResponse"}},"400":{"description":"invalid json / invalid bits","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"generation/create failed","schema":{"type":"string"}}}}},"/ssh/{id}":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns public key fields. Append ` + "`" + `?reveal=true` + "`" + ` to include the private key PEM.","consumes":["application/json"],"produces":["application/json"],"tags":["Ssh"],"summary":"Get ssh key by ID (org scoped)","operationId":"GetSSHKey","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"SSH Key ID (UUID)","name":"id","in":"path","required":true},{"type":"boolean","description":"Reveal private key PEM","name":"reveal","in":"query"}],"responses":{"200":{"description":"When reveal=true","schema":{"$ref":"#/definitions/dto.SshRevealResponse"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"fetch failed","schema":{"type":"string"}}}},"delete":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Permanently deletes a keypair.","consumes":["application/json"],"produces":["application/json"],"tags":["Ssh"],"summary":"Delete ssh keypair (org scoped)","operationId":"DeleteSSHKey","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"SSH Key ID (UUID)","name":"id","in":"path","required":true}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"delete failed","schema":{"type":"string"}}}}},"/ssh/{id}/download":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Download ` + "`" + `part=public|private|both` + "`" + ` of the keypair. ` + "`" + `both` + "`" + ` returns a zip file.","produces":["application/json"],"tags":["Ssh"],"summary":"Download ssh key files by ID (org scoped)","operationId":"DownloadSSHKey","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header","required":true},{"type":"string","description":"SSH Key ID (UUID)","name":"id","in":"path","required":true},{"enum":["public","private","both"],"type":"string","description":"Which part to download","name":"part","in":"query","required":true}],"responses":{"200":{"description":"file content","schema":{"type":"string"}},"400":{"description":"invalid id / invalid part","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"download failed","schema":{"type":"string"}}}}},"/taints":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns node taints for the organization in X-Org-ID. Filters: ` + "`" + `key` + "`" + `, ` + "`" + `value` + "`" + `, and ` + "`" + `q` + "`" + ` (key contains). Add ` + "`" + `include=node_pools` + "`" + ` to include linked node pools.","consumes":["application/json"],"produces":["application/json"],"tags":["Taints"],"summary":"List node pool taints (org scoped)","operationId":"ListTaints","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Exact key","name":"key","in":"query"},{"type":"string","description":"Exact value","name":"value","in":"query"},{"type":"string","description":"key contains (case-insensitive)","name":"q","in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/dto.TaintResponse"}}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"failed to list node taints","schema":{"type":"string"}}}},"post":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Creates a taint.","consumes":["application/json"],"produces":["application/json"],"tags":["Taints"],"summary":"Create node taint (org scoped)","operationId":"CreateTaint","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"description":"Taint payload","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.CreateTaintRequest"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/dto.TaintResponse"}},"400":{"description":"invalid json / missing fields / invalid node_pool_ids","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"create failed","schema":{"type":"string"}}}}},"/taints/{id}":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["Taints"],"summary":"Get node taint by ID (org scoped)","operationId":"GetTaint","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Taint ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.TaintResponse"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"fetch failed","schema":{"type":"string"}}}},"delete":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Permanently deletes the taint.","consumes":["application/json"],"produces":["application/json"],"tags":["Taints"],"summary":"Delete taint (org scoped)","operationId":"DeleteTaint","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Taint ID (UUID)","name":"id","in":"path","required":true}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"delete failed","schema":{"type":"string"}}}},"patch":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Partially update taint fields.","consumes":["application/json"],"produces":["application/json"],"tags":["Taints"],"summary":"Update node taint (org scoped)","operationId":"UpdateTaint","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Taint ID (UUID)","name":"id","in":"path","required":true},{"description":"Fields to update","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.UpdateTaintRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.TaintResponse"}},"400":{"description":"invalid id / invalid json","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"update failed","schema":{"type":"string"}}}}}},"definitions":{"dto.AnnotationResponse":{"type":"object","properties":{"created_at":{"type":"string"},"id":{"type":"string"},"key":{"type":"string"},"organization_id":{"type":"string"},"updated_at":{"type":"string"},"value":{"type":"string"}}},"dto.AttachAnnotationsRequest":{"type":"object","properties":{"annotation_ids":{"type":"array","items":{"type":"string"}}}},"dto.AttachLabelsRequest":{"type":"object","properties":{"label_ids":{"type":"array","items":{"type":"string"}}}},"dto.AttachServersRequest":{"type":"object","properties":{"server_ids":{"type":"array","items":{"type":"string"}}}},"dto.AttachTaintsRequest":{"type":"object","properties":{"taint_ids":{"type":"array","items":{"type":"string"}}}},"dto.AuthStartResponse":{"type":"object","properties":{"auth_url":{"type":"string","example":"https://accounts.google.com/o/oauth2/v2/auth?client_id=..."}}},"dto.CreateAnnotationRequest":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}},"dto.CreateLabelRequest":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}},"dto.CreateNodePoolRequest":{"type":"object","properties":{"name":{"type":"string"},"role":{"type":"string","enum":["master","worker"]}}},"dto.CreateSSHRequest":{"type":"object","properties":{"bits":{"description":"Only for RSA","type":"integer"},"comment":{"type":"string","example":"deploy@autoglue"},"name":{"type":"string"},"type":{"description":"\"rsa\" (default) or \"ed25519\"","type":"string"}}},"dto.CreateServerRequest":{"type":"object","properties":{"hostname":{"type":"string"},"private_ip_address":{"type":"string"},"public_ip_address":{"type":"string"},"role":{"type":"string","enum":["master","worker","bastion"],"example":"master|worker|bastion"},"ssh_key_id":{"type":"string"},"ssh_user":{"type":"string"},"status":{"type":"string","enum":["pending","provisioning","ready","failed"],"example":"pending|provisioning|ready|failed"}}},"dto.CreateTaintRequest":{"type":"object","properties":{"effect":{"type":"string"},"key":{"type":"string"},"value":{"type":"string"}}},"dto.EnqueueRequest":{"type":"object"},"dto.JWK":{"type":"object","properties":{"alg":{"type":"string","example":"RS256"},"e":{"type":"string","example":"AQAB"},"kid":{"type":"string","example":"7c6f1d0a-7a98-4e6a-9dbf-6b1af4b9f345"},"kty":{"type":"string","example":"RSA"},"n":{"type":"string"},"use":{"type":"string","example":"sig"},"x":{"type":"string"}}},"dto.JWKS":{"type":"object","properties":{"keys":{"type":"array","items":{"$ref":"#/definitions/dto.JWK"}}}},"dto.Job":{"type":"object","properties":{"attempts":{"type":"integer","example":0},"created_at":{"type":"string","example":"2025-11-04T09:30:00Z"},"id":{"type":"string","example":"01HF7SZK8Z8WG1M3J7S2Z8M2N6"},"last_error":{"type":"string","example":"error message"},"max_attempts":{"type":"integer","example":3},"payload":{},"queue":{"type":"string","example":"default"},"run_at":{"type":"string","example":"2025-11-04T09:30:00Z"},"status":{"enum":["queued|running|succeeded|failed|canceled|retrying|scheduled"],"allOf":[{"$ref":"#/definitions/dto.JobStatus"}],"example":"queued"},"type":{"type":"string","example":"email.send"},"updated_at":{"type":"string","example":"2025-11-04T09:30:00Z"}}},"dto.JobStatus":{"type":"string","enum":["queued","running","succeeded","failed","canceled","retrying","scheduled"],"x-enum-varnames":["StatusQueued","StatusRunning","StatusSucceeded","StatusFailed","StatusCanceled","StatusRetrying","StatusScheduled"]},"dto.LabelResponse":{"type":"object","properties":{"created_at":{"type":"string"},"id":{"type":"string"},"key":{"type":"string"},"organization_id":{"type":"string"},"updated_at":{"type":"string"},"value":{"type":"string"}}},"dto.LogoutRequest":{"type":"object","properties":{"refresh_token":{"type":"string","example":"m0l9o8rT3t0V8d3eFf..."}}},"dto.NodePoolResponse":{"type":"object","properties":{"annotations":{"type":"array","items":{"$ref":"#/definitions/dto.AnnotationResponse"}},"created_at":{"type":"string"},"id":{"type":"string"},"labels":{"type":"array","items":{"$ref":"#/definitions/dto.LabelResponse"}},"name":{"type":"string"},"organization_id":{"type":"string"},"role":{"type":"string","enum":["master","worker"]},"servers":{"type":"array","items":{"$ref":"#/definitions/dto.ServerResponse"}},"taints":{"type":"array","items":{"$ref":"#/definitions/dto.TaintResponse"}},"updated_at":{"type":"string"}}},"dto.PageJob":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/definitions/dto.Job"}},"page":{"type":"integer","example":1},"page_size":{"type":"integer","example":25},"total":{"type":"integer","example":120}}},"dto.QueueInfo":{"type":"object","properties":{"failed":{"type":"integer","example":5},"name":{"type":"string","example":"default"},"pending":{"type":"integer","example":42},"running":{"type":"integer","example":3},"scheduled":{"type":"integer","example":7}}},"dto.RefreshRequest":{"type":"object","properties":{"refresh_token":{"type":"string","example":"m0l9o8rT3t0V8d3eFf..."}}},"dto.ServerResponse":{"type":"object","properties":{"created_at":{"type":"string"},"hostname":{"type":"string"},"id":{"type":"string"},"organization_id":{"type":"string"},"private_ip_address":{"type":"string"},"public_ip_address":{"type":"string"},"role":{"type":"string","enum":["master","worker","bastion"],"example":"master|worker|bastion"},"ssh_key_id":{"type":"string"},"ssh_user":{"type":"string"},"status":{"type":"string","enum":["pending","provisioning","ready","failed"],"example":"pending|provisioning|ready|failed"},"updated_at":{"type":"string"}}},"dto.SshResponse":{"type":"object","properties":{"created_at":{"type":"string"},"fingerprint":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"organization_id":{"type":"string"},"public_key":{"type":"string"},"updated_at":{"type":"string"}}},"dto.SshRevealResponse":{"type":"object","properties":{"created_at":{"type":"string"},"fingerprint":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"organization_id":{"type":"string"},"private_key":{"type":"string"},"public_key":{"type":"string"},"updated_at":{"type":"string"}}},"dto.TaintResponse":{"type":"object","properties":{"created_at":{"type":"string"},"effect":{"type":"string"},"id":{"type":"string"},"key":{"type":"string"},"organization_id":{"type":"string"},"updated_at":{"type":"string"},"value":{"type":"string"}}},"dto.TokenPair":{"type":"object","properties":{"access_token":{"type":"string","example":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ij..."},"expires_in":{"type":"integer","example":3600},"refresh_token":{"type":"string","example":"m0l9o8rT3t0V8d3eFf...."},"token_type":{"type":"string","example":"Bearer"}}},"dto.UpdateAnnotationRequest":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}},"dto.UpdateLabelRequest":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}},"dto.UpdateNodePoolRequest":{"type":"object","properties":{"name":{"type":"string"},"role":{"type":"string","enum":["master","worker"]}}},"dto.UpdateServerRequest":{"type":"object","properties":{"hostname":{"type":"string"},"private_ip_address":{"type":"string"},"public_ip_address":{"type":"string"},"role":{"type":"string","enum":["master","worker","bastion"],"example":"master|worker|bastion"},"ssh_key_id":{"type":"string"},"ssh_user":{"type":"string"},"status":{"type":"string","enum":["pending","provisioning","ready","failed"],"example":"pending|provisioning|ready|failed"}}},"dto.UpdateTaintRequest":{"type":"object","properties":{"effect":{"type":"string"},"key":{"type":"string"},"value":{"type":"string"}}},"handlers.HealthStatus":{"type":"object","properties":{"status":{"type":"string","example":"ok"}}},"handlers.createUserKeyRequest":{"type":"object","properties":{"expires_in_hours":{"description":"optional TTL","type":"integer"},"name":{"type":"string"}}},"handlers.meResponse":{"type":"object","properties":{"avatar_url":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"display_name":{"type":"string"},"emails":{"type":"array","items":{"$ref":"#/definitions/models.UserEmail"}},"id":{"description":"example: 3fa85f64-5717-4562-b3fc-2c963f66afa6","type":"string","format":"uuid"},"is_admin":{"type":"boolean"},"is_disabled":{"type":"boolean"},"organizations":{"type":"array","items":{"$ref":"#/definitions/models.Organization"}},"primary_email":{"type":"string"},"updated_at":{"type":"string","format":"date-time"}}},"handlers.memberOut":{"type":"object","properties":{"email":{"type":"string"},"role":{"description":"owner/admin/member","type":"string"},"user_id":{"type":"string","format":"uuid"}}},"handlers.memberUpsertReq":{"type":"object","properties":{"role":{"type":"string","example":"member"},"user_id":{"type":"string","format":"uuid"}}},"handlers.orgCreateReq":{"type":"object","properties":{"domain":{"type":"string","example":"acme.com"},"name":{"type":"string","example":"Acme Corp"}}},"handlers.orgKeyCreateReq":{"type":"object","properties":{"expires_in_hours":{"type":"integer","example":720},"name":{"type":"string","example":"automation-bot"}}},"handlers.orgKeyCreateResp":{"type":"object","properties":{"created_at":{"type":"string"},"expires_at":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"org_key":{"description":"shown once:","type":"string"},"org_secret":{"description":"shown once:","type":"string"},"scope":{"description":"\"org\"","type":"string"}}},"handlers.orgUpdateReq":{"type":"object","properties":{"domain":{"type":"string"},"name":{"type":"string"}}},"handlers.updateMeRequest":{"type":"object","properties":{"display_name":{"type":"string"}}},"handlers.userAPIKeyOut":{"type":"object","properties":{"created_at":{"type":"string"},"expires_at":{"type":"string"},"id":{"type":"string","format":"uuid"},"last_used_at":{"type":"string"},"name":{"type":"string"},"plain":{"description":"Shown only on create:","type":"string"},"scope":{"description":"\"user\"","type":"string"}}},"models.APIKey":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid"},"last_used_at":{"type":"string","format":"date-time"},"name":{"type":"string"},"org_id":{"type":"string","format":"uuid"},"prefix":{"type":"string"},"revoked":{"type":"boolean"},"scope":{"type":"string"},"updated_at":{"type":"string","format":"date-time"},"user_id":{"type":"string","format":"uuid"}}},"models.Organization":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time"},"domain":{"type":"string"},"id":{"description":"example: 3fa85f64-5717-4562-b3fc-2c963f66afa6","type":"string","format":"uuid"},"name":{"type":"string"},"updated_at":{"type":"string","format":"date-time"}}},"models.User":{"type":"object","properties":{"avatar_url":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"display_name":{"type":"string"},"id":{"description":"example: 3fa85f64-5717-4562-b3fc-2c963f66afa6","type":"string","format":"uuid"},"is_admin":{"type":"boolean"},"is_disabled":{"type":"boolean"},"primary_email":{"type":"string"},"updated_at":{"type":"string","format":"date-time"}}},"models.UserEmail":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time"},"email":{"type":"string"},"id":{"description":"example: 3fa85f64-5717-4562-b3fc-2c963f66afa6","type":"string","format":"uuid"},"is_primary":{"type":"boolean"},"is_verified":{"type":"boolean"},"updated_at":{"type":"string","format":"date-time"},"user":{"$ref":"#/definitions/models.User"},"user_id":{"type":"string","format":"uuid"}}},"utils.ErrorResponse":{"type":"object","properties":{"code":{"description":"A machine-readable error code, e.g. \"validation_error\"\nexample: validation_error","type":"string"},"message":{"description":"Human-readable message\nexample: slug is required","type":"string"}}}},"securityDefinitions":{"ApiKeyAuth":{"description":"User API key","type":"apiKey","name":"X-API-KEY","in":"header"},"BearerAuth":{"description":"Bearer token authentication","type":"apiKey","name":"Authorization","in":"header"},"OrgKeyAuth":{"description":"Org-level key/secret authentication","type":"apiKey","name":"X-ORG-KEY","in":"header"},"OrgSecretAuth":{"description":"Org-level secret","type":"apiKey","name":"X-ORG-SECRET","in":"header"}}}` // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = &swag.Spec{ diff --git a/docs/swagger.json b/docs/swagger.json index fc1968f..e6ff6fd 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -1 +1 @@ -{"schemes":["http","https"],"swagger":"2.0","info":{"description":"API for managing K3s clusters across cloud providers","title":"AutoGlue API","contact":{"name":"GlueOps"},"version":"1.0"},"basePath":"/api/v1","paths":{"/.well-known/jwks.json":{"get":{"description":"Returns the JSON Web Key Set for token verification","produces":["application/json"],"tags":["Auth"],"summary":"Get JWKS","operationId":"getJWKS","responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.JWKS"}}}}},"/admin/archer/jobs":{"get":{"security":[{"BearerAuth":[]}],"description":"Paginated background jobs with optional filters. Search `q` may match id, type, error, payload (implementation-dependent).","consumes":["application/json"],"produces":["application/json"],"tags":["ArcherAdmin"],"summary":"List Archer jobs (admin)","operationId":"AdminListArcherJobs","parameters":[{"enum":["queued","running","succeeded","failed","canceled","retrying","scheduled"],"type":"string","description":"Filter by status","name":"status","in":"query"},{"type":"string","description":"Filter by queue name / worker name","name":"queue","in":"query"},{"type":"string","description":"Free-text search","name":"q","in":"query"},{"type":"integer","default":1,"description":"Page number","name":"page","in":"query"},{"maximum":100,"minimum":1,"type":"integer","default":25,"description":"Items per page","name":"page_size","in":"query"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.PageJob"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"forbidden","schema":{"type":"string"}},"500":{"description":"internal error","schema":{"type":"string"}}}},"post":{"security":[{"BearerAuth":[]}],"description":"Create a job immediately or schedule it for the future via `run_at`.","consumes":["application/json"],"produces":["application/json"],"tags":["ArcherAdmin"],"summary":"Enqueue a new Archer job (admin)","operationId":"AdminEnqueueArcherJob","parameters":[{"description":"Job parameters","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.EnqueueRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.Job"}},"400":{"description":"invalid json or missing fields","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"forbidden","schema":{"type":"string"}},"500":{"description":"internal error","schema":{"type":"string"}}}}},"/admin/archer/jobs/{id}/cancel":{"post":{"security":[{"BearerAuth":[]}],"description":"Set job status to canceled if cancellable. For running jobs, this only affects future picks; wire to Archer if you need active kill.","consumes":["application/json"],"produces":["application/json"],"tags":["ArcherAdmin"],"summary":"Cancel an Archer job (admin)","operationId":"AdminCancelArcherJob","parameters":[{"type":"string","description":"Job ID","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.Job"}},"400":{"description":"invalid job or not cancellable","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"forbidden","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}}}}},"/admin/archer/jobs/{id}/retry":{"post":{"security":[{"BearerAuth":[]}],"description":"Marks the job retriable (DB flip). Swap this for an Archer admin call if you expose one.","consumes":["application/json"],"produces":["application/json"],"tags":["ArcherAdmin"],"summary":"Retry a failed/canceled Archer job (admin)","operationId":"AdminRetryArcherJob","parameters":[{"type":"string","description":"Job ID","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.Job"}},"400":{"description":"invalid job or not eligible","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"forbidden","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}}}}},"/admin/archer/queues":{"get":{"security":[{"BearerAuth":[]}],"description":"Summary metrics per queue (pending, running, failed, scheduled).","consumes":["application/json"],"produces":["application/json"],"tags":["ArcherAdmin"],"summary":"List Archer queues (admin)","operationId":"AdminListArcherQueues","responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/dto.QueueInfo"}}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"forbidden","schema":{"type":"string"}},"500":{"description":"internal error","schema":{"type":"string"}}}}},"/annotations":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns annotations for the organization in X-Org-ID. Filters: `key`, `value`, and `q` (key contains). Add `include=node_pools` to include linked node pools.","consumes":["application/json"],"produces":["application/json"],"tags":["Annotations"],"summary":"List annotations (org scoped)","operationId":"ListAnnotations","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Exact key","name":"key","in":"query"},{"type":"string","description":"Exact value","name":"value","in":"query"},{"type":"string","description":"key contains (case-insensitive)","name":"q","in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/dto.AnnotationResponse"}}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"failed to list annotations","schema":{"type":"string"}}}},"post":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Creates an annotation.","consumes":["application/json"],"produces":["application/json"],"tags":["Annotations"],"summary":"Create annotation (org scoped)","operationId":"CreateAnnotation","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"description":"Annotation payload","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.CreateAnnotationRequest"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/dto.AnnotationResponse"}},"400":{"description":"invalid json / missing fields","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"create failed","schema":{"type":"string"}}}}},"/annotations/{id}":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns one annotation. Add `include=node_pools` to include node pools.","consumes":["application/json"],"produces":["application/json"],"tags":["Annotations"],"summary":"Get annotation by ID (org scoped)","operationId":"GetAnnotation","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Annotation ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.AnnotationResponse"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"fetch failed","schema":{"type":"string"}}}},"delete":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Permanently deletes the annotation.","consumes":["application/json"],"produces":["application/json"],"tags":["Annotations"],"summary":"Delete annotation (org scoped)","operationId":"DeleteAnnotation","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Annotation ID (UUID)","name":"id","in":"path","required":true}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"delete failed","schema":{"type":"string"}}}},"patch":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Partially update annotation fields.","consumes":["application/json"],"produces":["application/json"],"tags":["Annotations"],"summary":"Update annotation (org scoped)","operationId":"UpdateAnnotation","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Annotation ID (UUID)","name":"id","in":"path","required":true},{"description":"Fields to update","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.UpdateAnnotationRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.AnnotationResponse"}},"400":{"description":"invalid id / invalid json","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"update failed","schema":{"type":"string"}}}}},"/auth/logout":{"post":{"consumes":["application/json"],"produces":["application/json"],"tags":["Auth"],"summary":"Revoke refresh token family (logout everywhere)","operationId":"Logout","parameters":[{"description":"Refresh token","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.LogoutRequest"}}],"responses":{"204":{"description":"No Content"}}}},"/auth/refresh":{"post":{"consumes":["application/json"],"produces":["application/json"],"tags":["Auth"],"summary":"Rotate refresh token","operationId":"Refresh","parameters":[{"description":"Refresh token","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.RefreshRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.TokenPair"}}}}},"/auth/{provider}/callback":{"get":{"produces":["application/json"],"tags":["Auth"],"summary":"Handle social login callback","operationId":"AuthCallback","parameters":[{"type":"string","description":"google|github","name":"provider","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.TokenPair"}}}}},"/auth/{provider}/start":{"post":{"description":"Returns provider authorization URL for the frontend to redirect","produces":["application/json"],"tags":["Auth"],"summary":"Begin social login","operationId":"AuthStart","parameters":[{"type":"string","description":"google|github","name":"provider","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.AuthStartResponse"}}}}},"/healthz":{"get":{"description":"Returns 200 OK when the service is up","consumes":["application/json"],"produces":["application/json"],"tags":["Health"],"summary":"Basic health check","operationId":"HealthCheck // operationId","responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/handlers.HealthStatus"}}}}},"/labels":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns node labels for the organization in X-Org-ID. Filters: `key`, `value`, and `q` (key contains). Add `include=node_pools` to include linked node groups.","consumes":["application/json"],"produces":["application/json"],"tags":["Labels"],"summary":"List node labels (org scoped)","operationId":"ListLabels","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Exact key","name":"key","in":"query"},{"type":"string","description":"Exact value","name":"value","in":"query"},{"type":"string","description":"Key contains (case-insensitive)","name":"q","in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/dto.LabelResponse"}}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"failed to list node taints","schema":{"type":"string"}}}},"post":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Creates a label.","consumes":["application/json"],"produces":["application/json"],"tags":["Labels"],"summary":"Create label (org scoped)","operationId":"CreateLabel","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"description":"Label payload","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.CreateLabelRequest"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/dto.LabelResponse"}},"400":{"description":"invalid json / missing fields / invalid node_pool_ids","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"create failed","schema":{"type":"string"}}}}},"/labels/{id}":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns one label.","consumes":["application/json"],"produces":["application/json"],"tags":["Labels"],"summary":"Get label by ID (org scoped)","operationId":"GetLabel","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Label ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.LabelResponse"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"fetch failed","schema":{"type":"string"}}}},"delete":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Permanently deletes the label.","consumes":["application/json"],"produces":["application/json"],"tags":["Labels"],"summary":"Delete label (org scoped)","operationId":"DeleteLabel","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Label ID (UUID)","name":"id","in":"path","required":true}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"delete failed","schema":{"type":"string"}}}},"patch":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Partially update label fields.","consumes":["application/json"],"produces":["application/json"],"tags":["Labels"],"summary":"Update label (org scoped)","operationId":"UpdateLabel","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Label ID (UUID)","name":"id","in":"path","required":true},{"description":"Fields to update","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.UpdateLabelRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.LabelResponse"}},"400":{"description":"invalid id / invalid json","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"update failed","schema":{"type":"string"}}}}},"/me":{"get":{"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"produces":["application/json"],"tags":["Me"],"summary":"Get current user profile","operationId":"GetMe","responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/handlers.meResponse"}}}},"patch":{"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["Me"],"summary":"Update current user profile","operationId":"UpdateMe","parameters":[{"description":"Patch profile","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/handlers.updateMeRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/models.User"}}}}},"/me/api-keys":{"get":{"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"produces":["application/json"],"tags":["MeAPIKeys"],"summary":"List my API keys","operationId":"ListUserAPIKeys","responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/handlers.userAPIKeyOut"}}}}},"post":{"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"description":"Returns the plaintext key once. Store it securely on the client side.","consumes":["application/json"],"produces":["application/json"],"tags":["MeAPIKeys"],"summary":"Create a new user API key","operationId":"CreateUserAPIKey","parameters":[{"description":"Key options","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/handlers.createUserKeyRequest"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/handlers.userAPIKeyOut"}}}}},"/me/api-keys/{id}":{"delete":{"security":[{"BearerAuth":[]}],"produces":["application/json"],"tags":["MeAPIKeys"],"summary":"Delete a user API key","operationId":"DeleteUserAPIKey","parameters":[{"type":"string","description":"Key ID (UUID)","name":"id","in":"path","required":true}],"responses":{"204":{"description":"No Content"}}}},"/orgs":{"get":{"security":[{"BearerAuth":[]}],"produces":["application/json"],"tags":["Orgs"],"summary":"List organizations I belong to","operationId":"listMyOrgs","responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/models.Organization"}}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}},"post":{"security":[{"BearerAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["Orgs"],"summary":"Create organization","operationId":"createOrg","parameters":[{"description":"Org payload","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/handlers.orgCreateReq"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/models.Organization"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/utils.ErrorResponse"}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}},"409":{"description":"Conflict","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}}},"/orgs/{id}":{"get":{"security":[{"BearerAuth":[]}],"produces":["application/json"],"tags":["Orgs"],"summary":"Get organization","operationId":"getOrg","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/models.Organization"}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}},"delete":{"security":[{"BearerAuth":[]}],"produces":["application/json"],"tags":["Orgs"],"summary":"Delete organization (owner)","operationId":"deleteOrg","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}},"patch":{"security":[{"BearerAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["Orgs"],"summary":"Update organization (owner/admin)","operationId":"updateOrg","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true},{"description":"Update payload","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/handlers.orgUpdateReq"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/models.Organization"}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}}},"/orgs/{id}/api-keys":{"get":{"security":[{"BearerAuth":[]}],"produces":["application/json"],"tags":["Orgs"],"summary":"List org-scoped API keys (no secrets)","operationId":"listOrgKeys","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/models.APIKey"}}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}},"post":{"security":[{"BearerAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["Orgs"],"summary":"Create org key/secret pair (owner/admin)","operationId":"createOrgKey","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true},{"description":"Key name + optional expiry","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/handlers.orgKeyCreateReq"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/handlers.orgKeyCreateResp"}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}}},"/orgs/{id}/api-keys/{key_id}":{"delete":{"security":[{"BearerAuth":[]}],"produces":["application/json"],"tags":["Orgs"],"summary":"Delete org key (owner/admin)","operationId":"deleteOrgKey","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true},{"type":"string","description":"Key ID (UUID)","name":"key_id","in":"path","required":true}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}}},"/orgs/{id}/members":{"get":{"security":[{"BearerAuth":[]}],"produces":["application/json"],"tags":["Orgs"],"summary":"List members in org","operationId":"listMembers","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/handlers.memberOut"}}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}},"post":{"security":[{"BearerAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["Orgs"],"summary":"Add or update a member (owner/admin)","operationId":"addOrUpdateMember","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true},{"description":"User \u0026 role","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/handlers.memberUpsertReq"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/handlers.memberOut"}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}}},"/orgs/{id}/members/{user_id}":{"delete":{"security":[{"BearerAuth":[]}],"produces":["application/json"],"tags":["Orgs"],"summary":"Remove a member (owner/admin)","operationId":"removeMember","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true},{"type":"string","description":"User ID (UUID)","name":"user_id","in":"path","required":true}],"responses":{"204":{"description":"Removed"},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}}},"/servers":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns servers for the organization in X-Org-ID. Optional filters: status, role.","consumes":["application/json"],"produces":["application/json"],"tags":["Servers"],"summary":"List servers (org scoped)","operationId":"ListServers","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Filter by status (pending|provisioning|ready|failed)","name":"status","in":"query"},{"type":"string","description":"Filter by role","name":"role","in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/dto.ServerResponse"}}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"failed to list servers","schema":{"type":"string"}}}},"post":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Creates a server bound to the org in X-Org-ID. Validates that ssh_key_id belongs to the org.","consumes":["application/json"],"produces":["application/json"],"tags":["Servers"],"summary":"Create server (org scoped)","operationId":"CreateServer","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"description":"Server payload","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.CreateServerRequest"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/dto.ServerResponse"}},"400":{"description":"invalid json / missing fields / invalid status / invalid ssh_key_id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"create failed","schema":{"type":"string"}}}}},"/servers/{id}":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns one server in the given organization.","consumes":["application/json"],"produces":["application/json"],"tags":["Servers"],"summary":"Get server by ID (org scoped)","operationId":"GetServer","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Server ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.ServerResponse"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"fetch failed","schema":{"type":"string"}}}},"delete":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Permanently deletes the server.","consumes":["application/json"],"produces":["application/json"],"tags":["Servers"],"summary":"Delete server (org scoped)","operationId":"DeleteServer","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Server ID (UUID)","name":"id","in":"path","required":true}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"delete failed","schema":{"type":"string"}}}},"patch":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Partially update fields; changing ssh_key_id validates ownership.","consumes":["application/json"],"produces":["application/json"],"tags":["Servers"],"summary":"Update server (org scoped)","operationId":"UpdateServer","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Server ID (UUID)","name":"id","in":"path","required":true},{"description":"Fields to update","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.UpdateServerRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.ServerResponse"}},"400":{"description":"invalid id / invalid json / invalid status / invalid ssh_key_id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"update failed","schema":{"type":"string"}}}}},"/ssh":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns ssh keys for the organization in X-Org-ID.","consumes":["application/json"],"produces":["application/json"],"tags":["Ssh"],"summary":"List ssh keys (org scoped)","operationId":"ListPublicSshKeys","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/dto.SshResponse"}}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"failed to list keys","schema":{"type":"string"}}}},"post":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Generates an RSA or ED25519 keypair, saves it, and returns metadata. For RSA you may set bits (2048/3072/4096). Default is 4096. ED25519 ignores bits.","consumes":["application/json"],"produces":["application/json"],"tags":["Ssh"],"summary":"Create ssh keypair (org scoped)","operationId":"CreateSSHKey","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"description":"Key generation options","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.CreateSSHRequest"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/dto.SshResponse"}},"400":{"description":"invalid json / invalid bits","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"generation/create failed","schema":{"type":"string"}}}}},"/ssh/{id}":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns public key fields. Append `?reveal=true` to include the private key PEM.","consumes":["application/json"],"produces":["application/json"],"tags":["Ssh"],"summary":"Get ssh key by ID (org scoped)","operationId":"GetSSHKey","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"SSH Key ID (UUID)","name":"id","in":"path","required":true},{"type":"boolean","description":"Reveal private key PEM","name":"reveal","in":"query"}],"responses":{"200":{"description":"When reveal=true","schema":{"$ref":"#/definitions/dto.SshRevealResponse"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"fetch failed","schema":{"type":"string"}}}},"delete":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Permanently deletes a keypair.","consumes":["application/json"],"produces":["application/json"],"tags":["Ssh"],"summary":"Delete ssh keypair (org scoped)","operationId":"DeleteSSHKey","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"SSH Key ID (UUID)","name":"id","in":"path","required":true}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"delete failed","schema":{"type":"string"}}}}},"/ssh/{id}/download":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Download `part=public|private|both` of the keypair. `both` returns a zip file.","produces":["application/json"],"tags":["Ssh"],"summary":"Download ssh key files by ID (org scoped)","operationId":"DownloadSSHKey","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header","required":true},{"type":"string","description":"SSH Key ID (UUID)","name":"id","in":"path","required":true},{"enum":["public","private","both"],"type":"string","description":"Which part to download","name":"part","in":"query","required":true}],"responses":{"200":{"description":"file content","schema":{"type":"string"}},"400":{"description":"invalid id / invalid part","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"download failed","schema":{"type":"string"}}}}},"/taints":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns node taints for the organization in X-Org-ID. Filters: `key`, `value`, and `q` (key contains). Add `include=node_pools` to include linked node pools.","consumes":["application/json"],"produces":["application/json"],"tags":["Taints"],"summary":"List node pool taints (org scoped)","operationId":"ListTaints","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Exact key","name":"key","in":"query"},{"type":"string","description":"Exact value","name":"value","in":"query"},{"type":"string","description":"key contains (case-insensitive)","name":"q","in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/dto.TaintResponse"}}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"failed to list node taints","schema":{"type":"string"}}}},"post":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Creates a taint.","consumes":["application/json"],"produces":["application/json"],"tags":["Taints"],"summary":"Create node taint (org scoped)","operationId":"CreateTaint","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"description":"Taint payload","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.CreateTaintRequest"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/dto.TaintResponse"}},"400":{"description":"invalid json / missing fields / invalid node_pool_ids","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"create failed","schema":{"type":"string"}}}}},"/taints/{id}":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["Taints"],"summary":"Get node taint by ID (org scoped)","operationId":"GetTaint","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Taint ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.TaintResponse"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"fetch failed","schema":{"type":"string"}}}},"delete":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Permanently deletes the taint.","consumes":["application/json"],"produces":["application/json"],"tags":["Taints"],"summary":"Delete taint (org scoped)","operationId":"DeleteTaint","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Taint ID (UUID)","name":"id","in":"path","required":true}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"delete failed","schema":{"type":"string"}}}},"patch":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Partially update taint fields.","consumes":["application/json"],"produces":["application/json"],"tags":["Taints"],"summary":"Update node taint (org scoped)","operationId":"UpdateTaint","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Taint ID (UUID)","name":"id","in":"path","required":true},{"description":"Fields to update","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.UpdateTaintRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.TaintResponse"}},"400":{"description":"invalid id / invalid json","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"update failed","schema":{"type":"string"}}}}}},"definitions":{"dto.AnnotationResponse":{"type":"object","properties":{"created_at":{"type":"string"},"id":{"type":"string"},"key":{"type":"string"},"organization_id":{"type":"string"},"updated_at":{"type":"string"},"value":{"type":"string"}}},"dto.AuthStartResponse":{"type":"object","properties":{"auth_url":{"type":"string","example":"https://accounts.google.com/o/oauth2/v2/auth?client_id=..."}}},"dto.CreateAnnotationRequest":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}},"dto.CreateLabelRequest":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}},"dto.CreateSSHRequest":{"type":"object","properties":{"bits":{"description":"Only for RSA","type":"integer"},"comment":{"type":"string","example":"deploy@autoglue"},"name":{"type":"string"},"type":{"description":"\"rsa\" (default) or \"ed25519\"","type":"string"}}},"dto.CreateServerRequest":{"type":"object","properties":{"hostname":{"type":"string"},"private_ip_address":{"type":"string"},"public_ip_address":{"type":"string"},"role":{"type":"string","example":"master|worker|bastion"},"ssh_key_id":{"type":"string"},"ssh_user":{"type":"string"},"status":{"type":"string","example":"pending|provisioning|ready|failed"}}},"dto.CreateTaintRequest":{"type":"object","properties":{"effect":{"type":"string"},"key":{"type":"string"},"value":{"type":"string"}}},"dto.EnqueueRequest":{"type":"object"},"dto.JWK":{"type":"object","properties":{"alg":{"type":"string","example":"RS256"},"e":{"type":"string","example":"AQAB"},"kid":{"type":"string","example":"7c6f1d0a-7a98-4e6a-9dbf-6b1af4b9f345"},"kty":{"type":"string","example":"RSA"},"n":{"type":"string"},"use":{"type":"string","example":"sig"},"x":{"type":"string"}}},"dto.JWKS":{"type":"object","properties":{"keys":{"type":"array","items":{"$ref":"#/definitions/dto.JWK"}}}},"dto.Job":{"type":"object","properties":{"attempts":{"type":"integer","example":0},"created_at":{"type":"string","example":"2025-11-04T09:30:00Z"},"id":{"type":"string","example":"01HF7SZK8Z8WG1M3J7S2Z8M2N6"},"last_error":{"type":"string","example":"error message"},"max_attempts":{"type":"integer","example":3},"payload":{},"queue":{"type":"string","example":"default"},"run_at":{"type":"string","example":"2025-11-04T09:30:00Z"},"status":{"enum":["queued|running|succeeded|failed|canceled|retrying|scheduled"],"allOf":[{"$ref":"#/definitions/dto.JobStatus"}],"example":"queued"},"type":{"type":"string","example":"email.send"},"updated_at":{"type":"string","example":"2025-11-04T09:30:00Z"}}},"dto.JobStatus":{"type":"string","enum":["queued","running","succeeded","failed","canceled","retrying","scheduled"],"x-enum-varnames":["StatusQueued","StatusRunning","StatusSucceeded","StatusFailed","StatusCanceled","StatusRetrying","StatusScheduled"]},"dto.LabelResponse":{"type":"object","properties":{"created_at":{"type":"string"},"id":{"type":"string"},"key":{"type":"string"},"organization_id":{"type":"string"},"updated_at":{"type":"string"},"value":{"type":"string"}}},"dto.LogoutRequest":{"type":"object","properties":{"refresh_token":{"type":"string","example":"m0l9o8rT3t0V8d3eFf..."}}},"dto.PageJob":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/definitions/dto.Job"}},"page":{"type":"integer","example":1},"page_size":{"type":"integer","example":25},"total":{"type":"integer","example":120}}},"dto.QueueInfo":{"type":"object","properties":{"failed":{"type":"integer","example":5},"name":{"type":"string","example":"default"},"pending":{"type":"integer","example":42},"running":{"type":"integer","example":3},"scheduled":{"type":"integer","example":7}}},"dto.RefreshRequest":{"type":"object","properties":{"refresh_token":{"type":"string","example":"m0l9o8rT3t0V8d3eFf..."}}},"dto.ServerResponse":{"type":"object","properties":{"created_at":{"type":"string"},"hostname":{"type":"string"},"id":{"type":"string"},"organization_id":{"type":"string"},"private_ip_address":{"type":"string"},"public_ip_address":{"type":"string"},"role":{"type":"string"},"ssh_key_id":{"type":"string"},"ssh_user":{"type":"string"},"status":{"type":"string"},"updated_at":{"type":"string"}}},"dto.SshResponse":{"type":"object","properties":{"created_at":{"type":"string"},"fingerprint":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"organization_id":{"type":"string"},"public_key":{"type":"string"},"updated_at":{"type":"string"}}},"dto.SshRevealResponse":{"type":"object","properties":{"created_at":{"type":"string"},"fingerprint":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"organization_id":{"type":"string"},"private_key":{"type":"string"},"public_key":{"type":"string"},"updated_at":{"type":"string"}}},"dto.TaintResponse":{"type":"object","properties":{"created_at":{"type":"string"},"effect":{"type":"string"},"id":{"type":"string"},"key":{"type":"string"},"organization_id":{"type":"string"},"updated_at":{"type":"string"},"value":{"type":"string"}}},"dto.TokenPair":{"type":"object","properties":{"access_token":{"type":"string","example":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ij..."},"expires_in":{"type":"integer","example":3600},"refresh_token":{"type":"string","example":"m0l9o8rT3t0V8d3eFf...."},"token_type":{"type":"string","example":"Bearer"}}},"dto.UpdateAnnotationRequest":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}},"dto.UpdateLabelRequest":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}},"dto.UpdateServerRequest":{"type":"object","properties":{"hostname":{"type":"string"},"private_ip_address":{"type":"string"},"public_ip_address":{"type":"string"},"role":{"type":"string","example":"master|worker|bastion"},"ssh_key_id":{"type":"string"},"ssh_user":{"type":"string"},"status":{"type":"string","example":"pending|provisioning|ready|failed"}}},"dto.UpdateTaintRequest":{"type":"object","properties":{"effect":{"type":"string"},"key":{"type":"string"},"value":{"type":"string"}}},"handlers.HealthStatus":{"type":"object","properties":{"status":{"type":"string","example":"ok"}}},"handlers.createUserKeyRequest":{"type":"object","properties":{"expires_in_hours":{"description":"optional TTL","type":"integer"},"name":{"type":"string"}}},"handlers.meResponse":{"type":"object","properties":{"avatar_url":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"display_name":{"type":"string"},"emails":{"type":"array","items":{"$ref":"#/definitions/models.UserEmail"}},"id":{"description":"example: 3fa85f64-5717-4562-b3fc-2c963f66afa6","type":"string","format":"uuid"},"is_admin":{"type":"boolean"},"is_disabled":{"type":"boolean"},"organizations":{"type":"array","items":{"$ref":"#/definitions/models.Organization"}},"primary_email":{"type":"string"},"updated_at":{"type":"string","format":"date-time"}}},"handlers.memberOut":{"type":"object","properties":{"email":{"type":"string"},"role":{"description":"owner/admin/member","type":"string"},"user_id":{"type":"string","format":"uuid"}}},"handlers.memberUpsertReq":{"type":"object","properties":{"role":{"type":"string","example":"member"},"user_id":{"type":"string","format":"uuid"}}},"handlers.orgCreateReq":{"type":"object","properties":{"domain":{"type":"string","example":"acme.com"},"name":{"type":"string","example":"Acme Corp"}}},"handlers.orgKeyCreateReq":{"type":"object","properties":{"expires_in_hours":{"type":"integer","example":720},"name":{"type":"string","example":"automation-bot"}}},"handlers.orgKeyCreateResp":{"type":"object","properties":{"created_at":{"type":"string"},"expires_at":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"org_key":{"description":"shown once:","type":"string"},"org_secret":{"description":"shown once:","type":"string"},"scope":{"description":"\"org\"","type":"string"}}},"handlers.orgUpdateReq":{"type":"object","properties":{"domain":{"type":"string"},"name":{"type":"string"}}},"handlers.updateMeRequest":{"type":"object","properties":{"display_name":{"type":"string"}}},"handlers.userAPIKeyOut":{"type":"object","properties":{"created_at":{"type":"string"},"expires_at":{"type":"string"},"id":{"type":"string","format":"uuid"},"last_used_at":{"type":"string"},"name":{"type":"string"},"plain":{"description":"Shown only on create:","type":"string"},"scope":{"description":"\"user\"","type":"string"}}},"models.APIKey":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid"},"last_used_at":{"type":"string","format":"date-time"},"name":{"type":"string"},"org_id":{"type":"string","format":"uuid"},"prefix":{"type":"string"},"revoked":{"type":"boolean"},"scope":{"type":"string"},"updated_at":{"type":"string","format":"date-time"},"user_id":{"type":"string","format":"uuid"}}},"models.Organization":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time"},"domain":{"type":"string"},"id":{"description":"example: 3fa85f64-5717-4562-b3fc-2c963f66afa6","type":"string","format":"uuid"},"name":{"type":"string"},"updated_at":{"type":"string","format":"date-time"}}},"models.User":{"type":"object","properties":{"avatar_url":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"display_name":{"type":"string"},"id":{"description":"example: 3fa85f64-5717-4562-b3fc-2c963f66afa6","type":"string","format":"uuid"},"is_admin":{"type":"boolean"},"is_disabled":{"type":"boolean"},"primary_email":{"type":"string"},"updated_at":{"type":"string","format":"date-time"}}},"models.UserEmail":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time"},"email":{"type":"string"},"id":{"description":"example: 3fa85f64-5717-4562-b3fc-2c963f66afa6","type":"string","format":"uuid"},"is_primary":{"type":"boolean"},"is_verified":{"type":"boolean"},"updated_at":{"type":"string","format":"date-time"},"user":{"$ref":"#/definitions/models.User"},"user_id":{"type":"string","format":"uuid"}}},"utils.ErrorResponse":{"type":"object","properties":{"code":{"description":"A machine-readable error code, e.g. \"validation_error\"\nexample: validation_error","type":"string"},"message":{"description":"Human-readable message\nexample: slug is required","type":"string"}}}},"securityDefinitions":{"ApiKeyAuth":{"description":"User API key","type":"apiKey","name":"X-API-KEY","in":"header"},"BearerAuth":{"description":"Bearer token authentication","type":"apiKey","name":"Authorization","in":"header"},"OrgKeyAuth":{"description":"Org-level key/secret authentication","type":"apiKey","name":"X-ORG-KEY","in":"header"},"OrgSecretAuth":{"description":"Org-level secret","type":"apiKey","name":"X-ORG-SECRET","in":"header"}}} \ No newline at end of file +{"schemes":["http","https"],"swagger":"2.0","info":{"description":"API for managing K3s clusters across cloud providers","title":"AutoGlue API","contact":{"name":"GlueOps"},"version":"1.0"},"basePath":"/api/v1","paths":{"/.well-known/jwks.json":{"get":{"description":"Returns the JSON Web Key Set for token verification","produces":["application/json"],"tags":["Auth"],"summary":"Get JWKS","operationId":"getJWKS","responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.JWKS"}}}}},"/admin/archer/jobs":{"get":{"security":[{"BearerAuth":[]}],"description":"Paginated background jobs with optional filters. Search `q` may match id, type, error, payload (implementation-dependent).","consumes":["application/json"],"produces":["application/json"],"tags":["ArcherAdmin"],"summary":"List Archer jobs (admin)","operationId":"AdminListArcherJobs","parameters":[{"enum":["queued","running","succeeded","failed","canceled","retrying","scheduled"],"type":"string","description":"Filter by status","name":"status","in":"query"},{"type":"string","description":"Filter by queue name / worker name","name":"queue","in":"query"},{"type":"string","description":"Free-text search","name":"q","in":"query"},{"type":"integer","default":1,"description":"Page number","name":"page","in":"query"},{"maximum":100,"minimum":1,"type":"integer","default":25,"description":"Items per page","name":"page_size","in":"query"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.PageJob"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"forbidden","schema":{"type":"string"}},"500":{"description":"internal error","schema":{"type":"string"}}}},"post":{"security":[{"BearerAuth":[]}],"description":"Create a job immediately or schedule it for the future via `run_at`.","consumes":["application/json"],"produces":["application/json"],"tags":["ArcherAdmin"],"summary":"Enqueue a new Archer job (admin)","operationId":"AdminEnqueueArcherJob","parameters":[{"description":"Job parameters","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.EnqueueRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.Job"}},"400":{"description":"invalid json or missing fields","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"forbidden","schema":{"type":"string"}},"500":{"description":"internal error","schema":{"type":"string"}}}}},"/admin/archer/jobs/{id}/cancel":{"post":{"security":[{"BearerAuth":[]}],"description":"Set job status to canceled if cancellable. For running jobs, this only affects future picks; wire to Archer if you need active kill.","consumes":["application/json"],"produces":["application/json"],"tags":["ArcherAdmin"],"summary":"Cancel an Archer job (admin)","operationId":"AdminCancelArcherJob","parameters":[{"type":"string","description":"Job ID","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.Job"}},"400":{"description":"invalid job or not cancellable","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"forbidden","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}}}}},"/admin/archer/jobs/{id}/retry":{"post":{"security":[{"BearerAuth":[]}],"description":"Marks the job retriable (DB flip). Swap this for an Archer admin call if you expose one.","consumes":["application/json"],"produces":["application/json"],"tags":["ArcherAdmin"],"summary":"Retry a failed/canceled Archer job (admin)","operationId":"AdminRetryArcherJob","parameters":[{"type":"string","description":"Job ID","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.Job"}},"400":{"description":"invalid job or not eligible","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"forbidden","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}}}}},"/admin/archer/queues":{"get":{"security":[{"BearerAuth":[]}],"description":"Summary metrics per queue (pending, running, failed, scheduled).","consumes":["application/json"],"produces":["application/json"],"tags":["ArcherAdmin"],"summary":"List Archer queues (admin)","operationId":"AdminListArcherQueues","responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/dto.QueueInfo"}}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"forbidden","schema":{"type":"string"}},"500":{"description":"internal error","schema":{"type":"string"}}}}},"/annotations":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns annotations for the organization in X-Org-ID. Filters: `key`, `value`, and `q` (key contains). Add `include=node_pools` to include linked node pools.","consumes":["application/json"],"produces":["application/json"],"tags":["Annotations"],"summary":"List annotations (org scoped)","operationId":"ListAnnotations","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Exact key","name":"key","in":"query"},{"type":"string","description":"Exact value","name":"value","in":"query"},{"type":"string","description":"key contains (case-insensitive)","name":"q","in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/dto.AnnotationResponse"}}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"failed to list annotations","schema":{"type":"string"}}}},"post":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Creates an annotation.","consumes":["application/json"],"produces":["application/json"],"tags":["Annotations"],"summary":"Create annotation (org scoped)","operationId":"CreateAnnotation","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"description":"Annotation payload","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.CreateAnnotationRequest"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/dto.AnnotationResponse"}},"400":{"description":"invalid json / missing fields","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"create failed","schema":{"type":"string"}}}}},"/annotations/{id}":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns one annotation. Add `include=node_pools` to include node pools.","consumes":["application/json"],"produces":["application/json"],"tags":["Annotations"],"summary":"Get annotation by ID (org scoped)","operationId":"GetAnnotation","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Annotation ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.AnnotationResponse"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"fetch failed","schema":{"type":"string"}}}},"delete":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Permanently deletes the annotation.","consumes":["application/json"],"produces":["application/json"],"tags":["Annotations"],"summary":"Delete annotation (org scoped)","operationId":"DeleteAnnotation","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Annotation ID (UUID)","name":"id","in":"path","required":true}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"delete failed","schema":{"type":"string"}}}},"patch":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Partially update annotation fields.","consumes":["application/json"],"produces":["application/json"],"tags":["Annotations"],"summary":"Update annotation (org scoped)","operationId":"UpdateAnnotation","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Annotation ID (UUID)","name":"id","in":"path","required":true},{"description":"Fields to update","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.UpdateAnnotationRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.AnnotationResponse"}},"400":{"description":"invalid id / invalid json","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"update failed","schema":{"type":"string"}}}}},"/auth/logout":{"post":{"consumes":["application/json"],"produces":["application/json"],"tags":["Auth"],"summary":"Revoke refresh token family (logout everywhere)","operationId":"Logout","parameters":[{"description":"Refresh token","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.LogoutRequest"}}],"responses":{"204":{"description":"No Content"}}}},"/auth/refresh":{"post":{"consumes":["application/json"],"produces":["application/json"],"tags":["Auth"],"summary":"Rotate refresh token","operationId":"Refresh","parameters":[{"description":"Refresh token","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.RefreshRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.TokenPair"}}}}},"/auth/{provider}/callback":{"get":{"produces":["application/json"],"tags":["Auth"],"summary":"Handle social login callback","operationId":"AuthCallback","parameters":[{"type":"string","description":"google|github","name":"provider","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.TokenPair"}}}}},"/auth/{provider}/start":{"post":{"description":"Returns provider authorization URL for the frontend to redirect","produces":["application/json"],"tags":["Auth"],"summary":"Begin social login","operationId":"AuthStart","parameters":[{"type":"string","description":"google|github","name":"provider","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.AuthStartResponse"}}}}},"/healthz":{"get":{"description":"Returns 200 OK when the service is up","consumes":["application/json"],"produces":["application/json"],"tags":["Health"],"summary":"Basic health check","operationId":"HealthCheck // operationId","responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/handlers.HealthStatus"}}}}},"/labels":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns node labels for the organization in X-Org-ID. Filters: `key`, `value`, and `q` (key contains). Add `include=node_pools` to include linked node groups.","consumes":["application/json"],"produces":["application/json"],"tags":["Labels"],"summary":"List node labels (org scoped)","operationId":"ListLabels","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Exact key","name":"key","in":"query"},{"type":"string","description":"Exact value","name":"value","in":"query"},{"type":"string","description":"Key contains (case-insensitive)","name":"q","in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/dto.LabelResponse"}}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"failed to list node taints","schema":{"type":"string"}}}},"post":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Creates a label.","consumes":["application/json"],"produces":["application/json"],"tags":["Labels"],"summary":"Create label (org scoped)","operationId":"CreateLabel","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"description":"Label payload","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.CreateLabelRequest"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/dto.LabelResponse"}},"400":{"description":"invalid json / missing fields / invalid node_pool_ids","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"create failed","schema":{"type":"string"}}}}},"/labels/{id}":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns one label.","consumes":["application/json"],"produces":["application/json"],"tags":["Labels"],"summary":"Get label by ID (org scoped)","operationId":"GetLabel","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Label ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.LabelResponse"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"fetch failed","schema":{"type":"string"}}}},"delete":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Permanently deletes the label.","consumes":["application/json"],"produces":["application/json"],"tags":["Labels"],"summary":"Delete label (org scoped)","operationId":"DeleteLabel","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Label ID (UUID)","name":"id","in":"path","required":true}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"delete failed","schema":{"type":"string"}}}},"patch":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Partially update label fields.","consumes":["application/json"],"produces":["application/json"],"tags":["Labels"],"summary":"Update label (org scoped)","operationId":"UpdateLabel","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Label ID (UUID)","name":"id","in":"path","required":true},{"description":"Fields to update","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.UpdateLabelRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.LabelResponse"}},"400":{"description":"invalid id / invalid json","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"update failed","schema":{"type":"string"}}}}},"/me":{"get":{"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"produces":["application/json"],"tags":["Me"],"summary":"Get current user profile","operationId":"GetMe","responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/handlers.meResponse"}}}},"patch":{"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["Me"],"summary":"Update current user profile","operationId":"UpdateMe","parameters":[{"description":"Patch profile","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/handlers.updateMeRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/models.User"}}}}},"/me/api-keys":{"get":{"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"produces":["application/json"],"tags":["MeAPIKeys"],"summary":"List my API keys","operationId":"ListUserAPIKeys","responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/handlers.userAPIKeyOut"}}}}},"post":{"security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"description":"Returns the plaintext key once. Store it securely on the client side.","consumes":["application/json"],"produces":["application/json"],"tags":["MeAPIKeys"],"summary":"Create a new user API key","operationId":"CreateUserAPIKey","parameters":[{"description":"Key options","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/handlers.createUserKeyRequest"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/handlers.userAPIKeyOut"}}}}},"/me/api-keys/{id}":{"delete":{"security":[{"BearerAuth":[]}],"produces":["application/json"],"tags":["MeAPIKeys"],"summary":"Delete a user API key","operationId":"DeleteUserAPIKey","parameters":[{"type":"string","description":"Key ID (UUID)","name":"id","in":"path","required":true}],"responses":{"204":{"description":"No Content"}}}},"/node-pools":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns node pools for the organization in X-Org-ID.","consumes":["application/json"],"produces":["application/json"],"tags":["NodePools"],"summary":"List node pools (org scoped)","operationId":"ListNodePools","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Name contains (case-insensitive)","name":"q","in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/dto.NodePoolResponse"}}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"failed to list node pools","schema":{"type":"string"}}}},"post":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Creates a node pool. Optionally attach initial servers.","consumes":["application/json"],"produces":["application/json"],"tags":["NodePools"],"summary":"Create node pool (org scoped)","operationId":"CreateNodePool","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"description":"NodePool payload","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.CreateNodePoolRequest"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/dto.NodePoolResponse"}},"400":{"description":"invalid json / missing fields / invalid server_ids","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"create failed","schema":{"type":"string"}}}}},"/node-pools/{id}":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns one node pool. Add `include=servers` to include servers.","consumes":["application/json"],"produces":["application/json"],"tags":["NodePools"],"summary":"Get node pool by ID (org scoped)","operationId":"GetNodePool","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Pool ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.NodePoolResponse"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"fetch failed","schema":{"type":"string"}}}},"delete":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Permanently deletes the node pool.","consumes":["application/json"],"produces":["application/json"],"tags":["NodePools"],"summary":"Delete node pool (org scoped)","operationId":"DeleteNodePool","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Pool ID (UUID)","name":"id","in":"path","required":true}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"delete failed","schema":{"type":"string"}}}},"patch":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Partially update node pool fields.","consumes":["application/json"],"produces":["application/json"],"tags":["NodePools"],"summary":"Update node pool (org scoped)","operationId":"UpdateNodePool","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Pool ID (UUID)","name":"id","in":"path","required":true},{"description":"Fields to update","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.UpdateNodePoolRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.NodePoolResponse"}},"400":{"description":"invalid id / invalid json","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"update failed","schema":{"type":"string"}}}}},"/node-pools/{id}/annotations":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["NodePools"],"summary":"List annotations attached to a node pool (org scoped)","operationId":"ListNodePoolAnnotations","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Pool ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/dto.AnnotationResponse"}}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"fetch failed","schema":{"type":"string"}}}},"post":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["NodePools"],"summary":"Attach annotation to a node pool (org scoped)","operationId":"AttachNodePoolAnnotations","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Group ID (UUID)","name":"id","in":"path","required":true},{"description":"Annotation IDs to attach","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.AttachAnnotationsRequest"}}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id / invalid server_ids","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"attach failed","schema":{"type":"string"}}}}},"/node-pools/{id}/annotations/{annotationId}":{"delete":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["NodePools"],"summary":"Detach one annotation from a node pool (org scoped)","operationId":"DetachNodePoolAnnotation","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Pool ID (UUID)","name":"id","in":"path","required":true},{"type":"string","description":"Annotation ID (UUID)","name":"annotationId","in":"path","required":true}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"detach failed","schema":{"type":"string"}}}}},"/node-pools/{id}/labels":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["NodePools"],"summary":"List labels attached to a node pool (org scoped)","operationId":"ListNodePoolLabels","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Label Pool ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/dto.LabelResponse"}}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"fetch failed","schema":{"type":"string"}}}},"post":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["NodePools"],"summary":"Attach labels to a node pool (org scoped)","operationId":"AttachNodePoolLabels","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Pool ID (UUID)","name":"id","in":"path","required":true},{"description":"Label IDs to attach","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.AttachLabelsRequest"}}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id / invalid server_ids","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"attach failed","schema":{"type":"string"}}}}},"/node-pools/{id}/labels/{labelId}":{"delete":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["NodePools"],"summary":"Detach one label from a node pool (org scoped)","operationId":"DetachNodePoolLabel","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Pool ID (UUID)","name":"id","in":"path","required":true},{"type":"string","description":"Label ID (UUID)","name":"labelId","in":"path","required":true}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"detach failed","schema":{"type":"string"}}}}},"/node-pools/{id}/servers":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["NodePools"],"summary":"List servers attached to a node pool (org scoped)","operationId":"ListNodePoolServers","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Pool ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/dto.ServerResponse"}}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"fetch failed","schema":{"type":"string"}}}},"post":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["NodePools"],"summary":"Attach servers to a node pool (org scoped)","operationId":"AttachNodePoolServers","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Pool ID (UUID)","name":"id","in":"path","required":true},{"description":"Server IDs to attach","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.AttachServersRequest"}}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id / invalid server_ids","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"attach failed","schema":{"type":"string"}}}}},"/node-pools/{id}/servers/{serverId}":{"delete":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["NodePools"],"summary":"Detach one server from a node pool (org scoped)","operationId":"DetachNodePoolServer","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Pool ID (UUID)","name":"id","in":"path","required":true},{"type":"string","description":"Server ID (UUID)","name":"serverId","in":"path","required":true}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"detach failed","schema":{"type":"string"}}}}},"/node-pools/{id}/taints":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["NodePools"],"summary":"List taints attached to a node pool (org scoped)","operationId":"ListNodePoolTaints","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Pool ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/dto.TaintResponse"}}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"fetch failed","schema":{"type":"string"}}}},"post":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["NodePools"],"summary":"Attach taints to a node pool (org scoped)","operationId":"AttachNodePoolTaints","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Pool ID (UUID)","name":"id","in":"path","required":true},{"description":"Taint IDs to attach","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.AttachTaintsRequest"}}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id / invalid taint_ids","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"attach failed","schema":{"type":"string"}}}}},"/node-pools/{id}/taints/{taintId}":{"delete":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["NodePools"],"summary":"Detach one taint from a node pool (org scoped)","operationId":"DetachNodePoolTaint","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Pool ID (UUID)","name":"id","in":"path","required":true},{"type":"string","description":"Taint ID (UUID)","name":"taintId","in":"path","required":true}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"detach failed","schema":{"type":"string"}}}}},"/orgs":{"get":{"security":[{"BearerAuth":[]}],"produces":["application/json"],"tags":["Orgs"],"summary":"List organizations I belong to","operationId":"listMyOrgs","responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/models.Organization"}}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}},"post":{"security":[{"BearerAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["Orgs"],"summary":"Create organization","operationId":"createOrg","parameters":[{"description":"Org payload","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/handlers.orgCreateReq"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/models.Organization"}},"400":{"description":"Bad Request","schema":{"$ref":"#/definitions/utils.ErrorResponse"}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}},"409":{"description":"Conflict","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}}},"/orgs/{id}":{"get":{"security":[{"BearerAuth":[]}],"produces":["application/json"],"tags":["Orgs"],"summary":"Get organization","operationId":"getOrg","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/models.Organization"}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}},"delete":{"security":[{"BearerAuth":[]}],"produces":["application/json"],"tags":["Orgs"],"summary":"Delete organization (owner)","operationId":"deleteOrg","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}},"patch":{"security":[{"BearerAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["Orgs"],"summary":"Update organization (owner/admin)","operationId":"updateOrg","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true},{"description":"Update payload","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/handlers.orgUpdateReq"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/models.Organization"}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}},"404":{"description":"Not Found","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}}},"/orgs/{id}/api-keys":{"get":{"security":[{"BearerAuth":[]}],"produces":["application/json"],"tags":["Orgs"],"summary":"List org-scoped API keys (no secrets)","operationId":"listOrgKeys","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/models.APIKey"}}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}},"post":{"security":[{"BearerAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["Orgs"],"summary":"Create org key/secret pair (owner/admin)","operationId":"createOrgKey","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true},{"description":"Key name + optional expiry","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/handlers.orgKeyCreateReq"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/handlers.orgKeyCreateResp"}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}}},"/orgs/{id}/api-keys/{key_id}":{"delete":{"security":[{"BearerAuth":[]}],"produces":["application/json"],"tags":["Orgs"],"summary":"Delete org key (owner/admin)","operationId":"deleteOrgKey","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true},{"type":"string","description":"Key ID (UUID)","name":"key_id","in":"path","required":true}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}}},"/orgs/{id}/members":{"get":{"security":[{"BearerAuth":[]}],"produces":["application/json"],"tags":["Orgs"],"summary":"List members in org","operationId":"listMembers","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/handlers.memberOut"}}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}},"post":{"security":[{"BearerAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["Orgs"],"summary":"Add or update a member (owner/admin)","operationId":"addOrUpdateMember","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true},{"description":"User \u0026 role","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/handlers.memberUpsertReq"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/handlers.memberOut"}},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}}},"/orgs/{id}/members/{user_id}":{"delete":{"security":[{"BearerAuth":[]}],"produces":["application/json"],"tags":["Orgs"],"summary":"Remove a member (owner/admin)","operationId":"removeMember","parameters":[{"type":"string","description":"Org ID (UUID)","name":"id","in":"path","required":true},{"type":"string","description":"User ID (UUID)","name":"user_id","in":"path","required":true}],"responses":{"204":{"description":"Removed"},"401":{"description":"Unauthorized","schema":{"$ref":"#/definitions/utils.ErrorResponse"}}}}},"/servers":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns servers for the organization in X-Org-ID. Optional filters: status, role.","consumes":["application/json"],"produces":["application/json"],"tags":["Servers"],"summary":"List servers (org scoped)","operationId":"ListServers","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Filter by status (pending|provisioning|ready|failed)","name":"status","in":"query"},{"type":"string","description":"Filter by role","name":"role","in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/dto.ServerResponse"}}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"failed to list servers","schema":{"type":"string"}}}},"post":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Creates a server bound to the org in X-Org-ID. Validates that ssh_key_id belongs to the org.","consumes":["application/json"],"produces":["application/json"],"tags":["Servers"],"summary":"Create server (org scoped)","operationId":"CreateServer","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"description":"Server payload","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.CreateServerRequest"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/dto.ServerResponse"}},"400":{"description":"invalid json / missing fields / invalid status / invalid ssh_key_id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"create failed","schema":{"type":"string"}}}}},"/servers/{id}":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns one server in the given organization.","consumes":["application/json"],"produces":["application/json"],"tags":["Servers"],"summary":"Get server by ID (org scoped)","operationId":"GetServer","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Server ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.ServerResponse"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"fetch failed","schema":{"type":"string"}}}},"delete":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Permanently deletes the server.","consumes":["application/json"],"produces":["application/json"],"tags":["Servers"],"summary":"Delete server (org scoped)","operationId":"DeleteServer","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Server ID (UUID)","name":"id","in":"path","required":true}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"delete failed","schema":{"type":"string"}}}},"patch":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Partially update fields; changing ssh_key_id validates ownership.","consumes":["application/json"],"produces":["application/json"],"tags":["Servers"],"summary":"Update server (org scoped)","operationId":"UpdateServer","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Server ID (UUID)","name":"id","in":"path","required":true},{"description":"Fields to update","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.UpdateServerRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.ServerResponse"}},"400":{"description":"invalid id / invalid json / invalid status / invalid ssh_key_id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"update failed","schema":{"type":"string"}}}}},"/ssh":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns ssh keys for the organization in X-Org-ID.","consumes":["application/json"],"produces":["application/json"],"tags":["Ssh"],"summary":"List ssh keys (org scoped)","operationId":"ListPublicSshKeys","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/dto.SshResponse"}}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"failed to list keys","schema":{"type":"string"}}}},"post":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Generates an RSA or ED25519 keypair, saves it, and returns metadata. For RSA you may set bits (2048/3072/4096). Default is 4096. ED25519 ignores bits.","consumes":["application/json"],"produces":["application/json"],"tags":["Ssh"],"summary":"Create ssh keypair (org scoped)","operationId":"CreateSSHKey","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"description":"Key generation options","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.CreateSSHRequest"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/dto.SshResponse"}},"400":{"description":"invalid json / invalid bits","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"generation/create failed","schema":{"type":"string"}}}}},"/ssh/{id}":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns public key fields. Append `?reveal=true` to include the private key PEM.","consumes":["application/json"],"produces":["application/json"],"tags":["Ssh"],"summary":"Get ssh key by ID (org scoped)","operationId":"GetSSHKey","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"SSH Key ID (UUID)","name":"id","in":"path","required":true},{"type":"boolean","description":"Reveal private key PEM","name":"reveal","in":"query"}],"responses":{"200":{"description":"When reveal=true","schema":{"$ref":"#/definitions/dto.SshRevealResponse"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"fetch failed","schema":{"type":"string"}}}},"delete":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Permanently deletes a keypair.","consumes":["application/json"],"produces":["application/json"],"tags":["Ssh"],"summary":"Delete ssh keypair (org scoped)","operationId":"DeleteSSHKey","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"SSH Key ID (UUID)","name":"id","in":"path","required":true}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"delete failed","schema":{"type":"string"}}}}},"/ssh/{id}/download":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Download `part=public|private|both` of the keypair. `both` returns a zip file.","produces":["application/json"],"tags":["Ssh"],"summary":"Download ssh key files by ID (org scoped)","operationId":"DownloadSSHKey","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header","required":true},{"type":"string","description":"SSH Key ID (UUID)","name":"id","in":"path","required":true},{"enum":["public","private","both"],"type":"string","description":"Which part to download","name":"part","in":"query","required":true}],"responses":{"200":{"description":"file content","schema":{"type":"string"}},"400":{"description":"invalid id / invalid part","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"download failed","schema":{"type":"string"}}}}},"/taints":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Returns node taints for the organization in X-Org-ID. Filters: `key`, `value`, and `q` (key contains). Add `include=node_pools` to include linked node pools.","consumes":["application/json"],"produces":["application/json"],"tags":["Taints"],"summary":"List node pool taints (org scoped)","operationId":"ListTaints","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Exact key","name":"key","in":"query"},{"type":"string","description":"Exact value","name":"value","in":"query"},{"type":"string","description":"key contains (case-insensitive)","name":"q","in":"query"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/dto.TaintResponse"}}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"failed to list node taints","schema":{"type":"string"}}}},"post":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Creates a taint.","consumes":["application/json"],"produces":["application/json"],"tags":["Taints"],"summary":"Create node taint (org scoped)","operationId":"CreateTaint","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"description":"Taint payload","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.CreateTaintRequest"}}],"responses":{"201":{"description":"Created","schema":{"$ref":"#/definitions/dto.TaintResponse"}},"400":{"description":"invalid json / missing fields / invalid node_pool_ids","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"create failed","schema":{"type":"string"}}}}},"/taints/{id}":{"get":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"consumes":["application/json"],"produces":["application/json"],"tags":["Taints"],"summary":"Get node taint by ID (org scoped)","operationId":"GetTaint","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Taint ID (UUID)","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.TaintResponse"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"fetch failed","schema":{"type":"string"}}}},"delete":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Permanently deletes the taint.","consumes":["application/json"],"produces":["application/json"],"tags":["Taints"],"summary":"Delete taint (org scoped)","operationId":"DeleteTaint","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Taint ID (UUID)","name":"id","in":"path","required":true}],"responses":{"204":{"description":"No Content","schema":{"type":"string"}},"400":{"description":"invalid id","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"500":{"description":"delete failed","schema":{"type":"string"}}}},"patch":{"security":[{"BearerAuth":[]},{"OrgKeyAuth":[]},{"OrgSecretAuth":[]}],"description":"Partially update taint fields.","consumes":["application/json"],"produces":["application/json"],"tags":["Taints"],"summary":"Update node taint (org scoped)","operationId":"UpdateTaint","parameters":[{"type":"string","description":"Organization UUID","name":"X-Org-ID","in":"header"},{"type":"string","description":"Node Taint ID (UUID)","name":"id","in":"path","required":true},{"description":"Fields to update","name":"body","in":"body","required":true,"schema":{"$ref":"#/definitions/dto.UpdateTaintRequest"}}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/dto.TaintResponse"}},"400":{"description":"invalid id / invalid json","schema":{"type":"string"}},"401":{"description":"Unauthorized","schema":{"type":"string"}},"403":{"description":"organization required","schema":{"type":"string"}},"404":{"description":"not found","schema":{"type":"string"}},"500":{"description":"update failed","schema":{"type":"string"}}}}}},"definitions":{"dto.AnnotationResponse":{"type":"object","properties":{"created_at":{"type":"string"},"id":{"type":"string"},"key":{"type":"string"},"organization_id":{"type":"string"},"updated_at":{"type":"string"},"value":{"type":"string"}}},"dto.AttachAnnotationsRequest":{"type":"object","properties":{"annotation_ids":{"type":"array","items":{"type":"string"}}}},"dto.AttachLabelsRequest":{"type":"object","properties":{"label_ids":{"type":"array","items":{"type":"string"}}}},"dto.AttachServersRequest":{"type":"object","properties":{"server_ids":{"type":"array","items":{"type":"string"}}}},"dto.AttachTaintsRequest":{"type":"object","properties":{"taint_ids":{"type":"array","items":{"type":"string"}}}},"dto.AuthStartResponse":{"type":"object","properties":{"auth_url":{"type":"string","example":"https://accounts.google.com/o/oauth2/v2/auth?client_id=..."}}},"dto.CreateAnnotationRequest":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}},"dto.CreateLabelRequest":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}},"dto.CreateNodePoolRequest":{"type":"object","properties":{"name":{"type":"string"},"role":{"type":"string","enum":["master","worker"]}}},"dto.CreateSSHRequest":{"type":"object","properties":{"bits":{"description":"Only for RSA","type":"integer"},"comment":{"type":"string","example":"deploy@autoglue"},"name":{"type":"string"},"type":{"description":"\"rsa\" (default) or \"ed25519\"","type":"string"}}},"dto.CreateServerRequest":{"type":"object","properties":{"hostname":{"type":"string"},"private_ip_address":{"type":"string"},"public_ip_address":{"type":"string"},"role":{"type":"string","enum":["master","worker","bastion"],"example":"master|worker|bastion"},"ssh_key_id":{"type":"string"},"ssh_user":{"type":"string"},"status":{"type":"string","enum":["pending","provisioning","ready","failed"],"example":"pending|provisioning|ready|failed"}}},"dto.CreateTaintRequest":{"type":"object","properties":{"effect":{"type":"string"},"key":{"type":"string"},"value":{"type":"string"}}},"dto.EnqueueRequest":{"type":"object"},"dto.JWK":{"type":"object","properties":{"alg":{"type":"string","example":"RS256"},"e":{"type":"string","example":"AQAB"},"kid":{"type":"string","example":"7c6f1d0a-7a98-4e6a-9dbf-6b1af4b9f345"},"kty":{"type":"string","example":"RSA"},"n":{"type":"string"},"use":{"type":"string","example":"sig"},"x":{"type":"string"}}},"dto.JWKS":{"type":"object","properties":{"keys":{"type":"array","items":{"$ref":"#/definitions/dto.JWK"}}}},"dto.Job":{"type":"object","properties":{"attempts":{"type":"integer","example":0},"created_at":{"type":"string","example":"2025-11-04T09:30:00Z"},"id":{"type":"string","example":"01HF7SZK8Z8WG1M3J7S2Z8M2N6"},"last_error":{"type":"string","example":"error message"},"max_attempts":{"type":"integer","example":3},"payload":{},"queue":{"type":"string","example":"default"},"run_at":{"type":"string","example":"2025-11-04T09:30:00Z"},"status":{"enum":["queued|running|succeeded|failed|canceled|retrying|scheduled"],"allOf":[{"$ref":"#/definitions/dto.JobStatus"}],"example":"queued"},"type":{"type":"string","example":"email.send"},"updated_at":{"type":"string","example":"2025-11-04T09:30:00Z"}}},"dto.JobStatus":{"type":"string","enum":["queued","running","succeeded","failed","canceled","retrying","scheduled"],"x-enum-varnames":["StatusQueued","StatusRunning","StatusSucceeded","StatusFailed","StatusCanceled","StatusRetrying","StatusScheduled"]},"dto.LabelResponse":{"type":"object","properties":{"created_at":{"type":"string"},"id":{"type":"string"},"key":{"type":"string"},"organization_id":{"type":"string"},"updated_at":{"type":"string"},"value":{"type":"string"}}},"dto.LogoutRequest":{"type":"object","properties":{"refresh_token":{"type":"string","example":"m0l9o8rT3t0V8d3eFf..."}}},"dto.NodePoolResponse":{"type":"object","properties":{"annotations":{"type":"array","items":{"$ref":"#/definitions/dto.AnnotationResponse"}},"created_at":{"type":"string"},"id":{"type":"string"},"labels":{"type":"array","items":{"$ref":"#/definitions/dto.LabelResponse"}},"name":{"type":"string"},"organization_id":{"type":"string"},"role":{"type":"string","enum":["master","worker"]},"servers":{"type":"array","items":{"$ref":"#/definitions/dto.ServerResponse"}},"taints":{"type":"array","items":{"$ref":"#/definitions/dto.TaintResponse"}},"updated_at":{"type":"string"}}},"dto.PageJob":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/definitions/dto.Job"}},"page":{"type":"integer","example":1},"page_size":{"type":"integer","example":25},"total":{"type":"integer","example":120}}},"dto.QueueInfo":{"type":"object","properties":{"failed":{"type":"integer","example":5},"name":{"type":"string","example":"default"},"pending":{"type":"integer","example":42},"running":{"type":"integer","example":3},"scheduled":{"type":"integer","example":7}}},"dto.RefreshRequest":{"type":"object","properties":{"refresh_token":{"type":"string","example":"m0l9o8rT3t0V8d3eFf..."}}},"dto.ServerResponse":{"type":"object","properties":{"created_at":{"type":"string"},"hostname":{"type":"string"},"id":{"type":"string"},"organization_id":{"type":"string"},"private_ip_address":{"type":"string"},"public_ip_address":{"type":"string"},"role":{"type":"string","enum":["master","worker","bastion"],"example":"master|worker|bastion"},"ssh_key_id":{"type":"string"},"ssh_user":{"type":"string"},"status":{"type":"string","enum":["pending","provisioning","ready","failed"],"example":"pending|provisioning|ready|failed"},"updated_at":{"type":"string"}}},"dto.SshResponse":{"type":"object","properties":{"created_at":{"type":"string"},"fingerprint":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"organization_id":{"type":"string"},"public_key":{"type":"string"},"updated_at":{"type":"string"}}},"dto.SshRevealResponse":{"type":"object","properties":{"created_at":{"type":"string"},"fingerprint":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"organization_id":{"type":"string"},"private_key":{"type":"string"},"public_key":{"type":"string"},"updated_at":{"type":"string"}}},"dto.TaintResponse":{"type":"object","properties":{"created_at":{"type":"string"},"effect":{"type":"string"},"id":{"type":"string"},"key":{"type":"string"},"organization_id":{"type":"string"},"updated_at":{"type":"string"},"value":{"type":"string"}}},"dto.TokenPair":{"type":"object","properties":{"access_token":{"type":"string","example":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ij..."},"expires_in":{"type":"integer","example":3600},"refresh_token":{"type":"string","example":"m0l9o8rT3t0V8d3eFf...."},"token_type":{"type":"string","example":"Bearer"}}},"dto.UpdateAnnotationRequest":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}},"dto.UpdateLabelRequest":{"type":"object","properties":{"key":{"type":"string"},"value":{"type":"string"}}},"dto.UpdateNodePoolRequest":{"type":"object","properties":{"name":{"type":"string"},"role":{"type":"string","enum":["master","worker"]}}},"dto.UpdateServerRequest":{"type":"object","properties":{"hostname":{"type":"string"},"private_ip_address":{"type":"string"},"public_ip_address":{"type":"string"},"role":{"type":"string","enum":["master","worker","bastion"],"example":"master|worker|bastion"},"ssh_key_id":{"type":"string"},"ssh_user":{"type":"string"},"status":{"type":"string","enum":["pending","provisioning","ready","failed"],"example":"pending|provisioning|ready|failed"}}},"dto.UpdateTaintRequest":{"type":"object","properties":{"effect":{"type":"string"},"key":{"type":"string"},"value":{"type":"string"}}},"handlers.HealthStatus":{"type":"object","properties":{"status":{"type":"string","example":"ok"}}},"handlers.createUserKeyRequest":{"type":"object","properties":{"expires_in_hours":{"description":"optional TTL","type":"integer"},"name":{"type":"string"}}},"handlers.meResponse":{"type":"object","properties":{"avatar_url":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"display_name":{"type":"string"},"emails":{"type":"array","items":{"$ref":"#/definitions/models.UserEmail"}},"id":{"description":"example: 3fa85f64-5717-4562-b3fc-2c963f66afa6","type":"string","format":"uuid"},"is_admin":{"type":"boolean"},"is_disabled":{"type":"boolean"},"organizations":{"type":"array","items":{"$ref":"#/definitions/models.Organization"}},"primary_email":{"type":"string"},"updated_at":{"type":"string","format":"date-time"}}},"handlers.memberOut":{"type":"object","properties":{"email":{"type":"string"},"role":{"description":"owner/admin/member","type":"string"},"user_id":{"type":"string","format":"uuid"}}},"handlers.memberUpsertReq":{"type":"object","properties":{"role":{"type":"string","example":"member"},"user_id":{"type":"string","format":"uuid"}}},"handlers.orgCreateReq":{"type":"object","properties":{"domain":{"type":"string","example":"acme.com"},"name":{"type":"string","example":"Acme Corp"}}},"handlers.orgKeyCreateReq":{"type":"object","properties":{"expires_in_hours":{"type":"integer","example":720},"name":{"type":"string","example":"automation-bot"}}},"handlers.orgKeyCreateResp":{"type":"object","properties":{"created_at":{"type":"string"},"expires_at":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"org_key":{"description":"shown once:","type":"string"},"org_secret":{"description":"shown once:","type":"string"},"scope":{"description":"\"org\"","type":"string"}}},"handlers.orgUpdateReq":{"type":"object","properties":{"domain":{"type":"string"},"name":{"type":"string"}}},"handlers.updateMeRequest":{"type":"object","properties":{"display_name":{"type":"string"}}},"handlers.userAPIKeyOut":{"type":"object","properties":{"created_at":{"type":"string"},"expires_at":{"type":"string"},"id":{"type":"string","format":"uuid"},"last_used_at":{"type":"string"},"name":{"type":"string"},"plain":{"description":"Shown only on create:","type":"string"},"scope":{"description":"\"user\"","type":"string"}}},"models.APIKey":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time"},"expires_at":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid"},"last_used_at":{"type":"string","format":"date-time"},"name":{"type":"string"},"org_id":{"type":"string","format":"uuid"},"prefix":{"type":"string"},"revoked":{"type":"boolean"},"scope":{"type":"string"},"updated_at":{"type":"string","format":"date-time"},"user_id":{"type":"string","format":"uuid"}}},"models.Organization":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time"},"domain":{"type":"string"},"id":{"description":"example: 3fa85f64-5717-4562-b3fc-2c963f66afa6","type":"string","format":"uuid"},"name":{"type":"string"},"updated_at":{"type":"string","format":"date-time"}}},"models.User":{"type":"object","properties":{"avatar_url":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"display_name":{"type":"string"},"id":{"description":"example: 3fa85f64-5717-4562-b3fc-2c963f66afa6","type":"string","format":"uuid"},"is_admin":{"type":"boolean"},"is_disabled":{"type":"boolean"},"primary_email":{"type":"string"},"updated_at":{"type":"string","format":"date-time"}}},"models.UserEmail":{"type":"object","properties":{"created_at":{"type":"string","format":"date-time"},"email":{"type":"string"},"id":{"description":"example: 3fa85f64-5717-4562-b3fc-2c963f66afa6","type":"string","format":"uuid"},"is_primary":{"type":"boolean"},"is_verified":{"type":"boolean"},"updated_at":{"type":"string","format":"date-time"},"user":{"$ref":"#/definitions/models.User"},"user_id":{"type":"string","format":"uuid"}}},"utils.ErrorResponse":{"type":"object","properties":{"code":{"description":"A machine-readable error code, e.g. \"validation_error\"\nexample: validation_error","type":"string"},"message":{"description":"Human-readable message\nexample: slug is required","type":"string"}}}},"securityDefinitions":{"ApiKeyAuth":{"description":"User API key","type":"apiKey","name":"X-API-KEY","in":"header"},"BearerAuth":{"description":"Bearer token authentication","type":"apiKey","name":"Authorization","in":"header"},"OrgKeyAuth":{"description":"Org-level key/secret authentication","type":"apiKey","name":"X-ORG-KEY","in":"header"},"OrgSecretAuth":{"description":"Org-level secret","type":"apiKey","name":"X-ORG-SECRET","in":"header"}}} \ No newline at end of file diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 419c625..6fde2e2 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -15,6 +15,34 @@ definitions: value: type: string type: object + dto.AttachAnnotationsRequest: + properties: + annotation_ids: + items: + type: string + type: array + type: object + dto.AttachLabelsRequest: + properties: + label_ids: + items: + type: string + type: array + type: object + dto.AttachServersRequest: + properties: + server_ids: + items: + type: string + type: array + type: object + dto.AttachTaintsRequest: + properties: + taint_ids: + items: + type: string + type: array + type: object dto.AuthStartResponse: properties: auth_url: @@ -35,6 +63,16 @@ definitions: value: type: string type: object + dto.CreateNodePoolRequest: + properties: + name: + type: string + role: + enum: + - master + - worker + type: string + type: object dto.CreateSSHRequest: properties: bits: @@ -58,6 +96,10 @@ definitions: public_ip_address: type: string role: + enum: + - master + - worker + - bastion example: master|worker|bastion type: string ssh_key_id: @@ -65,6 +107,11 @@ definitions: ssh_user: type: string status: + enum: + - pending + - provisioning + - ready + - failed example: pending|provisioning|ready|failed type: string type: object @@ -184,6 +231,40 @@ definitions: example: m0l9o8rT3t0V8d3eFf... type: string type: object + dto.NodePoolResponse: + properties: + annotations: + items: + $ref: '#/definitions/dto.AnnotationResponse' + type: array + created_at: + type: string + id: + type: string + labels: + items: + $ref: '#/definitions/dto.LabelResponse' + type: array + name: + type: string + organization_id: + type: string + role: + enum: + - master + - worker + type: string + servers: + items: + $ref: '#/definitions/dto.ServerResponse' + type: array + taints: + items: + $ref: '#/definitions/dto.TaintResponse' + type: array + updated_at: + type: string + type: object dto.PageJob: properties: items: @@ -239,12 +320,23 @@ definitions: public_ip_address: type: string role: + enum: + - master + - worker + - bastion + example: master|worker|bastion type: string ssh_key_id: type: string ssh_user: type: string status: + enum: + - pending + - provisioning + - ready + - failed + example: pending|provisioning|ready|failed type: string updated_at: type: string @@ -331,6 +423,16 @@ definitions: value: type: string type: object + dto.UpdateNodePoolRequest: + properties: + name: + type: string + role: + enum: + - master + - worker + type: string + type: object dto.UpdateServerRequest: properties: hostname: @@ -340,6 +442,10 @@ definitions: public_ip_address: type: string role: + enum: + - master + - worker + - bastion example: master|worker|bastion type: string ssh_key_id: @@ -347,6 +453,11 @@ definitions: ssh_user: type: string status: + enum: + - pending + - provisioning + - ready + - failed example: pending|provisioning|ready|failed type: string type: object @@ -1541,6 +1652,881 @@ paths: summary: Delete a user API key tags: - MeAPIKeys + /node-pools: + get: + consumes: + - application/json + description: Returns node pools for the organization in X-Org-ID. + operationId: ListNodePools + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + type: string + - description: Name contains (case-insensitive) + in: query + name: q + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + items: + $ref: '#/definitions/dto.NodePoolResponse' + type: array + "401": + description: Unauthorized + schema: + type: string + "403": + description: organization required + schema: + type: string + "500": + description: failed to list node pools + schema: + type: string + security: + - BearerAuth: [] + - OrgKeyAuth: [] + - OrgSecretAuth: [] + summary: List node pools (org scoped) + tags: + - NodePools + post: + consumes: + - application/json + description: Creates a node pool. Optionally attach initial servers. + operationId: CreateNodePool + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + type: string + - description: NodePool payload + in: body + name: body + required: true + schema: + $ref: '#/definitions/dto.CreateNodePoolRequest' + produces: + - application/json + responses: + "201": + description: Created + schema: + $ref: '#/definitions/dto.NodePoolResponse' + "400": + description: invalid json / missing fields / invalid server_ids + schema: + type: string + "401": + description: Unauthorized + schema: + type: string + "403": + description: organization required + schema: + type: string + "500": + description: create failed + schema: + type: string + security: + - BearerAuth: [] + - OrgKeyAuth: [] + - OrgSecretAuth: [] + summary: Create node pool (org scoped) + tags: + - NodePools + /node-pools/{id}: + delete: + consumes: + - application/json + description: Permanently deletes the node pool. + operationId: DeleteNodePool + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + type: string + - description: Node Pool ID (UUID) + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "204": + description: No Content + schema: + type: string + "400": + description: invalid id + schema: + type: string + "401": + description: Unauthorized + schema: + type: string + "403": + description: organization required + schema: + type: string + "500": + description: delete failed + schema: + type: string + security: + - BearerAuth: [] + - OrgKeyAuth: [] + - OrgSecretAuth: [] + summary: Delete node pool (org scoped) + tags: + - NodePools + get: + consumes: + - application/json + description: Returns one node pool. Add `include=servers` to include servers. + operationId: GetNodePool + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + type: string + - description: Node Pool ID (UUID) + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.NodePoolResponse' + "400": + description: invalid id + schema: + type: string + "401": + description: Unauthorized + schema: + type: string + "403": + description: organization required + schema: + type: string + "404": + description: not found + schema: + type: string + "500": + description: fetch failed + schema: + type: string + security: + - BearerAuth: [] + - OrgKeyAuth: [] + - OrgSecretAuth: [] + summary: Get node pool by ID (org scoped) + tags: + - NodePools + patch: + consumes: + - application/json + description: Partially update node pool fields. + operationId: UpdateNodePool + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + type: string + - description: Node Pool ID (UUID) + in: path + name: id + required: true + type: string + - description: Fields to update + in: body + name: body + required: true + schema: + $ref: '#/definitions/dto.UpdateNodePoolRequest' + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/dto.NodePoolResponse' + "400": + description: invalid id / invalid json + schema: + type: string + "401": + description: Unauthorized + schema: + type: string + "403": + description: organization required + schema: + type: string + "404": + description: not found + schema: + type: string + "500": + description: update failed + schema: + type: string + security: + - BearerAuth: [] + - OrgKeyAuth: [] + - OrgSecretAuth: [] + summary: Update node pool (org scoped) + tags: + - NodePools + /node-pools/{id}/annotations: + get: + consumes: + - application/json + operationId: ListNodePoolAnnotations + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + type: string + - description: Node Pool ID (UUID) + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + items: + $ref: '#/definitions/dto.AnnotationResponse' + type: array + "400": + description: invalid id + schema: + type: string + "401": + description: Unauthorized + schema: + type: string + "403": + description: organization required + schema: + type: string + "404": + description: not found + schema: + type: string + "500": + description: fetch failed + schema: + type: string + security: + - BearerAuth: [] + - OrgKeyAuth: [] + - OrgSecretAuth: [] + summary: List annotations attached to a node pool (org scoped) + tags: + - NodePools + post: + consumes: + - application/json + operationId: AttachNodePoolAnnotations + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + type: string + - description: Node Group ID (UUID) + in: path + name: id + required: true + type: string + - description: Annotation IDs to attach + in: body + name: body + required: true + schema: + $ref: '#/definitions/dto.AttachAnnotationsRequest' + produces: + - application/json + responses: + "204": + description: No Content + schema: + type: string + "400": + description: invalid id / invalid server_ids + schema: + type: string + "401": + description: Unauthorized + schema: + type: string + "403": + description: organization required + schema: + type: string + "404": + description: not found + schema: + type: string + "500": + description: attach failed + schema: + type: string + security: + - BearerAuth: [] + - OrgKeyAuth: [] + - OrgSecretAuth: [] + summary: Attach annotation to a node pool (org scoped) + tags: + - NodePools + /node-pools/{id}/annotations/{annotationId}: + delete: + consumes: + - application/json + operationId: DetachNodePoolAnnotation + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + type: string + - description: Node Pool ID (UUID) + in: path + name: id + required: true + type: string + - description: Annotation ID (UUID) + in: path + name: annotationId + required: true + type: string + produces: + - application/json + responses: + "204": + description: No Content + schema: + type: string + "400": + description: invalid id + schema: + type: string + "401": + description: Unauthorized + schema: + type: string + "403": + description: organization required + schema: + type: string + "404": + description: not found + schema: + type: string + "500": + description: detach failed + schema: + type: string + security: + - BearerAuth: [] + - OrgKeyAuth: [] + - OrgSecretAuth: [] + summary: Detach one annotation from a node pool (org scoped) + tags: + - NodePools + /node-pools/{id}/labels: + get: + consumes: + - application/json + operationId: ListNodePoolLabels + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + type: string + - description: Label Pool ID (UUID) + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + items: + $ref: '#/definitions/dto.LabelResponse' + type: array + "400": + description: invalid id + schema: + type: string + "401": + description: Unauthorized + schema: + type: string + "403": + description: organization required + schema: + type: string + "404": + description: not found + schema: + type: string + "500": + description: fetch failed + schema: + type: string + security: + - BearerAuth: [] + - OrgKeyAuth: [] + - OrgSecretAuth: [] + summary: List labels attached to a node pool (org scoped) + tags: + - NodePools + post: + consumes: + - application/json + operationId: AttachNodePoolLabels + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + type: string + - description: Node Pool ID (UUID) + in: path + name: id + required: true + type: string + - description: Label IDs to attach + in: body + name: body + required: true + schema: + $ref: '#/definitions/dto.AttachLabelsRequest' + produces: + - application/json + responses: + "204": + description: No Content + schema: + type: string + "400": + description: invalid id / invalid server_ids + schema: + type: string + "401": + description: Unauthorized + schema: + type: string + "403": + description: organization required + schema: + type: string + "404": + description: not found + schema: + type: string + "500": + description: attach failed + schema: + type: string + security: + - BearerAuth: [] + - OrgKeyAuth: [] + - OrgSecretAuth: [] + summary: Attach labels to a node pool (org scoped) + tags: + - NodePools + /node-pools/{id}/labels/{labelId}: + delete: + consumes: + - application/json + operationId: DetachNodePoolLabel + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + type: string + - description: Node Pool ID (UUID) + in: path + name: id + required: true + type: string + - description: Label ID (UUID) + in: path + name: labelId + required: true + type: string + produces: + - application/json + responses: + "204": + description: No Content + schema: + type: string + "400": + description: invalid id + schema: + type: string + "401": + description: Unauthorized + schema: + type: string + "403": + description: organization required + schema: + type: string + "404": + description: not found + schema: + type: string + "500": + description: detach failed + schema: + type: string + security: + - BearerAuth: [] + - OrgKeyAuth: [] + - OrgSecretAuth: [] + summary: Detach one label from a node pool (org scoped) + tags: + - NodePools + /node-pools/{id}/servers: + get: + consumes: + - application/json + operationId: ListNodePoolServers + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + type: string + - description: Node Pool ID (UUID) + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + items: + $ref: '#/definitions/dto.ServerResponse' + type: array + "400": + description: invalid id + schema: + type: string + "401": + description: Unauthorized + schema: + type: string + "403": + description: organization required + schema: + type: string + "404": + description: not found + schema: + type: string + "500": + description: fetch failed + schema: + type: string + security: + - BearerAuth: [] + - OrgKeyAuth: [] + - OrgSecretAuth: [] + summary: List servers attached to a node pool (org scoped) + tags: + - NodePools + post: + consumes: + - application/json + operationId: AttachNodePoolServers + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + type: string + - description: Node Pool ID (UUID) + in: path + name: id + required: true + type: string + - description: Server IDs to attach + in: body + name: body + required: true + schema: + $ref: '#/definitions/dto.AttachServersRequest' + produces: + - application/json + responses: + "204": + description: No Content + schema: + type: string + "400": + description: invalid id / invalid server_ids + schema: + type: string + "401": + description: Unauthorized + schema: + type: string + "403": + description: organization required + schema: + type: string + "404": + description: not found + schema: + type: string + "500": + description: attach failed + schema: + type: string + security: + - BearerAuth: [] + - OrgKeyAuth: [] + - OrgSecretAuth: [] + summary: Attach servers to a node pool (org scoped) + tags: + - NodePools + /node-pools/{id}/servers/{serverId}: + delete: + consumes: + - application/json + operationId: DetachNodePoolServer + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + type: string + - description: Node Pool ID (UUID) + in: path + name: id + required: true + type: string + - description: Server ID (UUID) + in: path + name: serverId + required: true + type: string + produces: + - application/json + responses: + "204": + description: No Content + schema: + type: string + "400": + description: invalid id + schema: + type: string + "401": + description: Unauthorized + schema: + type: string + "403": + description: organization required + schema: + type: string + "404": + description: not found + schema: + type: string + "500": + description: detach failed + schema: + type: string + security: + - BearerAuth: [] + - OrgKeyAuth: [] + - OrgSecretAuth: [] + summary: Detach one server from a node pool (org scoped) + tags: + - NodePools + /node-pools/{id}/taints: + get: + consumes: + - application/json + operationId: ListNodePoolTaints + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + type: string + - description: Node Pool ID (UUID) + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + items: + $ref: '#/definitions/dto.TaintResponse' + type: array + "400": + description: invalid id + schema: + type: string + "401": + description: Unauthorized + schema: + type: string + "403": + description: organization required + schema: + type: string + "404": + description: not found + schema: + type: string + "500": + description: fetch failed + schema: + type: string + security: + - BearerAuth: [] + - OrgKeyAuth: [] + - OrgSecretAuth: [] + summary: List taints attached to a node pool (org scoped) + tags: + - NodePools + post: + consumes: + - application/json + operationId: AttachNodePoolTaints + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + type: string + - description: Node Pool ID (UUID) + in: path + name: id + required: true + type: string + - description: Taint IDs to attach + in: body + name: body + required: true + schema: + $ref: '#/definitions/dto.AttachTaintsRequest' + produces: + - application/json + responses: + "204": + description: No Content + schema: + type: string + "400": + description: invalid id / invalid taint_ids + schema: + type: string + "401": + description: Unauthorized + schema: + type: string + "403": + description: organization required + schema: + type: string + "404": + description: not found + schema: + type: string + "500": + description: attach failed + schema: + type: string + security: + - BearerAuth: [] + - OrgKeyAuth: [] + - OrgSecretAuth: [] + summary: Attach taints to a node pool (org scoped) + tags: + - NodePools + /node-pools/{id}/taints/{taintId}: + delete: + consumes: + - application/json + operationId: DetachNodePoolTaint + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + type: string + - description: Node Pool ID (UUID) + in: path + name: id + required: true + type: string + - description: Taint ID (UUID) + in: path + name: taintId + required: true + type: string + produces: + - application/json + responses: + "204": + description: No Content + schema: + type: string + "400": + description: invalid id + schema: + type: string + "401": + description: Unauthorized + schema: + type: string + "403": + description: organization required + schema: + type: string + "404": + description: not found + schema: + type: string + "500": + description: detach failed + schema: + type: string + security: + - BearerAuth: [] + - OrgKeyAuth: [] + - OrgSecretAuth: [] + summary: Detach one taint from a node pool (org scoped) + tags: + - NodePools /orgs: get: operationId: listMyOrgs diff --git a/internal/api/routes.go b/internal/api/routes.go index 12d5d5d..eea4ba7 100644 --- a/internal/api/routes.go +++ b/internal/api/routes.go @@ -79,15 +79,17 @@ func NewRouter(db *gorm.DB, jobs *bg.Jobs) http.Handler { a.Post("/logout", handlers.Logout(db)) }) - v1.Route("/admin/archer", func(a chi.Router) { - a.Use(authUser) - a.Use(httpmiddleware.RequirePlatformAdmin()) + v1.Route("/admin", func(admin chi.Router) { + admin.Route("/archer", func(archer chi.Router) { + archer.Use(authUser) + archer.Use(httpmiddleware.RequirePlatformAdmin()) - a.Get("/jobs", handlers.AdminListArcherJobs(db)) - a.Post("/jobs", handlers.AdminEnqueueArcherJob(db, jobs)) - a.Post("/jobs/{id}/retry", handlers.AdminRetryArcherJob(db)) - a.Post("/jobs/{id}/cancel", handlers.AdminCancelArcherJob(db)) - a.Get("/queues", handlers.AdminListArcherQueues(db)) + archer.Get("/jobs", handlers.AdminListArcherJobs(db)) + archer.Post("/jobs", handlers.AdminEnqueueArcherJob(db, jobs)) + archer.Post("/jobs/{id}/retry", handlers.AdminRetryArcherJob(db)) + archer.Post("/jobs/{id}/cancel", handlers.AdminCancelArcherJob(db)) + archer.Get("/queues", handlers.AdminListArcherQueues(db)) + }) }) v1.Route("/me", func(me chi.Router) { @@ -168,6 +170,35 @@ func NewRouter(db *gorm.DB, jobs *bg.Jobs) http.Handler { a.Patch("/{id}", handlers.UpdateAnnotation(db)) a.Delete("/{id}", handlers.DeleteAnnotation(db)) }) + + v1.Route("/node-pools", func(n chi.Router) { + n.Use(authOrg) + n.Get("/", handlers.ListNodePools(db)) + n.Post("/", handlers.CreateNodePool(db)) + n.Get("/{id}", handlers.GetNodePool(db)) + n.Patch("/{id}", handlers.UpdateNodePool(db)) + n.Delete("/{id}", handlers.DeleteNodePool(db)) + + // Servers + n.Get("/{id}/servers", handlers.ListNodePoolServers(db)) + n.Post("/{id}/servers", handlers.AttachNodePoolServers(db)) + n.Delete("/{id}/servers/{serverId}", handlers.DetachNodePoolServer(db)) + + // Taints + n.Get("/{id}/taints", handlers.ListNodePoolTaints(db)) + n.Post("/{id}/taints", handlers.AttachNodePoolTaints(db)) + n.Delete("/{id}/taints/{taintId}", handlers.DetachNodePoolTaint(db)) + + // Labels + n.Get("/{id}/labels", handlers.ListNodePoolLabels(db)) + n.Post("/{id}/labels", handlers.AttachNodePoolLabels(db)) + n.Delete("/{id}/labels/{labelId}", handlers.DetachNodePoolLabel(db)) + + // Annotations + n.Get("/{id}/annotations", handlers.ListNodePoolAnnotations(db)) + n.Post("/{id}/annotations", handlers.AttachNodePoolAnnotations(db)) + n.Delete("/{id}/annotations/{annotationId}", handlers.DetachNodePoolAnnotation(db)) + }) }) }) if config.IsDebug() { diff --git a/internal/app/runtime.go b/internal/app/runtime.go index 0017c26..b1ad10a 100644 --- a/internal/app/runtime.go +++ b/internal/app/runtime.go @@ -38,7 +38,10 @@ func NewRuntime() *Runtime { &models.Taint{}, &models.Label{}, &models.Annotation{}, + &models.NodePool{}, + &models.Cluster{}, ) + if err != nil { log.Fatalf("Error initializing database: %v", err) } diff --git a/internal/bg/bastion.go b/internal/bg/bastion.go index 5c6d76d..972eb16 100644 --- a/internal/bg/bastion.go +++ b/internal/bg/bastion.go @@ -225,19 +225,242 @@ func sshInstallDockerWithOutput(ctx context.Context, host, user string, privateK script := ` set -euxo pipefail -if ! command -v docker >/dev/null 2>&1; then - curl -fsSL https://get.docker.com | sh +# ----------- toggles (set to 0 to skip) ----------- +: "${BASELINE_PKGS:=1}" +: "${INSTALL_DOCKER:=1}" +: "${SSH_HARDEN:=1}" +: "${FIREWALL:=1}" +: "${AUTO_UPDATES:=1}" +: "${TIME_SYNC:=1}" +: "${FAIL2BAN:=1}" +: "${BANNER:=1}" + +# ----------- helpers ----------- +have() { command -v "$1" >/dev/null 2>&1; } + +pm="" +if have apt-get; then pm="apt" +elif have dnf; then pm="dnf" +elif have yum; then pm="yum" +elif have zypper; then pm="zypper" +elif have apk; then pm="apk" fi -# try to enable/start (handles distros with systemd) -if command -v systemctl >/dev/null 2>&1; then - sudo systemctl enable --now docker || true +pm_update_install() { + case "$pm" in + apt) + sudo apt-get update -y + sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends "$@" + ;; + dnf) sudo dnf install -y "$@" ;; + yum) sudo yum install -y "$@" ;; + zypper) sudo zypper --non-interactive install -y "$@" || true ;; + apk) sudo apk add --no-cache "$@" ;; + *) + echo "Unsupported distro: couldn't detect package manager" >&2 + return 1 + ;; + esac +} + +systemd_enable_now() { + if have systemctl; then + sudo systemctl enable --now "$1" || true + fi +} + +sshd_reload() { + if have systemctl && systemctl is-enabled ssh >/dev/null 2>&1; then + sudo systemctl reload ssh || true + elif have systemctl && systemctl is-enabled sshd >/dev/null 2>&1; then + sudo systemctl reload sshd || true + fi +} + +# ----------- baseline packages ----------- +if [ "$BASELINE_PKGS" = "1" ] && [ -n "$pm" ]; then + pkgs_common="curl ca-certificates gnupg git jq unzip tar vim tmux htop net-tools" + case "$pm" in + apt) pkgs="$pkgs_common ufw openssh-client" ;; + dnf|yum) pkgs="$pkgs_common firewalld openssh-clients" ;; + zypper) pkgs="$pkgs_common firewalld openssh" ;; + apk) pkgs="$pkgs_common openssh-client" ;; + esac + pm_update_install $pkgs || true fi -# add current ssh user to docker group if exists -if getent group docker >/dev/null 2>&1; then - sudo usermod -aG docker "$(id -un)" || true +# ----------- docker & compose v2 ----------- +if [ "$INSTALL_DOCKER" = "1" ]; then + if ! have docker; then + curl -fsSL https://get.docker.com | sh + fi + + # try to enable/start (handles distros with systemd) + if have systemctl; then + sudo systemctl enable --now docker || true + fi + + # add current ssh user to docker group if exists + if getent group docker >/dev/null 2>&1; then + sudo usermod -aG docker "$(id -un)" || true + fi + + # docker compose v2 (plugin) if missing + if ! docker compose version >/dev/null 2>&1; then + # Try package first (Debian/Ubuntu name) + if [ "$pm" = "apt" ]; then + sudo apt-get update -y + sudo apt-get install -y docker-compose-plugin || true + fi + + # Fallback: install static plugin binary under ~/.docker/cli-plugins + if ! docker compose version >/dev/null 2>&1; then + mkdir -p ~/.docker/cli-plugins + arch="$(uname -m)" + case "$arch" in + x86_64|amd64) arch="x86_64" ;; + aarch64|arm64) arch="aarch64" ;; + esac + curl -fsSL -o ~/.docker/cli-plugins/docker-compose \ + "https://github.com/docker/compose/releases/download/v2.29.7/docker-compose-$(uname -s)-$arch" + chmod +x ~/.docker/cli-plugins/docker-compose + fi + fi fi + +# ----------- SSH hardening (non-destructive: separate conf file) ----------- +if [ "$SSH_HARDEN" = "1" ]; then + confd="/etc/ssh/sshd_config.d" + if [ -d "$confd" ] && [ -w "$confd" ]; then + sudo tee "$confd/10-bastion.conf" >/dev/null <<'EOF' +# Bastion hardening +PasswordAuthentication no +ChallengeResponseAuthentication no +KbdInteractiveAuthentication no +UsePAM yes +PermitEmptyPasswords no +PubkeyAuthentication yes +ClientAliveInterval 300 +ClientAliveCountMax 2 +LoginGraceTime 20 +MaxAuthTries 3 +MaxSessions 10 +AllowAgentForwarding no +X11Forwarding no +EOF + sshd_reload + else + echo "Skipping SSH hardening: $confd not present or not writable" >&2 + fi + + # lock root password (no effect if already locked) + if have passwd; then + sudo passwd -l root || true + fi +fi + +# ----------- firewall ----------- +if [ "$FIREWALL" = "1" ]; then + if have ufw; then + # Keep it minimal: allow SSH and rate-limit + sudo ufw --force reset || true + sudo ufw default deny incoming + sudo ufw default allow outgoing + sudo ufw allow OpenSSH || sudo ufw allow 22/tcp + sudo ufw limit OpenSSH || true + sudo ufw --force enable + elif have firewall-cmd; then + systemd_enable_now firewalld + sudo firewall-cmd --permanent --add-service=ssh || sudo firewall-cmd --permanent --add-port=22/tcp + sudo firewall-cmd --reload || true + else + echo "No supported firewall tool detected; skipping." >&2 + fi +fi + +# ----------- unattended / automatic updates ----------- +if [ "$AUTO_UPDATES" = "1" ] && [ -n "$pm" ]; then + case "$pm" in + apt) + pm_update_install unattended-upgrades apt-listchanges || true + sudo dpkg-reconfigure -f noninteractive unattended-upgrades || true + sudo tee /etc/apt/apt.conf.d/20auto-upgrades >/dev/null <<'EOF' +APT::Periodic::Update-Package-Lists "1"; +APT::Periodic::Unattended-Upgrade "1"; +APT::Periodic::AutocleanInterval "7"; +EOF + ;; + dnf) + pm_update_install dnf-automatic || true + sudo sed -i 's/^apply_updates = .*/apply_updates = yes/' /etc/dnf/automatic.conf || true + systemd_enable_now dnf-automatic.timer + ;; + yum) + pm_update_install yum-cron || true + sudo sed -i 's/apply_updates = no/apply_updates = yes/' /etc/yum/yum-cron.conf || true + systemd_enable_now yum-cron + ;; + zypper) + pm_update_install pkgconf-pkg-config || true + # SUSE has automatic updates via transactional-update / yast2-online-update; skipping heavy config. + ;; + apk) + # Alpine: no official unattended updater; consider periodic 'apk upgrade' via cron (skipped by default). + ;; + esac +fi + +# ----------- time sync ----------- +if [ "$TIME_SYNC" = "1" ]; then + if have timedatectl; then + # Prefer systemd-timesyncd if available; else install/enable chrony + if [ -f /lib/systemd/system/systemd-timesyncd.service ] || [ -f /usr/lib/systemd/system/systemd-timesyncd.service ]; then + systemd_enable_now systemd-timesyncd + else + pm_update_install chrony || true + systemd_enable_now chronyd || systemd_enable_now chrony || true + fi + timedatectl set-ntp true || true + else + pm_update_install chrony || true + systemd_enable_now chronyd || systemd_enable_now chrony || true + fi +fi + +# ----------- fail2ban (basic sshd jail) ----------- +if [ "$FAIL2BAN" = "1" ]; then + pm_update_install fail2ban || true + if [ -d /etc/fail2ban ]; then + sudo tee /etc/fail2ban/jail.d/sshd.local >/dev/null <<'EOF' +[sshd] +enabled = true +port = ssh +logpath = %(sshd_log)s +maxretry = 4 +bantime = 1h +findtime = 10m +EOF + systemd_enable_now fail2ban + fi +fi + +# ----------- SSH banner / MOTD ----------- +if [ "$BANNER" = "1" ]; then + if [ -w /etc/issue.net ] || sudo test -w /etc/issue.net; then + sudo tee /etc/issue.net >/dev/null <<'EOF' +NOTICE: Authorized use only. Activity may be monitored and reported. +EOF + # Ensure banner is enabled via our bastion conf + if [ -d /etc/ssh/sshd_config.d ]; then + if ! grep -q '^Banner ' /etc/ssh/sshd_config.d/10-bastion.conf 2>/dev/null; then + echo 'Banner /etc/issue.net' | sudo tee -a /etc/ssh/sshd_config.d/10-bastion.conf >/dev/null + sshd_reload + fi + fi + fi +fi + +echo "Bootstrap complete. If you were added to the docker group, log out and back in to apply." ` // Send script via stdin to avoid quoting/escaping issues diff --git a/internal/handlers/dto/node_pools.go b/internal/handlers/dto/node_pools.go new file mode 100644 index 0000000..83bdab0 --- /dev/null +++ b/internal/handlers/dto/node_pools.go @@ -0,0 +1,46 @@ +package dto + +import "github.com/glueops/autoglue/internal/common" + +type NodeRole string + +const ( + NodeRoleMaster NodeRole = "master" + NodeRoleWorker NodeRole = "worker" +) + +type CreateNodePoolRequest struct { + Name string `json:"name"` + Role NodeRole `json:"role" enums:"master,worker" swaggertype:"string"` +} + +type UpdateNodePoolRequest struct { + Name *string `json:"name"` + Role *NodeRole `json:"role" enums:"master,worker" swaggertype:"string"` +} + +type NodePoolResponse struct { + common.AuditFields + Name string `json:"name"` + Role NodeRole `json:"role" enums:"master,worker" swaggertype:"string"` + Servers []ServerResponse `json:"servers"` + Annotations []AnnotationResponse `json:"annotations"` + Labels []LabelResponse `json:"labels"` + Taints []TaintResponse `json:"taints"` +} + +type AttachServersRequest struct { + ServerIDs []string `json:"server_ids"` +} + +type AttachTaintsRequest struct { + TaintIDs []string `json:"taint_ids"` +} + +type AttachLabelsRequest struct { + LabelIDs []string `json:"label_ids"` +} + +type AttachAnnotationsRequest struct { + AnnotationIDs []string `json:"annotation_ids"` +} diff --git a/internal/handlers/dto/servers.go b/internal/handlers/dto/servers.go index fabe44f..dd617b5 100644 --- a/internal/handlers/dto/servers.go +++ b/internal/handlers/dto/servers.go @@ -8,8 +8,8 @@ type CreateServerRequest struct { PrivateIPAddress string `json:"private_ip_address"` SSHUser string `json:"ssh_user"` SshKeyID string `json:"ssh_key_id"` - Role string `json:"role" example:"master|worker|bastion"` - Status string `json:"status,omitempty" example:"pending|provisioning|ready|failed"` + Role string `json:"role" example:"master|worker|bastion" enums:"master,worker,bastion"` + Status string `json:"status,omitempty" example:"pending|provisioning|ready|failed" enums:"pending,provisioning,ready,failed"` } type UpdateServerRequest struct { @@ -18,8 +18,8 @@ type UpdateServerRequest struct { PrivateIPAddress *string `json:"private_ip_address,omitempty"` SSHUser *string `json:"ssh_user,omitempty"` SshKeyID *string `json:"ssh_key_id,omitempty"` - Role *string `json:"role,omitempty" example:"master|worker|bastion"` - Status *string `json:"status,omitempty" example:"pending|provisioning|ready|failed"` + Role *string `json:"role" example:"master|worker|bastion" enums:"master,worker,bastion"` + Status *string `json:"status,omitempty" example:"pending|provisioning|ready|failed" enums:"pending,provisioning,ready,failed"` } type ServerResponse struct { @@ -30,8 +30,8 @@ type ServerResponse struct { PrivateIPAddress string `json:"private_ip_address"` SSHUser string `json:"ssh_user"` SshKeyID uuid.UUID `json:"ssh_key_id"` - Role string `json:"role"` - Status string `json:"status"` + Role string `json:"role" example:"master|worker|bastion" enums:"master,worker,bastion"` + Status string `json:"status,omitempty" example:"pending|provisioning|ready|failed" enums:"pending,provisioning,ready,failed"` CreatedAt string `json:"created_at,omitempty"` UpdatedAt string `json:"updated_at,omitempty"` } diff --git a/internal/handlers/node_pools.go b/internal/handlers/node_pools.go new file mode 100644 index 0000000..180e073 --- /dev/null +++ b/internal/handlers/node_pools.go @@ -0,0 +1,1270 @@ +package handlers + +import ( + "encoding/json" + "errors" + "net/http" + "strings" + "time" + + "github.com/glueops/autoglue/internal/api/httpmiddleware" + "github.com/glueops/autoglue/internal/common" + "github.com/glueops/autoglue/internal/handlers/dto" + "github.com/glueops/autoglue/internal/models" + "github.com/glueops/autoglue/internal/utils" + "github.com/go-chi/chi/v5" + "github.com/google/uuid" + "gorm.io/gorm" +) + +// -- Node Pools Core + +// ListNodePools godoc +// +// @ID ListNodePools +// @Summary List node pools (org scoped) +// @Description Returns node pools for the organization in X-Org-ID. +// @Tags NodePools +// @Accept json +// @Produce json +// @Param X-Org-ID header string false "Organization UUID" +// @Param q query string false "Name contains (case-insensitive)" +// @Success 200 {array} dto.NodePoolResponse +// @Failure 401 {string} string "Unauthorized" +// @Failure 403 {string} string "organization required" +// @Failure 500 {string} string "failed to list node pools" +// @Router /node-pools [get] +// @Security BearerAuth +// @Security OrgKeyAuth +// @Security OrgSecretAuth +func ListNodePools(db *gorm.DB) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + orgID, ok := httpmiddleware.OrgIDFrom(r.Context()) + if !ok { + utils.WriteError(w, http.StatusForbidden, "org_required", "specify X-Org-ID") + return + } + + q := db.Where("organization_id = ?", orgID) + if needle := strings.TrimSpace(r.URL.Query().Get("q")); needle != "" { + q = q.Where("name LIKE ?", "%"+needle+"%") + } + + var pools []models.NodePool + if err := q. + Preload("Servers"). + Preload("Labels"). + Preload("Taints"). + Preload("Annotations"). + Order("created_at DESC"). + Find(&pools).Error; err != nil { + utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error") + return + } + + out := make([]dto.NodePoolResponse, 0, len(pools)) + for _, p := range pools { + npr := dto.NodePoolResponse{ + AuditFields: p.AuditFields, + Name: p.Name, + Role: dto.NodeRole(p.Role), + Servers: make([]dto.ServerResponse, 0, len(p.Servers)), + Labels: make([]dto.LabelResponse, 0, len(p.Labels)), + Taints: make([]dto.TaintResponse, 0, len(p.Taints)), + Annotations: make([]dto.AnnotationResponse, 0, len(p.Annotations)), + } + //Servers + for _, s := range p.Servers { + outSrv := dto.ServerResponse{ + ID: s.ID, + Hostname: s.Hostname, + PublicIPAddress: s.PublicIPAddress, + PrivateIPAddress: s.PrivateIPAddress, + OrganizationID: s.OrganizationID, + SshKeyID: s.SshKeyID, + SSHUser: s.SSHUser, + Role: s.Role, + Status: s.Status, + CreatedAt: s.CreatedAt.UTC().Format(time.RFC3339), + UpdatedAt: s.UpdatedAt.UTC().Format(time.RFC3339), + // add more fields as needed + } + npr.Servers = append(npr.Servers, outSrv) + } + //Labels + for _, l := range p.Labels { + outL := dto.LabelResponse{ + AuditFields: common.AuditFields{ + ID: l.ID, + OrganizationID: l.OrganizationID, + CreatedAt: l.CreatedAt, + UpdatedAt: l.UpdatedAt, + }, + Key: l.Key, + Value: l.Value, + } + npr.Labels = append(npr.Labels, outL) + } + // Taints + for _, t := range p.Taints { + outT := dto.TaintResponse{ + ID: t.ID, + OrganizationID: t.OrganizationID, + CreatedAt: t.CreatedAt.UTC().Format(time.RFC3339), + UpdatedAt: t.UpdatedAt.UTC().Format(time.RFC3339), + Key: t.Key, + Value: t.Value, + Effect: t.Effect, + } + npr.Taints = append(npr.Taints, outT) + } + // Annotations + for _, a := range p.Annotations { + outA := dto.AnnotationResponse{ + AuditFields: common.AuditFields{ + ID: a.ID, + OrganizationID: a.OrganizationID, + CreatedAt: a.CreatedAt, + UpdatedAt: a.UpdatedAt, + }, + Key: a.Key, + Value: a.Value, + } + npr.Annotations = append(npr.Annotations, outA) + } + + out = append(out, npr) + } + utils.WriteJSON(w, http.StatusOK, out) + } +} + +// GetNodePool godoc +// +// @ID GetNodePool +// @Summary Get node pool by ID (org scoped) +// @Description Returns one node pool. Add `include=servers` to include servers. +// @Tags NodePools +// @Accept json +// @Produce json +// @Param X-Org-ID header string false "Organization UUID" +// @Param id path string true "Node Pool ID (UUID)" +// @Success 200 {object} dto.NodePoolResponse +// @Failure 400 {string} string "invalid id" +// @Failure 401 {string} string "Unauthorized" +// @Failure 403 {string} string "organization required" +// @Failure 404 {string} string "not found" +// @Failure 500 {string} string "fetch failed" +// @Router /node-pools/{id} [get] +// @Security BearerAuth +// @Security OrgKeyAuth +// @Security OrgSecretAuth +func GetNodePool(db *gorm.DB) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + orgID, ok := httpmiddleware.OrgIDFrom(r.Context()) + if !ok { + utils.WriteError(w, http.StatusForbidden, "org_required", "specify X-Org-ID") + return + } + + id, err := uuid.Parse(chi.URLParam(r, "id")) + if err != nil { + utils.WriteError(w, http.StatusBadRequest, "id_required", "id required") + return + } + + var out dto.NodePoolResponse + if err := db.Model(&models.NodePool{}).Preload("Servers").Where("id = ? AND organization_id = ?", id, orgID).First(&out, id).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + utils.WriteError(w, http.StatusNotFound, "node_pool_not_found", "node pool not found") + return + } + utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error") + return + } + utils.WriteJSON(w, http.StatusOK, out) + } +} + +// CreateNodePool godoc +// +// @ID CreateNodePool +// @Summary Create node pool (org scoped) +// @Description Creates a node pool. Optionally attach initial servers. +// @Tags NodePools +// @Accept json +// @Produce json +// @Param X-Org-ID header string false "Organization UUID" +// @Param body body dto.CreateNodePoolRequest true "NodePool payload" +// @Success 201 {object} dto.NodePoolResponse +// @Failure 400 {string} string "invalid json / missing fields / invalid server_ids" +// @Failure 401 {string} string "Unauthorized" +// @Failure 403 {string} string "organization required" +// @Failure 500 {string} string "create failed" +// @Router /node-pools [post] +// @Security BearerAuth +// @Security OrgKeyAuth +// @Security OrgSecretAuth +func CreateNodePool(db *gorm.DB) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + orgID, ok := httpmiddleware.OrgIDFrom(r.Context()) + if !ok { + utils.WriteError(w, http.StatusForbidden, "org_required", "specify X-Org-ID") + return + } + + var req dto.CreateNodePoolRequest + if err := json.NewDecoder(r.Body).Decode(&req); err != nil { + utils.WriteError(w, http.StatusBadRequest, "bad_request", "bad request") + return + } + + req.Name = strings.TrimSpace(req.Name) + req.Role = dto.NodeRole(strings.TrimSpace(string(req.Role))) + + if req.Name == "" || req.Role == "" { + utils.WriteError(w, http.StatusBadRequest, "bad_request", "missing name/role") + return + } + + n := models.NodePool{ + AuditFields: common.AuditFields{ + OrganizationID: orgID, + }, + Name: req.Name, + Role: string(req.Role), + } + + if err := db.Create(&n).Error; err != nil { + utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error") + return + } + + out := dto.NodePoolResponse{ + AuditFields: n.AuditFields, + Name: n.Name, + Role: dto.NodeRole(n.Role), + } + utils.WriteJSON(w, http.StatusCreated, out) + } +} + +// UpdateNodePool godoc +// +// @ID UpdateNodePool +// @Summary Update node pool (org scoped) +// @Description Partially update node pool fields. +// @Tags NodePools +// @Accept json +// @Produce json +// @Param X-Org-ID header string false "Organization UUID" +// @Param id path string true "Node Pool ID (UUID)" +// @Param body body dto.UpdateNodePoolRequest true "Fields to update" +// @Success 200 {object} dto.NodePoolResponse +// @Failure 400 {string} string "invalid id / invalid json" +// @Failure 401 {string} string "Unauthorized" +// @Failure 403 {string} string "organization required" +// @Failure 404 {string} string "not found" +// @Failure 500 {string} string "update failed" +// @Router /node-pools/{id} [patch] +// @Security BearerAuth +// @Security OrgKeyAuth +// @Security OrgSecretAuth +func UpdateNodePool(db *gorm.DB) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + orgID, ok := httpmiddleware.OrgIDFrom(r.Context()) + if !ok { + utils.WriteError(w, http.StatusForbidden, "org_required", "specify X-Org-ID") + return + } + + id, err := uuid.Parse(chi.URLParam(r, "id")) + if err != nil { + utils.WriteError(w, http.StatusBadRequest, "id_required", "id required") + return + } + + var n models.NodePool + if err := db.Where("id = ? AND organization_id = ?", id, orgID).First(&n).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + utils.WriteError(w, http.StatusNotFound, "node_pool_not_found", "node pool not found") + return + } + utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error") + return + } + + var req dto.UpdateNodePoolRequest + if err := json.NewDecoder(r.Body).Decode(&req); err != nil { + utils.WriteError(w, http.StatusBadRequest, "bad_request", "bad request") + return + } + + if req.Name != nil { + n.Name = strings.TrimSpace(*req.Name) + } + if req.Role != nil { + v := dto.NodeRole(strings.TrimSpace(string(*req.Role))) + n.Role = string(v) + } + + if err := db.Save(&n).Error; err != nil { + utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error") + return + } + out := dto.NodePoolResponse{ + AuditFields: n.AuditFields, + Name: n.Name, + Role: dto.NodeRole(n.Role), + } + utils.WriteJSON(w, http.StatusOK, out) + } +} + +// DeleteNodePool godoc +// +// @ID DeleteNodePool +// @Summary Delete node pool (org scoped) +// @Description Permanently deletes the node pool. +// @Tags NodePools +// @Accept json +// @Produce json +// @Param X-Org-ID header string false "Organization UUID" +// @Param id path string true "Node Pool ID (UUID)" +// @Success 204 {string} string "No Content" +// @Failure 400 {string} string "invalid id" +// @Failure 401 {string} string "Unauthorized" +// @Failure 403 {string} string "organization required" +// @Failure 500 {string} string "delete failed" +// @Router /node-pools/{id} [delete] +// @Security BearerAuth +// @Security OrgKeyAuth +// @Security OrgSecretAuth +func DeleteNodePool(db *gorm.DB) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + orgID, ok := httpmiddleware.OrgIDFrom(r.Context()) + if !ok { + utils.WriteError(w, http.StatusForbidden, "org_required", "specify X-Org-ID") + return + } + + id, err := uuid.Parse(chi.URLParam(r, "id")) + if err != nil { + utils.WriteError(w, http.StatusBadRequest, "id_required", "id required") + return + } + + if err := db.Where("id = ? AND organization_id = ?", id, orgID).Delete(&models.NodePool{}).Error; err != nil { + utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error") + return + } + w.WriteHeader(http.StatusNoContent) + } +} + +// -- Node Pools Servers + +// ListNodePoolServers godoc +// +// @ID ListNodePoolServers +// @Summary List servers attached to a node pool (org scoped) +// @Tags NodePools +// @Accept json +// @Produce json +// @Param X-Org-ID header string false "Organization UUID" +// @Param id path string true "Node Pool ID (UUID)" +// @Success 200 {array} dto.ServerResponse +// @Failure 400 {string} string "invalid id" +// @Failure 401 {string} string "Unauthorized" +// @Failure 403 {string} string "organization required" +// @Failure 404 {string} string "not found" +// @Failure 500 {string} string "fetch failed" +// @Router /node-pools/{id}/servers [get] +// @Security BearerAuth +// @Security OrgKeyAuth +// @Security OrgSecretAuth +func ListNodePoolServers(db *gorm.DB) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + orgID, ok := httpmiddleware.OrgIDFrom(r.Context()) + if !ok { + utils.WriteError(w, http.StatusForbidden, "org_required", "specify X-Org-ID") + return + } + + id, err := uuid.Parse(chi.URLParam(r, "id")) + if err != nil { + utils.WriteError(w, http.StatusBadRequest, "id_required", "id required") + return + } + + var np models.NodePool + if err := db.Where("id = ? AND organization_id = ?", id, orgID).Preload("Servers").First(&np).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + utils.WriteError(w, http.StatusNotFound, "node_pool_not_found", "node pool not found") + return + } + utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error") + return + } + + out := make([]dto.ServerResponse, 0, len(np.Servers)) + for _, server := range np.Servers { + out = append(out, dto.ServerResponse{ + ID: server.ID, + OrganizationID: server.OrganizationID, + Hostname: server.Hostname, + PrivateIPAddress: server.PrivateIPAddress, + PublicIPAddress: server.PublicIPAddress, + Role: server.Role, + SshKeyID: server.SshKeyID, + SSHUser: server.SSHUser, + Status: server.Status, + CreatedAt: server.CreatedAt.UTC().Format(time.RFC3339), + UpdatedAt: server.UpdatedAt.UTC().Format(time.RFC3339), + }) + } + utils.WriteJSON(w, http.StatusOK, out) + } +} + +// AttachNodePoolServers godoc +// +// @ID AttachNodePoolServers +// @Summary Attach servers to a node pool (org scoped) +// @Tags NodePools +// @Accept json +// @Produce json +// @Param X-Org-ID header string false "Organization UUID" +// @Param id path string true "Node Pool ID (UUID)" +// @Param body body dto.AttachServersRequest true "Server IDs to attach" +// @Success 204 {string} string "No Content" +// @Failure 400 {string} string "invalid id / invalid server_ids" +// @Failure 401 {string} string "Unauthorized" +// @Failure 403 {string} string "organization required" +// @Failure 404 {string} string "not found" +// @Failure 500 {string} string "attach failed" +// @Router /node-pools/{id}/servers [post] +// @Security BearerAuth +// @Security OrgKeyAuth +// @Security OrgSecretAuth +func AttachNodePoolServers(db *gorm.DB) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + orgID, ok := httpmiddleware.OrgIDFrom(r.Context()) + if !ok { + utils.WriteError(w, http.StatusForbidden, "org_required", "specify X-Org-ID") + return + } + + id, err := uuid.Parse(chi.URLParam(r, "id")) + if err != nil { + utils.WriteError(w, http.StatusBadRequest, "id_required", "id required") + return + } + + var np models.NodePool + if err := db.Where("id = ? AND organization_id = ?", id, orgID).First(&np).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + utils.WriteError(w, http.StatusNotFound, "node_pool_not_found", "node pool not found") + return + } + utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error") + return + } + + var req dto.AttachServersRequest + if err := json.NewDecoder(r.Body).Decode(&req); err != nil { + utils.WriteError(w, http.StatusBadRequest, "bad_request", "bad request") + return + } + + ids, err := parseUUIDs(req.ServerIDs) + if err != nil { + utils.WriteError(w, http.StatusBadRequest, "bad_request", "invalid server_ids") + return + } + + if len(ids) == 0 { + // nothing to attach + utils.WriteError(w, http.StatusBadRequest, "bad_request", "nothing to attach") + return + } + + // validate IDs belong to org + if err := ensureServersBelongToOrg(orgID, ids, db); err != nil { + utils.WriteError(w, http.StatusBadRequest, "bad_request", "invalid server_ids for this organization") + return + } + + // fetch only the requested servers + var servers []models.Server + if err := db.Where("organization_id = ? AND id IN ?", orgID, ids).Find(&servers).Error; err != nil { + utils.WriteError(w, http.StatusInternalServerError, "db_error", "attach db error") + return + } + + if len(servers) == 0 { + w.WriteHeader(http.StatusNoContent) + return + } + + if err := db.Model(&np).Association("Servers").Append(&servers); err != nil { + utils.WriteError(w, http.StatusInternalServerError, "db_error", "attach failed") + return + } + + w.WriteHeader(http.StatusNoContent) + } +} + +// DetachNodePoolServer godoc +// +// @ID DetachNodePoolServer +// @Summary Detach one server from a node pool (org scoped) +// @Tags NodePools +// @Accept json +// @Produce json +// @Param X-Org-ID header string false "Organization UUID" +// @Param id path string true "Node Pool ID (UUID)" +// @Param serverId path string true "Server ID (UUID)" +// @Success 204 {string} string "No Content" +// @Failure 400 {string} string "invalid id" +// @Failure 401 {string} string "Unauthorized" +// @Failure 403 {string} string "organization required" +// @Failure 404 {string} string "not found" +// @Failure 500 {string} string "detach failed" +// @Router /node-pools/{id}/servers/{serverId} [delete] +// @Security BearerAuth +// @Security OrgKeyAuth +// @Security OrgSecretAuth +func DetachNodePoolServer(db *gorm.DB) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + orgID, ok := httpmiddleware.OrgIDFrom(r.Context()) + if !ok { + utils.WriteError(w, http.StatusForbidden, "org_required", "specify X-Org-ID") + return + } + id, err := uuid.Parse(chi.URLParam(r, "id")) + if err != nil { + utils.WriteError(w, http.StatusBadRequest, "id_required", "node pool id required") + return + } + serverId, err := uuid.Parse(chi.URLParam(r, "serverId")) + if err != nil { + utils.WriteError(w, http.StatusBadRequest, "id_required", "server id required") + return + } + var np models.NodePool + if err := db.Where("id = ? AND organization_id = ?", id, orgID).First(&np).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + utils.WriteError(w, http.StatusNotFound, "node_pool_not_found", "node pool not found") + return + } + utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error") + return + } + + var s models.Server + if err := db.Where("id = ? AND organization_id = ?", serverId, orgID).First(&s).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + utils.WriteError(w, http.StatusNotFound, "server_not_found", "server not found") + return + } + utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error") + return + } + + if err := db.Model(&np).Association("Servers").Delete(&s); err != nil { + utils.WriteError(w, http.StatusInternalServerError, "db_error", "detach error") + return + } + w.WriteHeader(http.StatusNoContent) + } +} + +// -- Node Pools Taints + +// ListNodePoolTaints godoc +// +// @ID ListNodePoolTaints +// @Summary List taints attached to a node pool (org scoped) +// @Tags NodePools +// @Accept json +// @Produce json +// @Param X-Org-ID header string false "Organization UUID" +// @Param id path string true "Node Pool ID (UUID)" +// @Success 200 {array} dto.TaintResponse +// @Failure 400 {string} string "invalid id" +// @Failure 401 {string} string "Unauthorized" +// @Failure 403 {string} string "organization required" +// @Failure 404 {string} string "not found" +// @Failure 500 {string} string "fetch failed" +// @Router /node-pools/{id}/taints [get] +// @Security BearerAuth +// @Security OrgKeyAuth +// @Security OrgSecretAuth +func ListNodePoolTaints(db *gorm.DB) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + orgID, ok := httpmiddleware.OrgIDFrom(r.Context()) + if !ok { + utils.WriteError(w, http.StatusForbidden, "org_required", "specify X-Org-ID") + return + } + + id, err := uuid.Parse(chi.URLParam(r, "id")) + if err != nil { + utils.WriteError(w, http.StatusBadRequest, "id_required", "node pool id required") + return + } + + var np models.NodePool + if err := db.Where("id = ? AND organization_id = ?", id, orgID).Preload("Taints").First(&np).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + utils.WriteError(w, http.StatusNotFound, "node_pool_not_found", "node pool not found") + return + } + utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error") + return + } + + out := make([]dto.TaintResponse, 0, len(np.Taints)) + for _, t := range np.Taints { + out = append(out, dto.TaintResponse{ + ID: t.ID, + Key: t.Key, + Value: t.Value, + Effect: t.Effect, + }) + } + utils.WriteJSON(w, http.StatusOK, out) + } +} + +// AttachNodePoolTaints godoc +// +// @ID AttachNodePoolTaints +// @Summary Attach taints to a node pool (org scoped) +// @Tags NodePools +// @Accept json +// @Produce json +// @Param X-Org-ID header string false "Organization UUID" +// @Param id path string true "Node Pool ID (UUID)" +// @Param body body dto.AttachTaintsRequest true "Taint IDs to attach" +// @Success 204 {string} string "No Content" +// @Failure 400 {string} string "invalid id / invalid taint_ids" +// @Failure 401 {string} string "Unauthorized" +// @Failure 403 {string} string "organization required" +// @Failure 404 {string} string "not found" +// @Failure 500 {string} string "attach failed" +// @Router /node-pools/{id}/taints [post] +// @Security BearerAuth +// @Security OrgKeyAuth +// @Security OrgSecretAuth +func AttachNodePoolTaints(db *gorm.DB) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + orgID, ok := httpmiddleware.OrgIDFrom(r.Context()) + if !ok { + utils.WriteError(w, http.StatusForbidden, "org_required", "specify X-Org-ID") + return + } + + id, err := uuid.Parse(chi.URLParam(r, "id")) + if err != nil { + utils.WriteError(w, http.StatusBadRequest, "id_required", "node pool id required") + return + } + + var np models.NodePool + if err := db.Where("id = ? AND organization_id = ?", id, orgID).First(&np).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + utils.WriteError(w, http.StatusNotFound, "node_pool_not_found", "node pool not found") + return + } + utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error") + return + } + + var req dto.AttachTaintsRequest + if err := json.NewDecoder(r.Body).Decode(&req); err != nil { + utils.WriteError(w, http.StatusBadRequest, "bad_request", "bad request") + return + } + + ids, err := parseUUIDs(req.TaintIDs) + if err != nil { + utils.WriteError(w, http.StatusBadRequest, "bad_request", "invalid taint_ids") + return + } + + if len(ids) == 0 { + utils.WriteError(w, http.StatusBadRequest, "bad_request", "nothing to attach") + return + } + + // validate IDs belong to org + if err := ensureTaintsBelongToOrg(orgID, ids, db); err != nil { + utils.WriteError(w, http.StatusBadRequest, "bad_request", "invalid taint_ids for this organization") + return + } + + var taints []models.Taint + if err := db.Where("organization_id = ? AND id IN ?", orgID, ids).Find(&taints).Error; err != nil { + utils.WriteError(w, http.StatusInternalServerError, "db_error", "attach db error") + return + } + + if len(taints) == 0 { + w.WriteHeader(http.StatusNoContent) + return + } + + if err := db.Model(&np).Association("Taints").Append(&taints); err != nil { + utils.WriteError(w, http.StatusInternalServerError, "db_error", "attach db error") + return + } + w.WriteHeader(http.StatusNoContent) + } +} + +// DetachNodePoolTaint godoc +// +// @ID DetachNodePoolTaint +// @Summary Detach one taint from a node pool (org scoped) +// @Tags NodePools +// @Accept json +// @Produce json +// @Param X-Org-ID header string false "Organization UUID" +// @Param id path string true "Node Pool ID (UUID)" +// @Param taintId path string true "Taint ID (UUID)" +// @Success 204 {string} string "No Content" +// @Failure 400 {string} string "invalid id" +// @Failure 401 {string} string "Unauthorized" +// @Failure 403 {string} string "organization required" +// @Failure 404 {string} string "not found" +// @Failure 500 {string} string "detach failed" +// @Router /node-pools/{id}/taints/{taintId} [delete] +// @Security BearerAuth +// @Security OrgKeyAuth +// @Security OrgSecretAuth +func DetachNodePoolTaint(db *gorm.DB) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + orgID, ok := httpmiddleware.OrgIDFrom(r.Context()) + if !ok { + utils.WriteError(w, http.StatusForbidden, "org_required", "specify X-Org-ID") + return + } + id, err := uuid.Parse(chi.URLParam(r, "id")) + if err != nil { + utils.WriteError(w, http.StatusBadRequest, "id_required", "node pool id required") + return + } + taintId, err := uuid.Parse(chi.URLParam(r, "taintId")) + if err != nil { + utils.WriteError(w, http.StatusBadRequest, "taintId_required", "taint id required") + return + } + + var np models.NodePool + if err := db.Where("id = ? AND organization_id = ?", id, orgID).First(&np).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + utils.WriteError(w, http.StatusNotFound, "node_pool_not_found", "node pool not found") + return + } + utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error") + return + } + + var t models.Taint + if err := db.Where("id = ? AND organization_id = ?", taintId, orgID).First(&t).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + utils.WriteError(w, http.StatusNotFound, "taint_not_found", "taint not found") + return + } + utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error") + return + } + + if err := db.Model(&np).Association("Taints").Delete(&t); err != nil { + utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error") + return + } + w.WriteHeader(http.StatusNoContent) + } +} + +// -- Node Pools Labels + +// ListNodePoolLabels godoc +// +// @ID ListNodePoolLabels +// @Summary List labels attached to a node pool (org scoped) +// @Tags NodePools +// @Accept json +// @Produce json +// @Param X-Org-ID header string false "Organization UUID" +// @Param id path string true "Label Pool ID (UUID)" +// @Success 200 {array} dto.LabelResponse +// @Failure 400 {string} string "invalid id" +// @Failure 401 {string} string "Unauthorized" +// @Failure 403 {string} string "organization required" +// @Failure 404 {string} string "not found" +// @Failure 500 {string} string "fetch failed" +// @Router /node-pools/{id}/labels [get] +// @Security BearerAuth +// @Security OrgKeyAuth +// @Security OrgSecretAuth +func ListNodePoolLabels(db *gorm.DB) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + orgID, ok := httpmiddleware.OrgIDFrom(r.Context()) + if !ok { + utils.WriteError(w, http.StatusForbidden, "org_required", "specify X-Org-ID") + return + } + id, err := uuid.Parse(chi.URLParam(r, "id")) + if err != nil { + utils.WriteError(w, http.StatusBadRequest, "id_required", "node pool id required") + return + } + + var np models.NodePool + if err := db.Where("id = ? AND organization_id = ?", id, orgID).Preload("Labels").First(&np).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + utils.WriteError(w, http.StatusNotFound, "node_pool_not_found", "node pool not found") + return + } + utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error") + return + } + + out := make([]dto.LabelResponse, 0, len(np.Taints)) + for _, taint := range np.Taints { + out = append(out, dto.LabelResponse{ + AuditFields: common.AuditFields{ + ID: taint.ID, + OrganizationID: taint.OrganizationID, + CreatedAt: taint.CreatedAt, + UpdatedAt: taint.UpdatedAt, + }, + Key: taint.Key, + Value: taint.Value, + }) + } + utils.WriteJSON(w, http.StatusOK, out) + } +} + +// AttachNodePoolLabels godoc +// +// @ID AttachNodePoolLabels +// @Summary Attach labels to a node pool (org scoped) +// @Tags NodePools +// @Accept json +// @Produce json +// @Param X-Org-ID header string false "Organization UUID" +// @Param id path string true "Node Pool ID (UUID)" +// @Param body body dto.AttachLabelsRequest true "Label IDs to attach" +// @Success 204 {string} string "No Content" +// @Failure 400 {string} string "invalid id / invalid server_ids" +// @Failure 401 {string} string "Unauthorized" +// @Failure 403 {string} string "organization required" +// @Failure 404 {string} string "not found" +// @Failure 500 {string} string "attach failed" +// @Router /node-pools/{id}/labels [post] +// @Security BearerAuth +// @Security OrgKeyAuth +// @Security OrgSecretAuth +func AttachNodePoolLabels(db *gorm.DB) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + orgID, ok := httpmiddleware.OrgIDFrom(r.Context()) + if !ok { + utils.WriteError(w, http.StatusForbidden, "org_required", "specify X-Org-ID") + return + } + id, err := uuid.Parse(chi.URLParam(r, "id")) + if err != nil { + utils.WriteError(w, http.StatusBadRequest, "id_required", "node pool id required") + return + } + + var np models.NodePool + if err := db.Where("id = ? AND organization_id = ?", id, orgID).First(&np).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + utils.WriteError(w, http.StatusNotFound, "node_pool_not_found", "node pool not found") + return + } + utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error") + return + } + + var req dto.AttachLabelsRequest + if err := json.NewDecoder(r.Body).Decode(&req); err != nil { + utils.WriteError(w, http.StatusBadRequest, "bad_request", "bad request") + return + } + + ids, err := parseUUIDs(req.LabelIDs) + if err != nil { + utils.WriteError(w, http.StatusBadRequest, "bad_request", "invalid label_ids") + return + } + + if len(ids) == 0 { + utils.WriteError(w, http.StatusBadRequest, "bad_request", "nothing to attach") + return + } + + if err := ensureLabelsBelongToOrg(orgID, ids, db); err != nil { + utils.WriteError(w, http.StatusBadRequest, "bad_request", "invalid label_ids for this organization") + } + + var labels []models.Label + if err := db.Where("organization_id = ? AND id IN ?", orgID, ids).Find(&labels).Error; err != nil { + utils.WriteError(w, http.StatusInternalServerError, "db_error", "attach db error") + return + } + + if len(labels) == 0 { + w.WriteHeader(http.StatusNoContent) + return + } + + if err := db.Model(&np).Association("Labels").Append(&labels); err != nil { + utils.WriteError(w, http.StatusInternalServerError, "db_error", "attach failed") + return + } + w.WriteHeader(http.StatusNoContent) + } +} + +// DetachNodePoolLabel godoc +// +// @ID DetachNodePoolLabel +// @Summary Detach one label from a node pool (org scoped) +// @Tags NodePools +// @Accept json +// @Produce json +// @Param X-Org-ID header string false "Organization UUID" +// @Param id path string true "Node Pool ID (UUID)" +// @Param labelId path string true "Label ID (UUID)" +// @Success 204 {string} string "No Content" +// @Failure 400 {string} string "invalid id" +// @Failure 401 {string} string "Unauthorized" +// @Failure 403 {string} string "organization required" +// @Failure 404 {string} string "not found" +// @Failure 500 {string} string "detach failed" +// @Router /node-pools/{id}/labels/{labelId} [delete] +// @Security BearerAuth +// @Security OrgKeyAuth +// @Security OrgSecretAuth +func DetachNodePoolLabel(db *gorm.DB) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + orgID, ok := httpmiddleware.OrgIDFrom(r.Context()) + if !ok { + utils.WriteError(w, http.StatusForbidden, "org_required", "specify X-Org-ID") + return + } + id, err := uuid.Parse(chi.URLParam(r, "id")) + if err != nil { + utils.WriteError(w, http.StatusBadRequest, "id_required", "node pool id required") + return + } + labelId, err := uuid.Parse(chi.URLParam(r, "labelId")) + if err != nil { + utils.WriteError(w, http.StatusBadRequest, "id_required", "labelId required") + return + } + + var np models.NodePool + if err := db.Where("id = ? AND organization_id = ?", id, orgID).First(&np).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + utils.WriteError(w, http.StatusNotFound, "node_pool_not_found", "node pool not found") + return + } + utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error") + return + } + + var l models.Label + if err := db.Where("id = ? AND organization_id = ?", labelId, orgID).First(&l).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + utils.WriteError(w, http.StatusNotFound, "label_not_found", "label not found") + return + } + utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error") + return + } + + if err := db.Model(&np).Association("Labels").Delete(&l); err != nil { + utils.WriteError(w, http.StatusInternalServerError, "db_error", "detach error") + return + } + w.WriteHeader(http.StatusNoContent) + } +} + +// -- Node Pools Annotations + +// ListNodePoolAnnotations godoc +// +// @ID ListNodePoolAnnotations +// @Summary List annotations attached to a node pool (org scoped) +// @Tags NodePools +// @Accept json +// @Produce json +// @Param X-Org-ID header string false "Organization UUID" +// @Param id path string true "Node Pool ID (UUID)" +// @Success 200 {array} dto.AnnotationResponse +// @Failure 400 {string} string "invalid id" +// @Failure 401 {string} string "Unauthorized" +// @Failure 403 {string} string "organization required" +// @Failure 404 {string} string "not found" +// @Failure 500 {string} string "fetch failed" +// @Router /node-pools/{id}/annotations [get] +// @Security BearerAuth +// @Security OrgKeyAuth +// @Security OrgSecretAuth +func ListNodePoolAnnotations(db *gorm.DB) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + orgID, ok := httpmiddleware.OrgIDFrom(r.Context()) + if !ok { + utils.WriteError(w, http.StatusForbidden, "org_required", "specify X-Org-ID") + return + } + id, err := uuid.Parse(chi.URLParam(r, "id")) + if err != nil { + utils.WriteError(w, http.StatusBadRequest, "id_required", "node pool id required") + return + } + + var np models.NodePool + if err := db.Where("id = ? AND organization_id = ?", id, orgID).Preload("Labels").First(&np).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + utils.WriteError(w, http.StatusNotFound, "node_pool_not_found", "node pool not found") + return + } + utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error") + return + } + + out := make([]dto.AnnotationResponse, 0, len(np.Annotations)) + for _, ann := range np.Annotations { + out = append(out, dto.AnnotationResponse{ + AuditFields: common.AuditFields{ + ID: ann.ID, + OrganizationID: ann.OrganizationID, + CreatedAt: ann.CreatedAt, + UpdatedAt: ann.UpdatedAt, + }, + Key: ann.Key, + Value: ann.Value, + }) + } + utils.WriteJSON(w, http.StatusOK, out) + } +} + +// AttachNodePoolAnnotations godoc +// +// @ID AttachNodePoolAnnotations +// @Summary Attach annotation to a node pool (org scoped) +// @Tags NodePools +// @Accept json +// @Produce json +// @Param X-Org-ID header string false "Organization UUID" +// @Param id path string true "Node Group ID (UUID)" +// @Param body body dto.AttachAnnotationsRequest true "Annotation IDs to attach" +// @Success 204 {string} string "No Content" +// @Failure 400 {string} string "invalid id / invalid server_ids" +// @Failure 401 {string} string "Unauthorized" +// @Failure 403 {string} string "organization required" +// @Failure 404 {string} string "not found" +// @Failure 500 {string} string "attach failed" +// @Router /node-pools/{id}/annotations [post] +// @Security BearerAuth +// @Security OrgKeyAuth +// @Security OrgSecretAuth +func AttachNodePoolAnnotations(db *gorm.DB) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + orgID, ok := httpmiddleware.OrgIDFrom(r.Context()) + if !ok { + utils.WriteError(w, http.StatusForbidden, "org_required", "specify X-Org-ID") + return + } + id, err := uuid.Parse(chi.URLParam(r, "id")) + if err != nil { + utils.WriteError(w, http.StatusBadRequest, "id_required", "node pool id required") + return + } + + var np models.NodePool + if err := db.Where("id = ? AND organization_id = ?", id, orgID).First(&np).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + utils.WriteError(w, http.StatusNotFound, "node_pool_not_found", "node pool not found") + return + } + utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error") + return + } + + var req dto.AttachAnnotationsRequest + if err := json.NewDecoder(r.Body).Decode(&req); err != nil { + utils.WriteError(w, http.StatusBadRequest, "bad_request", "bad request") + return + } + + ids, err := parseUUIDs(req.AnnotationIDs) + if err != nil { + utils.WriteError(w, http.StatusBadRequest, "bad_request", "invalid annotation ids") + return + } + + if len(ids) == 0 { + utils.WriteError(w, http.StatusBadRequest, "bad_request", "nothing to attach") + return + } + + if err := ensureAnnotaionsBelongToOrg(orgID, ids, db); err != nil { + utils.WriteError(w, http.StatusBadRequest, "bad_request", "invalid annotation ids for this organization") + return + } + + var ann []models.Annotation + if err := db.Where("organization_id = ? AND id IN ?", orgID, ids).Find(&ann).Error; err != nil { + utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error") + return + } + + if len(ann) == 0 { + w.WriteHeader(http.StatusNoContent) + return + } + + if err := db.Model(&np).Association("Annotations").Append(&ann); err != nil { + utils.WriteError(w, http.StatusInternalServerError, "db_error", "attach failed") + return + } + w.WriteHeader(http.StatusNoContent) + } +} + +// DetachNodePoolAnnotation godoc +// +// @ID DetachNodePoolAnnotation +// @Summary Detach one annotation from a node pool (org scoped) +// @Tags NodePools +// @Accept json +// @Produce json +// @Param X-Org-ID header string false "Organization UUID" +// @Param id path string true "Node Pool ID (UUID)" +// @Param annotationId path string true "Annotation ID (UUID)" +// @Success 204 {string} string "No Content" +// @Failure 400 {string} string "invalid id" +// @Failure 401 {string} string "Unauthorized" +// @Failure 403 {string} string "organization required" +// @Failure 404 {string} string "not found" +// @Failure 500 {string} string "detach failed" +// @Router /node-pools/{id}/annotations/{annotationId} [delete] +// @Security BearerAuth +// @Security OrgKeyAuth +// @Security OrgSecretAuth +func DetachNodePoolAnnotation(db *gorm.DB) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + orgID, ok := httpmiddleware.OrgIDFrom(r.Context()) + if !ok { + utils.WriteError(w, http.StatusForbidden, "org_required", "specify X-Org-ID") + return + } + id, err := uuid.Parse(chi.URLParam(r, "id")) + if err != nil { + utils.WriteError(w, http.StatusBadRequest, "id_required", "node pool id required") + return + } + annotationId, err := uuid.Parse(chi.URLParam(r, "annotationId")) + if err != nil { + utils.WriteError(w, http.StatusBadRequest, "id_required", "node pool annotation id required") + return + } + + var np models.NodePool + if err := db.Where("id = ? AND organization_id = ?", id, orgID).First(&np).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + utils.WriteError(w, http.StatusNotFound, "node_pool_not_found", "node pool not found") + return + } + utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error") + return + } + + var ann []models.Annotation + if err := db.Where("id = ? AND organization_id = ?", annotationId, orgID).First(&ann).Error; err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + utils.WriteError(w, http.StatusNotFound, "annotation_not_found", "annotation not found") + return + } + utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error") + return + } + + if err := db.Model(&np).Association("Annotations").Delete(&ann); err != nil { + utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error") + return + } + w.WriteHeader(http.StatusNoContent) + } +} + +// -- Helpers +func parseUUIDs(ids []string) ([]uuid.UUID, error) { + out := make([]uuid.UUID, 0, len(ids)) + for _, id := range ids { + u, err := uuid.Parse(id) + if err != nil { + return nil, err + } + out = append(out, u) + } + return out, nil +} + +func ensureServersBelongToOrg(orgID uuid.UUID, ids []uuid.UUID, db *gorm.DB) error { + var count int64 + if err := db.Model(&models.Server{}).Where("organization_id = ? AND id IN ?", orgID, ids).Count(&count).Error; err != nil { + return err + } + if count != int64(len(ids)) { + return errors.New("some servers do not belong to this org") + } + return nil +} + +func ensureTaintsBelongToOrg(orgID uuid.UUID, ids []uuid.UUID, db *gorm.DB) error { + var count int64 + if err := db.Model(&models.Taint{}).Where("organization_id = ? AND id IN ?", orgID, ids).Count(&count).Error; err != nil { + return err + } + if count != int64(len(ids)) { + return errors.New("some taints do not belong to this org") + } + return nil +} + +func ensureLabelsBelongToOrg(orgID uuid.UUID, ids []uuid.UUID, db *gorm.DB) error { + var count int64 + if err := db.Model(&models.Label{}).Where("organization_id = ? AND id IN ?", orgID, ids).Count(&count).Error; err != nil { + return err + } + if count != int64(len(ids)) { + return errors.New("some labels do not belong to this org") + } + return nil +} + +func ensureAnnotaionsBelongToOrg(orgID uuid.UUID, ids []uuid.UUID, db *gorm.DB) error { + var count int64 + if err := db.Model(&models.Annotation{}).Where("organization_id = ? AND id IN ?", orgID, ids).Count(&count).Error; err != nil { + return err + } + if count != int64(len(ids)) { + return errors.New("some annotations do not belong to this org") + } + return nil +} diff --git a/internal/handlers/ssh_keys.go b/internal/handlers/ssh_keys.go index 799c874..72e5615 100644 --- a/internal/handlers/ssh_keys.go +++ b/internal/handlers/ssh_keys.go @@ -382,7 +382,6 @@ func DownloadSSHKey(db *gorm.DB) http.HandlerFunc { } if mode == "json" { - prefix := keyFilenamePrefix(key.PublicKey) resp := dto.SshMaterialJSON{ ID: key.ID.String(), Name: key.Name, @@ -392,7 +391,7 @@ func DownloadSSHKey(db *gorm.DB) http.HandlerFunc { case "public": pub := key.PublicKey resp.PublicKey = &pub - resp.Filenames = []string{fmt.Sprintf("%s_%s.pub", prefix, key.ID.String())} + resp.Filenames = []string{fmt.Sprintf("%s.pub", key.ID.String())} utils.WriteJSON(w, http.StatusOK, resp) return @@ -403,7 +402,7 @@ func DownloadSSHKey(db *gorm.DB) http.HandlerFunc { return } resp.PrivatePEM = &plain - resp.Filenames = []string{fmt.Sprintf("%s_%s.pem", prefix, key.ID.String())} + resp.Filenames = []string{fmt.Sprintf("%s.pem", key.ID.String())} utils.WriteJSON(w, http.StatusOK, resp) return @@ -416,16 +415,16 @@ func DownloadSSHKey(db *gorm.DB) http.HandlerFunc { var buf bytes.Buffer zw := zip.NewWriter(&buf) - _ = toZipFile(fmt.Sprintf("%s_%s.pem", prefix, key.ID.String()), []byte(plain), zw) - _ = toZipFile(fmt.Sprintf("%s_%s.pub", prefix, key.ID.String()), []byte(key.PublicKey), zw) + _ = toZipFile(fmt.Sprintf("%s.pem", key.ID.String()), []byte(plain), zw) + _ = toZipFile(fmt.Sprintf("%s.pub", key.ID.String()), []byte(key.PublicKey), zw) _ = zw.Close() b64 := utils.EncodeB64(buf.Bytes()) resp.ZipBase64 = &b64 resp.Filenames = []string{ - fmt.Sprintf("%s_%s.zip", prefix, key.ID.String()), - fmt.Sprintf("%s_%s.pem", prefix, key.ID.String()), - fmt.Sprintf("%s_%s.pub", prefix, key.ID.String()), + fmt.Sprintf("%s.zip", key.ID.String()), + fmt.Sprintf("%s.pem", key.ID.String()), + fmt.Sprintf("%s.pub", key.ID.String()), } utils.WriteJSON(w, http.StatusOK, resp) return @@ -436,11 +435,9 @@ func DownloadSSHKey(db *gorm.DB) http.HandlerFunc { } } - prefix := keyFilenamePrefix(key.PublicKey) - switch part { case "public": - filename := fmt.Sprintf("%s_%s.pub", prefix, key.ID.String()) + filename := fmt.Sprintf("%s.pub", key.ID.String()) w.Header().Set("Content-Type", "text/plain") w.Header().Set("Content-Disposition", fmt.Sprintf(`attachment; filename="%s"`, filename)) _, _ = w.Write([]byte(key.PublicKey)) @@ -452,7 +449,7 @@ func DownloadSSHKey(db *gorm.DB) http.HandlerFunc { utils.WriteError(w, http.StatusInternalServerError, "db_error", "failed to decrypt ssh key") return } - filename := fmt.Sprintf("%s_%s.pem", prefix, key.ID.String()) + filename := fmt.Sprintf("%s.pem", key.ID.String()) w.Header().Set("Content-Type", "application/x-pem-file") w.Header().Set("Content-Disposition", fmt.Sprintf(`attachment; filename="%s"`, filename)) _, _ = w.Write([]byte(plain)) @@ -467,8 +464,8 @@ func DownloadSSHKey(db *gorm.DB) http.HandlerFunc { var buf bytes.Buffer zw := zip.NewWriter(&buf) - _ = toZipFile(fmt.Sprintf("%s_%s.pem", prefix, key.ID.String()), []byte(plain), zw) - _ = toZipFile(fmt.Sprintf("%s_%s.pub", prefix, key.ID.String()), []byte(key.PublicKey), zw) + _ = toZipFile(fmt.Sprintf("%s.pem", key.ID.String()), []byte(plain), zw) + _ = toZipFile(fmt.Sprintf("%s.pub", key.ID.String()), []byte(key.PublicKey), zw) _ = zw.Close() filename := fmt.Sprintf("ssh_key_%s.zip", key.ID.String()) diff --git a/internal/models/annotation.go b/internal/models/annotation.go index 3f9cc38..df3f5da 100644 --- a/internal/models/annotation.go +++ b/internal/models/annotation.go @@ -9,4 +9,5 @@ type Annotation struct { Organization Organization `gorm:"foreignKey:OrganizationID;constraint:OnDelete:CASCADE" json:"organization"` Key string `gorm:"not null" json:"key"` Value string `gorm:"not null" json:"value"` + NodePools []NodePool `gorm:"many2many:node_annotations;constraint:OnDelete:CASCADE" json:"node_pools,omitempty"` } diff --git a/internal/models/cluster.go b/internal/models/cluster.go new file mode 100644 index 0000000..c19f0b4 --- /dev/null +++ b/internal/models/cluster.go @@ -0,0 +1,29 @@ +package models + +import ( + "time" + + "github.com/google/uuid" +) + +type Cluster struct { + ID uuid.UUID `gorm:"type:uuid;default:gen_random_uuid();primaryKey" json:"id"` + OrganizationID uuid.UUID `gorm:"type:uuid;not null" json:"organization_id"` + Organization Organization `gorm:"foreignKey:OrganizationID;constraint:OnDelete:CASCADE" json:"organization"` + Name string `gorm:"not null" json:"name"` + Provider string `json:"provider"` + Region string `json:"region"` + Status string `json:"status"` + CaptainDomain string `gorm:"not null" json:"captain_domain"` + ClusterLoadBalancer string `json:"cluster_load_balancer"` + RandomToken string `json:"random_token"` + CertificateKey string `json:"certificate_key"` + EncryptedKubeconfig string `gorm:"type:text" json:"-"` + KubeIV string `json:"-"` + KubeTag string `json:"-"` + NodePools []NodePool `gorm:"many2many:cluster_node_pools;constraint:OnDelete:CASCADE" json:"node_pools,omitempty"` + BastionServerID *uuid.UUID `gorm:"type:uuid" json:"bastion_server_id,omitempty"` + BastionServer *Server `gorm:"foreignKey:BastionServerID" json:"bastion_server,omitempty"` + CreatedAt time.Time `json:"created_at,omitempty" gorm:"type:timestamptz;column:created_at;not null;default:now()"` + UpdatedAt time.Time `json:"updated_at,omitempty" gorm:"type:timestamptz;autoUpdateTime;column:updated_at;not null;default:now()"` +} diff --git a/internal/models/label.go b/internal/models/label.go index 41fc06b..17a4a80 100644 --- a/internal/models/label.go +++ b/internal/models/label.go @@ -9,5 +9,5 @@ type Label struct { Organization Organization `gorm:"foreignKey:OrganizationID;constraint:OnDelete:CASCADE" json:"organization"` Key string `gorm:"not null" json:"key"` Value string `gorm:"not null" json:"value"` - NodePools []NodePool `gorm:"many2many:node_labels;constraint:OnDelete:CASCADE" json:"servers,omitempty"` + NodePools []NodePool `gorm:"many2many:node_labels;constraint:OnDelete:CASCADE" json:"node_pools,omitempty"` } diff --git a/internal/models/node_pool.go b/internal/models/node_pool.go index 9238d3f..b4aab42 100644 --- a/internal/models/node_pool.go +++ b/internal/models/node_pool.go @@ -1,23 +1,18 @@ package models import ( - "time" - - "github.com/google/uuid" + "github.com/glueops/autoglue/internal/common" ) type NodePool struct { - ID uuid.UUID `gorm:"type:uuid;primaryKey;default:gen_random_uuid()" json:"id"` - OrganizationID uuid.UUID `gorm:"type:uuid;not null" json:"organization_id"` - Organization Organization `gorm:"foreignKey:OrganizationID;constraint:OnDelete:CASCADE" json:"organization"` - Name string `gorm:"not null" json:"name"` - Servers []Server `gorm:"many2many:node_servers;constraint:OnDelete:CASCADE" json:"servers,omitempty"` - Annotations []Annotation `gorm:"many2many:node_annotations;constraint:OnDelete:CASCADE" json:"annotations,omitempty"` - Labels []Label `gorm:"many2many:node_labels;constraint:OnDelete:CASCADE" json:"labels,omitempty"` - Taints []Taint `gorm:"many2many:node_taints;constraint:OnDelete:CASCADE" json:"taints,omitempty"` + common.AuditFields + Organization Organization `gorm:"foreignKey:OrganizationID;constraint:OnDelete:CASCADE" json:"organization"` + Name string `gorm:"not null" json:"name"` + Servers []Server `gorm:"many2many:node_servers;constraint:OnDelete:CASCADE" json:"servers,omitempty"` + Annotations []Annotation `gorm:"many2many:node_annotations;constraint:OnDelete:CASCADE" json:"annotations,omitempty"` + Labels []Label `gorm:"many2many:node_labels;constraint:OnDelete:CASCADE" json:"labels,omitempty"` + Taints []Taint `gorm:"many2many:node_taints;constraint:OnDelete:CASCADE" json:"taints,omitempty"` //Clusters []Cluster `gorm:"many2many:cluster_node_pools;constraint:OnDelete:CASCADE" json:"clusters,omitempty"` //Topology string `gorm:"not null,default:'stacked'" json:"topology,omitempty"` // stacked or external - Role string `gorm:"not null,default:'worker'" json:"role,omitempty"` // master, worker, or etcd (etcd only if topology = external - CreatedAt time.Time `gorm:"not null;default:now()" json:"created_at" format:"date-time"` - UpdatedAt time.Time `gorm:"not null;default:now()" json:"updated_at" format:"date-time"` + Role string `gorm:"not null,default:'worker'" json:"role,omitempty"` // master, worker, or etcd (etcd only if topology = external } diff --git a/internal/models/server.go b/internal/models/server.go index ce5c3fd..a42e840 100644 --- a/internal/models/server.go +++ b/internal/models/server.go @@ -19,8 +19,9 @@ type Server struct { SSHUser string `gorm:"not null" json:"ssh_user"` SshKeyID uuid.UUID `gorm:"type:uuid;not null" json:"ssh_key_id"` SshKey SshKey `gorm:"foreignKey:SshKeyID" json:"ssh_key"` - Role string `gorm:"not null" json:"role"` // e.g., "master", "worker", "bastion" - Status string `gorm:"default:'pending'" json:"status"` // pending, provisioning, ready, failed + Role string `gorm:"not null" json:"role" enums:"master,worker,bastion"` // e.g., "master", "worker", "bastion" + Status string `gorm:"default:'pending'" json:"status" enums:"pending, provisioning, ready, failed"` // pending, provisioning, ready, failed + NodePools []NodePool `gorm:"many2many:node_servers;constraint:OnDelete:CASCADE" json:"node_pools,omitempty"` CreatedAt time.Time `gorm:"not null;default:now()" json:"created_at" format:"date-time"` UpdatedAt time.Time `gorm:"not null;default:now()" json:"updated_at" format:"date-time"` } diff --git a/sdk/go/.openapi-generator/FILES b/sdk/go/.openapi-generator/FILES index 1edc0f0..98bc56b 100644 --- a/sdk/go/.openapi-generator/FILES +++ b/sdk/go/.openapi-generator/FILES @@ -10,6 +10,7 @@ api_health.go api_labels.go api_me.go api_me_api_keys.go +api_node_pools.go api_orgs.go api_servers.go api_ssh.go @@ -20,9 +21,14 @@ docs/AnnotationsAPI.md docs/ArcherAdminAPI.md docs/AuthAPI.md docs/DtoAnnotationResponse.md +docs/DtoAttachAnnotationsRequest.md +docs/DtoAttachLabelsRequest.md +docs/DtoAttachServersRequest.md +docs/DtoAttachTaintsRequest.md docs/DtoAuthStartResponse.md docs/DtoCreateAnnotationRequest.md docs/DtoCreateLabelRequest.md +docs/DtoCreateNodePoolRequest.md docs/DtoCreateSSHRequest.md docs/DtoCreateServerRequest.md docs/DtoCreateTaintRequest.md @@ -32,6 +38,7 @@ docs/DtoJob.md docs/DtoJobStatus.md docs/DtoLabelResponse.md docs/DtoLogoutRequest.md +docs/DtoNodePoolResponse.md docs/DtoPageJob.md docs/DtoQueueInfo.md docs/DtoRefreshRequest.md @@ -42,6 +49,7 @@ docs/DtoTaintResponse.md docs/DtoTokenPair.md docs/DtoUpdateAnnotationRequest.md docs/DtoUpdateLabelRequest.md +docs/DtoUpdateNodePoolRequest.md docs/DtoUpdateServerRequest.md docs/DtoUpdateTaintRequest.md docs/HandlersCreateUserKeyRequest.md @@ -63,6 +71,7 @@ docs/ModelsAPIKey.md docs/ModelsOrganization.md docs/ModelsUser.md docs/ModelsUserEmail.md +docs/NodePoolsAPI.md docs/OrgsAPI.md docs/ServersAPI.md docs/SshAPI.md @@ -72,9 +81,14 @@ git_push.sh go.mod go.sum model_dto_annotation_response.go +model_dto_attach_annotations_request.go +model_dto_attach_labels_request.go +model_dto_attach_servers_request.go +model_dto_attach_taints_request.go model_dto_auth_start_response.go model_dto_create_annotation_request.go model_dto_create_label_request.go +model_dto_create_node_pool_request.go model_dto_create_server_request.go model_dto_create_ssh_request.go model_dto_create_taint_request.go @@ -84,6 +98,7 @@ model_dto_jwk.go model_dto_jwks.go model_dto_label_response.go model_dto_logout_request.go +model_dto_node_pool_response.go model_dto_page_job.go model_dto_queue_info.go model_dto_refresh_request.go @@ -94,6 +109,7 @@ model_dto_taint_response.go model_dto_token_pair.go model_dto_update_annotation_request.go model_dto_update_label_request.go +model_dto_update_node_pool_request.go model_dto_update_server_request.go model_dto_update_taint_request.go model_handlers_create_user_key_request.go @@ -120,6 +136,7 @@ test/api_health_test.go test/api_labels_test.go test/api_me_api_keys_test.go test/api_me_test.go +test/api_node_pools_test.go test/api_orgs_test.go test/api_servers_test.go test/api_ssh_test.go diff --git a/sdk/go/README.md b/sdk/go/README.md index 7951cdc..9ecfe4d 100644 --- a/sdk/go/README.md +++ b/sdk/go/README.md @@ -74,7 +74,7 @@ ctx = context.WithValue(context.Background(), autoglue.ContextOperationServerVar ## Documentation for API Endpoints -All URIs are relative to *http://localhost:8080/api/v1* +All URIs are relative to */api/v1* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- @@ -104,6 +104,23 @@ Class | Method | HTTP request | Description *MeAPIKeysAPI* | [**CreateUserAPIKey**](docs/MeAPIKeysAPI.md#createuserapikey) | **Post** /me/api-keys | Create a new user API key *MeAPIKeysAPI* | [**DeleteUserAPIKey**](docs/MeAPIKeysAPI.md#deleteuserapikey) | **Delete** /me/api-keys/{id} | Delete a user API key *MeAPIKeysAPI* | [**ListUserAPIKeys**](docs/MeAPIKeysAPI.md#listuserapikeys) | **Get** /me/api-keys | List my API keys +*NodePoolsAPI* | [**AttachNodePoolAnnotations**](docs/NodePoolsAPI.md#attachnodepoolannotations) | **Post** /node-pools/{id}/annotations | Attach annotation to a node pool (org scoped) +*NodePoolsAPI* | [**AttachNodePoolLabels**](docs/NodePoolsAPI.md#attachnodepoollabels) | **Post** /node-pools/{id}/labels | Attach labels to a node pool (org scoped) +*NodePoolsAPI* | [**AttachNodePoolServers**](docs/NodePoolsAPI.md#attachnodepoolservers) | **Post** /node-pools/{id}/servers | Attach servers to a node pool (org scoped) +*NodePoolsAPI* | [**AttachNodePoolTaints**](docs/NodePoolsAPI.md#attachnodepooltaints) | **Post** /node-pools/{id}/taints | Attach taints to a node pool (org scoped) +*NodePoolsAPI* | [**CreateNodePool**](docs/NodePoolsAPI.md#createnodepool) | **Post** /node-pools | Create node pool (org scoped) +*NodePoolsAPI* | [**DeleteNodePool**](docs/NodePoolsAPI.md#deletenodepool) | **Delete** /node-pools/{id} | Delete node pool (org scoped) +*NodePoolsAPI* | [**DetachNodePoolAnnotation**](docs/NodePoolsAPI.md#detachnodepoolannotation) | **Delete** /node-pools/{id}/annotations/{annotationId} | Detach one annotation from a node pool (org scoped) +*NodePoolsAPI* | [**DetachNodePoolLabel**](docs/NodePoolsAPI.md#detachnodepoollabel) | **Delete** /node-pools/{id}/labels/{labelId} | Detach one label from a node pool (org scoped) +*NodePoolsAPI* | [**DetachNodePoolServer**](docs/NodePoolsAPI.md#detachnodepoolserver) | **Delete** /node-pools/{id}/servers/{serverId} | Detach one server from a node pool (org scoped) +*NodePoolsAPI* | [**DetachNodePoolTaint**](docs/NodePoolsAPI.md#detachnodepooltaint) | **Delete** /node-pools/{id}/taints/{taintId} | Detach one taint from a node pool (org scoped) +*NodePoolsAPI* | [**GetNodePool**](docs/NodePoolsAPI.md#getnodepool) | **Get** /node-pools/{id} | Get node pool by ID (org scoped) +*NodePoolsAPI* | [**ListNodePoolAnnotations**](docs/NodePoolsAPI.md#listnodepoolannotations) | **Get** /node-pools/{id}/annotations | List annotations attached to a node pool (org scoped) +*NodePoolsAPI* | [**ListNodePoolLabels**](docs/NodePoolsAPI.md#listnodepoollabels) | **Get** /node-pools/{id}/labels | List labels attached to a node pool (org scoped) +*NodePoolsAPI* | [**ListNodePoolServers**](docs/NodePoolsAPI.md#listnodepoolservers) | **Get** /node-pools/{id}/servers | List servers attached to a node pool (org scoped) +*NodePoolsAPI* | [**ListNodePoolTaints**](docs/NodePoolsAPI.md#listnodepooltaints) | **Get** /node-pools/{id}/taints | List taints attached to a node pool (org scoped) +*NodePoolsAPI* | [**ListNodePools**](docs/NodePoolsAPI.md#listnodepools) | **Get** /node-pools | List node pools (org scoped) +*NodePoolsAPI* | [**UpdateNodePool**](docs/NodePoolsAPI.md#updatenodepool) | **Patch** /node-pools/{id} | Update node pool (org scoped) *OrgsAPI* | [**AddOrUpdateMember**](docs/OrgsAPI.md#addorupdatemember) | **Post** /orgs/{id}/members | Add or update a member (owner/admin) *OrgsAPI* | [**CreateOrg**](docs/OrgsAPI.md#createorg) | **Post** /orgs | Create organization *OrgsAPI* | [**CreateOrgKey**](docs/OrgsAPI.md#createorgkey) | **Post** /orgs/{id}/api-keys | Create org key/secret pair (owner/admin) @@ -135,9 +152,14 @@ Class | Method | HTTP request | Description ## Documentation For Models - [DtoAnnotationResponse](docs/DtoAnnotationResponse.md) + - [DtoAttachAnnotationsRequest](docs/DtoAttachAnnotationsRequest.md) + - [DtoAttachLabelsRequest](docs/DtoAttachLabelsRequest.md) + - [DtoAttachServersRequest](docs/DtoAttachServersRequest.md) + - [DtoAttachTaintsRequest](docs/DtoAttachTaintsRequest.md) - [DtoAuthStartResponse](docs/DtoAuthStartResponse.md) - [DtoCreateAnnotationRequest](docs/DtoCreateAnnotationRequest.md) - [DtoCreateLabelRequest](docs/DtoCreateLabelRequest.md) + - [DtoCreateNodePoolRequest](docs/DtoCreateNodePoolRequest.md) - [DtoCreateSSHRequest](docs/DtoCreateSSHRequest.md) - [DtoCreateServerRequest](docs/DtoCreateServerRequest.md) - [DtoCreateTaintRequest](docs/DtoCreateTaintRequest.md) @@ -147,6 +169,7 @@ Class | Method | HTTP request | Description - [DtoJobStatus](docs/DtoJobStatus.md) - [DtoLabelResponse](docs/DtoLabelResponse.md) - [DtoLogoutRequest](docs/DtoLogoutRequest.md) + - [DtoNodePoolResponse](docs/DtoNodePoolResponse.md) - [DtoPageJob](docs/DtoPageJob.md) - [DtoQueueInfo](docs/DtoQueueInfo.md) - [DtoRefreshRequest](docs/DtoRefreshRequest.md) @@ -157,6 +180,7 @@ Class | Method | HTTP request | Description - [DtoTokenPair](docs/DtoTokenPair.md) - [DtoUpdateAnnotationRequest](docs/DtoUpdateAnnotationRequest.md) - [DtoUpdateLabelRequest](docs/DtoUpdateLabelRequest.md) + - [DtoUpdateNodePoolRequest](docs/DtoUpdateNodePoolRequest.md) - [DtoUpdateServerRequest](docs/DtoUpdateServerRequest.md) - [DtoUpdateTaintRequest](docs/DtoUpdateTaintRequest.md) - [HandlersCreateUserKeyRequest](docs/HandlersCreateUserKeyRequest.md) diff --git a/sdk/go/api/openapi.yaml b/sdk/go/api/openapi.yaml index f2c1cae..0ec435c 100644 --- a/sdk/go/api/openapi.yaml +++ b/sdk/go/api/openapi.yaml @@ -6,8 +6,7 @@ info: title: AutoGlue API version: "1.0" servers: -- url: http://localhost:8080/api/v1 -- url: https://localhost:8080/api/v1 +- url: /api/v1 paths: /.well-known/jwks.json: get: @@ -1063,6 +1062,1058 @@ paths: summary: Delete a user API key tags: - MeAPIKeys + /node-pools: + get: + description: Returns node pools for the organization in X-Org-ID. + operationId: ListNodePools + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + schema: + type: string + - description: Name contains (case-insensitive) + in: query + name: q + schema: + type: string + responses: + "200": + content: + application/json: + schema: + items: + $ref: "#/components/schemas/dto.NodePoolResponse" + type: array + description: OK + "401": + content: + application/json: + schema: + type: string + description: Unauthorized + "403": + content: + application/json: + schema: + type: string + description: organization required + "500": + content: + application/json: + schema: + type: string + description: failed to list node pools + security: + - BearerAuth: [] + - OrgKeyAuth: [] + - OrgSecretAuth: [] + summary: List node pools (org scoped) + tags: + - NodePools + post: + description: Creates a node pool. Optionally attach initial servers. + operationId: CreateNodePool + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/dto.CreateNodePoolRequest" + description: NodePool payload + required: true + responses: + "201": + content: + application/json: + schema: + $ref: "#/components/schemas/dto.NodePoolResponse" + description: Created + "400": + content: + application/json: + schema: + type: string + description: invalid json / missing fields / invalid server_ids + "401": + content: + application/json: + schema: + type: string + description: Unauthorized + "403": + content: + application/json: + schema: + type: string + description: organization required + "500": + content: + application/json: + schema: + type: string + description: create failed + security: + - BearerAuth: [] + - OrgKeyAuth: [] + - OrgSecretAuth: [] + summary: Create node pool (org scoped) + tags: + - NodePools + x-codegen-request-body-name: body + /node-pools/{id}: + delete: + description: Permanently deletes the node pool. + operationId: DeleteNodePool + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + schema: + type: string + - description: Node Pool ID (UUID) + in: path + name: id + required: true + schema: + type: string + responses: + "204": + content: + application/json: + schema: + type: string + description: No Content + "400": + content: + application/json: + schema: + type: string + description: invalid id + "401": + content: + application/json: + schema: + type: string + description: Unauthorized + "403": + content: + application/json: + schema: + type: string + description: organization required + "500": + content: + application/json: + schema: + type: string + description: delete failed + security: + - BearerAuth: [] + - OrgKeyAuth: [] + - OrgSecretAuth: [] + summary: Delete node pool (org scoped) + tags: + - NodePools + get: + description: Returns one node pool. Add `include=servers` to include servers. + operationId: GetNodePool + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + schema: + type: string + - description: Node Pool ID (UUID) + in: path + name: id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/dto.NodePoolResponse" + description: OK + "400": + content: + application/json: + schema: + type: string + description: invalid id + "401": + content: + application/json: + schema: + type: string + description: Unauthorized + "403": + content: + application/json: + schema: + type: string + description: organization required + "404": + content: + application/json: + schema: + type: string + description: not found + "500": + content: + application/json: + schema: + type: string + description: fetch failed + security: + - BearerAuth: [] + - OrgKeyAuth: [] + - OrgSecretAuth: [] + summary: Get node pool by ID (org scoped) + tags: + - NodePools + patch: + description: Partially update node pool fields. + operationId: UpdateNodePool + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + schema: + type: string + - description: Node Pool ID (UUID) + in: path + name: id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/dto.UpdateNodePoolRequest" + description: Fields to update + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/dto.NodePoolResponse" + description: OK + "400": + content: + application/json: + schema: + type: string + description: invalid id / invalid json + "401": + content: + application/json: + schema: + type: string + description: Unauthorized + "403": + content: + application/json: + schema: + type: string + description: organization required + "404": + content: + application/json: + schema: + type: string + description: not found + "500": + content: + application/json: + schema: + type: string + description: update failed + security: + - BearerAuth: [] + - OrgKeyAuth: [] + - OrgSecretAuth: [] + summary: Update node pool (org scoped) + tags: + - NodePools + x-codegen-request-body-name: body + /node-pools/{id}/annotations: + get: + operationId: ListNodePoolAnnotations + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + schema: + type: string + - description: Node Pool ID (UUID) + in: path + name: id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + schema: + items: + $ref: "#/components/schemas/dto.AnnotationResponse" + type: array + description: OK + "400": + content: + application/json: + schema: + type: string + description: invalid id + "401": + content: + application/json: + schema: + type: string + description: Unauthorized + "403": + content: + application/json: + schema: + type: string + description: organization required + "404": + content: + application/json: + schema: + type: string + description: not found + "500": + content: + application/json: + schema: + type: string + description: fetch failed + security: + - BearerAuth: [] + - OrgKeyAuth: [] + - OrgSecretAuth: [] + summary: List annotations attached to a node pool (org scoped) + tags: + - NodePools + post: + operationId: AttachNodePoolAnnotations + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + schema: + type: string + - description: Node Group ID (UUID) + in: path + name: id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/dto.AttachAnnotationsRequest" + description: Annotation IDs to attach + required: true + responses: + "204": + content: + application/json: + schema: + type: string + description: No Content + "400": + content: + application/json: + schema: + type: string + description: invalid id / invalid server_ids + "401": + content: + application/json: + schema: + type: string + description: Unauthorized + "403": + content: + application/json: + schema: + type: string + description: organization required + "404": + content: + application/json: + schema: + type: string + description: not found + "500": + content: + application/json: + schema: + type: string + description: attach failed + security: + - BearerAuth: [] + - OrgKeyAuth: [] + - OrgSecretAuth: [] + summary: Attach annotation to a node pool (org scoped) + tags: + - NodePools + x-codegen-request-body-name: body + /node-pools/{id}/annotations/{annotationId}: + delete: + operationId: DetachNodePoolAnnotation + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + schema: + type: string + - description: Node Pool ID (UUID) + in: path + name: id + required: true + schema: + type: string + - description: Annotation ID (UUID) + in: path + name: annotationId + required: true + schema: + type: string + responses: + "204": + content: + application/json: + schema: + type: string + description: No Content + "400": + content: + application/json: + schema: + type: string + description: invalid id + "401": + content: + application/json: + schema: + type: string + description: Unauthorized + "403": + content: + application/json: + schema: + type: string + description: organization required + "404": + content: + application/json: + schema: + type: string + description: not found + "500": + content: + application/json: + schema: + type: string + description: detach failed + security: + - BearerAuth: [] + - OrgKeyAuth: [] + - OrgSecretAuth: [] + summary: Detach one annotation from a node pool (org scoped) + tags: + - NodePools + /node-pools/{id}/labels: + get: + operationId: ListNodePoolLabels + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + schema: + type: string + - description: Label Pool ID (UUID) + in: path + name: id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + schema: + items: + $ref: "#/components/schemas/dto.LabelResponse" + type: array + description: OK + "400": + content: + application/json: + schema: + type: string + description: invalid id + "401": + content: + application/json: + schema: + type: string + description: Unauthorized + "403": + content: + application/json: + schema: + type: string + description: organization required + "404": + content: + application/json: + schema: + type: string + description: not found + "500": + content: + application/json: + schema: + type: string + description: fetch failed + security: + - BearerAuth: [] + - OrgKeyAuth: [] + - OrgSecretAuth: [] + summary: List labels attached to a node pool (org scoped) + tags: + - NodePools + post: + operationId: AttachNodePoolLabels + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + schema: + type: string + - description: Node Pool ID (UUID) + in: path + name: id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/dto.AttachLabelsRequest" + description: Label IDs to attach + required: true + responses: + "204": + content: + application/json: + schema: + type: string + description: No Content + "400": + content: + application/json: + schema: + type: string + description: invalid id / invalid server_ids + "401": + content: + application/json: + schema: + type: string + description: Unauthorized + "403": + content: + application/json: + schema: + type: string + description: organization required + "404": + content: + application/json: + schema: + type: string + description: not found + "500": + content: + application/json: + schema: + type: string + description: attach failed + security: + - BearerAuth: [] + - OrgKeyAuth: [] + - OrgSecretAuth: [] + summary: Attach labels to a node pool (org scoped) + tags: + - NodePools + x-codegen-request-body-name: body + /node-pools/{id}/labels/{labelId}: + delete: + operationId: DetachNodePoolLabel + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + schema: + type: string + - description: Node Pool ID (UUID) + in: path + name: id + required: true + schema: + type: string + - description: Label ID (UUID) + in: path + name: labelId + required: true + schema: + type: string + responses: + "204": + content: + application/json: + schema: + type: string + description: No Content + "400": + content: + application/json: + schema: + type: string + description: invalid id + "401": + content: + application/json: + schema: + type: string + description: Unauthorized + "403": + content: + application/json: + schema: + type: string + description: organization required + "404": + content: + application/json: + schema: + type: string + description: not found + "500": + content: + application/json: + schema: + type: string + description: detach failed + security: + - BearerAuth: [] + - OrgKeyAuth: [] + - OrgSecretAuth: [] + summary: Detach one label from a node pool (org scoped) + tags: + - NodePools + /node-pools/{id}/servers: + get: + operationId: ListNodePoolServers + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + schema: + type: string + - description: Node Pool ID (UUID) + in: path + name: id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + schema: + items: + $ref: "#/components/schemas/dto.ServerResponse" + type: array + description: OK + "400": + content: + application/json: + schema: + type: string + description: invalid id + "401": + content: + application/json: + schema: + type: string + description: Unauthorized + "403": + content: + application/json: + schema: + type: string + description: organization required + "404": + content: + application/json: + schema: + type: string + description: not found + "500": + content: + application/json: + schema: + type: string + description: fetch failed + security: + - BearerAuth: [] + - OrgKeyAuth: [] + - OrgSecretAuth: [] + summary: List servers attached to a node pool (org scoped) + tags: + - NodePools + post: + operationId: AttachNodePoolServers + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + schema: + type: string + - description: Node Pool ID (UUID) + in: path + name: id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/dto.AttachServersRequest" + description: Server IDs to attach + required: true + responses: + "204": + content: + application/json: + schema: + type: string + description: No Content + "400": + content: + application/json: + schema: + type: string + description: invalid id / invalid server_ids + "401": + content: + application/json: + schema: + type: string + description: Unauthorized + "403": + content: + application/json: + schema: + type: string + description: organization required + "404": + content: + application/json: + schema: + type: string + description: not found + "500": + content: + application/json: + schema: + type: string + description: attach failed + security: + - BearerAuth: [] + - OrgKeyAuth: [] + - OrgSecretAuth: [] + summary: Attach servers to a node pool (org scoped) + tags: + - NodePools + x-codegen-request-body-name: body + /node-pools/{id}/servers/{serverId}: + delete: + operationId: DetachNodePoolServer + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + schema: + type: string + - description: Node Pool ID (UUID) + in: path + name: id + required: true + schema: + type: string + - description: Server ID (UUID) + in: path + name: serverId + required: true + schema: + type: string + responses: + "204": + content: + application/json: + schema: + type: string + description: No Content + "400": + content: + application/json: + schema: + type: string + description: invalid id + "401": + content: + application/json: + schema: + type: string + description: Unauthorized + "403": + content: + application/json: + schema: + type: string + description: organization required + "404": + content: + application/json: + schema: + type: string + description: not found + "500": + content: + application/json: + schema: + type: string + description: detach failed + security: + - BearerAuth: [] + - OrgKeyAuth: [] + - OrgSecretAuth: [] + summary: Detach one server from a node pool (org scoped) + tags: + - NodePools + /node-pools/{id}/taints: + get: + operationId: ListNodePoolTaints + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + schema: + type: string + - description: Node Pool ID (UUID) + in: path + name: id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + schema: + items: + $ref: "#/components/schemas/dto.TaintResponse" + type: array + description: OK + "400": + content: + application/json: + schema: + type: string + description: invalid id + "401": + content: + application/json: + schema: + type: string + description: Unauthorized + "403": + content: + application/json: + schema: + type: string + description: organization required + "404": + content: + application/json: + schema: + type: string + description: not found + "500": + content: + application/json: + schema: + type: string + description: fetch failed + security: + - BearerAuth: [] + - OrgKeyAuth: [] + - OrgSecretAuth: [] + summary: List taints attached to a node pool (org scoped) + tags: + - NodePools + post: + operationId: AttachNodePoolTaints + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + schema: + type: string + - description: Node Pool ID (UUID) + in: path + name: id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/dto.AttachTaintsRequest" + description: Taint IDs to attach + required: true + responses: + "204": + content: + application/json: + schema: + type: string + description: No Content + "400": + content: + application/json: + schema: + type: string + description: invalid id / invalid taint_ids + "401": + content: + application/json: + schema: + type: string + description: Unauthorized + "403": + content: + application/json: + schema: + type: string + description: organization required + "404": + content: + application/json: + schema: + type: string + description: not found + "500": + content: + application/json: + schema: + type: string + description: attach failed + security: + - BearerAuth: [] + - OrgKeyAuth: [] + - OrgSecretAuth: [] + summary: Attach taints to a node pool (org scoped) + tags: + - NodePools + x-codegen-request-body-name: body + /node-pools/{id}/taints/{taintId}: + delete: + operationId: DetachNodePoolTaint + parameters: + - description: Organization UUID + in: header + name: X-Org-ID + schema: + type: string + - description: Node Pool ID (UUID) + in: path + name: id + required: true + schema: + type: string + - description: Taint ID (UUID) + in: path + name: taintId + required: true + schema: + type: string + responses: + "204": + content: + application/json: + schema: + type: string + description: No Content + "400": + content: + application/json: + schema: + type: string + description: invalid id + "401": + content: + application/json: + schema: + type: string + description: Unauthorized + "403": + content: + application/json: + schema: + type: string + description: organization required + "404": + content: + application/json: + schema: + type: string + description: not found + "500": + content: + application/json: + schema: + type: string + description: detach failed + security: + - BearerAuth: [] + - OrgKeyAuth: [] + - OrgSecretAuth: [] + summary: Detach one taint from a node pool (org scoped) + tags: + - NodePools /orgs: get: operationId: listMyOrgs @@ -2325,6 +3376,34 @@ components: value: type: string type: object + dto.AttachAnnotationsRequest: + properties: + annotation_ids: + items: + type: string + type: array + type: object + dto.AttachLabelsRequest: + properties: + label_ids: + items: + type: string + type: array + type: object + dto.AttachServersRequest: + properties: + server_ids: + items: + type: string + type: array + type: object + dto.AttachTaintsRequest: + properties: + taint_ids: + items: + type: string + type: array + type: object dto.AuthStartResponse: example: auth_url: https://accounts.google.com/o/oauth2/v2/auth?client_id=... @@ -2347,6 +3426,16 @@ components: value: type: string type: object + dto.CreateNodePoolRequest: + properties: + name: + type: string + role: + enum: + - master + - worker + type: string + type: object dto.CreateSSHRequest: properties: bits: @@ -2370,6 +3459,10 @@ components: public_ip_address: type: string role: + enum: + - master + - worker + - bastion example: master|worker|bastion type: string ssh_key_id: @@ -2377,6 +3470,11 @@ components: ssh_user: type: string status: + enum: + - pending + - provisioning + - ready + - failed example: pending|provisioning|ready|failed type: string type: object @@ -2539,6 +3637,111 @@ components: example: m0l9o8rT3t0V8d3eFf... type: string type: object + dto.NodePoolResponse: + example: + role: master + servers: + - hostname: hostname + public_ip_address: public_ip_address + role: master|worker|bastion + updated_at: updated_at + ssh_key_id: ssh_key_id + organization_id: organization_id + created_at: created_at + private_ip_address: private_ip_address + id: id + ssh_user: ssh_user + status: pending|provisioning|ready|failed + - hostname: hostname + public_ip_address: public_ip_address + role: master|worker|bastion + updated_at: updated_at + ssh_key_id: ssh_key_id + organization_id: organization_id + created_at: created_at + private_ip_address: private_ip_address + id: id + ssh_user: ssh_user + status: pending|provisioning|ready|failed + updated_at: updated_at + organization_id: organization_id + name: name + annotations: + - updated_at: updated_at + organization_id: organization_id + created_at: created_at + id: id + value: value + key: key + - updated_at: updated_at + organization_id: organization_id + created_at: created_at + id: id + value: value + key: key + created_at: created_at + id: id + taints: + - updated_at: updated_at + effect: effect + organization_id: organization_id + created_at: created_at + id: id + value: value + key: key + - updated_at: updated_at + effect: effect + organization_id: organization_id + created_at: created_at + id: id + value: value + key: key + labels: + - updated_at: updated_at + organization_id: organization_id + created_at: created_at + id: id + value: value + key: key + - updated_at: updated_at + organization_id: organization_id + created_at: created_at + id: id + value: value + key: key + properties: + annotations: + items: + $ref: "#/components/schemas/dto.AnnotationResponse" + type: array + created_at: + type: string + id: + type: string + labels: + items: + $ref: "#/components/schemas/dto.LabelResponse" + type: array + name: + type: string + organization_id: + type: string + role: + enum: + - master + - worker + type: string + servers: + items: + $ref: "#/components/schemas/dto.ServerResponse" + type: array + taints: + items: + $ref: "#/components/schemas/dto.TaintResponse" + type: array + updated_at: + type: string + type: object dto.PageJob: example: total: 120 @@ -2616,7 +3819,7 @@ components: example: hostname: hostname public_ip_address: public_ip_address - role: role + role: master|worker|bastion updated_at: updated_at ssh_key_id: ssh_key_id organization_id: organization_id @@ -2624,7 +3827,7 @@ components: private_ip_address: private_ip_address id: id ssh_user: ssh_user - status: status + status: pending|provisioning|ready|failed properties: created_at: type: string @@ -2639,12 +3842,23 @@ components: public_ip_address: type: string role: + enum: + - master + - worker + - bastion + example: master|worker|bastion type: string ssh_key_id: type: string ssh_user: type: string status: + enum: + - pending + - provisioning + - ready + - failed + example: pending|provisioning|ready|failed type: string updated_at: type: string @@ -2761,6 +3975,16 @@ components: value: type: string type: object + dto.UpdateNodePoolRequest: + properties: + name: + type: string + role: + enum: + - master + - worker + type: string + type: object dto.UpdateServerRequest: properties: hostname: @@ -2770,6 +3994,10 @@ components: public_ip_address: type: string role: + enum: + - master + - worker + - bastion example: master|worker|bastion type: string ssh_key_id: @@ -2777,6 +4005,11 @@ components: ssh_user: type: string status: + enum: + - pending + - provisioning + - ready + - failed example: pending|provisioning|ready|failed type: string type: object diff --git a/sdk/go/api_node_pools.go b/sdk/go/api_node_pools.go new file mode 100644 index 0000000..3117c3c --- /dev/null +++ b/sdk/go/api_node_pools.go @@ -0,0 +1,3615 @@ +/* +AutoGlue API + +API for managing K3s clusters across cloud providers + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package autoglue + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" +) + +// NodePoolsAPIService NodePoolsAPI service +type NodePoolsAPIService service + +type ApiAttachNodePoolAnnotationsRequest struct { + ctx context.Context + ApiService *NodePoolsAPIService + id string + body *DtoAttachAnnotationsRequest + xOrgID *string +} + +// Annotation IDs to attach +func (r ApiAttachNodePoolAnnotationsRequest) Body(body DtoAttachAnnotationsRequest) ApiAttachNodePoolAnnotationsRequest { + r.body = &body + return r +} + +// Organization UUID +func (r ApiAttachNodePoolAnnotationsRequest) XOrgID(xOrgID string) ApiAttachNodePoolAnnotationsRequest { + r.xOrgID = &xOrgID + return r +} + +func (r ApiAttachNodePoolAnnotationsRequest) Execute() (string, *http.Response, error) { + return r.ApiService.AttachNodePoolAnnotationsExecute(r) +} + +/* +AttachNodePoolAnnotations Attach annotation to a node pool (org scoped) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Node Group ID (UUID) + @return ApiAttachNodePoolAnnotationsRequest +*/ +func (a *NodePoolsAPIService) AttachNodePoolAnnotations(ctx context.Context, id string) ApiAttachNodePoolAnnotationsRequest { + return ApiAttachNodePoolAnnotationsRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return string +func (a *NodePoolsAPIService) AttachNodePoolAnnotationsExecute(r ApiAttachNodePoolAnnotationsRequest) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodePoolsAPIService.AttachNodePoolAnnotations") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/node-pools/{id}/annotations" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xOrgID != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Org-ID", r.xOrgID, "", "") + } + // body params + localVarPostBody = r.body + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-KEY"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgSecretAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-SECRET"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["BearerAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAttachNodePoolLabelsRequest struct { + ctx context.Context + ApiService *NodePoolsAPIService + id string + body *DtoAttachLabelsRequest + xOrgID *string +} + +// Label IDs to attach +func (r ApiAttachNodePoolLabelsRequest) Body(body DtoAttachLabelsRequest) ApiAttachNodePoolLabelsRequest { + r.body = &body + return r +} + +// Organization UUID +func (r ApiAttachNodePoolLabelsRequest) XOrgID(xOrgID string) ApiAttachNodePoolLabelsRequest { + r.xOrgID = &xOrgID + return r +} + +func (r ApiAttachNodePoolLabelsRequest) Execute() (string, *http.Response, error) { + return r.ApiService.AttachNodePoolLabelsExecute(r) +} + +/* +AttachNodePoolLabels Attach labels to a node pool (org scoped) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Node Pool ID (UUID) + @return ApiAttachNodePoolLabelsRequest +*/ +func (a *NodePoolsAPIService) AttachNodePoolLabels(ctx context.Context, id string) ApiAttachNodePoolLabelsRequest { + return ApiAttachNodePoolLabelsRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return string +func (a *NodePoolsAPIService) AttachNodePoolLabelsExecute(r ApiAttachNodePoolLabelsRequest) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodePoolsAPIService.AttachNodePoolLabels") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/node-pools/{id}/labels" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xOrgID != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Org-ID", r.xOrgID, "", "") + } + // body params + localVarPostBody = r.body + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-KEY"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgSecretAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-SECRET"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["BearerAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAttachNodePoolServersRequest struct { + ctx context.Context + ApiService *NodePoolsAPIService + id string + body *DtoAttachServersRequest + xOrgID *string +} + +// Server IDs to attach +func (r ApiAttachNodePoolServersRequest) Body(body DtoAttachServersRequest) ApiAttachNodePoolServersRequest { + r.body = &body + return r +} + +// Organization UUID +func (r ApiAttachNodePoolServersRequest) XOrgID(xOrgID string) ApiAttachNodePoolServersRequest { + r.xOrgID = &xOrgID + return r +} + +func (r ApiAttachNodePoolServersRequest) Execute() (string, *http.Response, error) { + return r.ApiService.AttachNodePoolServersExecute(r) +} + +/* +AttachNodePoolServers Attach servers to a node pool (org scoped) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Node Pool ID (UUID) + @return ApiAttachNodePoolServersRequest +*/ +func (a *NodePoolsAPIService) AttachNodePoolServers(ctx context.Context, id string) ApiAttachNodePoolServersRequest { + return ApiAttachNodePoolServersRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return string +func (a *NodePoolsAPIService) AttachNodePoolServersExecute(r ApiAttachNodePoolServersRequest) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodePoolsAPIService.AttachNodePoolServers") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/node-pools/{id}/servers" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xOrgID != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Org-ID", r.xOrgID, "", "") + } + // body params + localVarPostBody = r.body + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-KEY"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgSecretAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-SECRET"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["BearerAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiAttachNodePoolTaintsRequest struct { + ctx context.Context + ApiService *NodePoolsAPIService + id string + body *DtoAttachTaintsRequest + xOrgID *string +} + +// Taint IDs to attach +func (r ApiAttachNodePoolTaintsRequest) Body(body DtoAttachTaintsRequest) ApiAttachNodePoolTaintsRequest { + r.body = &body + return r +} + +// Organization UUID +func (r ApiAttachNodePoolTaintsRequest) XOrgID(xOrgID string) ApiAttachNodePoolTaintsRequest { + r.xOrgID = &xOrgID + return r +} + +func (r ApiAttachNodePoolTaintsRequest) Execute() (string, *http.Response, error) { + return r.ApiService.AttachNodePoolTaintsExecute(r) +} + +/* +AttachNodePoolTaints Attach taints to a node pool (org scoped) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Node Pool ID (UUID) + @return ApiAttachNodePoolTaintsRequest +*/ +func (a *NodePoolsAPIService) AttachNodePoolTaints(ctx context.Context, id string) ApiAttachNodePoolTaintsRequest { + return ApiAttachNodePoolTaintsRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return string +func (a *NodePoolsAPIService) AttachNodePoolTaintsExecute(r ApiAttachNodePoolTaintsRequest) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodePoolsAPIService.AttachNodePoolTaints") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/node-pools/{id}/taints" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xOrgID != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Org-ID", r.xOrgID, "", "") + } + // body params + localVarPostBody = r.body + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-KEY"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgSecretAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-SECRET"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["BearerAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiCreateNodePoolRequest struct { + ctx context.Context + ApiService *NodePoolsAPIService + body *DtoCreateNodePoolRequest + xOrgID *string +} + +// NodePool payload +func (r ApiCreateNodePoolRequest) Body(body DtoCreateNodePoolRequest) ApiCreateNodePoolRequest { + r.body = &body + return r +} + +// Organization UUID +func (r ApiCreateNodePoolRequest) XOrgID(xOrgID string) ApiCreateNodePoolRequest { + r.xOrgID = &xOrgID + return r +} + +func (r ApiCreateNodePoolRequest) Execute() (*DtoNodePoolResponse, *http.Response, error) { + return r.ApiService.CreateNodePoolExecute(r) +} + +/* +CreateNodePool Create node pool (org scoped) + +Creates a node pool. Optionally attach initial servers. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateNodePoolRequest +*/ +func (a *NodePoolsAPIService) CreateNodePool(ctx context.Context) ApiCreateNodePoolRequest { + return ApiCreateNodePoolRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return DtoNodePoolResponse +func (a *NodePoolsAPIService) CreateNodePoolExecute(r ApiCreateNodePoolRequest) (*DtoNodePoolResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DtoNodePoolResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodePoolsAPIService.CreateNodePool") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/node-pools" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xOrgID != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Org-ID", r.xOrgID, "", "") + } + // body params + localVarPostBody = r.body + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-KEY"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgSecretAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-SECRET"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["BearerAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDeleteNodePoolRequest struct { + ctx context.Context + ApiService *NodePoolsAPIService + id string + xOrgID *string +} + +// Organization UUID +func (r ApiDeleteNodePoolRequest) XOrgID(xOrgID string) ApiDeleteNodePoolRequest { + r.xOrgID = &xOrgID + return r +} + +func (r ApiDeleteNodePoolRequest) Execute() (string, *http.Response, error) { + return r.ApiService.DeleteNodePoolExecute(r) +} + +/* +DeleteNodePool Delete node pool (org scoped) + +Permanently deletes the node pool. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Node Pool ID (UUID) + @return ApiDeleteNodePoolRequest +*/ +func (a *NodePoolsAPIService) DeleteNodePool(ctx context.Context, id string) ApiDeleteNodePoolRequest { + return ApiDeleteNodePoolRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return string +func (a *NodePoolsAPIService) DeleteNodePoolExecute(r ApiDeleteNodePoolRequest) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodePoolsAPIService.DeleteNodePool") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/node-pools/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xOrgID != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Org-ID", r.xOrgID, "", "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-KEY"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgSecretAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-SECRET"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["BearerAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDetachNodePoolAnnotationRequest struct { + ctx context.Context + ApiService *NodePoolsAPIService + id string + annotationId string + xOrgID *string +} + +// Organization UUID +func (r ApiDetachNodePoolAnnotationRequest) XOrgID(xOrgID string) ApiDetachNodePoolAnnotationRequest { + r.xOrgID = &xOrgID + return r +} + +func (r ApiDetachNodePoolAnnotationRequest) Execute() (string, *http.Response, error) { + return r.ApiService.DetachNodePoolAnnotationExecute(r) +} + +/* +DetachNodePoolAnnotation Detach one annotation from a node pool (org scoped) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Node Pool ID (UUID) + @param annotationId Annotation ID (UUID) + @return ApiDetachNodePoolAnnotationRequest +*/ +func (a *NodePoolsAPIService) DetachNodePoolAnnotation(ctx context.Context, id string, annotationId string) ApiDetachNodePoolAnnotationRequest { + return ApiDetachNodePoolAnnotationRequest{ + ApiService: a, + ctx: ctx, + id: id, + annotationId: annotationId, + } +} + +// Execute executes the request +// +// @return string +func (a *NodePoolsAPIService) DetachNodePoolAnnotationExecute(r ApiDetachNodePoolAnnotationRequest) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodePoolsAPIService.DetachNodePoolAnnotation") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/node-pools/{id}/annotations/{annotationId}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"annotationId"+"}", url.PathEscape(parameterValueToString(r.annotationId, "annotationId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xOrgID != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Org-ID", r.xOrgID, "", "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-KEY"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgSecretAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-SECRET"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["BearerAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDetachNodePoolLabelRequest struct { + ctx context.Context + ApiService *NodePoolsAPIService + id string + labelId string + xOrgID *string +} + +// Organization UUID +func (r ApiDetachNodePoolLabelRequest) XOrgID(xOrgID string) ApiDetachNodePoolLabelRequest { + r.xOrgID = &xOrgID + return r +} + +func (r ApiDetachNodePoolLabelRequest) Execute() (string, *http.Response, error) { + return r.ApiService.DetachNodePoolLabelExecute(r) +} + +/* +DetachNodePoolLabel Detach one label from a node pool (org scoped) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Node Pool ID (UUID) + @param labelId Label ID (UUID) + @return ApiDetachNodePoolLabelRequest +*/ +func (a *NodePoolsAPIService) DetachNodePoolLabel(ctx context.Context, id string, labelId string) ApiDetachNodePoolLabelRequest { + return ApiDetachNodePoolLabelRequest{ + ApiService: a, + ctx: ctx, + id: id, + labelId: labelId, + } +} + +// Execute executes the request +// +// @return string +func (a *NodePoolsAPIService) DetachNodePoolLabelExecute(r ApiDetachNodePoolLabelRequest) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodePoolsAPIService.DetachNodePoolLabel") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/node-pools/{id}/labels/{labelId}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"labelId"+"}", url.PathEscape(parameterValueToString(r.labelId, "labelId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xOrgID != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Org-ID", r.xOrgID, "", "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-KEY"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgSecretAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-SECRET"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["BearerAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDetachNodePoolServerRequest struct { + ctx context.Context + ApiService *NodePoolsAPIService + id string + serverId string + xOrgID *string +} + +// Organization UUID +func (r ApiDetachNodePoolServerRequest) XOrgID(xOrgID string) ApiDetachNodePoolServerRequest { + r.xOrgID = &xOrgID + return r +} + +func (r ApiDetachNodePoolServerRequest) Execute() (string, *http.Response, error) { + return r.ApiService.DetachNodePoolServerExecute(r) +} + +/* +DetachNodePoolServer Detach one server from a node pool (org scoped) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Node Pool ID (UUID) + @param serverId Server ID (UUID) + @return ApiDetachNodePoolServerRequest +*/ +func (a *NodePoolsAPIService) DetachNodePoolServer(ctx context.Context, id string, serverId string) ApiDetachNodePoolServerRequest { + return ApiDetachNodePoolServerRequest{ + ApiService: a, + ctx: ctx, + id: id, + serverId: serverId, + } +} + +// Execute executes the request +// +// @return string +func (a *NodePoolsAPIService) DetachNodePoolServerExecute(r ApiDetachNodePoolServerRequest) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodePoolsAPIService.DetachNodePoolServer") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/node-pools/{id}/servers/{serverId}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xOrgID != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Org-ID", r.xOrgID, "", "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-KEY"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgSecretAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-SECRET"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["BearerAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiDetachNodePoolTaintRequest struct { + ctx context.Context + ApiService *NodePoolsAPIService + id string + taintId string + xOrgID *string +} + +// Organization UUID +func (r ApiDetachNodePoolTaintRequest) XOrgID(xOrgID string) ApiDetachNodePoolTaintRequest { + r.xOrgID = &xOrgID + return r +} + +func (r ApiDetachNodePoolTaintRequest) Execute() (string, *http.Response, error) { + return r.ApiService.DetachNodePoolTaintExecute(r) +} + +/* +DetachNodePoolTaint Detach one taint from a node pool (org scoped) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Node Pool ID (UUID) + @param taintId Taint ID (UUID) + @return ApiDetachNodePoolTaintRequest +*/ +func (a *NodePoolsAPIService) DetachNodePoolTaint(ctx context.Context, id string, taintId string) ApiDetachNodePoolTaintRequest { + return ApiDetachNodePoolTaintRequest{ + ApiService: a, + ctx: ctx, + id: id, + taintId: taintId, + } +} + +// Execute executes the request +// +// @return string +func (a *NodePoolsAPIService) DetachNodePoolTaintExecute(r ApiDetachNodePoolTaintRequest) (string, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue string + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodePoolsAPIService.DetachNodePoolTaint") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/node-pools/{id}/taints/{taintId}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"taintId"+"}", url.PathEscape(parameterValueToString(r.taintId, "taintId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xOrgID != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Org-ID", r.xOrgID, "", "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-KEY"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgSecretAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-SECRET"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["BearerAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiGetNodePoolRequest struct { + ctx context.Context + ApiService *NodePoolsAPIService + id string + xOrgID *string +} + +// Organization UUID +func (r ApiGetNodePoolRequest) XOrgID(xOrgID string) ApiGetNodePoolRequest { + r.xOrgID = &xOrgID + return r +} + +func (r ApiGetNodePoolRequest) Execute() (*DtoNodePoolResponse, *http.Response, error) { + return r.ApiService.GetNodePoolExecute(r) +} + +/* +GetNodePool Get node pool by ID (org scoped) + +Returns one node pool. Add `include=servers` to include servers. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Node Pool ID (UUID) + @return ApiGetNodePoolRequest +*/ +func (a *NodePoolsAPIService) GetNodePool(ctx context.Context, id string) ApiGetNodePoolRequest { + return ApiGetNodePoolRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DtoNodePoolResponse +func (a *NodePoolsAPIService) GetNodePoolExecute(r ApiGetNodePoolRequest) (*DtoNodePoolResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DtoNodePoolResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodePoolsAPIService.GetNodePool") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/node-pools/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xOrgID != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Org-ID", r.xOrgID, "", "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-KEY"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgSecretAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-SECRET"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["BearerAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListNodePoolAnnotationsRequest struct { + ctx context.Context + ApiService *NodePoolsAPIService + id string + xOrgID *string +} + +// Organization UUID +func (r ApiListNodePoolAnnotationsRequest) XOrgID(xOrgID string) ApiListNodePoolAnnotationsRequest { + r.xOrgID = &xOrgID + return r +} + +func (r ApiListNodePoolAnnotationsRequest) Execute() ([]DtoAnnotationResponse, *http.Response, error) { + return r.ApiService.ListNodePoolAnnotationsExecute(r) +} + +/* +ListNodePoolAnnotations List annotations attached to a node pool (org scoped) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Node Pool ID (UUID) + @return ApiListNodePoolAnnotationsRequest +*/ +func (a *NodePoolsAPIService) ListNodePoolAnnotations(ctx context.Context, id string) ApiListNodePoolAnnotationsRequest { + return ApiListNodePoolAnnotationsRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []DtoAnnotationResponse +func (a *NodePoolsAPIService) ListNodePoolAnnotationsExecute(r ApiListNodePoolAnnotationsRequest) ([]DtoAnnotationResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []DtoAnnotationResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodePoolsAPIService.ListNodePoolAnnotations") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/node-pools/{id}/annotations" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xOrgID != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Org-ID", r.xOrgID, "", "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-KEY"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgSecretAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-SECRET"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["BearerAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListNodePoolLabelsRequest struct { + ctx context.Context + ApiService *NodePoolsAPIService + id string + xOrgID *string +} + +// Organization UUID +func (r ApiListNodePoolLabelsRequest) XOrgID(xOrgID string) ApiListNodePoolLabelsRequest { + r.xOrgID = &xOrgID + return r +} + +func (r ApiListNodePoolLabelsRequest) Execute() ([]DtoLabelResponse, *http.Response, error) { + return r.ApiService.ListNodePoolLabelsExecute(r) +} + +/* +ListNodePoolLabels List labels attached to a node pool (org scoped) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Label Pool ID (UUID) + @return ApiListNodePoolLabelsRequest +*/ +func (a *NodePoolsAPIService) ListNodePoolLabels(ctx context.Context, id string) ApiListNodePoolLabelsRequest { + return ApiListNodePoolLabelsRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []DtoLabelResponse +func (a *NodePoolsAPIService) ListNodePoolLabelsExecute(r ApiListNodePoolLabelsRequest) ([]DtoLabelResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []DtoLabelResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodePoolsAPIService.ListNodePoolLabels") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/node-pools/{id}/labels" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xOrgID != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Org-ID", r.xOrgID, "", "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-KEY"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgSecretAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-SECRET"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["BearerAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListNodePoolServersRequest struct { + ctx context.Context + ApiService *NodePoolsAPIService + id string + xOrgID *string +} + +// Organization UUID +func (r ApiListNodePoolServersRequest) XOrgID(xOrgID string) ApiListNodePoolServersRequest { + r.xOrgID = &xOrgID + return r +} + +func (r ApiListNodePoolServersRequest) Execute() ([]DtoServerResponse, *http.Response, error) { + return r.ApiService.ListNodePoolServersExecute(r) +} + +/* +ListNodePoolServers List servers attached to a node pool (org scoped) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Node Pool ID (UUID) + @return ApiListNodePoolServersRequest +*/ +func (a *NodePoolsAPIService) ListNodePoolServers(ctx context.Context, id string) ApiListNodePoolServersRequest { + return ApiListNodePoolServersRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []DtoServerResponse +func (a *NodePoolsAPIService) ListNodePoolServersExecute(r ApiListNodePoolServersRequest) ([]DtoServerResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []DtoServerResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodePoolsAPIService.ListNodePoolServers") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/node-pools/{id}/servers" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xOrgID != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Org-ID", r.xOrgID, "", "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-KEY"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgSecretAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-SECRET"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["BearerAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListNodePoolTaintsRequest struct { + ctx context.Context + ApiService *NodePoolsAPIService + id string + xOrgID *string +} + +// Organization UUID +func (r ApiListNodePoolTaintsRequest) XOrgID(xOrgID string) ApiListNodePoolTaintsRequest { + r.xOrgID = &xOrgID + return r +} + +func (r ApiListNodePoolTaintsRequest) Execute() ([]DtoTaintResponse, *http.Response, error) { + return r.ApiService.ListNodePoolTaintsExecute(r) +} + +/* +ListNodePoolTaints List taints attached to a node pool (org scoped) + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Node Pool ID (UUID) + @return ApiListNodePoolTaintsRequest +*/ +func (a *NodePoolsAPIService) ListNodePoolTaints(ctx context.Context, id string) ApiListNodePoolTaintsRequest { + return ApiListNodePoolTaintsRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return []DtoTaintResponse +func (a *NodePoolsAPIService) ListNodePoolTaintsExecute(r ApiListNodePoolTaintsRequest) ([]DtoTaintResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []DtoTaintResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodePoolsAPIService.ListNodePoolTaints") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/node-pools/{id}/taints" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xOrgID != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Org-ID", r.xOrgID, "", "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-KEY"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgSecretAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-SECRET"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["BearerAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiListNodePoolsRequest struct { + ctx context.Context + ApiService *NodePoolsAPIService + xOrgID *string + q *string +} + +// Organization UUID +func (r ApiListNodePoolsRequest) XOrgID(xOrgID string) ApiListNodePoolsRequest { + r.xOrgID = &xOrgID + return r +} + +// Name contains (case-insensitive) +func (r ApiListNodePoolsRequest) Q(q string) ApiListNodePoolsRequest { + r.q = &q + return r +} + +func (r ApiListNodePoolsRequest) Execute() ([]DtoNodePoolResponse, *http.Response, error) { + return r.ApiService.ListNodePoolsExecute(r) +} + +/* +ListNodePools List node pools (org scoped) + +Returns node pools for the organization in X-Org-ID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListNodePoolsRequest +*/ +func (a *NodePoolsAPIService) ListNodePools(ctx context.Context) ApiListNodePoolsRequest { + return ApiListNodePoolsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return []DtoNodePoolResponse +func (a *NodePoolsAPIService) ListNodePoolsExecute(r ApiListNodePoolsRequest) ([]DtoNodePoolResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue []DtoNodePoolResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodePoolsAPIService.ListNodePools") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/node-pools" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.q != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xOrgID != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Org-ID", r.xOrgID, "", "") + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-KEY"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgSecretAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-SECRET"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["BearerAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +type ApiUpdateNodePoolRequest struct { + ctx context.Context + ApiService *NodePoolsAPIService + id string + body *DtoUpdateNodePoolRequest + xOrgID *string +} + +// Fields to update +func (r ApiUpdateNodePoolRequest) Body(body DtoUpdateNodePoolRequest) ApiUpdateNodePoolRequest { + r.body = &body + return r +} + +// Organization UUID +func (r ApiUpdateNodePoolRequest) XOrgID(xOrgID string) ApiUpdateNodePoolRequest { + r.xOrgID = &xOrgID + return r +} + +func (r ApiUpdateNodePoolRequest) Execute() (*DtoNodePoolResponse, *http.Response, error) { + return r.ApiService.UpdateNodePoolExecute(r) +} + +/* +UpdateNodePool Update node pool (org scoped) + +Partially update node pool fields. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param id Node Pool ID (UUID) + @return ApiUpdateNodePoolRequest +*/ +func (a *NodePoolsAPIService) UpdateNodePool(ctx context.Context, id string) ApiUpdateNodePoolRequest { + return ApiUpdateNodePoolRequest{ + ApiService: a, + ctx: ctx, + id: id, + } +} + +// Execute executes the request +// +// @return DtoNodePoolResponse +func (a *NodePoolsAPIService) UpdateNodePoolExecute(r ApiUpdateNodePoolRequest) (*DtoNodePoolResponse, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *DtoNodePoolResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "NodePoolsAPIService.UpdateNodePool") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/node-pools/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.body == nil { + return localVarReturnValue, nil, reportError("body is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.xOrgID != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Org-ID", r.xOrgID, "", "") + } + // body params + localVarPostBody = r.body + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgKeyAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-KEY"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["OrgSecretAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["X-ORG-SECRET"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if apiKey, ok := auth["BearerAuth"]; ok { + var key string + if apiKey.Prefix != "" { + key = apiKey.Prefix + " " + apiKey.Key + } else { + key = apiKey.Key + } + localVarHeaderParams["Authorization"] = key + } + } + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v string + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/sdk/go/client.go b/sdk/go/client.go index e9ed526..ec732d3 100644 --- a/sdk/go/client.go +++ b/sdk/go/client.go @@ -62,6 +62,8 @@ type APIClient struct { MeAPIKeysAPI *MeAPIKeysAPIService + NodePoolsAPI *NodePoolsAPIService + OrgsAPI *OrgsAPIService ServersAPI *ServersAPIService @@ -94,6 +96,7 @@ func NewAPIClient(cfg *Configuration) *APIClient { c.LabelsAPI = (*LabelsAPIService)(&c.common) c.MeAPI = (*MeAPIService)(&c.common) c.MeAPIKeysAPI = (*MeAPIKeysAPIService)(&c.common) + c.NodePoolsAPI = (*NodePoolsAPIService)(&c.common) c.OrgsAPI = (*OrgsAPIService)(&c.common) c.ServersAPI = (*ServersAPIService)(&c.common) c.SshAPI = (*SshAPIService)(&c.common) diff --git a/sdk/go/configuration.go b/sdk/go/configuration.go index 2a6776d..06bc1dc 100644 --- a/sdk/go/configuration.go +++ b/sdk/go/configuration.go @@ -93,11 +93,7 @@ func NewConfiguration() *Configuration { Debug: false, Servers: ServerConfigurations{ { - URL: "http://localhost:8080/api/v1", - Description: "No description provided", - }, - { - URL: "https://localhost:8080/api/v1", + URL: "/api/v1", Description: "No description provided", }, }, diff --git a/sdk/go/docs/AnnotationsAPI.md b/sdk/go/docs/AnnotationsAPI.md index 5206260..3cf2e84 100644 --- a/sdk/go/docs/AnnotationsAPI.md +++ b/sdk/go/docs/AnnotationsAPI.md @@ -1,6 +1,6 @@ # \AnnotationsAPI -All URIs are relative to *http://localhost:8080/api/v1* +All URIs are relative to */api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/sdk/go/docs/ArcherAdminAPI.md b/sdk/go/docs/ArcherAdminAPI.md index cfdaf15..82c6e56 100644 --- a/sdk/go/docs/ArcherAdminAPI.md +++ b/sdk/go/docs/ArcherAdminAPI.md @@ -1,6 +1,6 @@ # \ArcherAdminAPI -All URIs are relative to *http://localhost:8080/api/v1* +All URIs are relative to */api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/sdk/go/docs/AuthAPI.md b/sdk/go/docs/AuthAPI.md index d18b369..ebd6da0 100644 --- a/sdk/go/docs/AuthAPI.md +++ b/sdk/go/docs/AuthAPI.md @@ -1,6 +1,6 @@ # \AuthAPI -All URIs are relative to *http://localhost:8080/api/v1* +All URIs are relative to */api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/sdk/go/docs/DtoAttachAnnotationsRequest.md b/sdk/go/docs/DtoAttachAnnotationsRequest.md new file mode 100644 index 0000000..9f4f7ae --- /dev/null +++ b/sdk/go/docs/DtoAttachAnnotationsRequest.md @@ -0,0 +1,56 @@ +# DtoAttachAnnotationsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AnnotationIds** | Pointer to **[]string** | | [optional] + +## Methods + +### NewDtoAttachAnnotationsRequest + +`func NewDtoAttachAnnotationsRequest() *DtoAttachAnnotationsRequest` + +NewDtoAttachAnnotationsRequest instantiates a new DtoAttachAnnotationsRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDtoAttachAnnotationsRequestWithDefaults + +`func NewDtoAttachAnnotationsRequestWithDefaults() *DtoAttachAnnotationsRequest` + +NewDtoAttachAnnotationsRequestWithDefaults instantiates a new DtoAttachAnnotationsRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAnnotationIds + +`func (o *DtoAttachAnnotationsRequest) GetAnnotationIds() []string` + +GetAnnotationIds returns the AnnotationIds field if non-nil, zero value otherwise. + +### GetAnnotationIdsOk + +`func (o *DtoAttachAnnotationsRequest) GetAnnotationIdsOk() (*[]string, bool)` + +GetAnnotationIdsOk returns a tuple with the AnnotationIds field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAnnotationIds + +`func (o *DtoAttachAnnotationsRequest) SetAnnotationIds(v []string)` + +SetAnnotationIds sets AnnotationIds field to given value. + +### HasAnnotationIds + +`func (o *DtoAttachAnnotationsRequest) HasAnnotationIds() bool` + +HasAnnotationIds returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/go/docs/DtoAttachLabelsRequest.md b/sdk/go/docs/DtoAttachLabelsRequest.md new file mode 100644 index 0000000..e667516 --- /dev/null +++ b/sdk/go/docs/DtoAttachLabelsRequest.md @@ -0,0 +1,56 @@ +# DtoAttachLabelsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LabelIds** | Pointer to **[]string** | | [optional] + +## Methods + +### NewDtoAttachLabelsRequest + +`func NewDtoAttachLabelsRequest() *DtoAttachLabelsRequest` + +NewDtoAttachLabelsRequest instantiates a new DtoAttachLabelsRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDtoAttachLabelsRequestWithDefaults + +`func NewDtoAttachLabelsRequestWithDefaults() *DtoAttachLabelsRequest` + +NewDtoAttachLabelsRequestWithDefaults instantiates a new DtoAttachLabelsRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetLabelIds + +`func (o *DtoAttachLabelsRequest) GetLabelIds() []string` + +GetLabelIds returns the LabelIds field if non-nil, zero value otherwise. + +### GetLabelIdsOk + +`func (o *DtoAttachLabelsRequest) GetLabelIdsOk() (*[]string, bool)` + +GetLabelIdsOk returns a tuple with the LabelIds field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLabelIds + +`func (o *DtoAttachLabelsRequest) SetLabelIds(v []string)` + +SetLabelIds sets LabelIds field to given value. + +### HasLabelIds + +`func (o *DtoAttachLabelsRequest) HasLabelIds() bool` + +HasLabelIds returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/go/docs/DtoAttachServersRequest.md b/sdk/go/docs/DtoAttachServersRequest.md new file mode 100644 index 0000000..15e03dc --- /dev/null +++ b/sdk/go/docs/DtoAttachServersRequest.md @@ -0,0 +1,56 @@ +# DtoAttachServersRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ServerIds** | Pointer to **[]string** | | [optional] + +## Methods + +### NewDtoAttachServersRequest + +`func NewDtoAttachServersRequest() *DtoAttachServersRequest` + +NewDtoAttachServersRequest instantiates a new DtoAttachServersRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDtoAttachServersRequestWithDefaults + +`func NewDtoAttachServersRequestWithDefaults() *DtoAttachServersRequest` + +NewDtoAttachServersRequestWithDefaults instantiates a new DtoAttachServersRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetServerIds + +`func (o *DtoAttachServersRequest) GetServerIds() []string` + +GetServerIds returns the ServerIds field if non-nil, zero value otherwise. + +### GetServerIdsOk + +`func (o *DtoAttachServersRequest) GetServerIdsOk() (*[]string, bool)` + +GetServerIdsOk returns a tuple with the ServerIds field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetServerIds + +`func (o *DtoAttachServersRequest) SetServerIds(v []string)` + +SetServerIds sets ServerIds field to given value. + +### HasServerIds + +`func (o *DtoAttachServersRequest) HasServerIds() bool` + +HasServerIds returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/go/docs/DtoAttachTaintsRequest.md b/sdk/go/docs/DtoAttachTaintsRequest.md new file mode 100644 index 0000000..6fcfe4e --- /dev/null +++ b/sdk/go/docs/DtoAttachTaintsRequest.md @@ -0,0 +1,56 @@ +# DtoAttachTaintsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TaintIds** | Pointer to **[]string** | | [optional] + +## Methods + +### NewDtoAttachTaintsRequest + +`func NewDtoAttachTaintsRequest() *DtoAttachTaintsRequest` + +NewDtoAttachTaintsRequest instantiates a new DtoAttachTaintsRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDtoAttachTaintsRequestWithDefaults + +`func NewDtoAttachTaintsRequestWithDefaults() *DtoAttachTaintsRequest` + +NewDtoAttachTaintsRequestWithDefaults instantiates a new DtoAttachTaintsRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetTaintIds + +`func (o *DtoAttachTaintsRequest) GetTaintIds() []string` + +GetTaintIds returns the TaintIds field if non-nil, zero value otherwise. + +### GetTaintIdsOk + +`func (o *DtoAttachTaintsRequest) GetTaintIdsOk() (*[]string, bool)` + +GetTaintIdsOk returns a tuple with the TaintIds field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTaintIds + +`func (o *DtoAttachTaintsRequest) SetTaintIds(v []string)` + +SetTaintIds sets TaintIds field to given value. + +### HasTaintIds + +`func (o *DtoAttachTaintsRequest) HasTaintIds() bool` + +HasTaintIds returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/go/docs/DtoCreateNodePoolRequest.md b/sdk/go/docs/DtoCreateNodePoolRequest.md new file mode 100644 index 0000000..fed77a8 --- /dev/null +++ b/sdk/go/docs/DtoCreateNodePoolRequest.md @@ -0,0 +1,82 @@ +# DtoCreateNodePoolRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | | [optional] +**Role** | Pointer to **string** | | [optional] + +## Methods + +### NewDtoCreateNodePoolRequest + +`func NewDtoCreateNodePoolRequest() *DtoCreateNodePoolRequest` + +NewDtoCreateNodePoolRequest instantiates a new DtoCreateNodePoolRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDtoCreateNodePoolRequestWithDefaults + +`func NewDtoCreateNodePoolRequestWithDefaults() *DtoCreateNodePoolRequest` + +NewDtoCreateNodePoolRequestWithDefaults instantiates a new DtoCreateNodePoolRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *DtoCreateNodePoolRequest) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *DtoCreateNodePoolRequest) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *DtoCreateNodePoolRequest) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *DtoCreateNodePoolRequest) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetRole + +`func (o *DtoCreateNodePoolRequest) GetRole() string` + +GetRole returns the Role field if non-nil, zero value otherwise. + +### GetRoleOk + +`func (o *DtoCreateNodePoolRequest) GetRoleOk() (*string, bool)` + +GetRoleOk returns a tuple with the Role field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRole + +`func (o *DtoCreateNodePoolRequest) SetRole(v string)` + +SetRole sets Role field to given value. + +### HasRole + +`func (o *DtoCreateNodePoolRequest) HasRole() bool` + +HasRole returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/go/docs/DtoNodePoolResponse.md b/sdk/go/docs/DtoNodePoolResponse.md new file mode 100644 index 0000000..6b81b6c --- /dev/null +++ b/sdk/go/docs/DtoNodePoolResponse.md @@ -0,0 +1,290 @@ +# DtoNodePoolResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Annotations** | Pointer to [**[]DtoAnnotationResponse**](DtoAnnotationResponse.md) | | [optional] +**CreatedAt** | Pointer to **string** | | [optional] +**Id** | Pointer to **string** | | [optional] +**Labels** | Pointer to [**[]DtoLabelResponse**](DtoLabelResponse.md) | | [optional] +**Name** | Pointer to **string** | | [optional] +**OrganizationId** | Pointer to **string** | | [optional] +**Role** | Pointer to **string** | | [optional] +**Servers** | Pointer to [**[]DtoServerResponse**](DtoServerResponse.md) | | [optional] +**Taints** | Pointer to [**[]DtoTaintResponse**](DtoTaintResponse.md) | | [optional] +**UpdatedAt** | Pointer to **string** | | [optional] + +## Methods + +### NewDtoNodePoolResponse + +`func NewDtoNodePoolResponse() *DtoNodePoolResponse` + +NewDtoNodePoolResponse instantiates a new DtoNodePoolResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDtoNodePoolResponseWithDefaults + +`func NewDtoNodePoolResponseWithDefaults() *DtoNodePoolResponse` + +NewDtoNodePoolResponseWithDefaults instantiates a new DtoNodePoolResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAnnotations + +`func (o *DtoNodePoolResponse) GetAnnotations() []DtoAnnotationResponse` + +GetAnnotations returns the Annotations field if non-nil, zero value otherwise. + +### GetAnnotationsOk + +`func (o *DtoNodePoolResponse) GetAnnotationsOk() (*[]DtoAnnotationResponse, bool)` + +GetAnnotationsOk returns a tuple with the Annotations field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAnnotations + +`func (o *DtoNodePoolResponse) SetAnnotations(v []DtoAnnotationResponse)` + +SetAnnotations sets Annotations field to given value. + +### HasAnnotations + +`func (o *DtoNodePoolResponse) HasAnnotations() bool` + +HasAnnotations returns a boolean if a field has been set. + +### GetCreatedAt + +`func (o *DtoNodePoolResponse) GetCreatedAt() string` + +GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise. + +### GetCreatedAtOk + +`func (o *DtoNodePoolResponse) GetCreatedAtOk() (*string, bool)` + +GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetCreatedAt + +`func (o *DtoNodePoolResponse) SetCreatedAt(v string)` + +SetCreatedAt sets CreatedAt field to given value. + +### HasCreatedAt + +`func (o *DtoNodePoolResponse) HasCreatedAt() bool` + +HasCreatedAt returns a boolean if a field has been set. + +### GetId + +`func (o *DtoNodePoolResponse) GetId() string` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *DtoNodePoolResponse) GetIdOk() (*string, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetId + +`func (o *DtoNodePoolResponse) SetId(v string)` + +SetId sets Id field to given value. + +### HasId + +`func (o *DtoNodePoolResponse) HasId() bool` + +HasId returns a boolean if a field has been set. + +### GetLabels + +`func (o *DtoNodePoolResponse) GetLabels() []DtoLabelResponse` + +GetLabels returns the Labels field if non-nil, zero value otherwise. + +### GetLabelsOk + +`func (o *DtoNodePoolResponse) GetLabelsOk() (*[]DtoLabelResponse, bool)` + +GetLabelsOk returns a tuple with the Labels field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLabels + +`func (o *DtoNodePoolResponse) SetLabels(v []DtoLabelResponse)` + +SetLabels sets Labels field to given value. + +### HasLabels + +`func (o *DtoNodePoolResponse) HasLabels() bool` + +HasLabels returns a boolean if a field has been set. + +### GetName + +`func (o *DtoNodePoolResponse) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *DtoNodePoolResponse) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *DtoNodePoolResponse) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *DtoNodePoolResponse) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetOrganizationId + +`func (o *DtoNodePoolResponse) GetOrganizationId() string` + +GetOrganizationId returns the OrganizationId field if non-nil, zero value otherwise. + +### GetOrganizationIdOk + +`func (o *DtoNodePoolResponse) GetOrganizationIdOk() (*string, bool)` + +GetOrganizationIdOk returns a tuple with the OrganizationId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrganizationId + +`func (o *DtoNodePoolResponse) SetOrganizationId(v string)` + +SetOrganizationId sets OrganizationId field to given value. + +### HasOrganizationId + +`func (o *DtoNodePoolResponse) HasOrganizationId() bool` + +HasOrganizationId returns a boolean if a field has been set. + +### GetRole + +`func (o *DtoNodePoolResponse) GetRole() string` + +GetRole returns the Role field if non-nil, zero value otherwise. + +### GetRoleOk + +`func (o *DtoNodePoolResponse) GetRoleOk() (*string, bool)` + +GetRoleOk returns a tuple with the Role field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRole + +`func (o *DtoNodePoolResponse) SetRole(v string)` + +SetRole sets Role field to given value. + +### HasRole + +`func (o *DtoNodePoolResponse) HasRole() bool` + +HasRole returns a boolean if a field has been set. + +### GetServers + +`func (o *DtoNodePoolResponse) GetServers() []DtoServerResponse` + +GetServers returns the Servers field if non-nil, zero value otherwise. + +### GetServersOk + +`func (o *DtoNodePoolResponse) GetServersOk() (*[]DtoServerResponse, bool)` + +GetServersOk returns a tuple with the Servers field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetServers + +`func (o *DtoNodePoolResponse) SetServers(v []DtoServerResponse)` + +SetServers sets Servers field to given value. + +### HasServers + +`func (o *DtoNodePoolResponse) HasServers() bool` + +HasServers returns a boolean if a field has been set. + +### GetTaints + +`func (o *DtoNodePoolResponse) GetTaints() []DtoTaintResponse` + +GetTaints returns the Taints field if non-nil, zero value otherwise. + +### GetTaintsOk + +`func (o *DtoNodePoolResponse) GetTaintsOk() (*[]DtoTaintResponse, bool)` + +GetTaintsOk returns a tuple with the Taints field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTaints + +`func (o *DtoNodePoolResponse) SetTaints(v []DtoTaintResponse)` + +SetTaints sets Taints field to given value. + +### HasTaints + +`func (o *DtoNodePoolResponse) HasTaints() bool` + +HasTaints returns a boolean if a field has been set. + +### GetUpdatedAt + +`func (o *DtoNodePoolResponse) GetUpdatedAt() string` + +GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise. + +### GetUpdatedAtOk + +`func (o *DtoNodePoolResponse) GetUpdatedAtOk() (*string, bool)` + +GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUpdatedAt + +`func (o *DtoNodePoolResponse) SetUpdatedAt(v string)` + +SetUpdatedAt sets UpdatedAt field to given value. + +### HasUpdatedAt + +`func (o *DtoNodePoolResponse) HasUpdatedAt() bool` + +HasUpdatedAt returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/go/docs/DtoUpdateNodePoolRequest.md b/sdk/go/docs/DtoUpdateNodePoolRequest.md new file mode 100644 index 0000000..d0df3b6 --- /dev/null +++ b/sdk/go/docs/DtoUpdateNodePoolRequest.md @@ -0,0 +1,82 @@ +# DtoUpdateNodePoolRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | | [optional] +**Role** | Pointer to **string** | | [optional] + +## Methods + +### NewDtoUpdateNodePoolRequest + +`func NewDtoUpdateNodePoolRequest() *DtoUpdateNodePoolRequest` + +NewDtoUpdateNodePoolRequest instantiates a new DtoUpdateNodePoolRequest object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewDtoUpdateNodePoolRequestWithDefaults + +`func NewDtoUpdateNodePoolRequestWithDefaults() *DtoUpdateNodePoolRequest` + +NewDtoUpdateNodePoolRequestWithDefaults instantiates a new DtoUpdateNodePoolRequest object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetName + +`func (o *DtoUpdateNodePoolRequest) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *DtoUpdateNodePoolRequest) GetNameOk() (*string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetName + +`func (o *DtoUpdateNodePoolRequest) SetName(v string)` + +SetName sets Name field to given value. + +### HasName + +`func (o *DtoUpdateNodePoolRequest) HasName() bool` + +HasName returns a boolean if a field has been set. + +### GetRole + +`func (o *DtoUpdateNodePoolRequest) GetRole() string` + +GetRole returns the Role field if non-nil, zero value otherwise. + +### GetRoleOk + +`func (o *DtoUpdateNodePoolRequest) GetRoleOk() (*string, bool)` + +GetRoleOk returns a tuple with the Role field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRole + +`func (o *DtoUpdateNodePoolRequest) SetRole(v string)` + +SetRole sets Role field to given value. + +### HasRole + +`func (o *DtoUpdateNodePoolRequest) HasRole() bool` + +HasRole returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/sdk/go/docs/HealthAPI.md b/sdk/go/docs/HealthAPI.md index 35d525c..5218945 100644 --- a/sdk/go/docs/HealthAPI.md +++ b/sdk/go/docs/HealthAPI.md @@ -1,6 +1,6 @@ # \HealthAPI -All URIs are relative to *http://localhost:8080/api/v1* +All URIs are relative to */api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/sdk/go/docs/LabelsAPI.md b/sdk/go/docs/LabelsAPI.md index fc32a9f..981f4ac 100644 --- a/sdk/go/docs/LabelsAPI.md +++ b/sdk/go/docs/LabelsAPI.md @@ -1,6 +1,6 @@ # \LabelsAPI -All URIs are relative to *http://localhost:8080/api/v1* +All URIs are relative to */api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/sdk/go/docs/MeAPI.md b/sdk/go/docs/MeAPI.md index 645e1cd..a122ff4 100644 --- a/sdk/go/docs/MeAPI.md +++ b/sdk/go/docs/MeAPI.md @@ -1,6 +1,6 @@ # \MeAPI -All URIs are relative to *http://localhost:8080/api/v1* +All URIs are relative to */api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/sdk/go/docs/MeAPIKeysAPI.md b/sdk/go/docs/MeAPIKeysAPI.md index d6c4952..111d2f0 100644 --- a/sdk/go/docs/MeAPIKeysAPI.md +++ b/sdk/go/docs/MeAPIKeysAPI.md @@ -1,6 +1,6 @@ # \MeAPIKeysAPI -All URIs are relative to *http://localhost:8080/api/v1* +All URIs are relative to */api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/sdk/go/docs/NodePoolsAPI.md b/sdk/go/docs/NodePoolsAPI.md new file mode 100644 index 0000000..8a28b36 --- /dev/null +++ b/sdk/go/docs/NodePoolsAPI.md @@ -0,0 +1,1239 @@ +# \NodePoolsAPI + +All URIs are relative to */api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AttachNodePoolAnnotations**](NodePoolsAPI.md#AttachNodePoolAnnotations) | **Post** /node-pools/{id}/annotations | Attach annotation to a node pool (org scoped) +[**AttachNodePoolLabels**](NodePoolsAPI.md#AttachNodePoolLabels) | **Post** /node-pools/{id}/labels | Attach labels to a node pool (org scoped) +[**AttachNodePoolServers**](NodePoolsAPI.md#AttachNodePoolServers) | **Post** /node-pools/{id}/servers | Attach servers to a node pool (org scoped) +[**AttachNodePoolTaints**](NodePoolsAPI.md#AttachNodePoolTaints) | **Post** /node-pools/{id}/taints | Attach taints to a node pool (org scoped) +[**CreateNodePool**](NodePoolsAPI.md#CreateNodePool) | **Post** /node-pools | Create node pool (org scoped) +[**DeleteNodePool**](NodePoolsAPI.md#DeleteNodePool) | **Delete** /node-pools/{id} | Delete node pool (org scoped) +[**DetachNodePoolAnnotation**](NodePoolsAPI.md#DetachNodePoolAnnotation) | **Delete** /node-pools/{id}/annotations/{annotationId} | Detach one annotation from a node pool (org scoped) +[**DetachNodePoolLabel**](NodePoolsAPI.md#DetachNodePoolLabel) | **Delete** /node-pools/{id}/labels/{labelId} | Detach one label from a node pool (org scoped) +[**DetachNodePoolServer**](NodePoolsAPI.md#DetachNodePoolServer) | **Delete** /node-pools/{id}/servers/{serverId} | Detach one server from a node pool (org scoped) +[**DetachNodePoolTaint**](NodePoolsAPI.md#DetachNodePoolTaint) | **Delete** /node-pools/{id}/taints/{taintId} | Detach one taint from a node pool (org scoped) +[**GetNodePool**](NodePoolsAPI.md#GetNodePool) | **Get** /node-pools/{id} | Get node pool by ID (org scoped) +[**ListNodePoolAnnotations**](NodePoolsAPI.md#ListNodePoolAnnotations) | **Get** /node-pools/{id}/annotations | List annotations attached to a node pool (org scoped) +[**ListNodePoolLabels**](NodePoolsAPI.md#ListNodePoolLabels) | **Get** /node-pools/{id}/labels | List labels attached to a node pool (org scoped) +[**ListNodePoolServers**](NodePoolsAPI.md#ListNodePoolServers) | **Get** /node-pools/{id}/servers | List servers attached to a node pool (org scoped) +[**ListNodePoolTaints**](NodePoolsAPI.md#ListNodePoolTaints) | **Get** /node-pools/{id}/taints | List taints attached to a node pool (org scoped) +[**ListNodePools**](NodePoolsAPI.md#ListNodePools) | **Get** /node-pools | List node pools (org scoped) +[**UpdateNodePool**](NodePoolsAPI.md#UpdateNodePool) | **Patch** /node-pools/{id} | Update node pool (org scoped) + + + +## AttachNodePoolAnnotations + +> string AttachNodePoolAnnotations(ctx, id).Body(body).XOrgID(xOrgID).Execute() + +Attach annotation to a node pool (org scoped) + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/glueops/autoglue-sdk-go" +) + +func main() { + id := "id_example" // string | Node Group ID (UUID) + body := *openapiclient.NewDtoAttachAnnotationsRequest() // DtoAttachAnnotationsRequest | Annotation IDs to attach + xOrgID := "xOrgID_example" // string | Organization UUID (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodePoolsAPI.AttachNodePoolAnnotations(context.Background(), id).Body(body).XOrgID(xOrgID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NodePoolsAPI.AttachNodePoolAnnotations``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AttachNodePoolAnnotations`: string + fmt.Fprintf(os.Stdout, "Response from `NodePoolsAPI.AttachNodePoolAnnotations`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Node Group ID (UUID) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAttachNodePoolAnnotationsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**DtoAttachAnnotationsRequest**](DtoAttachAnnotationsRequest.md) | Annotation IDs to attach | + **xOrgID** | **string** | Organization UUID | + +### Return type + +**string** + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## AttachNodePoolLabels + +> string AttachNodePoolLabels(ctx, id).Body(body).XOrgID(xOrgID).Execute() + +Attach labels to a node pool (org scoped) + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/glueops/autoglue-sdk-go" +) + +func main() { + id := "id_example" // string | Node Pool ID (UUID) + body := *openapiclient.NewDtoAttachLabelsRequest() // DtoAttachLabelsRequest | Label IDs to attach + xOrgID := "xOrgID_example" // string | Organization UUID (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodePoolsAPI.AttachNodePoolLabels(context.Background(), id).Body(body).XOrgID(xOrgID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NodePoolsAPI.AttachNodePoolLabels``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AttachNodePoolLabels`: string + fmt.Fprintf(os.Stdout, "Response from `NodePoolsAPI.AttachNodePoolLabels`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Node Pool ID (UUID) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAttachNodePoolLabelsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**DtoAttachLabelsRequest**](DtoAttachLabelsRequest.md) | Label IDs to attach | + **xOrgID** | **string** | Organization UUID | + +### Return type + +**string** + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## AttachNodePoolServers + +> string AttachNodePoolServers(ctx, id).Body(body).XOrgID(xOrgID).Execute() + +Attach servers to a node pool (org scoped) + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/glueops/autoglue-sdk-go" +) + +func main() { + id := "id_example" // string | Node Pool ID (UUID) + body := *openapiclient.NewDtoAttachServersRequest() // DtoAttachServersRequest | Server IDs to attach + xOrgID := "xOrgID_example" // string | Organization UUID (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodePoolsAPI.AttachNodePoolServers(context.Background(), id).Body(body).XOrgID(xOrgID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NodePoolsAPI.AttachNodePoolServers``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AttachNodePoolServers`: string + fmt.Fprintf(os.Stdout, "Response from `NodePoolsAPI.AttachNodePoolServers`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Node Pool ID (UUID) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAttachNodePoolServersRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**DtoAttachServersRequest**](DtoAttachServersRequest.md) | Server IDs to attach | + **xOrgID** | **string** | Organization UUID | + +### Return type + +**string** + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## AttachNodePoolTaints + +> string AttachNodePoolTaints(ctx, id).Body(body).XOrgID(xOrgID).Execute() + +Attach taints to a node pool (org scoped) + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/glueops/autoglue-sdk-go" +) + +func main() { + id := "id_example" // string | Node Pool ID (UUID) + body := *openapiclient.NewDtoAttachTaintsRequest() // DtoAttachTaintsRequest | Taint IDs to attach + xOrgID := "xOrgID_example" // string | Organization UUID (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodePoolsAPI.AttachNodePoolTaints(context.Background(), id).Body(body).XOrgID(xOrgID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NodePoolsAPI.AttachNodePoolTaints``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AttachNodePoolTaints`: string + fmt.Fprintf(os.Stdout, "Response from `NodePoolsAPI.AttachNodePoolTaints`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Node Pool ID (UUID) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiAttachNodePoolTaintsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**DtoAttachTaintsRequest**](DtoAttachTaintsRequest.md) | Taint IDs to attach | + **xOrgID** | **string** | Organization UUID | + +### Return type + +**string** + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## CreateNodePool + +> DtoNodePoolResponse CreateNodePool(ctx).Body(body).XOrgID(xOrgID).Execute() + +Create node pool (org scoped) + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/glueops/autoglue-sdk-go" +) + +func main() { + body := *openapiclient.NewDtoCreateNodePoolRequest() // DtoCreateNodePoolRequest | NodePool payload + xOrgID := "xOrgID_example" // string | Organization UUID (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodePoolsAPI.CreateNodePool(context.Background()).Body(body).XOrgID(xOrgID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NodePoolsAPI.CreateNodePool``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `CreateNodePool`: DtoNodePoolResponse + fmt.Fprintf(os.Stdout, "Response from `NodePoolsAPI.CreateNodePool`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiCreateNodePoolRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**DtoCreateNodePoolRequest**](DtoCreateNodePoolRequest.md) | NodePool payload | + **xOrgID** | **string** | Organization UUID | + +### Return type + +[**DtoNodePoolResponse**](DtoNodePoolResponse.md) + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DeleteNodePool + +> string DeleteNodePool(ctx, id).XOrgID(xOrgID).Execute() + +Delete node pool (org scoped) + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/glueops/autoglue-sdk-go" +) + +func main() { + id := "id_example" // string | Node Pool ID (UUID) + xOrgID := "xOrgID_example" // string | Organization UUID (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodePoolsAPI.DeleteNodePool(context.Background(), id).XOrgID(xOrgID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NodePoolsAPI.DeleteNodePool``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `DeleteNodePool`: string + fmt.Fprintf(os.Stdout, "Response from `NodePoolsAPI.DeleteNodePool`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Node Pool ID (UUID) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDeleteNodePoolRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgID** | **string** | Organization UUID | + +### Return type + +**string** + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DetachNodePoolAnnotation + +> string DetachNodePoolAnnotation(ctx, id, annotationId).XOrgID(xOrgID).Execute() + +Detach one annotation from a node pool (org scoped) + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/glueops/autoglue-sdk-go" +) + +func main() { + id := "id_example" // string | Node Pool ID (UUID) + annotationId := "annotationId_example" // string | Annotation ID (UUID) + xOrgID := "xOrgID_example" // string | Organization UUID (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodePoolsAPI.DetachNodePoolAnnotation(context.Background(), id, annotationId).XOrgID(xOrgID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NodePoolsAPI.DetachNodePoolAnnotation``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `DetachNodePoolAnnotation`: string + fmt.Fprintf(os.Stdout, "Response from `NodePoolsAPI.DetachNodePoolAnnotation`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Node Pool ID (UUID) | +**annotationId** | **string** | Annotation ID (UUID) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDetachNodePoolAnnotationRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **xOrgID** | **string** | Organization UUID | + +### Return type + +**string** + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DetachNodePoolLabel + +> string DetachNodePoolLabel(ctx, id, labelId).XOrgID(xOrgID).Execute() + +Detach one label from a node pool (org scoped) + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/glueops/autoglue-sdk-go" +) + +func main() { + id := "id_example" // string | Node Pool ID (UUID) + labelId := "labelId_example" // string | Label ID (UUID) + xOrgID := "xOrgID_example" // string | Organization UUID (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodePoolsAPI.DetachNodePoolLabel(context.Background(), id, labelId).XOrgID(xOrgID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NodePoolsAPI.DetachNodePoolLabel``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `DetachNodePoolLabel`: string + fmt.Fprintf(os.Stdout, "Response from `NodePoolsAPI.DetachNodePoolLabel`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Node Pool ID (UUID) | +**labelId** | **string** | Label ID (UUID) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDetachNodePoolLabelRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **xOrgID** | **string** | Organization UUID | + +### Return type + +**string** + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DetachNodePoolServer + +> string DetachNodePoolServer(ctx, id, serverId).XOrgID(xOrgID).Execute() + +Detach one server from a node pool (org scoped) + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/glueops/autoglue-sdk-go" +) + +func main() { + id := "id_example" // string | Node Pool ID (UUID) + serverId := "serverId_example" // string | Server ID (UUID) + xOrgID := "xOrgID_example" // string | Organization UUID (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodePoolsAPI.DetachNodePoolServer(context.Background(), id, serverId).XOrgID(xOrgID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NodePoolsAPI.DetachNodePoolServer``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `DetachNodePoolServer`: string + fmt.Fprintf(os.Stdout, "Response from `NodePoolsAPI.DetachNodePoolServer`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Node Pool ID (UUID) | +**serverId** | **string** | Server ID (UUID) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDetachNodePoolServerRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **xOrgID** | **string** | Organization UUID | + +### Return type + +**string** + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## DetachNodePoolTaint + +> string DetachNodePoolTaint(ctx, id, taintId).XOrgID(xOrgID).Execute() + +Detach one taint from a node pool (org scoped) + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/glueops/autoglue-sdk-go" +) + +func main() { + id := "id_example" // string | Node Pool ID (UUID) + taintId := "taintId_example" // string | Taint ID (UUID) + xOrgID := "xOrgID_example" // string | Organization UUID (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodePoolsAPI.DetachNodePoolTaint(context.Background(), id, taintId).XOrgID(xOrgID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NodePoolsAPI.DetachNodePoolTaint``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `DetachNodePoolTaint`: string + fmt.Fprintf(os.Stdout, "Response from `NodePoolsAPI.DetachNodePoolTaint`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Node Pool ID (UUID) | +**taintId** | **string** | Taint ID (UUID) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiDetachNodePoolTaintRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **xOrgID** | **string** | Organization UUID | + +### Return type + +**string** + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetNodePool + +> DtoNodePoolResponse GetNodePool(ctx, id).XOrgID(xOrgID).Execute() + +Get node pool by ID (org scoped) + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/glueops/autoglue-sdk-go" +) + +func main() { + id := "id_example" // string | Node Pool ID (UUID) + xOrgID := "xOrgID_example" // string | Organization UUID (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodePoolsAPI.GetNodePool(context.Background(), id).XOrgID(xOrgID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NodePoolsAPI.GetNodePool``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetNodePool`: DtoNodePoolResponse + fmt.Fprintf(os.Stdout, "Response from `NodePoolsAPI.GetNodePool`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Node Pool ID (UUID) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetNodePoolRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgID** | **string** | Organization UUID | + +### Return type + +[**DtoNodePoolResponse**](DtoNodePoolResponse.md) + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ListNodePoolAnnotations + +> []DtoAnnotationResponse ListNodePoolAnnotations(ctx, id).XOrgID(xOrgID).Execute() + +List annotations attached to a node pool (org scoped) + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/glueops/autoglue-sdk-go" +) + +func main() { + id := "id_example" // string | Node Pool ID (UUID) + xOrgID := "xOrgID_example" // string | Organization UUID (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodePoolsAPI.ListNodePoolAnnotations(context.Background(), id).XOrgID(xOrgID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NodePoolsAPI.ListNodePoolAnnotations``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ListNodePoolAnnotations`: []DtoAnnotationResponse + fmt.Fprintf(os.Stdout, "Response from `NodePoolsAPI.ListNodePoolAnnotations`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Node Pool ID (UUID) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiListNodePoolAnnotationsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgID** | **string** | Organization UUID | + +### Return type + +[**[]DtoAnnotationResponse**](DtoAnnotationResponse.md) + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ListNodePoolLabels + +> []DtoLabelResponse ListNodePoolLabels(ctx, id).XOrgID(xOrgID).Execute() + +List labels attached to a node pool (org scoped) + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/glueops/autoglue-sdk-go" +) + +func main() { + id := "id_example" // string | Label Pool ID (UUID) + xOrgID := "xOrgID_example" // string | Organization UUID (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodePoolsAPI.ListNodePoolLabels(context.Background(), id).XOrgID(xOrgID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NodePoolsAPI.ListNodePoolLabels``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ListNodePoolLabels`: []DtoLabelResponse + fmt.Fprintf(os.Stdout, "Response from `NodePoolsAPI.ListNodePoolLabels`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Label Pool ID (UUID) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiListNodePoolLabelsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgID** | **string** | Organization UUID | + +### Return type + +[**[]DtoLabelResponse**](DtoLabelResponse.md) + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ListNodePoolServers + +> []DtoServerResponse ListNodePoolServers(ctx, id).XOrgID(xOrgID).Execute() + +List servers attached to a node pool (org scoped) + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/glueops/autoglue-sdk-go" +) + +func main() { + id := "id_example" // string | Node Pool ID (UUID) + xOrgID := "xOrgID_example" // string | Organization UUID (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodePoolsAPI.ListNodePoolServers(context.Background(), id).XOrgID(xOrgID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NodePoolsAPI.ListNodePoolServers``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ListNodePoolServers`: []DtoServerResponse + fmt.Fprintf(os.Stdout, "Response from `NodePoolsAPI.ListNodePoolServers`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Node Pool ID (UUID) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiListNodePoolServersRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgID** | **string** | Organization UUID | + +### Return type + +[**[]DtoServerResponse**](DtoServerResponse.md) + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ListNodePoolTaints + +> []DtoTaintResponse ListNodePoolTaints(ctx, id).XOrgID(xOrgID).Execute() + +List taints attached to a node pool (org scoped) + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/glueops/autoglue-sdk-go" +) + +func main() { + id := "id_example" // string | Node Pool ID (UUID) + xOrgID := "xOrgID_example" // string | Organization UUID (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodePoolsAPI.ListNodePoolTaints(context.Background(), id).XOrgID(xOrgID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NodePoolsAPI.ListNodePoolTaints``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ListNodePoolTaints`: []DtoTaintResponse + fmt.Fprintf(os.Stdout, "Response from `NodePoolsAPI.ListNodePoolTaints`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Node Pool ID (UUID) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiListNodePoolTaintsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgID** | **string** | Organization UUID | + +### Return type + +[**[]DtoTaintResponse**](DtoTaintResponse.md) + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## ListNodePools + +> []DtoNodePoolResponse ListNodePools(ctx).XOrgID(xOrgID).Q(q).Execute() + +List node pools (org scoped) + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/glueops/autoglue-sdk-go" +) + +func main() { + xOrgID := "xOrgID_example" // string | Organization UUID (optional) + q := "q_example" // string | Name contains (case-insensitive) (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodePoolsAPI.ListNodePools(context.Background()).XOrgID(xOrgID).Q(q).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NodePoolsAPI.ListNodePools``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `ListNodePools`: []DtoNodePoolResponse + fmt.Fprintf(os.Stdout, "Response from `NodePoolsAPI.ListNodePools`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiListNodePoolsRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xOrgID** | **string** | Organization UUID | + **q** | **string** | Name contains (case-insensitive) | + +### Return type + +[**[]DtoNodePoolResponse**](DtoNodePoolResponse.md) + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdateNodePool + +> DtoNodePoolResponse UpdateNodePool(ctx, id).Body(body).XOrgID(xOrgID).Execute() + +Update node pool (org scoped) + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + openapiclient "github.com/glueops/autoglue-sdk-go" +) + +func main() { + id := "id_example" // string | Node Pool ID (UUID) + body := *openapiclient.NewDtoUpdateNodePoolRequest() // DtoUpdateNodePoolRequest | Fields to update + xOrgID := "xOrgID_example" // string | Organization UUID (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.NodePoolsAPI.UpdateNodePool(context.Background(), id).Body(body).XOrgID(xOrgID).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `NodePoolsAPI.UpdateNodePool``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UpdateNodePool`: DtoNodePoolResponse + fmt.Fprintf(os.Stdout, "Response from `NodePoolsAPI.UpdateNodePool`: %v\n", resp) +} +``` + +### Path Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**id** | **string** | Node Pool ID (UUID) | + +### Other Parameters + +Other parameters are passed through a pointer to a apiUpdateNodePoolRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**DtoUpdateNodePoolRequest**](DtoUpdateNodePoolRequest.md) | Fields to update | + **xOrgID** | **string** | Organization UUID | + +### Return type + +[**DtoNodePoolResponse**](DtoNodePoolResponse.md) + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/sdk/go/docs/OrgsAPI.md b/sdk/go/docs/OrgsAPI.md index 7f4980c..6b80b4f 100644 --- a/sdk/go/docs/OrgsAPI.md +++ b/sdk/go/docs/OrgsAPI.md @@ -1,6 +1,6 @@ # \OrgsAPI -All URIs are relative to *http://localhost:8080/api/v1* +All URIs are relative to */api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/sdk/go/docs/ServersAPI.md b/sdk/go/docs/ServersAPI.md index 6e146a4..194ffae 100644 --- a/sdk/go/docs/ServersAPI.md +++ b/sdk/go/docs/ServersAPI.md @@ -1,6 +1,6 @@ # \ServersAPI -All URIs are relative to *http://localhost:8080/api/v1* +All URIs are relative to */api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/sdk/go/docs/SshAPI.md b/sdk/go/docs/SshAPI.md index 23ea6c9..e80e1cd 100644 --- a/sdk/go/docs/SshAPI.md +++ b/sdk/go/docs/SshAPI.md @@ -1,6 +1,6 @@ # \SshAPI -All URIs are relative to *http://localhost:8080/api/v1* +All URIs are relative to */api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/sdk/go/docs/TaintsAPI.md b/sdk/go/docs/TaintsAPI.md index f318565..79c7dc3 100644 --- a/sdk/go/docs/TaintsAPI.md +++ b/sdk/go/docs/TaintsAPI.md @@ -1,6 +1,6 @@ # \TaintsAPI -All URIs are relative to *http://localhost:8080/api/v1* +All URIs are relative to */api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- diff --git a/sdk/go/go.mod b/sdk/go/go.mod index d33324b..7ea76d9 100644 --- a/sdk/go/go.mod +++ b/sdk/go/go.mod @@ -1,6 +1,6 @@ module github.com/glueops/autoglue-sdk-go -go 1.25.3 +go 1.25.4 require github.com/stretchr/testify v1.11.1 diff --git a/sdk/go/model_dto_attach_annotations_request.go b/sdk/go/model_dto_attach_annotations_request.go new file mode 100644 index 0000000..e64a148 --- /dev/null +++ b/sdk/go/model_dto_attach_annotations_request.go @@ -0,0 +1,124 @@ +/* +AutoGlue API + +API for managing K3s clusters across cloud providers + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package autoglue + +import ( + "encoding/json" +) + +// checks if the DtoAttachAnnotationsRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DtoAttachAnnotationsRequest{} + +// DtoAttachAnnotationsRequest struct for DtoAttachAnnotationsRequest +type DtoAttachAnnotationsRequest struct { + AnnotationIds []string `json:"annotation_ids,omitempty"` +} + +// NewDtoAttachAnnotationsRequest instantiates a new DtoAttachAnnotationsRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDtoAttachAnnotationsRequest() *DtoAttachAnnotationsRequest { + this := DtoAttachAnnotationsRequest{} + return &this +} + +// NewDtoAttachAnnotationsRequestWithDefaults instantiates a new DtoAttachAnnotationsRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDtoAttachAnnotationsRequestWithDefaults() *DtoAttachAnnotationsRequest { + this := DtoAttachAnnotationsRequest{} + return &this +} + +// GetAnnotationIds returns the AnnotationIds field value if set, zero value otherwise. +func (o *DtoAttachAnnotationsRequest) GetAnnotationIds() []string { + if o == nil || IsNil(o.AnnotationIds) { + var ret []string + return ret + } + return o.AnnotationIds +} + +// GetAnnotationIdsOk returns a tuple with the AnnotationIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DtoAttachAnnotationsRequest) GetAnnotationIdsOk() ([]string, bool) { + if o == nil || IsNil(o.AnnotationIds) { + return nil, false + } + return o.AnnotationIds, true +} + +// HasAnnotationIds returns a boolean if a field has been set. +func (o *DtoAttachAnnotationsRequest) HasAnnotationIds() bool { + if o != nil && !IsNil(o.AnnotationIds) { + return true + } + + return false +} + +// SetAnnotationIds gets a reference to the given []string and assigns it to the AnnotationIds field. +func (o *DtoAttachAnnotationsRequest) SetAnnotationIds(v []string) { + o.AnnotationIds = v +} + +func (o DtoAttachAnnotationsRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DtoAttachAnnotationsRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AnnotationIds) { + toSerialize["annotation_ids"] = o.AnnotationIds + } + return toSerialize, nil +} + +type NullableDtoAttachAnnotationsRequest struct { + value *DtoAttachAnnotationsRequest + isSet bool +} + +func (v NullableDtoAttachAnnotationsRequest) Get() *DtoAttachAnnotationsRequest { + return v.value +} + +func (v *NullableDtoAttachAnnotationsRequest) Set(val *DtoAttachAnnotationsRequest) { + v.value = val + v.isSet = true +} + +func (v NullableDtoAttachAnnotationsRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableDtoAttachAnnotationsRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDtoAttachAnnotationsRequest(val *DtoAttachAnnotationsRequest) *NullableDtoAttachAnnotationsRequest { + return &NullableDtoAttachAnnotationsRequest{value: val, isSet: true} +} + +func (v NullableDtoAttachAnnotationsRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDtoAttachAnnotationsRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/sdk/go/model_dto_attach_labels_request.go b/sdk/go/model_dto_attach_labels_request.go new file mode 100644 index 0000000..640e41b --- /dev/null +++ b/sdk/go/model_dto_attach_labels_request.go @@ -0,0 +1,124 @@ +/* +AutoGlue API + +API for managing K3s clusters across cloud providers + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package autoglue + +import ( + "encoding/json" +) + +// checks if the DtoAttachLabelsRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DtoAttachLabelsRequest{} + +// DtoAttachLabelsRequest struct for DtoAttachLabelsRequest +type DtoAttachLabelsRequest struct { + LabelIds []string `json:"label_ids,omitempty"` +} + +// NewDtoAttachLabelsRequest instantiates a new DtoAttachLabelsRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDtoAttachLabelsRequest() *DtoAttachLabelsRequest { + this := DtoAttachLabelsRequest{} + return &this +} + +// NewDtoAttachLabelsRequestWithDefaults instantiates a new DtoAttachLabelsRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDtoAttachLabelsRequestWithDefaults() *DtoAttachLabelsRequest { + this := DtoAttachLabelsRequest{} + return &this +} + +// GetLabelIds returns the LabelIds field value if set, zero value otherwise. +func (o *DtoAttachLabelsRequest) GetLabelIds() []string { + if o == nil || IsNil(o.LabelIds) { + var ret []string + return ret + } + return o.LabelIds +} + +// GetLabelIdsOk returns a tuple with the LabelIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DtoAttachLabelsRequest) GetLabelIdsOk() ([]string, bool) { + if o == nil || IsNil(o.LabelIds) { + return nil, false + } + return o.LabelIds, true +} + +// HasLabelIds returns a boolean if a field has been set. +func (o *DtoAttachLabelsRequest) HasLabelIds() bool { + if o != nil && !IsNil(o.LabelIds) { + return true + } + + return false +} + +// SetLabelIds gets a reference to the given []string and assigns it to the LabelIds field. +func (o *DtoAttachLabelsRequest) SetLabelIds(v []string) { + o.LabelIds = v +} + +func (o DtoAttachLabelsRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DtoAttachLabelsRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.LabelIds) { + toSerialize["label_ids"] = o.LabelIds + } + return toSerialize, nil +} + +type NullableDtoAttachLabelsRequest struct { + value *DtoAttachLabelsRequest + isSet bool +} + +func (v NullableDtoAttachLabelsRequest) Get() *DtoAttachLabelsRequest { + return v.value +} + +func (v *NullableDtoAttachLabelsRequest) Set(val *DtoAttachLabelsRequest) { + v.value = val + v.isSet = true +} + +func (v NullableDtoAttachLabelsRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableDtoAttachLabelsRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDtoAttachLabelsRequest(val *DtoAttachLabelsRequest) *NullableDtoAttachLabelsRequest { + return &NullableDtoAttachLabelsRequest{value: val, isSet: true} +} + +func (v NullableDtoAttachLabelsRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDtoAttachLabelsRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/sdk/go/model_dto_attach_servers_request.go b/sdk/go/model_dto_attach_servers_request.go new file mode 100644 index 0000000..130e4f8 --- /dev/null +++ b/sdk/go/model_dto_attach_servers_request.go @@ -0,0 +1,124 @@ +/* +AutoGlue API + +API for managing K3s clusters across cloud providers + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package autoglue + +import ( + "encoding/json" +) + +// checks if the DtoAttachServersRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DtoAttachServersRequest{} + +// DtoAttachServersRequest struct for DtoAttachServersRequest +type DtoAttachServersRequest struct { + ServerIds []string `json:"server_ids,omitempty"` +} + +// NewDtoAttachServersRequest instantiates a new DtoAttachServersRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDtoAttachServersRequest() *DtoAttachServersRequest { + this := DtoAttachServersRequest{} + return &this +} + +// NewDtoAttachServersRequestWithDefaults instantiates a new DtoAttachServersRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDtoAttachServersRequestWithDefaults() *DtoAttachServersRequest { + this := DtoAttachServersRequest{} + return &this +} + +// GetServerIds returns the ServerIds field value if set, zero value otherwise. +func (o *DtoAttachServersRequest) GetServerIds() []string { + if o == nil || IsNil(o.ServerIds) { + var ret []string + return ret + } + return o.ServerIds +} + +// GetServerIdsOk returns a tuple with the ServerIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DtoAttachServersRequest) GetServerIdsOk() ([]string, bool) { + if o == nil || IsNil(o.ServerIds) { + return nil, false + } + return o.ServerIds, true +} + +// HasServerIds returns a boolean if a field has been set. +func (o *DtoAttachServersRequest) HasServerIds() bool { + if o != nil && !IsNil(o.ServerIds) { + return true + } + + return false +} + +// SetServerIds gets a reference to the given []string and assigns it to the ServerIds field. +func (o *DtoAttachServersRequest) SetServerIds(v []string) { + o.ServerIds = v +} + +func (o DtoAttachServersRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DtoAttachServersRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ServerIds) { + toSerialize["server_ids"] = o.ServerIds + } + return toSerialize, nil +} + +type NullableDtoAttachServersRequest struct { + value *DtoAttachServersRequest + isSet bool +} + +func (v NullableDtoAttachServersRequest) Get() *DtoAttachServersRequest { + return v.value +} + +func (v *NullableDtoAttachServersRequest) Set(val *DtoAttachServersRequest) { + v.value = val + v.isSet = true +} + +func (v NullableDtoAttachServersRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableDtoAttachServersRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDtoAttachServersRequest(val *DtoAttachServersRequest) *NullableDtoAttachServersRequest { + return &NullableDtoAttachServersRequest{value: val, isSet: true} +} + +func (v NullableDtoAttachServersRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDtoAttachServersRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/sdk/go/model_dto_attach_taints_request.go b/sdk/go/model_dto_attach_taints_request.go new file mode 100644 index 0000000..93933bf --- /dev/null +++ b/sdk/go/model_dto_attach_taints_request.go @@ -0,0 +1,124 @@ +/* +AutoGlue API + +API for managing K3s clusters across cloud providers + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package autoglue + +import ( + "encoding/json" +) + +// checks if the DtoAttachTaintsRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DtoAttachTaintsRequest{} + +// DtoAttachTaintsRequest struct for DtoAttachTaintsRequest +type DtoAttachTaintsRequest struct { + TaintIds []string `json:"taint_ids,omitempty"` +} + +// NewDtoAttachTaintsRequest instantiates a new DtoAttachTaintsRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDtoAttachTaintsRequest() *DtoAttachTaintsRequest { + this := DtoAttachTaintsRequest{} + return &this +} + +// NewDtoAttachTaintsRequestWithDefaults instantiates a new DtoAttachTaintsRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDtoAttachTaintsRequestWithDefaults() *DtoAttachTaintsRequest { + this := DtoAttachTaintsRequest{} + return &this +} + +// GetTaintIds returns the TaintIds field value if set, zero value otherwise. +func (o *DtoAttachTaintsRequest) GetTaintIds() []string { + if o == nil || IsNil(o.TaintIds) { + var ret []string + return ret + } + return o.TaintIds +} + +// GetTaintIdsOk returns a tuple with the TaintIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DtoAttachTaintsRequest) GetTaintIdsOk() ([]string, bool) { + if o == nil || IsNil(o.TaintIds) { + return nil, false + } + return o.TaintIds, true +} + +// HasTaintIds returns a boolean if a field has been set. +func (o *DtoAttachTaintsRequest) HasTaintIds() bool { + if o != nil && !IsNil(o.TaintIds) { + return true + } + + return false +} + +// SetTaintIds gets a reference to the given []string and assigns it to the TaintIds field. +func (o *DtoAttachTaintsRequest) SetTaintIds(v []string) { + o.TaintIds = v +} + +func (o DtoAttachTaintsRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DtoAttachTaintsRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.TaintIds) { + toSerialize["taint_ids"] = o.TaintIds + } + return toSerialize, nil +} + +type NullableDtoAttachTaintsRequest struct { + value *DtoAttachTaintsRequest + isSet bool +} + +func (v NullableDtoAttachTaintsRequest) Get() *DtoAttachTaintsRequest { + return v.value +} + +func (v *NullableDtoAttachTaintsRequest) Set(val *DtoAttachTaintsRequest) { + v.value = val + v.isSet = true +} + +func (v NullableDtoAttachTaintsRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableDtoAttachTaintsRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDtoAttachTaintsRequest(val *DtoAttachTaintsRequest) *NullableDtoAttachTaintsRequest { + return &NullableDtoAttachTaintsRequest{value: val, isSet: true} +} + +func (v NullableDtoAttachTaintsRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDtoAttachTaintsRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/sdk/go/model_dto_create_node_pool_request.go b/sdk/go/model_dto_create_node_pool_request.go new file mode 100644 index 0000000..b32b6ff --- /dev/null +++ b/sdk/go/model_dto_create_node_pool_request.go @@ -0,0 +1,160 @@ +/* +AutoGlue API + +API for managing K3s clusters across cloud providers + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package autoglue + +import ( + "encoding/json" +) + +// checks if the DtoCreateNodePoolRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DtoCreateNodePoolRequest{} + +// DtoCreateNodePoolRequest struct for DtoCreateNodePoolRequest +type DtoCreateNodePoolRequest struct { + Name *string `json:"name,omitempty"` + Role *string `json:"role,omitempty"` +} + +// NewDtoCreateNodePoolRequest instantiates a new DtoCreateNodePoolRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDtoCreateNodePoolRequest() *DtoCreateNodePoolRequest { + this := DtoCreateNodePoolRequest{} + return &this +} + +// NewDtoCreateNodePoolRequestWithDefaults instantiates a new DtoCreateNodePoolRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDtoCreateNodePoolRequestWithDefaults() *DtoCreateNodePoolRequest { + this := DtoCreateNodePoolRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *DtoCreateNodePoolRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DtoCreateNodePoolRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *DtoCreateNodePoolRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *DtoCreateNodePoolRequest) SetName(v string) { + o.Name = &v +} + +// GetRole returns the Role field value if set, zero value otherwise. +func (o *DtoCreateNodePoolRequest) GetRole() string { + if o == nil || IsNil(o.Role) { + var ret string + return ret + } + return *o.Role +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DtoCreateNodePoolRequest) GetRoleOk() (*string, bool) { + if o == nil || IsNil(o.Role) { + return nil, false + } + return o.Role, true +} + +// HasRole returns a boolean if a field has been set. +func (o *DtoCreateNodePoolRequest) HasRole() bool { + if o != nil && !IsNil(o.Role) { + return true + } + + return false +} + +// SetRole gets a reference to the given string and assigns it to the Role field. +func (o *DtoCreateNodePoolRequest) SetRole(v string) { + o.Role = &v +} + +func (o DtoCreateNodePoolRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DtoCreateNodePoolRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Role) { + toSerialize["role"] = o.Role + } + return toSerialize, nil +} + +type NullableDtoCreateNodePoolRequest struct { + value *DtoCreateNodePoolRequest + isSet bool +} + +func (v NullableDtoCreateNodePoolRequest) Get() *DtoCreateNodePoolRequest { + return v.value +} + +func (v *NullableDtoCreateNodePoolRequest) Set(val *DtoCreateNodePoolRequest) { + v.value = val + v.isSet = true +} + +func (v NullableDtoCreateNodePoolRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableDtoCreateNodePoolRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDtoCreateNodePoolRequest(val *DtoCreateNodePoolRequest) *NullableDtoCreateNodePoolRequest { + return &NullableDtoCreateNodePoolRequest{value: val, isSet: true} +} + +func (v NullableDtoCreateNodePoolRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDtoCreateNodePoolRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/sdk/go/model_dto_node_pool_response.go b/sdk/go/model_dto_node_pool_response.go new file mode 100644 index 0000000..7b21e45 --- /dev/null +++ b/sdk/go/model_dto_node_pool_response.go @@ -0,0 +1,448 @@ +/* +AutoGlue API + +API for managing K3s clusters across cloud providers + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package autoglue + +import ( + "encoding/json" +) + +// checks if the DtoNodePoolResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DtoNodePoolResponse{} + +// DtoNodePoolResponse struct for DtoNodePoolResponse +type DtoNodePoolResponse struct { + Annotations []DtoAnnotationResponse `json:"annotations,omitempty"` + CreatedAt *string `json:"created_at,omitempty"` + Id *string `json:"id,omitempty"` + Labels []DtoLabelResponse `json:"labels,omitempty"` + Name *string `json:"name,omitempty"` + OrganizationId *string `json:"organization_id,omitempty"` + Role *string `json:"role,omitempty"` + Servers []DtoServerResponse `json:"servers,omitempty"` + Taints []DtoTaintResponse `json:"taints,omitempty"` + UpdatedAt *string `json:"updated_at,omitempty"` +} + +// NewDtoNodePoolResponse instantiates a new DtoNodePoolResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDtoNodePoolResponse() *DtoNodePoolResponse { + this := DtoNodePoolResponse{} + return &this +} + +// NewDtoNodePoolResponseWithDefaults instantiates a new DtoNodePoolResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDtoNodePoolResponseWithDefaults() *DtoNodePoolResponse { + this := DtoNodePoolResponse{} + return &this +} + +// GetAnnotations returns the Annotations field value if set, zero value otherwise. +func (o *DtoNodePoolResponse) GetAnnotations() []DtoAnnotationResponse { + if o == nil || IsNil(o.Annotations) { + var ret []DtoAnnotationResponse + return ret + } + return o.Annotations +} + +// GetAnnotationsOk returns a tuple with the Annotations field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DtoNodePoolResponse) GetAnnotationsOk() ([]DtoAnnotationResponse, bool) { + if o == nil || IsNil(o.Annotations) { + return nil, false + } + return o.Annotations, true +} + +// HasAnnotations returns a boolean if a field has been set. +func (o *DtoNodePoolResponse) HasAnnotations() bool { + if o != nil && !IsNil(o.Annotations) { + return true + } + + return false +} + +// SetAnnotations gets a reference to the given []DtoAnnotationResponse and assigns it to the Annotations field. +func (o *DtoNodePoolResponse) SetAnnotations(v []DtoAnnotationResponse) { + o.Annotations = v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *DtoNodePoolResponse) GetCreatedAt() string { + if o == nil || IsNil(o.CreatedAt) { + var ret string + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DtoNodePoolResponse) GetCreatedAtOk() (*string, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *DtoNodePoolResponse) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field. +func (o *DtoNodePoolResponse) SetCreatedAt(v string) { + o.CreatedAt = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *DtoNodePoolResponse) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DtoNodePoolResponse) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *DtoNodePoolResponse) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *DtoNodePoolResponse) SetId(v string) { + o.Id = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *DtoNodePoolResponse) GetLabels() []DtoLabelResponse { + if o == nil || IsNil(o.Labels) { + var ret []DtoLabelResponse + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DtoNodePoolResponse) GetLabelsOk() ([]DtoLabelResponse, bool) { + if o == nil || IsNil(o.Labels) { + return nil, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *DtoNodePoolResponse) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given []DtoLabelResponse and assigns it to the Labels field. +func (o *DtoNodePoolResponse) SetLabels(v []DtoLabelResponse) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *DtoNodePoolResponse) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DtoNodePoolResponse) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *DtoNodePoolResponse) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *DtoNodePoolResponse) SetName(v string) { + o.Name = &v +} + +// GetOrganizationId returns the OrganizationId field value if set, zero value otherwise. +func (o *DtoNodePoolResponse) GetOrganizationId() string { + if o == nil || IsNil(o.OrganizationId) { + var ret string + return ret + } + return *o.OrganizationId +} + +// GetOrganizationIdOk returns a tuple with the OrganizationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DtoNodePoolResponse) GetOrganizationIdOk() (*string, bool) { + if o == nil || IsNil(o.OrganizationId) { + return nil, false + } + return o.OrganizationId, true +} + +// HasOrganizationId returns a boolean if a field has been set. +func (o *DtoNodePoolResponse) HasOrganizationId() bool { + if o != nil && !IsNil(o.OrganizationId) { + return true + } + + return false +} + +// SetOrganizationId gets a reference to the given string and assigns it to the OrganizationId field. +func (o *DtoNodePoolResponse) SetOrganizationId(v string) { + o.OrganizationId = &v +} + +// GetRole returns the Role field value if set, zero value otherwise. +func (o *DtoNodePoolResponse) GetRole() string { + if o == nil || IsNil(o.Role) { + var ret string + return ret + } + return *o.Role +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DtoNodePoolResponse) GetRoleOk() (*string, bool) { + if o == nil || IsNil(o.Role) { + return nil, false + } + return o.Role, true +} + +// HasRole returns a boolean if a field has been set. +func (o *DtoNodePoolResponse) HasRole() bool { + if o != nil && !IsNil(o.Role) { + return true + } + + return false +} + +// SetRole gets a reference to the given string and assigns it to the Role field. +func (o *DtoNodePoolResponse) SetRole(v string) { + o.Role = &v +} + +// GetServers returns the Servers field value if set, zero value otherwise. +func (o *DtoNodePoolResponse) GetServers() []DtoServerResponse { + if o == nil || IsNil(o.Servers) { + var ret []DtoServerResponse + return ret + } + return o.Servers +} + +// GetServersOk returns a tuple with the Servers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DtoNodePoolResponse) GetServersOk() ([]DtoServerResponse, bool) { + if o == nil || IsNil(o.Servers) { + return nil, false + } + return o.Servers, true +} + +// HasServers returns a boolean if a field has been set. +func (o *DtoNodePoolResponse) HasServers() bool { + if o != nil && !IsNil(o.Servers) { + return true + } + + return false +} + +// SetServers gets a reference to the given []DtoServerResponse and assigns it to the Servers field. +func (o *DtoNodePoolResponse) SetServers(v []DtoServerResponse) { + o.Servers = v +} + +// GetTaints returns the Taints field value if set, zero value otherwise. +func (o *DtoNodePoolResponse) GetTaints() []DtoTaintResponse { + if o == nil || IsNil(o.Taints) { + var ret []DtoTaintResponse + return ret + } + return o.Taints +} + +// GetTaintsOk returns a tuple with the Taints field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DtoNodePoolResponse) GetTaintsOk() ([]DtoTaintResponse, bool) { + if o == nil || IsNil(o.Taints) { + return nil, false + } + return o.Taints, true +} + +// HasTaints returns a boolean if a field has been set. +func (o *DtoNodePoolResponse) HasTaints() bool { + if o != nil && !IsNil(o.Taints) { + return true + } + + return false +} + +// SetTaints gets a reference to the given []DtoTaintResponse and assigns it to the Taints field. +func (o *DtoNodePoolResponse) SetTaints(v []DtoTaintResponse) { + o.Taints = v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *DtoNodePoolResponse) GetUpdatedAt() string { + if o == nil || IsNil(o.UpdatedAt) { + var ret string + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DtoNodePoolResponse) GetUpdatedAtOk() (*string, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *DtoNodePoolResponse) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given string and assigns it to the UpdatedAt field. +func (o *DtoNodePoolResponse) SetUpdatedAt(v string) { + o.UpdatedAt = &v +} + +func (o DtoNodePoolResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DtoNodePoolResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Annotations) { + toSerialize["annotations"] = o.Annotations + } + if !IsNil(o.CreatedAt) { + toSerialize["created_at"] = o.CreatedAt + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.OrganizationId) { + toSerialize["organization_id"] = o.OrganizationId + } + if !IsNil(o.Role) { + toSerialize["role"] = o.Role + } + if !IsNil(o.Servers) { + toSerialize["servers"] = o.Servers + } + if !IsNil(o.Taints) { + toSerialize["taints"] = o.Taints + } + if !IsNil(o.UpdatedAt) { + toSerialize["updated_at"] = o.UpdatedAt + } + return toSerialize, nil +} + +type NullableDtoNodePoolResponse struct { + value *DtoNodePoolResponse + isSet bool +} + +func (v NullableDtoNodePoolResponse) Get() *DtoNodePoolResponse { + return v.value +} + +func (v *NullableDtoNodePoolResponse) Set(val *DtoNodePoolResponse) { + v.value = val + v.isSet = true +} + +func (v NullableDtoNodePoolResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableDtoNodePoolResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDtoNodePoolResponse(val *DtoNodePoolResponse) *NullableDtoNodePoolResponse { + return &NullableDtoNodePoolResponse{value: val, isSet: true} +} + +func (v NullableDtoNodePoolResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDtoNodePoolResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/sdk/go/model_dto_update_node_pool_request.go b/sdk/go/model_dto_update_node_pool_request.go new file mode 100644 index 0000000..2fd73b0 --- /dev/null +++ b/sdk/go/model_dto_update_node_pool_request.go @@ -0,0 +1,160 @@ +/* +AutoGlue API + +API for managing K3s clusters across cloud providers + +API version: 1.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package autoglue + +import ( + "encoding/json" +) + +// checks if the DtoUpdateNodePoolRequest type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DtoUpdateNodePoolRequest{} + +// DtoUpdateNodePoolRequest struct for DtoUpdateNodePoolRequest +type DtoUpdateNodePoolRequest struct { + Name *string `json:"name,omitempty"` + Role *string `json:"role,omitempty"` +} + +// NewDtoUpdateNodePoolRequest instantiates a new DtoUpdateNodePoolRequest object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDtoUpdateNodePoolRequest() *DtoUpdateNodePoolRequest { + this := DtoUpdateNodePoolRequest{} + return &this +} + +// NewDtoUpdateNodePoolRequestWithDefaults instantiates a new DtoUpdateNodePoolRequest object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDtoUpdateNodePoolRequestWithDefaults() *DtoUpdateNodePoolRequest { + this := DtoUpdateNodePoolRequest{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *DtoUpdateNodePoolRequest) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DtoUpdateNodePoolRequest) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *DtoUpdateNodePoolRequest) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *DtoUpdateNodePoolRequest) SetName(v string) { + o.Name = &v +} + +// GetRole returns the Role field value if set, zero value otherwise. +func (o *DtoUpdateNodePoolRequest) GetRole() string { + if o == nil || IsNil(o.Role) { + var ret string + return ret + } + return *o.Role +} + +// GetRoleOk returns a tuple with the Role field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *DtoUpdateNodePoolRequest) GetRoleOk() (*string, bool) { + if o == nil || IsNil(o.Role) { + return nil, false + } + return o.Role, true +} + +// HasRole returns a boolean if a field has been set. +func (o *DtoUpdateNodePoolRequest) HasRole() bool { + if o != nil && !IsNil(o.Role) { + return true + } + + return false +} + +// SetRole gets a reference to the given string and assigns it to the Role field. +func (o *DtoUpdateNodePoolRequest) SetRole(v string) { + o.Role = &v +} + +func (o DtoUpdateNodePoolRequest) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DtoUpdateNodePoolRequest) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Role) { + toSerialize["role"] = o.Role + } + return toSerialize, nil +} + +type NullableDtoUpdateNodePoolRequest struct { + value *DtoUpdateNodePoolRequest + isSet bool +} + +func (v NullableDtoUpdateNodePoolRequest) Get() *DtoUpdateNodePoolRequest { + return v.value +} + +func (v *NullableDtoUpdateNodePoolRequest) Set(val *DtoUpdateNodePoolRequest) { + v.value = val + v.isSet = true +} + +func (v NullableDtoUpdateNodePoolRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableDtoUpdateNodePoolRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDtoUpdateNodePoolRequest(val *DtoUpdateNodePoolRequest) *NullableDtoUpdateNodePoolRequest { + return &NullableDtoUpdateNodePoolRequest{value: val, isSet: true} +} + +func (v NullableDtoUpdateNodePoolRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDtoUpdateNodePoolRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/sdk/go/test/api_node_pools_test.go b/sdk/go/test/api_node_pools_test.go new file mode 100644 index 0000000..1bd02c9 --- /dev/null +++ b/sdk/go/test/api_node_pools_test.go @@ -0,0 +1,264 @@ +/* +AutoGlue API + +Testing NodePoolsAPIService + +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); + +package autoglue + +import ( + "context" + "testing" + + openapiclient "github.com/glueops/autoglue-sdk-go" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func Test_autoglue_NodePoolsAPIService(t *testing.T) { + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + + t.Run("Test NodePoolsAPIService AttachNodePoolAnnotations", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.NodePoolsAPI.AttachNodePoolAnnotations(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test NodePoolsAPIService AttachNodePoolLabels", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.NodePoolsAPI.AttachNodePoolLabels(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test NodePoolsAPIService AttachNodePoolServers", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.NodePoolsAPI.AttachNodePoolServers(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test NodePoolsAPIService AttachNodePoolTaints", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.NodePoolsAPI.AttachNodePoolTaints(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test NodePoolsAPIService CreateNodePool", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.NodePoolsAPI.CreateNodePool(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test NodePoolsAPIService DeleteNodePool", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.NodePoolsAPI.DeleteNodePool(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test NodePoolsAPIService DetachNodePoolAnnotation", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + var annotationId string + + resp, httpRes, err := apiClient.NodePoolsAPI.DetachNodePoolAnnotation(context.Background(), id, annotationId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test NodePoolsAPIService DetachNodePoolLabel", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + var labelId string + + resp, httpRes, err := apiClient.NodePoolsAPI.DetachNodePoolLabel(context.Background(), id, labelId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test NodePoolsAPIService DetachNodePoolServer", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + var serverId string + + resp, httpRes, err := apiClient.NodePoolsAPI.DetachNodePoolServer(context.Background(), id, serverId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test NodePoolsAPIService DetachNodePoolTaint", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + var taintId string + + resp, httpRes, err := apiClient.NodePoolsAPI.DetachNodePoolTaint(context.Background(), id, taintId).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test NodePoolsAPIService GetNodePool", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.NodePoolsAPI.GetNodePool(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test NodePoolsAPIService ListNodePoolAnnotations", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.NodePoolsAPI.ListNodePoolAnnotations(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test NodePoolsAPIService ListNodePoolLabels", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.NodePoolsAPI.ListNodePoolLabels(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test NodePoolsAPIService ListNodePoolServers", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.NodePoolsAPI.ListNodePoolServers(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test NodePoolsAPIService ListNodePoolTaints", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.NodePoolsAPI.ListNodePoolTaints(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test NodePoolsAPIService ListNodePools", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + resp, httpRes, err := apiClient.NodePoolsAPI.ListNodePools(context.Background()).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + + t.Run("Test NodePoolsAPIService UpdateNodePool", func(t *testing.T) { + + t.Skip("skip test") // remove to run test + + var id string + + resp, httpRes, err := apiClient.NodePoolsAPI.UpdateNodePool(context.Background(), id).Execute() + + require.Nil(t, err) + require.NotNil(t, resp) + assert.Equal(t, 200, httpRes.StatusCode) + + }) + +} diff --git a/sdk/ts/.openapi-generator/FILES b/sdk/ts/.openapi-generator/FILES index 67c4490..0dd7431 100644 --- a/sdk/ts/.openapi-generator/FILES +++ b/sdk/ts/.openapi-generator/FILES @@ -6,9 +6,14 @@ docs/AnnotationsApi.md docs/ArcherAdminApi.md docs/AuthApi.md docs/DtoAnnotationResponse.md +docs/DtoAttachAnnotationsRequest.md +docs/DtoAttachLabelsRequest.md +docs/DtoAttachServersRequest.md +docs/DtoAttachTaintsRequest.md docs/DtoAuthStartResponse.md docs/DtoCreateAnnotationRequest.md docs/DtoCreateLabelRequest.md +docs/DtoCreateNodePoolRequest.md docs/DtoCreateSSHRequest.md docs/DtoCreateServerRequest.md docs/DtoCreateTaintRequest.md @@ -18,6 +23,7 @@ docs/DtoJob.md docs/DtoJobStatus.md docs/DtoLabelResponse.md docs/DtoLogoutRequest.md +docs/DtoNodePoolResponse.md docs/DtoPageJob.md docs/DtoQueueInfo.md docs/DtoRefreshRequest.md @@ -28,6 +34,7 @@ docs/DtoTaintResponse.md docs/DtoTokenPair.md docs/DtoUpdateAnnotationRequest.md docs/DtoUpdateLabelRequest.md +docs/DtoUpdateNodePoolRequest.md docs/DtoUpdateServerRequest.md docs/DtoUpdateTaintRequest.md docs/HandlersCreateUserKeyRequest.md @@ -49,6 +56,7 @@ docs/ModelsAPIKey.md docs/ModelsOrganization.md docs/ModelsUser.md docs/ModelsUserEmail.md +docs/NodePoolsApi.md docs/OrgsApi.md docs/ServersApi.md docs/SshApi.md @@ -62,6 +70,7 @@ src/apis/HealthApi.ts src/apis/LabelsApi.ts src/apis/MeAPIKeysApi.ts src/apis/MeApi.ts +src/apis/NodePoolsApi.ts src/apis/OrgsApi.ts src/apis/ServersApi.ts src/apis/SshApi.ts @@ -69,9 +78,14 @@ src/apis/TaintsApi.ts src/apis/index.ts src/index.ts src/models/DtoAnnotationResponse.ts +src/models/DtoAttachAnnotationsRequest.ts +src/models/DtoAttachLabelsRequest.ts +src/models/DtoAttachServersRequest.ts +src/models/DtoAttachTaintsRequest.ts src/models/DtoAuthStartResponse.ts src/models/DtoCreateAnnotationRequest.ts src/models/DtoCreateLabelRequest.ts +src/models/DtoCreateNodePoolRequest.ts src/models/DtoCreateSSHRequest.ts src/models/DtoCreateServerRequest.ts src/models/DtoCreateTaintRequest.ts @@ -81,6 +95,7 @@ src/models/DtoJob.ts src/models/DtoJobStatus.ts src/models/DtoLabelResponse.ts src/models/DtoLogoutRequest.ts +src/models/DtoNodePoolResponse.ts src/models/DtoPageJob.ts src/models/DtoQueueInfo.ts src/models/DtoRefreshRequest.ts @@ -91,6 +106,7 @@ src/models/DtoTaintResponse.ts src/models/DtoTokenPair.ts src/models/DtoUpdateAnnotationRequest.ts src/models/DtoUpdateLabelRequest.ts +src/models/DtoUpdateNodePoolRequest.ts src/models/DtoUpdateServerRequest.ts src/models/DtoUpdateTaintRequest.ts src/models/HandlersCreateUserKeyRequest.ts diff --git a/sdk/ts/README.md b/sdk/ts/README.md index 762dd3c..64ce84c 100644 --- a/sdk/ts/README.md +++ b/sdk/ts/README.md @@ -54,69 +54,91 @@ example().catch(console.error); ### API Endpoints -All URIs are relative to _http://localhost:8080/api/v1_ +All URIs are relative to _/api/v1_ -| Class | Method | HTTP request | Description | -| ---------------- | ------------------------------------------------------------------------- | --------------------------------------- | ----------------------------------------------- | -| _AnnotationsApi_ | [**createAnnotation**](docs/AnnotationsApi.md#createannotation) | **POST** /annotations | Create annotation (org scoped) | -| _AnnotationsApi_ | [**deleteAnnotation**](docs/AnnotationsApi.md#deleteannotation) | **DELETE** /annotations/{id} | Delete annotation (org scoped) | -| _AnnotationsApi_ | [**getAnnotation**](docs/AnnotationsApi.md#getannotation) | **GET** /annotations/{id} | Get annotation by ID (org scoped) | -| _AnnotationsApi_ | [**listAnnotations**](docs/AnnotationsApi.md#listannotations) | **GET** /annotations | List annotations (org scoped) | -| _AnnotationsApi_ | [**updateAnnotation**](docs/AnnotationsApi.md#updateannotation) | **PATCH** /annotations/{id} | Update annotation (org scoped) | -| _ArcherAdminApi_ | [**adminCancelArcherJob**](docs/ArcherAdminApi.md#admincancelarcherjob) | **POST** /admin/archer/jobs/{id}/cancel | Cancel an Archer job (admin) | -| _ArcherAdminApi_ | [**adminEnqueueArcherJob**](docs/ArcherAdminApi.md#adminenqueuearcherjob) | **POST** /admin/archer/jobs | Enqueue a new Archer job (admin) | -| _ArcherAdminApi_ | [**adminListArcherJobs**](docs/ArcherAdminApi.md#adminlistarcherjobs) | **GET** /admin/archer/jobs | List Archer jobs (admin) | -| _ArcherAdminApi_ | [**adminListArcherQueues**](docs/ArcherAdminApi.md#adminlistarcherqueues) | **GET** /admin/archer/queues | List Archer queues (admin) | -| _ArcherAdminApi_ | [**adminRetryArcherJob**](docs/ArcherAdminApi.md#adminretryarcherjob) | **POST** /admin/archer/jobs/{id}/retry | Retry a failed/canceled Archer job (admin) | -| _AuthApi_ | [**authCallback**](docs/AuthApi.md#authcallback) | **GET** /auth/{provider}/callback | Handle social login callback | -| _AuthApi_ | [**authStart**](docs/AuthApi.md#authstart) | **POST** /auth/{provider}/start | Begin social login | -| _AuthApi_ | [**getJWKS**](docs/AuthApi.md#getjwks) | **GET** /.well-known/jwks.json | Get JWKS | -| _AuthApi_ | [**logout**](docs/AuthApi.md#logout) | **POST** /auth/logout | Revoke refresh token family (logout everywhere) | -| _AuthApi_ | [**refresh**](docs/AuthApi.md#refresh) | **POST** /auth/refresh | Rotate refresh token | -| _HealthApi_ | [**healthCheckOperationId**](docs/HealthApi.md#healthcheckoperationid) | **GET** /healthz | Basic health check | -| _LabelsApi_ | [**createLabel**](docs/LabelsApi.md#createlabel) | **POST** /labels | Create label (org scoped) | -| _LabelsApi_ | [**deleteLabel**](docs/LabelsApi.md#deletelabel) | **DELETE** /labels/{id} | Delete label (org scoped) | -| _LabelsApi_ | [**getLabel**](docs/LabelsApi.md#getlabel) | **GET** /labels/{id} | Get label by ID (org scoped) | -| _LabelsApi_ | [**listLabels**](docs/LabelsApi.md#listlabels) | **GET** /labels | List node labels (org scoped) | -| _LabelsApi_ | [**updateLabel**](docs/LabelsApi.md#updatelabel) | **PATCH** /labels/{id} | Update label (org scoped) | -| _MeApi_ | [**getMe**](docs/MeApi.md#getme) | **GET** /me | Get current user profile | -| _MeApi_ | [**updateMe**](docs/MeApi.md#updateme) | **PATCH** /me | Update current user profile | -| _MeAPIKeysApi_ | [**createUserAPIKey**](docs/MeAPIKeysApi.md#createuserapikey) | **POST** /me/api-keys | Create a new user API key | -| _MeAPIKeysApi_ | [**deleteUserAPIKey**](docs/MeAPIKeysApi.md#deleteuserapikey) | **DELETE** /me/api-keys/{id} | Delete a user API key | -| _MeAPIKeysApi_ | [**listUserAPIKeys**](docs/MeAPIKeysApi.md#listuserapikeys) | **GET** /me/api-keys | List my API keys | -| _OrgsApi_ | [**addOrUpdateMember**](docs/OrgsApi.md#addorupdatemember) | **POST** /orgs/{id}/members | Add or update a member (owner/admin) | -| _OrgsApi_ | [**createOrg**](docs/OrgsApi.md#createorg) | **POST** /orgs | Create organization | -| _OrgsApi_ | [**createOrgKey**](docs/OrgsApi.md#createorgkey) | **POST** /orgs/{id}/api-keys | Create org key/secret pair (owner/admin) | -| _OrgsApi_ | [**deleteOrg**](docs/OrgsApi.md#deleteorg) | **DELETE** /orgs/{id} | Delete organization (owner) | -| _OrgsApi_ | [**deleteOrgKey**](docs/OrgsApi.md#deleteorgkey) | **DELETE** /orgs/{id}/api-keys/{key_id} | Delete org key (owner/admin) | -| _OrgsApi_ | [**getOrg**](docs/OrgsApi.md#getorg) | **GET** /orgs/{id} | Get organization | -| _OrgsApi_ | [**listMembers**](docs/OrgsApi.md#listmembers) | **GET** /orgs/{id}/members | List members in org | -| _OrgsApi_ | [**listMyOrgs**](docs/OrgsApi.md#listmyorgs) | **GET** /orgs | List organizations I belong to | -| _OrgsApi_ | [**listOrgKeys**](docs/OrgsApi.md#listorgkeys) | **GET** /orgs/{id}/api-keys | List org-scoped API keys (no secrets) | -| _OrgsApi_ | [**removeMember**](docs/OrgsApi.md#removemember) | **DELETE** /orgs/{id}/members/{user_id} | Remove a member (owner/admin) | -| _OrgsApi_ | [**updateOrg**](docs/OrgsApi.md#updateorg) | **PATCH** /orgs/{id} | Update organization (owner/admin) | -| _ServersApi_ | [**createServer**](docs/ServersApi.md#createserver) | **POST** /servers | Create server (org scoped) | -| _ServersApi_ | [**deleteServer**](docs/ServersApi.md#deleteserver) | **DELETE** /servers/{id} | Delete server (org scoped) | -| _ServersApi_ | [**getServer**](docs/ServersApi.md#getserver) | **GET** /servers/{id} | Get server by ID (org scoped) | -| _ServersApi_ | [**listServers**](docs/ServersApi.md#listservers) | **GET** /servers | List servers (org scoped) | -| _ServersApi_ | [**updateServer**](docs/ServersApi.md#updateserver) | **PATCH** /servers/{id} | Update server (org scoped) | -| _SshApi_ | [**createSSHKey**](docs/SshApi.md#createsshkey) | **POST** /ssh | Create ssh keypair (org scoped) | -| _SshApi_ | [**deleteSSHKey**](docs/SshApi.md#deletesshkey) | **DELETE** /ssh/{id} | Delete ssh keypair (org scoped) | -| _SshApi_ | [**downloadSSHKey**](docs/SshApi.md#downloadsshkey) | **GET** /ssh/{id}/download | Download ssh key files by ID (org scoped) | -| _SshApi_ | [**getSSHKey**](docs/SshApi.md#getsshkey) | **GET** /ssh/{id} | Get ssh key by ID (org scoped) | -| _SshApi_ | [**listPublicSshKeys**](docs/SshApi.md#listpublicsshkeys) | **GET** /ssh | List ssh keys (org scoped) | -| _TaintsApi_ | [**createTaint**](docs/TaintsApi.md#createtaint) | **POST** /taints | Create node taint (org scoped) | -| _TaintsApi_ | [**deleteTaint**](docs/TaintsApi.md#deletetaint) | **DELETE** /taints/{id} | Delete taint (org scoped) | -| _TaintsApi_ | [**getTaint**](docs/TaintsApi.md#gettaint) | **GET** /taints/{id} | Get node taint by ID (org scoped) | -| _TaintsApi_ | [**listTaints**](docs/TaintsApi.md#listtaints) | **GET** /taints | List node pool taints (org scoped) | -| _TaintsApi_ | [**updateTaint**](docs/TaintsApi.md#updatetaint) | **PATCH** /taints/{id} | Update node taint (org scoped) | +| Class | Method | HTTP request | Description | +| ---------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------ | ----------------------------------------------------- | +| _AnnotationsApi_ | [**createAnnotation**](docs/AnnotationsApi.md#createannotation) | **POST** /annotations | Create annotation (org scoped) | +| _AnnotationsApi_ | [**deleteAnnotation**](docs/AnnotationsApi.md#deleteannotation) | **DELETE** /annotations/{id} | Delete annotation (org scoped) | +| _AnnotationsApi_ | [**getAnnotation**](docs/AnnotationsApi.md#getannotation) | **GET** /annotations/{id} | Get annotation by ID (org scoped) | +| _AnnotationsApi_ | [**listAnnotations**](docs/AnnotationsApi.md#listannotations) | **GET** /annotations | List annotations (org scoped) | +| _AnnotationsApi_ | [**updateAnnotation**](docs/AnnotationsApi.md#updateannotation) | **PATCH** /annotations/{id} | Update annotation (org scoped) | +| _ArcherAdminApi_ | [**adminCancelArcherJob**](docs/ArcherAdminApi.md#admincancelarcherjob) | **POST** /admin/archer/jobs/{id}/cancel | Cancel an Archer job (admin) | +| _ArcherAdminApi_ | [**adminEnqueueArcherJob**](docs/ArcherAdminApi.md#adminenqueuearcherjob) | **POST** /admin/archer/jobs | Enqueue a new Archer job (admin) | +| _ArcherAdminApi_ | [**adminListArcherJobs**](docs/ArcherAdminApi.md#adminlistarcherjobs) | **GET** /admin/archer/jobs | List Archer jobs (admin) | +| _ArcherAdminApi_ | [**adminListArcherQueues**](docs/ArcherAdminApi.md#adminlistarcherqueues) | **GET** /admin/archer/queues | List Archer queues (admin) | +| _ArcherAdminApi_ | [**adminRetryArcherJob**](docs/ArcherAdminApi.md#adminretryarcherjob) | **POST** /admin/archer/jobs/{id}/retry | Retry a failed/canceled Archer job (admin) | +| _AuthApi_ | [**authCallback**](docs/AuthApi.md#authcallback) | **GET** /auth/{provider}/callback | Handle social login callback | +| _AuthApi_ | [**authStart**](docs/AuthApi.md#authstart) | **POST** /auth/{provider}/start | Begin social login | +| _AuthApi_ | [**getJWKS**](docs/AuthApi.md#getjwks) | **GET** /.well-known/jwks.json | Get JWKS | +| _AuthApi_ | [**logout**](docs/AuthApi.md#logout) | **POST** /auth/logout | Revoke refresh token family (logout everywhere) | +| _AuthApi_ | [**refresh**](docs/AuthApi.md#refresh) | **POST** /auth/refresh | Rotate refresh token | +| _HealthApi_ | [**healthCheckOperationId**](docs/HealthApi.md#healthcheckoperationid) | **GET** /healthz | Basic health check | +| _LabelsApi_ | [**createLabel**](docs/LabelsApi.md#createlabel) | **POST** /labels | Create label (org scoped) | +| _LabelsApi_ | [**deleteLabel**](docs/LabelsApi.md#deletelabel) | **DELETE** /labels/{id} | Delete label (org scoped) | +| _LabelsApi_ | [**getLabel**](docs/LabelsApi.md#getlabel) | **GET** /labels/{id} | Get label by ID (org scoped) | +| _LabelsApi_ | [**listLabels**](docs/LabelsApi.md#listlabels) | **GET** /labels | List node labels (org scoped) | +| _LabelsApi_ | [**updateLabel**](docs/LabelsApi.md#updatelabel) | **PATCH** /labels/{id} | Update label (org scoped) | +| _MeApi_ | [**getMe**](docs/MeApi.md#getme) | **GET** /me | Get current user profile | +| _MeApi_ | [**updateMe**](docs/MeApi.md#updateme) | **PATCH** /me | Update current user profile | +| _MeAPIKeysApi_ | [**createUserAPIKey**](docs/MeAPIKeysApi.md#createuserapikey) | **POST** /me/api-keys | Create a new user API key | +| _MeAPIKeysApi_ | [**deleteUserAPIKey**](docs/MeAPIKeysApi.md#deleteuserapikey) | **DELETE** /me/api-keys/{id} | Delete a user API key | +| _MeAPIKeysApi_ | [**listUserAPIKeys**](docs/MeAPIKeysApi.md#listuserapikeys) | **GET** /me/api-keys | List my API keys | +| _NodePoolsApi_ | [**attachNodePoolAnnotations**](docs/NodePoolsApi.md#attachnodepoolannotations) | **POST** /node-pools/{id}/annotations | Attach annotation to a node pool (org scoped) | +| _NodePoolsApi_ | [**attachNodePoolLabels**](docs/NodePoolsApi.md#attachnodepoollabels) | **POST** /node-pools/{id}/labels | Attach labels to a node pool (org scoped) | +| _NodePoolsApi_ | [**attachNodePoolServers**](docs/NodePoolsApi.md#attachnodepoolservers) | **POST** /node-pools/{id}/servers | Attach servers to a node pool (org scoped) | +| _NodePoolsApi_ | [**attachNodePoolTaints**](docs/NodePoolsApi.md#attachnodepooltaints) | **POST** /node-pools/{id}/taints | Attach taints to a node pool (org scoped) | +| _NodePoolsApi_ | [**createNodePool**](docs/NodePoolsApi.md#createnodepool) | **POST** /node-pools | Create node pool (org scoped) | +| _NodePoolsApi_ | [**deleteNodePool**](docs/NodePoolsApi.md#deletenodepool) | **DELETE** /node-pools/{id} | Delete node pool (org scoped) | +| _NodePoolsApi_ | [**detachNodePoolAnnotation**](docs/NodePoolsApi.md#detachnodepoolannotation) | **DELETE** /node-pools/{id}/annotations/{annotationId} | Detach one annotation from a node pool (org scoped) | +| _NodePoolsApi_ | [**detachNodePoolLabel**](docs/NodePoolsApi.md#detachnodepoollabel) | **DELETE** /node-pools/{id}/labels/{labelId} | Detach one label from a node pool (org scoped) | +| _NodePoolsApi_ | [**detachNodePoolServer**](docs/NodePoolsApi.md#detachnodepoolserver) | **DELETE** /node-pools/{id}/servers/{serverId} | Detach one server from a node pool (org scoped) | +| _NodePoolsApi_ | [**detachNodePoolTaint**](docs/NodePoolsApi.md#detachnodepooltaint) | **DELETE** /node-pools/{id}/taints/{taintId} | Detach one taint from a node pool (org scoped) | +| _NodePoolsApi_ | [**getNodePool**](docs/NodePoolsApi.md#getnodepool) | **GET** /node-pools/{id} | Get node pool by ID (org scoped) | +| _NodePoolsApi_ | [**listNodePoolAnnotations**](docs/NodePoolsApi.md#listnodepoolannotations) | **GET** /node-pools/{id}/annotations | List annotations attached to a node pool (org scoped) | +| _NodePoolsApi_ | [**listNodePoolLabels**](docs/NodePoolsApi.md#listnodepoollabels) | **GET** /node-pools/{id}/labels | List labels attached to a node pool (org scoped) | +| _NodePoolsApi_ | [**listNodePoolServers**](docs/NodePoolsApi.md#listnodepoolservers) | **GET** /node-pools/{id}/servers | List servers attached to a node pool (org scoped) | +| _NodePoolsApi_ | [**listNodePoolTaints**](docs/NodePoolsApi.md#listnodepooltaints) | **GET** /node-pools/{id}/taints | List taints attached to a node pool (org scoped) | +| _NodePoolsApi_ | [**listNodePools**](docs/NodePoolsApi.md#listnodepools) | **GET** /node-pools | List node pools (org scoped) | +| _NodePoolsApi_ | [**updateNodePool**](docs/NodePoolsApi.md#updatenodepool) | **PATCH** /node-pools/{id} | Update node pool (org scoped) | +| _OrgsApi_ | [**addOrUpdateMember**](docs/OrgsApi.md#addorupdatemember) | **POST** /orgs/{id}/members | Add or update a member (owner/admin) | +| _OrgsApi_ | [**createOrg**](docs/OrgsApi.md#createorg) | **POST** /orgs | Create organization | +| _OrgsApi_ | [**createOrgKey**](docs/OrgsApi.md#createorgkey) | **POST** /orgs/{id}/api-keys | Create org key/secret pair (owner/admin) | +| _OrgsApi_ | [**deleteOrg**](docs/OrgsApi.md#deleteorg) | **DELETE** /orgs/{id} | Delete organization (owner) | +| _OrgsApi_ | [**deleteOrgKey**](docs/OrgsApi.md#deleteorgkey) | **DELETE** /orgs/{id}/api-keys/{key_id} | Delete org key (owner/admin) | +| _OrgsApi_ | [**getOrg**](docs/OrgsApi.md#getorg) | **GET** /orgs/{id} | Get organization | +| _OrgsApi_ | [**listMembers**](docs/OrgsApi.md#listmembers) | **GET** /orgs/{id}/members | List members in org | +| _OrgsApi_ | [**listMyOrgs**](docs/OrgsApi.md#listmyorgs) | **GET** /orgs | List organizations I belong to | +| _OrgsApi_ | [**listOrgKeys**](docs/OrgsApi.md#listorgkeys) | **GET** /orgs/{id}/api-keys | List org-scoped API keys (no secrets) | +| _OrgsApi_ | [**removeMember**](docs/OrgsApi.md#removemember) | **DELETE** /orgs/{id}/members/{user_id} | Remove a member (owner/admin) | +| _OrgsApi_ | [**updateOrg**](docs/OrgsApi.md#updateorg) | **PATCH** /orgs/{id} | Update organization (owner/admin) | +| _ServersApi_ | [**createServer**](docs/ServersApi.md#createserver) | **POST** /servers | Create server (org scoped) | +| _ServersApi_ | [**deleteServer**](docs/ServersApi.md#deleteserver) | **DELETE** /servers/{id} | Delete server (org scoped) | +| _ServersApi_ | [**getServer**](docs/ServersApi.md#getserver) | **GET** /servers/{id} | Get server by ID (org scoped) | +| _ServersApi_ | [**listServers**](docs/ServersApi.md#listservers) | **GET** /servers | List servers (org scoped) | +| _ServersApi_ | [**updateServer**](docs/ServersApi.md#updateserver) | **PATCH** /servers/{id} | Update server (org scoped) | +| _SshApi_ | [**createSSHKey**](docs/SshApi.md#createsshkey) | **POST** /ssh | Create ssh keypair (org scoped) | +| _SshApi_ | [**deleteSSHKey**](docs/SshApi.md#deletesshkey) | **DELETE** /ssh/{id} | Delete ssh keypair (org scoped) | +| _SshApi_ | [**downloadSSHKey**](docs/SshApi.md#downloadsshkey) | **GET** /ssh/{id}/download | Download ssh key files by ID (org scoped) | +| _SshApi_ | [**getSSHKey**](docs/SshApi.md#getsshkey) | **GET** /ssh/{id} | Get ssh key by ID (org scoped) | +| _SshApi_ | [**listPublicSshKeys**](docs/SshApi.md#listpublicsshkeys) | **GET** /ssh | List ssh keys (org scoped) | +| _TaintsApi_ | [**createTaint**](docs/TaintsApi.md#createtaint) | **POST** /taints | Create node taint (org scoped) | +| _TaintsApi_ | [**deleteTaint**](docs/TaintsApi.md#deletetaint) | **DELETE** /taints/{id} | Delete taint (org scoped) | +| _TaintsApi_ | [**getTaint**](docs/TaintsApi.md#gettaint) | **GET** /taints/{id} | Get node taint by ID (org scoped) | +| _TaintsApi_ | [**listTaints**](docs/TaintsApi.md#listtaints) | **GET** /taints | List node pool taints (org scoped) | +| _TaintsApi_ | [**updateTaint**](docs/TaintsApi.md#updatetaint) | **PATCH** /taints/{id} | Update node taint (org scoped) | ### Models - [DtoAnnotationResponse](docs/DtoAnnotationResponse.md) +- [DtoAttachAnnotationsRequest](docs/DtoAttachAnnotationsRequest.md) +- [DtoAttachLabelsRequest](docs/DtoAttachLabelsRequest.md) +- [DtoAttachServersRequest](docs/DtoAttachServersRequest.md) +- [DtoAttachTaintsRequest](docs/DtoAttachTaintsRequest.md) - [DtoAuthStartResponse](docs/DtoAuthStartResponse.md) - [DtoCreateAnnotationRequest](docs/DtoCreateAnnotationRequest.md) - [DtoCreateLabelRequest](docs/DtoCreateLabelRequest.md) +- [DtoCreateNodePoolRequest](docs/DtoCreateNodePoolRequest.md) - [DtoCreateSSHRequest](docs/DtoCreateSSHRequest.md) - [DtoCreateServerRequest](docs/DtoCreateServerRequest.md) - [DtoCreateTaintRequest](docs/DtoCreateTaintRequest.md) @@ -126,6 +148,7 @@ All URIs are relative to _http://localhost:8080/api/v1_ - [DtoJobStatus](docs/DtoJobStatus.md) - [DtoLabelResponse](docs/DtoLabelResponse.md) - [DtoLogoutRequest](docs/DtoLogoutRequest.md) +- [DtoNodePoolResponse](docs/DtoNodePoolResponse.md) - [DtoPageJob](docs/DtoPageJob.md) - [DtoQueueInfo](docs/DtoQueueInfo.md) - [DtoRefreshRequest](docs/DtoRefreshRequest.md) @@ -136,6 +159,7 @@ All URIs are relative to _http://localhost:8080/api/v1_ - [DtoTokenPair](docs/DtoTokenPair.md) - [DtoUpdateAnnotationRequest](docs/DtoUpdateAnnotationRequest.md) - [DtoUpdateLabelRequest](docs/DtoUpdateLabelRequest.md) +- [DtoUpdateNodePoolRequest](docs/DtoUpdateNodePoolRequest.md) - [DtoUpdateServerRequest](docs/DtoUpdateServerRequest.md) - [DtoUpdateTaintRequest](docs/DtoUpdateTaintRequest.md) - [HandlersCreateUserKeyRequest](docs/HandlersCreateUserKeyRequest.md) diff --git a/sdk/ts/docs/AnnotationsApi.md b/sdk/ts/docs/AnnotationsApi.md index 3fb7eda..a1c4c4e 100644 --- a/sdk/ts/docs/AnnotationsApi.md +++ b/sdk/ts/docs/AnnotationsApi.md @@ -1,6 +1,6 @@ # AnnotationsApi -All URIs are relative to _http://localhost:8080/api/v1_ +All URIs are relative to _/api/v1_ | Method | HTTP request | Description | | ---------------------------------------------------------- | ---------------------------- | --------------------------------- | diff --git a/sdk/ts/docs/ArcherAdminApi.md b/sdk/ts/docs/ArcherAdminApi.md index 118c5b2..fb342ba 100644 --- a/sdk/ts/docs/ArcherAdminApi.md +++ b/sdk/ts/docs/ArcherAdminApi.md @@ -1,6 +1,6 @@ # ArcherAdminApi -All URIs are relative to _http://localhost:8080/api/v1_ +All URIs are relative to _/api/v1_ | Method | HTTP request | Description | | -------------------------------------------------------------------- | --------------------------------------- | ------------------------------------------ | diff --git a/sdk/ts/docs/AuthApi.md b/sdk/ts/docs/AuthApi.md index ca893be..4fda760 100644 --- a/sdk/ts/docs/AuthApi.md +++ b/sdk/ts/docs/AuthApi.md @@ -1,6 +1,6 @@ # AuthApi -All URIs are relative to _http://localhost:8080/api/v1_ +All URIs are relative to _/api/v1_ | Method | HTTP request | Description | | ------------------------------------------- | --------------------------------- | ----------------------------------------------- | diff --git a/sdk/ts/docs/DtoAttachAnnotationsRequest.md b/sdk/ts/docs/DtoAttachAnnotationsRequest.md new file mode 100644 index 0000000..fd869da --- /dev/null +++ b/sdk/ts/docs/DtoAttachAnnotationsRequest.md @@ -0,0 +1,30 @@ +# DtoAttachAnnotationsRequest + +## Properties + +| Name | Type | +| ---------------- | ------------------- | +| `annotation_ids` | Array<string> | + +## Example + +```typescript +import type { DtoAttachAnnotationsRequest } from "@glueops/autoglue-sdk-go"; + +// TODO: Update the object below with actual values +const example = { + annotation_ids: null, +} satisfies DtoAttachAnnotationsRequest; + +console.log(example); + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example); +console.log(exampleJSON); + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as DtoAttachAnnotationsRequest; +console.log(exampleParsed); +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/sdk/ts/docs/DtoAttachLabelsRequest.md b/sdk/ts/docs/DtoAttachLabelsRequest.md new file mode 100644 index 0000000..66c49b2 --- /dev/null +++ b/sdk/ts/docs/DtoAttachLabelsRequest.md @@ -0,0 +1,30 @@ +# DtoAttachLabelsRequest + +## Properties + +| Name | Type | +| ----------- | ------------------- | +| `label_ids` | Array<string> | + +## Example + +```typescript +import type { DtoAttachLabelsRequest } from "@glueops/autoglue-sdk-go"; + +// TODO: Update the object below with actual values +const example = { + label_ids: null, +} satisfies DtoAttachLabelsRequest; + +console.log(example); + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example); +console.log(exampleJSON); + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as DtoAttachLabelsRequest; +console.log(exampleParsed); +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/sdk/ts/docs/DtoAttachServersRequest.md b/sdk/ts/docs/DtoAttachServersRequest.md new file mode 100644 index 0000000..3736a10 --- /dev/null +++ b/sdk/ts/docs/DtoAttachServersRequest.md @@ -0,0 +1,30 @@ +# DtoAttachServersRequest + +## Properties + +| Name | Type | +| ------------ | ------------------- | +| `server_ids` | Array<string> | + +## Example + +```typescript +import type { DtoAttachServersRequest } from "@glueops/autoglue-sdk-go"; + +// TODO: Update the object below with actual values +const example = { + server_ids: null, +} satisfies DtoAttachServersRequest; + +console.log(example); + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example); +console.log(exampleJSON); + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as DtoAttachServersRequest; +console.log(exampleParsed); +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/sdk/ts/docs/DtoAttachTaintsRequest.md b/sdk/ts/docs/DtoAttachTaintsRequest.md new file mode 100644 index 0000000..809f0c5 --- /dev/null +++ b/sdk/ts/docs/DtoAttachTaintsRequest.md @@ -0,0 +1,30 @@ +# DtoAttachTaintsRequest + +## Properties + +| Name | Type | +| ----------- | ------------------- | +| `taint_ids` | Array<string> | + +## Example + +```typescript +import type { DtoAttachTaintsRequest } from "@glueops/autoglue-sdk-go"; + +// TODO: Update the object below with actual values +const example = { + taint_ids: null, +} satisfies DtoAttachTaintsRequest; + +console.log(example); + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example); +console.log(exampleJSON); + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as DtoAttachTaintsRequest; +console.log(exampleParsed); +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/sdk/ts/docs/DtoCreateNodePoolRequest.md b/sdk/ts/docs/DtoCreateNodePoolRequest.md new file mode 100644 index 0000000..c72f5e9 --- /dev/null +++ b/sdk/ts/docs/DtoCreateNodePoolRequest.md @@ -0,0 +1,32 @@ +# DtoCreateNodePoolRequest + +## Properties + +| Name | Type | +| ------ | ------ | +| `name` | string | +| `role` | string | + +## Example + +```typescript +import type { DtoCreateNodePoolRequest } from "@glueops/autoglue-sdk-go"; + +// TODO: Update the object below with actual values +const example = { + name: null, + role: null, +} satisfies DtoCreateNodePoolRequest; + +console.log(example); + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example); +console.log(exampleJSON); + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as DtoCreateNodePoolRequest; +console.log(exampleParsed); +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/sdk/ts/docs/DtoNodePoolResponse.md b/sdk/ts/docs/DtoNodePoolResponse.md new file mode 100644 index 0000000..134f95f --- /dev/null +++ b/sdk/ts/docs/DtoNodePoolResponse.md @@ -0,0 +1,48 @@ +# DtoNodePoolResponse + +## Properties + +| Name | Type | +| ----------------- | -------------------------------------------------------------- | +| `annotations` | [Array<DtoAnnotationResponse>](DtoAnnotationResponse.md) | +| `created_at` | string | +| `id` | string | +| `labels` | [Array<DtoLabelResponse>](DtoLabelResponse.md) | +| `name` | string | +| `organization_id` | string | +| `role` | string | +| `servers` | [Array<DtoServerResponse>](DtoServerResponse.md) | +| `taints` | [Array<DtoTaintResponse>](DtoTaintResponse.md) | +| `updated_at` | string | + +## Example + +```typescript +import type { DtoNodePoolResponse } from "@glueops/autoglue-sdk-go"; + +// TODO: Update the object below with actual values +const example = { + annotations: null, + created_at: null, + id: null, + labels: null, + name: null, + organization_id: null, + role: null, + servers: null, + taints: null, + updated_at: null, +} satisfies DtoNodePoolResponse; + +console.log(example); + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example); +console.log(exampleJSON); + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as DtoNodePoolResponse; +console.log(exampleParsed); +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/sdk/ts/docs/DtoServerResponse.md b/sdk/ts/docs/DtoServerResponse.md index 2a51bb8..d756598 100644 --- a/sdk/ts/docs/DtoServerResponse.md +++ b/sdk/ts/docs/DtoServerResponse.md @@ -29,10 +29,10 @@ const example = { organization_id: null, private_ip_address: null, public_ip_address: null, - role: null, + role: master | worker | bastion, ssh_key_id: null, ssh_user: null, - status: null, + status: pending | provisioning | ready | failed, updated_at: null, } satisfies DtoServerResponse; diff --git a/sdk/ts/docs/DtoUpdateNodePoolRequest.md b/sdk/ts/docs/DtoUpdateNodePoolRequest.md new file mode 100644 index 0000000..04f55c0 --- /dev/null +++ b/sdk/ts/docs/DtoUpdateNodePoolRequest.md @@ -0,0 +1,32 @@ +# DtoUpdateNodePoolRequest + +## Properties + +| Name | Type | +| ------ | ------ | +| `name` | string | +| `role` | string | + +## Example + +```typescript +import type { DtoUpdateNodePoolRequest } from "@glueops/autoglue-sdk-go"; + +// TODO: Update the object below with actual values +const example = { + name: null, + role: null, +} satisfies DtoUpdateNodePoolRequest; + +console.log(example); + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example); +console.log(exampleJSON); + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as DtoUpdateNodePoolRequest; +console.log(exampleParsed); +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/sdk/ts/docs/HealthApi.md b/sdk/ts/docs/HealthApi.md index abe6e9f..2c7706e 100644 --- a/sdk/ts/docs/HealthApi.md +++ b/sdk/ts/docs/HealthApi.md @@ -1,6 +1,6 @@ # HealthApi -All URIs are relative to _http://localhost:8080/api/v1_ +All URIs are relative to _/api/v1_ | Method | HTTP request | Description | | ----------------------------------------------------------------- | ---------------- | ------------------ | diff --git a/sdk/ts/docs/LabelsApi.md b/sdk/ts/docs/LabelsApi.md index 9e9a206..bc21c8e 100644 --- a/sdk/ts/docs/LabelsApi.md +++ b/sdk/ts/docs/LabelsApi.md @@ -1,6 +1,6 @@ # LabelsApi -All URIs are relative to _http://localhost:8080/api/v1_ +All URIs are relative to _/api/v1_ | Method | HTTP request | Description | | ------------------------------------------- | ----------------------- | ----------------------------- | diff --git a/sdk/ts/docs/MeAPIKeysApi.md b/sdk/ts/docs/MeAPIKeysApi.md index 069f92f..fc50c98 100644 --- a/sdk/ts/docs/MeAPIKeysApi.md +++ b/sdk/ts/docs/MeAPIKeysApi.md @@ -1,6 +1,6 @@ # MeAPIKeysApi -All URIs are relative to _http://localhost:8080/api/v1_ +All URIs are relative to _/api/v1_ | Method | HTTP request | Description | | -------------------------------------------------------- | ---------------------------- | ------------------------- | diff --git a/sdk/ts/docs/MeApi.md b/sdk/ts/docs/MeApi.md index 4438c2e..9011a75 100644 --- a/sdk/ts/docs/MeApi.md +++ b/sdk/ts/docs/MeApi.md @@ -1,6 +1,6 @@ # MeApi -All URIs are relative to _http://localhost:8080/api/v1_ +All URIs are relative to _/api/v1_ | Method | HTTP request | Description | | --------------------------------- | ------------- | --------------------------- | diff --git a/sdk/ts/docs/NodePoolsApi.md b/sdk/ts/docs/NodePoolsApi.md new file mode 100644 index 0000000..d8100f5 --- /dev/null +++ b/sdk/ts/docs/NodePoolsApi.md @@ -0,0 +1,1366 @@ +# NodePoolsApi + +All URIs are relative to _/api/v1_ + +| Method | HTTP request | Description | +| -------------------------------------------------------------------------- | ------------------------------------------------------ | ----------------------------------------------------- | +| [**attachNodePoolAnnotations**](NodePoolsApi.md#attachnodepoolannotations) | **POST** /node-pools/{id}/annotations | Attach annotation to a node pool (org scoped) | +| [**attachNodePoolLabels**](NodePoolsApi.md#attachnodepoollabels) | **POST** /node-pools/{id}/labels | Attach labels to a node pool (org scoped) | +| [**attachNodePoolServers**](NodePoolsApi.md#attachnodepoolservers) | **POST** /node-pools/{id}/servers | Attach servers to a node pool (org scoped) | +| [**attachNodePoolTaints**](NodePoolsApi.md#attachnodepooltaints) | **POST** /node-pools/{id}/taints | Attach taints to a node pool (org scoped) | +| [**createNodePool**](NodePoolsApi.md#createnodepool) | **POST** /node-pools | Create node pool (org scoped) | +| [**deleteNodePool**](NodePoolsApi.md#deletenodepool) | **DELETE** /node-pools/{id} | Delete node pool (org scoped) | +| [**detachNodePoolAnnotation**](NodePoolsApi.md#detachnodepoolannotation) | **DELETE** /node-pools/{id}/annotations/{annotationId} | Detach one annotation from a node pool (org scoped) | +| [**detachNodePoolLabel**](NodePoolsApi.md#detachnodepoollabel) | **DELETE** /node-pools/{id}/labels/{labelId} | Detach one label from a node pool (org scoped) | +| [**detachNodePoolServer**](NodePoolsApi.md#detachnodepoolserver) | **DELETE** /node-pools/{id}/servers/{serverId} | Detach one server from a node pool (org scoped) | +| [**detachNodePoolTaint**](NodePoolsApi.md#detachnodepooltaint) | **DELETE** /node-pools/{id}/taints/{taintId} | Detach one taint from a node pool (org scoped) | +| [**getNodePool**](NodePoolsApi.md#getnodepool) | **GET** /node-pools/{id} | Get node pool by ID (org scoped) | +| [**listNodePoolAnnotations**](NodePoolsApi.md#listnodepoolannotations) | **GET** /node-pools/{id}/annotations | List annotations attached to a node pool (org scoped) | +| [**listNodePoolLabels**](NodePoolsApi.md#listnodepoollabels) | **GET** /node-pools/{id}/labels | List labels attached to a node pool (org scoped) | +| [**listNodePoolServers**](NodePoolsApi.md#listnodepoolservers) | **GET** /node-pools/{id}/servers | List servers attached to a node pool (org scoped) | +| [**listNodePoolTaints**](NodePoolsApi.md#listnodepooltaints) | **GET** /node-pools/{id}/taints | List taints attached to a node pool (org scoped) | +| [**listNodePools**](NodePoolsApi.md#listnodepools) | **GET** /node-pools | List node pools (org scoped) | +| [**updateNodePool**](NodePoolsApi.md#updatenodepool) | **PATCH** /node-pools/{id} | Update node pool (org scoped) | + +## attachNodePoolAnnotations + +> string attachNodePoolAnnotations(id, body, xOrgID) + +Attach annotation to a node pool (org scoped) + +### Example + +```ts +import { + Configuration, + NodePoolsApi, +} from '@glueops/autoglue-sdk-go'; +import type { AttachNodePoolAnnotationsRequest } from '@glueops/autoglue-sdk-go'; + +async function example() { + console.log("🚀 Testing @glueops/autoglue-sdk-go SDK..."); + const config = new Configuration({ + // To configure API key authorization: OrgKeyAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: OrgSecretAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: BearerAuth + apiKey: "YOUR API KEY", + }); + const api = new NodePoolsApi(config); + + const body = { + // string | Node Group ID (UUID) + id: id_example, + // DtoAttachAnnotationsRequest | Annotation IDs to attach + body: ..., + // string | Organization UUID (optional) + xOrgID: xOrgID_example, + } satisfies AttachNodePoolAnnotationsRequest; + + try { + const data = await api.attachNodePoolAnnotations(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---------- | ------------------------------------------------------------- | ------------------------ | ------------------------------------ | +| **id** | `string` | Node Group ID (UUID) | [Defaults to `undefined`] | +| **body** | [DtoAttachAnnotationsRequest](DtoAttachAnnotationsRequest.md) | Annotation IDs to attach | | +| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] | + +### Return type + +**string** + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------- | ---------------- | +| **204** | No Content | - | +| **400** | invalid id / invalid server_ids | - | +| **401** | Unauthorized | - | +| **403** | organization required | - | +| **404** | not found | - | +| **500** | attach failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +## attachNodePoolLabels + +> string attachNodePoolLabels(id, body, xOrgID) + +Attach labels to a node pool (org scoped) + +### Example + +```ts +import { + Configuration, + NodePoolsApi, +} from '@glueops/autoglue-sdk-go'; +import type { AttachNodePoolLabelsRequest } from '@glueops/autoglue-sdk-go'; + +async function example() { + console.log("🚀 Testing @glueops/autoglue-sdk-go SDK..."); + const config = new Configuration({ + // To configure API key authorization: OrgKeyAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: OrgSecretAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: BearerAuth + apiKey: "YOUR API KEY", + }); + const api = new NodePoolsApi(config); + + const body = { + // string | Node Pool ID (UUID) + id: id_example, + // DtoAttachLabelsRequest | Label IDs to attach + body: ..., + // string | Organization UUID (optional) + xOrgID: xOrgID_example, + } satisfies AttachNodePoolLabelsRequest; + + try { + const data = await api.attachNodePoolLabels(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---------- | --------------------------------------------------- | ------------------- | ------------------------------------ | +| **id** | `string` | Node Pool ID (UUID) | [Defaults to `undefined`] | +| **body** | [DtoAttachLabelsRequest](DtoAttachLabelsRequest.md) | Label IDs to attach | | +| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] | + +### Return type + +**string** + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------- | ---------------- | +| **204** | No Content | - | +| **400** | invalid id / invalid server_ids | - | +| **401** | Unauthorized | - | +| **403** | organization required | - | +| **404** | not found | - | +| **500** | attach failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +## attachNodePoolServers + +> string attachNodePoolServers(id, body, xOrgID) + +Attach servers to a node pool (org scoped) + +### Example + +```ts +import { + Configuration, + NodePoolsApi, +} from '@glueops/autoglue-sdk-go'; +import type { AttachNodePoolServersRequest } from '@glueops/autoglue-sdk-go'; + +async function example() { + console.log("🚀 Testing @glueops/autoglue-sdk-go SDK..."); + const config = new Configuration({ + // To configure API key authorization: OrgKeyAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: OrgSecretAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: BearerAuth + apiKey: "YOUR API KEY", + }); + const api = new NodePoolsApi(config); + + const body = { + // string | Node Pool ID (UUID) + id: id_example, + // DtoAttachServersRequest | Server IDs to attach + body: ..., + // string | Organization UUID (optional) + xOrgID: xOrgID_example, + } satisfies AttachNodePoolServersRequest; + + try { + const data = await api.attachNodePoolServers(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---------- | ----------------------------------------------------- | -------------------- | ------------------------------------ | +| **id** | `string` | Node Pool ID (UUID) | [Defaults to `undefined`] | +| **body** | [DtoAttachServersRequest](DtoAttachServersRequest.md) | Server IDs to attach | | +| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] | + +### Return type + +**string** + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------- | ---------------- | +| **204** | No Content | - | +| **400** | invalid id / invalid server_ids | - | +| **401** | Unauthorized | - | +| **403** | organization required | - | +| **404** | not found | - | +| **500** | attach failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +## attachNodePoolTaints + +> string attachNodePoolTaints(id, body, xOrgID) + +Attach taints to a node pool (org scoped) + +### Example + +```ts +import { + Configuration, + NodePoolsApi, +} from '@glueops/autoglue-sdk-go'; +import type { AttachNodePoolTaintsRequest } from '@glueops/autoglue-sdk-go'; + +async function example() { + console.log("🚀 Testing @glueops/autoglue-sdk-go SDK..."); + const config = new Configuration({ + // To configure API key authorization: OrgKeyAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: OrgSecretAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: BearerAuth + apiKey: "YOUR API KEY", + }); + const api = new NodePoolsApi(config); + + const body = { + // string | Node Pool ID (UUID) + id: id_example, + // DtoAttachTaintsRequest | Taint IDs to attach + body: ..., + // string | Organization UUID (optional) + xOrgID: xOrgID_example, + } satisfies AttachNodePoolTaintsRequest; + + try { + const data = await api.attachNodePoolTaints(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---------- | --------------------------------------------------- | ------------------- | ------------------------------------ | +| **id** | `string` | Node Pool ID (UUID) | [Defaults to `undefined`] | +| **body** | [DtoAttachTaintsRequest](DtoAttachTaintsRequest.md) | Taint IDs to attach | | +| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] | + +### Return type + +**string** + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------------ | ---------------- | +| **204** | No Content | - | +| **400** | invalid id / invalid taint_ids | - | +| **401** | Unauthorized | - | +| **403** | organization required | - | +| **404** | not found | - | +| **500** | attach failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +## createNodePool + +> DtoNodePoolResponse createNodePool(body, xOrgID) + +Create node pool (org scoped) + +Creates a node pool. Optionally attach initial servers. + +### Example + +```ts +import { + Configuration, + NodePoolsApi, +} from '@glueops/autoglue-sdk-go'; +import type { CreateNodePoolRequest } from '@glueops/autoglue-sdk-go'; + +async function example() { + console.log("🚀 Testing @glueops/autoglue-sdk-go SDK..."); + const config = new Configuration({ + // To configure API key authorization: OrgKeyAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: OrgSecretAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: BearerAuth + apiKey: "YOUR API KEY", + }); + const api = new NodePoolsApi(config); + + const body = { + // DtoCreateNodePoolRequest | NodePool payload + body: ..., + // string | Organization UUID (optional) + xOrgID: xOrgID_example, + } satisfies CreateNodePoolRequest; + + try { + const data = await api.createNodePool(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---------- | ------------------------------------------------------- | ----------------- | ------------------------------------ | +| **body** | [DtoCreateNodePoolRequest](DtoCreateNodePoolRequest.md) | NodePool payload | | +| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] | + +### Return type + +[**DtoNodePoolResponse**](DtoNodePoolResponse.md) + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | -------------------------------------------------- | ---------------- | +| **201** | Created | - | +| **400** | invalid json / missing fields / invalid server_ids | - | +| **401** | Unauthorized | - | +| **403** | organization required | - | +| **500** | create failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +## deleteNodePool + +> string deleteNodePool(id, xOrgID) + +Delete node pool (org scoped) + +Permanently deletes the node pool. + +### Example + +```ts +import { Configuration, NodePoolsApi } from "@glueops/autoglue-sdk-go"; +import type { DeleteNodePoolRequest } from "@glueops/autoglue-sdk-go"; + +async function example() { + console.log("🚀 Testing @glueops/autoglue-sdk-go SDK..."); + const config = new Configuration({ + // To configure API key authorization: OrgKeyAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: OrgSecretAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: BearerAuth + apiKey: "YOUR API KEY", + }); + const api = new NodePoolsApi(config); + + const body = { + // string | Node Pool ID (UUID) + id: id_example, + // string | Organization UUID (optional) + xOrgID: xOrgID_example, + } satisfies DeleteNodePoolRequest; + + try { + const data = await api.deleteNodePool(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---------- | -------- | ------------------- | ------------------------------------ | +| **id** | `string` | Node Pool ID (UUID) | [Defaults to `undefined`] | +| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] | + +### Return type + +**string** + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | --------------------- | ---------------- | +| **204** | No Content | - | +| **400** | invalid id | - | +| **401** | Unauthorized | - | +| **403** | organization required | - | +| **500** | delete failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +## detachNodePoolAnnotation + +> string detachNodePoolAnnotation(id, annotationId, xOrgID) + +Detach one annotation from a node pool (org scoped) + +### Example + +```ts +import { Configuration, NodePoolsApi } from "@glueops/autoglue-sdk-go"; +import type { DetachNodePoolAnnotationRequest } from "@glueops/autoglue-sdk-go"; + +async function example() { + console.log("🚀 Testing @glueops/autoglue-sdk-go SDK..."); + const config = new Configuration({ + // To configure API key authorization: OrgKeyAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: OrgSecretAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: BearerAuth + apiKey: "YOUR API KEY", + }); + const api = new NodePoolsApi(config); + + const body = { + // string | Node Pool ID (UUID) + id: id_example, + // string | Annotation ID (UUID) + annotationId: annotationId_example, + // string | Organization UUID (optional) + xOrgID: xOrgID_example, + } satisfies DetachNodePoolAnnotationRequest; + + try { + const data = await api.detachNodePoolAnnotation(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---------------- | -------- | -------------------- | ------------------------------------ | +| **id** | `string` | Node Pool ID (UUID) | [Defaults to `undefined`] | +| **annotationId** | `string` | Annotation ID (UUID) | [Defaults to `undefined`] | +| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] | + +### Return type + +**string** + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | --------------------- | ---------------- | +| **204** | No Content | - | +| **400** | invalid id | - | +| **401** | Unauthorized | - | +| **403** | organization required | - | +| **404** | not found | - | +| **500** | detach failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +## detachNodePoolLabel + +> string detachNodePoolLabel(id, labelId, xOrgID) + +Detach one label from a node pool (org scoped) + +### Example + +```ts +import { Configuration, NodePoolsApi } from "@glueops/autoglue-sdk-go"; +import type { DetachNodePoolLabelRequest } from "@glueops/autoglue-sdk-go"; + +async function example() { + console.log("🚀 Testing @glueops/autoglue-sdk-go SDK..."); + const config = new Configuration({ + // To configure API key authorization: OrgKeyAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: OrgSecretAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: BearerAuth + apiKey: "YOUR API KEY", + }); + const api = new NodePoolsApi(config); + + const body = { + // string | Node Pool ID (UUID) + id: id_example, + // string | Label ID (UUID) + labelId: labelId_example, + // string | Organization UUID (optional) + xOrgID: xOrgID_example, + } satisfies DetachNodePoolLabelRequest; + + try { + const data = await api.detachNodePoolLabel(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +| Name | Type | Description | Notes | +| ----------- | -------- | ------------------- | ------------------------------------ | +| **id** | `string` | Node Pool ID (UUID) | [Defaults to `undefined`] | +| **labelId** | `string` | Label ID (UUID) | [Defaults to `undefined`] | +| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] | + +### Return type + +**string** + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | --------------------- | ---------------- | +| **204** | No Content | - | +| **400** | invalid id | - | +| **401** | Unauthorized | - | +| **403** | organization required | - | +| **404** | not found | - | +| **500** | detach failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +## detachNodePoolServer + +> string detachNodePoolServer(id, serverId, xOrgID) + +Detach one server from a node pool (org scoped) + +### Example + +```ts +import { Configuration, NodePoolsApi } from "@glueops/autoglue-sdk-go"; +import type { DetachNodePoolServerRequest } from "@glueops/autoglue-sdk-go"; + +async function example() { + console.log("🚀 Testing @glueops/autoglue-sdk-go SDK..."); + const config = new Configuration({ + // To configure API key authorization: OrgKeyAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: OrgSecretAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: BearerAuth + apiKey: "YOUR API KEY", + }); + const api = new NodePoolsApi(config); + + const body = { + // string | Node Pool ID (UUID) + id: id_example, + // string | Server ID (UUID) + serverId: serverId_example, + // string | Organization UUID (optional) + xOrgID: xOrgID_example, + } satisfies DetachNodePoolServerRequest; + + try { + const data = await api.detachNodePoolServer(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------ | -------- | ------------------- | ------------------------------------ | +| **id** | `string` | Node Pool ID (UUID) | [Defaults to `undefined`] | +| **serverId** | `string` | Server ID (UUID) | [Defaults to `undefined`] | +| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] | + +### Return type + +**string** + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | --------------------- | ---------------- | +| **204** | No Content | - | +| **400** | invalid id | - | +| **401** | Unauthorized | - | +| **403** | organization required | - | +| **404** | not found | - | +| **500** | detach failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +## detachNodePoolTaint + +> string detachNodePoolTaint(id, taintId, xOrgID) + +Detach one taint from a node pool (org scoped) + +### Example + +```ts +import { Configuration, NodePoolsApi } from "@glueops/autoglue-sdk-go"; +import type { DetachNodePoolTaintRequest } from "@glueops/autoglue-sdk-go"; + +async function example() { + console.log("🚀 Testing @glueops/autoglue-sdk-go SDK..."); + const config = new Configuration({ + // To configure API key authorization: OrgKeyAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: OrgSecretAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: BearerAuth + apiKey: "YOUR API KEY", + }); + const api = new NodePoolsApi(config); + + const body = { + // string | Node Pool ID (UUID) + id: id_example, + // string | Taint ID (UUID) + taintId: taintId_example, + // string | Organization UUID (optional) + xOrgID: xOrgID_example, + } satisfies DetachNodePoolTaintRequest; + + try { + const data = await api.detachNodePoolTaint(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +| Name | Type | Description | Notes | +| ----------- | -------- | ------------------- | ------------------------------------ | +| **id** | `string` | Node Pool ID (UUID) | [Defaults to `undefined`] | +| **taintId** | `string` | Taint ID (UUID) | [Defaults to `undefined`] | +| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] | + +### Return type + +**string** + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | --------------------- | ---------------- | +| **204** | No Content | - | +| **400** | invalid id | - | +| **401** | Unauthorized | - | +| **403** | organization required | - | +| **404** | not found | - | +| **500** | detach failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +## getNodePool + +> DtoNodePoolResponse getNodePool(id, xOrgID) + +Get node pool by ID (org scoped) + +Returns one node pool. Add `include=servers` to include servers. + +### Example + +```ts +import { Configuration, NodePoolsApi } from "@glueops/autoglue-sdk-go"; +import type { GetNodePoolRequest } from "@glueops/autoglue-sdk-go"; + +async function example() { + console.log("🚀 Testing @glueops/autoglue-sdk-go SDK..."); + const config = new Configuration({ + // To configure API key authorization: OrgKeyAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: OrgSecretAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: BearerAuth + apiKey: "YOUR API KEY", + }); + const api = new NodePoolsApi(config); + + const body = { + // string | Node Pool ID (UUID) + id: id_example, + // string | Organization UUID (optional) + xOrgID: xOrgID_example, + } satisfies GetNodePoolRequest; + + try { + const data = await api.getNodePool(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---------- | -------- | ------------------- | ------------------------------------ | +| **id** | `string` | Node Pool ID (UUID) | [Defaults to `undefined`] | +| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] | + +### Return type + +[**DtoNodePoolResponse**](DtoNodePoolResponse.md) + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | --------------------- | ---------------- | +| **200** | OK | - | +| **400** | invalid id | - | +| **401** | Unauthorized | - | +| **403** | organization required | - | +| **404** | not found | - | +| **500** | fetch failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +## listNodePoolAnnotations + +> Array<DtoAnnotationResponse> listNodePoolAnnotations(id, xOrgID) + +List annotations attached to a node pool (org scoped) + +### Example + +```ts +import { Configuration, NodePoolsApi } from "@glueops/autoglue-sdk-go"; +import type { ListNodePoolAnnotationsRequest } from "@glueops/autoglue-sdk-go"; + +async function example() { + console.log("🚀 Testing @glueops/autoglue-sdk-go SDK..."); + const config = new Configuration({ + // To configure API key authorization: OrgKeyAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: OrgSecretAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: BearerAuth + apiKey: "YOUR API KEY", + }); + const api = new NodePoolsApi(config); + + const body = { + // string | Node Pool ID (UUID) + id: id_example, + // string | Organization UUID (optional) + xOrgID: xOrgID_example, + } satisfies ListNodePoolAnnotationsRequest; + + try { + const data = await api.listNodePoolAnnotations(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---------- | -------- | ------------------- | ------------------------------------ | +| **id** | `string` | Node Pool ID (UUID) | [Defaults to `undefined`] | +| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] | + +### Return type + +[**Array<DtoAnnotationResponse>**](DtoAnnotationResponse.md) + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | --------------------- | ---------------- | +| **200** | OK | - | +| **400** | invalid id | - | +| **401** | Unauthorized | - | +| **403** | organization required | - | +| **404** | not found | - | +| **500** | fetch failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +## listNodePoolLabels + +> Array<DtoLabelResponse> listNodePoolLabels(id, xOrgID) + +List labels attached to a node pool (org scoped) + +### Example + +```ts +import { Configuration, NodePoolsApi } from "@glueops/autoglue-sdk-go"; +import type { ListNodePoolLabelsRequest } from "@glueops/autoglue-sdk-go"; + +async function example() { + console.log("🚀 Testing @glueops/autoglue-sdk-go SDK..."); + const config = new Configuration({ + // To configure API key authorization: OrgKeyAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: OrgSecretAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: BearerAuth + apiKey: "YOUR API KEY", + }); + const api = new NodePoolsApi(config); + + const body = { + // string | Label Pool ID (UUID) + id: id_example, + // string | Organization UUID (optional) + xOrgID: xOrgID_example, + } satisfies ListNodePoolLabelsRequest; + + try { + const data = await api.listNodePoolLabels(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---------- | -------- | -------------------- | ------------------------------------ | +| **id** | `string` | Label Pool ID (UUID) | [Defaults to `undefined`] | +| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] | + +### Return type + +[**Array<DtoLabelResponse>**](DtoLabelResponse.md) + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | --------------------- | ---------------- | +| **200** | OK | - | +| **400** | invalid id | - | +| **401** | Unauthorized | - | +| **403** | organization required | - | +| **404** | not found | - | +| **500** | fetch failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +## listNodePoolServers + +> Array<DtoServerResponse> listNodePoolServers(id, xOrgID) + +List servers attached to a node pool (org scoped) + +### Example + +```ts +import { Configuration, NodePoolsApi } from "@glueops/autoglue-sdk-go"; +import type { ListNodePoolServersRequest } from "@glueops/autoglue-sdk-go"; + +async function example() { + console.log("🚀 Testing @glueops/autoglue-sdk-go SDK..."); + const config = new Configuration({ + // To configure API key authorization: OrgKeyAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: OrgSecretAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: BearerAuth + apiKey: "YOUR API KEY", + }); + const api = new NodePoolsApi(config); + + const body = { + // string | Node Pool ID (UUID) + id: id_example, + // string | Organization UUID (optional) + xOrgID: xOrgID_example, + } satisfies ListNodePoolServersRequest; + + try { + const data = await api.listNodePoolServers(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---------- | -------- | ------------------- | ------------------------------------ | +| **id** | `string` | Node Pool ID (UUID) | [Defaults to `undefined`] | +| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] | + +### Return type + +[**Array<DtoServerResponse>**](DtoServerResponse.md) + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | --------------------- | ---------------- | +| **200** | OK | - | +| **400** | invalid id | - | +| **401** | Unauthorized | - | +| **403** | organization required | - | +| **404** | not found | - | +| **500** | fetch failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +## listNodePoolTaints + +> Array<DtoTaintResponse> listNodePoolTaints(id, xOrgID) + +List taints attached to a node pool (org scoped) + +### Example + +```ts +import { Configuration, NodePoolsApi } from "@glueops/autoglue-sdk-go"; +import type { ListNodePoolTaintsRequest } from "@glueops/autoglue-sdk-go"; + +async function example() { + console.log("🚀 Testing @glueops/autoglue-sdk-go SDK..."); + const config = new Configuration({ + // To configure API key authorization: OrgKeyAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: OrgSecretAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: BearerAuth + apiKey: "YOUR API KEY", + }); + const api = new NodePoolsApi(config); + + const body = { + // string | Node Pool ID (UUID) + id: id_example, + // string | Organization UUID (optional) + xOrgID: xOrgID_example, + } satisfies ListNodePoolTaintsRequest; + + try { + const data = await api.listNodePoolTaints(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---------- | -------- | ------------------- | ------------------------------------ | +| **id** | `string` | Node Pool ID (UUID) | [Defaults to `undefined`] | +| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] | + +### Return type + +[**Array<DtoTaintResponse>**](DtoTaintResponse.md) + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | --------------------- | ---------------- | +| **200** | OK | - | +| **400** | invalid id | - | +| **401** | Unauthorized | - | +| **403** | organization required | - | +| **404** | not found | - | +| **500** | fetch failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +## listNodePools + +> Array<DtoNodePoolResponse> listNodePools(xOrgID, q) + +List node pools (org scoped) + +Returns node pools for the organization in X-Org-ID. + +### Example + +```ts +import { Configuration, NodePoolsApi } from "@glueops/autoglue-sdk-go"; +import type { ListNodePoolsRequest } from "@glueops/autoglue-sdk-go"; + +async function example() { + console.log("🚀 Testing @glueops/autoglue-sdk-go SDK..."); + const config = new Configuration({ + // To configure API key authorization: OrgKeyAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: OrgSecretAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: BearerAuth + apiKey: "YOUR API KEY", + }); + const api = new NodePoolsApi(config); + + const body = { + // string | Organization UUID (optional) + xOrgID: xOrgID_example, + // string | Name contains (case-insensitive) (optional) + q: q_example, + } satisfies ListNodePoolsRequest; + + try { + const data = await api.listNodePools(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---------- | -------- | -------------------------------- | ------------------------------------ | +| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] | +| **q** | `string` | Name contains (case-insensitive) | [Optional] [Defaults to `undefined`] | + +### Return type + +[**Array<DtoNodePoolResponse>**](DtoNodePoolResponse.md) + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------- | ---------------- | +| **200** | OK | - | +| **401** | Unauthorized | - | +| **403** | organization required | - | +| **500** | failed to list node pools | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + +## updateNodePool + +> DtoNodePoolResponse updateNodePool(id, body, xOrgID) + +Update node pool (org scoped) + +Partially update node pool fields. + +### Example + +```ts +import { + Configuration, + NodePoolsApi, +} from '@glueops/autoglue-sdk-go'; +import type { UpdateNodePoolRequest } from '@glueops/autoglue-sdk-go'; + +async function example() { + console.log("🚀 Testing @glueops/autoglue-sdk-go SDK..."); + const config = new Configuration({ + // To configure API key authorization: OrgKeyAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: OrgSecretAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: BearerAuth + apiKey: "YOUR API KEY", + }); + const api = new NodePoolsApi(config); + + const body = { + // string | Node Pool ID (UUID) + id: id_example, + // DtoUpdateNodePoolRequest | Fields to update + body: ..., + // string | Organization UUID (optional) + xOrgID: xOrgID_example, + } satisfies UpdateNodePoolRequest; + + try { + const data = await api.updateNodePool(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---------- | ------------------------------------------------------- | ------------------- | ------------------------------------ | +| **id** | `string` | Node Pool ID (UUID) | [Defaults to `undefined`] | +| **body** | [DtoUpdateNodePoolRequest](DtoUpdateNodePoolRequest.md) | Fields to update | | +| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] | + +### Return type + +[**DtoNodePoolResponse**](DtoNodePoolResponse.md) + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +### HTTP response details + +| Status code | Description | Response headers | +| ----------- | ------------------------- | ---------------- | +| **200** | OK | - | +| **400** | invalid id / invalid json | - | +| **401** | Unauthorized | - | +| **403** | organization required | - | +| **404** | not found | - | +| **500** | update failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) diff --git a/sdk/ts/docs/OrgsApi.md b/sdk/ts/docs/OrgsApi.md index 3eac0d7..afad04e 100644 --- a/sdk/ts/docs/OrgsApi.md +++ b/sdk/ts/docs/OrgsApi.md @@ -1,6 +1,6 @@ # OrgsApi -All URIs are relative to _http://localhost:8080/api/v1_ +All URIs are relative to _/api/v1_ | Method | HTTP request | Description | | ----------------------------------------------------- | --------------------------------------- | ---------------------------------------- | diff --git a/sdk/ts/docs/ServersApi.md b/sdk/ts/docs/ServersApi.md index 38f1de6..9af8354 100644 --- a/sdk/ts/docs/ServersApi.md +++ b/sdk/ts/docs/ServersApi.md @@ -1,6 +1,6 @@ # ServersApi -All URIs are relative to _http://localhost:8080/api/v1_ +All URIs are relative to _/api/v1_ | Method | HTTP request | Description | | ---------------------------------------------- | ------------------------ | ----------------------------- | diff --git a/sdk/ts/docs/SshApi.md b/sdk/ts/docs/SshApi.md index fef4aed..3e756ac 100644 --- a/sdk/ts/docs/SshApi.md +++ b/sdk/ts/docs/SshApi.md @@ -1,6 +1,6 @@ # SshApi -All URIs are relative to _http://localhost:8080/api/v1_ +All URIs are relative to _/api/v1_ | Method | HTTP request | Description | | ---------------------------------------------------- | -------------------------- | ----------------------------------------- | diff --git a/sdk/ts/docs/TaintsApi.md b/sdk/ts/docs/TaintsApi.md index 3a9b2ec..bfa2cd0 100644 --- a/sdk/ts/docs/TaintsApi.md +++ b/sdk/ts/docs/TaintsApi.md @@ -1,6 +1,6 @@ # TaintsApi -All URIs are relative to _http://localhost:8080/api/v1_ +All URIs are relative to _/api/v1_ | Method | HTTP request | Description | | ------------------------------------------- | ----------------------- | ---------------------------------- | diff --git a/sdk/ts/package.json b/sdk/ts/package.json index b1f87f5..de57003 100644 --- a/sdk/ts/package.json +++ b/sdk/ts/package.json @@ -16,6 +16,6 @@ "prepare": "npm run build" }, "devDependencies": { - "typescript": "5.9.3" + "typescript": "^4.0 || ^5.0" } } diff --git a/sdk/ts/src/apis/NodePoolsApi.ts b/sdk/ts/src/apis/NodePoolsApi.ts new file mode 100644 index 0000000..2974e5c --- /dev/null +++ b/sdk/ts/src/apis/NodePoolsApi.ts @@ -0,0 +1,1478 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * AutoGlue API + * API for managing K3s clusters across cloud providers + * + * The version of the OpenAPI document: 1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import * as runtime from "../runtime"; +import type { + DtoAnnotationResponse, + DtoAttachAnnotationsRequest, + DtoAttachLabelsRequest, + DtoAttachServersRequest, + DtoAttachTaintsRequest, + DtoCreateNodePoolRequest, + DtoLabelResponse, + DtoNodePoolResponse, + DtoServerResponse, + DtoTaintResponse, + DtoUpdateNodePoolRequest, +} from "../models/index"; +import { + DtoAnnotationResponseFromJSON, + DtoAttachAnnotationsRequestToJSON, + DtoAttachLabelsRequestToJSON, + DtoAttachServersRequestToJSON, + DtoAttachTaintsRequestToJSON, + DtoCreateNodePoolRequestToJSON, + DtoLabelResponseFromJSON, + DtoNodePoolResponseFromJSON, + DtoServerResponseFromJSON, + DtoTaintResponseFromJSON, + DtoUpdateNodePoolRequestToJSON, +} from "../models/index"; + +export interface AttachNodePoolAnnotationsRequest { + id: string; + body: DtoAttachAnnotationsRequest; + xOrgID?: string; +} + +export interface AttachNodePoolLabelsRequest { + id: string; + body: DtoAttachLabelsRequest; + xOrgID?: string; +} + +export interface AttachNodePoolServersRequest { + id: string; + body: DtoAttachServersRequest; + xOrgID?: string; +} + +export interface AttachNodePoolTaintsRequest { + id: string; + body: DtoAttachTaintsRequest; + xOrgID?: string; +} + +export interface CreateNodePoolRequest { + body: DtoCreateNodePoolRequest; + xOrgID?: string; +} + +export interface DeleteNodePoolRequest { + id: string; + xOrgID?: string; +} + +export interface DetachNodePoolAnnotationRequest { + id: string; + annotationId: string; + xOrgID?: string; +} + +export interface DetachNodePoolLabelRequest { + id: string; + labelId: string; + xOrgID?: string; +} + +export interface DetachNodePoolServerRequest { + id: string; + serverId: string; + xOrgID?: string; +} + +export interface DetachNodePoolTaintRequest { + id: string; + taintId: string; + xOrgID?: string; +} + +export interface GetNodePoolRequest { + id: string; + xOrgID?: string; +} + +export interface ListNodePoolAnnotationsRequest { + id: string; + xOrgID?: string; +} + +export interface ListNodePoolLabelsRequest { + id: string; + xOrgID?: string; +} + +export interface ListNodePoolServersRequest { + id: string; + xOrgID?: string; +} + +export interface ListNodePoolTaintsRequest { + id: string; + xOrgID?: string; +} + +export interface ListNodePoolsRequest { + xOrgID?: string; + q?: string; +} + +export interface UpdateNodePoolRequest { + id: string; + body: DtoUpdateNodePoolRequest; + xOrgID?: string; +} + +/** + * + */ +export class NodePoolsApi extends runtime.BaseAPI { + /** + * Attach annotation to a node pool (org scoped) + */ + async attachNodePoolAnnotationsRaw( + requestParameters: AttachNodePoolAnnotationsRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters["id"] == null) { + throw new runtime.RequiredError( + "id", + 'Required parameter "id" was null or undefined when calling attachNodePoolAnnotations().', + ); + } + + if (requestParameters["body"] == null) { + throw new runtime.RequiredError( + "body", + 'Required parameter "body" was null or undefined when calling attachNodePoolAnnotations().', + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters["Content-Type"] = "application/json"; + + if (requestParameters["xOrgID"] != null) { + headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-KEY"] = + await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-SECRET"] = + await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = + await this.configuration.apiKey("Authorization"); // BearerAuth authentication + } + + let urlPath = `/node-pools/{id}/annotations`; + urlPath = urlPath.replace( + `{${"id"}}`, + encodeURIComponent(String(requestParameters["id"])), + ); + + const response = await this.request( + { + path: urlPath, + method: "POST", + headers: headerParameters, + query: queryParameters, + body: DtoAttachAnnotationsRequestToJSON(requestParameters["body"]), + }, + initOverrides, + ); + + if (this.isJsonMime(response.headers.get("content-type"))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Attach annotation to a node pool (org scoped) + */ + async attachNodePoolAnnotations( + requestParameters: AttachNodePoolAnnotationsRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.attachNodePoolAnnotationsRaw( + requestParameters, + initOverrides, + ); + return await response.value(); + } + + /** + * Attach labels to a node pool (org scoped) + */ + async attachNodePoolLabelsRaw( + requestParameters: AttachNodePoolLabelsRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters["id"] == null) { + throw new runtime.RequiredError( + "id", + 'Required parameter "id" was null or undefined when calling attachNodePoolLabels().', + ); + } + + if (requestParameters["body"] == null) { + throw new runtime.RequiredError( + "body", + 'Required parameter "body" was null or undefined when calling attachNodePoolLabels().', + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters["Content-Type"] = "application/json"; + + if (requestParameters["xOrgID"] != null) { + headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-KEY"] = + await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-SECRET"] = + await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = + await this.configuration.apiKey("Authorization"); // BearerAuth authentication + } + + let urlPath = `/node-pools/{id}/labels`; + urlPath = urlPath.replace( + `{${"id"}}`, + encodeURIComponent(String(requestParameters["id"])), + ); + + const response = await this.request( + { + path: urlPath, + method: "POST", + headers: headerParameters, + query: queryParameters, + body: DtoAttachLabelsRequestToJSON(requestParameters["body"]), + }, + initOverrides, + ); + + if (this.isJsonMime(response.headers.get("content-type"))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Attach labels to a node pool (org scoped) + */ + async attachNodePoolLabels( + requestParameters: AttachNodePoolLabelsRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.attachNodePoolLabelsRaw( + requestParameters, + initOverrides, + ); + return await response.value(); + } + + /** + * Attach servers to a node pool (org scoped) + */ + async attachNodePoolServersRaw( + requestParameters: AttachNodePoolServersRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters["id"] == null) { + throw new runtime.RequiredError( + "id", + 'Required parameter "id" was null or undefined when calling attachNodePoolServers().', + ); + } + + if (requestParameters["body"] == null) { + throw new runtime.RequiredError( + "body", + 'Required parameter "body" was null or undefined when calling attachNodePoolServers().', + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters["Content-Type"] = "application/json"; + + if (requestParameters["xOrgID"] != null) { + headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-KEY"] = + await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-SECRET"] = + await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = + await this.configuration.apiKey("Authorization"); // BearerAuth authentication + } + + let urlPath = `/node-pools/{id}/servers`; + urlPath = urlPath.replace( + `{${"id"}}`, + encodeURIComponent(String(requestParameters["id"])), + ); + + const response = await this.request( + { + path: urlPath, + method: "POST", + headers: headerParameters, + query: queryParameters, + body: DtoAttachServersRequestToJSON(requestParameters["body"]), + }, + initOverrides, + ); + + if (this.isJsonMime(response.headers.get("content-type"))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Attach servers to a node pool (org scoped) + */ + async attachNodePoolServers( + requestParameters: AttachNodePoolServersRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.attachNodePoolServersRaw( + requestParameters, + initOverrides, + ); + return await response.value(); + } + + /** + * Attach taints to a node pool (org scoped) + */ + async attachNodePoolTaintsRaw( + requestParameters: AttachNodePoolTaintsRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters["id"] == null) { + throw new runtime.RequiredError( + "id", + 'Required parameter "id" was null or undefined when calling attachNodePoolTaints().', + ); + } + + if (requestParameters["body"] == null) { + throw new runtime.RequiredError( + "body", + 'Required parameter "body" was null or undefined when calling attachNodePoolTaints().', + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters["Content-Type"] = "application/json"; + + if (requestParameters["xOrgID"] != null) { + headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-KEY"] = + await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-SECRET"] = + await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = + await this.configuration.apiKey("Authorization"); // BearerAuth authentication + } + + let urlPath = `/node-pools/{id}/taints`; + urlPath = urlPath.replace( + `{${"id"}}`, + encodeURIComponent(String(requestParameters["id"])), + ); + + const response = await this.request( + { + path: urlPath, + method: "POST", + headers: headerParameters, + query: queryParameters, + body: DtoAttachTaintsRequestToJSON(requestParameters["body"]), + }, + initOverrides, + ); + + if (this.isJsonMime(response.headers.get("content-type"))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Attach taints to a node pool (org scoped) + */ + async attachNodePoolTaints( + requestParameters: AttachNodePoolTaintsRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.attachNodePoolTaintsRaw( + requestParameters, + initOverrides, + ); + return await response.value(); + } + + /** + * Creates a node pool. Optionally attach initial servers. + * Create node pool (org scoped) + */ + async createNodePoolRaw( + requestParameters: CreateNodePoolRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters["body"] == null) { + throw new runtime.RequiredError( + "body", + 'Required parameter "body" was null or undefined when calling createNodePool().', + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters["Content-Type"] = "application/json"; + + if (requestParameters["xOrgID"] != null) { + headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-KEY"] = + await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-SECRET"] = + await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = + await this.configuration.apiKey("Authorization"); // BearerAuth authentication + } + + let urlPath = `/node-pools`; + + const response = await this.request( + { + path: urlPath, + method: "POST", + headers: headerParameters, + query: queryParameters, + body: DtoCreateNodePoolRequestToJSON(requestParameters["body"]), + }, + initOverrides, + ); + + return new runtime.JSONApiResponse(response, (jsonValue) => + DtoNodePoolResponseFromJSON(jsonValue), + ); + } + + /** + * Creates a node pool. Optionally attach initial servers. + * Create node pool (org scoped) + */ + async createNodePool( + requestParameters: CreateNodePoolRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.createNodePoolRaw( + requestParameters, + initOverrides, + ); + return await response.value(); + } + + /** + * Permanently deletes the node pool. + * Delete node pool (org scoped) + */ + async deleteNodePoolRaw( + requestParameters: DeleteNodePoolRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters["id"] == null) { + throw new runtime.RequiredError( + "id", + 'Required parameter "id" was null or undefined when calling deleteNodePool().', + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters["xOrgID"] != null) { + headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-KEY"] = + await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-SECRET"] = + await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = + await this.configuration.apiKey("Authorization"); // BearerAuth authentication + } + + let urlPath = `/node-pools/{id}`; + urlPath = urlPath.replace( + `{${"id"}}`, + encodeURIComponent(String(requestParameters["id"])), + ); + + const response = await this.request( + { + path: urlPath, + method: "DELETE", + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ); + + if (this.isJsonMime(response.headers.get("content-type"))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Permanently deletes the node pool. + * Delete node pool (org scoped) + */ + async deleteNodePool( + requestParameters: DeleteNodePoolRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.deleteNodePoolRaw( + requestParameters, + initOverrides, + ); + return await response.value(); + } + + /** + * Detach one annotation from a node pool (org scoped) + */ + async detachNodePoolAnnotationRaw( + requestParameters: DetachNodePoolAnnotationRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters["id"] == null) { + throw new runtime.RequiredError( + "id", + 'Required parameter "id" was null or undefined when calling detachNodePoolAnnotation().', + ); + } + + if (requestParameters["annotationId"] == null) { + throw new runtime.RequiredError( + "annotationId", + 'Required parameter "annotationId" was null or undefined when calling detachNodePoolAnnotation().', + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters["xOrgID"] != null) { + headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-KEY"] = + await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-SECRET"] = + await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = + await this.configuration.apiKey("Authorization"); // BearerAuth authentication + } + + let urlPath = `/node-pools/{id}/annotations/{annotationId}`; + urlPath = urlPath.replace( + `{${"id"}}`, + encodeURIComponent(String(requestParameters["id"])), + ); + urlPath = urlPath.replace( + `{${"annotationId"}}`, + encodeURIComponent(String(requestParameters["annotationId"])), + ); + + const response = await this.request( + { + path: urlPath, + method: "DELETE", + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ); + + if (this.isJsonMime(response.headers.get("content-type"))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Detach one annotation from a node pool (org scoped) + */ + async detachNodePoolAnnotation( + requestParameters: DetachNodePoolAnnotationRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.detachNodePoolAnnotationRaw( + requestParameters, + initOverrides, + ); + return await response.value(); + } + + /** + * Detach one label from a node pool (org scoped) + */ + async detachNodePoolLabelRaw( + requestParameters: DetachNodePoolLabelRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters["id"] == null) { + throw new runtime.RequiredError( + "id", + 'Required parameter "id" was null or undefined when calling detachNodePoolLabel().', + ); + } + + if (requestParameters["labelId"] == null) { + throw new runtime.RequiredError( + "labelId", + 'Required parameter "labelId" was null or undefined when calling detachNodePoolLabel().', + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters["xOrgID"] != null) { + headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-KEY"] = + await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-SECRET"] = + await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = + await this.configuration.apiKey("Authorization"); // BearerAuth authentication + } + + let urlPath = `/node-pools/{id}/labels/{labelId}`; + urlPath = urlPath.replace( + `{${"id"}}`, + encodeURIComponent(String(requestParameters["id"])), + ); + urlPath = urlPath.replace( + `{${"labelId"}}`, + encodeURIComponent(String(requestParameters["labelId"])), + ); + + const response = await this.request( + { + path: urlPath, + method: "DELETE", + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ); + + if (this.isJsonMime(response.headers.get("content-type"))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Detach one label from a node pool (org scoped) + */ + async detachNodePoolLabel( + requestParameters: DetachNodePoolLabelRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.detachNodePoolLabelRaw( + requestParameters, + initOverrides, + ); + return await response.value(); + } + + /** + * Detach one server from a node pool (org scoped) + */ + async detachNodePoolServerRaw( + requestParameters: DetachNodePoolServerRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters["id"] == null) { + throw new runtime.RequiredError( + "id", + 'Required parameter "id" was null or undefined when calling detachNodePoolServer().', + ); + } + + if (requestParameters["serverId"] == null) { + throw new runtime.RequiredError( + "serverId", + 'Required parameter "serverId" was null or undefined when calling detachNodePoolServer().', + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters["xOrgID"] != null) { + headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-KEY"] = + await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-SECRET"] = + await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = + await this.configuration.apiKey("Authorization"); // BearerAuth authentication + } + + let urlPath = `/node-pools/{id}/servers/{serverId}`; + urlPath = urlPath.replace( + `{${"id"}}`, + encodeURIComponent(String(requestParameters["id"])), + ); + urlPath = urlPath.replace( + `{${"serverId"}}`, + encodeURIComponent(String(requestParameters["serverId"])), + ); + + const response = await this.request( + { + path: urlPath, + method: "DELETE", + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ); + + if (this.isJsonMime(response.headers.get("content-type"))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Detach one server from a node pool (org scoped) + */ + async detachNodePoolServer( + requestParameters: DetachNodePoolServerRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.detachNodePoolServerRaw( + requestParameters, + initOverrides, + ); + return await response.value(); + } + + /** + * Detach one taint from a node pool (org scoped) + */ + async detachNodePoolTaintRaw( + requestParameters: DetachNodePoolTaintRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters["id"] == null) { + throw new runtime.RequiredError( + "id", + 'Required parameter "id" was null or undefined when calling detachNodePoolTaint().', + ); + } + + if (requestParameters["taintId"] == null) { + throw new runtime.RequiredError( + "taintId", + 'Required parameter "taintId" was null or undefined when calling detachNodePoolTaint().', + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters["xOrgID"] != null) { + headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-KEY"] = + await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-SECRET"] = + await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = + await this.configuration.apiKey("Authorization"); // BearerAuth authentication + } + + let urlPath = `/node-pools/{id}/taints/{taintId}`; + urlPath = urlPath.replace( + `{${"id"}}`, + encodeURIComponent(String(requestParameters["id"])), + ); + urlPath = urlPath.replace( + `{${"taintId"}}`, + encodeURIComponent(String(requestParameters["taintId"])), + ); + + const response = await this.request( + { + path: urlPath, + method: "DELETE", + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ); + + if (this.isJsonMime(response.headers.get("content-type"))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Detach one taint from a node pool (org scoped) + */ + async detachNodePoolTaint( + requestParameters: DetachNodePoolTaintRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.detachNodePoolTaintRaw( + requestParameters, + initOverrides, + ); + return await response.value(); + } + + /** + * Returns one node pool. Add `include=servers` to include servers. + * Get node pool by ID (org scoped) + */ + async getNodePoolRaw( + requestParameters: GetNodePoolRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters["id"] == null) { + throw new runtime.RequiredError( + "id", + 'Required parameter "id" was null or undefined when calling getNodePool().', + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters["xOrgID"] != null) { + headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-KEY"] = + await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-SECRET"] = + await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = + await this.configuration.apiKey("Authorization"); // BearerAuth authentication + } + + let urlPath = `/node-pools/{id}`; + urlPath = urlPath.replace( + `{${"id"}}`, + encodeURIComponent(String(requestParameters["id"])), + ); + + const response = await this.request( + { + path: urlPath, + method: "GET", + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ); + + return new runtime.JSONApiResponse(response, (jsonValue) => + DtoNodePoolResponseFromJSON(jsonValue), + ); + } + + /** + * Returns one node pool. Add `include=servers` to include servers. + * Get node pool by ID (org scoped) + */ + async getNodePool( + requestParameters: GetNodePoolRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.getNodePoolRaw( + requestParameters, + initOverrides, + ); + return await response.value(); + } + + /** + * List annotations attached to a node pool (org scoped) + */ + async listNodePoolAnnotationsRaw( + requestParameters: ListNodePoolAnnotationsRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise>> { + if (requestParameters["id"] == null) { + throw new runtime.RequiredError( + "id", + 'Required parameter "id" was null or undefined when calling listNodePoolAnnotations().', + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters["xOrgID"] != null) { + headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-KEY"] = + await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-SECRET"] = + await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = + await this.configuration.apiKey("Authorization"); // BearerAuth authentication + } + + let urlPath = `/node-pools/{id}/annotations`; + urlPath = urlPath.replace( + `{${"id"}}`, + encodeURIComponent(String(requestParameters["id"])), + ); + + const response = await this.request( + { + path: urlPath, + method: "GET", + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ); + + return new runtime.JSONApiResponse(response, (jsonValue) => + jsonValue.map(DtoAnnotationResponseFromJSON), + ); + } + + /** + * List annotations attached to a node pool (org scoped) + */ + async listNodePoolAnnotations( + requestParameters: ListNodePoolAnnotationsRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const response = await this.listNodePoolAnnotationsRaw( + requestParameters, + initOverrides, + ); + return await response.value(); + } + + /** + * List labels attached to a node pool (org scoped) + */ + async listNodePoolLabelsRaw( + requestParameters: ListNodePoolLabelsRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise>> { + if (requestParameters["id"] == null) { + throw new runtime.RequiredError( + "id", + 'Required parameter "id" was null or undefined when calling listNodePoolLabels().', + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters["xOrgID"] != null) { + headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-KEY"] = + await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-SECRET"] = + await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = + await this.configuration.apiKey("Authorization"); // BearerAuth authentication + } + + let urlPath = `/node-pools/{id}/labels`; + urlPath = urlPath.replace( + `{${"id"}}`, + encodeURIComponent(String(requestParameters["id"])), + ); + + const response = await this.request( + { + path: urlPath, + method: "GET", + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ); + + return new runtime.JSONApiResponse(response, (jsonValue) => + jsonValue.map(DtoLabelResponseFromJSON), + ); + } + + /** + * List labels attached to a node pool (org scoped) + */ + async listNodePoolLabels( + requestParameters: ListNodePoolLabelsRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const response = await this.listNodePoolLabelsRaw( + requestParameters, + initOverrides, + ); + return await response.value(); + } + + /** + * List servers attached to a node pool (org scoped) + */ + async listNodePoolServersRaw( + requestParameters: ListNodePoolServersRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise>> { + if (requestParameters["id"] == null) { + throw new runtime.RequiredError( + "id", + 'Required parameter "id" was null or undefined when calling listNodePoolServers().', + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters["xOrgID"] != null) { + headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-KEY"] = + await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-SECRET"] = + await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = + await this.configuration.apiKey("Authorization"); // BearerAuth authentication + } + + let urlPath = `/node-pools/{id}/servers`; + urlPath = urlPath.replace( + `{${"id"}}`, + encodeURIComponent(String(requestParameters["id"])), + ); + + const response = await this.request( + { + path: urlPath, + method: "GET", + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ); + + return new runtime.JSONApiResponse(response, (jsonValue) => + jsonValue.map(DtoServerResponseFromJSON), + ); + } + + /** + * List servers attached to a node pool (org scoped) + */ + async listNodePoolServers( + requestParameters: ListNodePoolServersRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const response = await this.listNodePoolServersRaw( + requestParameters, + initOverrides, + ); + return await response.value(); + } + + /** + * List taints attached to a node pool (org scoped) + */ + async listNodePoolTaintsRaw( + requestParameters: ListNodePoolTaintsRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise>> { + if (requestParameters["id"] == null) { + throw new runtime.RequiredError( + "id", + 'Required parameter "id" was null or undefined when calling listNodePoolTaints().', + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters["xOrgID"] != null) { + headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-KEY"] = + await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-SECRET"] = + await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = + await this.configuration.apiKey("Authorization"); // BearerAuth authentication + } + + let urlPath = `/node-pools/{id}/taints`; + urlPath = urlPath.replace( + `{${"id"}}`, + encodeURIComponent(String(requestParameters["id"])), + ); + + const response = await this.request( + { + path: urlPath, + method: "GET", + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ); + + return new runtime.JSONApiResponse(response, (jsonValue) => + jsonValue.map(DtoTaintResponseFromJSON), + ); + } + + /** + * List taints attached to a node pool (org scoped) + */ + async listNodePoolTaints( + requestParameters: ListNodePoolTaintsRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const response = await this.listNodePoolTaintsRaw( + requestParameters, + initOverrides, + ); + return await response.value(); + } + + /** + * Returns node pools for the organization in X-Org-ID. + * List node pools (org scoped) + */ + async listNodePoolsRaw( + requestParameters: ListNodePoolsRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise>> { + const queryParameters: any = {}; + + if (requestParameters["q"] != null) { + queryParameters["q"] = requestParameters["q"]; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters["xOrgID"] != null) { + headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-KEY"] = + await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-SECRET"] = + await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = + await this.configuration.apiKey("Authorization"); // BearerAuth authentication + } + + let urlPath = `/node-pools`; + + const response = await this.request( + { + path: urlPath, + method: "GET", + headers: headerParameters, + query: queryParameters, + }, + initOverrides, + ); + + return new runtime.JSONApiResponse(response, (jsonValue) => + jsonValue.map(DtoNodePoolResponseFromJSON), + ); + } + + /** + * Returns node pools for the organization in X-Org-ID. + * List node pools (org scoped) + */ + async listNodePools( + requestParameters: ListNodePoolsRequest = {}, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + const response = await this.listNodePoolsRaw( + requestParameters, + initOverrides, + ); + return await response.value(); + } + + /** + * Partially update node pool fields. + * Update node pool (org scoped) + */ + async updateNodePoolRaw( + requestParameters: UpdateNodePoolRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise> { + if (requestParameters["id"] == null) { + throw new runtime.RequiredError( + "id", + 'Required parameter "id" was null or undefined when calling updateNodePool().', + ); + } + + if (requestParameters["body"] == null) { + throw new runtime.RequiredError( + "body", + 'Required parameter "body" was null or undefined when calling updateNodePool().', + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters["Content-Type"] = "application/json"; + + if (requestParameters["xOrgID"] != null) { + headerParameters["X-Org-ID"] = String(requestParameters["xOrgID"]); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-KEY"] = + await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-SECRET"] = + await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = + await this.configuration.apiKey("Authorization"); // BearerAuth authentication + } + + let urlPath = `/node-pools/{id}`; + urlPath = urlPath.replace( + `{${"id"}}`, + encodeURIComponent(String(requestParameters["id"])), + ); + + const response = await this.request( + { + path: urlPath, + method: "PATCH", + headers: headerParameters, + query: queryParameters, + body: DtoUpdateNodePoolRequestToJSON(requestParameters["body"]), + }, + initOverrides, + ); + + return new runtime.JSONApiResponse(response, (jsonValue) => + DtoNodePoolResponseFromJSON(jsonValue), + ); + } + + /** + * Partially update node pool fields. + * Update node pool (org scoped) + */ + async updateNodePool( + requestParameters: UpdateNodePoolRequest, + initOverrides?: RequestInit | runtime.InitOverrideFunction, + ): Promise { + const response = await this.updateNodePoolRaw( + requestParameters, + initOverrides, + ); + return await response.value(); + } +} diff --git a/sdk/ts/src/apis/index.ts b/sdk/ts/src/apis/index.ts index 47b4820..c9423af 100644 --- a/sdk/ts/src/apis/index.ts +++ b/sdk/ts/src/apis/index.ts @@ -7,6 +7,7 @@ export * from "./HealthApi"; export * from "./LabelsApi"; export * from "./MeApi"; export * from "./MeAPIKeysApi"; +export * from "./NodePoolsApi"; export * from "./OrgsApi"; export * from "./ServersApi"; export * from "./SshApi"; diff --git a/sdk/ts/src/models/DtoAttachAnnotationsRequest.ts b/sdk/ts/src/models/DtoAttachAnnotationsRequest.ts new file mode 100644 index 0000000..adae218 --- /dev/null +++ b/sdk/ts/src/models/DtoAttachAnnotationsRequest.ts @@ -0,0 +1,74 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * AutoGlue API + * API for managing K3s clusters across cloud providers + * + * The version of the OpenAPI document: 1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @interface DtoAttachAnnotationsRequest + */ +export interface DtoAttachAnnotationsRequest { + /** + * + * @type {Array} + * @memberof DtoAttachAnnotationsRequest + */ + annotation_ids?: Array; +} + +/** + * Check if a given object implements the DtoAttachAnnotationsRequest interface. + */ +export function instanceOfDtoAttachAnnotationsRequest( + value: object, +): value is DtoAttachAnnotationsRequest { + return true; +} + +export function DtoAttachAnnotationsRequestFromJSON( + json: any, +): DtoAttachAnnotationsRequest { + return DtoAttachAnnotationsRequestFromJSONTyped(json, false); +} + +export function DtoAttachAnnotationsRequestFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): DtoAttachAnnotationsRequest { + if (json == null) { + return json; + } + return { + annotation_ids: + json["annotation_ids"] == null ? undefined : json["annotation_ids"], + }; +} + +export function DtoAttachAnnotationsRequestToJSON( + json: any, +): DtoAttachAnnotationsRequest { + return DtoAttachAnnotationsRequestToJSONTyped(json, false); +} + +export function DtoAttachAnnotationsRequestToJSONTyped( + value?: DtoAttachAnnotationsRequest | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value; + } + + return { + annotation_ids: value["annotation_ids"], + }; +} diff --git a/sdk/ts/src/models/DtoAttachLabelsRequest.ts b/sdk/ts/src/models/DtoAttachLabelsRequest.ts new file mode 100644 index 0000000..2feb6ec --- /dev/null +++ b/sdk/ts/src/models/DtoAttachLabelsRequest.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * AutoGlue API + * API for managing K3s clusters across cloud providers + * + * The version of the OpenAPI document: 1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @interface DtoAttachLabelsRequest + */ +export interface DtoAttachLabelsRequest { + /** + * + * @type {Array} + * @memberof DtoAttachLabelsRequest + */ + label_ids?: Array; +} + +/** + * Check if a given object implements the DtoAttachLabelsRequest interface. + */ +export function instanceOfDtoAttachLabelsRequest( + value: object, +): value is DtoAttachLabelsRequest { + return true; +} + +export function DtoAttachLabelsRequestFromJSON( + json: any, +): DtoAttachLabelsRequest { + return DtoAttachLabelsRequestFromJSONTyped(json, false); +} + +export function DtoAttachLabelsRequestFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): DtoAttachLabelsRequest { + if (json == null) { + return json; + } + return { + label_ids: json["label_ids"] == null ? undefined : json["label_ids"], + }; +} + +export function DtoAttachLabelsRequestToJSON( + json: any, +): DtoAttachLabelsRequest { + return DtoAttachLabelsRequestToJSONTyped(json, false); +} + +export function DtoAttachLabelsRequestToJSONTyped( + value?: DtoAttachLabelsRequest | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value; + } + + return { + label_ids: value["label_ids"], + }; +} diff --git a/sdk/ts/src/models/DtoAttachServersRequest.ts b/sdk/ts/src/models/DtoAttachServersRequest.ts new file mode 100644 index 0000000..323c331 --- /dev/null +++ b/sdk/ts/src/models/DtoAttachServersRequest.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * AutoGlue API + * API for managing K3s clusters across cloud providers + * + * The version of the OpenAPI document: 1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @interface DtoAttachServersRequest + */ +export interface DtoAttachServersRequest { + /** + * + * @type {Array} + * @memberof DtoAttachServersRequest + */ + server_ids?: Array; +} + +/** + * Check if a given object implements the DtoAttachServersRequest interface. + */ +export function instanceOfDtoAttachServersRequest( + value: object, +): value is DtoAttachServersRequest { + return true; +} + +export function DtoAttachServersRequestFromJSON( + json: any, +): DtoAttachServersRequest { + return DtoAttachServersRequestFromJSONTyped(json, false); +} + +export function DtoAttachServersRequestFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): DtoAttachServersRequest { + if (json == null) { + return json; + } + return { + server_ids: json["server_ids"] == null ? undefined : json["server_ids"], + }; +} + +export function DtoAttachServersRequestToJSON( + json: any, +): DtoAttachServersRequest { + return DtoAttachServersRequestToJSONTyped(json, false); +} + +export function DtoAttachServersRequestToJSONTyped( + value?: DtoAttachServersRequest | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value; + } + + return { + server_ids: value["server_ids"], + }; +} diff --git a/sdk/ts/src/models/DtoAttachTaintsRequest.ts b/sdk/ts/src/models/DtoAttachTaintsRequest.ts new file mode 100644 index 0000000..9ffc888 --- /dev/null +++ b/sdk/ts/src/models/DtoAttachTaintsRequest.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * AutoGlue API + * API for managing K3s clusters across cloud providers + * + * The version of the OpenAPI document: 1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @interface DtoAttachTaintsRequest + */ +export interface DtoAttachTaintsRequest { + /** + * + * @type {Array} + * @memberof DtoAttachTaintsRequest + */ + taint_ids?: Array; +} + +/** + * Check if a given object implements the DtoAttachTaintsRequest interface. + */ +export function instanceOfDtoAttachTaintsRequest( + value: object, +): value is DtoAttachTaintsRequest { + return true; +} + +export function DtoAttachTaintsRequestFromJSON( + json: any, +): DtoAttachTaintsRequest { + return DtoAttachTaintsRequestFromJSONTyped(json, false); +} + +export function DtoAttachTaintsRequestFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): DtoAttachTaintsRequest { + if (json == null) { + return json; + } + return { + taint_ids: json["taint_ids"] == null ? undefined : json["taint_ids"], + }; +} + +export function DtoAttachTaintsRequestToJSON( + json: any, +): DtoAttachTaintsRequest { + return DtoAttachTaintsRequestToJSONTyped(json, false); +} + +export function DtoAttachTaintsRequestToJSONTyped( + value?: DtoAttachTaintsRequest | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value; + } + + return { + taint_ids: value["taint_ids"], + }; +} diff --git a/sdk/ts/src/models/DtoCreateNodePoolRequest.ts b/sdk/ts/src/models/DtoCreateNodePoolRequest.ts new file mode 100644 index 0000000..64c74cb --- /dev/null +++ b/sdk/ts/src/models/DtoCreateNodePoolRequest.ts @@ -0,0 +1,91 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * AutoGlue API + * API for managing K3s clusters across cloud providers + * + * The version of the OpenAPI document: 1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @interface DtoCreateNodePoolRequest + */ +export interface DtoCreateNodePoolRequest { + /** + * + * @type {string} + * @memberof DtoCreateNodePoolRequest + */ + name?: string; + /** + * + * @type {string} + * @memberof DtoCreateNodePoolRequest + */ + role?: DtoCreateNodePoolRequestRoleEnum; +} + +/** + * @export + */ +export const DtoCreateNodePoolRequestRoleEnum = { + master: "master", + worker: "worker", +} as const; +export type DtoCreateNodePoolRequestRoleEnum = + (typeof DtoCreateNodePoolRequestRoleEnum)[keyof typeof DtoCreateNodePoolRequestRoleEnum]; + +/** + * Check if a given object implements the DtoCreateNodePoolRequest interface. + */ +export function instanceOfDtoCreateNodePoolRequest( + value: object, +): value is DtoCreateNodePoolRequest { + return true; +} + +export function DtoCreateNodePoolRequestFromJSON( + json: any, +): DtoCreateNodePoolRequest { + return DtoCreateNodePoolRequestFromJSONTyped(json, false); +} + +export function DtoCreateNodePoolRequestFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): DtoCreateNodePoolRequest { + if (json == null) { + return json; + } + return { + name: json["name"] == null ? undefined : json["name"], + role: json["role"] == null ? undefined : json["role"], + }; +} + +export function DtoCreateNodePoolRequestToJSON( + json: any, +): DtoCreateNodePoolRequest { + return DtoCreateNodePoolRequestToJSONTyped(json, false); +} + +export function DtoCreateNodePoolRequestToJSONTyped( + value?: DtoCreateNodePoolRequest | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value; + } + + return { + name: value["name"], + role: value["role"], + }; +} diff --git a/sdk/ts/src/models/DtoCreateServerRequest.ts b/sdk/ts/src/models/DtoCreateServerRequest.ts index 2dc2ea0..6a0cd96 100644 --- a/sdk/ts/src/models/DtoCreateServerRequest.ts +++ b/sdk/ts/src/models/DtoCreateServerRequest.ts @@ -12,7 +12,6 @@ * Do not edit the class manually. */ -import { mapValues } from "../runtime"; /** * * @export @@ -42,7 +41,7 @@ export interface DtoCreateServerRequest { * @type {string} * @memberof DtoCreateServerRequest */ - role?: string; + role?: DtoCreateServerRequestRoleEnum; /** * * @type {string} @@ -60,9 +59,32 @@ export interface DtoCreateServerRequest { * @type {string} * @memberof DtoCreateServerRequest */ - status?: string; + status?: DtoCreateServerRequestStatusEnum; } +/** + * @export + */ +export const DtoCreateServerRequestRoleEnum = { + master: "master", + worker: "worker", + bastion: "bastion", +} as const; +export type DtoCreateServerRequestRoleEnum = + (typeof DtoCreateServerRequestRoleEnum)[keyof typeof DtoCreateServerRequestRoleEnum]; + +/** + * @export + */ +export const DtoCreateServerRequestStatusEnum = { + pending: "pending", + provisioning: "provisioning", + ready: "ready", + failed: "failed", +} as const; +export type DtoCreateServerRequestStatusEnum = + (typeof DtoCreateServerRequestStatusEnum)[keyof typeof DtoCreateServerRequestStatusEnum]; + /** * Check if a given object implements the DtoCreateServerRequest interface. */ diff --git a/sdk/ts/src/models/DtoNodePoolResponse.ts b/sdk/ts/src/models/DtoNodePoolResponse.ts new file mode 100644 index 0000000..24c67f5 --- /dev/null +++ b/sdk/ts/src/models/DtoNodePoolResponse.ts @@ -0,0 +1,187 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * AutoGlue API + * API for managing K3s clusters across cloud providers + * + * The version of the OpenAPI document: 1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type {DtoTaintResponse} from "./DtoTaintResponse"; +import {DtoTaintResponseFromJSON, DtoTaintResponseToJSON,} from "./DtoTaintResponse"; +import type {DtoLabelResponse} from "./DtoLabelResponse"; +import {DtoLabelResponseFromJSON, DtoLabelResponseToJSON,} from "./DtoLabelResponse"; +import type {DtoServerResponse} from "./DtoServerResponse"; +import {DtoServerResponseFromJSON, DtoServerResponseToJSON,} from "./DtoServerResponse"; +import type {DtoAnnotationResponse} from "./DtoAnnotationResponse"; +import {DtoAnnotationResponseFromJSON, DtoAnnotationResponseToJSON,} from "./DtoAnnotationResponse"; + +/** + * + * @export + * @interface DtoNodePoolResponse + */ +export interface DtoNodePoolResponse { + /** + * + * @type {Array} + * @memberof DtoNodePoolResponse + */ + annotations?: Array; + /** + * + * @type {string} + * @memberof DtoNodePoolResponse + */ + created_at?: string; + /** + * + * @type {string} + * @memberof DtoNodePoolResponse + */ + id?: string; + /** + * + * @type {Array} + * @memberof DtoNodePoolResponse + */ + labels?: Array; + /** + * + * @type {string} + * @memberof DtoNodePoolResponse + */ + name?: string; + /** + * + * @type {string} + * @memberof DtoNodePoolResponse + */ + organization_id?: string; + /** + * + * @type {string} + * @memberof DtoNodePoolResponse + */ + role?: DtoNodePoolResponseRoleEnum; + /** + * + * @type {Array} + * @memberof DtoNodePoolResponse + */ + servers?: Array; + /** + * + * @type {Array} + * @memberof DtoNodePoolResponse + */ + taints?: Array; + /** + * + * @type {string} + * @memberof DtoNodePoolResponse + */ + updated_at?: string; +} + +/** + * @export + */ +export const DtoNodePoolResponseRoleEnum = { + master: "master", + worker: "worker", +} as const; +export type DtoNodePoolResponseRoleEnum = + (typeof DtoNodePoolResponseRoleEnum)[keyof typeof DtoNodePoolResponseRoleEnum]; + +/** + * Check if a given object implements the DtoNodePoolResponse interface. + */ +export function instanceOfDtoNodePoolResponse( + value: object, +): value is DtoNodePoolResponse { + return true; +} + +export function DtoNodePoolResponseFromJSON(json: any): DtoNodePoolResponse { + return DtoNodePoolResponseFromJSONTyped(json, false); +} + +export function DtoNodePoolResponseFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): DtoNodePoolResponse { + if (json == null) { + return json; + } + return { + annotations: + json["annotations"] == null + ? undefined + : (json["annotations"] as Array).map( + DtoAnnotationResponseFromJSON, + ), + created_at: json["created_at"] == null ? undefined : json["created_at"], + id: json["id"] == null ? undefined : json["id"], + labels: + json["labels"] == null + ? undefined + : (json["labels"] as Array).map(DtoLabelResponseFromJSON), + name: json["name"] == null ? undefined : json["name"], + organization_id: + json["organization_id"] == null ? undefined : json["organization_id"], + role: json["role"] == null ? undefined : json["role"], + servers: + json["servers"] == null + ? undefined + : (json["servers"] as Array).map(DtoServerResponseFromJSON), + taints: + json["taints"] == null + ? undefined + : (json["taints"] as Array).map(DtoTaintResponseFromJSON), + updated_at: json["updated_at"] == null ? undefined : json["updated_at"], + }; +} + +export function DtoNodePoolResponseToJSON(json: any): DtoNodePoolResponse { + return DtoNodePoolResponseToJSONTyped(json, false); +} + +export function DtoNodePoolResponseToJSONTyped( + value?: DtoNodePoolResponse | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value; + } + + return { + annotations: + value["annotations"] == null + ? undefined + : (value["annotations"] as Array).map(DtoAnnotationResponseToJSON), + created_at: value["created_at"], + id: value["id"], + labels: + value["labels"] == null + ? undefined + : (value["labels"] as Array).map(DtoLabelResponseToJSON), + name: value["name"], + organization_id: value["organization_id"], + role: value["role"], + servers: + value["servers"] == null + ? undefined + : (value["servers"] as Array).map(DtoServerResponseToJSON), + taints: + value["taints"] == null + ? undefined + : (value["taints"] as Array).map(DtoTaintResponseToJSON), + updated_at: value["updated_at"], + }; +} diff --git a/sdk/ts/src/models/DtoServerResponse.ts b/sdk/ts/src/models/DtoServerResponse.ts index 3e94c67..97305a9 100644 --- a/sdk/ts/src/models/DtoServerResponse.ts +++ b/sdk/ts/src/models/DtoServerResponse.ts @@ -12,7 +12,6 @@ * Do not edit the class manually. */ -import { mapValues } from "../runtime"; /** * * @export @@ -60,7 +59,7 @@ export interface DtoServerResponse { * @type {string} * @memberof DtoServerResponse */ - role?: string; + role?: DtoServerResponseRoleEnum; /** * * @type {string} @@ -78,7 +77,7 @@ export interface DtoServerResponse { * @type {string} * @memberof DtoServerResponse */ - status?: string; + status?: DtoServerResponseStatusEnum; /** * * @type {string} @@ -87,6 +86,29 @@ export interface DtoServerResponse { updated_at?: string; } +/** + * @export + */ +export const DtoServerResponseRoleEnum = { + master: "master", + worker: "worker", + bastion: "bastion", +} as const; +export type DtoServerResponseRoleEnum = + (typeof DtoServerResponseRoleEnum)[keyof typeof DtoServerResponseRoleEnum]; + +/** + * @export + */ +export const DtoServerResponseStatusEnum = { + pending: "pending", + provisioning: "provisioning", + ready: "ready", + failed: "failed", +} as const; +export type DtoServerResponseStatusEnum = + (typeof DtoServerResponseStatusEnum)[keyof typeof DtoServerResponseStatusEnum]; + /** * Check if a given object implements the DtoServerResponse interface. */ diff --git a/sdk/ts/src/models/DtoUpdateNodePoolRequest.ts b/sdk/ts/src/models/DtoUpdateNodePoolRequest.ts new file mode 100644 index 0000000..ce4bc19 --- /dev/null +++ b/sdk/ts/src/models/DtoUpdateNodePoolRequest.ts @@ -0,0 +1,91 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * AutoGlue API + * API for managing K3s clusters across cloud providers + * + * The version of the OpenAPI document: 1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @interface DtoUpdateNodePoolRequest + */ +export interface DtoUpdateNodePoolRequest { + /** + * + * @type {string} + * @memberof DtoUpdateNodePoolRequest + */ + name?: string; + /** + * + * @type {string} + * @memberof DtoUpdateNodePoolRequest + */ + role?: DtoUpdateNodePoolRequestRoleEnum; +} + +/** + * @export + */ +export const DtoUpdateNodePoolRequestRoleEnum = { + master: "master", + worker: "worker", +} as const; +export type DtoUpdateNodePoolRequestRoleEnum = + (typeof DtoUpdateNodePoolRequestRoleEnum)[keyof typeof DtoUpdateNodePoolRequestRoleEnum]; + +/** + * Check if a given object implements the DtoUpdateNodePoolRequest interface. + */ +export function instanceOfDtoUpdateNodePoolRequest( + value: object, +): value is DtoUpdateNodePoolRequest { + return true; +} + +export function DtoUpdateNodePoolRequestFromJSON( + json: any, +): DtoUpdateNodePoolRequest { + return DtoUpdateNodePoolRequestFromJSONTyped(json, false); +} + +export function DtoUpdateNodePoolRequestFromJSONTyped( + json: any, + ignoreDiscriminator: boolean, +): DtoUpdateNodePoolRequest { + if (json == null) { + return json; + } + return { + name: json["name"] == null ? undefined : json["name"], + role: json["role"] == null ? undefined : json["role"], + }; +} + +export function DtoUpdateNodePoolRequestToJSON( + json: any, +): DtoUpdateNodePoolRequest { + return DtoUpdateNodePoolRequestToJSONTyped(json, false); +} + +export function DtoUpdateNodePoolRequestToJSONTyped( + value?: DtoUpdateNodePoolRequest | null, + ignoreDiscriminator: boolean = false, +): any { + if (value == null) { + return value; + } + + return { + name: value["name"], + role: value["role"], + }; +} diff --git a/sdk/ts/src/models/DtoUpdateServerRequest.ts b/sdk/ts/src/models/DtoUpdateServerRequest.ts index edbde25..ca6c6c3 100644 --- a/sdk/ts/src/models/DtoUpdateServerRequest.ts +++ b/sdk/ts/src/models/DtoUpdateServerRequest.ts @@ -12,7 +12,6 @@ * Do not edit the class manually. */ -import { mapValues } from "../runtime"; /** * * @export @@ -42,7 +41,7 @@ export interface DtoUpdateServerRequest { * @type {string} * @memberof DtoUpdateServerRequest */ - role?: string; + role?: DtoUpdateServerRequestRoleEnum; /** * * @type {string} @@ -60,9 +59,32 @@ export interface DtoUpdateServerRequest { * @type {string} * @memberof DtoUpdateServerRequest */ - status?: string; + status?: DtoUpdateServerRequestStatusEnum; } +/** + * @export + */ +export const DtoUpdateServerRequestRoleEnum = { + master: "master", + worker: "worker", + bastion: "bastion", +} as const; +export type DtoUpdateServerRequestRoleEnum = + (typeof DtoUpdateServerRequestRoleEnum)[keyof typeof DtoUpdateServerRequestRoleEnum]; + +/** + * @export + */ +export const DtoUpdateServerRequestStatusEnum = { + pending: "pending", + provisioning: "provisioning", + ready: "ready", + failed: "failed", +} as const; +export type DtoUpdateServerRequestStatusEnum = + (typeof DtoUpdateServerRequestStatusEnum)[keyof typeof DtoUpdateServerRequestStatusEnum]; + /** * Check if a given object implements the DtoUpdateServerRequest interface. */ diff --git a/sdk/ts/src/models/index.ts b/sdk/ts/src/models/index.ts index 1d4ba42..e6d61d3 100644 --- a/sdk/ts/src/models/index.ts +++ b/sdk/ts/src/models/index.ts @@ -1,9 +1,14 @@ /* tslint:disable */ /* eslint-disable */ export * from "./DtoAnnotationResponse"; +export * from "./DtoAttachAnnotationsRequest"; +export * from "./DtoAttachLabelsRequest"; +export * from "./DtoAttachServersRequest"; +export * from "./DtoAttachTaintsRequest"; export * from "./DtoAuthStartResponse"; export * from "./DtoCreateAnnotationRequest"; export * from "./DtoCreateLabelRequest"; +export * from "./DtoCreateNodePoolRequest"; export * from "./DtoCreateSSHRequest"; export * from "./DtoCreateServerRequest"; export * from "./DtoCreateTaintRequest"; @@ -13,6 +18,7 @@ export * from "./DtoJob"; export * from "./DtoJobStatus"; export * from "./DtoLabelResponse"; export * from "./DtoLogoutRequest"; +export * from "./DtoNodePoolResponse"; export * from "./DtoPageJob"; export * from "./DtoQueueInfo"; export * from "./DtoRefreshRequest"; @@ -23,6 +29,7 @@ export * from "./DtoTaintResponse"; export * from "./DtoTokenPair"; export * from "./DtoUpdateAnnotationRequest"; export * from "./DtoUpdateLabelRequest"; +export * from "./DtoUpdateNodePoolRequest"; export * from "./DtoUpdateServerRequest"; export * from "./DtoUpdateTaintRequest"; export * from "./HandlersCreateUserKeyRequest"; diff --git a/sdk/ts/src/runtime.ts b/sdk/ts/src/runtime.ts index 71111cd..16dc319 100644 --- a/sdk/ts/src/runtime.ts +++ b/sdk/ts/src/runtime.ts @@ -12,7 +12,7 @@ * Do not edit the class manually. */ -export const BASE_PATH = "http://localhost:8080/api/v1".replace(/\/+$/, ""); +export const BASE_PATH = "/api/v1".replace(/\/+$/, ""); export interface ConfigurationParameters { basePath?: string; // override base path diff --git a/terraform-provider-autoglue/go.mod b/terraform-provider-autoglue/go.mod index 88d2f5b..bb2f73d 100644 --- a/terraform-provider-autoglue/go.mod +++ b/terraform-provider-autoglue/go.mod @@ -1,6 +1,6 @@ module github.com/glueops/terraform-provider-gsot -go 1.25.3 +go 1.25.4 require ( github.com/glueops/autoglue-sdk-go v0.0.0-20251106000315-3969abd74adf diff --git a/terraform/envs/dev/main.tf b/terraform/envs/dev/main.tf index bd6f279..165eb46 100644 --- a/terraform/envs/dev/main.tf +++ b/terraform/envs/dev/main.tf @@ -37,9 +37,9 @@ module "servers" { bastion = { hostname = "bastion-01" private_ip_address = "10.0.0.10" - public_ip_address = "54.12.34.56" # required for role=bastion + public_ip_address = "65.109.95.175" # required for role=bastion role = "bastion" - ssh_user = "ubuntu" + ssh_user = "root" ssh_key_ref = "bastionKey" # points to module.ssh["bastionKey"].id status = "pending" } @@ -47,7 +47,7 @@ module "servers" { manager1 = { hostname = "k3s-mgr-01" private_ip_address = "10.0.1.11" - role = "manager" + role = "master" ssh_user = "ubuntu" ssh_key_ref = "clusterKey" status = "pending" @@ -56,7 +56,7 @@ module "servers" { agent1 = { hostname = "k3s-agent-01" private_ip_address = "10.0.2.21" - role = "agent" + role = "worker" ssh_user = "ubuntu" ssh_key_ref = "clusterKey" status = "pending" diff --git a/ui/src/App.tsx b/ui/src/App.tsx index 5d043cf..4ea3041 100644 --- a/ui/src/App.tsx +++ b/ui/src/App.tsx @@ -7,6 +7,7 @@ import { Login } from "@/pages/auth/login.tsx" import { JobsPage } from "@/pages/jobs/jobs-page.tsx" import { LabelsPage } from "@/pages/labels/labels-page.tsx" import { MePage } from "@/pages/me/me-page.tsx" +import { NodePoolsPage } from "@/pages/nodepools/node-pools-page.tsx" import { OrgApiKeys } from "@/pages/org/api-keys.tsx" import { OrgMembers } from "@/pages/org/members.tsx" import { OrgSettings } from "@/pages/org/settings.tsx" @@ -31,6 +32,7 @@ export default function App() { } /> } /> } /> + } /> } /> diff --git a/ui/src/api/node_pools.ts b/ui/src/api/node_pools.ts new file mode 100644 index 0000000..f81af42 --- /dev/null +++ b/ui/src/api/node_pools.ts @@ -0,0 +1,91 @@ +import { withRefresh } from "@/api/with-refresh.ts" +import type { + DtoAttachAnnotationsRequest, + DtoAttachLabelsRequest, + DtoAttachServersRequest, + DtoAttachTaintsRequest, + DtoCreateNodePoolRequest, + DtoUpdateNodePoolRequest, +} from "@/sdk" +import { makeNodePoolApi } from "@/sdkClient.ts" + +const nodePools = makeNodePoolApi() +export const canAttachToPool = (poolRole: string | undefined, serverRole: string | undefined) => { + if (!poolRole) return true + return poolRole === serverRole +} + +export const nodePoolsApi = { + listNodePools: () => + withRefresh(async () => { + return await nodePools.listNodePools({}) + }), + createNodePool: (body: DtoCreateNodePoolRequest) => + withRefresh(async () => { + return await nodePools.createNodePool({ body }) + }), + getNodePool: (id: string) => + withRefresh(async () => { + return await nodePools.getNodePool({ id }) + }), + deleteNodePool: (id: string) => + withRefresh(async () => { + await nodePools.deleteNodePool({ id }) + }), + updateNodePool: (id: string, body: DtoUpdateNodePoolRequest) => + withRefresh(async () => { + return await nodePools.updateNodePool({ id, body }) + }), + // Servers + listNodePoolServers: (id: string) => + withRefresh(async () => { + return await nodePools.listNodePoolServers({ id }) + }), + attachNodePoolServer: (id: string, body: DtoAttachServersRequest) => + withRefresh(async () => { + return await nodePools.attachNodePoolServers({ id, body }) + }), + detachNodePoolServers: (id: string, serverId: string) => + withRefresh(async () => { + return await nodePools.detachNodePoolServer({ id, serverId }) + }), + // Taints + listNodePoolTaints: (id: string) => + withRefresh(async () => { + return await nodePools.listNodePoolTaints({ id }) + }), + attachNodePoolTaints: (id: string, body: DtoAttachTaintsRequest) => + withRefresh(async () => { + return await nodePools.attachNodePoolTaints({ id, body }) + }), + detachNodePoolTaints: (id: string, taintId: string) => + withRefresh(async () => { + return await nodePools.detachNodePoolTaint({ id, taintId }) + }), + // Labels + listNodePoolLabels: (id: string) => + withRefresh(async () => { + return await nodePools.listNodePoolLabels({ id }) + }), + attachNodePoolLabels: (id: string, body: DtoAttachLabelsRequest) => + withRefresh(async () => { + return await nodePools.attachNodePoolLabels({ id, body }) + }), + detachNodePoolLabels: (id: string, labelId: string) => + withRefresh(async () => { + return await nodePools.detachNodePoolLabel({ id, labelId }) + }), + // Annotations + listNodePoolAnnotations: (id: string) => + withRefresh(async () => { + return await nodePools.listNodePoolAnnotations({ id }) + }), + attachNodePoolAnnotations: (id: string, body: DtoAttachAnnotationsRequest) => + withRefresh(async () => { + return await nodePools.attachNodePoolAnnotations({ id, body }) + }), + detachNodePoolAnnotations: (id: string, annotationId: string) => + withRefresh(async () => { + return await nodePools.detachNodePoolAnnotation({ id, annotationId }) + }), +} diff --git a/ui/src/api/ssh.ts b/ui/src/api/ssh.ts index 1523d03..432b919 100644 --- a/ui/src/api/ssh.ts +++ b/ui/src/api/ssh.ts @@ -1,10 +1,29 @@ import { withRefresh } from "@/api/with-refresh.ts" +import { orgStore } from "@/auth/org.ts" +import { authStore } from "@/auth/store.ts" import type { DtoCreateSSHRequest, DtoSshResponse, DtoSshRevealResponse } from "@/sdk" import { makeSshApi } from "@/sdkClient.ts" const ssh = makeSshApi() export type SshDownloadPart = "public" | "private" | "both" +function authHeaders() { + const token = authStore.getAccessToken() + const orgId = orgStore.get() + return { + ...(token ? { Authorization: `Bearer ${token}` } : {}), + ...(orgId ? { "X-Org-ID": orgId } : {}), + } +} + +async function authedFetch(input: RequestInfo | URL, init: RequestInit = {}) { + return fetch(input, { + ...init, + headers: { ...(init.headers as any), ...authHeaders() }, + credentials: "include", // keep if you rely on cookies/HttpOnly sessions + }) +} + export const sshApi = { listSshKeys: () => withRefresh(async (): Promise => { @@ -42,7 +61,7 @@ export const sshApi = { url.searchParams.set("part", part) url.searchParams.set("mode", "json") - const res = await fetch(url.toString()) + const res = await authedFetch(url.toString()) if (!res.ok) throw new Error(`Download failed: ${res.statusText}`) return (await res.json()) as { id: string @@ -61,7 +80,7 @@ export const sshApi = { const url = new URL(`/api/v1/ssh/${id}/download`, window.location.origin) url.searchParams.set("part", part) - const res = await fetch(url.toString()) + const res = await authedFetch(url.toString()) if (!res.ok) throw new Error(`Download failed: ${res.statusText}`) // Parse filename from Content-Disposition diff --git a/ui/src/pages/me/me-page.tsx b/ui/src/pages/me/me-page.tsx index 9f76703..b5fb137 100644 --- a/ui/src/pages/me/me-page.tsx +++ b/ui/src/pages/me/me-page.tsx @@ -378,8 +378,13 @@ export const MePage = () => { + field.onChange(e.target.value === "" ? "" : Number(e.target.value)) + } /> diff --git a/ui/src/pages/nodepools/node-pools-page.tsx b/ui/src/pages/nodepools/node-pools-page.tsx new file mode 100644 index 0000000..a18f469 --- /dev/null +++ b/ui/src/pages/nodepools/node-pools-page.tsx @@ -0,0 +1,1065 @@ +import { useEffect, useMemo, useState } from "react" +import { annotationsApi } from "@/api/annotations" +import { labelsApi } from "@/api/labels" +import { canAttachToPool, nodePoolsApi } from "@/api/node_pools" +import { serversApi } from "@/api/servers" +import { taintsApi } from "@/api/taints" +import type { DtoNodePoolResponse } from "@/sdk" +import { zodResolver } from "@hookform/resolvers/zod" +import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query" +import { Ellipsis, LinkIcon, Pencil, Plus, Search, ServerIcon, Trash2 } from "lucide-react" +import { useForm } from "react-hook-form" +import { toast } from "sonner" +import { z } from "zod" + +import { Badge } from "@/components/ui/badge" +import { Button } from "@/components/ui/button" +import { + Dialog, + DialogContent, + DialogFooter, + DialogHeader, + DialogTitle, + DialogTrigger, +} from "@/components/ui/dialog" +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuTrigger, +} from "@/components/ui/dropdown-menu" +import { + Form, + FormControl, + FormField, + FormItem, + FormLabel, + FormMessage, +} from "@/components/ui/form" +import { Input } from "@/components/ui/input" +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/components/ui/select" +import { + Table, + TableBody, + TableCell, + TableHead, + TableHeader, + TableRow, +} from "@/components/ui/table" + +// --------------------------------------------- +// Helpers & shared UI +// --------------------------------------------- + +const ROLE_OPTIONS = ["master", "worker"] as const +type Role = (typeof ROLE_OPTIONS)[number] + +function StatusBadge({ status }: { status?: string }) { + const v = + status === "ready" + ? "default" + : status === "provisioning" + ? "secondary" + : status === "failed" + ? "destructive" + : "outline" + return ( + + {status || "unknown"} + + ) +} + +// --------------------------------------------- +// Reusable manage-many dialog +// --------------------------------------------- + +type AssocItem = { + id: string + // common searchable/display fields + name?: string + key?: string + value?: string + effect?: string + role?: string + status?: string + hostname?: string + private_ip_address?: string + public_ip_address?: string +} + +function fuzzyIncludes(hay: string | undefined, q: string) { + return (hay ?? "").toLowerCase().includes(q) +} + +function ManageManyDialog(props: { + open: boolean + title: string + onOpenChange: (v: boolean) => void + items: AssocItem[] + initialSelectedIds: Set + onSave: (diff: { toAttach: string[]; toDetach: string[] }) => Promise | void + columns: { header: string; render: (item: AssocItem) => React.ReactNode }[] + allowItem?: (item: AssocItem) => boolean +}) { + const { open, title, onOpenChange, items, initialSelectedIds, onSave, columns, allowItem } = props + const [q, setQ] = useState("") + const [selected, setSelected] = useState>(new Set(initialSelectedIds)) + const [saving, setSaving] = useState(false) + + useEffect(() => { + setSelected(new Set(initialSelectedIds)) + setQ("") + }, [initialSelectedIds, open]) + + const filtered = useMemo(() => { + const qq = q.trim().toLowerCase() + return items.filter((it) => { + if (allowItem && !allowItem(it)) return false + if (!qq) return true + return ( + fuzzyIncludes(it.name, qq) || + fuzzyIncludes(it.key, qq) || + fuzzyIncludes(it.value, qq) || + fuzzyIncludes(it.effect, qq) || + fuzzyIncludes(it.hostname, qq) || + fuzzyIncludes(it.private_ip_address, qq) || + fuzzyIncludes(it.public_ip_address, qq) || + fuzzyIncludes(it.role, qq) || + fuzzyIncludes(it.status, qq) + ) + }) + }, [items, q, allowItem]) + + const initial = initialSelectedIds + const changed = + Array.from(selected).some((id) => !initial.has(id)) || + Array.from(initial).some((id) => !selected.has(id)) + + return ( + + + + {title} + + +
+
+ + setQ(e.target.value)} + placeholder="Search…" + className="pl-8" + /> +
+ +
+ + + + + {columns.map((c, i) => ( + {c.header} + ))} + + + + {filtered.map((it) => { + const id = it.id + const checked = selected.has(id) + return ( + + + { + const next = new Set(selected) + if (e.target.checked) next.add(id) + else next.delete(id) + setSelected(next) + }} + /> + + {columns.map((c, i) => ( + {c.render(it)} + ))} + + ) + })} + {filtered.length === 0 && ( + + + No items found. + + + )} + +
+
+ +
+ Selected: {selected.size} +
+
+ + + + + +
+
+ ) +} + +// --------------------------------------------- +// Page +// --------------------------------------------- + +const createNodePoolSchema = z.object({ + name: z.string().trim().min(1, "Name is required").max(120, "Max 120 chars"), + role: z.enum(ROLE_OPTIONS), +}) +type CreateNodePoolValues = z.infer + +const updateNodePoolSchema = createNodePoolSchema.partial() +type UpdateNodePoolValues = z.infer + +export function NodePoolsPage() { + const [filter, setFilter] = useState("") + const [createOpen, setCreateOpen] = useState(false) + const [updateOpen, setUpdateOpen] = useState(false) + const [deleteOpen, setDeleteOpen] = useState(false) + const [editing, setEditing] = useState(null) + const [deleting, setDeleting] = useState(null) + + // Manage Servers dialog state + const [manageOpen, setManageOpen] = useState(false) + const [managePool, setManagePool] = useState(null) + const [selected, setSelected] = useState>(new Set()) + const [initialSelected, setInitialSelected] = useState>(new Set()) + const [serverFilter, setServerFilter] = useState("") + + // Manage Labels / Annotations / Taints dialog state + const [manageLabelsOpen, setManageLabelsOpen] = useState(false) + const [manageAnnotationsOpen, setManageAnnotationsOpen] = useState(false) + const [manageTaintsOpen, setManageTaintsOpen] = useState(false) + const [manageLATPool, setManageLATPool] = useState(null) + + const [labelsInitial, setLabelsInitial] = useState>(new Set()) + const [annotationsInitial, setAnnotationsInitial] = useState>(new Set()) + const [taintsInitial, setTaintsInitial] = useState>(new Set()) + + const qc = useQueryClient() + + // Queries + const nodePoolQ = useQuery({ + queryKey: ["node-pools"], + queryFn: () => nodePoolsApi.listNodePools(), + }) + + const serverQ = useQuery({ + queryKey: ["servers"], + queryFn: () => serversApi.listServers(), + }) + + const annotationQ = useQuery({ + queryKey: ["annotations"], + queryFn: () => annotationsApi.listAnnotations(), + }) + + const labelQ = useQuery({ + queryKey: ["labels"], + queryFn: () => labelsApi.listLabels(), + }) + + const taintQ = useQuery({ + queryKey: ["taints"], + queryFn: () => taintsApi.listTaints(), + }) + + // --- Create + const createForm = useForm({ + resolver: zodResolver(createNodePoolSchema), + defaultValues: { name: "", role: "worker" }, + }) + + const createMut = useMutation({ + mutationFn: (values: CreateNodePoolValues) => nodePoolsApi.createNodePool(values), + onSuccess: async () => { + await qc.invalidateQueries({ queryKey: ["node-pools"] }) + createForm.reset({ name: "", role: "worker" }) + setCreateOpen(false) + toast.success("Node pool created.") + }, + onError: (err: any) => toast.error(err?.message ?? "Unable to create node pool."), + }) + + const onCreateSubmit = (values: CreateNodePoolValues) => createMut.mutate(values) + + // --- Update + const updateForm = useForm({ + resolver: zodResolver(updateNodePoolSchema), + defaultValues: { name: undefined, role: undefined }, + }) + + useEffect(() => { + if (editing) { + updateForm.reset({ name: editing.name, role: editing.role as Role }) + } else { + updateForm.reset({ name: undefined, role: undefined }) + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [editing]) + + const updateMut = useMutation({ + mutationFn: async (values: UpdateNodePoolValues) => { + if (!editing) return + const body: UpdateNodePoolValues = {} + if (values.name !== editing.name) body.name = values.name + if ((values.role as string) !== editing.role) body.role = values.role + return await nodePoolsApi.updateNodePool(editing.id as unknown as string, body) + }, + onSuccess: async () => { + await qc.invalidateQueries({ queryKey: ["node-pools"] }) + setUpdateOpen(false) + setEditing(null) + toast.success("Node pool updated.") + }, + onError: (err: any) => toast.error(err?.message ?? "Unable to update node pool."), + }) + + const onUpdateSubmit = (values: UpdateNodePoolValues) => updateMut.mutate(values) + + // --- Delete + const deleteMut = useMutation({ + mutationFn: async () => { + if (!deleting) return + await nodePoolsApi.deleteNodePool(deleting.id as unknown as string) + }, + onSuccess: async () => { + await qc.invalidateQueries({ queryKey: ["node-pools"] }) + setDeleteOpen(false) + setDeleting(null) + toast.success("Node pool deleted.") + }, + onError: (err: any) => toast.error(err?.message ?? "Unable to delete node pool."), + }) + + // --- Filter table + const filtered = useMemo(() => { + const data = (nodePoolQ.data ?? []) as DtoNodePoolResponse[] + const q = filter.trim().toLowerCase() + return q + ? data.filter( + (p) => p.name?.toLowerCase().includes(q) || (p.role as string)?.toLowerCase().includes(q) + ) + : data + }, [filter, nodePoolQ.data]) + + if (nodePoolQ.isLoading) return
Loading node pools…
+ if (nodePoolQ.error) + return ( +
+ Error loading node pools. +
+          {JSON.stringify(nodePoolQ.error, null, 2)}
+        
+
+ ) + + return ( +
+
+

Node Pools

+ +
+
+ + setFilter(e.target.value)} + placeholder="Search node pools" + className="w-64 pl-8" + /> +
+ + + + + + + + Create Node Pool + + +
+ + ( + + Name + + + + + + )} + /> + + ( + + Role + + + + )} + /> + + + + + + + +
+
+
+
+ +
+
+ + + + Name + Role + Servers + Annotations + Labels + Taints + Actions + + + + {filtered.map((p) => { + const serverCount = Array.isArray(p.servers) ? p.servers.length : 0 + return ( + + {p.name} + {p.role} + + {/* Servers cell */} + +
+ {(p.servers || []).slice(0, 6).map((s) => ( + + + {s.hostname || s.private_ip_address} + {s.role} + {s.status && ( + + + + )} + + ))} + {serverCount === 0 && ( + No servers + )} + {serverCount > 6 && ( + +{serverCount - 6} more + )} + + +
+
+ + {/* Annotations */} + +
+ {(p.annotations || []).slice(0, 6).map((a: any) => ( + + {a.key}:{a.value} + + ))} + {(p.annotations || []).length === 0 && ( + No annotations + )} + {(p.annotations || []).length > 6 && ( + + +{(p.annotations || []).length - 6} more + + )} + +
+
+ + {/* Labels */} + +
+ {(p.labels || []).slice(0, 6).map((l: any) => ( + + {l.key}:{l.value} + + ))} + {(p.labels || []).length === 0 && ( + No labels + )} + {(p.labels || []).length > 6 && ( + + +{(p.labels || []).length - 6} more + + )} + +
+
+ + {/* Taints */} + +
+ {(p.taints || []).slice(0, 6).map((t: any) => ( + + {t.key}:{t.value} + {t.effect ? ({t.effect}) : null} + + ))} + {(p.taints || []).length === 0 && ( + No taints + )} + {(p.taints || []).length > 6 && ( + + +{(p.taints || []).length - 6} more + + )} + +
+
+ + + + + + + + { + setEditing(p) + setUpdateOpen(true) + }} + > + Edit + + { + setDeleting(p) + setDeleteOpen(true) + }} + > + Delete + + + + +
+ ) + })} + {filtered.length === 0 && ( + + + No node pools found. + + + )} +
+
+
+
+ + {/* Edit dialog */} + + + + Edit Node Pool + + +
+ + ( + + Name + + + + + + )} + /> + + ( + + Role + + + + )} + /> + + + + + + + +
+
+ + {/* Delete confirm */} + + + + Delete node pool + +

+ This will permanently delete{" "} + {deleting?.name}. +

+ + + + +
+
+ + {/* Manage Servers dialog */} + + + + Manage Servers{managePool ? ` — ${managePool.name}` : ""} + + +
+
+ + setServerFilter(e.target.value)} + placeholder="Search by hostname, IP or role…" + className="pl-8" + /> +
+ +
+ + + + + Hostname + Private IP + Public IP + Role + Status + + + + {(serverQ.data ?? []) + .filter((s: any) => { + if (managePool?.role && !canAttachToPool(managePool.role as string, s.role)) { + return false + } + const q = serverFilter.trim().toLowerCase() + if (!q) return true + return ( + (s.hostname ?? "").toLowerCase().includes(q) || + (s.private_ip_address ?? "").toLowerCase().includes(q) || + (s.public_ip_address ?? "").toLowerCase().includes(q) || + (s.role ?? "").toLowerCase().includes(q) + ) + }) + .map((s: any) => { + const id = s.id as string + const checked = selected.has(id) + return ( + + + { + const next = new Set(selected) + if (e.target.checked) next.add(id) + else next.delete(id) + setSelected(next) + }} + /> + + {s.hostname || "—"} + {s.private_ip_address || "—"} + {s.public_ip_address || "—"} + {s.role || "—"} + + + + + ) + })} + {(serverQ.data ?? []).length === 0 && ( + + + {serverQ.isLoading ? "Loading servers…" : "No servers found."} + + + )} + +
+
+ +
+ Selected: {selected.size} +
+
+ + + + + +
+
+ + {/* Manage Labels */} + { + setManageLabelsOpen(o) + if (!o) setManageLATPool(null) + }} + title={`Manage Labels${manageLATPool ? ` — ${manageLATPool.name}` : ""}`} + items={(labelQ.data ?? []).map((l: any) => ({ + id: l.id as string, + key: l.key, + value: l.value, + name: `${l.key}:${l.value}`, + }))} + initialSelectedIds={labelsInitial} + columns={[ + { header: "Key", render: (it) => {it.key} }, + { header: "Value", render: (it) => it.value ?? "—" }, + ]} + onSave={async ({ toAttach, toDetach }) => { + if (!manageLATPool) return + const poolId = manageLATPool.id as unknown as string + try { + if (toAttach.length > 0) { + await nodePoolsApi.attachNodePoolLabels(poolId, { label_ids: toAttach }) + } + for (const id of toDetach) { + await nodePoolsApi.detachNodePoolLabels(poolId, id) + } + await qc.invalidateQueries({ queryKey: ["node-pools"] }) + toast.success("Labels updated for node pool.") + } catch (err: any) { + toast.error(err?.message ?? "Failed to update labels.") + throw err + } + }} + /> + + {/* Manage Annotations */} + { + setManageAnnotationsOpen(o) + if (!o) setManageLATPool(null) + }} + title={`Manage Annotations${manageLATPool ? ` — ${manageLATPool.name}` : ""}`} + items={(annotationQ.data ?? []).map((a: any) => ({ + id: a.id as string, + key: a.key, + value: a.value, + name: `${a.key}:${a.value}`, + }))} + initialSelectedIds={annotationsInitial} + columns={[ + { header: "Key", render: (it) => {it.key} }, + { header: "Value", render: (it) => it.value ?? "—" }, + ]} + onSave={async ({ toAttach, toDetach }) => { + if (!manageLATPool) return + const poolId = manageLATPool.id as unknown as string + try { + if (toAttach.length > 0) { + await nodePoolsApi.attachNodePoolAnnotations(poolId, { annotation_ids: toAttach }) + } + for (const id of toDetach) { + await nodePoolsApi.detachNodePoolAnnotations(poolId, id) + } + await qc.invalidateQueries({ queryKey: ["node-pools"] }) + toast.success("Annotations updated for node pool.") + } catch (err: any) { + toast.error(err?.message ?? "Failed to update annotations.") + throw err + } + }} + /> + + {/* Manage Taints */} + { + setManageTaintsOpen(o) + if (!o) setManageLATPool(null) + }} + title={`Manage Taints${manageLATPool ? ` — ${manageLATPool.name}` : ""}`} + items={(taintQ.data ?? []).map((t: any) => ({ + id: t.id as string, + key: t.key, + value: t.value, + effect: t.effect, + name: `${t.key}:${t.value}`, + }))} + initialSelectedIds={taintsInitial} + columns={[ + { header: "Key", render: (it) => {it.key} }, + { header: "Value", render: (it) => it.value ?? "—" }, + { header: "Effect", render: (it) => it.effect ?? "—" }, + ]} + onSave={async ({ toAttach, toDetach }) => { + if (!manageLATPool) return + const poolId = manageLATPool.id as unknown as string + try { + if (toAttach.length > 0) { + await nodePoolsApi.attachNodePoolTaints(poolId, { taint_ids: toAttach }) + } + for (const id of toDetach) { + await nodePoolsApi.detachNodePoolTaints(poolId, id) + } + await qc.invalidateQueries({ queryKey: ["node-pools"] }) + toast.success("Taints updated for node pool.") + } catch (err: any) { + toast.error(err?.message ?? "Failed to update taints.") + throw err + } + }} + /> +
+ ) +} diff --git a/ui/src/pages/servers/server-page.tsx b/ui/src/pages/servers/server-page.tsx index 78820f3..ae118e0 100644 --- a/ui/src/pages/servers/server-page.tsx +++ b/ui/src/pages/servers/server-page.tsx @@ -59,7 +59,7 @@ const createServerSchema = z public_ip_address: z.string().trim().optional().or(z.literal("")), private_ip_address: z.string().trim().min(1, "Private IP address required"), role: z.enum(ROLE_OPTIONS), - ssh_key_id: z.string().uuid("Pick a valid SSH key"), + ssh_key_id: z.uuid("Pick a valid SSH key"), ssh_user: z.string().trim().min(1, "SSH user is required"), status: z.enum(STATUS).default("pending"), }) diff --git a/ui/src/sdk/.openapi-generator/FILES b/ui/src/sdk/.openapi-generator/FILES index 67c4490..0dd7431 100644 --- a/ui/src/sdk/.openapi-generator/FILES +++ b/ui/src/sdk/.openapi-generator/FILES @@ -6,9 +6,14 @@ docs/AnnotationsApi.md docs/ArcherAdminApi.md docs/AuthApi.md docs/DtoAnnotationResponse.md +docs/DtoAttachAnnotationsRequest.md +docs/DtoAttachLabelsRequest.md +docs/DtoAttachServersRequest.md +docs/DtoAttachTaintsRequest.md docs/DtoAuthStartResponse.md docs/DtoCreateAnnotationRequest.md docs/DtoCreateLabelRequest.md +docs/DtoCreateNodePoolRequest.md docs/DtoCreateSSHRequest.md docs/DtoCreateServerRequest.md docs/DtoCreateTaintRequest.md @@ -18,6 +23,7 @@ docs/DtoJob.md docs/DtoJobStatus.md docs/DtoLabelResponse.md docs/DtoLogoutRequest.md +docs/DtoNodePoolResponse.md docs/DtoPageJob.md docs/DtoQueueInfo.md docs/DtoRefreshRequest.md @@ -28,6 +34,7 @@ docs/DtoTaintResponse.md docs/DtoTokenPair.md docs/DtoUpdateAnnotationRequest.md docs/DtoUpdateLabelRequest.md +docs/DtoUpdateNodePoolRequest.md docs/DtoUpdateServerRequest.md docs/DtoUpdateTaintRequest.md docs/HandlersCreateUserKeyRequest.md @@ -49,6 +56,7 @@ docs/ModelsAPIKey.md docs/ModelsOrganization.md docs/ModelsUser.md docs/ModelsUserEmail.md +docs/NodePoolsApi.md docs/OrgsApi.md docs/ServersApi.md docs/SshApi.md @@ -62,6 +70,7 @@ src/apis/HealthApi.ts src/apis/LabelsApi.ts src/apis/MeAPIKeysApi.ts src/apis/MeApi.ts +src/apis/NodePoolsApi.ts src/apis/OrgsApi.ts src/apis/ServersApi.ts src/apis/SshApi.ts @@ -69,9 +78,14 @@ src/apis/TaintsApi.ts src/apis/index.ts src/index.ts src/models/DtoAnnotationResponse.ts +src/models/DtoAttachAnnotationsRequest.ts +src/models/DtoAttachLabelsRequest.ts +src/models/DtoAttachServersRequest.ts +src/models/DtoAttachTaintsRequest.ts src/models/DtoAuthStartResponse.ts src/models/DtoCreateAnnotationRequest.ts src/models/DtoCreateLabelRequest.ts +src/models/DtoCreateNodePoolRequest.ts src/models/DtoCreateSSHRequest.ts src/models/DtoCreateServerRequest.ts src/models/DtoCreateTaintRequest.ts @@ -81,6 +95,7 @@ src/models/DtoJob.ts src/models/DtoJobStatus.ts src/models/DtoLabelResponse.ts src/models/DtoLogoutRequest.ts +src/models/DtoNodePoolResponse.ts src/models/DtoPageJob.ts src/models/DtoQueueInfo.ts src/models/DtoRefreshRequest.ts @@ -91,6 +106,7 @@ src/models/DtoTaintResponse.ts src/models/DtoTokenPair.ts src/models/DtoUpdateAnnotationRequest.ts src/models/DtoUpdateLabelRequest.ts +src/models/DtoUpdateNodePoolRequest.ts src/models/DtoUpdateServerRequest.ts src/models/DtoUpdateTaintRequest.ts src/models/HandlersCreateUserKeyRequest.ts diff --git a/ui/src/sdk/apis/NodePoolsApi.ts b/ui/src/sdk/apis/NodePoolsApi.ts new file mode 100644 index 0000000..52f4bee --- /dev/null +++ b/ui/src/sdk/apis/NodePoolsApi.ts @@ -0,0 +1,1170 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * AutoGlue API + * API for managing K3s clusters across cloud providers + * + * The version of the OpenAPI document: 1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from "../runtime" +import type { + DtoAnnotationResponse, + DtoAttachAnnotationsRequest, + DtoAttachLabelsRequest, + DtoAttachServersRequest, + DtoAttachTaintsRequest, + DtoCreateNodePoolRequest, + DtoLabelResponse, + DtoNodePoolResponse, + DtoServerResponse, + DtoTaintResponse, + DtoUpdateNodePoolRequest, +} from "../models/index" +import { + DtoAnnotationResponseFromJSON, + DtoAttachAnnotationsRequestToJSON, + DtoAttachLabelsRequestToJSON, + DtoAttachServersRequestToJSON, + DtoAttachTaintsRequestToJSON, + DtoCreateNodePoolRequestToJSON, + DtoLabelResponseFromJSON, + DtoNodePoolResponseFromJSON, + DtoServerResponseFromJSON, + DtoTaintResponseFromJSON, + DtoUpdateNodePoolRequestToJSON, +} from "../models/index" + +export interface AttachNodePoolAnnotationsRequest { + id: string; + body: DtoAttachAnnotationsRequest; + xOrgID?: string; +} + +export interface AttachNodePoolLabelsRequest { + id: string; + body: DtoAttachLabelsRequest; + xOrgID?: string; +} + +export interface AttachNodePoolServersRequest { + id: string; + body: DtoAttachServersRequest; + xOrgID?: string; +} + +export interface AttachNodePoolTaintsRequest { + id: string; + body: DtoAttachTaintsRequest; + xOrgID?: string; +} + +export interface CreateNodePoolRequest { + body: DtoCreateNodePoolRequest; + xOrgID?: string; +} + +export interface DeleteNodePoolRequest { + id: string; + xOrgID?: string; +} + +export interface DetachNodePoolAnnotationRequest { + id: string; + annotationId: string; + xOrgID?: string; +} + +export interface DetachNodePoolLabelRequest { + id: string; + labelId: string; + xOrgID?: string; +} + +export interface DetachNodePoolServerRequest { + id: string; + serverId: string; + xOrgID?: string; +} + +export interface DetachNodePoolTaintRequest { + id: string; + taintId: string; + xOrgID?: string; +} + +export interface GetNodePoolRequest { + id: string; + xOrgID?: string; +} + +export interface ListNodePoolAnnotationsRequest { + id: string; + xOrgID?: string; +} + +export interface ListNodePoolLabelsRequest { + id: string; + xOrgID?: string; +} + +export interface ListNodePoolServersRequest { + id: string; + xOrgID?: string; +} + +export interface ListNodePoolTaintsRequest { + id: string; + xOrgID?: string; +} + +export interface ListNodePoolsRequest { + xOrgID?: string; + q?: string; +} + +export interface UpdateNodePoolRequest { + id: string; + body: DtoUpdateNodePoolRequest; + xOrgID?: string; +} + +/** + * + */ +export class NodePoolsApi extends runtime.BaseAPI { + + /** + * Attach annotation to a node pool (org scoped) + */ + async attachNodePoolAnnotationsRaw(requestParameters: AttachNodePoolAnnotationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling attachNodePoolAnnotations().' + ); + } + + if (requestParameters['body'] == null) { + throw new runtime.RequiredError( + 'body', + 'Required parameter "body" was null or undefined when calling attachNodePoolAnnotations().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters['xOrgID'] != null) { + headerParameters['X-Org-ID'] = String(requestParameters['xOrgID']); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-KEY"] = await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-SECRET"] = await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // BearerAuth authentication + } + + + let urlPath = `/node-pools/{id}/annotations`; + urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DtoAttachAnnotationsRequestToJSON(requestParameters['body']), + }, initOverrides); + + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Attach annotation to a node pool (org scoped) + */ + async attachNodePoolAnnotations(requestParameters: AttachNodePoolAnnotationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.attachNodePoolAnnotationsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Attach labels to a node pool (org scoped) + */ + async attachNodePoolLabelsRaw(requestParameters: AttachNodePoolLabelsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling attachNodePoolLabels().' + ); + } + + if (requestParameters['body'] == null) { + throw new runtime.RequiredError( + 'body', + 'Required parameter "body" was null or undefined when calling attachNodePoolLabels().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters['xOrgID'] != null) { + headerParameters['X-Org-ID'] = String(requestParameters['xOrgID']); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-KEY"] = await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-SECRET"] = await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // BearerAuth authentication + } + + + let urlPath = `/node-pools/{id}/labels`; + urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DtoAttachLabelsRequestToJSON(requestParameters['body']), + }, initOverrides); + + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Attach labels to a node pool (org scoped) + */ + async attachNodePoolLabels(requestParameters: AttachNodePoolLabelsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.attachNodePoolLabelsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Attach servers to a node pool (org scoped) + */ + async attachNodePoolServersRaw(requestParameters: AttachNodePoolServersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling attachNodePoolServers().' + ); + } + + if (requestParameters['body'] == null) { + throw new runtime.RequiredError( + 'body', + 'Required parameter "body" was null or undefined when calling attachNodePoolServers().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters['xOrgID'] != null) { + headerParameters['X-Org-ID'] = String(requestParameters['xOrgID']); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-KEY"] = await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-SECRET"] = await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // BearerAuth authentication + } + + + let urlPath = `/node-pools/{id}/servers`; + urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DtoAttachServersRequestToJSON(requestParameters['body']), + }, initOverrides); + + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Attach servers to a node pool (org scoped) + */ + async attachNodePoolServers(requestParameters: AttachNodePoolServersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.attachNodePoolServersRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Attach taints to a node pool (org scoped) + */ + async attachNodePoolTaintsRaw(requestParameters: AttachNodePoolTaintsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling attachNodePoolTaints().' + ); + } + + if (requestParameters['body'] == null) { + throw new runtime.RequiredError( + 'body', + 'Required parameter "body" was null or undefined when calling attachNodePoolTaints().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters['xOrgID'] != null) { + headerParameters['X-Org-ID'] = String(requestParameters['xOrgID']); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-KEY"] = await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-SECRET"] = await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // BearerAuth authentication + } + + + let urlPath = `/node-pools/{id}/taints`; + urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DtoAttachTaintsRequestToJSON(requestParameters['body']), + }, initOverrides); + + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Attach taints to a node pool (org scoped) + */ + async attachNodePoolTaints(requestParameters: AttachNodePoolTaintsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.attachNodePoolTaintsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Creates a node pool. Optionally attach initial servers. + * Create node pool (org scoped) + */ + async createNodePoolRaw(requestParameters: CreateNodePoolRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['body'] == null) { + throw new runtime.RequiredError( + 'body', + 'Required parameter "body" was null or undefined when calling createNodePool().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters['xOrgID'] != null) { + headerParameters['X-Org-ID'] = String(requestParameters['xOrgID']); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-KEY"] = await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-SECRET"] = await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // BearerAuth authentication + } + + + let urlPath = `/node-pools`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DtoCreateNodePoolRequestToJSON(requestParameters['body']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DtoNodePoolResponseFromJSON(jsonValue)); + } + + /** + * Creates a node pool. Optionally attach initial servers. + * Create node pool (org scoped) + */ + async createNodePool(requestParameters: CreateNodePoolRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.createNodePoolRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Permanently deletes the node pool. + * Delete node pool (org scoped) + */ + async deleteNodePoolRaw(requestParameters: DeleteNodePoolRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling deleteNodePool().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters['xOrgID'] != null) { + headerParameters['X-Org-ID'] = String(requestParameters['xOrgID']); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-KEY"] = await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-SECRET"] = await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // BearerAuth authentication + } + + + let urlPath = `/node-pools/{id}`; + urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); + + const response = await this.request({ + path: urlPath, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Permanently deletes the node pool. + * Delete node pool (org scoped) + */ + async deleteNodePool(requestParameters: DeleteNodePoolRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.deleteNodePoolRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Detach one annotation from a node pool (org scoped) + */ + async detachNodePoolAnnotationRaw(requestParameters: DetachNodePoolAnnotationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling detachNodePoolAnnotation().' + ); + } + + if (requestParameters['annotationId'] == null) { + throw new runtime.RequiredError( + 'annotationId', + 'Required parameter "annotationId" was null or undefined when calling detachNodePoolAnnotation().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters['xOrgID'] != null) { + headerParameters['X-Org-ID'] = String(requestParameters['xOrgID']); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-KEY"] = await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-SECRET"] = await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // BearerAuth authentication + } + + + let urlPath = `/node-pools/{id}/annotations/{annotationId}`; + urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); + urlPath = urlPath.replace(`{${"annotationId"}}`, encodeURIComponent(String(requestParameters['annotationId']))); + + const response = await this.request({ + path: urlPath, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Detach one annotation from a node pool (org scoped) + */ + async detachNodePoolAnnotation(requestParameters: DetachNodePoolAnnotationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.detachNodePoolAnnotationRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Detach one label from a node pool (org scoped) + */ + async detachNodePoolLabelRaw(requestParameters: DetachNodePoolLabelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling detachNodePoolLabel().' + ); + } + + if (requestParameters['labelId'] == null) { + throw new runtime.RequiredError( + 'labelId', + 'Required parameter "labelId" was null or undefined when calling detachNodePoolLabel().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters['xOrgID'] != null) { + headerParameters['X-Org-ID'] = String(requestParameters['xOrgID']); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-KEY"] = await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-SECRET"] = await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // BearerAuth authentication + } + + + let urlPath = `/node-pools/{id}/labels/{labelId}`; + urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); + urlPath = urlPath.replace(`{${"labelId"}}`, encodeURIComponent(String(requestParameters['labelId']))); + + const response = await this.request({ + path: urlPath, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Detach one label from a node pool (org scoped) + */ + async detachNodePoolLabel(requestParameters: DetachNodePoolLabelRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.detachNodePoolLabelRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Detach one server from a node pool (org scoped) + */ + async detachNodePoolServerRaw(requestParameters: DetachNodePoolServerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling detachNodePoolServer().' + ); + } + + if (requestParameters['serverId'] == null) { + throw new runtime.RequiredError( + 'serverId', + 'Required parameter "serverId" was null or undefined when calling detachNodePoolServer().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters['xOrgID'] != null) { + headerParameters['X-Org-ID'] = String(requestParameters['xOrgID']); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-KEY"] = await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-SECRET"] = await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // BearerAuth authentication + } + + + let urlPath = `/node-pools/{id}/servers/{serverId}`; + urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); + urlPath = urlPath.replace(`{${"serverId"}}`, encodeURIComponent(String(requestParameters['serverId']))); + + const response = await this.request({ + path: urlPath, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Detach one server from a node pool (org scoped) + */ + async detachNodePoolServer(requestParameters: DetachNodePoolServerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.detachNodePoolServerRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Detach one taint from a node pool (org scoped) + */ + async detachNodePoolTaintRaw(requestParameters: DetachNodePoolTaintRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling detachNodePoolTaint().' + ); + } + + if (requestParameters['taintId'] == null) { + throw new runtime.RequiredError( + 'taintId', + 'Required parameter "taintId" was null or undefined when calling detachNodePoolTaint().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters['xOrgID'] != null) { + headerParameters['X-Org-ID'] = String(requestParameters['xOrgID']); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-KEY"] = await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-SECRET"] = await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // BearerAuth authentication + } + + + let urlPath = `/node-pools/{id}/taints/{taintId}`; + urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); + urlPath = urlPath.replace(`{${"taintId"}}`, encodeURIComponent(String(requestParameters['taintId']))); + + const response = await this.request({ + path: urlPath, + method: 'DELETE', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + if (this.isJsonMime(response.headers.get('content-type'))) { + return new runtime.JSONApiResponse(response); + } else { + return new runtime.TextApiResponse(response) as any; + } + } + + /** + * Detach one taint from a node pool (org scoped) + */ + async detachNodePoolTaint(requestParameters: DetachNodePoolTaintRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.detachNodePoolTaintRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Returns one node pool. Add `include=servers` to include servers. + * Get node pool by ID (org scoped) + */ + async getNodePoolRaw(requestParameters: GetNodePoolRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling getNodePool().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters['xOrgID'] != null) { + headerParameters['X-Org-ID'] = String(requestParameters['xOrgID']); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-KEY"] = await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-SECRET"] = await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // BearerAuth authentication + } + + + let urlPath = `/node-pools/{id}`; + urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); + + const response = await this.request({ + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DtoNodePoolResponseFromJSON(jsonValue)); + } + + /** + * Returns one node pool. Add `include=servers` to include servers. + * Get node pool by ID (org scoped) + */ + async getNodePool(requestParameters: GetNodePoolRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.getNodePoolRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List annotations attached to a node pool (org scoped) + */ + async listNodePoolAnnotationsRaw(requestParameters: ListNodePoolAnnotationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling listNodePoolAnnotations().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters['xOrgID'] != null) { + headerParameters['X-Org-ID'] = String(requestParameters['xOrgID']); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-KEY"] = await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-SECRET"] = await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // BearerAuth authentication + } + + + let urlPath = `/node-pools/{id}/annotations`; + urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); + + const response = await this.request({ + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(DtoAnnotationResponseFromJSON)); + } + + /** + * List annotations attached to a node pool (org scoped) + */ + async listNodePoolAnnotations(requestParameters: ListNodePoolAnnotationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.listNodePoolAnnotationsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List labels attached to a node pool (org scoped) + */ + async listNodePoolLabelsRaw(requestParameters: ListNodePoolLabelsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling listNodePoolLabels().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters['xOrgID'] != null) { + headerParameters['X-Org-ID'] = String(requestParameters['xOrgID']); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-KEY"] = await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-SECRET"] = await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // BearerAuth authentication + } + + + let urlPath = `/node-pools/{id}/labels`; + urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); + + const response = await this.request({ + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(DtoLabelResponseFromJSON)); + } + + /** + * List labels attached to a node pool (org scoped) + */ + async listNodePoolLabels(requestParameters: ListNodePoolLabelsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.listNodePoolLabelsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List servers attached to a node pool (org scoped) + */ + async listNodePoolServersRaw(requestParameters: ListNodePoolServersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling listNodePoolServers().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters['xOrgID'] != null) { + headerParameters['X-Org-ID'] = String(requestParameters['xOrgID']); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-KEY"] = await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-SECRET"] = await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // BearerAuth authentication + } + + + let urlPath = `/node-pools/{id}/servers`; + urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); + + const response = await this.request({ + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(DtoServerResponseFromJSON)); + } + + /** + * List servers attached to a node pool (org scoped) + */ + async listNodePoolServers(requestParameters: ListNodePoolServersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.listNodePoolServersRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List taints attached to a node pool (org scoped) + */ + async listNodePoolTaintsRaw(requestParameters: ListNodePoolTaintsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling listNodePoolTaints().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters['xOrgID'] != null) { + headerParameters['X-Org-ID'] = String(requestParameters['xOrgID']); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-KEY"] = await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-SECRET"] = await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // BearerAuth authentication + } + + + let urlPath = `/node-pools/{id}/taints`; + urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); + + const response = await this.request({ + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(DtoTaintResponseFromJSON)); + } + + /** + * List taints attached to a node pool (org scoped) + */ + async listNodePoolTaints(requestParameters: ListNodePoolTaintsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.listNodePoolTaintsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Returns node pools for the organization in X-Org-ID. + * List node pools (org scoped) + */ + async listNodePoolsRaw(requestParameters: ListNodePoolsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>> { + const queryParameters: any = {}; + + if (requestParameters['q'] != null) { + queryParameters['q'] = requestParameters['q']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (requestParameters['xOrgID'] != null) { + headerParameters['X-Org-ID'] = String(requestParameters['xOrgID']); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-KEY"] = await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-SECRET"] = await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // BearerAuth authentication + } + + + let urlPath = `/node-pools`; + + const response = await this.request({ + path: urlPath, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(DtoNodePoolResponseFromJSON)); + } + + /** + * Returns node pools for the organization in X-Org-ID. + * List node pools (org scoped) + */ + async listNodePools(requestParameters: ListNodePoolsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const response = await this.listNodePoolsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Partially update node pool fields. + * Update node pool (org scoped) + */ + async updateNodePoolRaw(requestParameters: UpdateNodePoolRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['id'] == null) { + throw new runtime.RequiredError( + 'id', + 'Required parameter "id" was null or undefined when calling updateNodePool().' + ); + } + + if (requestParameters['body'] == null) { + throw new runtime.RequiredError( + 'body', + 'Required parameter "body" was null or undefined when calling updateNodePool().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (requestParameters['xOrgID'] != null) { + headerParameters['X-Org-ID'] = String(requestParameters['xOrgID']); + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-KEY"] = await this.configuration.apiKey("X-ORG-KEY"); // OrgKeyAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["X-ORG-SECRET"] = await this.configuration.apiKey("X-ORG-SECRET"); // OrgSecretAuth authentication + } + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // BearerAuth authentication + } + + + let urlPath = `/node-pools/{id}`; + urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))); + + const response = await this.request({ + path: urlPath, + method: 'PATCH', + headers: headerParameters, + query: queryParameters, + body: DtoUpdateNodePoolRequestToJSON(requestParameters['body']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DtoNodePoolResponseFromJSON(jsonValue)); + } + + /** + * Partially update node pool fields. + * Update node pool (org scoped) + */ + async updateNodePool(requestParameters: UpdateNodePoolRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.updateNodePoolRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/ui/src/sdk/apis/index.ts b/ui/src/sdk/apis/index.ts index 1989451..54ca292 100644 --- a/ui/src/sdk/apis/index.ts +++ b/ui/src/sdk/apis/index.ts @@ -7,6 +7,7 @@ export * from './HealthApi'; export * from './LabelsApi'; export * from './MeApi'; export * from './MeAPIKeysApi'; +export * from './NodePoolsApi'; export * from './OrgsApi'; export * from './ServersApi'; export * from './SshApi'; diff --git a/ui/src/sdk/docs/AnnotationsApi.md b/ui/src/sdk/docs/AnnotationsApi.md index 2f5331d..6690874 100644 --- a/ui/src/sdk/docs/AnnotationsApi.md +++ b/ui/src/sdk/docs/AnnotationsApi.md @@ -1,6 +1,6 @@ # AnnotationsApi -All URIs are relative to *http://localhost:8080/api/v1* +All URIs are relative to */api/v1* | Method | HTTP request | Description | |------------- | ------------- | -------------| diff --git a/ui/src/sdk/docs/ArcherAdminApi.md b/ui/src/sdk/docs/ArcherAdminApi.md index 995fa06..8d37832 100644 --- a/ui/src/sdk/docs/ArcherAdminApi.md +++ b/ui/src/sdk/docs/ArcherAdminApi.md @@ -1,6 +1,6 @@ # ArcherAdminApi -All URIs are relative to *http://localhost:8080/api/v1* +All URIs are relative to */api/v1* | Method | HTTP request | Description | |------------- | ------------- | -------------| diff --git a/ui/src/sdk/docs/AuthApi.md b/ui/src/sdk/docs/AuthApi.md index eb48069..f5b3a9c 100644 --- a/ui/src/sdk/docs/AuthApi.md +++ b/ui/src/sdk/docs/AuthApi.md @@ -1,6 +1,6 @@ # AuthApi -All URIs are relative to *http://localhost:8080/api/v1* +All URIs are relative to */api/v1* | Method | HTTP request | Description | |------------- | ------------- | -------------| diff --git a/ui/src/sdk/docs/DtoAttachAnnotationsRequest.md b/ui/src/sdk/docs/DtoAttachAnnotationsRequest.md new file mode 100644 index 0000000..eb56c1e --- /dev/null +++ b/ui/src/sdk/docs/DtoAttachAnnotationsRequest.md @@ -0,0 +1,34 @@ + +# DtoAttachAnnotationsRequest + + +## Properties + +Name | Type +------------ | ------------- +`annotation_ids` | Array<string> + +## Example + +```typescript +import type { DtoAttachAnnotationsRequest } from '@glueops/autoglue-sdk-go' + +// TODO: Update the object below with actual values +const example = { + "annotation_ids": null, +} satisfies DtoAttachAnnotationsRequest + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as DtoAttachAnnotationsRequest +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/ui/src/sdk/docs/DtoAttachLabelsRequest.md b/ui/src/sdk/docs/DtoAttachLabelsRequest.md new file mode 100644 index 0000000..7949f3a --- /dev/null +++ b/ui/src/sdk/docs/DtoAttachLabelsRequest.md @@ -0,0 +1,34 @@ + +# DtoAttachLabelsRequest + + +## Properties + +Name | Type +------------ | ------------- +`label_ids` | Array<string> + +## Example + +```typescript +import type { DtoAttachLabelsRequest } from '@glueops/autoglue-sdk-go' + +// TODO: Update the object below with actual values +const example = { + "label_ids": null, +} satisfies DtoAttachLabelsRequest + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as DtoAttachLabelsRequest +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/ui/src/sdk/docs/DtoAttachServersRequest.md b/ui/src/sdk/docs/DtoAttachServersRequest.md new file mode 100644 index 0000000..f68dd1c --- /dev/null +++ b/ui/src/sdk/docs/DtoAttachServersRequest.md @@ -0,0 +1,34 @@ + +# DtoAttachServersRequest + + +## Properties + +Name | Type +------------ | ------------- +`server_ids` | Array<string> + +## Example + +```typescript +import type { DtoAttachServersRequest } from '@glueops/autoglue-sdk-go' + +// TODO: Update the object below with actual values +const example = { + "server_ids": null, +} satisfies DtoAttachServersRequest + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as DtoAttachServersRequest +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/ui/src/sdk/docs/DtoAttachTaintsRequest.md b/ui/src/sdk/docs/DtoAttachTaintsRequest.md new file mode 100644 index 0000000..bc4d768 --- /dev/null +++ b/ui/src/sdk/docs/DtoAttachTaintsRequest.md @@ -0,0 +1,34 @@ + +# DtoAttachTaintsRequest + + +## Properties + +Name | Type +------------ | ------------- +`taint_ids` | Array<string> + +## Example + +```typescript +import type { DtoAttachTaintsRequest } from '@glueops/autoglue-sdk-go' + +// TODO: Update the object below with actual values +const example = { + "taint_ids": null, +} satisfies DtoAttachTaintsRequest + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as DtoAttachTaintsRequest +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/ui/src/sdk/docs/DtoCreateNodePoolRequest.md b/ui/src/sdk/docs/DtoCreateNodePoolRequest.md new file mode 100644 index 0000000..97a833c --- /dev/null +++ b/ui/src/sdk/docs/DtoCreateNodePoolRequest.md @@ -0,0 +1,36 @@ + +# DtoCreateNodePoolRequest + + +## Properties + +Name | Type +------------ | ------------- +`name` | string +`role` | string + +## Example + +```typescript +import type { DtoCreateNodePoolRequest } from '@glueops/autoglue-sdk-go' + +// TODO: Update the object below with actual values +const example = { + "name": null, + "role": null, +} satisfies DtoCreateNodePoolRequest + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as DtoCreateNodePoolRequest +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/ui/src/sdk/docs/DtoNodePoolResponse.md b/ui/src/sdk/docs/DtoNodePoolResponse.md new file mode 100644 index 0000000..1fa77a6 --- /dev/null +++ b/ui/src/sdk/docs/DtoNodePoolResponse.md @@ -0,0 +1,52 @@ + +# DtoNodePoolResponse + + +## Properties + +Name | Type +------------ | ------------- +`annotations` | [Array<DtoAnnotationResponse>](DtoAnnotationResponse.md) +`created_at` | string +`id` | string +`labels` | [Array<DtoLabelResponse>](DtoLabelResponse.md) +`name` | string +`organization_id` | string +`role` | string +`servers` | [Array<DtoServerResponse>](DtoServerResponse.md) +`taints` | [Array<DtoTaintResponse>](DtoTaintResponse.md) +`updated_at` | string + +## Example + +```typescript +import type { DtoNodePoolResponse } from '@glueops/autoglue-sdk-go' + +// TODO: Update the object below with actual values +const example = { + "annotations": null, + "created_at": null, + "id": null, + "labels": null, + "name": null, + "organization_id": null, + "role": null, + "servers": null, + "taints": null, + "updated_at": null, +} satisfies DtoNodePoolResponse + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as DtoNodePoolResponse +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/ui/src/sdk/docs/DtoServerResponse.md b/ui/src/sdk/docs/DtoServerResponse.md index 0303132..bfb7aaf 100644 --- a/ui/src/sdk/docs/DtoServerResponse.md +++ b/ui/src/sdk/docs/DtoServerResponse.md @@ -31,10 +31,10 @@ const example = { "organization_id": null, "private_ip_address": null, "public_ip_address": null, - "role": null, + "role": master|worker|bastion, "ssh_key_id": null, "ssh_user": null, - "status": null, + "status": pending|provisioning|ready|failed, "updated_at": null, } satisfies DtoServerResponse diff --git a/ui/src/sdk/docs/DtoUpdateNodePoolRequest.md b/ui/src/sdk/docs/DtoUpdateNodePoolRequest.md new file mode 100644 index 0000000..48ea60a --- /dev/null +++ b/ui/src/sdk/docs/DtoUpdateNodePoolRequest.md @@ -0,0 +1,36 @@ + +# DtoUpdateNodePoolRequest + + +## Properties + +Name | Type +------------ | ------------- +`name` | string +`role` | string + +## Example + +```typescript +import type { DtoUpdateNodePoolRequest } from '@glueops/autoglue-sdk-go' + +// TODO: Update the object below with actual values +const example = { + "name": null, + "role": null, +} satisfies DtoUpdateNodePoolRequest + +console.log(example) + +// Convert the instance to a JSON string +const exampleJSON: string = JSON.stringify(example) +console.log(exampleJSON) + +// Parse the JSON string back to an object +const exampleParsed = JSON.parse(exampleJSON) as DtoUpdateNodePoolRequest +console.log(exampleParsed) +``` + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + diff --git a/ui/src/sdk/docs/HealthApi.md b/ui/src/sdk/docs/HealthApi.md index f6f82bc..af32193 100644 --- a/ui/src/sdk/docs/HealthApi.md +++ b/ui/src/sdk/docs/HealthApi.md @@ -1,6 +1,6 @@ # HealthApi -All URIs are relative to *http://localhost:8080/api/v1* +All URIs are relative to */api/v1* | Method | HTTP request | Description | |------------- | ------------- | -------------| diff --git a/ui/src/sdk/docs/LabelsApi.md b/ui/src/sdk/docs/LabelsApi.md index 2333fca..4e71362 100644 --- a/ui/src/sdk/docs/LabelsApi.md +++ b/ui/src/sdk/docs/LabelsApi.md @@ -1,6 +1,6 @@ # LabelsApi -All URIs are relative to *http://localhost:8080/api/v1* +All URIs are relative to */api/v1* | Method | HTTP request | Description | |------------- | ------------- | -------------| diff --git a/ui/src/sdk/docs/MeAPIKeysApi.md b/ui/src/sdk/docs/MeAPIKeysApi.md index bf85dd3..42e26c7 100644 --- a/ui/src/sdk/docs/MeAPIKeysApi.md +++ b/ui/src/sdk/docs/MeAPIKeysApi.md @@ -1,6 +1,6 @@ # MeAPIKeysApi -All URIs are relative to *http://localhost:8080/api/v1* +All URIs are relative to */api/v1* | Method | HTTP request | Description | |------------- | ------------- | -------------| diff --git a/ui/src/sdk/docs/MeApi.md b/ui/src/sdk/docs/MeApi.md index 8b189a3..e21cfaf 100644 --- a/ui/src/sdk/docs/MeApi.md +++ b/ui/src/sdk/docs/MeApi.md @@ -1,6 +1,6 @@ # MeApi -All URIs are relative to *http://localhost:8080/api/v1* +All URIs are relative to */api/v1* | Method | HTTP request | Description | |------------- | ------------- | -------------| diff --git a/ui/src/sdk/docs/NodePoolsApi.md b/ui/src/sdk/docs/NodePoolsApi.md new file mode 100644 index 0000000..fa21f3a --- /dev/null +++ b/ui/src/sdk/docs/NodePoolsApi.md @@ -0,0 +1,1435 @@ +# NodePoolsApi + +All URIs are relative to */api/v1* + +| Method | HTTP request | Description | +|------------- | ------------- | -------------| +| [**attachNodePoolAnnotations**](NodePoolsApi.md#attachnodepoolannotations) | **POST** /node-pools/{id}/annotations | Attach annotation to a node pool (org scoped) | +| [**attachNodePoolLabels**](NodePoolsApi.md#attachnodepoollabels) | **POST** /node-pools/{id}/labels | Attach labels to a node pool (org scoped) | +| [**attachNodePoolServers**](NodePoolsApi.md#attachnodepoolservers) | **POST** /node-pools/{id}/servers | Attach servers to a node pool (org scoped) | +| [**attachNodePoolTaints**](NodePoolsApi.md#attachnodepooltaints) | **POST** /node-pools/{id}/taints | Attach taints to a node pool (org scoped) | +| [**createNodePool**](NodePoolsApi.md#createnodepool) | **POST** /node-pools | Create node pool (org scoped) | +| [**deleteNodePool**](NodePoolsApi.md#deletenodepool) | **DELETE** /node-pools/{id} | Delete node pool (org scoped) | +| [**detachNodePoolAnnotation**](NodePoolsApi.md#detachnodepoolannotation) | **DELETE** /node-pools/{id}/annotations/{annotationId} | Detach one annotation from a node pool (org scoped) | +| [**detachNodePoolLabel**](NodePoolsApi.md#detachnodepoollabel) | **DELETE** /node-pools/{id}/labels/{labelId} | Detach one label from a node pool (org scoped) | +| [**detachNodePoolServer**](NodePoolsApi.md#detachnodepoolserver) | **DELETE** /node-pools/{id}/servers/{serverId} | Detach one server from a node pool (org scoped) | +| [**detachNodePoolTaint**](NodePoolsApi.md#detachnodepooltaint) | **DELETE** /node-pools/{id}/taints/{taintId} | Detach one taint from a node pool (org scoped) | +| [**getNodePool**](NodePoolsApi.md#getnodepool) | **GET** /node-pools/{id} | Get node pool by ID (org scoped) | +| [**listNodePoolAnnotations**](NodePoolsApi.md#listnodepoolannotations) | **GET** /node-pools/{id}/annotations | List annotations attached to a node pool (org scoped) | +| [**listNodePoolLabels**](NodePoolsApi.md#listnodepoollabels) | **GET** /node-pools/{id}/labels | List labels attached to a node pool (org scoped) | +| [**listNodePoolServers**](NodePoolsApi.md#listnodepoolservers) | **GET** /node-pools/{id}/servers | List servers attached to a node pool (org scoped) | +| [**listNodePoolTaints**](NodePoolsApi.md#listnodepooltaints) | **GET** /node-pools/{id}/taints | List taints attached to a node pool (org scoped) | +| [**listNodePools**](NodePoolsApi.md#listnodepools) | **GET** /node-pools | List node pools (org scoped) | +| [**updateNodePool**](NodePoolsApi.md#updatenodepool) | **PATCH** /node-pools/{id} | Update node pool (org scoped) | + + + +## attachNodePoolAnnotations + +> string attachNodePoolAnnotations(id, body, xOrgID) + +Attach annotation to a node pool (org scoped) + +### Example + +```ts +import { + Configuration, + NodePoolsApi, +} from '@glueops/autoglue-sdk-go'; +import type { AttachNodePoolAnnotationsRequest } from '@glueops/autoglue-sdk-go'; + +async function example() { + console.log("🚀 Testing @glueops/autoglue-sdk-go SDK..."); + const config = new Configuration({ + // To configure API key authorization: OrgKeyAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: OrgSecretAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: BearerAuth + apiKey: "YOUR API KEY", + }); + const api = new NodePoolsApi(config); + + const body = { + // string | Node Group ID (UUID) + id: id_example, + // DtoAttachAnnotationsRequest | Annotation IDs to attach + body: ..., + // string | Organization UUID (optional) + xOrgID: xOrgID_example, + } satisfies AttachNodePoolAnnotationsRequest; + + try { + const data = await api.attachNodePoolAnnotations(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | `string` | Node Group ID (UUID) | [Defaults to `undefined`] | +| **body** | [DtoAttachAnnotationsRequest](DtoAttachAnnotationsRequest.md) | Annotation IDs to attach | | +| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] | + +### Return type + +**string** + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | No Content | - | +| **400** | invalid id / invalid server_ids | - | +| **401** | Unauthorized | - | +| **403** | organization required | - | +| **404** | not found | - | +| **500** | attach failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## attachNodePoolLabels + +> string attachNodePoolLabels(id, body, xOrgID) + +Attach labels to a node pool (org scoped) + +### Example + +```ts +import { + Configuration, + NodePoolsApi, +} from '@glueops/autoglue-sdk-go'; +import type { AttachNodePoolLabelsRequest } from '@glueops/autoglue-sdk-go'; + +async function example() { + console.log("🚀 Testing @glueops/autoglue-sdk-go SDK..."); + const config = new Configuration({ + // To configure API key authorization: OrgKeyAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: OrgSecretAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: BearerAuth + apiKey: "YOUR API KEY", + }); + const api = new NodePoolsApi(config); + + const body = { + // string | Node Pool ID (UUID) + id: id_example, + // DtoAttachLabelsRequest | Label IDs to attach + body: ..., + // string | Organization UUID (optional) + xOrgID: xOrgID_example, + } satisfies AttachNodePoolLabelsRequest; + + try { + const data = await api.attachNodePoolLabels(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | `string` | Node Pool ID (UUID) | [Defaults to `undefined`] | +| **body** | [DtoAttachLabelsRequest](DtoAttachLabelsRequest.md) | Label IDs to attach | | +| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] | + +### Return type + +**string** + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | No Content | - | +| **400** | invalid id / invalid server_ids | - | +| **401** | Unauthorized | - | +| **403** | organization required | - | +| **404** | not found | - | +| **500** | attach failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## attachNodePoolServers + +> string attachNodePoolServers(id, body, xOrgID) + +Attach servers to a node pool (org scoped) + +### Example + +```ts +import { + Configuration, + NodePoolsApi, +} from '@glueops/autoglue-sdk-go'; +import type { AttachNodePoolServersRequest } from '@glueops/autoglue-sdk-go'; + +async function example() { + console.log("🚀 Testing @glueops/autoglue-sdk-go SDK..."); + const config = new Configuration({ + // To configure API key authorization: OrgKeyAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: OrgSecretAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: BearerAuth + apiKey: "YOUR API KEY", + }); + const api = new NodePoolsApi(config); + + const body = { + // string | Node Pool ID (UUID) + id: id_example, + // DtoAttachServersRequest | Server IDs to attach + body: ..., + // string | Organization UUID (optional) + xOrgID: xOrgID_example, + } satisfies AttachNodePoolServersRequest; + + try { + const data = await api.attachNodePoolServers(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | `string` | Node Pool ID (UUID) | [Defaults to `undefined`] | +| **body** | [DtoAttachServersRequest](DtoAttachServersRequest.md) | Server IDs to attach | | +| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] | + +### Return type + +**string** + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | No Content | - | +| **400** | invalid id / invalid server_ids | - | +| **401** | Unauthorized | - | +| **403** | organization required | - | +| **404** | not found | - | +| **500** | attach failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## attachNodePoolTaints + +> string attachNodePoolTaints(id, body, xOrgID) + +Attach taints to a node pool (org scoped) + +### Example + +```ts +import { + Configuration, + NodePoolsApi, +} from '@glueops/autoglue-sdk-go'; +import type { AttachNodePoolTaintsRequest } from '@glueops/autoglue-sdk-go'; + +async function example() { + console.log("🚀 Testing @glueops/autoglue-sdk-go SDK..."); + const config = new Configuration({ + // To configure API key authorization: OrgKeyAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: OrgSecretAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: BearerAuth + apiKey: "YOUR API KEY", + }); + const api = new NodePoolsApi(config); + + const body = { + // string | Node Pool ID (UUID) + id: id_example, + // DtoAttachTaintsRequest | Taint IDs to attach + body: ..., + // string | Organization UUID (optional) + xOrgID: xOrgID_example, + } satisfies AttachNodePoolTaintsRequest; + + try { + const data = await api.attachNodePoolTaints(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | `string` | Node Pool ID (UUID) | [Defaults to `undefined`] | +| **body** | [DtoAttachTaintsRequest](DtoAttachTaintsRequest.md) | Taint IDs to attach | | +| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] | + +### Return type + +**string** + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | No Content | - | +| **400** | invalid id / invalid taint_ids | - | +| **401** | Unauthorized | - | +| **403** | organization required | - | +| **404** | not found | - | +| **500** | attach failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## createNodePool + +> DtoNodePoolResponse createNodePool(body, xOrgID) + +Create node pool (org scoped) + +Creates a node pool. Optionally attach initial servers. + +### Example + +```ts +import { + Configuration, + NodePoolsApi, +} from '@glueops/autoglue-sdk-go'; +import type { CreateNodePoolRequest } from '@glueops/autoglue-sdk-go'; + +async function example() { + console.log("🚀 Testing @glueops/autoglue-sdk-go SDK..."); + const config = new Configuration({ + // To configure API key authorization: OrgKeyAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: OrgSecretAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: BearerAuth + apiKey: "YOUR API KEY", + }); + const api = new NodePoolsApi(config); + + const body = { + // DtoCreateNodePoolRequest | NodePool payload + body: ..., + // string | Organization UUID (optional) + xOrgID: xOrgID_example, + } satisfies CreateNodePoolRequest; + + try { + const data = await api.createNodePool(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **body** | [DtoCreateNodePoolRequest](DtoCreateNodePoolRequest.md) | NodePool payload | | +| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] | + +### Return type + +[**DtoNodePoolResponse**](DtoNodePoolResponse.md) + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **201** | Created | - | +| **400** | invalid json / missing fields / invalid server_ids | - | +| **401** | Unauthorized | - | +| **403** | organization required | - | +| **500** | create failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## deleteNodePool + +> string deleteNodePool(id, xOrgID) + +Delete node pool (org scoped) + +Permanently deletes the node pool. + +### Example + +```ts +import { + Configuration, + NodePoolsApi, +} from '@glueops/autoglue-sdk-go'; +import type { DeleteNodePoolRequest } from '@glueops/autoglue-sdk-go'; + +async function example() { + console.log("🚀 Testing @glueops/autoglue-sdk-go SDK..."); + const config = new Configuration({ + // To configure API key authorization: OrgKeyAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: OrgSecretAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: BearerAuth + apiKey: "YOUR API KEY", + }); + const api = new NodePoolsApi(config); + + const body = { + // string | Node Pool ID (UUID) + id: id_example, + // string | Organization UUID (optional) + xOrgID: xOrgID_example, + } satisfies DeleteNodePoolRequest; + + try { + const data = await api.deleteNodePool(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | `string` | Node Pool ID (UUID) | [Defaults to `undefined`] | +| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] | + +### Return type + +**string** + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | No Content | - | +| **400** | invalid id | - | +| **401** | Unauthorized | - | +| **403** | organization required | - | +| **500** | delete failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## detachNodePoolAnnotation + +> string detachNodePoolAnnotation(id, annotationId, xOrgID) + +Detach one annotation from a node pool (org scoped) + +### Example + +```ts +import { + Configuration, + NodePoolsApi, +} from '@glueops/autoglue-sdk-go'; +import type { DetachNodePoolAnnotationRequest } from '@glueops/autoglue-sdk-go'; + +async function example() { + console.log("🚀 Testing @glueops/autoglue-sdk-go SDK..."); + const config = new Configuration({ + // To configure API key authorization: OrgKeyAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: OrgSecretAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: BearerAuth + apiKey: "YOUR API KEY", + }); + const api = new NodePoolsApi(config); + + const body = { + // string | Node Pool ID (UUID) + id: id_example, + // string | Annotation ID (UUID) + annotationId: annotationId_example, + // string | Organization UUID (optional) + xOrgID: xOrgID_example, + } satisfies DetachNodePoolAnnotationRequest; + + try { + const data = await api.detachNodePoolAnnotation(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | `string` | Node Pool ID (UUID) | [Defaults to `undefined`] | +| **annotationId** | `string` | Annotation ID (UUID) | [Defaults to `undefined`] | +| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] | + +### Return type + +**string** + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | No Content | - | +| **400** | invalid id | - | +| **401** | Unauthorized | - | +| **403** | organization required | - | +| **404** | not found | - | +| **500** | detach failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## detachNodePoolLabel + +> string detachNodePoolLabel(id, labelId, xOrgID) + +Detach one label from a node pool (org scoped) + +### Example + +```ts +import { + Configuration, + NodePoolsApi, +} from '@glueops/autoglue-sdk-go'; +import type { DetachNodePoolLabelRequest } from '@glueops/autoglue-sdk-go'; + +async function example() { + console.log("🚀 Testing @glueops/autoglue-sdk-go SDK..."); + const config = new Configuration({ + // To configure API key authorization: OrgKeyAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: OrgSecretAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: BearerAuth + apiKey: "YOUR API KEY", + }); + const api = new NodePoolsApi(config); + + const body = { + // string | Node Pool ID (UUID) + id: id_example, + // string | Label ID (UUID) + labelId: labelId_example, + // string | Organization UUID (optional) + xOrgID: xOrgID_example, + } satisfies DetachNodePoolLabelRequest; + + try { + const data = await api.detachNodePoolLabel(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | `string` | Node Pool ID (UUID) | [Defaults to `undefined`] | +| **labelId** | `string` | Label ID (UUID) | [Defaults to `undefined`] | +| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] | + +### Return type + +**string** + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | No Content | - | +| **400** | invalid id | - | +| **401** | Unauthorized | - | +| **403** | organization required | - | +| **404** | not found | - | +| **500** | detach failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## detachNodePoolServer + +> string detachNodePoolServer(id, serverId, xOrgID) + +Detach one server from a node pool (org scoped) + +### Example + +```ts +import { + Configuration, + NodePoolsApi, +} from '@glueops/autoglue-sdk-go'; +import type { DetachNodePoolServerRequest } from '@glueops/autoglue-sdk-go'; + +async function example() { + console.log("🚀 Testing @glueops/autoglue-sdk-go SDK..."); + const config = new Configuration({ + // To configure API key authorization: OrgKeyAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: OrgSecretAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: BearerAuth + apiKey: "YOUR API KEY", + }); + const api = new NodePoolsApi(config); + + const body = { + // string | Node Pool ID (UUID) + id: id_example, + // string | Server ID (UUID) + serverId: serverId_example, + // string | Organization UUID (optional) + xOrgID: xOrgID_example, + } satisfies DetachNodePoolServerRequest; + + try { + const data = await api.detachNodePoolServer(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | `string` | Node Pool ID (UUID) | [Defaults to `undefined`] | +| **serverId** | `string` | Server ID (UUID) | [Defaults to `undefined`] | +| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] | + +### Return type + +**string** + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | No Content | - | +| **400** | invalid id | - | +| **401** | Unauthorized | - | +| **403** | organization required | - | +| **404** | not found | - | +| **500** | detach failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## detachNodePoolTaint + +> string detachNodePoolTaint(id, taintId, xOrgID) + +Detach one taint from a node pool (org scoped) + +### Example + +```ts +import { + Configuration, + NodePoolsApi, +} from '@glueops/autoglue-sdk-go'; +import type { DetachNodePoolTaintRequest } from '@glueops/autoglue-sdk-go'; + +async function example() { + console.log("🚀 Testing @glueops/autoglue-sdk-go SDK..."); + const config = new Configuration({ + // To configure API key authorization: OrgKeyAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: OrgSecretAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: BearerAuth + apiKey: "YOUR API KEY", + }); + const api = new NodePoolsApi(config); + + const body = { + // string | Node Pool ID (UUID) + id: id_example, + // string | Taint ID (UUID) + taintId: taintId_example, + // string | Organization UUID (optional) + xOrgID: xOrgID_example, + } satisfies DetachNodePoolTaintRequest; + + try { + const data = await api.detachNodePoolTaint(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | `string` | Node Pool ID (UUID) | [Defaults to `undefined`] | +| **taintId** | `string` | Taint ID (UUID) | [Defaults to `undefined`] | +| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] | + +### Return type + +**string** + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | No Content | - | +| **400** | invalid id | - | +| **401** | Unauthorized | - | +| **403** | organization required | - | +| **404** | not found | - | +| **500** | detach failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## getNodePool + +> DtoNodePoolResponse getNodePool(id, xOrgID) + +Get node pool by ID (org scoped) + +Returns one node pool. Add `include=servers` to include servers. + +### Example + +```ts +import { + Configuration, + NodePoolsApi, +} from '@glueops/autoglue-sdk-go'; +import type { GetNodePoolRequest } from '@glueops/autoglue-sdk-go'; + +async function example() { + console.log("🚀 Testing @glueops/autoglue-sdk-go SDK..."); + const config = new Configuration({ + // To configure API key authorization: OrgKeyAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: OrgSecretAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: BearerAuth + apiKey: "YOUR API KEY", + }); + const api = new NodePoolsApi(config); + + const body = { + // string | Node Pool ID (UUID) + id: id_example, + // string | Organization UUID (optional) + xOrgID: xOrgID_example, + } satisfies GetNodePoolRequest; + + try { + const data = await api.getNodePool(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | `string` | Node Pool ID (UUID) | [Defaults to `undefined`] | +| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] | + +### Return type + +[**DtoNodePoolResponse**](DtoNodePoolResponse.md) + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | invalid id | - | +| **401** | Unauthorized | - | +| **403** | organization required | - | +| **404** | not found | - | +| **500** | fetch failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## listNodePoolAnnotations + +> Array<DtoAnnotationResponse> listNodePoolAnnotations(id, xOrgID) + +List annotations attached to a node pool (org scoped) + +### Example + +```ts +import { + Configuration, + NodePoolsApi, +} from '@glueops/autoglue-sdk-go'; +import type { ListNodePoolAnnotationsRequest } from '@glueops/autoglue-sdk-go'; + +async function example() { + console.log("🚀 Testing @glueops/autoglue-sdk-go SDK..."); + const config = new Configuration({ + // To configure API key authorization: OrgKeyAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: OrgSecretAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: BearerAuth + apiKey: "YOUR API KEY", + }); + const api = new NodePoolsApi(config); + + const body = { + // string | Node Pool ID (UUID) + id: id_example, + // string | Organization UUID (optional) + xOrgID: xOrgID_example, + } satisfies ListNodePoolAnnotationsRequest; + + try { + const data = await api.listNodePoolAnnotations(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | `string` | Node Pool ID (UUID) | [Defaults to `undefined`] | +| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] | + +### Return type + +[**Array<DtoAnnotationResponse>**](DtoAnnotationResponse.md) + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | invalid id | - | +| **401** | Unauthorized | - | +| **403** | organization required | - | +| **404** | not found | - | +| **500** | fetch failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## listNodePoolLabels + +> Array<DtoLabelResponse> listNodePoolLabels(id, xOrgID) + +List labels attached to a node pool (org scoped) + +### Example + +```ts +import { + Configuration, + NodePoolsApi, +} from '@glueops/autoglue-sdk-go'; +import type { ListNodePoolLabelsRequest } from '@glueops/autoglue-sdk-go'; + +async function example() { + console.log("🚀 Testing @glueops/autoglue-sdk-go SDK..."); + const config = new Configuration({ + // To configure API key authorization: OrgKeyAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: OrgSecretAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: BearerAuth + apiKey: "YOUR API KEY", + }); + const api = new NodePoolsApi(config); + + const body = { + // string | Label Pool ID (UUID) + id: id_example, + // string | Organization UUID (optional) + xOrgID: xOrgID_example, + } satisfies ListNodePoolLabelsRequest; + + try { + const data = await api.listNodePoolLabels(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | `string` | Label Pool ID (UUID) | [Defaults to `undefined`] | +| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] | + +### Return type + +[**Array<DtoLabelResponse>**](DtoLabelResponse.md) + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | invalid id | - | +| **401** | Unauthorized | - | +| **403** | organization required | - | +| **404** | not found | - | +| **500** | fetch failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## listNodePoolServers + +> Array<DtoServerResponse> listNodePoolServers(id, xOrgID) + +List servers attached to a node pool (org scoped) + +### Example + +```ts +import { + Configuration, + NodePoolsApi, +} from '@glueops/autoglue-sdk-go'; +import type { ListNodePoolServersRequest } from '@glueops/autoglue-sdk-go'; + +async function example() { + console.log("🚀 Testing @glueops/autoglue-sdk-go SDK..."); + const config = new Configuration({ + // To configure API key authorization: OrgKeyAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: OrgSecretAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: BearerAuth + apiKey: "YOUR API KEY", + }); + const api = new NodePoolsApi(config); + + const body = { + // string | Node Pool ID (UUID) + id: id_example, + // string | Organization UUID (optional) + xOrgID: xOrgID_example, + } satisfies ListNodePoolServersRequest; + + try { + const data = await api.listNodePoolServers(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | `string` | Node Pool ID (UUID) | [Defaults to `undefined`] | +| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] | + +### Return type + +[**Array<DtoServerResponse>**](DtoServerResponse.md) + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | invalid id | - | +| **401** | Unauthorized | - | +| **403** | organization required | - | +| **404** | not found | - | +| **500** | fetch failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## listNodePoolTaints + +> Array<DtoTaintResponse> listNodePoolTaints(id, xOrgID) + +List taints attached to a node pool (org scoped) + +### Example + +```ts +import { + Configuration, + NodePoolsApi, +} from '@glueops/autoglue-sdk-go'; +import type { ListNodePoolTaintsRequest } from '@glueops/autoglue-sdk-go'; + +async function example() { + console.log("🚀 Testing @glueops/autoglue-sdk-go SDK..."); + const config = new Configuration({ + // To configure API key authorization: OrgKeyAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: OrgSecretAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: BearerAuth + apiKey: "YOUR API KEY", + }); + const api = new NodePoolsApi(config); + + const body = { + // string | Node Pool ID (UUID) + id: id_example, + // string | Organization UUID (optional) + xOrgID: xOrgID_example, + } satisfies ListNodePoolTaintsRequest; + + try { + const data = await api.listNodePoolTaints(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | `string` | Node Pool ID (UUID) | [Defaults to `undefined`] | +| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] | + +### Return type + +[**Array<DtoTaintResponse>**](DtoTaintResponse.md) + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | invalid id | - | +| **401** | Unauthorized | - | +| **403** | organization required | - | +| **404** | not found | - | +| **500** | fetch failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## listNodePools + +> Array<DtoNodePoolResponse> listNodePools(xOrgID, q) + +List node pools (org scoped) + +Returns node pools for the organization in X-Org-ID. + +### Example + +```ts +import { + Configuration, + NodePoolsApi, +} from '@glueops/autoglue-sdk-go'; +import type { ListNodePoolsRequest } from '@glueops/autoglue-sdk-go'; + +async function example() { + console.log("🚀 Testing @glueops/autoglue-sdk-go SDK..."); + const config = new Configuration({ + // To configure API key authorization: OrgKeyAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: OrgSecretAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: BearerAuth + apiKey: "YOUR API KEY", + }); + const api = new NodePoolsApi(config); + + const body = { + // string | Organization UUID (optional) + xOrgID: xOrgID_example, + // string | Name contains (case-insensitive) (optional) + q: q_example, + } satisfies ListNodePoolsRequest; + + try { + const data = await api.listNodePools(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] | +| **q** | `string` | Name contains (case-insensitive) | [Optional] [Defaults to `undefined`] | + +### Return type + +[**Array<DtoNodePoolResponse>**](DtoNodePoolResponse.md) + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **401** | Unauthorized | - | +| **403** | organization required | - | +| **500** | failed to list node pools | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + + +## updateNodePool + +> DtoNodePoolResponse updateNodePool(id, body, xOrgID) + +Update node pool (org scoped) + +Partially update node pool fields. + +### Example + +```ts +import { + Configuration, + NodePoolsApi, +} from '@glueops/autoglue-sdk-go'; +import type { UpdateNodePoolRequest } from '@glueops/autoglue-sdk-go'; + +async function example() { + console.log("🚀 Testing @glueops/autoglue-sdk-go SDK..."); + const config = new Configuration({ + // To configure API key authorization: OrgKeyAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: OrgSecretAuth + apiKey: "YOUR API KEY", + // To configure API key authorization: BearerAuth + apiKey: "YOUR API KEY", + }); + const api = new NodePoolsApi(config); + + const body = { + // string | Node Pool ID (UUID) + id: id_example, + // DtoUpdateNodePoolRequest | Fields to update + body: ..., + // string | Organization UUID (optional) + xOrgID: xOrgID_example, + } satisfies UpdateNodePoolRequest; + + try { + const data = await api.updateNodePool(body); + console.log(data); + } catch (error) { + console.error(error); + } +} + +// Run the test +example().catch(console.error); +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **id** | `string` | Node Pool ID (UUID) | [Defaults to `undefined`] | +| **body** | [DtoUpdateNodePoolRequest](DtoUpdateNodePoolRequest.md) | Fields to update | | +| **xOrgID** | `string` | Organization UUID | [Optional] [Defaults to `undefined`] | + +### Return type + +[**DtoNodePoolResponse**](DtoNodePoolResponse.md) + +### Authorization + +[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | invalid id / invalid json | - | +| **401** | Unauthorized | - | +| **403** | organization required | - | +| **404** | not found | - | +| **500** | update failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md) + diff --git a/ui/src/sdk/docs/OrgsApi.md b/ui/src/sdk/docs/OrgsApi.md index ed0c720..5ae52d3 100644 --- a/ui/src/sdk/docs/OrgsApi.md +++ b/ui/src/sdk/docs/OrgsApi.md @@ -1,6 +1,6 @@ # OrgsApi -All URIs are relative to *http://localhost:8080/api/v1* +All URIs are relative to */api/v1* | Method | HTTP request | Description | |------------- | ------------- | -------------| diff --git a/ui/src/sdk/docs/ServersApi.md b/ui/src/sdk/docs/ServersApi.md index 9238058..7708e9f 100644 --- a/ui/src/sdk/docs/ServersApi.md +++ b/ui/src/sdk/docs/ServersApi.md @@ -1,6 +1,6 @@ # ServersApi -All URIs are relative to *http://localhost:8080/api/v1* +All URIs are relative to */api/v1* | Method | HTTP request | Description | |------------- | ------------- | -------------| diff --git a/ui/src/sdk/docs/SshApi.md b/ui/src/sdk/docs/SshApi.md index 01181ac..d4ba898 100644 --- a/ui/src/sdk/docs/SshApi.md +++ b/ui/src/sdk/docs/SshApi.md @@ -1,6 +1,6 @@ # SshApi -All URIs are relative to *http://localhost:8080/api/v1* +All URIs are relative to */api/v1* | Method | HTTP request | Description | |------------- | ------------- | -------------| diff --git a/ui/src/sdk/docs/TaintsApi.md b/ui/src/sdk/docs/TaintsApi.md index aa7f9c8..d33a883 100644 --- a/ui/src/sdk/docs/TaintsApi.md +++ b/ui/src/sdk/docs/TaintsApi.md @@ -1,6 +1,6 @@ # TaintsApi -All URIs are relative to *http://localhost:8080/api/v1* +All URIs are relative to */api/v1* | Method | HTTP request | Description | |------------- | ------------- | -------------| diff --git a/ui/src/sdk/models/DtoAttachAnnotationsRequest.ts b/ui/src/sdk/models/DtoAttachAnnotationsRequest.ts new file mode 100644 index 0000000..d8595cf --- /dev/null +++ b/ui/src/sdk/models/DtoAttachAnnotationsRequest.ts @@ -0,0 +1,64 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * AutoGlue API + * API for managing K3s clusters across cloud providers + * + * The version of the OpenAPI document: 1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @interface DtoAttachAnnotationsRequest + */ +export interface DtoAttachAnnotationsRequest { + /** + * + * @type {Array} + * @memberof DtoAttachAnnotationsRequest + */ + annotation_ids?: Array; +} + +/** + * Check if a given object implements the DtoAttachAnnotationsRequest interface. + */ +export function instanceOfDtoAttachAnnotationsRequest(value: object): value is DtoAttachAnnotationsRequest { + return true; +} + +export function DtoAttachAnnotationsRequestFromJSON(json: any): DtoAttachAnnotationsRequest { + return DtoAttachAnnotationsRequestFromJSONTyped(json, false); +} + +export function DtoAttachAnnotationsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DtoAttachAnnotationsRequest { + if (json == null) { + return json; + } + return { + + 'annotation_ids': json['annotation_ids'] == null ? undefined : json['annotation_ids'], + }; +} + +export function DtoAttachAnnotationsRequestToJSON(json: any): DtoAttachAnnotationsRequest { + return DtoAttachAnnotationsRequestToJSONTyped(json, false); +} + +export function DtoAttachAnnotationsRequestToJSONTyped(value?: DtoAttachAnnotationsRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'annotation_ids': value['annotation_ids'], + }; +} + diff --git a/ui/src/sdk/models/DtoAttachLabelsRequest.ts b/ui/src/sdk/models/DtoAttachLabelsRequest.ts new file mode 100644 index 0000000..7dfcf90 --- /dev/null +++ b/ui/src/sdk/models/DtoAttachLabelsRequest.ts @@ -0,0 +1,64 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * AutoGlue API + * API for managing K3s clusters across cloud providers + * + * The version of the OpenAPI document: 1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @interface DtoAttachLabelsRequest + */ +export interface DtoAttachLabelsRequest { + /** + * + * @type {Array} + * @memberof DtoAttachLabelsRequest + */ + label_ids?: Array; +} + +/** + * Check if a given object implements the DtoAttachLabelsRequest interface. + */ +export function instanceOfDtoAttachLabelsRequest(value: object): value is DtoAttachLabelsRequest { + return true; +} + +export function DtoAttachLabelsRequestFromJSON(json: any): DtoAttachLabelsRequest { + return DtoAttachLabelsRequestFromJSONTyped(json, false); +} + +export function DtoAttachLabelsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DtoAttachLabelsRequest { + if (json == null) { + return json; + } + return { + + 'label_ids': json['label_ids'] == null ? undefined : json['label_ids'], + }; +} + +export function DtoAttachLabelsRequestToJSON(json: any): DtoAttachLabelsRequest { + return DtoAttachLabelsRequestToJSONTyped(json, false); +} + +export function DtoAttachLabelsRequestToJSONTyped(value?: DtoAttachLabelsRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'label_ids': value['label_ids'], + }; +} + diff --git a/ui/src/sdk/models/DtoAttachServersRequest.ts b/ui/src/sdk/models/DtoAttachServersRequest.ts new file mode 100644 index 0000000..2a58ab4 --- /dev/null +++ b/ui/src/sdk/models/DtoAttachServersRequest.ts @@ -0,0 +1,64 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * AutoGlue API + * API for managing K3s clusters across cloud providers + * + * The version of the OpenAPI document: 1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @interface DtoAttachServersRequest + */ +export interface DtoAttachServersRequest { + /** + * + * @type {Array} + * @memberof DtoAttachServersRequest + */ + server_ids?: Array; +} + +/** + * Check if a given object implements the DtoAttachServersRequest interface. + */ +export function instanceOfDtoAttachServersRequest(value: object): value is DtoAttachServersRequest { + return true; +} + +export function DtoAttachServersRequestFromJSON(json: any): DtoAttachServersRequest { + return DtoAttachServersRequestFromJSONTyped(json, false); +} + +export function DtoAttachServersRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DtoAttachServersRequest { + if (json == null) { + return json; + } + return { + + 'server_ids': json['server_ids'] == null ? undefined : json['server_ids'], + }; +} + +export function DtoAttachServersRequestToJSON(json: any): DtoAttachServersRequest { + return DtoAttachServersRequestToJSONTyped(json, false); +} + +export function DtoAttachServersRequestToJSONTyped(value?: DtoAttachServersRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'server_ids': value['server_ids'], + }; +} + diff --git a/ui/src/sdk/models/DtoAttachTaintsRequest.ts b/ui/src/sdk/models/DtoAttachTaintsRequest.ts new file mode 100644 index 0000000..e15ff92 --- /dev/null +++ b/ui/src/sdk/models/DtoAttachTaintsRequest.ts @@ -0,0 +1,64 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * AutoGlue API + * API for managing K3s clusters across cloud providers + * + * The version of the OpenAPI document: 1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @interface DtoAttachTaintsRequest + */ +export interface DtoAttachTaintsRequest { + /** + * + * @type {Array} + * @memberof DtoAttachTaintsRequest + */ + taint_ids?: Array; +} + +/** + * Check if a given object implements the DtoAttachTaintsRequest interface. + */ +export function instanceOfDtoAttachTaintsRequest(value: object): value is DtoAttachTaintsRequest { + return true; +} + +export function DtoAttachTaintsRequestFromJSON(json: any): DtoAttachTaintsRequest { + return DtoAttachTaintsRequestFromJSONTyped(json, false); +} + +export function DtoAttachTaintsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DtoAttachTaintsRequest { + if (json == null) { + return json; + } + return { + + 'taint_ids': json['taint_ids'] == null ? undefined : json['taint_ids'], + }; +} + +export function DtoAttachTaintsRequestToJSON(json: any): DtoAttachTaintsRequest { + return DtoAttachTaintsRequestToJSONTyped(json, false); +} + +export function DtoAttachTaintsRequestToJSONTyped(value?: DtoAttachTaintsRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'taint_ids': value['taint_ids'], + }; +} + diff --git a/ui/src/sdk/models/DtoCreateNodePoolRequest.ts b/ui/src/sdk/models/DtoCreateNodePoolRequest.ts new file mode 100644 index 0000000..3d0e780 --- /dev/null +++ b/ui/src/sdk/models/DtoCreateNodePoolRequest.ts @@ -0,0 +1,83 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * AutoGlue API + * API for managing K3s clusters across cloud providers + * + * The version of the OpenAPI document: 1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @interface DtoCreateNodePoolRequest + */ +export interface DtoCreateNodePoolRequest { + /** + * + * @type {string} + * @memberof DtoCreateNodePoolRequest + */ + name?: string; + /** + * + * @type {string} + * @memberof DtoCreateNodePoolRequest + */ + role?: DtoCreateNodePoolRequestRoleEnum; +} + + +/** + * @export + */ +export const DtoCreateNodePoolRequestRoleEnum = { + master: 'master', + worker: 'worker' +} as const; +export type DtoCreateNodePoolRequestRoleEnum = typeof DtoCreateNodePoolRequestRoleEnum[keyof typeof DtoCreateNodePoolRequestRoleEnum]; + + +/** + * Check if a given object implements the DtoCreateNodePoolRequest interface. + */ +export function instanceOfDtoCreateNodePoolRequest(value: object): value is DtoCreateNodePoolRequest { + return true; +} + +export function DtoCreateNodePoolRequestFromJSON(json: any): DtoCreateNodePoolRequest { + return DtoCreateNodePoolRequestFromJSONTyped(json, false); +} + +export function DtoCreateNodePoolRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DtoCreateNodePoolRequest { + if (json == null) { + return json; + } + return { + + 'name': json['name'] == null ? undefined : json['name'], + 'role': json['role'] == null ? undefined : json['role'], + }; +} + +export function DtoCreateNodePoolRequestToJSON(json: any): DtoCreateNodePoolRequest { + return DtoCreateNodePoolRequestToJSONTyped(json, false); +} + +export function DtoCreateNodePoolRequestToJSONTyped(value?: DtoCreateNodePoolRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'name': value['name'], + 'role': value['role'], + }; +} + diff --git a/ui/src/sdk/models/DtoCreateServerRequest.ts b/ui/src/sdk/models/DtoCreateServerRequest.ts index 2c48e20..a41a2d5 100644 --- a/ui/src/sdk/models/DtoCreateServerRequest.ts +++ b/ui/src/sdk/models/DtoCreateServerRequest.ts @@ -12,7 +12,6 @@ * Do not edit the class manually. */ -import { mapValues } from '../runtime'; /** * * @export @@ -42,7 +41,7 @@ export interface DtoCreateServerRequest { * @type {string} * @memberof DtoCreateServerRequest */ - role?: string; + role?: DtoCreateServerRequestRoleEnum; /** * * @type {string} @@ -60,9 +59,32 @@ export interface DtoCreateServerRequest { * @type {string} * @memberof DtoCreateServerRequest */ - status?: string; + status?: DtoCreateServerRequestStatusEnum; } + +/** + * @export + */ +export const DtoCreateServerRequestRoleEnum = { + master: 'master', + worker: 'worker', + bastion: 'bastion' +} as const; +export type DtoCreateServerRequestRoleEnum = typeof DtoCreateServerRequestRoleEnum[keyof typeof DtoCreateServerRequestRoleEnum]; + +/** + * @export + */ +export const DtoCreateServerRequestStatusEnum = { + pending: 'pending', + provisioning: 'provisioning', + ready: 'ready', + failed: 'failed' +} as const; +export type DtoCreateServerRequestStatusEnum = typeof DtoCreateServerRequestStatusEnum[keyof typeof DtoCreateServerRequestStatusEnum]; + + /** * Check if a given object implements the DtoCreateServerRequest interface. */ diff --git a/ui/src/sdk/models/DtoNodePoolResponse.ts b/ui/src/sdk/models/DtoNodePoolResponse.ts new file mode 100644 index 0000000..7adcd07 --- /dev/null +++ b/ui/src/sdk/models/DtoNodePoolResponse.ts @@ -0,0 +1,156 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * AutoGlue API + * API for managing K3s clusters across cloud providers + * + * The version of the OpenAPI document: 1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { DtoTaintResponse } from "./DtoTaintResponse" +import { DtoTaintResponseFromJSON, DtoTaintResponseToJSON, } from "./DtoTaintResponse" +import type { DtoLabelResponse } from "./DtoLabelResponse" +import { DtoLabelResponseFromJSON, DtoLabelResponseToJSON, } from "./DtoLabelResponse" +import type { DtoServerResponse } from "./DtoServerResponse" +import { DtoServerResponseFromJSON, DtoServerResponseToJSON, } from "./DtoServerResponse" +import type { DtoAnnotationResponse } from "./DtoAnnotationResponse" +import { DtoAnnotationResponseFromJSON, DtoAnnotationResponseToJSON, } from "./DtoAnnotationResponse" + +/** + * + * @export + * @interface DtoNodePoolResponse + */ +export interface DtoNodePoolResponse { + /** + * + * @type {Array} + * @memberof DtoNodePoolResponse + */ + annotations?: Array; + /** + * + * @type {string} + * @memberof DtoNodePoolResponse + */ + created_at?: string; + /** + * + * @type {string} + * @memberof DtoNodePoolResponse + */ + id?: string; + /** + * + * @type {Array} + * @memberof DtoNodePoolResponse + */ + labels?: Array; + /** + * + * @type {string} + * @memberof DtoNodePoolResponse + */ + name?: string; + /** + * + * @type {string} + * @memberof DtoNodePoolResponse + */ + organization_id?: string; + /** + * + * @type {string} + * @memberof DtoNodePoolResponse + */ + role?: DtoNodePoolResponseRoleEnum; + /** + * + * @type {Array} + * @memberof DtoNodePoolResponse + */ + servers?: Array; + /** + * + * @type {Array} + * @memberof DtoNodePoolResponse + */ + taints?: Array; + /** + * + * @type {string} + * @memberof DtoNodePoolResponse + */ + updated_at?: string; +} + + +/** + * @export + */ +export const DtoNodePoolResponseRoleEnum = { + master: 'master', + worker: 'worker' +} as const; +export type DtoNodePoolResponseRoleEnum = typeof DtoNodePoolResponseRoleEnum[keyof typeof DtoNodePoolResponseRoleEnum]; + + +/** + * Check if a given object implements the DtoNodePoolResponse interface. + */ +export function instanceOfDtoNodePoolResponse(value: object): value is DtoNodePoolResponse { + return true; +} + +export function DtoNodePoolResponseFromJSON(json: any): DtoNodePoolResponse { + return DtoNodePoolResponseFromJSONTyped(json, false); +} + +export function DtoNodePoolResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DtoNodePoolResponse { + if (json == null) { + return json; + } + return { + + 'annotations': json['annotations'] == null ? undefined : ((json['annotations'] as Array).map(DtoAnnotationResponseFromJSON)), + 'created_at': json['created_at'] == null ? undefined : json['created_at'], + 'id': json['id'] == null ? undefined : json['id'], + 'labels': json['labels'] == null ? undefined : ((json['labels'] as Array).map(DtoLabelResponseFromJSON)), + 'name': json['name'] == null ? undefined : json['name'], + 'organization_id': json['organization_id'] == null ? undefined : json['organization_id'], + 'role': json['role'] == null ? undefined : json['role'], + 'servers': json['servers'] == null ? undefined : ((json['servers'] as Array).map(DtoServerResponseFromJSON)), + 'taints': json['taints'] == null ? undefined : ((json['taints'] as Array).map(DtoTaintResponseFromJSON)), + 'updated_at': json['updated_at'] == null ? undefined : json['updated_at'], + }; +} + +export function DtoNodePoolResponseToJSON(json: any): DtoNodePoolResponse { + return DtoNodePoolResponseToJSONTyped(json, false); +} + +export function DtoNodePoolResponseToJSONTyped(value?: DtoNodePoolResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'annotations': value['annotations'] == null ? undefined : ((value['annotations'] as Array).map(DtoAnnotationResponseToJSON)), + 'created_at': value['created_at'], + 'id': value['id'], + 'labels': value['labels'] == null ? undefined : ((value['labels'] as Array).map(DtoLabelResponseToJSON)), + 'name': value['name'], + 'organization_id': value['organization_id'], + 'role': value['role'], + 'servers': value['servers'] == null ? undefined : ((value['servers'] as Array).map(DtoServerResponseToJSON)), + 'taints': value['taints'] == null ? undefined : ((value['taints'] as Array).map(DtoTaintResponseToJSON)), + 'updated_at': value['updated_at'], + }; +} + diff --git a/ui/src/sdk/models/DtoServerResponse.ts b/ui/src/sdk/models/DtoServerResponse.ts index 3e785e1..5741f65 100644 --- a/ui/src/sdk/models/DtoServerResponse.ts +++ b/ui/src/sdk/models/DtoServerResponse.ts @@ -12,7 +12,6 @@ * Do not edit the class manually. */ -import { mapValues } from '../runtime'; /** * * @export @@ -60,7 +59,7 @@ export interface DtoServerResponse { * @type {string} * @memberof DtoServerResponse */ - role?: string; + role?: DtoServerResponseRoleEnum; /** * * @type {string} @@ -78,7 +77,7 @@ export interface DtoServerResponse { * @type {string} * @memberof DtoServerResponse */ - status?: string; + status?: DtoServerResponseStatusEnum; /** * * @type {string} @@ -87,6 +86,29 @@ export interface DtoServerResponse { updated_at?: string; } + +/** + * @export + */ +export const DtoServerResponseRoleEnum = { + master: 'master', + worker: 'worker', + bastion: 'bastion' +} as const; +export type DtoServerResponseRoleEnum = typeof DtoServerResponseRoleEnum[keyof typeof DtoServerResponseRoleEnum]; + +/** + * @export + */ +export const DtoServerResponseStatusEnum = { + pending: 'pending', + provisioning: 'provisioning', + ready: 'ready', + failed: 'failed' +} as const; +export type DtoServerResponseStatusEnum = typeof DtoServerResponseStatusEnum[keyof typeof DtoServerResponseStatusEnum]; + + /** * Check if a given object implements the DtoServerResponse interface. */ diff --git a/ui/src/sdk/models/DtoUpdateNodePoolRequest.ts b/ui/src/sdk/models/DtoUpdateNodePoolRequest.ts new file mode 100644 index 0000000..7ec7206 --- /dev/null +++ b/ui/src/sdk/models/DtoUpdateNodePoolRequest.ts @@ -0,0 +1,83 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * AutoGlue API + * API for managing K3s clusters across cloud providers + * + * The version of the OpenAPI document: 1.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * + * @export + * @interface DtoUpdateNodePoolRequest + */ +export interface DtoUpdateNodePoolRequest { + /** + * + * @type {string} + * @memberof DtoUpdateNodePoolRequest + */ + name?: string; + /** + * + * @type {string} + * @memberof DtoUpdateNodePoolRequest + */ + role?: DtoUpdateNodePoolRequestRoleEnum; +} + + +/** + * @export + */ +export const DtoUpdateNodePoolRequestRoleEnum = { + master: 'master', + worker: 'worker' +} as const; +export type DtoUpdateNodePoolRequestRoleEnum = typeof DtoUpdateNodePoolRequestRoleEnum[keyof typeof DtoUpdateNodePoolRequestRoleEnum]; + + +/** + * Check if a given object implements the DtoUpdateNodePoolRequest interface. + */ +export function instanceOfDtoUpdateNodePoolRequest(value: object): value is DtoUpdateNodePoolRequest { + return true; +} + +export function DtoUpdateNodePoolRequestFromJSON(json: any): DtoUpdateNodePoolRequest { + return DtoUpdateNodePoolRequestFromJSONTyped(json, false); +} + +export function DtoUpdateNodePoolRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DtoUpdateNodePoolRequest { + if (json == null) { + return json; + } + return { + + 'name': json['name'] == null ? undefined : json['name'], + 'role': json['role'] == null ? undefined : json['role'], + }; +} + +export function DtoUpdateNodePoolRequestToJSON(json: any): DtoUpdateNodePoolRequest { + return DtoUpdateNodePoolRequestToJSONTyped(json, false); +} + +export function DtoUpdateNodePoolRequestToJSONTyped(value?: DtoUpdateNodePoolRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'name': value['name'], + 'role': value['role'], + }; +} + diff --git a/ui/src/sdk/models/DtoUpdateServerRequest.ts b/ui/src/sdk/models/DtoUpdateServerRequest.ts index 3e0327a..9060388 100644 --- a/ui/src/sdk/models/DtoUpdateServerRequest.ts +++ b/ui/src/sdk/models/DtoUpdateServerRequest.ts @@ -12,7 +12,6 @@ * Do not edit the class manually. */ -import { mapValues } from '../runtime'; /** * * @export @@ -42,7 +41,7 @@ export interface DtoUpdateServerRequest { * @type {string} * @memberof DtoUpdateServerRequest */ - role?: string; + role?: DtoUpdateServerRequestRoleEnum; /** * * @type {string} @@ -60,9 +59,32 @@ export interface DtoUpdateServerRequest { * @type {string} * @memberof DtoUpdateServerRequest */ - status?: string; + status?: DtoUpdateServerRequestStatusEnum; } + +/** + * @export + */ +export const DtoUpdateServerRequestRoleEnum = { + master: 'master', + worker: 'worker', + bastion: 'bastion' +} as const; +export type DtoUpdateServerRequestRoleEnum = typeof DtoUpdateServerRequestRoleEnum[keyof typeof DtoUpdateServerRequestRoleEnum]; + +/** + * @export + */ +export const DtoUpdateServerRequestStatusEnum = { + pending: 'pending', + provisioning: 'provisioning', + ready: 'ready', + failed: 'failed' +} as const; +export type DtoUpdateServerRequestStatusEnum = typeof DtoUpdateServerRequestStatusEnum[keyof typeof DtoUpdateServerRequestStatusEnum]; + + /** * Check if a given object implements the DtoUpdateServerRequest interface. */ diff --git a/ui/src/sdk/models/index.ts b/ui/src/sdk/models/index.ts index 873b3c0..5203284 100644 --- a/ui/src/sdk/models/index.ts +++ b/ui/src/sdk/models/index.ts @@ -1,9 +1,14 @@ /* tslint:disable */ /* eslint-disable */ export * from './DtoAnnotationResponse'; +export * from './DtoAttachAnnotationsRequest'; +export * from './DtoAttachLabelsRequest'; +export * from './DtoAttachServersRequest'; +export * from './DtoAttachTaintsRequest'; export * from './DtoAuthStartResponse'; export * from './DtoCreateAnnotationRequest'; export * from './DtoCreateLabelRequest'; +export * from './DtoCreateNodePoolRequest'; export * from './DtoCreateSSHRequest'; export * from './DtoCreateServerRequest'; export * from './DtoCreateTaintRequest'; @@ -13,6 +18,7 @@ export * from './DtoJob'; export * from './DtoJobStatus'; export * from './DtoLabelResponse'; export * from './DtoLogoutRequest'; +export * from './DtoNodePoolResponse'; export * from './DtoPageJob'; export * from './DtoQueueInfo'; export * from './DtoRefreshRequest'; @@ -23,6 +29,7 @@ export * from './DtoTaintResponse'; export * from './DtoTokenPair'; export * from './DtoUpdateAnnotationRequest'; export * from './DtoUpdateLabelRequest'; +export * from './DtoUpdateNodePoolRequest'; export * from './DtoUpdateServerRequest'; export * from './DtoUpdateTaintRequest'; export * from './HandlersCreateUserKeyRequest'; diff --git a/ui/src/sdk/runtime.ts b/ui/src/sdk/runtime.ts index d2e5a39..a81d7ec 100644 --- a/ui/src/sdk/runtime.ts +++ b/ui/src/sdk/runtime.ts @@ -13,7 +13,7 @@ */ -export const BASE_PATH = "http://localhost:8080/api/v1".replace(/\/+$/, ""); +export const BASE_PATH = "/api/v1".replace(/\/+$/, ""); export interface ConfigurationParameters { basePath?: string; // override base path diff --git a/ui/src/sdkClient.ts b/ui/src/sdkClient.ts index cc27548..081d565 100644 --- a/ui/src/sdkClient.ts +++ b/ui/src/sdkClient.ts @@ -8,6 +8,7 @@ import { LabelsApi, MeApi, MeAPIKeysApi, + NodePoolsApi, OrgsApi, ServersApi, SshApi, @@ -99,6 +100,11 @@ export function makeLabelsApi() { export function makeAnnotationsApi() { return makeApiClient(AnnotationsApi) } + export function makeArcherAdminApi() { return makeApiClient(ArcherAdminApi) } + +export function makeNodePoolApi() { + return makeApiClient(NodePoolsApi) +}