From b860b5833cc8504f6ec0ecc9bd736a15b724a0b0 Mon Sep 17 00:00:00 2001 From: Philip Zingmark Date: Tue, 22 Apr 2025 01:23:24 +0200 Subject: [PATCH 1/9] add support for exposing multiple internal ports --- Dockerfile | 2 +- cached.Dockerfile | 2 +- models/model/deployment_convert.go | 36 +++++ models/model/deployment_params.go | 40 +++--- models/model/deployment_related.go | 11 +- scripts/check-lint.sh | 131 +++++++++++------- .../v2/deployments/resources/k8s_generator.go | 39 +++++- 7 files changed, 184 insertions(+), 77 deletions(-) diff --git a/Dockerfile b/Dockerfile index 36f9abd3..f28afc35 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,7 +17,7 @@ RUN go mod download # Copy the rest of the project to ensure code changes doesnt trigger re-download of all deps COPY . . -RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$GOARCH go build -a -installsuffix cgo -o main . +RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -a -installsuffix cgo -o main . ############################ diff --git a/cached.Dockerfile b/cached.Dockerfile index 9c9f30d1..5be85313 100644 --- a/cached.Dockerfile +++ b/cached.Dockerfile @@ -23,7 +23,7 @@ COPY . . ENV GOCACHE=/root/.cache/go-build RUN --mount=type=cache,target=/go/pkg/mod/ \ --mount=type=cache,target="/root/.cache/go-build" \ - CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$GOARCH go build -a -installsuffix cgo -o main . + CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -a -installsuffix cgo -o main . ############################ diff --git a/models/model/deployment_convert.go b/models/model/deployment_convert.go index b7290195..2df1ab86 100644 --- a/models/model/deployment_convert.go +++ b/models/model/deployment_convert.go @@ -3,6 +3,7 @@ package model import ( "fmt" "strconv" + "strings" "github.com/kthcloud/go-deploy/dto/v2/body" "github.com/kthcloud/go-deploy/pkg/log" @@ -25,6 +26,16 @@ func (deployment *Deployment) ToDTO(smURL *string, externalPort *int, teams []st Value: fmt.Sprintf("%d", app.InternalPort), }) + portsStr := make([]string, len(app.InternallPorts)) + for i, port := range app.InternallPorts { + portsStr[i] = strconv.Itoa(port) + } + + envs = append(envs, body.Env{ + Name: "INTERNAL_PORTS", + Value: strings.Join(portsStr, ","), + }) + for i, env := range app.Envs { envs[i] = body.Env{ Name: env.Name, @@ -171,6 +182,18 @@ func (p *DeploymentCreateParams) FromDTO(dto *body.DeploymentCreate, fallbackZon p.InternalPort = port continue } + if env.Name == "INTERNAL_PORTS" { + portsStr := strings.Split(env.Value, ",") + var internalPorts []int + for _, prt := range portsStr { + prt = strings.TrimSpace(prt) + if port, err := strconv.Atoi(prt); err == nil { + internalPorts = append(internalPorts, port) + } + } + p.InternalPorts = internalPorts + continue + } p.Envs = append(p.Envs, DeploymentEnv{ Name: env.Name, @@ -240,6 +263,19 @@ func (p *DeploymentUpdateParams) FromDTO(dto *body.DeploymentUpdate, deploymentT continue } + if env.Name == "INTERNAL_PORTS" { + portsStr := strings.Split(env.Value, ",") + var internalPorts []int + for _, prt := range portsStr { + prt = strings.TrimSpace(prt) + if port, err := strconv.Atoi(prt); err == nil { + internalPorts = append(internalPorts, port) + } + } + p.InternalPorts = &internalPorts + continue + } + envs = append(envs, DeploymentEnv{ Name: env.Name, Value: env.Value, diff --git a/models/model/deployment_params.go b/models/model/deployment_params.go index d94dc569..7edaa145 100644 --- a/models/model/deployment_params.go +++ b/models/model/deployment_params.go @@ -8,15 +8,16 @@ type DeploymentCreateParams struct { RAM float64 Replicas int - Image string - InternalPort int - Envs []DeploymentEnv - Volumes []DeploymentVolume - InitCommands []string - Args []string - PingPath string - CustomDomain *string - Visibility string + Image string + InternalPort int + InternalPorts []int + Envs []DeploymentEnv + Volumes []DeploymentVolume + InitCommands []string + Args []string + PingPath string + CustomDomain *string + Visibility string NeverStale bool @@ -30,16 +31,17 @@ type DeploymentUpdateParams struct { CpuCores *float64 RAM *float64 - Envs *[]DeploymentEnv - InternalPort *int - Volumes *[]DeploymentVolume - InitCommands *[]string - Args *[]string - CustomDomain *string - Image *string - PingPath *string - Replicas *int - Visibility *string + Envs *[]DeploymentEnv + InternalPort *int + InternalPorts *[]int + Volumes *[]DeploymentVolume + InitCommands *[]string + Args *[]string + CustomDomain *string + Image *string + PingPath *string + Replicas *int + Visibility *string NeverStale *bool } diff --git a/models/model/deployment_related.go b/models/model/deployment_related.go index 4d20749c..5f4d5845 100644 --- a/models/model/deployment_related.go +++ b/models/model/deployment_related.go @@ -36,11 +36,12 @@ type App struct { RAM float64 `bson:"ram,omitempty"` Replicas int `bson:"replicas"` - Image string `bson:"image"` - InternalPort int `bson:"internalPort"` - Envs []DeploymentEnv `bson:"envs"` - Volumes []DeploymentVolume `bson:"volumes"` - Visibility string `bson:"visibility"` + Image string `bson:"image"` + InternalPort int `bson:"internalPort"` + InternallPorts []int `bson:"internallPorts"` + Envs []DeploymentEnv `bson:"envs"` + Volumes []DeploymentVolume `bson:"volumes"` + Visibility string `bson:"visibility"` // Deprecated: use Visibility instead. Private bool `bson:"private"` diff --git a/scripts/check-lint.sh b/scripts/check-lint.sh index 1caa646f..4f6fd408 100755 --- a/scripts/check-lint.sh +++ b/scripts/check-lint.sh @@ -1,104 +1,133 @@ -#!/bin/sh +#!/usr/bin/env bash + +RED="\e[31m" +YELLOW="\e[33m" +GREEN="\e[32m" +BLUE="\e[34m" +GRAY="\e[90m" +RESET="\e[0m" + +ERROR_LOG="${RED}[ERROR]${RESET}" +WARN_LOG="${YELLOW}[WARN]${RESET}" +INFO_LOG="${GREEN}[INFO]${RESET}" +PRINT_INDENT_LOG="${GRAY}||===>${RESET}" + +log_err() { + echo -e "$ERROR_LOG $1" >&2 +} + +log_warn() { + echo -e "$WARN_LOG $1" >&2 +} + +log_info() { + echo -e "$INFO_LOG $1" >&2 +} -RED='\033[0;31m' -GREEN='\033[0;32m' -YELLOW='\033[0;33m' -NC='\033[0m' # No Color +log_print() { + echo -e "$PRINT_INDENT_LOG $1" >&2 +} -function get_git_root() { - git rev-parse --show-toplevel 2>/dev/null || { echo -e "${RED}This is not a git repository. Please run this script from within the Git repository.${NC}"; exit 1; } +get_git_root() { + git rev-parse --show-toplevel 2>/dev/null || { echo -e "${RED}This is not a git repository. Please run this script from within the Git repository.${RESET}"; exit 1; } } -function check_gofmt() { - command -v gofmt >/dev/null 2>&1 || { echo -e "${RED}gofmt is not installed. Please install it to continue.${NC}"; exit 1; } +check_gofmt() { + command -v gofmt >/dev/null 2>&1 || { echo -e "${RED}gofmt is not installed. Please install it to continue.${RESET}"; exit 1; } } -function check_go_vet() { - command -v go >/dev/null 2>&1 || { echo -e "${RED}go is not installed. Please install Go to continue.${NC}"; exit 1; } +check_go_vet() { + command -v go >/dev/null 2>&1 || { echo -e "${RED}go is not installed. Please install Go to continue.${RESET}"; exit 1; } } -function check_go_cyclo() { - command -v gocyclo >/dev/null 2>&1 || { echo -e "${YELLOW}go-cyclo is not installed. Installing...${NC}"; go install github.com/fzipp/gocyclo/cmd/gocyclo@latest; } +check_go_cyclo() { + command -v gocyclo >/dev/null 2>&1 || { echo -e "${YELLOW}go-cyclo is not installed. Installing...${RESET}"; go install github.com/fzipp/gocyclo/cmd/gocyclo@latest; } } -function check_ineffassign() { - command -v ineffassign >/dev/null 2>&1 || { echo -e "${YELLOW}ineffassign is not installed. Installing...${NC}"; go install github.com/gordonklaus/ineffassign@latest; } +check_ineffassign() { + command -v ineffassign >/dev/null 2>&1 || { echo -e "${YELLOW}ineffassign is not installed. Installing...${RESET}"; go install github.com/gordonklaus/ineffassign@latest; } } -function check_staticcheck() { - command -v staticcheck >/dev/null 2>&1 || { echo -e "${YELLOW}go-staticcheck is not installed. Installing...${NC}"; go install honnef.co/go/tools/cmd/staticcheck@latest; } +check_staticcheck() { + command -v staticcheck >/dev/null 2>&1 || { echo -e "${YELLOW}go-staticcheck is not installed. Installing...${RESET}"; go install honnef.co/go/tools/cmd/staticcheck@latest; } } -function run_gofmt() { - echo -e "${YELLOW}Running gofmt check...${NC}" +run_gofmt() { + log_info "${YELLOW}Running gofmt check...${RESET}" # Check for formatting issues gofmt_output=$(gofmt -l .) if [ -n "$gofmt_output" ]; then - echo -e "${RED}gofmt found the following issues:${NC}" - echo "$gofmt_output" + log_err "${RED}gofmt found the following issues:${RESET}" + echo "$gofmt_output" | while IFS= read -r line; do + log_print "\t$line" + done gofmt_error=1 else - echo -e "${GREEN}passed gofmt.${NC}" + log_print "${GREEN}passed gofmt.${RESET}" fi } -function run_go_vet() { - echo -e "${YELLOW}Running go vet check...${NC}" +run_go_vet() { + log_info "${YELLOW}Running go vet check...${RESET}" # Run go vet to analyze code for potential issues go_vet_output=$(go vet ./... 2>&1) if [ -n "$go_vet_output" ]; then - echo -e "${RED}go vet found the following issues:${NC}" - echo "$go_vet_output" + log_err "${RED}go vet found the following issues:${RESET}" + echo "$go_vet_output" | while IFS= read -r line; do + log_print "\t$line" + done go_vet_error=1 else - echo -e "${GREEN}passed go vet.${NC}" + log_print "${GREEN}passed go vet.${RESET}" fi } -function run_go_cyclo() { - echo -e "${YELLOW}Running go-cyclo check...${NC}" +run_go_cyclo() { + log_info "${YELLOW}Running go-cyclo check...${RESET}" # Check for cyclomatic complexity go_cyclo_output=$(find . -path ./pkg/imp -prune -o -type f -name "*.go" -exec gocyclo -over 15 {} +) if [ -n "$go_cyclo_output" ]; then - echo -e "${RED}gocyclo found the following issues:${NC}" - echo "$go_cyclo_output" + log_err "${RED}gocyclo found the following issues:${RESET}" + echo "$go_cyclo_output" | while IFS= read -r line; do + log_print "\t$line" + done go_cyclo_error=1 else - echo -e "${GREEN}passed gocyclo -over 15.${NC}" + log_print "${GREEN}passed gocyclo -over 15.${RESET}" fi } -function run_ineffassign() { - echo -e "${YELLOW}Running ineffassign check...${NC}" +run_ineffassign() { + log_info "${YELLOW}Running ineffassign check...${RESET}" # Check for unused variable assignments ineffassign_output=$(ineffassign .) if [ -n "$ineffassign_output" ]; then - echo -e "${RED}ineffassign found the following issues:${NC}" - echo "$ineffassign_output" + log_err "${RED}ineffassign found the following issues:${RESET}" + echo "$ineffassign_output" | while IFS= read -r line; do + log_print "\t$line" + done ineffassign_error=1 else - echo -e "${GREEN}passed ineffassign.${NC}" + log_print "${GREEN}passed ineffassign.${RESET}" fi } -function run_staticcheck() { - echo -e "${YELLOW}Running go-staticcheck check...${NC}" +run_staticcheck() { + log_info "${YELLOW}Running go-staticcheck check...${RESET}" # Run staticcheck to analyze code for potential issues staticcheck_output=$(staticcheck ./...) if [ -n "$staticcheck_output" ]; then - echo -e "${RED}go-staticcheck found the following issues:${NC}" - echo "$staticcheck_output" + log_err "${RED}go-staticcheck found the following issues:${RESET}" + echo "$staticcheck_output" | while IFS= read -r line; do + log_print "\t$line" + done staticcheck_error=1 else - echo -e "${GREEN}passed go-staticcheck.${NC}" + log_print "${GREEN}passed go-staticcheck.${RESET}" fi } -# Get the git root, to make sure the scripts are run in the correct location -git_root=$(get_git_root) - -# Change to the Git root directory -cd "$git_root" || { echo -e "${RED}Failed to change to the Git root directory.${NC}"; exit 1; } +pushd "$(dirname "${BASH_SOURCE[0]}")/.." > /dev/null || { log_err "Failed to change to script directory."; exit 1; } # Ensure all tools are installed check_gofmt @@ -107,6 +136,8 @@ check_go_cyclo check_ineffassign check_staticcheck +go mod download + # Initialize error flags gofmt_error=0 go_vet_error=0 @@ -123,9 +154,11 @@ run_staticcheck # Print a summary and exit with failure if there were any errors if [ $gofmt_error -eq 1 ] || [ $go_vet_error -eq 1 ] || [ $go_cyclo_error -eq 1 ] || [ $ineffassign_error -eq 1 ] || [ $staticcheck_error -eq 1 ]; then - echo -e "${RED}SUMMARY: Please resolve the above issues.${NC}" + echo -e "${RED}SUMMARY: Please resolve the above issues.${RESET}" + popd > /dev/null exit 1 else - echo -e "${GREEN}All checks passed successfully.${NC}" + echo -e "${GREEN}All checks passed successfully.${RESET}" + popd > /dev/null exit 0 fi diff --git a/service/v2/deployments/resources/k8s_generator.go b/service/v2/deployments/resources/k8s_generator.go index 6505d61d..5d46ddd1 100644 --- a/service/v2/deployments/resources/k8s_generator.go +++ b/service/v2/deployments/resources/k8s_generator.go @@ -8,6 +8,7 @@ import ( "path" "regexp" "slices" + "strconv" "strings" "time" @@ -67,7 +68,7 @@ func (kg *K8sGenerator) Deployments() []models.DeploymentPublic { k8sEnvs := make([]models.EnvVar, len(mainApp.Envs)) for i, env := range mainApp.Envs { - if env.Name == "PORT" { + if env.Name == "PORT" || env.Name == "INTERNAL_PORTS" { continue } @@ -82,6 +83,16 @@ func (kg *K8sGenerator) Deployments() []models.DeploymentPublic { Value: fmt.Sprintf("%d", mainApp.InternalPort), }) + portsStr := make([]string, len(mainApp.InternallPorts)) + for i, port := range mainApp.InternallPorts { + portsStr[i] = strconv.Itoa(port) + } + + k8sEnvs = append(k8sEnvs, models.EnvVar{ + Name: "INTERNAL_PORTS", + Value: strings.Join(portsStr, ","), + }) + k8sVolumes := make([]models.Volume, len(mainApp.Volumes)) for i, volume := range mainApp.Volumes { pvcName := fmt.Sprintf("%s-%s", kg.deployment.Name, makeValidK8sName(volume.Name)) @@ -257,10 +268,34 @@ func (kg *K8sGenerator) Services() []models.ServicePublic { res := make([]models.ServicePublic, 0) + // Add the base http port + ports := []models.Port{ + { + Name: "http", + Protocol: "tcp", + Port: mainApp.InternalPort, + TargetPort: mainApp.InternalPort, + }, + } + + // add all internalPorts to expose to the with the service + for _, p := range mainApp.InternallPorts { + if p == mainApp.InternalPort { + continue + } + + ports = append(ports, models.Port{ + Name: fmt.Sprintf("port-%d", p), + Protocol: "tcp", + Port: p, + TargetPort: p, + }) + } + se := models.ServicePublic{ Name: kg.deployment.Name, Namespace: kg.namespace, - Ports: []models.Port{{Name: "http", Protocol: "tcp", Port: mainApp.InternalPort, TargetPort: mainApp.InternalPort}}, + Ports: ports, Selector: map[string]string{ keys.LabelDeployName: kg.deployment.Name, }, From f2eaf83735c857c10412cbcd7e65b4a09ae4e170 Mon Sep 17 00:00:00 2001 From: Philip Zingmark Date: Tue, 22 Apr 2025 02:21:01 +0200 Subject: [PATCH 2/9] fix persist in db + spellfix --- dto/v2/body/deployment.go | 1 + models/model/deployment_convert.go | 5 +++-- models/model/deployment_related.go | 12 ++++++------ pkg/db/resources/deployment_repo/db.go | 11 ++++++----- service/v2/deployments/resources/k8s_generator.go | 8 ++++---- 5 files changed, 20 insertions(+), 17 deletions(-) diff --git a/dto/v2/body/deployment.go b/dto/v2/body/deployment.go index b770676b..2b3367ac 100644 --- a/dto/v2/body/deployment.go +++ b/dto/v2/body/deployment.go @@ -25,6 +25,7 @@ type DeploymentRead struct { InitCommands []string `json:"initCommands"` Args []string `json:"args"` InternalPort int `json:"internalPort"` + InternalPorts []int `json:"internalPorts"` Image *string `json:"image,omitempty"` HealthCheckPath *string `json:"healthCheckPath,omitempty"` CustomDomain *CustomDomainRead `json:"customDomain,omitempty"` diff --git a/models/model/deployment_convert.go b/models/model/deployment_convert.go index 2df1ab86..4b128975 100644 --- a/models/model/deployment_convert.go +++ b/models/model/deployment_convert.go @@ -26,8 +26,8 @@ func (deployment *Deployment) ToDTO(smURL *string, externalPort *int, teams []st Value: fmt.Sprintf("%d", app.InternalPort), }) - portsStr := make([]string, len(app.InternallPorts)) - for i, port := range app.InternallPorts { + portsStr := make([]string, len(app.InternalPorts)) + for i, port := range app.InternalPorts { portsStr[i] = strconv.Itoa(port) } @@ -136,6 +136,7 @@ func (deployment *Deployment) ToDTO(smURL *string, externalPort *int, teams []st InitCommands: app.InitCommands, Args: app.Args, InternalPort: app.InternalPort, + InternalPorts: app.InternalPorts, Image: image, HealthCheckPath: healthCheckPath, CustomDomain: customDomain, diff --git a/models/model/deployment_related.go b/models/model/deployment_related.go index 5f4d5845..f71ef34e 100644 --- a/models/model/deployment_related.go +++ b/models/model/deployment_related.go @@ -36,12 +36,12 @@ type App struct { RAM float64 `bson:"ram,omitempty"` Replicas int `bson:"replicas"` - Image string `bson:"image"` - InternalPort int `bson:"internalPort"` - InternallPorts []int `bson:"internallPorts"` - Envs []DeploymentEnv `bson:"envs"` - Volumes []DeploymentVolume `bson:"volumes"` - Visibility string `bson:"visibility"` + Image string `bson:"image"` + InternalPort int `bson:"internalPort"` + InternalPorts []int `bson:"internallPorts"` + Envs []DeploymentEnv `bson:"envs"` + Volumes []DeploymentVolume `bson:"volumes"` + Visibility string `bson:"visibility"` // Deprecated: use Visibility instead. Private bool `bson:"private"` diff --git a/pkg/db/resources/deployment_repo/db.go b/pkg/db/resources/deployment_repo/db.go index a34b50bc..7059faa8 100644 --- a/pkg/db/resources/deployment_repo/db.go +++ b/pkg/db/resources/deployment_repo/db.go @@ -40,11 +40,12 @@ func (client *Client) Create(id, ownerID string, params *model.DeploymentCreateP RAM: params.RAM, Replicas: params.Replicas, - Image: params.Image, - InternalPort: params.InternalPort, - Envs: params.Envs, - Volumes: params.Volumes, - Visibility: params.Visibility, + Image: params.Image, + InternalPort: params.InternalPort, + InternalPorts: params.InternalPorts, + Envs: params.Envs, + Volumes: params.Volumes, + Visibility: params.Visibility, Args: params.Args, InitCommands: params.InitCommands, diff --git a/service/v2/deployments/resources/k8s_generator.go b/service/v2/deployments/resources/k8s_generator.go index 5d46ddd1..8e85c3bc 100644 --- a/service/v2/deployments/resources/k8s_generator.go +++ b/service/v2/deployments/resources/k8s_generator.go @@ -83,8 +83,8 @@ func (kg *K8sGenerator) Deployments() []models.DeploymentPublic { Value: fmt.Sprintf("%d", mainApp.InternalPort), }) - portsStr := make([]string, len(mainApp.InternallPorts)) - for i, port := range mainApp.InternallPorts { + portsStr := make([]string, len(mainApp.InternalPorts)) + for i, port := range mainApp.InternalPorts { portsStr[i] = strconv.Itoa(port) } @@ -279,8 +279,8 @@ func (kg *K8sGenerator) Services() []models.ServicePublic { } // add all internalPorts to expose to the with the service - for _, p := range mainApp.InternallPorts { - if p == mainApp.InternalPort { + for _, p := range mainApp.InternalPorts { + if p == mainApp.InternalPort || p == 0 { continue } From 6dd7e44a9efd99b2709b7372d5f3aecf6ce4792d Mon Sep 17 00:00:00 2001 From: Philip Zingmark Date: Tue, 22 Apr 2025 02:51:17 +0200 Subject: [PATCH 3/9] fix persist on update --- docs/api/v2/V2_docs.go | 2 +- docs/api/v2/V2_swagger.json | 2 +- docs/api/v2/V2_swagger.yaml | 5 +++++ export/types/v2/body/index.ts | 1 + pkg/db/resources/deployment_repo/db.go | 1 + 5 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/api/v2/V2_docs.go b/docs/api/v2/V2_docs.go index 6e86409f..b06eb519 100644 --- a/docs/api/v2/V2_docs.go +++ b/docs/api/v2/V2_docs.go @@ -6,7 +6,7 @@ import "github.com/swaggo/swag/v2" const docTemplateV2 = `{ "schemes": {{ marshal .Schemes }}, - "components": {"schemas":{"body.ApiKey":{"properties":{"createdAt":{"type":"string"},"expiresAt":{"type":"string"},"name":{"type":"string"}},"type":"object"},"body.ApiKeyCreate":{"properties":{"expiresAt":{"type":"string"},"name":{"type":"string"}},"required":["expiresAt","name"],"type":"object"},"body.ApiKeyCreated":{"properties":{"createdAt":{"type":"string"},"expiresAt":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"}},"type":"object"},"body.BindingError":{"properties":{"validationErrors":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object"}},"type":"object"},"body.CiConfig":{"properties":{"config":{"type":"string"}},"type":"object"},"body.ClusterCapacities":{"properties":{"cluster":{"type":"string"},"cpuCore":{"$ref":"#/components/schemas/body.CpuCoreCapacities"},"gpu":{"$ref":"#/components/schemas/body.GpuCapacities"},"ram":{"$ref":"#/components/schemas/body.RamCapacities"}},"type":"object"},"body.ClusterStats":{"properties":{"cluster":{"type":"string"},"podCount":{"type":"integer"}},"type":"object"},"body.CpuCoreCapacities":{"description":"Total","properties":{"total":{"type":"integer"}},"type":"object"},"body.CpuStatus":{"properties":{"load":{"$ref":"#/components/schemas/body.CpuStatusLoad"},"temp":{"$ref":"#/components/schemas/body.CpuStatusTemp"}},"type":"object"},"body.CpuStatusLoad":{"properties":{"cores":{"items":{"type":"integer"},"type":"array","uniqueItems":false},"main":{"type":"number"},"max":{"type":"number"}},"type":"object"},"body.CpuStatusTemp":{"properties":{"cores":{"items":{"type":"integer"},"type":"array","uniqueItems":false},"main":{"type":"number"},"max":{"type":"number"}},"type":"object"},"body.CustomDomainRead":{"properties":{"domain":{"type":"string"},"secret":{"type":"string"},"status":{"type":"string"},"url":{"type":"string"}},"type":"object"},"body.DeploymentCommand":{"properties":{"command":{"enum":["restart"],"type":"string"}},"required":["command"],"type":"object"},"body.DeploymentCreate":{"properties":{"args":{"items":{"type":"string"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"cpuCores":{"type":"number"},"customDomain":{"description":"CustomDomain is the domain that the deployment will be available on.\nThe max length is set to 243 to allow for a subdomain when confirming the domain.","type":"string"},"envs":{"items":{"$ref":"#/components/schemas/body.Env"},"maxItems":1000,"minItems":0,"type":"array","uniqueItems":false},"healthCheckPath":{"maxLength":1000,"minLength":0,"type":"string"},"image":{"maxLength":1000,"minLength":1,"type":"string"},"initCommands":{"items":{"type":"string"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"name":{"maxLength":30,"minLength":3,"type":"string"},"neverStale":{"description":"Boolean to make deployment never get disabled, despite being stale","type":"boolean"},"private":{"description":"Deprecated: Use Visibility instead.","type":"boolean"},"ram":{"type":"number"},"replicas":{"maximum":100,"minimum":0,"type":"integer"},"visibility":{"enum":["public","private","auth"],"type":"string"},"volumes":{"items":{"$ref":"#/components/schemas/body.Volume"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"zone":{"description":"Zone is the zone that the deployment will be created in.\nIf the zone is not set, the deployment will be created in the default zone.","type":"string"}},"required":["name"],"type":"object"},"body.DeploymentCreated":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.DeploymentRead":{"properties":{"accessedAt":{"type":"string"},"args":{"items":{"type":"string"},"type":"array","uniqueItems":false},"createdAt":{"type":"string"},"customDomain":{"$ref":"#/components/schemas/body.CustomDomainRead"},"envs":{"items":{"$ref":"#/components/schemas/body.Env"},"type":"array","uniqueItems":false},"error":{"type":"string"},"healthCheckPath":{"type":"string"},"id":{"type":"string"},"image":{"type":"string"},"initCommands":{"items":{"type":"string"},"type":"array","uniqueItems":false},"integrations":{"description":"Integrations are currently not used, but could be used if we wanted to add a list of integrations to the deployment\n\nFor example GitHub","items":{"type":"string"},"type":"array","uniqueItems":false},"internalPort":{"type":"integer"},"name":{"type":"string"},"neverStale":{"type":"boolean"},"ownerId":{"type":"string"},"pingResult":{"type":"integer"},"private":{"description":"Deprecated: Use Visibility instead.","type":"boolean"},"repairedAt":{"type":"string"},"replicaStatus":{"$ref":"#/components/schemas/body.ReplicaStatus"},"restartedAt":{"type":"string"},"specs":{"$ref":"#/components/schemas/body.DeploymentSpecs"},"status":{"type":"string"},"storageUrl":{"type":"string"},"teams":{"items":{"type":"string"},"type":"array","uniqueItems":false},"type":{"type":"string"},"updatedAt":{"type":"string"},"url":{"type":"string"},"visibility":{"type":"string"},"volumes":{"items":{"$ref":"#/components/schemas/body.Volume"},"type":"array","uniqueItems":false},"zone":{"type":"string"}},"type":"object"},"body.DeploymentSpecs":{"properties":{"cpuCores":{"type":"number"},"ram":{"type":"number"},"replicas":{"type":"integer"}},"type":"object"},"body.DeploymentUpdate":{"properties":{"args":{"items":{"type":"string"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"cpuCores":{"type":"number"},"customDomain":{"description":"CustomDomain is the domain that the deployment will be available on.\nThe max length is set to 243 to allow for a subdomain when confirming the domain.","type":"string"},"envs":{"items":{"$ref":"#/components/schemas/body.Env"},"maxItems":1000,"minItems":0,"type":"array","uniqueItems":false},"healthCheckPath":{"maxLength":1000,"minLength":0,"type":"string"},"image":{"maxLength":1000,"minLength":1,"type":"string"},"initCommands":{"items":{"type":"string"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"name":{"maxLength":30,"minLength":3,"type":"string"},"neverStale":{"type":"boolean"},"private":{"description":"Deprecated: Use Visibility instead.","type":"boolean"},"ram":{"type":"number"},"replicas":{"maximum":100,"minimum":0,"type":"integer"},"visibility":{"enum":["public","private","auth"],"type":"string"},"volumes":{"items":{"$ref":"#/components/schemas/body.Volume"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false}},"required":["name"],"type":"object"},"body.DeploymentUpdated":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.DiscoverRead":{"properties":{"roles":{"items":{"$ref":"#/components/schemas/body.Role"},"type":"array","uniqueItems":false},"version":{"type":"string"}},"type":"object"},"body.Env":{"properties":{"name":{"maxLength":100,"minLength":1,"type":"string"},"value":{"maxLength":10000,"minLength":1,"type":"string"}},"required":["name","value"],"type":"object"},"body.GpuCapacities":{"properties":{"total":{"type":"integer"}},"type":"object"},"body.GpuGroupRead":{"properties":{"available":{"type":"integer"},"displayName":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"total":{"type":"integer"},"vendor":{"type":"string"},"zone":{"type":"string"}},"type":"object"},"body.GpuLeaseCreate":{"properties":{"gpuGroupId":{"description":"GpuGroupID is used to specify the GPU to lease.\nAs such, the lease does not specify which specific GPU to lease, but rather the type of GPU to lease.","type":"string"},"leaseForever":{"description":"LeaseForever is used to specify whether the lease should be created forever.","type":"boolean"}},"required":["gpuGroupId"],"type":"object"},"body.GpuLeaseCreated":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.GpuLeaseDeleted":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.GpuLeaseRead":{"properties":{"activatedAt":{"description":"ActivatedAt specifies the time when the lease was activated. This is the time the user first attached the GPU\nor 1 day after the lease was created if the user did not attach the GPU.","type":"string"},"active":{"type":"boolean"},"assignedAt":{"description":"AssignedAt specifies the time when the lease was assigned to the user.","type":"string"},"createdAt":{"type":"string"},"expiredAt":{"type":"string"},"expiresAt":{"description":"ExpiresAt specifies the time when the lease will expire.\nThis is only present if the lease is active.","type":"string"},"gpuGroupId":{"type":"string"},"id":{"type":"string"},"leaseDuration":{"type":"number"},"queuePosition":{"type":"integer"},"userId":{"type":"string"},"vmId":{"description":"VmID is set when the lease is attached to a VM.","type":"string"}},"type":"object"},"body.GpuLeaseUpdate":{"properties":{"vmId":{"description":"VmID is used to specify the VM to attach the lease to.\n\n- If specified, the lease will be attached to the VM.\n\n- If the lease is already attached to a VM, it will be detached from the current VM and attached to the new VM.\n\n- If the lease is not active, specifying a VM will activate the lease.\n\n- If the lease is not assigned, an error will be returned.","type":"string"}},"type":"object"},"body.GpuLeaseUpdated":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.GpuStatus":{"properties":{"temp":{"items":{"$ref":"#/components/schemas/body.GpuStatusTemp"},"type":"array","uniqueItems":false}},"type":"object"},"body.GpuStatusTemp":{"properties":{"main":{"type":"number"}},"type":"object"},"body.HarborWebhook":{"properties":{"event_data":{"properties":{"repository":{"properties":{"date_created":{"type":"integer"},"name":{"type":"string"},"namespace":{"type":"string"},"repo_full_name":{"type":"string"},"repo_type":{"type":"string"}},"type":"object"},"resources":{"items":{"properties":{"digest":{"type":"string"},"resource_url":{"type":"string"},"tag":{"type":"string"}},"type":"object"},"type":"array","uniqueItems":false}},"type":"object"},"occur_at":{"type":"integer"},"operator":{"type":"string"},"type":{"type":"string"}},"type":"object"},"body.HostCapacities":{"properties":{"cpuCore":{"$ref":"#/components/schemas/body.CpuCoreCapacities"},"displayName":{"type":"string"},"gpu":{"$ref":"#/components/schemas/body.GpuCapacities"},"name":{"type":"string"},"ram":{"$ref":"#/components/schemas/body.RamCapacities"},"zone":{"description":"Zone is the name of the zone where the host is located.","type":"string"}},"type":"object"},"body.HostRead":{"properties":{"displayName":{"type":"string"},"name":{"type":"string"},"zone":{"description":"Zone is the name of the zone where the host is located.","type":"string"}},"type":"object"},"body.HostStatus":{"properties":{"cpu":{"$ref":"#/components/schemas/body.CpuStatus"},"displayName":{"type":"string"},"gpu":{"$ref":"#/components/schemas/body.GpuStatus"},"name":{"type":"string"},"ram":{"$ref":"#/components/schemas/body.RamStatus"},"zone":{"description":"Zone is the name of the zone where the host is located.","type":"string"}},"type":"object"},"body.HostVerboseRead":{"properties":{"deactivatedUntil":{"type":"string"},"displayName":{"type":"string"},"enabled":{"type":"boolean"},"ip":{"type":"string"},"lastSeenAt":{"type":"string"},"name":{"type":"string"},"port":{"type":"integer"},"registeredAt":{"type":"string"},"schedulable":{"type":"boolean"},"zone":{"description":"Zone is the name of the zone where the host is located.","type":"string"}},"type":"object"},"body.HttpProxyCreate":{"properties":{"customDomain":{"description":"CustomDomain is the domain that the deployment will be available on.\nThe max length is set to 243 to allow for a subdomain when confirming the domain.","type":"string"},"name":{"maxLength":30,"minLength":3,"type":"string"}},"required":["name"],"type":"object"},"body.HttpProxyRead":{"properties":{"customDomain":{"$ref":"#/components/schemas/body.CustomDomainRead"},"name":{"type":"string"},"url":{"type":"string"}},"type":"object"},"body.HttpProxyUpdate":{"properties":{"customDomain":{"description":"CustomDomain is the domain that the deployment will be available on.\nThe max length is set to 243 to allow for a subdomain when confirming the domain.","type":"string"},"name":{"maxLength":30,"minLength":3,"type":"string"}},"required":["name"],"type":"object"},"body.JobRead":{"properties":{"createdAt":{"type":"string"},"finishedAt":{"type":"string"},"id":{"type":"string"},"lastError":{"type":"string"},"lastRunAt":{"type":"string"},"runAfter":{"type":"string"},"status":{"type":"string"},"type":{"type":"string"},"userId":{"type":"string"}},"type":"object"},"body.JobUpdate":{"properties":{"status":{"enum":["pending","running","failed","terminated","finished","completed"],"type":"string"}},"type":"object"},"body.K8sStats":{"properties":{"clusters":{"items":{"$ref":"#/components/schemas/body.ClusterStats"},"type":"array","uniqueItems":false},"podCount":{"type":"integer"}},"type":"object"},"body.NotificationRead":{"properties":{"completedAt":{"type":"string"},"content":{"additionalProperties":{},"type":"object"},"createdAt":{"type":"string"},"id":{"type":"string"},"readAt":{"type":"string"},"toastedAt":{"type":"string"},"type":{"type":"string"},"userId":{"type":"string"}},"type":"object"},"body.NotificationUpdate":{"properties":{"read":{"type":"boolean"},"toasted":{"type":"boolean"}},"type":"object"},"body.PortCreate":{"properties":{"httpProxy":{"$ref":"#/components/schemas/body.HttpProxyCreate"},"name":{"maxLength":100,"minLength":1,"type":"string"},"port":{"maximum":65535,"minimum":1,"type":"integer"},"protocol":{"enum":["tcp","udp"],"type":"string"}},"required":["name","port","protocol"],"type":"object"},"body.PortRead":{"properties":{"externalPort":{"type":"integer"},"httpProxy":{"$ref":"#/components/schemas/body.HttpProxyRead"},"name":{"type":"string"},"port":{"type":"integer"},"protocol":{"type":"string"}},"type":"object"},"body.PortUpdate":{"properties":{"httpProxy":{"$ref":"#/components/schemas/body.HttpProxyUpdate"},"name":{"maxLength":100,"minLength":1,"type":"string"},"port":{"maximum":65535,"minimum":1,"type":"integer"},"protocol":{"enum":["tcp","udp"],"type":"string"}},"required":["name","port","protocol"],"type":"object"},"body.PublicKey":{"properties":{"key":{"type":"string"},"name":{"maxLength":30,"minLength":1,"type":"string"}},"required":["key","name"],"type":"object"},"body.Quota":{"properties":{"cpuCores":{"type":"number"},"diskSize":{"type":"number"},"gpuLeaseDuration":{"description":"in hours","type":"number"},"ram":{"type":"number"},"snapshots":{"type":"integer"}},"type":"object"},"body.RamCapacities":{"properties":{"total":{"type":"integer"}},"type":"object"},"body.RamStatus":{"properties":{"load":{"$ref":"#/components/schemas/body.RamStatusLoad"}},"type":"object"},"body.RamStatusLoad":{"properties":{"main":{"type":"number"}},"type":"object"},"body.ReplicaStatus":{"properties":{"availableReplicas":{"description":"AvailableReplicas is the number of replicas that are available.","type":"integer"},"desiredReplicas":{"description":"DesiredReplicas is the number of replicas that the deployment should have.","type":"integer"},"readyReplicas":{"description":"ReadyReplicas is the number of replicas that are ready.","type":"integer"},"unavailableReplicas":{"description":"UnavailableReplicas is the number of replicas that are unavailable.","type":"integer"}},"type":"object"},"body.ResourceMigrationCreate":{"properties":{"resourceId":{"description":"ResourceID is the ID of the resource that is being migrated.\nThis can be a VM ID, deployment ID, etc. depending on the type of the migration.","type":"string"},"status":{"description":"Status is the status of the resource migration.\nIt is used by privileged admins to directly accept or reject a migration.\nThe field is ignored by non-admins.\n\nPossible values:\n- accepted\n- pending","type":"string"},"type":{"description":"Type is the type of the resource migration.\n\nPossible values:\n- updateOwner","enum":["updateOwner"],"type":"string"},"updateOwner":{"description":"UpdateOwner is the set of parameters that are required for the updateOwner migration type.\nIt is ignored if the migration type is not updateOwner.","properties":{"ownerId":{"type":"string"}},"required":["ownerId"],"type":"object"}},"required":["resourceId","type"],"type":"object"},"body.ResourceMigrationCreated":{"properties":{"createdAt":{"type":"string"},"deletedAt":{"type":"string"},"id":{"type":"string"},"jobId":{"description":"JobID is the ID of the job that was created for the resource migration.\nIt will only be set if the migration was created with status 'accepted'.","type":"string"},"resourceId":{"description":"ResourceID is the ID of the resource that is being migrated.\nThis can be a VM ID, deployment ID, etc. depending on the type of the migration.","type":"string"},"resourceType":{"description":"ResourceType is the type of the resource that is being migrated.\n\nPossible values:\n- vm\n- deployment","type":"string"},"status":{"description":"Status is the status of the resource migration.\nWhen this field is set to 'accepted', the migration will take place and then automatically be deleted.","type":"string"},"type":{"description":"Type is the type of the resource migration.\n\nPossible values:\n- updateOwner","type":"string"},"updateOwner":{"description":"UpdateOwner is the set of parameters that are required for the updateOwner migration type.\nIt is empty if the migration type is not updateOwner.","properties":{"ownerId":{"type":"string"}},"type":"object"},"userId":{"description":"UserID is the ID of the user who initiated the migration.","type":"string"}},"type":"object"},"body.ResourceMigrationRead":{"properties":{"createdAt":{"type":"string"},"deletedAt":{"type":"string"},"id":{"type":"string"},"resourceId":{"description":"ResourceID is the ID of the resource that is being migrated.\nThis can be a VM ID, deployment ID, etc. depending on the type of the migration.","type":"string"},"resourceType":{"description":"ResourceType is the type of the resource that is being migrated.\n\nPossible values:\n- vm\n- deployment","type":"string"},"status":{"description":"Status is the status of the resource migration.\nWhen this field is set to 'accepted', the migration will take place and then automatically be deleted.","type":"string"},"type":{"description":"Type is the type of the resource migration.\n\nPossible values:\n- updateOwner","type":"string"},"updateOwner":{"description":"UpdateOwner is the set of parameters that are required for the updateOwner migration type.\nIt is empty if the migration type is not updateOwner.","properties":{"ownerId":{"type":"string"}},"type":"object"},"userId":{"description":"UserID is the ID of the user who initiated the migration.","type":"string"}},"type":"object"},"body.ResourceMigrationUpdate":{"properties":{"code":{"description":"Code is a token required when accepting a migration if the acceptor is not an admin.\nIt is sent to the acceptor using the notification API","type":"string"},"status":{"description":"Status is the status of the resource migration.\nIt is used to accept a migration by setting the status to 'accepted'.\nIf the acceptor is not an admin, a Code must be provided.\n\nPossible values:\n- accepted\n- pending","type":"string"}},"required":["status"],"type":"object"},"body.ResourceMigrationUpdated":{"properties":{"createdAt":{"type":"string"},"deletedAt":{"type":"string"},"id":{"type":"string"},"jobId":{"description":"JobID is the ID of the job that was created for the resource migration.\nIt will only be set if the migration was updated with status 'accepted'.","type":"string"},"resourceId":{"description":"ResourceID is the ID of the resource that is being migrated.\nThis can be a VM ID, deployment ID, etc. depending on the type of the migration.","type":"string"},"resourceType":{"description":"ResourceType is the type of the resource that is being migrated.\n\nPossible values:\n- vm\n- deployment","type":"string"},"status":{"description":"Status is the status of the resource migration.\nWhen this field is set to 'accepted', the migration will take place and then automatically be deleted.","type":"string"},"type":{"description":"Type is the type of the resource migration.\n\nPossible values:\n- updateOwner","type":"string"},"updateOwner":{"description":"UpdateOwner is the set of parameters that are required for the updateOwner migration type.\nIt is empty if the migration type is not updateOwner.","properties":{"ownerId":{"type":"string"}},"type":"object"},"userId":{"description":"UserID is the ID of the user who initiated the migration.","type":"string"}},"type":"object"},"body.Role":{"properties":{"description":{"type":"string"},"name":{"type":"string"},"permissions":{"items":{"type":"string"},"type":"array","uniqueItems":false},"quota":{"$ref":"#/components/schemas/body.Quota"}},"type":"object"},"body.SmDeleted":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.SmRead":{"properties":{"createdAt":{"type":"string"},"id":{"type":"string"},"ownerId":{"type":"string"},"url":{"type":"string"},"zone":{"type":"string"}},"type":"object"},"body.SystemCapacities":{"properties":{"clusters":{"description":"Per Cluster","items":{"$ref":"#/components/schemas/body.ClusterCapacities"},"type":"array","uniqueItems":false},"cpuCore":{"$ref":"#/components/schemas/body.CpuCoreCapacities"},"gpu":{"$ref":"#/components/schemas/body.GpuCapacities"},"hosts":{"description":"Per Host","items":{"$ref":"#/components/schemas/body.HostCapacities"},"type":"array","uniqueItems":false},"ram":{"$ref":"#/components/schemas/body.RamCapacities"}},"type":"object"},"body.SystemStats":{"properties":{"k8s":{"$ref":"#/components/schemas/body.K8sStats"}},"type":"object"},"body.SystemStatus":{"properties":{"hosts":{"items":{"$ref":"#/components/schemas/body.HostStatus"},"type":"array","uniqueItems":false}},"type":"object"},"body.TeamCreate":{"properties":{"description":{"maxLength":1000,"type":"string"},"members":{"items":{"$ref":"#/components/schemas/body.TeamMemberCreate"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"name":{"maxLength":100,"minLength":1,"type":"string"},"resources":{"items":{"type":"string"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false}},"required":["name"],"type":"object"},"body.TeamMember":{"properties":{"addedAt":{"type":"string"},"email":{"type":"string"},"firstName":{"type":"string"},"gravatarUrl":{"type":"string"},"id":{"type":"string"},"joinedAt":{"type":"string"},"lastName":{"type":"string"},"memberStatus":{"type":"string"},"teamRole":{"type":"string"},"username":{"type":"string"}},"type":"object"},"body.TeamMemberCreate":{"properties":{"id":{"type":"string"},"teamRole":{"description":"default to MemberRoleAdmin right now","type":"string"}},"required":["id"],"type":"object"},"body.TeamMemberUpdate":{"properties":{"id":{"type":"string"},"teamRole":{"description":"default to MemberRoleAdmin right now","type":"string"}},"required":["id"],"type":"object"},"body.TeamRead":{"properties":{"createdAt":{"type":"string"},"description":{"type":"string"},"id":{"type":"string"},"members":{"items":{"$ref":"#/components/schemas/body.TeamMember"},"type":"array","uniqueItems":false},"name":{"type":"string"},"ownerId":{"type":"string"},"resources":{"items":{"$ref":"#/components/schemas/body.TeamResource"},"type":"array","uniqueItems":false},"updatedAt":{"type":"string"}},"type":"object"},"body.TeamResource":{"properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"}},"type":"object"},"body.TeamUpdate":{"properties":{"description":{"maxLength":1000,"type":"string"},"members":{"items":{"$ref":"#/components/schemas/body.TeamMemberUpdate"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"name":{"maxLength":100,"minLength":1,"type":"string"},"resources":{"items":{"type":"string"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false}},"type":"object"},"body.TimestampedSystemCapacities":{"properties":{"capacities":{"$ref":"#/components/schemas/body.SystemCapacities"},"timestamp":{"type":"string"}},"type":"object"},"body.TimestampedSystemStats":{"properties":{"stats":{"$ref":"#/components/schemas/body.SystemStats"},"timestamp":{"type":"string"}},"type":"object"},"body.TimestampedSystemStatus":{"properties":{"status":{"$ref":"#/components/schemas/body.SystemStatus"},"timestamp":{"type":"string"}},"type":"object"},"body.Usage":{"properties":{"cpuCores":{"type":"number"},"diskSize":{"type":"integer"},"ram":{"type":"number"}},"type":"object"},"body.UserData":{"properties":{"key":{"maxLength":255,"minLength":1,"type":"string"},"value":{"maxLength":255,"minLength":1,"type":"string"}},"required":["key","value"],"type":"object"},"body.UserRead":{"properties":{"admin":{"type":"boolean"},"apiKeys":{"items":{"$ref":"#/components/schemas/body.ApiKey"},"type":"array","uniqueItems":false},"email":{"type":"string"},"firstName":{"type":"string"},"gravatarUrl":{"type":"string"},"id":{"type":"string"},"lastName":{"type":"string"},"publicKeys":{"items":{"$ref":"#/components/schemas/body.PublicKey"},"type":"array","uniqueItems":false},"quota":{"$ref":"#/components/schemas/body.Quota"},"role":{"$ref":"#/components/schemas/body.Role"},"storageUrl":{"type":"string"},"usage":{"$ref":"#/components/schemas/body.Usage"},"userData":{"items":{"$ref":"#/components/schemas/body.UserData"},"type":"array","uniqueItems":false},"username":{"type":"string"}},"type":"object"},"body.UserUpdate":{"properties":{"apiKeys":{"description":"ApiKeys specifies the API keys that should remain. If an API key is not in this list, it will be deleted.\nHowever, API keys cannot be created, use /apiKeys endpoint to create new API keys.","items":{"$ref":"#/components/schemas/body.ApiKey"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"publicKeys":{"items":{"$ref":"#/components/schemas/body.PublicKey"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"userData":{"items":{"$ref":"#/components/schemas/body.UserData"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false}},"type":"object"},"body.VmActionCreate":{"properties":{"action":{"enum":["start","stop","restart","repair"],"type":"string"}},"required":["action"],"type":"object"},"body.VmActionCreated":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.VmCreate":{"properties":{"cpuCores":{"minimum":1,"type":"integer"},"diskSize":{"minimum":10,"type":"integer"},"name":{"maxLength":30,"minLength":3,"type":"string"},"neverStale":{"type":"boolean"},"ports":{"items":{"$ref":"#/components/schemas/body.PortCreate"},"maxItems":10,"minItems":0,"type":"array","uniqueItems":false},"ram":{"minimum":1,"type":"integer"},"sshPublicKey":{"type":"string"},"zone":{"type":"string"}},"required":["cpuCores","diskSize","name","ram","sshPublicKey"],"type":"object"},"body.VmCreated":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.VmDeleted":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.VmGpuLease":{"properties":{"activatedAt":{"description":"ActivatedAt specifies the time when the lease was activated. This is the time the user first attached the GPU\nor 1 day after the lease was created if the user did not attach the GPU.","type":"string"},"assignedAt":{"description":"AssignedAt specifies the time when the lease was assigned to the user.","type":"string"},"createdAt":{"type":"string"},"expiredAt":{"description":"ExpiredAt specifies the time when the lease expired.\nThis is only present if the lease is expired.","type":"string"},"expiresAt":{"description":"ExpiresAt specifies the time when the lease will expire.\nThis is only present if the lease is active.","type":"string"},"gpuGroupId":{"type":"string"},"id":{"type":"string"},"leaseDuration":{"type":"number"}},"type":"object"},"body.VmRead":{"properties":{"accessedAt":{"type":"string"},"createdAt":{"type":"string"},"gpu":{"$ref":"#/components/schemas/body.VmGpuLease"},"host":{"type":"string"},"id":{"type":"string"},"internalName":{"type":"string"},"name":{"type":"string"},"neverStale":{"type":"boolean"},"ownerId":{"type":"string"},"ports":{"items":{"$ref":"#/components/schemas/body.PortRead"},"type":"array","uniqueItems":false},"repairedAt":{"type":"string"},"specs":{"$ref":"#/components/schemas/body.VmSpecs"},"sshConnectionString":{"type":"string"},"sshPublicKey":{"type":"string"},"status":{"type":"string"},"teams":{"items":{"type":"string"},"type":"array","uniqueItems":false},"updatedAt":{"type":"string"},"zone":{"type":"string"}},"type":"object"},"body.VmSnapshotCreated":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.VmSnapshotDeleted":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.VmSnapshotRead":{"properties":{"created":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"}},"type":"object"},"body.VmSpecs":{"properties":{"cpuCores":{"type":"integer"},"diskSize":{"type":"integer"},"ram":{"type":"integer"}},"type":"object"},"body.VmUpdate":{"properties":{"cpuCores":{"minimum":1,"type":"integer"},"name":{"maxLength":30,"minLength":3,"type":"string"},"neverStale":{"type":"boolean"},"ports":{"items":{"$ref":"#/components/schemas/body.PortUpdate"},"maxItems":10,"minItems":0,"type":"array","uniqueItems":false},"ram":{"minimum":1,"type":"integer"}},"type":"object"},"body.VmUpdated":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.Volume":{"properties":{"appPath":{"maxLength":255,"minLength":1,"type":"string"},"name":{"maxLength":30,"minLength":3,"type":"string"},"serverPath":{"maxLength":255,"minLength":1,"type":"string"}},"required":["appPath","name","serverPath"],"type":"object"},"body.WorkerStatusRead":{"properties":{"name":{"type":"string"},"reportedAt":{"type":"string"},"status":{"type":"string"}},"type":"object"},"body.ZoneEndpoints":{"properties":{"deployment":{"type":"string"},"storage":{"type":"string"},"vm":{"type":"string"},"vmApp":{"type":"string"}},"type":"object"},"body.ZoneRead":{"properties":{"capabilities":{"items":{"type":"string"},"type":"array","uniqueItems":false},"description":{"type":"string"},"enabled":{"type":"boolean"},"endpoints":{"$ref":"#/components/schemas/body.ZoneEndpoints"},"legacy":{"type":"boolean"},"name":{"type":"string"}},"type":"object"},"sys.Error":{"properties":{"code":{"type":"string"},"msg":{"type":"string"}},"type":"object"},"sys.ErrorResponse":{"properties":{"errors":{"items":{"$ref":"#/components/schemas/sys.Error"},"type":"array","uniqueItems":false}},"type":"object"}},"securitySchemes":{"ApiKeyAuth":{"in":"header","name":"X-Api-Key","type":"apiKey"},"KeycloakOAuth":{"flows":{"authorizationCode":{"authorizationUrl":"https://iam.cloud.cbh.kth.se/realms/cloud/protocol/openid-connect/auth","tokenUrl":"https://iam.cloud.cbh.kth.se/realms/cloud/protocol/openid-connect/token"}},"in":"header","type":"oauth2"}}}, + "components": {"schemas":{"body.ApiKey":{"properties":{"createdAt":{"type":"string"},"expiresAt":{"type":"string"},"name":{"type":"string"}},"type":"object"},"body.ApiKeyCreate":{"properties":{"expiresAt":{"type":"string"},"name":{"type":"string"}},"required":["expiresAt","name"],"type":"object"},"body.ApiKeyCreated":{"properties":{"createdAt":{"type":"string"},"expiresAt":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"}},"type":"object"},"body.BindingError":{"properties":{"validationErrors":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object"}},"type":"object"},"body.CiConfig":{"properties":{"config":{"type":"string"}},"type":"object"},"body.ClusterCapacities":{"properties":{"cluster":{"type":"string"},"cpuCore":{"$ref":"#/components/schemas/body.CpuCoreCapacities"},"gpu":{"$ref":"#/components/schemas/body.GpuCapacities"},"ram":{"$ref":"#/components/schemas/body.RamCapacities"}},"type":"object"},"body.ClusterStats":{"properties":{"cluster":{"type":"string"},"podCount":{"type":"integer"}},"type":"object"},"body.CpuCoreCapacities":{"description":"Total","properties":{"total":{"type":"integer"}},"type":"object"},"body.CpuStatus":{"properties":{"load":{"$ref":"#/components/schemas/body.CpuStatusLoad"},"temp":{"$ref":"#/components/schemas/body.CpuStatusTemp"}},"type":"object"},"body.CpuStatusLoad":{"properties":{"cores":{"items":{"type":"integer"},"type":"array","uniqueItems":false},"main":{"type":"number"},"max":{"type":"number"}},"type":"object"},"body.CpuStatusTemp":{"properties":{"cores":{"items":{"type":"integer"},"type":"array","uniqueItems":false},"main":{"type":"number"},"max":{"type":"number"}},"type":"object"},"body.CustomDomainRead":{"properties":{"domain":{"type":"string"},"secret":{"type":"string"},"status":{"type":"string"},"url":{"type":"string"}},"type":"object"},"body.DeploymentCommand":{"properties":{"command":{"enum":["restart"],"type":"string"}},"required":["command"],"type":"object"},"body.DeploymentCreate":{"properties":{"args":{"items":{"type":"string"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"cpuCores":{"type":"number"},"customDomain":{"description":"CustomDomain is the domain that the deployment will be available on.\nThe max length is set to 243 to allow for a subdomain when confirming the domain.","type":"string"},"envs":{"items":{"$ref":"#/components/schemas/body.Env"},"maxItems":1000,"minItems":0,"type":"array","uniqueItems":false},"healthCheckPath":{"maxLength":1000,"minLength":0,"type":"string"},"image":{"maxLength":1000,"minLength":1,"type":"string"},"initCommands":{"items":{"type":"string"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"name":{"maxLength":30,"minLength":3,"type":"string"},"neverStale":{"description":"Boolean to make deployment never get disabled, despite being stale","type":"boolean"},"private":{"description":"Deprecated: Use Visibility instead.","type":"boolean"},"ram":{"type":"number"},"replicas":{"maximum":100,"minimum":0,"type":"integer"},"visibility":{"enum":["public","private","auth"],"type":"string"},"volumes":{"items":{"$ref":"#/components/schemas/body.Volume"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"zone":{"description":"Zone is the zone that the deployment will be created in.\nIf the zone is not set, the deployment will be created in the default zone.","type":"string"}},"required":["name"],"type":"object"},"body.DeploymentCreated":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.DeploymentRead":{"properties":{"accessedAt":{"type":"string"},"args":{"items":{"type":"string"},"type":"array","uniqueItems":false},"createdAt":{"type":"string"},"customDomain":{"$ref":"#/components/schemas/body.CustomDomainRead"},"envs":{"items":{"$ref":"#/components/schemas/body.Env"},"type":"array","uniqueItems":false},"error":{"type":"string"},"healthCheckPath":{"type":"string"},"id":{"type":"string"},"image":{"type":"string"},"initCommands":{"items":{"type":"string"},"type":"array","uniqueItems":false},"integrations":{"description":"Integrations are currently not used, but could be used if we wanted to add a list of integrations to the deployment\n\nFor example GitHub","items":{"type":"string"},"type":"array","uniqueItems":false},"internalPort":{"type":"integer"},"internalPorts":{"items":{"type":"integer"},"type":"array","uniqueItems":false},"name":{"type":"string"},"neverStale":{"type":"boolean"},"ownerId":{"type":"string"},"pingResult":{"type":"integer"},"private":{"description":"Deprecated: Use Visibility instead.","type":"boolean"},"repairedAt":{"type":"string"},"replicaStatus":{"$ref":"#/components/schemas/body.ReplicaStatus"},"restartedAt":{"type":"string"},"specs":{"$ref":"#/components/schemas/body.DeploymentSpecs"},"status":{"type":"string"},"storageUrl":{"type":"string"},"teams":{"items":{"type":"string"},"type":"array","uniqueItems":false},"type":{"type":"string"},"updatedAt":{"type":"string"},"url":{"type":"string"},"visibility":{"type":"string"},"volumes":{"items":{"$ref":"#/components/schemas/body.Volume"},"type":"array","uniqueItems":false},"zone":{"type":"string"}},"type":"object"},"body.DeploymentSpecs":{"properties":{"cpuCores":{"type":"number"},"ram":{"type":"number"},"replicas":{"type":"integer"}},"type":"object"},"body.DeploymentUpdate":{"properties":{"args":{"items":{"type":"string"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"cpuCores":{"type":"number"},"customDomain":{"description":"CustomDomain is the domain that the deployment will be available on.\nThe max length is set to 243 to allow for a subdomain when confirming the domain.","type":"string"},"envs":{"items":{"$ref":"#/components/schemas/body.Env"},"maxItems":1000,"minItems":0,"type":"array","uniqueItems":false},"healthCheckPath":{"maxLength":1000,"minLength":0,"type":"string"},"image":{"maxLength":1000,"minLength":1,"type":"string"},"initCommands":{"items":{"type":"string"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"name":{"maxLength":30,"minLength":3,"type":"string"},"neverStale":{"type":"boolean"},"private":{"description":"Deprecated: Use Visibility instead.","type":"boolean"},"ram":{"type":"number"},"replicas":{"maximum":100,"minimum":0,"type":"integer"},"visibility":{"enum":["public","private","auth"],"type":"string"},"volumes":{"items":{"$ref":"#/components/schemas/body.Volume"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false}},"required":["name"],"type":"object"},"body.DeploymentUpdated":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.DiscoverRead":{"properties":{"roles":{"items":{"$ref":"#/components/schemas/body.Role"},"type":"array","uniqueItems":false},"version":{"type":"string"}},"type":"object"},"body.Env":{"properties":{"name":{"maxLength":100,"minLength":1,"type":"string"},"value":{"maxLength":10000,"minLength":1,"type":"string"}},"required":["name","value"],"type":"object"},"body.GpuCapacities":{"properties":{"total":{"type":"integer"}},"type":"object"},"body.GpuGroupRead":{"properties":{"available":{"type":"integer"},"displayName":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"total":{"type":"integer"},"vendor":{"type":"string"},"zone":{"type":"string"}},"type":"object"},"body.GpuLeaseCreate":{"properties":{"gpuGroupId":{"description":"GpuGroupID is used to specify the GPU to lease.\nAs such, the lease does not specify which specific GPU to lease, but rather the type of GPU to lease.","type":"string"},"leaseForever":{"description":"LeaseForever is used to specify whether the lease should be created forever.","type":"boolean"}},"required":["gpuGroupId"],"type":"object"},"body.GpuLeaseCreated":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.GpuLeaseDeleted":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.GpuLeaseRead":{"properties":{"activatedAt":{"description":"ActivatedAt specifies the time when the lease was activated. This is the time the user first attached the GPU\nor 1 day after the lease was created if the user did not attach the GPU.","type":"string"},"active":{"type":"boolean"},"assignedAt":{"description":"AssignedAt specifies the time when the lease was assigned to the user.","type":"string"},"createdAt":{"type":"string"},"expiredAt":{"type":"string"},"expiresAt":{"description":"ExpiresAt specifies the time when the lease will expire.\nThis is only present if the lease is active.","type":"string"},"gpuGroupId":{"type":"string"},"id":{"type":"string"},"leaseDuration":{"type":"number"},"queuePosition":{"type":"integer"},"userId":{"type":"string"},"vmId":{"description":"VmID is set when the lease is attached to a VM.","type":"string"}},"type":"object"},"body.GpuLeaseUpdate":{"properties":{"vmId":{"description":"VmID is used to specify the VM to attach the lease to.\n\n- If specified, the lease will be attached to the VM.\n\n- If the lease is already attached to a VM, it will be detached from the current VM and attached to the new VM.\n\n- If the lease is not active, specifying a VM will activate the lease.\n\n- If the lease is not assigned, an error will be returned.","type":"string"}},"type":"object"},"body.GpuLeaseUpdated":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.GpuStatus":{"properties":{"temp":{"items":{"$ref":"#/components/schemas/body.GpuStatusTemp"},"type":"array","uniqueItems":false}},"type":"object"},"body.GpuStatusTemp":{"properties":{"main":{"type":"number"}},"type":"object"},"body.HarborWebhook":{"properties":{"event_data":{"properties":{"repository":{"properties":{"date_created":{"type":"integer"},"name":{"type":"string"},"namespace":{"type":"string"},"repo_full_name":{"type":"string"},"repo_type":{"type":"string"}},"type":"object"},"resources":{"items":{"properties":{"digest":{"type":"string"},"resource_url":{"type":"string"},"tag":{"type":"string"}},"type":"object"},"type":"array","uniqueItems":false}},"type":"object"},"occur_at":{"type":"integer"},"operator":{"type":"string"},"type":{"type":"string"}},"type":"object"},"body.HostCapacities":{"properties":{"cpuCore":{"$ref":"#/components/schemas/body.CpuCoreCapacities"},"displayName":{"type":"string"},"gpu":{"$ref":"#/components/schemas/body.GpuCapacities"},"name":{"type":"string"},"ram":{"$ref":"#/components/schemas/body.RamCapacities"},"zone":{"description":"Zone is the name of the zone where the host is located.","type":"string"}},"type":"object"},"body.HostRead":{"properties":{"displayName":{"type":"string"},"name":{"type":"string"},"zone":{"description":"Zone is the name of the zone where the host is located.","type":"string"}},"type":"object"},"body.HostStatus":{"properties":{"cpu":{"$ref":"#/components/schemas/body.CpuStatus"},"displayName":{"type":"string"},"gpu":{"$ref":"#/components/schemas/body.GpuStatus"},"name":{"type":"string"},"ram":{"$ref":"#/components/schemas/body.RamStatus"},"zone":{"description":"Zone is the name of the zone where the host is located.","type":"string"}},"type":"object"},"body.HostVerboseRead":{"properties":{"deactivatedUntil":{"type":"string"},"displayName":{"type":"string"},"enabled":{"type":"boolean"},"ip":{"type":"string"},"lastSeenAt":{"type":"string"},"name":{"type":"string"},"port":{"type":"integer"},"registeredAt":{"type":"string"},"schedulable":{"type":"boolean"},"zone":{"description":"Zone is the name of the zone where the host is located.","type":"string"}},"type":"object"},"body.HttpProxyCreate":{"properties":{"customDomain":{"description":"CustomDomain is the domain that the deployment will be available on.\nThe max length is set to 243 to allow for a subdomain when confirming the domain.","type":"string"},"name":{"maxLength":30,"minLength":3,"type":"string"}},"required":["name"],"type":"object"},"body.HttpProxyRead":{"properties":{"customDomain":{"$ref":"#/components/schemas/body.CustomDomainRead"},"name":{"type":"string"},"url":{"type":"string"}},"type":"object"},"body.HttpProxyUpdate":{"properties":{"customDomain":{"description":"CustomDomain is the domain that the deployment will be available on.\nThe max length is set to 243 to allow for a subdomain when confirming the domain.","type":"string"},"name":{"maxLength":30,"minLength":3,"type":"string"}},"required":["name"],"type":"object"},"body.JobRead":{"properties":{"createdAt":{"type":"string"},"finishedAt":{"type":"string"},"id":{"type":"string"},"lastError":{"type":"string"},"lastRunAt":{"type":"string"},"runAfter":{"type":"string"},"status":{"type":"string"},"type":{"type":"string"},"userId":{"type":"string"}},"type":"object"},"body.JobUpdate":{"properties":{"status":{"enum":["pending","running","failed","terminated","finished","completed"],"type":"string"}},"type":"object"},"body.K8sStats":{"properties":{"clusters":{"items":{"$ref":"#/components/schemas/body.ClusterStats"},"type":"array","uniqueItems":false},"podCount":{"type":"integer"}},"type":"object"},"body.NotificationRead":{"properties":{"completedAt":{"type":"string"},"content":{"additionalProperties":{},"type":"object"},"createdAt":{"type":"string"},"id":{"type":"string"},"readAt":{"type":"string"},"toastedAt":{"type":"string"},"type":{"type":"string"},"userId":{"type":"string"}},"type":"object"},"body.NotificationUpdate":{"properties":{"read":{"type":"boolean"},"toasted":{"type":"boolean"}},"type":"object"},"body.PortCreate":{"properties":{"httpProxy":{"$ref":"#/components/schemas/body.HttpProxyCreate"},"name":{"maxLength":100,"minLength":1,"type":"string"},"port":{"maximum":65535,"minimum":1,"type":"integer"},"protocol":{"enum":["tcp","udp"],"type":"string"}},"required":["name","port","protocol"],"type":"object"},"body.PortRead":{"properties":{"externalPort":{"type":"integer"},"httpProxy":{"$ref":"#/components/schemas/body.HttpProxyRead"},"name":{"type":"string"},"port":{"type":"integer"},"protocol":{"type":"string"}},"type":"object"},"body.PortUpdate":{"properties":{"httpProxy":{"$ref":"#/components/schemas/body.HttpProxyUpdate"},"name":{"maxLength":100,"minLength":1,"type":"string"},"port":{"maximum":65535,"minimum":1,"type":"integer"},"protocol":{"enum":["tcp","udp"],"type":"string"}},"required":["name","port","protocol"],"type":"object"},"body.PublicKey":{"properties":{"key":{"type":"string"},"name":{"maxLength":30,"minLength":1,"type":"string"}},"required":["key","name"],"type":"object"},"body.Quota":{"properties":{"cpuCores":{"type":"number"},"diskSize":{"type":"number"},"gpuLeaseDuration":{"description":"in hours","type":"number"},"ram":{"type":"number"},"snapshots":{"type":"integer"}},"type":"object"},"body.RamCapacities":{"properties":{"total":{"type":"integer"}},"type":"object"},"body.RamStatus":{"properties":{"load":{"$ref":"#/components/schemas/body.RamStatusLoad"}},"type":"object"},"body.RamStatusLoad":{"properties":{"main":{"type":"number"}},"type":"object"},"body.ReplicaStatus":{"properties":{"availableReplicas":{"description":"AvailableReplicas is the number of replicas that are available.","type":"integer"},"desiredReplicas":{"description":"DesiredReplicas is the number of replicas that the deployment should have.","type":"integer"},"readyReplicas":{"description":"ReadyReplicas is the number of replicas that are ready.","type":"integer"},"unavailableReplicas":{"description":"UnavailableReplicas is the number of replicas that are unavailable.","type":"integer"}},"type":"object"},"body.ResourceMigrationCreate":{"properties":{"resourceId":{"description":"ResourceID is the ID of the resource that is being migrated.\nThis can be a VM ID, deployment ID, etc. depending on the type of the migration.","type":"string"},"status":{"description":"Status is the status of the resource migration.\nIt is used by privileged admins to directly accept or reject a migration.\nThe field is ignored by non-admins.\n\nPossible values:\n- accepted\n- pending","type":"string"},"type":{"description":"Type is the type of the resource migration.\n\nPossible values:\n- updateOwner","enum":["updateOwner"],"type":"string"},"updateOwner":{"description":"UpdateOwner is the set of parameters that are required for the updateOwner migration type.\nIt is ignored if the migration type is not updateOwner.","properties":{"ownerId":{"type":"string"}},"required":["ownerId"],"type":"object"}},"required":["resourceId","type"],"type":"object"},"body.ResourceMigrationCreated":{"properties":{"createdAt":{"type":"string"},"deletedAt":{"type":"string"},"id":{"type":"string"},"jobId":{"description":"JobID is the ID of the job that was created for the resource migration.\nIt will only be set if the migration was created with status 'accepted'.","type":"string"},"resourceId":{"description":"ResourceID is the ID of the resource that is being migrated.\nThis can be a VM ID, deployment ID, etc. depending on the type of the migration.","type":"string"},"resourceType":{"description":"ResourceType is the type of the resource that is being migrated.\n\nPossible values:\n- vm\n- deployment","type":"string"},"status":{"description":"Status is the status of the resource migration.\nWhen this field is set to 'accepted', the migration will take place and then automatically be deleted.","type":"string"},"type":{"description":"Type is the type of the resource migration.\n\nPossible values:\n- updateOwner","type":"string"},"updateOwner":{"description":"UpdateOwner is the set of parameters that are required for the updateOwner migration type.\nIt is empty if the migration type is not updateOwner.","properties":{"ownerId":{"type":"string"}},"type":"object"},"userId":{"description":"UserID is the ID of the user who initiated the migration.","type":"string"}},"type":"object"},"body.ResourceMigrationRead":{"properties":{"createdAt":{"type":"string"},"deletedAt":{"type":"string"},"id":{"type":"string"},"resourceId":{"description":"ResourceID is the ID of the resource that is being migrated.\nThis can be a VM ID, deployment ID, etc. depending on the type of the migration.","type":"string"},"resourceType":{"description":"ResourceType is the type of the resource that is being migrated.\n\nPossible values:\n- vm\n- deployment","type":"string"},"status":{"description":"Status is the status of the resource migration.\nWhen this field is set to 'accepted', the migration will take place and then automatically be deleted.","type":"string"},"type":{"description":"Type is the type of the resource migration.\n\nPossible values:\n- updateOwner","type":"string"},"updateOwner":{"description":"UpdateOwner is the set of parameters that are required for the updateOwner migration type.\nIt is empty if the migration type is not updateOwner.","properties":{"ownerId":{"type":"string"}},"type":"object"},"userId":{"description":"UserID is the ID of the user who initiated the migration.","type":"string"}},"type":"object"},"body.ResourceMigrationUpdate":{"properties":{"code":{"description":"Code is a token required when accepting a migration if the acceptor is not an admin.\nIt is sent to the acceptor using the notification API","type":"string"},"status":{"description":"Status is the status of the resource migration.\nIt is used to accept a migration by setting the status to 'accepted'.\nIf the acceptor is not an admin, a Code must be provided.\n\nPossible values:\n- accepted\n- pending","type":"string"}},"required":["status"],"type":"object"},"body.ResourceMigrationUpdated":{"properties":{"createdAt":{"type":"string"},"deletedAt":{"type":"string"},"id":{"type":"string"},"jobId":{"description":"JobID is the ID of the job that was created for the resource migration.\nIt will only be set if the migration was updated with status 'accepted'.","type":"string"},"resourceId":{"description":"ResourceID is the ID of the resource that is being migrated.\nThis can be a VM ID, deployment ID, etc. depending on the type of the migration.","type":"string"},"resourceType":{"description":"ResourceType is the type of the resource that is being migrated.\n\nPossible values:\n- vm\n- deployment","type":"string"},"status":{"description":"Status is the status of the resource migration.\nWhen this field is set to 'accepted', the migration will take place and then automatically be deleted.","type":"string"},"type":{"description":"Type is the type of the resource migration.\n\nPossible values:\n- updateOwner","type":"string"},"updateOwner":{"description":"UpdateOwner is the set of parameters that are required for the updateOwner migration type.\nIt is empty if the migration type is not updateOwner.","properties":{"ownerId":{"type":"string"}},"type":"object"},"userId":{"description":"UserID is the ID of the user who initiated the migration.","type":"string"}},"type":"object"},"body.Role":{"properties":{"description":{"type":"string"},"name":{"type":"string"},"permissions":{"items":{"type":"string"},"type":"array","uniqueItems":false},"quota":{"$ref":"#/components/schemas/body.Quota"}},"type":"object"},"body.SmDeleted":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.SmRead":{"properties":{"createdAt":{"type":"string"},"id":{"type":"string"},"ownerId":{"type":"string"},"url":{"type":"string"},"zone":{"type":"string"}},"type":"object"},"body.SystemCapacities":{"properties":{"clusters":{"description":"Per Cluster","items":{"$ref":"#/components/schemas/body.ClusterCapacities"},"type":"array","uniqueItems":false},"cpuCore":{"$ref":"#/components/schemas/body.CpuCoreCapacities"},"gpu":{"$ref":"#/components/schemas/body.GpuCapacities"},"hosts":{"description":"Per Host","items":{"$ref":"#/components/schemas/body.HostCapacities"},"type":"array","uniqueItems":false},"ram":{"$ref":"#/components/schemas/body.RamCapacities"}},"type":"object"},"body.SystemStats":{"properties":{"k8s":{"$ref":"#/components/schemas/body.K8sStats"}},"type":"object"},"body.SystemStatus":{"properties":{"hosts":{"items":{"$ref":"#/components/schemas/body.HostStatus"},"type":"array","uniqueItems":false}},"type":"object"},"body.TeamCreate":{"properties":{"description":{"maxLength":1000,"type":"string"},"members":{"items":{"$ref":"#/components/schemas/body.TeamMemberCreate"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"name":{"maxLength":100,"minLength":1,"type":"string"},"resources":{"items":{"type":"string"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false}},"required":["name"],"type":"object"},"body.TeamMember":{"properties":{"addedAt":{"type":"string"},"email":{"type":"string"},"firstName":{"type":"string"},"gravatarUrl":{"type":"string"},"id":{"type":"string"},"joinedAt":{"type":"string"},"lastName":{"type":"string"},"memberStatus":{"type":"string"},"teamRole":{"type":"string"},"username":{"type":"string"}},"type":"object"},"body.TeamMemberCreate":{"properties":{"id":{"type":"string"},"teamRole":{"description":"default to MemberRoleAdmin right now","type":"string"}},"required":["id"],"type":"object"},"body.TeamMemberUpdate":{"properties":{"id":{"type":"string"},"teamRole":{"description":"default to MemberRoleAdmin right now","type":"string"}},"required":["id"],"type":"object"},"body.TeamRead":{"properties":{"createdAt":{"type":"string"},"description":{"type":"string"},"id":{"type":"string"},"members":{"items":{"$ref":"#/components/schemas/body.TeamMember"},"type":"array","uniqueItems":false},"name":{"type":"string"},"ownerId":{"type":"string"},"resources":{"items":{"$ref":"#/components/schemas/body.TeamResource"},"type":"array","uniqueItems":false},"updatedAt":{"type":"string"}},"type":"object"},"body.TeamResource":{"properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"}},"type":"object"},"body.TeamUpdate":{"properties":{"description":{"maxLength":1000,"type":"string"},"members":{"items":{"$ref":"#/components/schemas/body.TeamMemberUpdate"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"name":{"maxLength":100,"minLength":1,"type":"string"},"resources":{"items":{"type":"string"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false}},"type":"object"},"body.TimestampedSystemCapacities":{"properties":{"capacities":{"$ref":"#/components/schemas/body.SystemCapacities"},"timestamp":{"type":"string"}},"type":"object"},"body.TimestampedSystemStats":{"properties":{"stats":{"$ref":"#/components/schemas/body.SystemStats"},"timestamp":{"type":"string"}},"type":"object"},"body.TimestampedSystemStatus":{"properties":{"status":{"$ref":"#/components/schemas/body.SystemStatus"},"timestamp":{"type":"string"}},"type":"object"},"body.Usage":{"properties":{"cpuCores":{"type":"number"},"diskSize":{"type":"integer"},"ram":{"type":"number"}},"type":"object"},"body.UserData":{"properties":{"key":{"maxLength":255,"minLength":1,"type":"string"},"value":{"maxLength":255,"minLength":1,"type":"string"}},"required":["key","value"],"type":"object"},"body.UserRead":{"properties":{"admin":{"type":"boolean"},"apiKeys":{"items":{"$ref":"#/components/schemas/body.ApiKey"},"type":"array","uniqueItems":false},"email":{"type":"string"},"firstName":{"type":"string"},"gravatarUrl":{"type":"string"},"id":{"type":"string"},"lastName":{"type":"string"},"publicKeys":{"items":{"$ref":"#/components/schemas/body.PublicKey"},"type":"array","uniqueItems":false},"quota":{"$ref":"#/components/schemas/body.Quota"},"role":{"$ref":"#/components/schemas/body.Role"},"storageUrl":{"type":"string"},"usage":{"$ref":"#/components/schemas/body.Usage"},"userData":{"items":{"$ref":"#/components/schemas/body.UserData"},"type":"array","uniqueItems":false},"username":{"type":"string"}},"type":"object"},"body.UserUpdate":{"properties":{"apiKeys":{"description":"ApiKeys specifies the API keys that should remain. If an API key is not in this list, it will be deleted.\nHowever, API keys cannot be created, use /apiKeys endpoint to create new API keys.","items":{"$ref":"#/components/schemas/body.ApiKey"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"publicKeys":{"items":{"$ref":"#/components/schemas/body.PublicKey"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"userData":{"items":{"$ref":"#/components/schemas/body.UserData"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false}},"type":"object"},"body.VmActionCreate":{"properties":{"action":{"enum":["start","stop","restart","repair"],"type":"string"}},"required":["action"],"type":"object"},"body.VmActionCreated":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.VmCreate":{"properties":{"cpuCores":{"minimum":1,"type":"integer"},"diskSize":{"minimum":10,"type":"integer"},"name":{"maxLength":30,"minLength":3,"type":"string"},"neverStale":{"type":"boolean"},"ports":{"items":{"$ref":"#/components/schemas/body.PortCreate"},"maxItems":10,"minItems":0,"type":"array","uniqueItems":false},"ram":{"minimum":1,"type":"integer"},"sshPublicKey":{"type":"string"},"zone":{"type":"string"}},"required":["cpuCores","diskSize","name","ram","sshPublicKey"],"type":"object"},"body.VmCreated":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.VmDeleted":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.VmGpuLease":{"properties":{"activatedAt":{"description":"ActivatedAt specifies the time when the lease was activated. This is the time the user first attached the GPU\nor 1 day after the lease was created if the user did not attach the GPU.","type":"string"},"assignedAt":{"description":"AssignedAt specifies the time when the lease was assigned to the user.","type":"string"},"createdAt":{"type":"string"},"expiredAt":{"description":"ExpiredAt specifies the time when the lease expired.\nThis is only present if the lease is expired.","type":"string"},"expiresAt":{"description":"ExpiresAt specifies the time when the lease will expire.\nThis is only present if the lease is active.","type":"string"},"gpuGroupId":{"type":"string"},"id":{"type":"string"},"leaseDuration":{"type":"number"}},"type":"object"},"body.VmRead":{"properties":{"accessedAt":{"type":"string"},"createdAt":{"type":"string"},"gpu":{"$ref":"#/components/schemas/body.VmGpuLease"},"host":{"type":"string"},"id":{"type":"string"},"internalName":{"type":"string"},"name":{"type":"string"},"neverStale":{"type":"boolean"},"ownerId":{"type":"string"},"ports":{"items":{"$ref":"#/components/schemas/body.PortRead"},"type":"array","uniqueItems":false},"repairedAt":{"type":"string"},"specs":{"$ref":"#/components/schemas/body.VmSpecs"},"sshConnectionString":{"type":"string"},"sshPublicKey":{"type":"string"},"status":{"type":"string"},"teams":{"items":{"type":"string"},"type":"array","uniqueItems":false},"updatedAt":{"type":"string"},"zone":{"type":"string"}},"type":"object"},"body.VmSnapshotCreated":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.VmSnapshotDeleted":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.VmSnapshotRead":{"properties":{"created":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"}},"type":"object"},"body.VmSpecs":{"properties":{"cpuCores":{"type":"integer"},"diskSize":{"type":"integer"},"ram":{"type":"integer"}},"type":"object"},"body.VmUpdate":{"properties":{"cpuCores":{"minimum":1,"type":"integer"},"name":{"maxLength":30,"minLength":3,"type":"string"},"neverStale":{"type":"boolean"},"ports":{"items":{"$ref":"#/components/schemas/body.PortUpdate"},"maxItems":10,"minItems":0,"type":"array","uniqueItems":false},"ram":{"minimum":1,"type":"integer"}},"type":"object"},"body.VmUpdated":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.Volume":{"properties":{"appPath":{"maxLength":255,"minLength":1,"type":"string"},"name":{"maxLength":30,"minLength":3,"type":"string"},"serverPath":{"maxLength":255,"minLength":1,"type":"string"}},"required":["appPath","name","serverPath"],"type":"object"},"body.WorkerStatusRead":{"properties":{"name":{"type":"string"},"reportedAt":{"type":"string"},"status":{"type":"string"}},"type":"object"},"body.ZoneEndpoints":{"properties":{"deployment":{"type":"string"},"storage":{"type":"string"},"vm":{"type":"string"},"vmApp":{"type":"string"}},"type":"object"},"body.ZoneRead":{"properties":{"capabilities":{"items":{"type":"string"},"type":"array","uniqueItems":false},"description":{"type":"string"},"enabled":{"type":"boolean"},"endpoints":{"$ref":"#/components/schemas/body.ZoneEndpoints"},"legacy":{"type":"boolean"},"name":{"type":"string"}},"type":"object"},"sys.Error":{"properties":{"code":{"type":"string"},"msg":{"type":"string"}},"type":"object"},"sys.ErrorResponse":{"properties":{"errors":{"items":{"$ref":"#/components/schemas/sys.Error"},"type":"array","uniqueItems":false}},"type":"object"}},"securitySchemes":{"ApiKeyAuth":{"in":"header","name":"X-Api-Key","type":"apiKey"},"KeycloakOAuth":{"flows":{"authorizationCode":{"authorizationUrl":"https://iam.cloud.cbh.kth.se/realms/cloud/protocol/openid-connect/auth","tokenUrl":"https://iam.cloud.cbh.kth.se/realms/cloud/protocol/openid-connect/token"}},"in":"header","type":"oauth2"}}}, "info": {"contact":{"name":"Support","url":"https://github.com/kthcloud/go-deploy"},"description":"{{escape .Description}}","license":{"name":"MIT License","url":"https://github.com/kthcloud/go-deploy?tab=MIT-1-ov-file#readme"},"termsOfService":"http://swagger.io/terms/","title":"{{.Title}}","version":"{{.Version}}"}, "externalDocs": {"description":"","url":""}, "paths": {"/v2/deployments":{"get":{"description":"List deployments","parameters":[{"description":"List all","in":"query","name":"all","schema":{"type":"boolean"}},{"description":"Filter by user ID","in":"query","name":"userId","schema":{"type":"string"}},{"description":"Include shared","in":"query","name":"shared","schema":{"type":"boolean"}},{"description":"Page number","in":"query","name":"page","schema":{"type":"integer"}},{"description":"Number of items per page","in":"query","name":"pageSize","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.DeploymentRead"},"type":"array"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"List deployments","tags":["Deployment"]},"post":{"description":"Create deployment","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.DeploymentCreate"}}},"description":"Deployment body","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.DeploymentRead"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Create deployment","tags":["Deployment"]}},"/v2/deployments/{deploymentId}":{"delete":{"description":"Delete deployment","parameters":[{"description":"Deployment ID","in":"path","name":"deploymentId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.DeploymentCreated"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Delete deployment","tags":["Deployment"]},"get":{"description":"Get deployment","parameters":[{"description":"Deployment ID","in":"path","name":"deploymentId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.DeploymentRead"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Get deployment","tags":["Deployment"]},"post":{"description":"Update deployment","parameters":[{"description":"Deployment ID","in":"path","name":"deploymentId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.DeploymentUpdate"}}},"description":"Deployment update","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.DeploymentUpdated"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Update deployment","tags":["Deployment"]}},"/v2/deployments/{deploymentId}/ciConfig":{"get":{"description":"Get CI config","parameters":[{"description":"Deployment ID","in":"path","name":"deploymentId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.CiConfig"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Get CI config","tags":["Deployment"]}},"/v2/deployments/{deploymentId}/command":{"post":{"description":"Do command","parameters":[{"description":"Deployment ID","in":"path","name":"deploymentId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.DeploymentCommand"}}},"description":"Command body","required":true},"responses":{"204":{"description":"No Content"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Locked"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Do command","tags":["Deployment"]}},"/v2/deployments/{deploymentId}/logs":{"get":{"description":"Get logs using Server-Sent Events","parameters":[{"description":"Deployment ID","in":"path","name":"deploymentId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"string"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Get logs using Server-Sent Events","tags":["Deployment"]}},"/v2/discover":{"get":{"description":"Discover","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.DiscoverRead"}}},"description":"OK"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Discover","tags":["Discover"]}},"/v2/gpuGroups":{"get":{"description":"List GPU groups","parameters":[{"description":"Page number","in":"query","name":"page","schema":{"type":"integer"}},{"description":"Number of items per page","in":"query","name":"pageSize","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.GpuGroupRead"},"type":"array"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Locked"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"List GPU groups","tags":["GpuGroup"]}},"/v2/gpuGroups/{gpuGroupId}":{"get":{"description":"Get GPU group","parameters":[{"description":"GPU group ID","in":"path","name":"gpuGroupId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.GpuGroupRead"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Locked"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Get GPU group","tags":["GpuGroup"]}},"/v2/gpuLeases":{"get":{"description":"List GPU leases","parameters":[{"description":"List all","in":"query","name":"all","schema":{"type":"boolean"}},{"description":"Filter by VM ID","in":"query","name":"vmId","schema":{"type":"string"}},{"description":"Page number","in":"query","name":"page","schema":{"type":"integer"}},{"description":"Number of items per page","in":"query","name":"pageSize","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.GpuLeaseRead"},"type":"array"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Locked"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"List GPU leases","tags":["GpuLease"]},"post":{"description":"Create GPU lease","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.GpuLeaseCreate"}}},"description":"GPU lease","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.GpuLeaseCreated"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Create GPU Lease","tags":["GpuLease"]}},"/v2/gpuLeases/{gpuLeaseId}":{"delete":{"description":"Delete GPU lease","parameters":[{"description":"GPU lease ID","in":"path","name":"gpuLeaseId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.GpuLeaseDeleted"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Delete GPU lease","tags":["GpuLease"]},"get":{"description":"Get GPU lease","parameters":[{"description":"GPU lease ID","in":"path","name":"gpuLeaseId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.GpuLeaseRead"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Locked"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Get GPU lease","tags":["GpuLease"]},"post":{"description":"Update GPU lease","parameters":[{"description":"GPU lease ID","in":"path","name":"gpuLeaseId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.GpuLeaseUpdate"}}},"description":"GPU lease","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.GpuLeaseUpdated"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Update GPU lease","tags":["GpuLease"]}},"/v2/hooks/harbor":{"post":{"description":"Handle Harbor hook","parameters":[{"description":"Basic auth token","in":"header","name":"Authorization","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.HarborWebhook"}}},"description":"Harbor webhook body","required":true},"responses":{"204":{"description":"No Content"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Handle Harbor hook","tags":["Deployment"]}},"/v2/hosts":{"get":{"description":"List Hosts","responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.HostRead"},"type":"array"}}},"description":"OK"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"List Hosts","tags":["Host"]}},"/v2/hosts/verbose":{"get":{"description":"List Hosts verbose","responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.HostVerboseRead"},"type":"array"}}},"description":"OK"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Forbidden"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"List Hosts verbose","tags":["Host"]}},"/v2/jobs":{"get":{"description":"List jobs","parameters":[{"description":"List all","in":"query","name":"all","schema":{"type":"boolean"}},{"description":"Filter by user ID","in":"query","name":"userId","schema":{"type":"string"}},{"description":"Filter by type","in":"query","name":"type","schema":{"type":"string"}},{"description":"Filter by status","in":"query","name":"status","schema":{"type":"string"}},{"description":"Page number","in":"query","name":"page","schema":{"type":"integer"}},{"description":"Number of items per page","in":"query","name":"pageSize","schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.JobRead"},"type":"array"}}},"description":"OK"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"List jobs","tags":["Job"]}},"/v2/jobs/{jobId}":{"get":{"description":"GetJob job by id","parameters":[{"description":"Job ID","in":"path","name":"jobId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.JobRead"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"GetJob job by id","tags":["Job"]},"post":{"description":"Update job. Only allowed for admins.","parameters":[{"description":"Job ID","in":"path","name":"jobId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.JobUpdate"}}},"description":"Job update","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.JobRead"}}},"description":"OK"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Update job","tags":["Job"]}},"/v2/metrics":{"get":{"description":"Get metrics","responses":{"200":{"content":{"application/json":{"schema":{"type":"string"}}},"description":"OK"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Get metrics","tags":["Metrics"]}},"/v2/notifications":{"get":{"description":"List notifications","parameters":[{"description":"List all notifications","in":"query","name":"all","schema":{"type":"boolean"}},{"description":"Filter by user ID","in":"query","name":"userId","schema":{"type":"string"}},{"description":"Page number","in":"query","name":"page","schema":{"type":"integer"}},{"description":"Number of items per page","in":"query","name":"pageSize","schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.NotificationRead"},"type":"array"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"List notifications","tags":["Notification"]}},"/v2/notifications/{notificationId}":{"delete":{"description":"Delete notification","parameters":[{"description":"Notification ID","in":"path","name":"notificationId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Delete notification","tags":["Notification"]},"get":{"description":"Get notification","parameters":[{"description":"Notification ID","in":"path","name":"notificationId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.NotificationRead"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Get notification","tags":["Notification"]},"post":{"description":"Update notification","parameters":[{"description":"Notification ID","in":"path","name":"notificationId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.NotificationUpdate"}}},"description":"Notification update","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Update notification","tags":["Notification"]}},"/v2/register":{"get":{"description":"Register resource","responses":{"204":{"description":"No Content"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Register resource","tags":["Register"]}},"/v2/resourceMigrations":{"get":{"description":"List resource migrations","parameters":[{"description":"Page number","in":"query","name":"page","schema":{"type":"integer"}},{"description":"Number of items per page","in":"query","name":"pageSize","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.ResourceMigrationRead"},"type":"array"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"List resource migrations","tags":["ResourceMigration"]},"post":{"description":"Create resource migration","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.ResourceMigrationCreate"}}},"description":"Resource Migration Create","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.ResourceMigrationCreated"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Create resource migration","tags":["ResourceMigration"]}},"/v2/resourceMigrations/{resourceMigrationId}":{"delete":{"description":"Delete resource migration","parameters":[{"description":"Resource Migration ID","in":"path","name":"resourceMigrationId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"204":{"description":"No Content"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Delete resource migration","tags":["ResourceMigration"]},"get":{"description":"Get resource migration","parameters":[{"description":"Resource Migration ID","in":"path","name":"resourceMigrationId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.ResourceMigrationRead"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Get resource migration","tags":["ResourceMigration"]},"post":{"description":"Update resource migration","parameters":[{"description":"Resource Migration ID","in":"path","name":"resourceMigrationId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.ResourceMigrationUpdate"}}},"description":"Resource Migration Update","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.ResourceMigrationUpdated"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Update resource migration","tags":["ResourceMigration"]}},"/v2/snapshots":{"get":{"description":"List snapshots","parameters":[{"description":"Filter by VM ID","in":"path","name":"vmId","required":true,"schema":{"type":"string"}},{"description":"Page number","in":"query","name":"page","schema":{"type":"integer"}},{"description":"Number of items per page","in":"query","name":"pageSize","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.VmSnapshotRead"},"type":"array"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Locked"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"List snapshots","tags":["Snapshot"]},"post":{"description":"Create snapshot","parameters":[{"description":"VM ID","in":"path","name":"vmId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.VmSnapshotCreated"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Create snapshot","tags":["Snapshot"]}},"/v2/storageManagers":{"get":{"description":"Get storage manager list","parameters":[{"description":"List all","in":"query","name":"all","schema":{"type":"boolean"}},{"description":"Page number","in":"query","name":"page","schema":{"type":"integer"}},{"description":"Number of items per page","in":"query","name":"pageSize","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.SmRead"},"type":"array"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Get storage manager list","tags":["StorageManager"]}},"/v2/storageManagers/{storageManagerId}":{"delete":{"description":"Delete storage manager","parameters":[{"description":"Storage manager ID","in":"path","name":"storageManagerId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.SmDeleted"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Delete storage manager","tags":["StorageManager"]},"get":{"description":"Get storage manager","parameters":[{"description":"Storage manager ID","in":"path","name":"storageManagerId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.SmDeleted"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Get storage manager","tags":["StorageManager"]}},"/v2/systemCapacities":{"get":{"description":"List system capacities","parameters":[{"description":"n","in":"query","name":"n","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.TimestampedSystemCapacities"},"type":"array"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.BindingError"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"List system capacities","tags":["System"]}},"/v2/systemStats":{"get":{"description":"List system stats","parameters":[{"description":"n","in":"query","name":"n","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.TimestampedSystemStats"},"type":"array"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.BindingError"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"List system stats","tags":["System"]}},"/v2/systemStatus":{"get":{"description":"List system stats","parameters":[{"description":"n","in":"query","name":"n","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.TimestampedSystemStatus"},"type":"array"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.BindingError"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"List system stats","tags":["System"]}},"/v2/teams":{"get":{"description":"List teams","parameters":[{"description":"List all","in":"query","name":"all","schema":{"type":"boolean"}},{"description":"Filter by user ID","in":"query","name":"userId","schema":{"type":"string"}},{"description":"Page number","in":"query","name":"page","schema":{"type":"integer"}},{"description":"Number of items per page","in":"query","name":"pageSize","schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.TeamRead"},"type":"array"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.BindingError"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"List teams","tags":["Team"]},"post":{"description":"Create team","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.TeamCreate"}}},"description":"Team","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.TeamRead"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.BindingError"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Create team","tags":["Team"]}},"/v2/teams/{teamId}":{"delete":{"description":"Delete team","parameters":[{"description":"Team ID","in":"path","name":"teamId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"204":{"description":"No Content"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.BindingError"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Delete team","tags":["Team"]},"get":{"description":"Get team","parameters":[{"description":"Team ID","in":"path","name":"teamId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.TeamRead"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.BindingError"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Get team","tags":["Team"]},"post":{"description":"Update team","parameters":[{"description":"Team ID","in":"path","name":"teamId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.TeamUpdate"}}},"description":"Team","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.TeamRead"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.BindingError"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Update team","tags":["Team"]}},"/v2/users":{"get":{"description":"List users","parameters":[{"description":"List all","in":"query","name":"all","schema":{"type":"boolean"}},{"description":"Discovery mode","in":"query","name":"discover","schema":{"type":"boolean"}},{"description":"Search query","in":"query","name":"search","schema":{"type":"string"}},{"description":"Page number","in":"query","name":"page","schema":{"type":"integer"}},{"description":"Number of items per page","in":"query","name":"pageSize","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.UserRead"},"type":"array"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"List users","tags":["User"]}},"/v2/users/{userId}":{"get":{"description":"Get user","parameters":[{"description":"User ID","in":"path","name":"userId","required":true,"schema":{"type":"string"}},{"description":"Discovery mode","in":"query","name":"discover","schema":{"type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.UserRead"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Get user","tags":["User"]},"post":{"description":"Update user","parameters":[{"description":"User ID","in":"path","name":"userId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.UserUpdate"}}},"description":"User update","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.UserRead"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Update user","tags":["User"]}},"/v2/users/{userId}/apiKeys":{"post":{"description":"Create API key","parameters":[{"description":"User ID","in":"path","name":"userId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.ApiKeyCreate"}}},"description":"API key create body","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.ApiKeyCreated"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Create API key","tags":["User"]}},"/v2/vmActions":{"post":{"description":"Creates a new action","parameters":[{"description":"VM ID","in":"path","name":"vmId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.VmActionCreate"}}},"description":"actions body","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.VmActionCreated"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Creates a new action","tags":["VmAction"]}},"/v2/vms":{"get":{"description":"List VMs","parameters":[{"description":"List all","in":"query","name":"all","schema":{"type":"boolean"}},{"description":"Filter by user ID","in":"query","name":"userId","schema":{"type":"string"}},{"description":"Page number","in":"query","name":"page","schema":{"type":"integer"}},{"description":"Number of items per page","in":"query","name":"pageSize","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.VmRead"},"type":"array"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"List VMs","tags":["VM"]},"post":{"description":"Create VM","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.VmCreate"}}},"description":"VM body","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.VmCreated"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Create VM","tags":["VM"]}},"/v2/vms/{vmId}":{"delete":{"description":"Delete VM","parameters":[{"description":"VM ID","in":"path","name":"vmId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.VmDeleted"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Delete VM","tags":["VM"]},"get":{"description":"Get VM","parameters":[{"description":"VM ID","in":"path","name":"vmId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.VmRead"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Get VM","tags":["VM"]},"post":{"description":"Update VM","parameters":[{"description":"VM ID","in":"path","name":"vmId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.VmUpdate"}}},"description":"VM update","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.VmUpdated"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Update VM","tags":["VM"]}},"/v2/vms/{vmId}/snapshot/{snapshotId}":{"delete":{"description":"Delete snapshot","parameters":[{"description":"VM ID","in":"path","name":"vmId","required":true,"schema":{"type":"string"}},{"description":"Snapshot ID","in":"path","name":"snapshotId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.VmSnapshotDeleted"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Delete snapshot","tags":["Snapshot"]},"post":{"description":"Get snapshot","parameters":[{"description":"VM ID","in":"path","name":"vmId","required":true,"schema":{"type":"string"}},{"description":"Snapshot ID","in":"path","name":"snapshotId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.VmSnapshotRead"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Get snapshot","tags":["Snapshot"]}},"/v2/workerStatus":{"get":{"description":"List of worker status","responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.WorkerStatusRead"},"type":"array"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"List worker status","tags":["Status"]}},"/v2/zones":{"get":{"description":"List zones","responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.ZoneRead"},"type":"array"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"List zones","tags":["Zone"]}}}, diff --git a/docs/api/v2/V2_swagger.json b/docs/api/v2/V2_swagger.json index bd5358b1..d9eef331 100644 --- a/docs/api/v2/V2_swagger.json +++ b/docs/api/v2/V2_swagger.json @@ -1,5 +1,5 @@ { - "components": {"schemas":{"body.ApiKey":{"properties":{"createdAt":{"type":"string"},"expiresAt":{"type":"string"},"name":{"type":"string"}},"type":"object"},"body.ApiKeyCreate":{"properties":{"expiresAt":{"type":"string"},"name":{"type":"string"}},"required":["expiresAt","name"],"type":"object"},"body.ApiKeyCreated":{"properties":{"createdAt":{"type":"string"},"expiresAt":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"}},"type":"object"},"body.BindingError":{"properties":{"validationErrors":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object"}},"type":"object"},"body.CiConfig":{"properties":{"config":{"type":"string"}},"type":"object"},"body.ClusterCapacities":{"properties":{"cluster":{"type":"string"},"cpuCore":{"$ref":"#/components/schemas/body.CpuCoreCapacities"},"gpu":{"$ref":"#/components/schemas/body.GpuCapacities"},"ram":{"$ref":"#/components/schemas/body.RamCapacities"}},"type":"object"},"body.ClusterStats":{"properties":{"cluster":{"type":"string"},"podCount":{"type":"integer"}},"type":"object"},"body.CpuCoreCapacities":{"description":"Total","properties":{"total":{"type":"integer"}},"type":"object"},"body.CpuStatus":{"properties":{"load":{"$ref":"#/components/schemas/body.CpuStatusLoad"},"temp":{"$ref":"#/components/schemas/body.CpuStatusTemp"}},"type":"object"},"body.CpuStatusLoad":{"properties":{"cores":{"items":{"type":"integer"},"type":"array","uniqueItems":false},"main":{"type":"number"},"max":{"type":"number"}},"type":"object"},"body.CpuStatusTemp":{"properties":{"cores":{"items":{"type":"integer"},"type":"array","uniqueItems":false},"main":{"type":"number"},"max":{"type":"number"}},"type":"object"},"body.CustomDomainRead":{"properties":{"domain":{"type":"string"},"secret":{"type":"string"},"status":{"type":"string"},"url":{"type":"string"}},"type":"object"},"body.DeploymentCommand":{"properties":{"command":{"enum":["restart"],"type":"string"}},"required":["command"],"type":"object"},"body.DeploymentCreate":{"properties":{"args":{"items":{"type":"string"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"cpuCores":{"type":"number"},"customDomain":{"description":"CustomDomain is the domain that the deployment will be available on.\nThe max length is set to 243 to allow for a subdomain when confirming the domain.","type":"string"},"envs":{"items":{"$ref":"#/components/schemas/body.Env"},"maxItems":1000,"minItems":0,"type":"array","uniqueItems":false},"healthCheckPath":{"maxLength":1000,"minLength":0,"type":"string"},"image":{"maxLength":1000,"minLength":1,"type":"string"},"initCommands":{"items":{"type":"string"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"name":{"maxLength":30,"minLength":3,"type":"string"},"neverStale":{"description":"Boolean to make deployment never get disabled, despite being stale","type":"boolean"},"private":{"description":"Deprecated: Use Visibility instead.","type":"boolean"},"ram":{"type":"number"},"replicas":{"maximum":100,"minimum":0,"type":"integer"},"visibility":{"enum":["public","private","auth"],"type":"string"},"volumes":{"items":{"$ref":"#/components/schemas/body.Volume"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"zone":{"description":"Zone is the zone that the deployment will be created in.\nIf the zone is not set, the deployment will be created in the default zone.","type":"string"}},"required":["name"],"type":"object"},"body.DeploymentCreated":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.DeploymentRead":{"properties":{"accessedAt":{"type":"string"},"args":{"items":{"type":"string"},"type":"array","uniqueItems":false},"createdAt":{"type":"string"},"customDomain":{"$ref":"#/components/schemas/body.CustomDomainRead"},"envs":{"items":{"$ref":"#/components/schemas/body.Env"},"type":"array","uniqueItems":false},"error":{"type":"string"},"healthCheckPath":{"type":"string"},"id":{"type":"string"},"image":{"type":"string"},"initCommands":{"items":{"type":"string"},"type":"array","uniqueItems":false},"integrations":{"description":"Integrations are currently not used, but could be used if we wanted to add a list of integrations to the deployment\n\nFor example GitHub","items":{"type":"string"},"type":"array","uniqueItems":false},"internalPort":{"type":"integer"},"name":{"type":"string"},"neverStale":{"type":"boolean"},"ownerId":{"type":"string"},"pingResult":{"type":"integer"},"private":{"description":"Deprecated: Use Visibility instead.","type":"boolean"},"repairedAt":{"type":"string"},"replicaStatus":{"$ref":"#/components/schemas/body.ReplicaStatus"},"restartedAt":{"type":"string"},"specs":{"$ref":"#/components/schemas/body.DeploymentSpecs"},"status":{"type":"string"},"storageUrl":{"type":"string"},"teams":{"items":{"type":"string"},"type":"array","uniqueItems":false},"type":{"type":"string"},"updatedAt":{"type":"string"},"url":{"type":"string"},"visibility":{"type":"string"},"volumes":{"items":{"$ref":"#/components/schemas/body.Volume"},"type":"array","uniqueItems":false},"zone":{"type":"string"}},"type":"object"},"body.DeploymentSpecs":{"properties":{"cpuCores":{"type":"number"},"ram":{"type":"number"},"replicas":{"type":"integer"}},"type":"object"},"body.DeploymentUpdate":{"properties":{"args":{"items":{"type":"string"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"cpuCores":{"type":"number"},"customDomain":{"description":"CustomDomain is the domain that the deployment will be available on.\nThe max length is set to 243 to allow for a subdomain when confirming the domain.","type":"string"},"envs":{"items":{"$ref":"#/components/schemas/body.Env"},"maxItems":1000,"minItems":0,"type":"array","uniqueItems":false},"healthCheckPath":{"maxLength":1000,"minLength":0,"type":"string"},"image":{"maxLength":1000,"minLength":1,"type":"string"},"initCommands":{"items":{"type":"string"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"name":{"maxLength":30,"minLength":3,"type":"string"},"neverStale":{"type":"boolean"},"private":{"description":"Deprecated: Use Visibility instead.","type":"boolean"},"ram":{"type":"number"},"replicas":{"maximum":100,"minimum":0,"type":"integer"},"visibility":{"enum":["public","private","auth"],"type":"string"},"volumes":{"items":{"$ref":"#/components/schemas/body.Volume"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false}},"required":["name"],"type":"object"},"body.DeploymentUpdated":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.DiscoverRead":{"properties":{"roles":{"items":{"$ref":"#/components/schemas/body.Role"},"type":"array","uniqueItems":false},"version":{"type":"string"}},"type":"object"},"body.Env":{"properties":{"name":{"maxLength":100,"minLength":1,"type":"string"},"value":{"maxLength":10000,"minLength":1,"type":"string"}},"required":["name","value"],"type":"object"},"body.GpuCapacities":{"properties":{"total":{"type":"integer"}},"type":"object"},"body.GpuGroupRead":{"properties":{"available":{"type":"integer"},"displayName":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"total":{"type":"integer"},"vendor":{"type":"string"},"zone":{"type":"string"}},"type":"object"},"body.GpuLeaseCreate":{"properties":{"gpuGroupId":{"description":"GpuGroupID is used to specify the GPU to lease.\nAs such, the lease does not specify which specific GPU to lease, but rather the type of GPU to lease.","type":"string"},"leaseForever":{"description":"LeaseForever is used to specify whether the lease should be created forever.","type":"boolean"}},"required":["gpuGroupId"],"type":"object"},"body.GpuLeaseCreated":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.GpuLeaseDeleted":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.GpuLeaseRead":{"properties":{"activatedAt":{"description":"ActivatedAt specifies the time when the lease was activated. This is the time the user first attached the GPU\nor 1 day after the lease was created if the user did not attach the GPU.","type":"string"},"active":{"type":"boolean"},"assignedAt":{"description":"AssignedAt specifies the time when the lease was assigned to the user.","type":"string"},"createdAt":{"type":"string"},"expiredAt":{"type":"string"},"expiresAt":{"description":"ExpiresAt specifies the time when the lease will expire.\nThis is only present if the lease is active.","type":"string"},"gpuGroupId":{"type":"string"},"id":{"type":"string"},"leaseDuration":{"type":"number"},"queuePosition":{"type":"integer"},"userId":{"type":"string"},"vmId":{"description":"VmID is set when the lease is attached to a VM.","type":"string"}},"type":"object"},"body.GpuLeaseUpdate":{"properties":{"vmId":{"description":"VmID is used to specify the VM to attach the lease to.\n\n- If specified, the lease will be attached to the VM.\n\n- If the lease is already attached to a VM, it will be detached from the current VM and attached to the new VM.\n\n- If the lease is not active, specifying a VM will activate the lease.\n\n- If the lease is not assigned, an error will be returned.","type":"string"}},"type":"object"},"body.GpuLeaseUpdated":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.GpuStatus":{"properties":{"temp":{"items":{"$ref":"#/components/schemas/body.GpuStatusTemp"},"type":"array","uniqueItems":false}},"type":"object"},"body.GpuStatusTemp":{"properties":{"main":{"type":"number"}},"type":"object"},"body.HarborWebhook":{"properties":{"event_data":{"properties":{"repository":{"properties":{"date_created":{"type":"integer"},"name":{"type":"string"},"namespace":{"type":"string"},"repo_full_name":{"type":"string"},"repo_type":{"type":"string"}},"type":"object"},"resources":{"items":{"properties":{"digest":{"type":"string"},"resource_url":{"type":"string"},"tag":{"type":"string"}},"type":"object"},"type":"array","uniqueItems":false}},"type":"object"},"occur_at":{"type":"integer"},"operator":{"type":"string"},"type":{"type":"string"}},"type":"object"},"body.HostCapacities":{"properties":{"cpuCore":{"$ref":"#/components/schemas/body.CpuCoreCapacities"},"displayName":{"type":"string"},"gpu":{"$ref":"#/components/schemas/body.GpuCapacities"},"name":{"type":"string"},"ram":{"$ref":"#/components/schemas/body.RamCapacities"},"zone":{"description":"Zone is the name of the zone where the host is located.","type":"string"}},"type":"object"},"body.HostRead":{"properties":{"displayName":{"type":"string"},"name":{"type":"string"},"zone":{"description":"Zone is the name of the zone where the host is located.","type":"string"}},"type":"object"},"body.HostStatus":{"properties":{"cpu":{"$ref":"#/components/schemas/body.CpuStatus"},"displayName":{"type":"string"},"gpu":{"$ref":"#/components/schemas/body.GpuStatus"},"name":{"type":"string"},"ram":{"$ref":"#/components/schemas/body.RamStatus"},"zone":{"description":"Zone is the name of the zone where the host is located.","type":"string"}},"type":"object"},"body.HostVerboseRead":{"properties":{"deactivatedUntil":{"type":"string"},"displayName":{"type":"string"},"enabled":{"type":"boolean"},"ip":{"type":"string"},"lastSeenAt":{"type":"string"},"name":{"type":"string"},"port":{"type":"integer"},"registeredAt":{"type":"string"},"schedulable":{"type":"boolean"},"zone":{"description":"Zone is the name of the zone where the host is located.","type":"string"}},"type":"object"},"body.HttpProxyCreate":{"properties":{"customDomain":{"description":"CustomDomain is the domain that the deployment will be available on.\nThe max length is set to 243 to allow for a subdomain when confirming the domain.","type":"string"},"name":{"maxLength":30,"minLength":3,"type":"string"}},"required":["name"],"type":"object"},"body.HttpProxyRead":{"properties":{"customDomain":{"$ref":"#/components/schemas/body.CustomDomainRead"},"name":{"type":"string"},"url":{"type":"string"}},"type":"object"},"body.HttpProxyUpdate":{"properties":{"customDomain":{"description":"CustomDomain is the domain that the deployment will be available on.\nThe max length is set to 243 to allow for a subdomain when confirming the domain.","type":"string"},"name":{"maxLength":30,"minLength":3,"type":"string"}},"required":["name"],"type":"object"},"body.JobRead":{"properties":{"createdAt":{"type":"string"},"finishedAt":{"type":"string"},"id":{"type":"string"},"lastError":{"type":"string"},"lastRunAt":{"type":"string"},"runAfter":{"type":"string"},"status":{"type":"string"},"type":{"type":"string"},"userId":{"type":"string"}},"type":"object"},"body.JobUpdate":{"properties":{"status":{"enum":["pending","running","failed","terminated","finished","completed"],"type":"string"}},"type":"object"},"body.K8sStats":{"properties":{"clusters":{"items":{"$ref":"#/components/schemas/body.ClusterStats"},"type":"array","uniqueItems":false},"podCount":{"type":"integer"}},"type":"object"},"body.NotificationRead":{"properties":{"completedAt":{"type":"string"},"content":{"additionalProperties":{},"type":"object"},"createdAt":{"type":"string"},"id":{"type":"string"},"readAt":{"type":"string"},"toastedAt":{"type":"string"},"type":{"type":"string"},"userId":{"type":"string"}},"type":"object"},"body.NotificationUpdate":{"properties":{"read":{"type":"boolean"},"toasted":{"type":"boolean"}},"type":"object"},"body.PortCreate":{"properties":{"httpProxy":{"$ref":"#/components/schemas/body.HttpProxyCreate"},"name":{"maxLength":100,"minLength":1,"type":"string"},"port":{"maximum":65535,"minimum":1,"type":"integer"},"protocol":{"enum":["tcp","udp"],"type":"string"}},"required":["name","port","protocol"],"type":"object"},"body.PortRead":{"properties":{"externalPort":{"type":"integer"},"httpProxy":{"$ref":"#/components/schemas/body.HttpProxyRead"},"name":{"type":"string"},"port":{"type":"integer"},"protocol":{"type":"string"}},"type":"object"},"body.PortUpdate":{"properties":{"httpProxy":{"$ref":"#/components/schemas/body.HttpProxyUpdate"},"name":{"maxLength":100,"minLength":1,"type":"string"},"port":{"maximum":65535,"minimum":1,"type":"integer"},"protocol":{"enum":["tcp","udp"],"type":"string"}},"required":["name","port","protocol"],"type":"object"},"body.PublicKey":{"properties":{"key":{"type":"string"},"name":{"maxLength":30,"minLength":1,"type":"string"}},"required":["key","name"],"type":"object"},"body.Quota":{"properties":{"cpuCores":{"type":"number"},"diskSize":{"type":"number"},"gpuLeaseDuration":{"description":"in hours","type":"number"},"ram":{"type":"number"},"snapshots":{"type":"integer"}},"type":"object"},"body.RamCapacities":{"properties":{"total":{"type":"integer"}},"type":"object"},"body.RamStatus":{"properties":{"load":{"$ref":"#/components/schemas/body.RamStatusLoad"}},"type":"object"},"body.RamStatusLoad":{"properties":{"main":{"type":"number"}},"type":"object"},"body.ReplicaStatus":{"properties":{"availableReplicas":{"description":"AvailableReplicas is the number of replicas that are available.","type":"integer"},"desiredReplicas":{"description":"DesiredReplicas is the number of replicas that the deployment should have.","type":"integer"},"readyReplicas":{"description":"ReadyReplicas is the number of replicas that are ready.","type":"integer"},"unavailableReplicas":{"description":"UnavailableReplicas is the number of replicas that are unavailable.","type":"integer"}},"type":"object"},"body.ResourceMigrationCreate":{"properties":{"resourceId":{"description":"ResourceID is the ID of the resource that is being migrated.\nThis can be a VM ID, deployment ID, etc. depending on the type of the migration.","type":"string"},"status":{"description":"Status is the status of the resource migration.\nIt is used by privileged admins to directly accept or reject a migration.\nThe field is ignored by non-admins.\n\nPossible values:\n- accepted\n- pending","type":"string"},"type":{"description":"Type is the type of the resource migration.\n\nPossible values:\n- updateOwner","enum":["updateOwner"],"type":"string"},"updateOwner":{"description":"UpdateOwner is the set of parameters that are required for the updateOwner migration type.\nIt is ignored if the migration type is not updateOwner.","properties":{"ownerId":{"type":"string"}},"required":["ownerId"],"type":"object"}},"required":["resourceId","type"],"type":"object"},"body.ResourceMigrationCreated":{"properties":{"createdAt":{"type":"string"},"deletedAt":{"type":"string"},"id":{"type":"string"},"jobId":{"description":"JobID is the ID of the job that was created for the resource migration.\nIt will only be set if the migration was created with status 'accepted'.","type":"string"},"resourceId":{"description":"ResourceID is the ID of the resource that is being migrated.\nThis can be a VM ID, deployment ID, etc. depending on the type of the migration.","type":"string"},"resourceType":{"description":"ResourceType is the type of the resource that is being migrated.\n\nPossible values:\n- vm\n- deployment","type":"string"},"status":{"description":"Status is the status of the resource migration.\nWhen this field is set to 'accepted', the migration will take place and then automatically be deleted.","type":"string"},"type":{"description":"Type is the type of the resource migration.\n\nPossible values:\n- updateOwner","type":"string"},"updateOwner":{"description":"UpdateOwner is the set of parameters that are required for the updateOwner migration type.\nIt is empty if the migration type is not updateOwner.","properties":{"ownerId":{"type":"string"}},"type":"object"},"userId":{"description":"UserID is the ID of the user who initiated the migration.","type":"string"}},"type":"object"},"body.ResourceMigrationRead":{"properties":{"createdAt":{"type":"string"},"deletedAt":{"type":"string"},"id":{"type":"string"},"resourceId":{"description":"ResourceID is the ID of the resource that is being migrated.\nThis can be a VM ID, deployment ID, etc. depending on the type of the migration.","type":"string"},"resourceType":{"description":"ResourceType is the type of the resource that is being migrated.\n\nPossible values:\n- vm\n- deployment","type":"string"},"status":{"description":"Status is the status of the resource migration.\nWhen this field is set to 'accepted', the migration will take place and then automatically be deleted.","type":"string"},"type":{"description":"Type is the type of the resource migration.\n\nPossible values:\n- updateOwner","type":"string"},"updateOwner":{"description":"UpdateOwner is the set of parameters that are required for the updateOwner migration type.\nIt is empty if the migration type is not updateOwner.","properties":{"ownerId":{"type":"string"}},"type":"object"},"userId":{"description":"UserID is the ID of the user who initiated the migration.","type":"string"}},"type":"object"},"body.ResourceMigrationUpdate":{"properties":{"code":{"description":"Code is a token required when accepting a migration if the acceptor is not an admin.\nIt is sent to the acceptor using the notification API","type":"string"},"status":{"description":"Status is the status of the resource migration.\nIt is used to accept a migration by setting the status to 'accepted'.\nIf the acceptor is not an admin, a Code must be provided.\n\nPossible values:\n- accepted\n- pending","type":"string"}},"required":["status"],"type":"object"},"body.ResourceMigrationUpdated":{"properties":{"createdAt":{"type":"string"},"deletedAt":{"type":"string"},"id":{"type":"string"},"jobId":{"description":"JobID is the ID of the job that was created for the resource migration.\nIt will only be set if the migration was updated with status 'accepted'.","type":"string"},"resourceId":{"description":"ResourceID is the ID of the resource that is being migrated.\nThis can be a VM ID, deployment ID, etc. depending on the type of the migration.","type":"string"},"resourceType":{"description":"ResourceType is the type of the resource that is being migrated.\n\nPossible values:\n- vm\n- deployment","type":"string"},"status":{"description":"Status is the status of the resource migration.\nWhen this field is set to 'accepted', the migration will take place and then automatically be deleted.","type":"string"},"type":{"description":"Type is the type of the resource migration.\n\nPossible values:\n- updateOwner","type":"string"},"updateOwner":{"description":"UpdateOwner is the set of parameters that are required for the updateOwner migration type.\nIt is empty if the migration type is not updateOwner.","properties":{"ownerId":{"type":"string"}},"type":"object"},"userId":{"description":"UserID is the ID of the user who initiated the migration.","type":"string"}},"type":"object"},"body.Role":{"properties":{"description":{"type":"string"},"name":{"type":"string"},"permissions":{"items":{"type":"string"},"type":"array","uniqueItems":false},"quota":{"$ref":"#/components/schemas/body.Quota"}},"type":"object"},"body.SmDeleted":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.SmRead":{"properties":{"createdAt":{"type":"string"},"id":{"type":"string"},"ownerId":{"type":"string"},"url":{"type":"string"},"zone":{"type":"string"}},"type":"object"},"body.SystemCapacities":{"properties":{"clusters":{"description":"Per Cluster","items":{"$ref":"#/components/schemas/body.ClusterCapacities"},"type":"array","uniqueItems":false},"cpuCore":{"$ref":"#/components/schemas/body.CpuCoreCapacities"},"gpu":{"$ref":"#/components/schemas/body.GpuCapacities"},"hosts":{"description":"Per Host","items":{"$ref":"#/components/schemas/body.HostCapacities"},"type":"array","uniqueItems":false},"ram":{"$ref":"#/components/schemas/body.RamCapacities"}},"type":"object"},"body.SystemStats":{"properties":{"k8s":{"$ref":"#/components/schemas/body.K8sStats"}},"type":"object"},"body.SystemStatus":{"properties":{"hosts":{"items":{"$ref":"#/components/schemas/body.HostStatus"},"type":"array","uniqueItems":false}},"type":"object"},"body.TeamCreate":{"properties":{"description":{"maxLength":1000,"type":"string"},"members":{"items":{"$ref":"#/components/schemas/body.TeamMemberCreate"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"name":{"maxLength":100,"minLength":1,"type":"string"},"resources":{"items":{"type":"string"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false}},"required":["name"],"type":"object"},"body.TeamMember":{"properties":{"addedAt":{"type":"string"},"email":{"type":"string"},"firstName":{"type":"string"},"gravatarUrl":{"type":"string"},"id":{"type":"string"},"joinedAt":{"type":"string"},"lastName":{"type":"string"},"memberStatus":{"type":"string"},"teamRole":{"type":"string"},"username":{"type":"string"}},"type":"object"},"body.TeamMemberCreate":{"properties":{"id":{"type":"string"},"teamRole":{"description":"default to MemberRoleAdmin right now","type":"string"}},"required":["id"],"type":"object"},"body.TeamMemberUpdate":{"properties":{"id":{"type":"string"},"teamRole":{"description":"default to MemberRoleAdmin right now","type":"string"}},"required":["id"],"type":"object"},"body.TeamRead":{"properties":{"createdAt":{"type":"string"},"description":{"type":"string"},"id":{"type":"string"},"members":{"items":{"$ref":"#/components/schemas/body.TeamMember"},"type":"array","uniqueItems":false},"name":{"type":"string"},"ownerId":{"type":"string"},"resources":{"items":{"$ref":"#/components/schemas/body.TeamResource"},"type":"array","uniqueItems":false},"updatedAt":{"type":"string"}},"type":"object"},"body.TeamResource":{"properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"}},"type":"object"},"body.TeamUpdate":{"properties":{"description":{"maxLength":1000,"type":"string"},"members":{"items":{"$ref":"#/components/schemas/body.TeamMemberUpdate"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"name":{"maxLength":100,"minLength":1,"type":"string"},"resources":{"items":{"type":"string"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false}},"type":"object"},"body.TimestampedSystemCapacities":{"properties":{"capacities":{"$ref":"#/components/schemas/body.SystemCapacities"},"timestamp":{"type":"string"}},"type":"object"},"body.TimestampedSystemStats":{"properties":{"stats":{"$ref":"#/components/schemas/body.SystemStats"},"timestamp":{"type":"string"}},"type":"object"},"body.TimestampedSystemStatus":{"properties":{"status":{"$ref":"#/components/schemas/body.SystemStatus"},"timestamp":{"type":"string"}},"type":"object"},"body.Usage":{"properties":{"cpuCores":{"type":"number"},"diskSize":{"type":"integer"},"ram":{"type":"number"}},"type":"object"},"body.UserData":{"properties":{"key":{"maxLength":255,"minLength":1,"type":"string"},"value":{"maxLength":255,"minLength":1,"type":"string"}},"required":["key","value"],"type":"object"},"body.UserRead":{"properties":{"admin":{"type":"boolean"},"apiKeys":{"items":{"$ref":"#/components/schemas/body.ApiKey"},"type":"array","uniqueItems":false},"email":{"type":"string"},"firstName":{"type":"string"},"gravatarUrl":{"type":"string"},"id":{"type":"string"},"lastName":{"type":"string"},"publicKeys":{"items":{"$ref":"#/components/schemas/body.PublicKey"},"type":"array","uniqueItems":false},"quota":{"$ref":"#/components/schemas/body.Quota"},"role":{"$ref":"#/components/schemas/body.Role"},"storageUrl":{"type":"string"},"usage":{"$ref":"#/components/schemas/body.Usage"},"userData":{"items":{"$ref":"#/components/schemas/body.UserData"},"type":"array","uniqueItems":false},"username":{"type":"string"}},"type":"object"},"body.UserUpdate":{"properties":{"apiKeys":{"description":"ApiKeys specifies the API keys that should remain. If an API key is not in this list, it will be deleted.\nHowever, API keys cannot be created, use /apiKeys endpoint to create new API keys.","items":{"$ref":"#/components/schemas/body.ApiKey"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"publicKeys":{"items":{"$ref":"#/components/schemas/body.PublicKey"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"userData":{"items":{"$ref":"#/components/schemas/body.UserData"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false}},"type":"object"},"body.VmActionCreate":{"properties":{"action":{"enum":["start","stop","restart","repair"],"type":"string"}},"required":["action"],"type":"object"},"body.VmActionCreated":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.VmCreate":{"properties":{"cpuCores":{"minimum":1,"type":"integer"},"diskSize":{"minimum":10,"type":"integer"},"name":{"maxLength":30,"minLength":3,"type":"string"},"neverStale":{"type":"boolean"},"ports":{"items":{"$ref":"#/components/schemas/body.PortCreate"},"maxItems":10,"minItems":0,"type":"array","uniqueItems":false},"ram":{"minimum":1,"type":"integer"},"sshPublicKey":{"type":"string"},"zone":{"type":"string"}},"required":["cpuCores","diskSize","name","ram","sshPublicKey"],"type":"object"},"body.VmCreated":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.VmDeleted":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.VmGpuLease":{"properties":{"activatedAt":{"description":"ActivatedAt specifies the time when the lease was activated. This is the time the user first attached the GPU\nor 1 day after the lease was created if the user did not attach the GPU.","type":"string"},"assignedAt":{"description":"AssignedAt specifies the time when the lease was assigned to the user.","type":"string"},"createdAt":{"type":"string"},"expiredAt":{"description":"ExpiredAt specifies the time when the lease expired.\nThis is only present if the lease is expired.","type":"string"},"expiresAt":{"description":"ExpiresAt specifies the time when the lease will expire.\nThis is only present if the lease is active.","type":"string"},"gpuGroupId":{"type":"string"},"id":{"type":"string"},"leaseDuration":{"type":"number"}},"type":"object"},"body.VmRead":{"properties":{"accessedAt":{"type":"string"},"createdAt":{"type":"string"},"gpu":{"$ref":"#/components/schemas/body.VmGpuLease"},"host":{"type":"string"},"id":{"type":"string"},"internalName":{"type":"string"},"name":{"type":"string"},"neverStale":{"type":"boolean"},"ownerId":{"type":"string"},"ports":{"items":{"$ref":"#/components/schemas/body.PortRead"},"type":"array","uniqueItems":false},"repairedAt":{"type":"string"},"specs":{"$ref":"#/components/schemas/body.VmSpecs"},"sshConnectionString":{"type":"string"},"sshPublicKey":{"type":"string"},"status":{"type":"string"},"teams":{"items":{"type":"string"},"type":"array","uniqueItems":false},"updatedAt":{"type":"string"},"zone":{"type":"string"}},"type":"object"},"body.VmSnapshotCreated":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.VmSnapshotDeleted":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.VmSnapshotRead":{"properties":{"created":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"}},"type":"object"},"body.VmSpecs":{"properties":{"cpuCores":{"type":"integer"},"diskSize":{"type":"integer"},"ram":{"type":"integer"}},"type":"object"},"body.VmUpdate":{"properties":{"cpuCores":{"minimum":1,"type":"integer"},"name":{"maxLength":30,"minLength":3,"type":"string"},"neverStale":{"type":"boolean"},"ports":{"items":{"$ref":"#/components/schemas/body.PortUpdate"},"maxItems":10,"minItems":0,"type":"array","uniqueItems":false},"ram":{"minimum":1,"type":"integer"}},"type":"object"},"body.VmUpdated":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.Volume":{"properties":{"appPath":{"maxLength":255,"minLength":1,"type":"string"},"name":{"maxLength":30,"minLength":3,"type":"string"},"serverPath":{"maxLength":255,"minLength":1,"type":"string"}},"required":["appPath","name","serverPath"],"type":"object"},"body.WorkerStatusRead":{"properties":{"name":{"type":"string"},"reportedAt":{"type":"string"},"status":{"type":"string"}},"type":"object"},"body.ZoneEndpoints":{"properties":{"deployment":{"type":"string"},"storage":{"type":"string"},"vm":{"type":"string"},"vmApp":{"type":"string"}},"type":"object"},"body.ZoneRead":{"properties":{"capabilities":{"items":{"type":"string"},"type":"array","uniqueItems":false},"description":{"type":"string"},"enabled":{"type":"boolean"},"endpoints":{"$ref":"#/components/schemas/body.ZoneEndpoints"},"legacy":{"type":"boolean"},"name":{"type":"string"}},"type":"object"},"sys.Error":{"properties":{"code":{"type":"string"},"msg":{"type":"string"}},"type":"object"},"sys.ErrorResponse":{"properties":{"errors":{"items":{"$ref":"#/components/schemas/sys.Error"},"type":"array","uniqueItems":false}},"type":"object"}},"securitySchemes":{"ApiKeyAuth":{"in":"header","name":"X-Api-Key","type":"apiKey"},"KeycloakOAuth":{"flows":{"authorizationCode":{"authorizationUrl":"https://iam.cloud.cbh.kth.se/realms/cloud/protocol/openid-connect/auth","tokenUrl":"https://iam.cloud.cbh.kth.se/realms/cloud/protocol/openid-connect/token"}},"in":"header","type":"oauth2"}}}, + "components": {"schemas":{"body.ApiKey":{"properties":{"createdAt":{"type":"string"},"expiresAt":{"type":"string"},"name":{"type":"string"}},"type":"object"},"body.ApiKeyCreate":{"properties":{"expiresAt":{"type":"string"},"name":{"type":"string"}},"required":["expiresAt","name"],"type":"object"},"body.ApiKeyCreated":{"properties":{"createdAt":{"type":"string"},"expiresAt":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"}},"type":"object"},"body.BindingError":{"properties":{"validationErrors":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object"}},"type":"object"},"body.CiConfig":{"properties":{"config":{"type":"string"}},"type":"object"},"body.ClusterCapacities":{"properties":{"cluster":{"type":"string"},"cpuCore":{"$ref":"#/components/schemas/body.CpuCoreCapacities"},"gpu":{"$ref":"#/components/schemas/body.GpuCapacities"},"ram":{"$ref":"#/components/schemas/body.RamCapacities"}},"type":"object"},"body.ClusterStats":{"properties":{"cluster":{"type":"string"},"podCount":{"type":"integer"}},"type":"object"},"body.CpuCoreCapacities":{"description":"Total","properties":{"total":{"type":"integer"}},"type":"object"},"body.CpuStatus":{"properties":{"load":{"$ref":"#/components/schemas/body.CpuStatusLoad"},"temp":{"$ref":"#/components/schemas/body.CpuStatusTemp"}},"type":"object"},"body.CpuStatusLoad":{"properties":{"cores":{"items":{"type":"integer"},"type":"array","uniqueItems":false},"main":{"type":"number"},"max":{"type":"number"}},"type":"object"},"body.CpuStatusTemp":{"properties":{"cores":{"items":{"type":"integer"},"type":"array","uniqueItems":false},"main":{"type":"number"},"max":{"type":"number"}},"type":"object"},"body.CustomDomainRead":{"properties":{"domain":{"type":"string"},"secret":{"type":"string"},"status":{"type":"string"},"url":{"type":"string"}},"type":"object"},"body.DeploymentCommand":{"properties":{"command":{"enum":["restart"],"type":"string"}},"required":["command"],"type":"object"},"body.DeploymentCreate":{"properties":{"args":{"items":{"type":"string"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"cpuCores":{"type":"number"},"customDomain":{"description":"CustomDomain is the domain that the deployment will be available on.\nThe max length is set to 243 to allow for a subdomain when confirming the domain.","type":"string"},"envs":{"items":{"$ref":"#/components/schemas/body.Env"},"maxItems":1000,"minItems":0,"type":"array","uniqueItems":false},"healthCheckPath":{"maxLength":1000,"minLength":0,"type":"string"},"image":{"maxLength":1000,"minLength":1,"type":"string"},"initCommands":{"items":{"type":"string"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"name":{"maxLength":30,"minLength":3,"type":"string"},"neverStale":{"description":"Boolean to make deployment never get disabled, despite being stale","type":"boolean"},"private":{"description":"Deprecated: Use Visibility instead.","type":"boolean"},"ram":{"type":"number"},"replicas":{"maximum":100,"minimum":0,"type":"integer"},"visibility":{"enum":["public","private","auth"],"type":"string"},"volumes":{"items":{"$ref":"#/components/schemas/body.Volume"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"zone":{"description":"Zone is the zone that the deployment will be created in.\nIf the zone is not set, the deployment will be created in the default zone.","type":"string"}},"required":["name"],"type":"object"},"body.DeploymentCreated":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.DeploymentRead":{"properties":{"accessedAt":{"type":"string"},"args":{"items":{"type":"string"},"type":"array","uniqueItems":false},"createdAt":{"type":"string"},"customDomain":{"$ref":"#/components/schemas/body.CustomDomainRead"},"envs":{"items":{"$ref":"#/components/schemas/body.Env"},"type":"array","uniqueItems":false},"error":{"type":"string"},"healthCheckPath":{"type":"string"},"id":{"type":"string"},"image":{"type":"string"},"initCommands":{"items":{"type":"string"},"type":"array","uniqueItems":false},"integrations":{"description":"Integrations are currently not used, but could be used if we wanted to add a list of integrations to the deployment\n\nFor example GitHub","items":{"type":"string"},"type":"array","uniqueItems":false},"internalPort":{"type":"integer"},"internalPorts":{"items":{"type":"integer"},"type":"array","uniqueItems":false},"name":{"type":"string"},"neverStale":{"type":"boolean"},"ownerId":{"type":"string"},"pingResult":{"type":"integer"},"private":{"description":"Deprecated: Use Visibility instead.","type":"boolean"},"repairedAt":{"type":"string"},"replicaStatus":{"$ref":"#/components/schemas/body.ReplicaStatus"},"restartedAt":{"type":"string"},"specs":{"$ref":"#/components/schemas/body.DeploymentSpecs"},"status":{"type":"string"},"storageUrl":{"type":"string"},"teams":{"items":{"type":"string"},"type":"array","uniqueItems":false},"type":{"type":"string"},"updatedAt":{"type":"string"},"url":{"type":"string"},"visibility":{"type":"string"},"volumes":{"items":{"$ref":"#/components/schemas/body.Volume"},"type":"array","uniqueItems":false},"zone":{"type":"string"}},"type":"object"},"body.DeploymentSpecs":{"properties":{"cpuCores":{"type":"number"},"ram":{"type":"number"},"replicas":{"type":"integer"}},"type":"object"},"body.DeploymentUpdate":{"properties":{"args":{"items":{"type":"string"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"cpuCores":{"type":"number"},"customDomain":{"description":"CustomDomain is the domain that the deployment will be available on.\nThe max length is set to 243 to allow for a subdomain when confirming the domain.","type":"string"},"envs":{"items":{"$ref":"#/components/schemas/body.Env"},"maxItems":1000,"minItems":0,"type":"array","uniqueItems":false},"healthCheckPath":{"maxLength":1000,"minLength":0,"type":"string"},"image":{"maxLength":1000,"minLength":1,"type":"string"},"initCommands":{"items":{"type":"string"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"name":{"maxLength":30,"minLength":3,"type":"string"},"neverStale":{"type":"boolean"},"private":{"description":"Deprecated: Use Visibility instead.","type":"boolean"},"ram":{"type":"number"},"replicas":{"maximum":100,"minimum":0,"type":"integer"},"visibility":{"enum":["public","private","auth"],"type":"string"},"volumes":{"items":{"$ref":"#/components/schemas/body.Volume"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false}},"required":["name"],"type":"object"},"body.DeploymentUpdated":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.DiscoverRead":{"properties":{"roles":{"items":{"$ref":"#/components/schemas/body.Role"},"type":"array","uniqueItems":false},"version":{"type":"string"}},"type":"object"},"body.Env":{"properties":{"name":{"maxLength":100,"minLength":1,"type":"string"},"value":{"maxLength":10000,"minLength":1,"type":"string"}},"required":["name","value"],"type":"object"},"body.GpuCapacities":{"properties":{"total":{"type":"integer"}},"type":"object"},"body.GpuGroupRead":{"properties":{"available":{"type":"integer"},"displayName":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"total":{"type":"integer"},"vendor":{"type":"string"},"zone":{"type":"string"}},"type":"object"},"body.GpuLeaseCreate":{"properties":{"gpuGroupId":{"description":"GpuGroupID is used to specify the GPU to lease.\nAs such, the lease does not specify which specific GPU to lease, but rather the type of GPU to lease.","type":"string"},"leaseForever":{"description":"LeaseForever is used to specify whether the lease should be created forever.","type":"boolean"}},"required":["gpuGroupId"],"type":"object"},"body.GpuLeaseCreated":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.GpuLeaseDeleted":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.GpuLeaseRead":{"properties":{"activatedAt":{"description":"ActivatedAt specifies the time when the lease was activated. This is the time the user first attached the GPU\nor 1 day after the lease was created if the user did not attach the GPU.","type":"string"},"active":{"type":"boolean"},"assignedAt":{"description":"AssignedAt specifies the time when the lease was assigned to the user.","type":"string"},"createdAt":{"type":"string"},"expiredAt":{"type":"string"},"expiresAt":{"description":"ExpiresAt specifies the time when the lease will expire.\nThis is only present if the lease is active.","type":"string"},"gpuGroupId":{"type":"string"},"id":{"type":"string"},"leaseDuration":{"type":"number"},"queuePosition":{"type":"integer"},"userId":{"type":"string"},"vmId":{"description":"VmID is set when the lease is attached to a VM.","type":"string"}},"type":"object"},"body.GpuLeaseUpdate":{"properties":{"vmId":{"description":"VmID is used to specify the VM to attach the lease to.\n\n- If specified, the lease will be attached to the VM.\n\n- If the lease is already attached to a VM, it will be detached from the current VM and attached to the new VM.\n\n- If the lease is not active, specifying a VM will activate the lease.\n\n- If the lease is not assigned, an error will be returned.","type":"string"}},"type":"object"},"body.GpuLeaseUpdated":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.GpuStatus":{"properties":{"temp":{"items":{"$ref":"#/components/schemas/body.GpuStatusTemp"},"type":"array","uniqueItems":false}},"type":"object"},"body.GpuStatusTemp":{"properties":{"main":{"type":"number"}},"type":"object"},"body.HarborWebhook":{"properties":{"event_data":{"properties":{"repository":{"properties":{"date_created":{"type":"integer"},"name":{"type":"string"},"namespace":{"type":"string"},"repo_full_name":{"type":"string"},"repo_type":{"type":"string"}},"type":"object"},"resources":{"items":{"properties":{"digest":{"type":"string"},"resource_url":{"type":"string"},"tag":{"type":"string"}},"type":"object"},"type":"array","uniqueItems":false}},"type":"object"},"occur_at":{"type":"integer"},"operator":{"type":"string"},"type":{"type":"string"}},"type":"object"},"body.HostCapacities":{"properties":{"cpuCore":{"$ref":"#/components/schemas/body.CpuCoreCapacities"},"displayName":{"type":"string"},"gpu":{"$ref":"#/components/schemas/body.GpuCapacities"},"name":{"type":"string"},"ram":{"$ref":"#/components/schemas/body.RamCapacities"},"zone":{"description":"Zone is the name of the zone where the host is located.","type":"string"}},"type":"object"},"body.HostRead":{"properties":{"displayName":{"type":"string"},"name":{"type":"string"},"zone":{"description":"Zone is the name of the zone where the host is located.","type":"string"}},"type":"object"},"body.HostStatus":{"properties":{"cpu":{"$ref":"#/components/schemas/body.CpuStatus"},"displayName":{"type":"string"},"gpu":{"$ref":"#/components/schemas/body.GpuStatus"},"name":{"type":"string"},"ram":{"$ref":"#/components/schemas/body.RamStatus"},"zone":{"description":"Zone is the name of the zone where the host is located.","type":"string"}},"type":"object"},"body.HostVerboseRead":{"properties":{"deactivatedUntil":{"type":"string"},"displayName":{"type":"string"},"enabled":{"type":"boolean"},"ip":{"type":"string"},"lastSeenAt":{"type":"string"},"name":{"type":"string"},"port":{"type":"integer"},"registeredAt":{"type":"string"},"schedulable":{"type":"boolean"},"zone":{"description":"Zone is the name of the zone where the host is located.","type":"string"}},"type":"object"},"body.HttpProxyCreate":{"properties":{"customDomain":{"description":"CustomDomain is the domain that the deployment will be available on.\nThe max length is set to 243 to allow for a subdomain when confirming the domain.","type":"string"},"name":{"maxLength":30,"minLength":3,"type":"string"}},"required":["name"],"type":"object"},"body.HttpProxyRead":{"properties":{"customDomain":{"$ref":"#/components/schemas/body.CustomDomainRead"},"name":{"type":"string"},"url":{"type":"string"}},"type":"object"},"body.HttpProxyUpdate":{"properties":{"customDomain":{"description":"CustomDomain is the domain that the deployment will be available on.\nThe max length is set to 243 to allow for a subdomain when confirming the domain.","type":"string"},"name":{"maxLength":30,"minLength":3,"type":"string"}},"required":["name"],"type":"object"},"body.JobRead":{"properties":{"createdAt":{"type":"string"},"finishedAt":{"type":"string"},"id":{"type":"string"},"lastError":{"type":"string"},"lastRunAt":{"type":"string"},"runAfter":{"type":"string"},"status":{"type":"string"},"type":{"type":"string"},"userId":{"type":"string"}},"type":"object"},"body.JobUpdate":{"properties":{"status":{"enum":["pending","running","failed","terminated","finished","completed"],"type":"string"}},"type":"object"},"body.K8sStats":{"properties":{"clusters":{"items":{"$ref":"#/components/schemas/body.ClusterStats"},"type":"array","uniqueItems":false},"podCount":{"type":"integer"}},"type":"object"},"body.NotificationRead":{"properties":{"completedAt":{"type":"string"},"content":{"additionalProperties":{},"type":"object"},"createdAt":{"type":"string"},"id":{"type":"string"},"readAt":{"type":"string"},"toastedAt":{"type":"string"},"type":{"type":"string"},"userId":{"type":"string"}},"type":"object"},"body.NotificationUpdate":{"properties":{"read":{"type":"boolean"},"toasted":{"type":"boolean"}},"type":"object"},"body.PortCreate":{"properties":{"httpProxy":{"$ref":"#/components/schemas/body.HttpProxyCreate"},"name":{"maxLength":100,"minLength":1,"type":"string"},"port":{"maximum":65535,"minimum":1,"type":"integer"},"protocol":{"enum":["tcp","udp"],"type":"string"}},"required":["name","port","protocol"],"type":"object"},"body.PortRead":{"properties":{"externalPort":{"type":"integer"},"httpProxy":{"$ref":"#/components/schemas/body.HttpProxyRead"},"name":{"type":"string"},"port":{"type":"integer"},"protocol":{"type":"string"}},"type":"object"},"body.PortUpdate":{"properties":{"httpProxy":{"$ref":"#/components/schemas/body.HttpProxyUpdate"},"name":{"maxLength":100,"minLength":1,"type":"string"},"port":{"maximum":65535,"minimum":1,"type":"integer"},"protocol":{"enum":["tcp","udp"],"type":"string"}},"required":["name","port","protocol"],"type":"object"},"body.PublicKey":{"properties":{"key":{"type":"string"},"name":{"maxLength":30,"minLength":1,"type":"string"}},"required":["key","name"],"type":"object"},"body.Quota":{"properties":{"cpuCores":{"type":"number"},"diskSize":{"type":"number"},"gpuLeaseDuration":{"description":"in hours","type":"number"},"ram":{"type":"number"},"snapshots":{"type":"integer"}},"type":"object"},"body.RamCapacities":{"properties":{"total":{"type":"integer"}},"type":"object"},"body.RamStatus":{"properties":{"load":{"$ref":"#/components/schemas/body.RamStatusLoad"}},"type":"object"},"body.RamStatusLoad":{"properties":{"main":{"type":"number"}},"type":"object"},"body.ReplicaStatus":{"properties":{"availableReplicas":{"description":"AvailableReplicas is the number of replicas that are available.","type":"integer"},"desiredReplicas":{"description":"DesiredReplicas is the number of replicas that the deployment should have.","type":"integer"},"readyReplicas":{"description":"ReadyReplicas is the number of replicas that are ready.","type":"integer"},"unavailableReplicas":{"description":"UnavailableReplicas is the number of replicas that are unavailable.","type":"integer"}},"type":"object"},"body.ResourceMigrationCreate":{"properties":{"resourceId":{"description":"ResourceID is the ID of the resource that is being migrated.\nThis can be a VM ID, deployment ID, etc. depending on the type of the migration.","type":"string"},"status":{"description":"Status is the status of the resource migration.\nIt is used by privileged admins to directly accept or reject a migration.\nThe field is ignored by non-admins.\n\nPossible values:\n- accepted\n- pending","type":"string"},"type":{"description":"Type is the type of the resource migration.\n\nPossible values:\n- updateOwner","enum":["updateOwner"],"type":"string"},"updateOwner":{"description":"UpdateOwner is the set of parameters that are required for the updateOwner migration type.\nIt is ignored if the migration type is not updateOwner.","properties":{"ownerId":{"type":"string"}},"required":["ownerId"],"type":"object"}},"required":["resourceId","type"],"type":"object"},"body.ResourceMigrationCreated":{"properties":{"createdAt":{"type":"string"},"deletedAt":{"type":"string"},"id":{"type":"string"},"jobId":{"description":"JobID is the ID of the job that was created for the resource migration.\nIt will only be set if the migration was created with status 'accepted'.","type":"string"},"resourceId":{"description":"ResourceID is the ID of the resource that is being migrated.\nThis can be a VM ID, deployment ID, etc. depending on the type of the migration.","type":"string"},"resourceType":{"description":"ResourceType is the type of the resource that is being migrated.\n\nPossible values:\n- vm\n- deployment","type":"string"},"status":{"description":"Status is the status of the resource migration.\nWhen this field is set to 'accepted', the migration will take place and then automatically be deleted.","type":"string"},"type":{"description":"Type is the type of the resource migration.\n\nPossible values:\n- updateOwner","type":"string"},"updateOwner":{"description":"UpdateOwner is the set of parameters that are required for the updateOwner migration type.\nIt is empty if the migration type is not updateOwner.","properties":{"ownerId":{"type":"string"}},"type":"object"},"userId":{"description":"UserID is the ID of the user who initiated the migration.","type":"string"}},"type":"object"},"body.ResourceMigrationRead":{"properties":{"createdAt":{"type":"string"},"deletedAt":{"type":"string"},"id":{"type":"string"},"resourceId":{"description":"ResourceID is the ID of the resource that is being migrated.\nThis can be a VM ID, deployment ID, etc. depending on the type of the migration.","type":"string"},"resourceType":{"description":"ResourceType is the type of the resource that is being migrated.\n\nPossible values:\n- vm\n- deployment","type":"string"},"status":{"description":"Status is the status of the resource migration.\nWhen this field is set to 'accepted', the migration will take place and then automatically be deleted.","type":"string"},"type":{"description":"Type is the type of the resource migration.\n\nPossible values:\n- updateOwner","type":"string"},"updateOwner":{"description":"UpdateOwner is the set of parameters that are required for the updateOwner migration type.\nIt is empty if the migration type is not updateOwner.","properties":{"ownerId":{"type":"string"}},"type":"object"},"userId":{"description":"UserID is the ID of the user who initiated the migration.","type":"string"}},"type":"object"},"body.ResourceMigrationUpdate":{"properties":{"code":{"description":"Code is a token required when accepting a migration if the acceptor is not an admin.\nIt is sent to the acceptor using the notification API","type":"string"},"status":{"description":"Status is the status of the resource migration.\nIt is used to accept a migration by setting the status to 'accepted'.\nIf the acceptor is not an admin, a Code must be provided.\n\nPossible values:\n- accepted\n- pending","type":"string"}},"required":["status"],"type":"object"},"body.ResourceMigrationUpdated":{"properties":{"createdAt":{"type":"string"},"deletedAt":{"type":"string"},"id":{"type":"string"},"jobId":{"description":"JobID is the ID of the job that was created for the resource migration.\nIt will only be set if the migration was updated with status 'accepted'.","type":"string"},"resourceId":{"description":"ResourceID is the ID of the resource that is being migrated.\nThis can be a VM ID, deployment ID, etc. depending on the type of the migration.","type":"string"},"resourceType":{"description":"ResourceType is the type of the resource that is being migrated.\n\nPossible values:\n- vm\n- deployment","type":"string"},"status":{"description":"Status is the status of the resource migration.\nWhen this field is set to 'accepted', the migration will take place and then automatically be deleted.","type":"string"},"type":{"description":"Type is the type of the resource migration.\n\nPossible values:\n- updateOwner","type":"string"},"updateOwner":{"description":"UpdateOwner is the set of parameters that are required for the updateOwner migration type.\nIt is empty if the migration type is not updateOwner.","properties":{"ownerId":{"type":"string"}},"type":"object"},"userId":{"description":"UserID is the ID of the user who initiated the migration.","type":"string"}},"type":"object"},"body.Role":{"properties":{"description":{"type":"string"},"name":{"type":"string"},"permissions":{"items":{"type":"string"},"type":"array","uniqueItems":false},"quota":{"$ref":"#/components/schemas/body.Quota"}},"type":"object"},"body.SmDeleted":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.SmRead":{"properties":{"createdAt":{"type":"string"},"id":{"type":"string"},"ownerId":{"type":"string"},"url":{"type":"string"},"zone":{"type":"string"}},"type":"object"},"body.SystemCapacities":{"properties":{"clusters":{"description":"Per Cluster","items":{"$ref":"#/components/schemas/body.ClusterCapacities"},"type":"array","uniqueItems":false},"cpuCore":{"$ref":"#/components/schemas/body.CpuCoreCapacities"},"gpu":{"$ref":"#/components/schemas/body.GpuCapacities"},"hosts":{"description":"Per Host","items":{"$ref":"#/components/schemas/body.HostCapacities"},"type":"array","uniqueItems":false},"ram":{"$ref":"#/components/schemas/body.RamCapacities"}},"type":"object"},"body.SystemStats":{"properties":{"k8s":{"$ref":"#/components/schemas/body.K8sStats"}},"type":"object"},"body.SystemStatus":{"properties":{"hosts":{"items":{"$ref":"#/components/schemas/body.HostStatus"},"type":"array","uniqueItems":false}},"type":"object"},"body.TeamCreate":{"properties":{"description":{"maxLength":1000,"type":"string"},"members":{"items":{"$ref":"#/components/schemas/body.TeamMemberCreate"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"name":{"maxLength":100,"minLength":1,"type":"string"},"resources":{"items":{"type":"string"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false}},"required":["name"],"type":"object"},"body.TeamMember":{"properties":{"addedAt":{"type":"string"},"email":{"type":"string"},"firstName":{"type":"string"},"gravatarUrl":{"type":"string"},"id":{"type":"string"},"joinedAt":{"type":"string"},"lastName":{"type":"string"},"memberStatus":{"type":"string"},"teamRole":{"type":"string"},"username":{"type":"string"}},"type":"object"},"body.TeamMemberCreate":{"properties":{"id":{"type":"string"},"teamRole":{"description":"default to MemberRoleAdmin right now","type":"string"}},"required":["id"],"type":"object"},"body.TeamMemberUpdate":{"properties":{"id":{"type":"string"},"teamRole":{"description":"default to MemberRoleAdmin right now","type":"string"}},"required":["id"],"type":"object"},"body.TeamRead":{"properties":{"createdAt":{"type":"string"},"description":{"type":"string"},"id":{"type":"string"},"members":{"items":{"$ref":"#/components/schemas/body.TeamMember"},"type":"array","uniqueItems":false},"name":{"type":"string"},"ownerId":{"type":"string"},"resources":{"items":{"$ref":"#/components/schemas/body.TeamResource"},"type":"array","uniqueItems":false},"updatedAt":{"type":"string"}},"type":"object"},"body.TeamResource":{"properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"}},"type":"object"},"body.TeamUpdate":{"properties":{"description":{"maxLength":1000,"type":"string"},"members":{"items":{"$ref":"#/components/schemas/body.TeamMemberUpdate"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"name":{"maxLength":100,"minLength":1,"type":"string"},"resources":{"items":{"type":"string"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false}},"type":"object"},"body.TimestampedSystemCapacities":{"properties":{"capacities":{"$ref":"#/components/schemas/body.SystemCapacities"},"timestamp":{"type":"string"}},"type":"object"},"body.TimestampedSystemStats":{"properties":{"stats":{"$ref":"#/components/schemas/body.SystemStats"},"timestamp":{"type":"string"}},"type":"object"},"body.TimestampedSystemStatus":{"properties":{"status":{"$ref":"#/components/schemas/body.SystemStatus"},"timestamp":{"type":"string"}},"type":"object"},"body.Usage":{"properties":{"cpuCores":{"type":"number"},"diskSize":{"type":"integer"},"ram":{"type":"number"}},"type":"object"},"body.UserData":{"properties":{"key":{"maxLength":255,"minLength":1,"type":"string"},"value":{"maxLength":255,"minLength":1,"type":"string"}},"required":["key","value"],"type":"object"},"body.UserRead":{"properties":{"admin":{"type":"boolean"},"apiKeys":{"items":{"$ref":"#/components/schemas/body.ApiKey"},"type":"array","uniqueItems":false},"email":{"type":"string"},"firstName":{"type":"string"},"gravatarUrl":{"type":"string"},"id":{"type":"string"},"lastName":{"type":"string"},"publicKeys":{"items":{"$ref":"#/components/schemas/body.PublicKey"},"type":"array","uniqueItems":false},"quota":{"$ref":"#/components/schemas/body.Quota"},"role":{"$ref":"#/components/schemas/body.Role"},"storageUrl":{"type":"string"},"usage":{"$ref":"#/components/schemas/body.Usage"},"userData":{"items":{"$ref":"#/components/schemas/body.UserData"},"type":"array","uniqueItems":false},"username":{"type":"string"}},"type":"object"},"body.UserUpdate":{"properties":{"apiKeys":{"description":"ApiKeys specifies the API keys that should remain. If an API key is not in this list, it will be deleted.\nHowever, API keys cannot be created, use /apiKeys endpoint to create new API keys.","items":{"$ref":"#/components/schemas/body.ApiKey"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"publicKeys":{"items":{"$ref":"#/components/schemas/body.PublicKey"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false},"userData":{"items":{"$ref":"#/components/schemas/body.UserData"},"maxItems":100,"minItems":0,"type":"array","uniqueItems":false}},"type":"object"},"body.VmActionCreate":{"properties":{"action":{"enum":["start","stop","restart","repair"],"type":"string"}},"required":["action"],"type":"object"},"body.VmActionCreated":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.VmCreate":{"properties":{"cpuCores":{"minimum":1,"type":"integer"},"diskSize":{"minimum":10,"type":"integer"},"name":{"maxLength":30,"minLength":3,"type":"string"},"neverStale":{"type":"boolean"},"ports":{"items":{"$ref":"#/components/schemas/body.PortCreate"},"maxItems":10,"minItems":0,"type":"array","uniqueItems":false},"ram":{"minimum":1,"type":"integer"},"sshPublicKey":{"type":"string"},"zone":{"type":"string"}},"required":["cpuCores","diskSize","name","ram","sshPublicKey"],"type":"object"},"body.VmCreated":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.VmDeleted":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.VmGpuLease":{"properties":{"activatedAt":{"description":"ActivatedAt specifies the time when the lease was activated. This is the time the user first attached the GPU\nor 1 day after the lease was created if the user did not attach the GPU.","type":"string"},"assignedAt":{"description":"AssignedAt specifies the time when the lease was assigned to the user.","type":"string"},"createdAt":{"type":"string"},"expiredAt":{"description":"ExpiredAt specifies the time when the lease expired.\nThis is only present if the lease is expired.","type":"string"},"expiresAt":{"description":"ExpiresAt specifies the time when the lease will expire.\nThis is only present if the lease is active.","type":"string"},"gpuGroupId":{"type":"string"},"id":{"type":"string"},"leaseDuration":{"type":"number"}},"type":"object"},"body.VmRead":{"properties":{"accessedAt":{"type":"string"},"createdAt":{"type":"string"},"gpu":{"$ref":"#/components/schemas/body.VmGpuLease"},"host":{"type":"string"},"id":{"type":"string"},"internalName":{"type":"string"},"name":{"type":"string"},"neverStale":{"type":"boolean"},"ownerId":{"type":"string"},"ports":{"items":{"$ref":"#/components/schemas/body.PortRead"},"type":"array","uniqueItems":false},"repairedAt":{"type":"string"},"specs":{"$ref":"#/components/schemas/body.VmSpecs"},"sshConnectionString":{"type":"string"},"sshPublicKey":{"type":"string"},"status":{"type":"string"},"teams":{"items":{"type":"string"},"type":"array","uniqueItems":false},"updatedAt":{"type":"string"},"zone":{"type":"string"}},"type":"object"},"body.VmSnapshotCreated":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.VmSnapshotDeleted":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.VmSnapshotRead":{"properties":{"created":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"}},"type":"object"},"body.VmSpecs":{"properties":{"cpuCores":{"type":"integer"},"diskSize":{"type":"integer"},"ram":{"type":"integer"}},"type":"object"},"body.VmUpdate":{"properties":{"cpuCores":{"minimum":1,"type":"integer"},"name":{"maxLength":30,"minLength":3,"type":"string"},"neverStale":{"type":"boolean"},"ports":{"items":{"$ref":"#/components/schemas/body.PortUpdate"},"maxItems":10,"minItems":0,"type":"array","uniqueItems":false},"ram":{"minimum":1,"type":"integer"}},"type":"object"},"body.VmUpdated":{"properties":{"id":{"type":"string"},"jobId":{"type":"string"}},"type":"object"},"body.Volume":{"properties":{"appPath":{"maxLength":255,"minLength":1,"type":"string"},"name":{"maxLength":30,"minLength":3,"type":"string"},"serverPath":{"maxLength":255,"minLength":1,"type":"string"}},"required":["appPath","name","serverPath"],"type":"object"},"body.WorkerStatusRead":{"properties":{"name":{"type":"string"},"reportedAt":{"type":"string"},"status":{"type":"string"}},"type":"object"},"body.ZoneEndpoints":{"properties":{"deployment":{"type":"string"},"storage":{"type":"string"},"vm":{"type":"string"},"vmApp":{"type":"string"}},"type":"object"},"body.ZoneRead":{"properties":{"capabilities":{"items":{"type":"string"},"type":"array","uniqueItems":false},"description":{"type":"string"},"enabled":{"type":"boolean"},"endpoints":{"$ref":"#/components/schemas/body.ZoneEndpoints"},"legacy":{"type":"boolean"},"name":{"type":"string"}},"type":"object"},"sys.Error":{"properties":{"code":{"type":"string"},"msg":{"type":"string"}},"type":"object"},"sys.ErrorResponse":{"properties":{"errors":{"items":{"$ref":"#/components/schemas/sys.Error"},"type":"array","uniqueItems":false}},"type":"object"}},"securitySchemes":{"ApiKeyAuth":{"in":"header","name":"X-Api-Key","type":"apiKey"},"KeycloakOAuth":{"flows":{"authorizationCode":{"authorizationUrl":"https://iam.cloud.cbh.kth.se/realms/cloud/protocol/openid-connect/auth","tokenUrl":"https://iam.cloud.cbh.kth.se/realms/cloud/protocol/openid-connect/token"}},"in":"header","type":"oauth2"}}}, "info": {"contact":{"name":"Support","url":"https://github.com/kthcloud/go-deploy"},"description":"This is the API explorer for the go-deploy API. You can use it as a reference for the API endpoints.","license":{"name":"MIT License","url":"https://github.com/kthcloud/go-deploy?tab=MIT-1-ov-file#readme"},"termsOfService":"http://swagger.io/terms/","title":"go-deploy API","version":"1.0"}, "externalDocs": {"description":"","url":""}, "paths": {"/v2/deployments":{"get":{"description":"List deployments","parameters":[{"description":"List all","in":"query","name":"all","schema":{"type":"boolean"}},{"description":"Filter by user ID","in":"query","name":"userId","schema":{"type":"string"}},{"description":"Include shared","in":"query","name":"shared","schema":{"type":"boolean"}},{"description":"Page number","in":"query","name":"page","schema":{"type":"integer"}},{"description":"Number of items per page","in":"query","name":"pageSize","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.DeploymentRead"},"type":"array"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"List deployments","tags":["Deployment"]},"post":{"description":"Create deployment","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.DeploymentCreate"}}},"description":"Deployment body","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.DeploymentRead"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Create deployment","tags":["Deployment"]}},"/v2/deployments/{deploymentId}":{"delete":{"description":"Delete deployment","parameters":[{"description":"Deployment ID","in":"path","name":"deploymentId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.DeploymentCreated"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Delete deployment","tags":["Deployment"]},"get":{"description":"Get deployment","parameters":[{"description":"Deployment ID","in":"path","name":"deploymentId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.DeploymentRead"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Get deployment","tags":["Deployment"]},"post":{"description":"Update deployment","parameters":[{"description":"Deployment ID","in":"path","name":"deploymentId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.DeploymentUpdate"}}},"description":"Deployment update","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.DeploymentUpdated"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Update deployment","tags":["Deployment"]}},"/v2/deployments/{deploymentId}/ciConfig":{"get":{"description":"Get CI config","parameters":[{"description":"Deployment ID","in":"path","name":"deploymentId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.CiConfig"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Get CI config","tags":["Deployment"]}},"/v2/deployments/{deploymentId}/command":{"post":{"description":"Do command","parameters":[{"description":"Deployment ID","in":"path","name":"deploymentId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.DeploymentCommand"}}},"description":"Command body","required":true},"responses":{"204":{"description":"No Content"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Locked"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Do command","tags":["Deployment"]}},"/v2/deployments/{deploymentId}/logs":{"get":{"description":"Get logs using Server-Sent Events","parameters":[{"description":"Deployment ID","in":"path","name":"deploymentId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"string"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Get logs using Server-Sent Events","tags":["Deployment"]}},"/v2/discover":{"get":{"description":"Discover","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.DiscoverRead"}}},"description":"OK"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Discover","tags":["Discover"]}},"/v2/gpuGroups":{"get":{"description":"List GPU groups","parameters":[{"description":"Page number","in":"query","name":"page","schema":{"type":"integer"}},{"description":"Number of items per page","in":"query","name":"pageSize","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.GpuGroupRead"},"type":"array"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Locked"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"List GPU groups","tags":["GpuGroup"]}},"/v2/gpuGroups/{gpuGroupId}":{"get":{"description":"Get GPU group","parameters":[{"description":"GPU group ID","in":"path","name":"gpuGroupId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.GpuGroupRead"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Locked"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Get GPU group","tags":["GpuGroup"]}},"/v2/gpuLeases":{"get":{"description":"List GPU leases","parameters":[{"description":"List all","in":"query","name":"all","schema":{"type":"boolean"}},{"description":"Filter by VM ID","in":"query","name":"vmId","schema":{"type":"string"}},{"description":"Page number","in":"query","name":"page","schema":{"type":"integer"}},{"description":"Number of items per page","in":"query","name":"pageSize","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.GpuLeaseRead"},"type":"array"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Locked"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"List GPU leases","tags":["GpuLease"]},"post":{"description":"Create GPU lease","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.GpuLeaseCreate"}}},"description":"GPU lease","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.GpuLeaseCreated"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Create GPU Lease","tags":["GpuLease"]}},"/v2/gpuLeases/{gpuLeaseId}":{"delete":{"description":"Delete GPU lease","parameters":[{"description":"GPU lease ID","in":"path","name":"gpuLeaseId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.GpuLeaseDeleted"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Delete GPU lease","tags":["GpuLease"]},"get":{"description":"Get GPU lease","parameters":[{"description":"GPU lease ID","in":"path","name":"gpuLeaseId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.GpuLeaseRead"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Locked"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Get GPU lease","tags":["GpuLease"]},"post":{"description":"Update GPU lease","parameters":[{"description":"GPU lease ID","in":"path","name":"gpuLeaseId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.GpuLeaseUpdate"}}},"description":"GPU lease","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.GpuLeaseUpdated"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Update GPU lease","tags":["GpuLease"]}},"/v2/hooks/harbor":{"post":{"description":"Handle Harbor hook","parameters":[{"description":"Basic auth token","in":"header","name":"Authorization","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.HarborWebhook"}}},"description":"Harbor webhook body","required":true},"responses":{"204":{"description":"No Content"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Handle Harbor hook","tags":["Deployment"]}},"/v2/hosts":{"get":{"description":"List Hosts","responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.HostRead"},"type":"array"}}},"description":"OK"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"List Hosts","tags":["Host"]}},"/v2/hosts/verbose":{"get":{"description":"List Hosts verbose","responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.HostVerboseRead"},"type":"array"}}},"description":"OK"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Forbidden"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"List Hosts verbose","tags":["Host"]}},"/v2/jobs":{"get":{"description":"List jobs","parameters":[{"description":"List all","in":"query","name":"all","schema":{"type":"boolean"}},{"description":"Filter by user ID","in":"query","name":"userId","schema":{"type":"string"}},{"description":"Filter by type","in":"query","name":"type","schema":{"type":"string"}},{"description":"Filter by status","in":"query","name":"status","schema":{"type":"string"}},{"description":"Page number","in":"query","name":"page","schema":{"type":"integer"}},{"description":"Number of items per page","in":"query","name":"pageSize","schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.JobRead"},"type":"array"}}},"description":"OK"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"List jobs","tags":["Job"]}},"/v2/jobs/{jobId}":{"get":{"description":"GetJob job by id","parameters":[{"description":"Job ID","in":"path","name":"jobId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.JobRead"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"GetJob job by id","tags":["Job"]},"post":{"description":"Update job. Only allowed for admins.","parameters":[{"description":"Job ID","in":"path","name":"jobId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.JobUpdate"}}},"description":"Job update","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.JobRead"}}},"description":"OK"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Update job","tags":["Job"]}},"/v2/metrics":{"get":{"description":"Get metrics","responses":{"200":{"content":{"application/json":{"schema":{"type":"string"}}},"description":"OK"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Get metrics","tags":["Metrics"]}},"/v2/notifications":{"get":{"description":"List notifications","parameters":[{"description":"List all notifications","in":"query","name":"all","schema":{"type":"boolean"}},{"description":"Filter by user ID","in":"query","name":"userId","schema":{"type":"string"}},{"description":"Page number","in":"query","name":"page","schema":{"type":"integer"}},{"description":"Number of items per page","in":"query","name":"pageSize","schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.NotificationRead"},"type":"array"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"List notifications","tags":["Notification"]}},"/v2/notifications/{notificationId}":{"delete":{"description":"Delete notification","parameters":[{"description":"Notification ID","in":"path","name":"notificationId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Delete notification","tags":["Notification"]},"get":{"description":"Get notification","parameters":[{"description":"Notification ID","in":"path","name":"notificationId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.NotificationRead"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Get notification","tags":["Notification"]},"post":{"description":"Update notification","parameters":[{"description":"Notification ID","in":"path","name":"notificationId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.NotificationUpdate"}}},"description":"Notification update","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Update notification","tags":["Notification"]}},"/v2/register":{"get":{"description":"Register resource","responses":{"204":{"description":"No Content"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"Register resource","tags":["Register"]}},"/v2/resourceMigrations":{"get":{"description":"List resource migrations","parameters":[{"description":"Page number","in":"query","name":"page","schema":{"type":"integer"}},{"description":"Number of items per page","in":"query","name":"pageSize","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.ResourceMigrationRead"},"type":"array"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"List resource migrations","tags":["ResourceMigration"]},"post":{"description":"Create resource migration","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.ResourceMigrationCreate"}}},"description":"Resource Migration Create","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.ResourceMigrationCreated"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Create resource migration","tags":["ResourceMigration"]}},"/v2/resourceMigrations/{resourceMigrationId}":{"delete":{"description":"Delete resource migration","parameters":[{"description":"Resource Migration ID","in":"path","name":"resourceMigrationId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"204":{"description":"No Content"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Delete resource migration","tags":["ResourceMigration"]},"get":{"description":"Get resource migration","parameters":[{"description":"Resource Migration ID","in":"path","name":"resourceMigrationId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.ResourceMigrationRead"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Get resource migration","tags":["ResourceMigration"]},"post":{"description":"Update resource migration","parameters":[{"description":"Resource Migration ID","in":"path","name":"resourceMigrationId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.ResourceMigrationUpdate"}}},"description":"Resource Migration Update","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.ResourceMigrationUpdated"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Update resource migration","tags":["ResourceMigration"]}},"/v2/snapshots":{"get":{"description":"List snapshots","parameters":[{"description":"Filter by VM ID","in":"path","name":"vmId","required":true,"schema":{"type":"string"}},{"description":"Page number","in":"query","name":"page","schema":{"type":"integer"}},{"description":"Number of items per page","in":"query","name":"pageSize","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.VmSnapshotRead"},"type":"array"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"423":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Locked"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"List snapshots","tags":["Snapshot"]},"post":{"description":"Create snapshot","parameters":[{"description":"VM ID","in":"path","name":"vmId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.VmSnapshotCreated"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Create snapshot","tags":["Snapshot"]}},"/v2/storageManagers":{"get":{"description":"Get storage manager list","parameters":[{"description":"List all","in":"query","name":"all","schema":{"type":"boolean"}},{"description":"Page number","in":"query","name":"page","schema":{"type":"integer"}},{"description":"Number of items per page","in":"query","name":"pageSize","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.SmRead"},"type":"array"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Unauthorized"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Get storage manager list","tags":["StorageManager"]}},"/v2/storageManagers/{storageManagerId}":{"delete":{"description":"Delete storage manager","parameters":[{"description":"Storage manager ID","in":"path","name":"storageManagerId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.SmDeleted"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Delete storage manager","tags":["StorageManager"]},"get":{"description":"Get storage manager","parameters":[{"description":"Storage manager ID","in":"path","name":"storageManagerId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.SmDeleted"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Get storage manager","tags":["StorageManager"]}},"/v2/systemCapacities":{"get":{"description":"List system capacities","parameters":[{"description":"n","in":"query","name":"n","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.TimestampedSystemCapacities"},"type":"array"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.BindingError"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"List system capacities","tags":["System"]}},"/v2/systemStats":{"get":{"description":"List system stats","parameters":[{"description":"n","in":"query","name":"n","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.TimestampedSystemStats"},"type":"array"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.BindingError"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"List system stats","tags":["System"]}},"/v2/systemStatus":{"get":{"description":"List system stats","parameters":[{"description":"n","in":"query","name":"n","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.TimestampedSystemStatus"},"type":"array"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.BindingError"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"List system stats","tags":["System"]}},"/v2/teams":{"get":{"description":"List teams","parameters":[{"description":"List all","in":"query","name":"all","schema":{"type":"boolean"}},{"description":"Filter by user ID","in":"query","name":"userId","schema":{"type":"string"}},{"description":"Page number","in":"query","name":"page","schema":{"type":"integer"}},{"description":"Number of items per page","in":"query","name":"pageSize","schema":{"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.TeamRead"},"type":"array"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.BindingError"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"List teams","tags":["Team"]},"post":{"description":"Create team","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.TeamCreate"}}},"description":"Team","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.TeamRead"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.BindingError"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Create team","tags":["Team"]}},"/v2/teams/{teamId}":{"delete":{"description":"Delete team","parameters":[{"description":"Team ID","in":"path","name":"teamId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"204":{"description":"No Content"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.BindingError"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Delete team","tags":["Team"]},"get":{"description":"Get team","parameters":[{"description":"Team ID","in":"path","name":"teamId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.TeamRead"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.BindingError"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Get team","tags":["Team"]},"post":{"description":"Update team","parameters":[{"description":"Team ID","in":"path","name":"teamId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.TeamUpdate"}}},"description":"Team","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.TeamRead"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.BindingError"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Update team","tags":["Team"]}},"/v2/users":{"get":{"description":"List users","parameters":[{"description":"List all","in":"query","name":"all","schema":{"type":"boolean"}},{"description":"Discovery mode","in":"query","name":"discover","schema":{"type":"boolean"}},{"description":"Search query","in":"query","name":"search","schema":{"type":"string"}},{"description":"Page number","in":"query","name":"page","schema":{"type":"integer"}},{"description":"Number of items per page","in":"query","name":"pageSize","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.UserRead"},"type":"array"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"List users","tags":["User"]}},"/v2/users/{userId}":{"get":{"description":"Get user","parameters":[{"description":"User ID","in":"path","name":"userId","required":true,"schema":{"type":"string"}},{"description":"Discovery mode","in":"query","name":"discover","schema":{"type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.UserRead"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Get user","tags":["User"]},"post":{"description":"Update user","parameters":[{"description":"User ID","in":"path","name":"userId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.UserUpdate"}}},"description":"User update","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.UserRead"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Update user","tags":["User"]}},"/v2/users/{userId}/apiKeys":{"post":{"description":"Create API key","parameters":[{"description":"User ID","in":"path","name":"userId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.ApiKeyCreate"}}},"description":"API key create body","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.ApiKeyCreated"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Create API key","tags":["User"]}},"/v2/vmActions":{"post":{"description":"Creates a new action","parameters":[{"description":"VM ID","in":"path","name":"vmId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.VmActionCreate"}}},"description":"actions body","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.VmActionCreated"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Creates a new action","tags":["VmAction"]}},"/v2/vms":{"get":{"description":"List VMs","parameters":[{"description":"List all","in":"query","name":"all","schema":{"type":"boolean"}},{"description":"Filter by user ID","in":"query","name":"userId","schema":{"type":"string"}},{"description":"Page number","in":"query","name":"page","schema":{"type":"integer"}},{"description":"Number of items per page","in":"query","name":"pageSize","schema":{"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.VmRead"},"type":"array"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"List VMs","tags":["VM"]},"post":{"description":"Create VM","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.VmCreate"}}},"description":"VM body","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.VmCreated"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Create VM","tags":["VM"]}},"/v2/vms/{vmId}":{"delete":{"description":"Delete VM","parameters":[{"description":"VM ID","in":"path","name":"vmId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.VmDeleted"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Unauthorized"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Delete VM","tags":["VM"]},"get":{"description":"Get VM","parameters":[{"description":"VM ID","in":"path","name":"vmId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.VmRead"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Get VM","tags":["VM"]},"post":{"description":"Update VM","parameters":[{"description":"VM ID","in":"path","name":"vmId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.VmUpdate"}}},"description":"VM update","required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.VmUpdated"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Update VM","tags":["VM"]}},"/v2/vms/{vmId}/snapshot/{snapshotId}":{"delete":{"description":"Delete snapshot","parameters":[{"description":"VM ID","in":"path","name":"vmId","required":true,"schema":{"type":"string"}},{"description":"Snapshot ID","in":"path","name":"snapshotId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.VmSnapshotDeleted"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Delete snapshot","tags":["Snapshot"]},"post":{"description":"Get snapshot","parameters":[{"description":"VM ID","in":"path","name":"vmId","required":true,"schema":{"type":"string"}},{"description":"Snapshot ID","in":"path","name":"snapshotId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body.VmSnapshotRead"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"Get snapshot","tags":["Snapshot"]}},"/v2/workerStatus":{"get":{"description":"List of worker status","responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.WorkerStatusRead"},"type":"array"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"summary":"List worker status","tags":["Status"]}},"/v2/zones":{"get":{"description":"List zones","responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/body.ZoneRead"},"type":"array"}}},"description":"OK"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Bad Request"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/sys.ErrorResponse"}}},"description":"Internal Server Error"}},"security":[{"ApiKeyAuth":[]},{"KeycloakOAuth":[]}],"summary":"List zones","tags":["Zone"]}}}, diff --git a/docs/api/v2/V2_swagger.yaml b/docs/api/v2/V2_swagger.yaml index 9dc5f5c9..1003b712 100644 --- a/docs/api/v2/V2_swagger.yaml +++ b/docs/api/v2/V2_swagger.yaml @@ -244,6 +244,11 @@ components: uniqueItems: false internalPort: type: integer + internalPorts: + items: + type: integer + type: array + uniqueItems: false name: type: string neverStale: diff --git a/export/types/v2/body/index.ts b/export/types/v2/body/index.ts index 3f4f0f47..e35d8c49 100644 --- a/export/types/v2/body/index.ts +++ b/export/types/v2/body/index.ts @@ -41,6 +41,7 @@ export interface DeploymentRead { initCommands: string[]; args: string[]; internalPort: number /* int */; + internalPorts: number /* int */[]; image?: string; healthCheckPath?: string; customDomain?: CustomDomainRead; diff --git a/pkg/db/resources/deployment_repo/db.go b/pkg/db/resources/deployment_repo/db.go index 7059faa8..0d5c09e5 100644 --- a/pkg/db/resources/deployment_repo/db.go +++ b/pkg/db/resources/deployment_repo/db.go @@ -133,6 +133,7 @@ func (client *Client) UpdateWithParams(id string, params *model.DeploymentUpdate db.AddIfNotNil(&setUpdate, "name", params.Name) db.AddIfNotNil(&setUpdate, "ownerId", params.OwnerID) db.AddIfNotNil(&setUpdate, "apps.main.internalPort", params.InternalPort) + db.AddIfNotNil(&setUpdate, "apps.main.internalPorts", params.InternalPorts) db.AddIfNotNil(&setUpdate, "apps.main.envs", params.Envs) db.AddIfNotNil(&setUpdate, "apps.main.volumes", params.Volumes) db.AddIfNotNil(&setUpdate, "apps.main.initCommands", params.InitCommands) From d68863218c91328e2952477ea466debe38306935 Mon Sep 17 00:00:00 2001 From: Philip Zingmark Date: Tue, 22 Apr 2025 02:56:02 +0200 Subject: [PATCH 4/9] fix typo on bson binding key --- dto/v2/body/deployment.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dto/v2/body/deployment.go b/dto/v2/body/deployment.go index 2b3367ac..2151fc51 100644 --- a/dto/v2/body/deployment.go +++ b/dto/v2/body/deployment.go @@ -25,7 +25,7 @@ type DeploymentRead struct { InitCommands []string `json:"initCommands"` Args []string `json:"args"` InternalPort int `json:"internalPort"` - InternalPorts []int `json:"internalPorts"` + InternalPorts []int `json:"internalPorts,omitempty"` Image *string `json:"image,omitempty"` HealthCheckPath *string `json:"healthCheckPath,omitempty"` CustomDomain *CustomDomainRead `json:"customDomain,omitempty"` From 0406ccbb8aafd86d8bf3dbf41ec0d7c707f0b8d6 Mon Sep 17 00:00:00 2001 From: Philip Zingmark Date: Tue, 22 Apr 2025 02:56:26 +0200 Subject: [PATCH 5/9] fix typo on bson binding --- models/model/deployment_related.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/model/deployment_related.go b/models/model/deployment_related.go index f71ef34e..a46d0302 100644 --- a/models/model/deployment_related.go +++ b/models/model/deployment_related.go @@ -38,7 +38,7 @@ type App struct { Image string `bson:"image"` InternalPort int `bson:"internalPort"` - InternalPorts []int `bson:"internallPorts"` + InternalPorts []int `bson:"internalPorts"` Envs []DeploymentEnv `bson:"envs"` Volumes []DeploymentVolume `bson:"volumes"` Visibility string `bson:"visibility"` From d354e153e46892ab4d4f5978d80405aff42fe036 Mon Sep 17 00:00:00 2001 From: Philip Zingmark Date: Tue, 22 Apr 2025 03:53:30 +0200 Subject: [PATCH 6/9] fix conv to dto --- models/model/deployment_convert.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/models/model/deployment_convert.go b/models/model/deployment_convert.go index 4b128975..06770294 100644 --- a/models/model/deployment_convert.go +++ b/models/model/deployment_convert.go @@ -26,15 +26,17 @@ func (deployment *Deployment) ToDTO(smURL *string, externalPort *int, teams []st Value: fmt.Sprintf("%d", app.InternalPort), }) - portsStr := make([]string, len(app.InternalPorts)) - for i, port := range app.InternalPorts { - portsStr[i] = strconv.Itoa(port) - } + if len(app.InternalPorts) > 0 { + portsStr := make([]string, len(app.InternalPorts)) + for i, port := range app.InternalPorts { + portsStr[i] = strconv.Itoa(port) + } - envs = append(envs, body.Env{ - Name: "INTERNAL_PORTS", - Value: strings.Join(portsStr, ","), - }) + envs = append(envs, body.Env{ + Name: "INTERNAL_PORTS", + Value: strings.Join(portsStr, ","), + }) + } for i, env := range app.Envs { envs[i] = body.Env{ From 3d97808b135ce179c2d5764bb0cf1991bd1c6738 Mon Sep 17 00:00:00 2001 From: Philip Zingmark Date: Tue, 22 Apr 2025 04:03:42 +0200 Subject: [PATCH 7/9] only set env if it is provided --- .../v2/deployments/resources/k8s_generator.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/service/v2/deployments/resources/k8s_generator.go b/service/v2/deployments/resources/k8s_generator.go index 8e85c3bc..3a4dd4f2 100644 --- a/service/v2/deployments/resources/k8s_generator.go +++ b/service/v2/deployments/resources/k8s_generator.go @@ -83,15 +83,17 @@ func (kg *K8sGenerator) Deployments() []models.DeploymentPublic { Value: fmt.Sprintf("%d", mainApp.InternalPort), }) - portsStr := make([]string, len(mainApp.InternalPorts)) - for i, port := range mainApp.InternalPorts { - portsStr[i] = strconv.Itoa(port) - } + if len(mainApp.InternalPorts) > 0 { + portsStr := make([]string, len(mainApp.InternalPorts)) + for i, port := range mainApp.InternalPorts { + portsStr[i] = strconv.Itoa(port) + } - k8sEnvs = append(k8sEnvs, models.EnvVar{ - Name: "INTERNAL_PORTS", - Value: strings.Join(portsStr, ","), - }) + k8sEnvs = append(k8sEnvs, models.EnvVar{ + Name: "INTERNAL_PORTS", + Value: strings.Join(portsStr, ","), + }) + } k8sVolumes := make([]models.Volume, len(mainApp.Volumes)) for i, volume := range mainApp.Volumes { From 639cc68d49612b3e793b1739075201f3e05e17b4 Mon Sep 17 00:00:00 2001 From: Philip Zingmark Date: Tue, 22 Apr 2025 07:41:27 +0200 Subject: [PATCH 8/9] fix conversion related issues --- models/model/deployment_convert.go | 59 ++++++++++++++++++++++-------- 1 file changed, 44 insertions(+), 15 deletions(-) diff --git a/models/model/deployment_convert.go b/models/model/deployment_convert.go index 06770294..669781d7 100644 --- a/models/model/deployment_convert.go +++ b/models/model/deployment_convert.go @@ -2,6 +2,7 @@ package model import ( "fmt" + "slices" "strconv" "strings" @@ -21,28 +22,56 @@ func (deployment *Deployment) ToDTO(smURL *string, externalPort *int, teams []st envs := make([]body.Env, len(app.Envs)) - envs = append(envs, body.Env{ - Name: "PORT", - Value: fmt.Sprintf("%d", app.InternalPort), - }) - - if len(app.InternalPorts) > 0 { - portsStr := make([]string, len(app.InternalPorts)) - for i, port := range app.InternalPorts { - portsStr[i] = strconv.Itoa(port) + portIndex := -1 + internalPortIndex := -1 + for i, env := range app.Envs { + if env.Name == "PORT" { + portIndex = i + continue + } else if env.Name == "INTERNAL_PORTS" { + internalPortIndex = i + continue } + envs[i] = body.Env{ + Name: env.Name, + Value: env.Value, + } + } + if portIndex == -1 { envs = append(envs, body.Env{ - Name: "INTERNAL_PORTS", - Value: strings.Join(portsStr, ","), + Name: "PORT", + Value: fmt.Sprintf("%d", app.InternalPort), }) + } else { + envs[portIndex] = body.Env{ + Name: "PORT", + Value: fmt.Sprintf("%d", app.InternalPort), + } } + if internalPortIndex == -1 { + if len(app.InternalPorts) > 0 { + portsStr := make([]string, len(app.InternalPorts)) + for i, port := range app.InternalPorts { + portsStr[i] = fmt.Sprintf("%d", port) + } - for i, env := range app.Envs { - envs[i] = body.Env{ - Name: env.Name, - Value: env.Value, + envs = append(envs, body.Env{ + Name: "INTERNAL_PORTS", + Value: strings.Join(portsStr, ","), + }) } + } else if len(app.InternalPorts) > 0 { + portsStr := make([]string, len(app.InternalPorts)) + for i, port := range app.InternalPorts { + portsStr[i] = fmt.Sprintf("%d", port) + } + envs[internalPortIndex] = body.Env{ + Name: "INTERNAL_PORTS", + Value: strings.Join(portsStr, ","), + } + } else { + envs = slices.Delete(envs, internalPortIndex, internalPortIndex+1) } volumes := make([]body.Volume, len(app.Volumes)) From 1811cdcb2f87910d9881e9d91ff727b8ce0f6a45 Mon Sep 17 00:00:00 2001 From: Philip Zingmark Date: Tue, 22 Apr 2025 07:48:48 +0200 Subject: [PATCH 9/9] update tygo types --- export/types/v2/body/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/export/types/v2/body/index.ts b/export/types/v2/body/index.ts index e35d8c49..062e99a6 100644 --- a/export/types/v2/body/index.ts +++ b/export/types/v2/body/index.ts @@ -41,7 +41,7 @@ export interface DeploymentRead { initCommands: string[]; args: string[]; internalPort: number /* int */; - internalPorts: number /* int */[]; + internalPorts?: number /* int */[]; image?: string; healthCheckPath?: string; customDomain?: CustomDomainRead;