mirror of
https://github.com/GlueOps/autoglue.git
synced 2026-02-13 21:00:06 +01:00
Compare commits
30 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3a1ce33bca | ||
|
|
9108ee8f8f | ||
|
|
1feb3e29e1 | ||
|
|
0e9ce98624 | ||
|
|
96aef81959 | ||
|
|
62232e18f3 | ||
|
|
515327153c | ||
|
|
5f2e885a8e | ||
|
|
01b48efba0 | ||
|
|
1c87566c5b | ||
|
|
ad00a3c45d | ||
|
|
158fdce780 | ||
|
|
c4fd344364 | ||
|
|
953e724ba0 | ||
|
|
256acfd686 | ||
|
|
1dd0a39aad | ||
|
|
7ef0605c2b | ||
|
|
8a92727b88 | ||
|
|
1f9920a04c | ||
|
|
5fd96ec40f | ||
|
|
bc72df3c9a | ||
|
|
56ea963b47 | ||
|
|
c9d5080d50 | ||
|
|
4adad29c4f | ||
|
|
13c9ba0ec0 | ||
|
|
e80d818e86 | ||
|
|
f1533eb325 | ||
|
|
334df457ce | ||
|
|
c478a8d10f | ||
|
|
3463b2cb33 |
2
.github/workflows/docker-publish.yml
vendored
2
.github/workflows/docker-publish.yml
vendored
@@ -39,7 +39,7 @@ jobs:
|
|||||||
# https://github.com/sigstore/cosign-installer
|
# https://github.com/sigstore/cosign-installer
|
||||||
- name: Install cosign
|
- name: Install cosign
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
uses: sigstore/cosign-installer@7e8b541eb2e61bf99390e1afd4be13a184e9ebc5 # v3.10.1
|
uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4.0.0
|
||||||
with:
|
with:
|
||||||
cosign-release: 'v2.2.4'
|
cosign-release: 'v2.2.4'
|
||||||
|
|
||||||
|
|||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -137,4 +137,6 @@ notes.txt
|
|||||||
|
|
||||||
.terraform
|
.terraform
|
||||||
.terraform.lock*
|
.terraform.lock*
|
||||||
terraform.tfstate*
|
terraform.tfstate*
|
||||||
|
|
||||||
|
ui/src/sdk
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
#################################
|
#################################
|
||||||
# Builder: Go + Node in one
|
# Builder: Go + Node in one
|
||||||
#################################
|
#################################
|
||||||
FROM golang:1.25.4-alpine@sha256:d2ede9f3341a67413127cf5366bb25bbad9b0a66e8173cae3a900ab00e84861f AS builder
|
FROM golang:1.25.4-alpine@sha256:d3f0cf7723f3429e3f9ed846243970b20a2de7bae6a5b66fc5914e228d831bbb AS builder
|
||||||
|
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
bash git ca-certificates tzdata \
|
bash git ca-certificates tzdata \
|
||||||
@@ -15,7 +15,11 @@ RUN npm i -g yarn pnpm
|
|||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN make clean && make swagger && make sdk-ts-ui && make ui && make build
|
RUN make clean
|
||||||
|
RUN make swagger
|
||||||
|
RUN make sdk-ts-ui
|
||||||
|
RUN make ui
|
||||||
|
RUN make build
|
||||||
|
|
||||||
#################################
|
#################################
|
||||||
# Runtime
|
# Runtime
|
||||||
|
|||||||
10
Makefile
10
Makefile
@@ -23,7 +23,7 @@ MODULE_PATH ?= $(GIT_HOST)/$(GIT_USER)/$(BIN)
|
|||||||
|
|
||||||
# SDK / module settings (Go)
|
# SDK / module settings (Go)
|
||||||
SDK_REPO ?= $(BIN)-sdk-go # repo name used for module path
|
SDK_REPO ?= $(BIN)-sdk-go # repo name used for module path
|
||||||
SDK_OUTDIR ?= sdk/go # output directory (inside repo)
|
SDK_OUTDIR ?= ../autoglue-sdk-go # output directory (inside repo)
|
||||||
SDK_PKG ?= ${BIN} # package name inside the SDK
|
SDK_PKG ?= ${BIN} # package name inside the SDK
|
||||||
|
|
||||||
UI_SSG_ROUTES ?= /,/login,/docs,/pricing
|
UI_SSG_ROUTES ?= /,/login,/docs,/pricing
|
||||||
@@ -70,7 +70,7 @@ export GO_POST_PROCESS_FILE := gofmt -w
|
|||||||
.DEFAULT_GOAL := help
|
.DEFAULT_GOAL := help
|
||||||
|
|
||||||
# --- version metadata (ldflags) ---
|
# --- version metadata (ldflags) ---
|
||||||
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
|
VERSION := $(shell git describe --tags --always 2>/dev/null || echo "dev")
|
||||||
COMMIT := $(shell git rev-parse HEAD 2>/dev/null || echo "none")
|
COMMIT := $(shell git rev-parse HEAD 2>/dev/null || echo "none")
|
||||||
DATE := $(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
|
DATE := $(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
|
||||||
BUILT_BY := $(shell whoami)
|
BUILT_BY := $(shell whoami)
|
||||||
@@ -103,7 +103,7 @@ DOCS_YAML := docs/swagger.yaml
|
|||||||
# Prefer git for speed; fall back to find. Exclude UI dir.
|
# Prefer git for speed; fall back to find. Exclude UI dir.
|
||||||
#GO_SRCS := $(shell (git ls-files '*.go' ':!$(UI_DIR)/**' 2>/dev/null || find . -name '*.go' -not -path './$(UI_DIR)/*' -type f))
|
#GO_SRCS := $(shell (git ls-files '*.go' ':!$(UI_DIR)/**' 2>/dev/null || find . -name '*.go' -not -path './$(UI_DIR)/*' -type f))
|
||||||
GO_SRCS := $(shell ( \
|
GO_SRCS := $(shell ( \
|
||||||
git ls-files '*.go' ':!$(UI_DIR)/**' ':!docs/**' ':!sdk/**' 2>/dev/null \
|
git ls-files '*.go' ':!$(UI_DIR)/**' ':!docs/**' ':!sdk/**' ':!terraform-provider-autoglue/**' 2>/dev/null \
|
||||||
|| find . -name '*.go' -not -path './$(UI_DIR)/*' -not -path './docs/*' -type f \
|
|| find . -name '*.go' -not -path './$(UI_DIR)/*' -not -path './docs/*' -type f \
|
||||||
))
|
))
|
||||||
|
|
||||||
@@ -247,7 +247,6 @@ TS_PROPS := -p npmName=$(SDK_TS_NPM_NAME) -p npmVersion=$(SDK_TS_NPM_VER) $
|
|||||||
# --- sdk generation (Go) ---
|
# --- sdk generation (Go) ---
|
||||||
sdk-go: $(DOCS_JSON) validate-spec check-tags ## Generate Go SDK + tidy module
|
sdk-go: $(DOCS_JSON) validate-spec check-tags ## Generate Go SDK + tidy module
|
||||||
@echo ">> Generating Go SDK (module $(GIT_HOST_CLEAN)/$(GIT_USER_CLEAN)/$(SDK_REPO_CLEAN), Go $(GO_VERSION))..."
|
@echo ">> Generating Go SDK (module $(GIT_HOST_CLEAN)/$(GIT_USER_CLEAN)/$(SDK_REPO_CLEAN), Go $(GO_VERSION))..."
|
||||||
@rm -rf "$(SDK_OUTDIR_CLEAN)"; mkdir -p "$(SDK_OUTDIR_CLEAN)"
|
|
||||||
@$(call OGC_GENERATE,go,$(SDK_OUTDIR_CLEAN),--additional-properties=packageName=$(SDK_PKG_CLEAN) $(OAG_GIT_PROPS))
|
@$(call OGC_GENERATE,go,$(SDK_OUTDIR_CLEAN),--additional-properties=packageName=$(SDK_PKG_CLEAN) $(OAG_GIT_PROPS))
|
||||||
@cd "$(SDK_OUTDIR_CLEAN)"; \
|
@cd "$(SDK_OUTDIR_CLEAN)"; \
|
||||||
$(GOCMD) mod edit -go=$(GO_VERSION); \
|
$(GOCMD) mod edit -go=$(GO_VERSION); \
|
||||||
@@ -311,6 +310,9 @@ doctor: ## Print environment diagnostics (shell, versions, generator availabilit
|
|||||||
$(OGC_BIN) version || true; \
|
$(OGC_BIN) version || true; \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fetch-pgweb: ## Fetch PGWeb Binaries for embedding
|
||||||
|
go run ./tools/pgweb_fetch.go
|
||||||
|
|
||||||
help: ## Show this help
|
help: ## Show this help
|
||||||
@grep -hE '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | \
|
@grep -hE '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | \
|
||||||
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|
||||||
|
|||||||
51
cmd/db.go
Normal file
51
cmd/db.go
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
package cmd
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"os/exec"
|
||||||
|
"runtime"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/glueops/autoglue/internal/config"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
)
|
||||||
|
|
||||||
|
var dbCmd = &cobra.Command{
|
||||||
|
Use: "db",
|
||||||
|
Short: "Database utilities",
|
||||||
|
}
|
||||||
|
|
||||||
|
var dbPsqlCmd = &cobra.Command{
|
||||||
|
Use: "psql",
|
||||||
|
Short: "Open a psql session to the app database",
|
||||||
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
|
cfg, err := config.Load()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if cfg.DbURL == "" {
|
||||||
|
return errors.New("database.url is empty")
|
||||||
|
}
|
||||||
|
psql := "psql"
|
||||||
|
if runtime.GOOS == "windows" {
|
||||||
|
psql = "psql.exe"
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), 72*time.Hour)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
psqlCmd := exec.CommandContext(ctx, psql, cfg.DbURL)
|
||||||
|
psqlCmd.Stdin, psqlCmd.Stdout, psqlCmd.Stderr = os.Stdin, os.Stdout, os.Stderr
|
||||||
|
fmt.Println("Launching psql…")
|
||||||
|
return psqlCmd.Run()
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
dbCmd.AddCommand(dbPsqlCmd)
|
||||||
|
|
||||||
|
rootCmd.AddCommand(dbCmd)
|
||||||
|
}
|
||||||
32
cmd/serve.go
32
cmd/serve.go
@@ -18,6 +18,7 @@ import (
|
|||||||
"github.com/glueops/autoglue/internal/auth"
|
"github.com/glueops/autoglue/internal/auth"
|
||||||
"github.com/glueops/autoglue/internal/bg"
|
"github.com/glueops/autoglue/internal/bg"
|
||||||
"github.com/glueops/autoglue/internal/config"
|
"github.com/glueops/autoglue/internal/config"
|
||||||
|
"github.com/glueops/autoglue/internal/web"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
@@ -33,6 +34,8 @@ var serveCmd = &cobra.Command{
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var pgwebInst *web.Pgweb
|
||||||
|
|
||||||
jobs, err := bg.NewJobs(rt.DB, cfg.DbURL)
|
jobs, err := bg.NewJobs(rt.DB, cfg.DbURL)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("failed to init background jobs: %v", err)
|
log.Fatalf("failed to init background jobs: %v", err)
|
||||||
@@ -119,7 +122,31 @@ var serveCmd = &cobra.Command{
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
r := api.NewRouter(rt.DB, jobs)
|
var studioHandler http.Handler
|
||||||
|
r := api.NewRouter(rt.DB, jobs, nil)
|
||||||
|
|
||||||
|
if cfg.DBStudioEnabled {
|
||||||
|
dbURL := cfg.DbURLRO
|
||||||
|
if dbURL == "" {
|
||||||
|
dbURL = cfg.DbURL
|
||||||
|
}
|
||||||
|
|
||||||
|
pgwebInst, err = web.StartPgweb(
|
||||||
|
dbURL,
|
||||||
|
cfg.DBStudioBind,
|
||||||
|
cfg.DBStudioPort,
|
||||||
|
true,
|
||||||
|
cfg.DBStudioUser,
|
||||||
|
cfg.DBStudioPass,
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("pgweb failed to start: %v", err)
|
||||||
|
} else {
|
||||||
|
studioHandler = http.HandlerFunc(pgwebInst.Proxy())
|
||||||
|
r = api.NewRouter(rt.DB, jobs, studioHandler)
|
||||||
|
log.Printf("pgweb running on http://%s:%s (proxied at /db-studio/)", cfg.DBStudioBind, pgwebInst.Port())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
addr := fmt.Sprintf("%s:%s", cfg.Host, cfg.Port)
|
addr := fmt.Sprintf("%s:%s", cfg.Host, cfg.Port)
|
||||||
|
|
||||||
@@ -143,6 +170,9 @@ var serveCmd = &cobra.Command{
|
|||||||
|
|
||||||
<-ctx.Done()
|
<-ctx.Done()
|
||||||
fmt.Println("\n⏳ Shutting down...")
|
fmt.Println("\n⏳ Shutting down...")
|
||||||
|
if pgwebInst != nil {
|
||||||
|
_ = pgwebInst.Stop(context.Background())
|
||||||
|
}
|
||||||
shutdownCtx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
shutdownCtx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
return srv.Shutdown(shutdownCtx)
|
return srv.Shutdown(shutdownCtx)
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ services:
|
|||||||
- postgres
|
- postgres
|
||||||
|
|
||||||
mailpit:
|
mailpit:
|
||||||
image: axllent/mailpit@sha256:6abc8e633df15eaf785cfcf38bae48e66f64beecdc03121e249d0f9ec15f0707
|
image: axllent/mailpit@sha256:e22dce5b36f93c77082e204a3942fb6b283b7896e057458400a4c88344c3df68
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- "1025:1025"
|
- "1025:1025"
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1531
docs/swagger.yaml
1531
docs/swagger.yaml
File diff suppressed because it is too large
Load Diff
7
go.mod
7
go.mod
@@ -9,6 +9,7 @@ require (
|
|||||||
github.com/go-chi/chi/v5 v5.2.3
|
github.com/go-chi/chi/v5 v5.2.3
|
||||||
github.com/go-chi/cors v1.2.2
|
github.com/go-chi/cors v1.2.2
|
||||||
github.com/go-chi/httprate v0.15.0
|
github.com/go-chi/httprate v0.15.0
|
||||||
|
github.com/go-playground/validator/v10 v10.28.0
|
||||||
github.com/golang-jwt/jwt/v5 v5.3.0
|
github.com/golang-jwt/jwt/v5 v5.3.0
|
||||||
github.com/google/uuid v1.6.0
|
github.com/google/uuid v1.6.0
|
||||||
github.com/joho/godotenv v1.5.1
|
github.com/joho/godotenv v1.5.1
|
||||||
@@ -18,7 +19,7 @@ require (
|
|||||||
github.com/swaggo/http-swagger/v2 v2.0.2
|
github.com/swaggo/http-swagger/v2 v2.0.2
|
||||||
github.com/swaggo/swag/v2 v2.0.0-rc4
|
github.com/swaggo/swag/v2 v2.0.0-rc4
|
||||||
golang.org/x/crypto v0.43.0
|
golang.org/x/crypto v0.43.0
|
||||||
golang.org/x/oauth2 v0.32.0
|
golang.org/x/oauth2 v0.33.0
|
||||||
gopkg.in/yaml.v3 v3.0.1
|
gopkg.in/yaml.v3 v3.0.1
|
||||||
gorm.io/datatypes v1.2.7
|
gorm.io/datatypes v1.2.7
|
||||||
gorm.io/driver/postgres v1.6.0
|
gorm.io/driver/postgres v1.6.0
|
||||||
@@ -29,11 +30,14 @@ require (
|
|||||||
filippo.io/edwards25519 v1.1.0 // indirect
|
filippo.io/edwards25519 v1.1.0 // indirect
|
||||||
github.com/KyleBanks/depth v1.2.1 // indirect
|
github.com/KyleBanks/depth v1.2.1 // indirect
|
||||||
github.com/fsnotify/fsnotify v1.9.0 // indirect
|
github.com/fsnotify/fsnotify v1.9.0 // indirect
|
||||||
|
github.com/gabriel-vasile/mimetype v1.4.10 // indirect
|
||||||
github.com/go-jose/go-jose/v4 v4.1.3 // indirect
|
github.com/go-jose/go-jose/v4 v4.1.3 // indirect
|
||||||
github.com/go-openapi/jsonpointer v0.19.6 // indirect
|
github.com/go-openapi/jsonpointer v0.19.6 // indirect
|
||||||
github.com/go-openapi/jsonreference v0.20.2 // indirect
|
github.com/go-openapi/jsonreference v0.20.2 // indirect
|
||||||
github.com/go-openapi/spec v0.20.9 // indirect
|
github.com/go-openapi/spec v0.20.9 // indirect
|
||||||
github.com/go-openapi/swag v0.22.3 // indirect
|
github.com/go-openapi/swag v0.22.3 // indirect
|
||||||
|
github.com/go-playground/locales v0.14.1 // indirect
|
||||||
|
github.com/go-playground/universal-translator v0.18.1 // indirect
|
||||||
github.com/go-sql-driver/mysql v1.8.1 // indirect
|
github.com/go-sql-driver/mysql v1.8.1 // indirect
|
||||||
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
|
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
|
||||||
github.com/goccy/go-json v0.10.5 // indirect
|
github.com/goccy/go-json v0.10.5 // indirect
|
||||||
@@ -46,6 +50,7 @@ require (
|
|||||||
github.com/jinzhu/now v1.1.5 // indirect
|
github.com/jinzhu/now v1.1.5 // indirect
|
||||||
github.com/josharian/intern v1.0.0 // indirect
|
github.com/josharian/intern v1.0.0 // indirect
|
||||||
github.com/klauspost/cpuid/v2 v2.2.10 // indirect
|
github.com/klauspost/cpuid/v2 v2.2.10 // indirect
|
||||||
|
github.com/leodido/go-urn v1.4.0 // indirect
|
||||||
github.com/lib/pq v1.10.9 // indirect
|
github.com/lib/pq v1.10.9 // indirect
|
||||||
github.com/mailru/easyjson v0.7.7 // indirect
|
github.com/mailru/easyjson v0.7.7 // indirect
|
||||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||||
|
|||||||
16
go.sum
16
go.sum
@@ -22,6 +22,8 @@ github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHk
|
|||||||
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
|
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
|
||||||
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
|
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
|
||||||
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
|
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
|
||||||
|
github.com/gabriel-vasile/mimetype v1.4.10 h1:zyueNbySn/z8mJZHLt6IPw0KoZsiQNszIpU+bX4+ZK0=
|
||||||
|
github.com/gabriel-vasile/mimetype v1.4.10/go.mod h1:d+9Oxyo1wTzWdyVUPMmXFvp4F9tea18J8ufA774AB3s=
|
||||||
github.com/go-chi/chi/v5 v5.2.3 h1:WQIt9uxdsAbgIYgid+BpYc+liqQZGMHRaUwp0JUcvdE=
|
github.com/go-chi/chi/v5 v5.2.3 h1:WQIt9uxdsAbgIYgid+BpYc+liqQZGMHRaUwp0JUcvdE=
|
||||||
github.com/go-chi/chi/v5 v5.2.3/go.mod h1:L2yAIGWB3H+phAw1NxKwWM+7eUH/lU8pOMm5hHcoops=
|
github.com/go-chi/chi/v5 v5.2.3/go.mod h1:L2yAIGWB3H+phAw1NxKwWM+7eUH/lU8pOMm5hHcoops=
|
||||||
github.com/go-chi/cors v1.2.2 h1:Jmey33TE+b+rB7fT8MUy1u0I4L+NARQlK6LhzKPSyQE=
|
github.com/go-chi/cors v1.2.2 h1:Jmey33TE+b+rB7fT8MUy1u0I4L+NARQlK6LhzKPSyQE=
|
||||||
@@ -43,6 +45,14 @@ github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh
|
|||||||
github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
|
github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ=
|
||||||
github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g=
|
github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g=
|
||||||
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
|
github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
|
||||||
|
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
|
||||||
|
github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
|
||||||
|
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
|
||||||
|
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
|
||||||
|
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
|
||||||
|
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
|
||||||
|
github.com/go-playground/validator/v10 v10.28.0 h1:Q7ibns33JjyW48gHkuFT91qX48KG0ktULL6FgHdG688=
|
||||||
|
github.com/go-playground/validator/v10 v10.28.0/go.mod h1:GoI6I1SjPBh9p7ykNE/yj3fFYbyDOpwMn5KXd+m2hUU=
|
||||||
github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
|
github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
|
||||||
github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y=
|
github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y=
|
||||||
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
|
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
|
||||||
@@ -89,6 +99,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
|||||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||||
|
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
|
||||||
|
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
|
||||||
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
|
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
|
||||||
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||||
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
|
||||||
@@ -181,8 +193,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v
|
|||||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||||
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||||
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
||||||
golang.org/x/oauth2 v0.32.0 h1:jsCblLleRMDrxMN29H3z/k1KliIvpLgCkE6R8FXXNgY=
|
golang.org/x/oauth2 v0.33.0 h1:4Q+qn+E5z8gPRJfmRy7C2gGG3T4jIprK6aSYgTXGRpo=
|
||||||
golang.org/x/oauth2 v0.32.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA=
|
golang.org/x/oauth2 v0.33.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA=
|
||||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
|||||||
@@ -49,6 +49,14 @@ func AuthMiddleware(db *gorm.DB, requireOrg bool) func(http.Handler) http.Handle
|
|||||||
} else if appKey := r.Header.Get("X-APP-KEY"); appKey != "" {
|
} else if appKey := r.Header.Get("X-APP-KEY"); appKey != "" {
|
||||||
secret := r.Header.Get("X-APP-SECRET")
|
secret := r.Header.Get("X-APP-SECRET")
|
||||||
user = auth.ValidateAppKeyPair(appKey, secret, db)
|
user = auth.ValidateAppKeyPair(appKey, secret, db)
|
||||||
|
} else if c, err := r.Cookie("ag_jwt"); err == nil {
|
||||||
|
tok := strings.TrimSpace(c.Value)
|
||||||
|
if strings.HasPrefix(strings.ToLower(tok), "bearer ") {
|
||||||
|
tok = tok[7:]
|
||||||
|
}
|
||||||
|
if tok != "" {
|
||||||
|
user = auth.ValidateJWT(tok, db)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if user == nil {
|
if user == nil {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import (
|
|||||||
httpSwagger "github.com/swaggo/http-swagger/v2"
|
httpSwagger "github.com/swaggo/http-swagger/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewRouter(db *gorm.DB, jobs *bg.Jobs) http.Handler {
|
func NewRouter(db *gorm.DB, jobs *bg.Jobs, studio http.Handler) http.Handler {
|
||||||
zerolog.TimeFieldFormat = time.RFC3339
|
zerolog.TimeFieldFormat = time.RFC3339
|
||||||
|
|
||||||
l := log.Output(zerolog.ConsoleWriter{Out: os.Stdout, TimeFormat: "15:04:05"})
|
l := log.Output(zerolog.ConsoleWriter{Out: os.Stdout, TimeFormat: "15:04:05"})
|
||||||
@@ -71,6 +71,7 @@ func NewRouter(db *gorm.DB, jobs *bg.Jobs) http.Handler {
|
|||||||
v1.Get("/.well-known/jwks.json", handlers.JWKSHandler)
|
v1.Get("/.well-known/jwks.json", handlers.JWKSHandler)
|
||||||
|
|
||||||
v1.Get("/healthz", handlers.HealthCheck)
|
v1.Get("/healthz", handlers.HealthCheck)
|
||||||
|
v1.Get("/version", handlers.Version)
|
||||||
|
|
||||||
v1.Route("/auth", func(a chi.Router) {
|
v1.Route("/auth", func(a chi.Router) {
|
||||||
a.Post("/{provider}/start", handlers.AuthStart(db))
|
a.Post("/{provider}/start", handlers.AuthStart(db))
|
||||||
@@ -79,15 +80,17 @@ func NewRouter(db *gorm.DB, jobs *bg.Jobs) http.Handler {
|
|||||||
a.Post("/logout", handlers.Logout(db))
|
a.Post("/logout", handlers.Logout(db))
|
||||||
})
|
})
|
||||||
|
|
||||||
v1.Route("/admin/archer", func(a chi.Router) {
|
v1.Route("/admin", func(admin chi.Router) {
|
||||||
a.Use(authUser)
|
admin.Route("/archer", func(archer chi.Router) {
|
||||||
a.Use(httpmiddleware.RequirePlatformAdmin())
|
archer.Use(authUser)
|
||||||
|
archer.Use(httpmiddleware.RequirePlatformAdmin())
|
||||||
|
|
||||||
a.Get("/jobs", handlers.AdminListArcherJobs(db))
|
archer.Get("/jobs", handlers.AdminListArcherJobs(db))
|
||||||
a.Post("/jobs", handlers.AdminEnqueueArcherJob(db, jobs))
|
archer.Post("/jobs", handlers.AdminEnqueueArcherJob(db, jobs))
|
||||||
a.Post("/jobs/{id}/retry", handlers.AdminRetryArcherJob(db))
|
archer.Post("/jobs/{id}/retry", handlers.AdminRetryArcherJob(db))
|
||||||
a.Post("/jobs/{id}/cancel", handlers.AdminCancelArcherJob(db))
|
archer.Post("/jobs/{id}/cancel", handlers.AdminCancelArcherJob(db))
|
||||||
a.Get("/queues", handlers.AdminListArcherQueues(db))
|
archer.Get("/queues", handlers.AdminListArcherQueues(db))
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
v1.Route("/me", func(me chi.Router) {
|
v1.Route("/me", func(me chi.Router) {
|
||||||
@@ -124,6 +127,16 @@ func NewRouter(db *gorm.DB, jobs *bg.Jobs) http.Handler {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
v1.Route("/credentials", func(c chi.Router) {
|
||||||
|
c.Use(authOrg)
|
||||||
|
c.Get("/", handlers.ListCredentials(db))
|
||||||
|
c.Post("/", handlers.CreateCredential(db))
|
||||||
|
c.Get("/{id}", handlers.GetCredential(db))
|
||||||
|
c.Patch("/{id}", handlers.UpdateCredential(db))
|
||||||
|
c.Delete("/{id}", handlers.DeleteCredential(db))
|
||||||
|
c.Post("/{id}/reveal", handlers.RevealCredential(db))
|
||||||
|
})
|
||||||
|
|
||||||
v1.Route("/ssh", func(s chi.Router) {
|
v1.Route("/ssh", func(s chi.Router) {
|
||||||
s.Use(authOrg)
|
s.Use(authOrg)
|
||||||
s.Get("/", handlers.ListPublicSshKeys(db))
|
s.Get("/", handlers.ListPublicSshKeys(db))
|
||||||
@@ -168,8 +181,48 @@ func NewRouter(db *gorm.DB, jobs *bg.Jobs) http.Handler {
|
|||||||
a.Patch("/{id}", handlers.UpdateAnnotation(db))
|
a.Patch("/{id}", handlers.UpdateAnnotation(db))
|
||||||
a.Delete("/{id}", handlers.DeleteAnnotation(db))
|
a.Delete("/{id}", handlers.DeleteAnnotation(db))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
v1.Route("/node-pools", func(n chi.Router) {
|
||||||
|
n.Use(authOrg)
|
||||||
|
n.Get("/", handlers.ListNodePools(db))
|
||||||
|
n.Post("/", handlers.CreateNodePool(db))
|
||||||
|
n.Get("/{id}", handlers.GetNodePool(db))
|
||||||
|
n.Patch("/{id}", handlers.UpdateNodePool(db))
|
||||||
|
n.Delete("/{id}", handlers.DeleteNodePool(db))
|
||||||
|
|
||||||
|
// Servers
|
||||||
|
n.Get("/{id}/servers", handlers.ListNodePoolServers(db))
|
||||||
|
n.Post("/{id}/servers", handlers.AttachNodePoolServers(db))
|
||||||
|
n.Delete("/{id}/servers/{serverId}", handlers.DetachNodePoolServer(db))
|
||||||
|
|
||||||
|
// Taints
|
||||||
|
n.Get("/{id}/taints", handlers.ListNodePoolTaints(db))
|
||||||
|
n.Post("/{id}/taints", handlers.AttachNodePoolTaints(db))
|
||||||
|
n.Delete("/{id}/taints/{taintId}", handlers.DetachNodePoolTaint(db))
|
||||||
|
|
||||||
|
// Labels
|
||||||
|
n.Get("/{id}/labels", handlers.ListNodePoolLabels(db))
|
||||||
|
n.Post("/{id}/labels", handlers.AttachNodePoolLabels(db))
|
||||||
|
n.Delete("/{id}/labels/{labelId}", handlers.DetachNodePoolLabel(db))
|
||||||
|
|
||||||
|
// Annotations
|
||||||
|
n.Get("/{id}/annotations", handlers.ListNodePoolAnnotations(db))
|
||||||
|
n.Post("/{id}/annotations", handlers.AttachNodePoolAnnotations(db))
|
||||||
|
n.Delete("/{id}/annotations/{annotationId}", handlers.DetachNodePoolAnnotation(db))
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if studio != nil {
|
||||||
|
r.Group(func(gr chi.Router) {
|
||||||
|
authUser := httpmiddleware.AuthMiddleware(db, false)
|
||||||
|
adminOnly := httpmiddleware.RequirePlatformAdmin()
|
||||||
|
gr.Use(authUser)
|
||||||
|
gr.Use(adminOnly)
|
||||||
|
gr.Mount("/db-studio", http.StripPrefix("/db-studio", studio))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
if config.IsDebug() {
|
if config.IsDebug() {
|
||||||
r.Route("/debug/pprof", func(pr chi.Router) {
|
r.Route("/debug/pprof", func(pr chi.Router) {
|
||||||
pr.Get("/", httpPprof.Index)
|
pr.Get("/", httpPprof.Index)
|
||||||
@@ -209,6 +262,7 @@ func NewRouter(db *gorm.DB, jobs *bg.Jobs) http.Handler {
|
|||||||
mux.Handle("/api/", r)
|
mux.Handle("/api/", r)
|
||||||
mux.Handle("/api", r)
|
mux.Handle("/api", r)
|
||||||
mux.Handle("/swagger/", r)
|
mux.Handle("/swagger/", r)
|
||||||
|
mux.Handle("/db-studio/", r)
|
||||||
mux.Handle("/debug/pprof/", r)
|
mux.Handle("/debug/pprof/", r)
|
||||||
// Everything else (/, /brand-preview, assets) → proxy (no middlewares)
|
// Everything else (/, /brand-preview, assets) → proxy (no middlewares)
|
||||||
mux.Handle("/", proxy)
|
mux.Handle("/", proxy)
|
||||||
|
|||||||
@@ -38,7 +38,11 @@ func NewRuntime() *Runtime {
|
|||||||
&models.Taint{},
|
&models.Taint{},
|
||||||
&models.Label{},
|
&models.Label{},
|
||||||
&models.Annotation{},
|
&models.Annotation{},
|
||||||
|
&models.NodePool{},
|
||||||
|
&models.Cluster{},
|
||||||
|
&models.Credential{},
|
||||||
)
|
)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Error initializing database: %v", err)
|
log.Fatalf("Error initializing database: %v", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -225,19 +225,242 @@ func sshInstallDockerWithOutput(ctx context.Context, host, user string, privateK
|
|||||||
script := `
|
script := `
|
||||||
set -euxo pipefail
|
set -euxo pipefail
|
||||||
|
|
||||||
if ! command -v docker >/dev/null 2>&1; then
|
# ----------- toggles (set to 0 to skip) -----------
|
||||||
curl -fsSL https://get.docker.com | sh
|
: "${BASELINE_PKGS:=1}"
|
||||||
|
: "${INSTALL_DOCKER:=1}"
|
||||||
|
: "${SSH_HARDEN:=1}"
|
||||||
|
: "${FIREWALL:=1}"
|
||||||
|
: "${AUTO_UPDATES:=1}"
|
||||||
|
: "${TIME_SYNC:=1}"
|
||||||
|
: "${FAIL2BAN:=1}"
|
||||||
|
: "${BANNER:=1}"
|
||||||
|
|
||||||
|
# ----------- helpers -----------
|
||||||
|
have() { command -v "$1" >/dev/null 2>&1; }
|
||||||
|
|
||||||
|
pm=""
|
||||||
|
if have apt-get; then pm="apt"
|
||||||
|
elif have dnf; then pm="dnf"
|
||||||
|
elif have yum; then pm="yum"
|
||||||
|
elif have zypper; then pm="zypper"
|
||||||
|
elif have apk; then pm="apk"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# try to enable/start (handles distros with systemd)
|
pm_update_install() {
|
||||||
if command -v systemctl >/dev/null 2>&1; then
|
case "$pm" in
|
||||||
sudo systemctl enable --now docker || true
|
apt)
|
||||||
|
sudo apt-get update -y
|
||||||
|
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends "$@"
|
||||||
|
;;
|
||||||
|
dnf) sudo dnf install -y "$@" ;;
|
||||||
|
yum) sudo yum install -y "$@" ;;
|
||||||
|
zypper) sudo zypper --non-interactive install -y "$@" || true ;;
|
||||||
|
apk) sudo apk add --no-cache "$@" ;;
|
||||||
|
*)
|
||||||
|
echo "Unsupported distro: couldn't detect package manager" >&2
|
||||||
|
return 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
systemd_enable_now() {
|
||||||
|
if have systemctl; then
|
||||||
|
sudo systemctl enable --now "$1" || true
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
sshd_reload() {
|
||||||
|
if have systemctl && systemctl is-enabled ssh >/dev/null 2>&1; then
|
||||||
|
sudo systemctl reload ssh || true
|
||||||
|
elif have systemctl && systemctl is-enabled sshd >/dev/null 2>&1; then
|
||||||
|
sudo systemctl reload sshd || true
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# ----------- baseline packages -----------
|
||||||
|
if [ "$BASELINE_PKGS" = "1" ] && [ -n "$pm" ]; then
|
||||||
|
pkgs_common="curl ca-certificates gnupg git jq unzip tar vim tmux htop net-tools"
|
||||||
|
case "$pm" in
|
||||||
|
apt) pkgs="$pkgs_common ufw openssh-client" ;;
|
||||||
|
dnf|yum) pkgs="$pkgs_common firewalld openssh-clients" ;;
|
||||||
|
zypper) pkgs="$pkgs_common firewalld openssh" ;;
|
||||||
|
apk) pkgs="$pkgs_common openssh-client" ;;
|
||||||
|
esac
|
||||||
|
pm_update_install $pkgs || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# add current ssh user to docker group if exists
|
# ----------- docker & compose v2 -----------
|
||||||
if getent group docker >/dev/null 2>&1; then
|
if [ "$INSTALL_DOCKER" = "1" ]; then
|
||||||
sudo usermod -aG docker "$(id -un)" || true
|
if ! have docker; then
|
||||||
|
curl -fsSL https://get.docker.com | sh
|
||||||
|
fi
|
||||||
|
|
||||||
|
# try to enable/start (handles distros with systemd)
|
||||||
|
if have systemctl; then
|
||||||
|
sudo systemctl enable --now docker || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# add current ssh user to docker group if exists
|
||||||
|
if getent group docker >/dev/null 2>&1; then
|
||||||
|
sudo usermod -aG docker "$(id -un)" || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# docker compose v2 (plugin) if missing
|
||||||
|
if ! docker compose version >/dev/null 2>&1; then
|
||||||
|
# Try package first (Debian/Ubuntu name)
|
||||||
|
if [ "$pm" = "apt" ]; then
|
||||||
|
sudo apt-get update -y
|
||||||
|
sudo apt-get install -y docker-compose-plugin || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Fallback: install static plugin binary under ~/.docker/cli-plugins
|
||||||
|
if ! docker compose version >/dev/null 2>&1; then
|
||||||
|
mkdir -p ~/.docker/cli-plugins
|
||||||
|
arch="$(uname -m)"
|
||||||
|
case "$arch" in
|
||||||
|
x86_64|amd64) arch="x86_64" ;;
|
||||||
|
aarch64|arm64) arch="aarch64" ;;
|
||||||
|
esac
|
||||||
|
curl -fsSL -o ~/.docker/cli-plugins/docker-compose \
|
||||||
|
"https://github.com/docker/compose/releases/download/v2.29.7/docker-compose-$(uname -s)-$arch"
|
||||||
|
chmod +x ~/.docker/cli-plugins/docker-compose
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# ----------- SSH hardening (non-destructive: separate conf file) -----------
|
||||||
|
if [ "$SSH_HARDEN" = "1" ]; then
|
||||||
|
confd="/etc/ssh/sshd_config.d"
|
||||||
|
if [ -d "$confd" ] && [ -w "$confd" ]; then
|
||||||
|
sudo tee "$confd/10-bastion.conf" >/dev/null <<'EOF'
|
||||||
|
# Bastion hardening
|
||||||
|
PasswordAuthentication no
|
||||||
|
ChallengeResponseAuthentication no
|
||||||
|
KbdInteractiveAuthentication no
|
||||||
|
UsePAM yes
|
||||||
|
PermitEmptyPasswords no
|
||||||
|
PubkeyAuthentication yes
|
||||||
|
ClientAliveInterval 300
|
||||||
|
ClientAliveCountMax 2
|
||||||
|
LoginGraceTime 20
|
||||||
|
MaxAuthTries 3
|
||||||
|
MaxSessions 10
|
||||||
|
AllowAgentForwarding no
|
||||||
|
X11Forwarding no
|
||||||
|
EOF
|
||||||
|
sshd_reload
|
||||||
|
else
|
||||||
|
echo "Skipping SSH hardening: $confd not present or not writable" >&2
|
||||||
|
fi
|
||||||
|
|
||||||
|
# lock root password (no effect if already locked)
|
||||||
|
if have passwd; then
|
||||||
|
sudo passwd -l root || true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ----------- firewall -----------
|
||||||
|
if [ "$FIREWALL" = "1" ]; then
|
||||||
|
if have ufw; then
|
||||||
|
# Keep it minimal: allow SSH and rate-limit
|
||||||
|
sudo ufw --force reset || true
|
||||||
|
sudo ufw default deny incoming
|
||||||
|
sudo ufw default allow outgoing
|
||||||
|
sudo ufw allow OpenSSH || sudo ufw allow 22/tcp
|
||||||
|
sudo ufw limit OpenSSH || true
|
||||||
|
sudo ufw --force enable
|
||||||
|
elif have firewall-cmd; then
|
||||||
|
systemd_enable_now firewalld
|
||||||
|
sudo firewall-cmd --permanent --add-service=ssh || sudo firewall-cmd --permanent --add-port=22/tcp
|
||||||
|
sudo firewall-cmd --reload || true
|
||||||
|
else
|
||||||
|
echo "No supported firewall tool detected; skipping." >&2
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ----------- unattended / automatic updates -----------
|
||||||
|
if [ "$AUTO_UPDATES" = "1" ] && [ -n "$pm" ]; then
|
||||||
|
case "$pm" in
|
||||||
|
apt)
|
||||||
|
pm_update_install unattended-upgrades apt-listchanges || true
|
||||||
|
sudo dpkg-reconfigure -f noninteractive unattended-upgrades || true
|
||||||
|
sudo tee /etc/apt/apt.conf.d/20auto-upgrades >/dev/null <<'EOF'
|
||||||
|
APT::Periodic::Update-Package-Lists "1";
|
||||||
|
APT::Periodic::Unattended-Upgrade "1";
|
||||||
|
APT::Periodic::AutocleanInterval "7";
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
dnf)
|
||||||
|
pm_update_install dnf-automatic || true
|
||||||
|
sudo sed -i 's/^apply_updates = .*/apply_updates = yes/' /etc/dnf/automatic.conf || true
|
||||||
|
systemd_enable_now dnf-automatic.timer
|
||||||
|
;;
|
||||||
|
yum)
|
||||||
|
pm_update_install yum-cron || true
|
||||||
|
sudo sed -i 's/apply_updates = no/apply_updates = yes/' /etc/yum/yum-cron.conf || true
|
||||||
|
systemd_enable_now yum-cron
|
||||||
|
;;
|
||||||
|
zypper)
|
||||||
|
pm_update_install pkgconf-pkg-config || true
|
||||||
|
# SUSE has automatic updates via transactional-update / yast2-online-update; skipping heavy config.
|
||||||
|
;;
|
||||||
|
apk)
|
||||||
|
# Alpine: no official unattended updater; consider periodic 'apk upgrade' via cron (skipped by default).
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ----------- time sync -----------
|
||||||
|
if [ "$TIME_SYNC" = "1" ]; then
|
||||||
|
if have timedatectl; then
|
||||||
|
# Prefer systemd-timesyncd if available; else install/enable chrony
|
||||||
|
if [ -f /lib/systemd/system/systemd-timesyncd.service ] || [ -f /usr/lib/systemd/system/systemd-timesyncd.service ]; then
|
||||||
|
systemd_enable_now systemd-timesyncd
|
||||||
|
else
|
||||||
|
pm_update_install chrony || true
|
||||||
|
systemd_enable_now chronyd || systemd_enable_now chrony || true
|
||||||
|
fi
|
||||||
|
timedatectl set-ntp true || true
|
||||||
|
else
|
||||||
|
pm_update_install chrony || true
|
||||||
|
systemd_enable_now chronyd || systemd_enable_now chrony || true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ----------- fail2ban (basic sshd jail) -----------
|
||||||
|
if [ "$FAIL2BAN" = "1" ]; then
|
||||||
|
pm_update_install fail2ban || true
|
||||||
|
if [ -d /etc/fail2ban ]; then
|
||||||
|
sudo tee /etc/fail2ban/jail.d/sshd.local >/dev/null <<'EOF'
|
||||||
|
[sshd]
|
||||||
|
enabled = true
|
||||||
|
port = ssh
|
||||||
|
logpath = %(sshd_log)s
|
||||||
|
maxretry = 4
|
||||||
|
bantime = 1h
|
||||||
|
findtime = 10m
|
||||||
|
EOF
|
||||||
|
systemd_enable_now fail2ban
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ----------- SSH banner / MOTD -----------
|
||||||
|
if [ "$BANNER" = "1" ]; then
|
||||||
|
if [ -w /etc/issue.net ] || sudo test -w /etc/issue.net; then
|
||||||
|
sudo tee /etc/issue.net >/dev/null <<'EOF'
|
||||||
|
NOTICE: Authorized use only. Activity may be monitored and reported.
|
||||||
|
EOF
|
||||||
|
# Ensure banner is enabled via our bastion conf
|
||||||
|
if [ -d /etc/ssh/sshd_config.d ]; then
|
||||||
|
if ! grep -q '^Banner ' /etc/ssh/sshd_config.d/10-bastion.conf 2>/dev/null; then
|
||||||
|
echo 'Banner /etc/issue.net' | sudo tee -a /etc/ssh/sshd_config.d/10-bastion.conf >/dev/null
|
||||||
|
sshd_reload
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Bootstrap complete. If you were added to the docker group, log out and back in to apply."
|
||||||
`
|
`
|
||||||
|
|
||||||
// Send script via stdin to avoid quoting/escaping issues
|
// Send script via stdin to avoid quoting/escaping issues
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import (
|
|||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
DbURL string
|
DbURL string
|
||||||
|
DbURLRO string
|
||||||
Port string
|
Port string
|
||||||
Host string
|
Host string
|
||||||
JWTIssuer string
|
JWTIssuer string
|
||||||
@@ -29,6 +30,12 @@ type Config struct {
|
|||||||
Debug bool
|
Debug bool
|
||||||
Swagger bool
|
Swagger bool
|
||||||
SwaggerHost string
|
SwaggerHost string
|
||||||
|
|
||||||
|
DBStudioEnabled bool
|
||||||
|
DBStudioBind string
|
||||||
|
DBStudioPort string
|
||||||
|
DBStudioUser string
|
||||||
|
DBStudioPass string
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -48,6 +55,12 @@ func Load() (Config, error) {
|
|||||||
v.SetDefault("bind.address", "127.0.0.1")
|
v.SetDefault("bind.address", "127.0.0.1")
|
||||||
v.SetDefault("bind.port", "8080")
|
v.SetDefault("bind.port", "8080")
|
||||||
v.SetDefault("database.url", "postgres://user:pass@localhost:5432/db?sslmode=disable")
|
v.SetDefault("database.url", "postgres://user:pass@localhost:5432/db?sslmode=disable")
|
||||||
|
v.SetDefault("database.url_ro", "")
|
||||||
|
v.SetDefault("db_studio.enabled", false)
|
||||||
|
v.SetDefault("db_studio.bind", "127.0.0.1")
|
||||||
|
v.SetDefault("db_studio.port", "0") // 0 = random
|
||||||
|
v.SetDefault("db_studio.user", "")
|
||||||
|
v.SetDefault("db_studio.pass", "")
|
||||||
|
|
||||||
v.SetDefault("ui.dev", false)
|
v.SetDefault("ui.dev", false)
|
||||||
v.SetDefault("env", "development")
|
v.SetDefault("env", "development")
|
||||||
@@ -63,6 +76,7 @@ func Load() (Config, error) {
|
|||||||
"bind.address",
|
"bind.address",
|
||||||
"bind.port",
|
"bind.port",
|
||||||
"database.url",
|
"database.url",
|
||||||
|
"database.url_ro",
|
||||||
"jwt.issuer",
|
"jwt.issuer",
|
||||||
"jwt.audience",
|
"jwt.audience",
|
||||||
"jwt.private.enc.key",
|
"jwt.private.enc.key",
|
||||||
@@ -76,6 +90,11 @@ func Load() (Config, error) {
|
|||||||
"debug",
|
"debug",
|
||||||
"swagger",
|
"swagger",
|
||||||
"swagger.host",
|
"swagger.host",
|
||||||
|
"db_studio.enabled",
|
||||||
|
"db_studio.bind",
|
||||||
|
"db_studio.port",
|
||||||
|
"db_studio.user",
|
||||||
|
"db_studio.pass",
|
||||||
}
|
}
|
||||||
for _, k := range keys {
|
for _, k := range keys {
|
||||||
_ = v.BindEnv(k)
|
_ = v.BindEnv(k)
|
||||||
@@ -84,6 +103,7 @@ func Load() (Config, error) {
|
|||||||
// Build config
|
// Build config
|
||||||
cfg := Config{
|
cfg := Config{
|
||||||
DbURL: v.GetString("database.url"),
|
DbURL: v.GetString("database.url"),
|
||||||
|
DbURLRO: v.GetString("database.url_ro"),
|
||||||
Port: v.GetString("bind.port"),
|
Port: v.GetString("bind.port"),
|
||||||
Host: v.GetString("bind.address"),
|
Host: v.GetString("bind.address"),
|
||||||
JWTIssuer: v.GetString("jwt.issuer"),
|
JWTIssuer: v.GetString("jwt.issuer"),
|
||||||
@@ -100,6 +120,12 @@ func Load() (Config, error) {
|
|||||||
Debug: v.GetBool("debug"),
|
Debug: v.GetBool("debug"),
|
||||||
Swagger: v.GetBool("swagger"),
|
Swagger: v.GetBool("swagger"),
|
||||||
SwaggerHost: v.GetString("swagger.host"),
|
SwaggerHost: v.GetString("swagger.host"),
|
||||||
|
|
||||||
|
DBStudioEnabled: v.GetBool("db_studio.enabled"),
|
||||||
|
DBStudioBind: v.GetString("db_studio.bind"),
|
||||||
|
DBStudioPort: v.GetString("db_studio.port"),
|
||||||
|
DBStudioUser: v.GetString("db_studio.user"),
|
||||||
|
DBStudioPass: v.GetString("db_studio.pass"),
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate
|
// Validate
|
||||||
|
|||||||
@@ -273,6 +273,21 @@ func AuthCallback(db *gorm.DB) http.HandlerFunc {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
secure := strings.HasPrefix(cfg.OAuthRedirectBase, "https://")
|
||||||
|
if xf := r.Header.Get("X-Forwarded-Proto"); xf != "" {
|
||||||
|
secure = strings.EqualFold(xf, "https")
|
||||||
|
}
|
||||||
|
|
||||||
|
http.SetCookie(w, &http.Cookie{
|
||||||
|
Name: "ag_jwt",
|
||||||
|
Value: "Bearer " + access,
|
||||||
|
Path: "/",
|
||||||
|
HttpOnly: true,
|
||||||
|
SameSite: http.SameSiteLaxMode,
|
||||||
|
Secure: secure,
|
||||||
|
MaxAge: int((time.Hour * 8).Seconds()),
|
||||||
|
})
|
||||||
|
|
||||||
// If the state indicates SPA popup mode, postMessage tokens to the opener and close
|
// If the state indicates SPA popup mode, postMessage tokens to the opener and close
|
||||||
state := r.URL.Query().Get("state")
|
state := r.URL.Query().Get("state")
|
||||||
if strings.Contains(state, "mode=spa") {
|
if strings.Contains(state, "mode=spa") {
|
||||||
@@ -377,6 +392,7 @@ func Refresh(db *gorm.DB) http.HandlerFunc {
|
|||||||
// @Router /auth/logout [post]
|
// @Router /auth/logout [post]
|
||||||
func Logout(db *gorm.DB) http.HandlerFunc {
|
func Logout(db *gorm.DB) http.HandlerFunc {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
cfg, _ := config.Load()
|
||||||
var req dto.LogoutRequest
|
var req dto.LogoutRequest
|
||||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||||
utils.WriteError(w, 400, "invalid_json", err.Error())
|
utils.WriteError(w, 400, "invalid_json", err.Error())
|
||||||
@@ -385,13 +401,27 @@ func Logout(db *gorm.DB) http.HandlerFunc {
|
|||||||
rec, err := auth.ValidateRefreshToken(db, req.RefreshToken)
|
rec, err := auth.ValidateRefreshToken(db, req.RefreshToken)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
w.WriteHeader(204) // already invalid/revoked
|
w.WriteHeader(204) // already invalid/revoked
|
||||||
return
|
goto clearCookie
|
||||||
}
|
}
|
||||||
if err := auth.RevokeFamily(db, rec.FamilyID); err != nil {
|
if err := auth.RevokeFamily(db, rec.FamilyID); err != nil {
|
||||||
utils.WriteError(w, 500, "revoke_failed", err.Error())
|
utils.WriteError(w, 500, "revoke_failed", err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clearCookie:
|
||||||
|
http.SetCookie(w, &http.Cookie{
|
||||||
|
Name: "ag_jwt",
|
||||||
|
Value: "",
|
||||||
|
Path: "/",
|
||||||
|
HttpOnly: true,
|
||||||
|
MaxAge: -1,
|
||||||
|
Expires: time.Unix(0, 0),
|
||||||
|
SameSite: http.SameSiteLaxMode,
|
||||||
|
Secure: strings.HasPrefix(cfg.OAuthRedirectBase, "https"),
|
||||||
|
})
|
||||||
|
|
||||||
w.WriteHeader(204)
|
w.WriteHeader(204)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
186
internal/handlers/clusters.go
Normal file
186
internal/handlers/clusters.go
Normal file
@@ -0,0 +1,186 @@
|
|||||||
|
package handlers
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/glueops/autoglue/internal/api/httpmiddleware"
|
||||||
|
"github.com/glueops/autoglue/internal/common"
|
||||||
|
"github.com/glueops/autoglue/internal/handlers/dto"
|
||||||
|
"github.com/glueops/autoglue/internal/models"
|
||||||
|
"github.com/glueops/autoglue/internal/utils"
|
||||||
|
"gorm.io/gorm"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ListClusters godoc
|
||||||
|
//
|
||||||
|
// @ID ListClusters
|
||||||
|
// @Summary List clusters (org scoped)
|
||||||
|
// @Description Returns clusters for the organization in X-Org-ID. Filter by `q` (name contains).
|
||||||
|
// @Tags Clusters
|
||||||
|
// @Produce json
|
||||||
|
// @Param X-Org-ID header string false "Organization UUID"
|
||||||
|
// @Param q query string false "Name contains (case-insensitive)"
|
||||||
|
// @Success 200 {array} dto.ClusterResponse
|
||||||
|
// @Failure 401 {string} string "Unauthorized"
|
||||||
|
// @Failure 403 {string} string "organization required"
|
||||||
|
// @Failure 500 {string} string "failed to list clusters"
|
||||||
|
// @Router /clusters [get]
|
||||||
|
// @Security BearerAuth
|
||||||
|
// @Security OrgKeyAuth
|
||||||
|
// @Security OrgSecretAuth
|
||||||
|
func ListClusters(db *gorm.DB) http.HandlerFunc {
|
||||||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
orgID, ok := httpmiddleware.OrgIDFrom(r.Context())
|
||||||
|
if !ok {
|
||||||
|
utils.WriteError(w, http.StatusForbidden, "org_required", "specify X-Org-ID")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
q := db.Where("organization_id = ?", orgID)
|
||||||
|
if needle := strings.TrimSpace(r.URL.Query().Get("q")); needle != "" {
|
||||||
|
q = q.Where(`name ILIKE ?`, "%"+needle+"%")
|
||||||
|
}
|
||||||
|
|
||||||
|
var rows []models.Cluster
|
||||||
|
if err := q.
|
||||||
|
Preload("NodePools").
|
||||||
|
Preload("NodePools.Labels").
|
||||||
|
Preload("NodePools.Annotations").
|
||||||
|
Preload("NodePools.Labels").
|
||||||
|
Preload("NodePools.Taints").
|
||||||
|
Preload("NodePools.Servers").
|
||||||
|
Preload("BastionServer").
|
||||||
|
Find(&rows).Error; err != nil {
|
||||||
|
utils.WriteError(w, http.StatusInternalServerError, "db_error", "db error")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
out := make([]dto.ClusterResponse, 0, len(rows))
|
||||||
|
for _, row := range rows {
|
||||||
|
out = append(out, clusterToDTO(row))
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateCluster godoc
|
||||||
|
//
|
||||||
|
// @ID CreateCluster
|
||||||
|
// @Summary Create cluster (org scoped)
|
||||||
|
// @Description Creates a cluster. If `kubeconfig` is provided, it will be encrypted per-organization and stored securely (never returned).
|
||||||
|
// @Tags Clusters
|
||||||
|
// @Accept json
|
||||||
|
// @Produce json
|
||||||
|
// @Param X-Org-ID header string false "Organization UUID"
|
||||||
|
// @Param body body dto.CreateClusterRequest true "payload"
|
||||||
|
// @Success 201 {object} dto.ClusterResponse
|
||||||
|
// @Failure 400 {string} string "invalid json"
|
||||||
|
// @Failure 401 {string} string "Unauthorized"
|
||||||
|
// @Failure 403 {string} string "organization required"
|
||||||
|
// @Failure 500 {string} string "create failed"
|
||||||
|
// @Router /clusters [post]
|
||||||
|
// @Security BearerAuth
|
||||||
|
// @Security OrgKeyAuth
|
||||||
|
// @Security OrgSecretAuth
|
||||||
|
func CreateCluster(db *gorm.DB) http.HandlerFunc {
|
||||||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
w.WriteHeader(http.StatusNoContent)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// -- Helpers
|
||||||
|
|
||||||
|
func clusterToDTO(c models.Cluster) dto.ClusterResponse {
|
||||||
|
var bastion *dto.ServerResponse
|
||||||
|
if c.BastionServer != nil {
|
||||||
|
b := serverToDTO(*c.BastionServer)
|
||||||
|
bastion = &b
|
||||||
|
}
|
||||||
|
|
||||||
|
nps := make([]dto.NodePoolResponse, 0, len(c.NodePools))
|
||||||
|
for _, np := range c.NodePools {
|
||||||
|
nps = append(nps, nodePoolToDTO(np))
|
||||||
|
}
|
||||||
|
|
||||||
|
return dto.ClusterResponse{
|
||||||
|
ID: c.ID,
|
||||||
|
Name: c.Name,
|
||||||
|
Provider: c.Provider,
|
||||||
|
Region: c.Region,
|
||||||
|
Status: c.Status,
|
||||||
|
CaptainDomain: c.CaptainDomain,
|
||||||
|
//ClusterLoadBalancer: c.ClusterLoadBalancer,
|
||||||
|
RandomToken: c.RandomToken,
|
||||||
|
CertificateKey: c.CertificateKey,
|
||||||
|
//ControlLoadBalancer: c.ControlLoadBalancer,
|
||||||
|
NodePools: nps,
|
||||||
|
BastionServer: bastion,
|
||||||
|
CreatedAt: c.CreatedAt,
|
||||||
|
UpdatedAt: c.UpdatedAt,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func nodePoolToDTO(np models.NodePool) dto.NodePoolResponse {
|
||||||
|
labels := make([]dto.LabelResponse, 0, len(np.Labels))
|
||||||
|
for _, l := range np.Labels {
|
||||||
|
labels = append(labels, dto.LabelResponse{
|
||||||
|
Key: l.Key,
|
||||||
|
Value: l.Value,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
annotations := make([]dto.AnnotationResponse, 0, len(np.Annotations))
|
||||||
|
for _, a := range np.Annotations {
|
||||||
|
annotations = append(annotations, dto.AnnotationResponse{
|
||||||
|
Key: a.Key,
|
||||||
|
Value: a.Value,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
taints := make([]dto.TaintResponse, 0, len(np.Taints))
|
||||||
|
for _, t := range np.Taints {
|
||||||
|
taints = append(taints, dto.TaintResponse{
|
||||||
|
Key: t.Key,
|
||||||
|
Value: t.Value,
|
||||||
|
Effect: t.Effect,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
servers := make([]dto.ServerResponse, 0, len(np.Servers))
|
||||||
|
for _, s := range np.Servers {
|
||||||
|
servers = append(servers, serverToDTO(s))
|
||||||
|
}
|
||||||
|
|
||||||
|
return dto.NodePoolResponse{
|
||||||
|
AuditFields: common.AuditFields{
|
||||||
|
ID: np.ID,
|
||||||
|
OrganizationID: np.OrganizationID,
|
||||||
|
CreatedAt: np.CreatedAt,
|
||||||
|
UpdatedAt: np.UpdatedAt,
|
||||||
|
},
|
||||||
|
Name: np.Name,
|
||||||
|
Role: dto.NodeRole(np.Role),
|
||||||
|
Labels: labels,
|
||||||
|
Annotations: annotations,
|
||||||
|
Taints: taints,
|
||||||
|
Servers: servers,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func serverToDTO(s models.Server) dto.ServerResponse {
|
||||||
|
return dto.ServerResponse{
|
||||||
|
ID: s.ID,
|
||||||
|
Hostname: s.Hostname,
|
||||||
|
PrivateIPAddress: s.PrivateIPAddress,
|
||||||
|
PublicIPAddress: s.PublicIPAddress,
|
||||||
|
Role: s.Role,
|
||||||
|
Status: s.Status,
|
||||||
|
SSHUser: s.SSHUser,
|
||||||
|
SshKeyID: s.SshKeyID,
|
||||||
|
CreatedAt: s.CreatedAt.UTC().Format(time.RFC3339),
|
||||||
|
UpdatedAt: s.UpdatedAt.UTC().Format(time.RFC3339),
|
||||||
|
}
|
||||||
|
}
|
||||||
561
internal/handlers/credentials.go
Normal file
561
internal/handlers/credentials.go
Normal file
@@ -0,0 +1,561 @@
|
|||||||
|
package handlers
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"context"
|
||||||
|
"crypto/sha256"
|
||||||
|
"encoding/hex"
|
||||||
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
"sort"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/glueops/autoglue/internal/api/httpmiddleware"
|
||||||
|
"github.com/glueops/autoglue/internal/handlers/dto"
|
||||||
|
"github.com/glueops/autoglue/internal/models"
|
||||||
|
"github.com/glueops/autoglue/internal/utils"
|
||||||
|
"github.com/go-chi/chi/v5"
|
||||||
|
"github.com/google/uuid"
|
||||||
|
"gorm.io/datatypes"
|
||||||
|
"gorm.io/gorm"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ListCredentials godoc
|
||||||
|
// @ID ListCredentials
|
||||||
|
// @Summary List credentials (metadata only)
|
||||||
|
// @Description Returns credential metadata for the current org. Secrets are never returned.
|
||||||
|
// @Tags Credentials
|
||||||
|
// @Accept json
|
||||||
|
// @Produce json
|
||||||
|
// @Param X-Org-ID header string false "Organization ID (UUID)"
|
||||||
|
// @Param provider query string false "Filter by provider (e.g., aws)"
|
||||||
|
// @Param kind query string false "Filter by kind (e.g., aws_access_key)"
|
||||||
|
// @Param scope_kind query string false "Filter by scope kind (provider/service/resource)"
|
||||||
|
// @Success 200 {array} dto.CredentialOut
|
||||||
|
// @Failure 401 {string} string "Unauthorized"
|
||||||
|
// @Failure 403 {string} string "organization required"
|
||||||
|
// @Failure 500 {string} string "internal server error"
|
||||||
|
// @Router /credentials [get]
|
||||||
|
// @Security BearerAuth
|
||||||
|
// @Security OrgKeyAuth
|
||||||
|
// @Security OrgSecretAuth
|
||||||
|
func ListCredentials(db *gorm.DB) http.HandlerFunc {
|
||||||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
orgID, ok := httpmiddleware.OrgIDFrom(r.Context())
|
||||||
|
if !ok {
|
||||||
|
utils.WriteError(w, http.StatusForbidden, "org_required", "specify X-Org-ID")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
q := db.Where("organization_id = ?", orgID)
|
||||||
|
if v := r.URL.Query().Get("provider"); v != "" {
|
||||||
|
q = q.Where("provider = ?", v)
|
||||||
|
}
|
||||||
|
if v := r.URL.Query().Get("kind"); v != "" {
|
||||||
|
q = q.Where("kind = ?", v)
|
||||||
|
}
|
||||||
|
if v := r.URL.Query().Get("scope_kind"); v != "" {
|
||||||
|
q = q.Where("scope_kind = ?", v)
|
||||||
|
}
|
||||||
|
|
||||||
|
var rows []models.Credential
|
||||||
|
if err := q.Order("updated_at DESC").Find(&rows).Error; err != nil {
|
||||||
|
utils.WriteError(w, http.StatusInternalServerError, "db_error", err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
out := make([]dto.CredentialOut, 0, len(rows))
|
||||||
|
for i := range rows {
|
||||||
|
out = append(out, credOut(&rows[i]))
|
||||||
|
}
|
||||||
|
utils.WriteJSON(w, http.StatusOK, out)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetCredential godoc
|
||||||
|
// @ID GetCredential
|
||||||
|
// @Summary Get credential by ID (metadata only)
|
||||||
|
// @Tags Credentials
|
||||||
|
// @Accept json
|
||||||
|
// @Produce json
|
||||||
|
// @Param X-Org-ID header string false "Organization ID (UUID)"
|
||||||
|
// @Param id path string true "Credential ID (UUID)"
|
||||||
|
// @Success 200 {object} dto.CredentialOut
|
||||||
|
// @Failure 401 {string} string "Unauthorized"
|
||||||
|
// @Failure 403 {string} string "organization required"
|
||||||
|
// @Failure 500 {string} string "internal server error"
|
||||||
|
// @Router /credentials/{id} [get]
|
||||||
|
// @Security BearerAuth
|
||||||
|
// @Security OrgKeyAuth
|
||||||
|
// @Security OrgSecretAuth
|
||||||
|
func GetCredential(db *gorm.DB) http.HandlerFunc {
|
||||||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
orgID, ok := httpmiddleware.OrgIDFrom(r.Context())
|
||||||
|
if !ok {
|
||||||
|
utils.WriteError(w, http.StatusForbidden, "org_required", "specify X-Org-ID")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
idStr := chi.URLParam(r, "id")
|
||||||
|
id, err := uuid.Parse(idStr)
|
||||||
|
if err != nil {
|
||||||
|
utils.WriteError(w, http.StatusBadRequest, "bad_id", "invalid UUID")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var row models.Credential
|
||||||
|
if err := db.Where("organization_id = ? AND id = ?", orgID, id).First(&row).Error; err != nil {
|
||||||
|
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||||
|
utils.WriteError(w, http.StatusNotFound, "not_found", "credential not found")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
utils.WriteError(w, http.StatusInternalServerError, "db_error", err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
utils.WriteJSON(w, http.StatusOK, credOut(&row))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// CreateCredential godoc
|
||||||
|
// @ID CreateCredential
|
||||||
|
// @Summary Create a credential (encrypts secret)
|
||||||
|
// @Tags Credentials
|
||||||
|
// @Accept json
|
||||||
|
// @Produce json
|
||||||
|
// @Param X-Org-ID header string false "Organization ID (UUID)"
|
||||||
|
// @Param body body dto.CreateCredentialRequest true "Credential payload"
|
||||||
|
// @Success 201 {object} dto.CredentialOut
|
||||||
|
// @Failure 401 {string} string "Unauthorized"
|
||||||
|
// @Failure 403 {string} string "organization required"
|
||||||
|
// @Failure 500 {string} string "internal server error"
|
||||||
|
// @Router /credentials [post]
|
||||||
|
// @Security BearerAuth
|
||||||
|
// @Security OrgKeyAuth
|
||||||
|
// @Security OrgSecretAuth
|
||||||
|
func CreateCredential(db *gorm.DB) http.HandlerFunc {
|
||||||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
orgID, ok := httpmiddleware.OrgIDFrom(r.Context())
|
||||||
|
if !ok {
|
||||||
|
utils.WriteError(w, http.StatusForbidden, "org_required", "specify X-Org-ID")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var in dto.CreateCredentialRequest
|
||||||
|
if err := json.NewDecoder(r.Body).Decode(&in); err != nil {
|
||||||
|
utils.WriteError(w, http.StatusBadRequest, "bad_json", err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := dto.Validate.Struct(in); err != nil {
|
||||||
|
utils.WriteError(w, http.StatusBadRequest, "validation_error", err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
cred, err := SaveCredentialWithScope(
|
||||||
|
r.Context(), db, orgID,
|
||||||
|
in.Provider, in.Kind, in.SchemaVersion,
|
||||||
|
in.ScopeKind, in.ScopeVersion, json.RawMessage(in.Scope), json.RawMessage(in.Secret),
|
||||||
|
in.Name, in.AccountID, in.Region,
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
utils.WriteError(w, http.StatusBadRequest, "save_failed", err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
utils.WriteJSON(w, http.StatusCreated, credOut(cred))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateCredential godoc
|
||||||
|
// @ID UpdateCredential
|
||||||
|
// @Summary Update credential metadata and/or rotate secret
|
||||||
|
// @Tags Credentials
|
||||||
|
// @Accept json
|
||||||
|
// @Produce json
|
||||||
|
// @Param X-Org-ID header string false "Organization ID (UUID)"
|
||||||
|
// @Param id path string true "Credential ID (UUID)"
|
||||||
|
// @Param body body dto.UpdateCredentialRequest true "Fields to update"
|
||||||
|
// @Success 200 {object} dto.CredentialOut
|
||||||
|
// @Failure 403 {string} string "X-Org-ID required"
|
||||||
|
// @Failure 404 {string} string "not found"
|
||||||
|
// @Router /credentials/{id} [patch]
|
||||||
|
// @Security BearerAuth
|
||||||
|
// @Security OrgKeyAuth
|
||||||
|
// @Security OrgSecretAuth
|
||||||
|
func UpdateCredential(db *gorm.DB) http.HandlerFunc {
|
||||||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
orgID, ok := httpmiddleware.OrgIDFrom(r.Context())
|
||||||
|
if !ok {
|
||||||
|
utils.WriteError(w, http.StatusForbidden, "org_required", "specify X-Org-ID")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
id, err := uuid.Parse(chi.URLParam(r, "id"))
|
||||||
|
if err != nil {
|
||||||
|
utils.WriteError(w, http.StatusBadRequest, "bad_id", "invalid UUID")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var row models.Credential
|
||||||
|
if err := db.Where("organization_id = ? AND id = ?", orgID, id).First(&row).Error; err != nil {
|
||||||
|
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||||
|
utils.WriteError(w, http.StatusNotFound, "not_found", "credential not found")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
utils.WriteError(w, http.StatusInternalServerError, "db_error", err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var in dto.UpdateCredentialRequest
|
||||||
|
if err := json.NewDecoder(r.Body).Decode(&in); err != nil {
|
||||||
|
utils.WriteError(w, http.StatusBadRequest, "bad_json", err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update metadata
|
||||||
|
if in.Name != nil {
|
||||||
|
row.Name = *in.Name
|
||||||
|
}
|
||||||
|
if in.AccountID != nil {
|
||||||
|
row.AccountID = *in.AccountID
|
||||||
|
}
|
||||||
|
if in.Region != nil {
|
||||||
|
row.Region = *in.Region
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update scope (re-validate + fingerprint)
|
||||||
|
if in.ScopeKind != nil || in.Scope != nil || in.ScopeVersion != nil {
|
||||||
|
newKind := row.ScopeKind
|
||||||
|
if in.ScopeKind != nil {
|
||||||
|
newKind = *in.ScopeKind
|
||||||
|
}
|
||||||
|
newVersion := row.ScopeVersion
|
||||||
|
if in.ScopeVersion != nil {
|
||||||
|
newVersion = *in.ScopeVersion
|
||||||
|
}
|
||||||
|
if in.Scope == nil {
|
||||||
|
utils.WriteError(w, http.StatusBadRequest, "validation_error", "scope must be provided when changing scope kind/version")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
prScopes := dto.ScopeRegistry[row.Provider]
|
||||||
|
kScopes := prScopes[newKind]
|
||||||
|
sdef := kScopes[newVersion]
|
||||||
|
dst := sdef.New()
|
||||||
|
if err := json.Unmarshal(*in.Scope, dst); err != nil {
|
||||||
|
utils.WriteError(w, http.StatusBadRequest, "invalid_scope_json", err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if err := sdef.Validate(dst); err != nil {
|
||||||
|
utils.WriteError(w, http.StatusBadRequest, "invalid_scope", err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
canonScope, err := canonicalJSON(dst)
|
||||||
|
if err != nil {
|
||||||
|
utils.WriteError(w, http.StatusInternalServerError, "canon_error", err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
row.Scope = canonScope
|
||||||
|
row.ScopeKind = newKind
|
||||||
|
row.ScopeVersion = newVersion
|
||||||
|
row.ScopeFingerprint = sha256Hex(canonScope)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Rotate secret
|
||||||
|
if in.Secret != nil {
|
||||||
|
// validate against current Provider/Kind/SchemaVersion
|
||||||
|
def := dto.CredentialRegistry[row.Provider][row.Kind][row.SchemaVersion]
|
||||||
|
dst := def.New()
|
||||||
|
if err := json.Unmarshal(*in.Secret, dst); err != nil {
|
||||||
|
utils.WriteError(w, http.StatusBadRequest, "invalid_secret_json", err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if err := def.Validate(dst); err != nil {
|
||||||
|
utils.WriteError(w, http.StatusBadRequest, "invalid_secret", err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
canonSecret, err := canonicalJSON(dst)
|
||||||
|
if err != nil {
|
||||||
|
utils.WriteError(w, http.StatusInternalServerError, "canon_error", err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
cipher, iv, tag, err := utils.EncryptForOrg(orgID, canonSecret, db)
|
||||||
|
if err != nil {
|
||||||
|
utils.WriteError(w, http.StatusInternalServerError, "encrypt_error", err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
row.EncryptedData = cipher
|
||||||
|
row.IV = iv
|
||||||
|
row.Tag = tag
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := db.Save(&row).Error; err != nil {
|
||||||
|
utils.WriteError(w, http.StatusInternalServerError, "db_error", err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
utils.WriteJSON(w, http.StatusOK, credOut(&row))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// DeleteCredential godoc
|
||||||
|
// @ID DeleteCredential
|
||||||
|
// @Summary Delete credential
|
||||||
|
// @Tags Credentials
|
||||||
|
// @Accept json
|
||||||
|
// @Produce json
|
||||||
|
// @Param X-Org-ID header string false "Organization ID (UUID)"
|
||||||
|
// @Param id path string true "Credential ID (UUID)"
|
||||||
|
// @Success 204
|
||||||
|
// @Failure 404 {string} string "not found"
|
||||||
|
// @Router /credentials/{id} [delete]
|
||||||
|
// @Security BearerAuth
|
||||||
|
// @Security OrgKeyAuth
|
||||||
|
// @Security OrgSecretAuth
|
||||||
|
func DeleteCredential(db *gorm.DB) http.HandlerFunc {
|
||||||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
orgID, ok := httpmiddleware.OrgIDFrom(r.Context())
|
||||||
|
if !ok {
|
||||||
|
utils.WriteError(w, http.StatusForbidden, "org_required", "specify X-Org-ID")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
id, err := uuid.Parse(chi.URLParam(r, "id"))
|
||||||
|
if err != nil {
|
||||||
|
utils.WriteError(w, http.StatusBadRequest, "bad_id", "invalid UUID")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
res := db.Where("organization_id = ? AND id = ?", orgID, id).Delete(&models.Credential{})
|
||||||
|
if res.Error != nil {
|
||||||
|
utils.WriteError(w, http.StatusInternalServerError, "db_error", res.Error.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if res.RowsAffected == 0 {
|
||||||
|
utils.WriteError(w, http.StatusNotFound, "not_found", "credential not found")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
w.WriteHeader(http.StatusNoContent)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// RevealCredential godoc
|
||||||
|
// @ID RevealCredential
|
||||||
|
// @Summary Reveal decrypted secret (one-time read)
|
||||||
|
// @Tags Credentials
|
||||||
|
// @Accept json
|
||||||
|
// @Produce json
|
||||||
|
// @Param X-Org-ID header string false "Organization ID (UUID)"
|
||||||
|
// @Param id path string true "Credential ID (UUID)"
|
||||||
|
// @Success 200 {object} map[string]any
|
||||||
|
// @Failure 403 {string} string "organization required"
|
||||||
|
// @Failure 404 {string} string "not found"
|
||||||
|
// @Router /credentials/{id}/reveal [post]
|
||||||
|
// @Security BearerAuth
|
||||||
|
// @Security OrgKeyAuth
|
||||||
|
// @Security OrgSecretAuth
|
||||||
|
func RevealCredential(db *gorm.DB) http.HandlerFunc {
|
||||||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
orgID, ok := httpmiddleware.OrgIDFrom(r.Context())
|
||||||
|
if !ok {
|
||||||
|
utils.WriteError(w, http.StatusForbidden, "org_required", "specify X-Org-ID")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
id, err := uuid.Parse(chi.URLParam(r, "id"))
|
||||||
|
if err != nil {
|
||||||
|
utils.WriteError(w, http.StatusBadRequest, "bad_id", "invalid UUID")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var row models.Credential
|
||||||
|
if err := db.Where("organization_id = ? AND id = ?", orgID, id).First(&row).Error; err != nil {
|
||||||
|
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||||
|
utils.WriteError(w, http.StatusNotFound, "not_found", "credential not found")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
utils.WriteError(w, http.StatusInternalServerError, "db_error", err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
plain, err := utils.DecryptForOrg(orgID, row.EncryptedData, row.IV, row.Tag, db)
|
||||||
|
if err != nil {
|
||||||
|
utils.WriteError(w, http.StatusInternalServerError, "decrypt_error", err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
utils.WriteJSON(w, http.StatusOK, plain)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// -- Helpers
|
||||||
|
|
||||||
|
func canonicalJSON(v any) ([]byte, error) {
|
||||||
|
b, err := json.Marshal(v)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
var m any
|
||||||
|
if err := json.Unmarshal(b, &m); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return marshalSorted(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
func marshalSorted(v any) ([]byte, error) {
|
||||||
|
switch vv := v.(type) {
|
||||||
|
case map[string]any:
|
||||||
|
keys := make([]string, 0, len(vv))
|
||||||
|
for k := range vv {
|
||||||
|
keys = append(keys, k)
|
||||||
|
}
|
||||||
|
sort.Strings(keys)
|
||||||
|
buf := bytes.NewBufferString("{")
|
||||||
|
for i, k := range keys {
|
||||||
|
if i > 0 {
|
||||||
|
buf.WriteByte(',')
|
||||||
|
}
|
||||||
|
kb, _ := json.Marshal(k)
|
||||||
|
buf.Write(kb)
|
||||||
|
buf.WriteByte(':')
|
||||||
|
b, err := marshalSorted(vv[k])
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
buf.Write(b)
|
||||||
|
}
|
||||||
|
buf.WriteByte('}')
|
||||||
|
return buf.Bytes(), nil
|
||||||
|
case []any:
|
||||||
|
buf := bytes.NewBufferString("[")
|
||||||
|
for i, e := range vv {
|
||||||
|
if i > 0 {
|
||||||
|
buf.WriteByte(',')
|
||||||
|
}
|
||||||
|
b, err := marshalSorted(e)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
buf.Write(b)
|
||||||
|
}
|
||||||
|
buf.WriteByte(']')
|
||||||
|
return buf.Bytes(), nil
|
||||||
|
default:
|
||||||
|
return json.Marshal(v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func sha256Hex(b []byte) string {
|
||||||
|
sum := sha256.Sum256(b)
|
||||||
|
return hex.EncodeToString(sum[:])
|
||||||
|
}
|
||||||
|
|
||||||
|
// SaveCredentialWithScope validates secret+scope, encrypts, fingerprints, and stores.
|
||||||
|
func SaveCredentialWithScope(
|
||||||
|
ctx context.Context,
|
||||||
|
db *gorm.DB,
|
||||||
|
orgID uuid.UUID,
|
||||||
|
provider, kind string,
|
||||||
|
schemaVersion int,
|
||||||
|
scopeKind string,
|
||||||
|
scopeVersion int,
|
||||||
|
rawScope json.RawMessage,
|
||||||
|
rawSecret json.RawMessage,
|
||||||
|
name, accountID, region string,
|
||||||
|
) (*models.Credential, error) {
|
||||||
|
// 1) secret shape
|
||||||
|
pv, ok := dto.CredentialRegistry[provider]
|
||||||
|
if !ok {
|
||||||
|
return nil, fmt.Errorf("unknown provider %q", provider)
|
||||||
|
}
|
||||||
|
kv, ok := pv[kind]
|
||||||
|
if !ok {
|
||||||
|
return nil, fmt.Errorf("unknown kind %q for provider %q", kind, provider)
|
||||||
|
}
|
||||||
|
def, ok := kv[schemaVersion]
|
||||||
|
if !ok {
|
||||||
|
return nil, fmt.Errorf("unsupported schema version %d for %s/%s", schemaVersion, provider, kind)
|
||||||
|
}
|
||||||
|
|
||||||
|
secretDst := def.New()
|
||||||
|
if err := json.Unmarshal(rawSecret, secretDst); err != nil {
|
||||||
|
return nil, fmt.Errorf("payload is not valid JSON for %s/%s: %w", provider, kind, err)
|
||||||
|
}
|
||||||
|
if err := def.Validate(secretDst); err != nil {
|
||||||
|
return nil, fmt.Errorf("invalid %s/%s: %w", provider, kind, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2) scope shape
|
||||||
|
prScopes, ok := dto.ScopeRegistry[provider]
|
||||||
|
if !ok {
|
||||||
|
return nil, fmt.Errorf("no scopes registered for provider %q", provider)
|
||||||
|
}
|
||||||
|
kScopes, ok := prScopes[scopeKind]
|
||||||
|
if !ok {
|
||||||
|
return nil, fmt.Errorf("invalid scope_kind %q for provider %q", scopeKind, provider)
|
||||||
|
}
|
||||||
|
sdef, ok := kScopes[scopeVersion]
|
||||||
|
if !ok {
|
||||||
|
return nil, fmt.Errorf("unsupported scope version %d for %s/%s", scopeVersion, provider, scopeKind)
|
||||||
|
}
|
||||||
|
|
||||||
|
scopeDst := sdef.New()
|
||||||
|
if err := json.Unmarshal(rawScope, scopeDst); err != nil {
|
||||||
|
return nil, fmt.Errorf("invalid scope JSON: %w", err)
|
||||||
|
}
|
||||||
|
if err := sdef.Validate(scopeDst); err != nil {
|
||||||
|
return nil, fmt.Errorf("invalid scope: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3) canonicalize scope (also what we persist in plaintext)
|
||||||
|
canonScope, err := canonicalJSON(scopeDst)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
fp := sha256Hex(canonScope) // or HMAC if you have a server-side key
|
||||||
|
|
||||||
|
// 4) canonicalize + encrypt secret
|
||||||
|
canonSecret, err := canonicalJSON(secretDst)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
cipher, iv, tag, err := utils.EncryptForOrg(orgID, canonSecret, db)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("encrypt: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
cred := &models.Credential{
|
||||||
|
OrganizationID: orgID,
|
||||||
|
Provider: provider,
|
||||||
|
Kind: kind,
|
||||||
|
SchemaVersion: schemaVersion,
|
||||||
|
Name: name,
|
||||||
|
ScopeKind: scopeKind,
|
||||||
|
Scope: datatypes.JSON(canonScope),
|
||||||
|
ScopeVersion: scopeVersion,
|
||||||
|
AccountID: accountID,
|
||||||
|
Region: region,
|
||||||
|
ScopeFingerprint: fp,
|
||||||
|
EncryptedData: cipher,
|
||||||
|
IV: iv,
|
||||||
|
Tag: tag,
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := db.WithContext(ctx).Create(cred).Error; err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return cred, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// credOut converts model → response DTO
|
||||||
|
func credOut(c *models.Credential) dto.CredentialOut {
|
||||||
|
return dto.CredentialOut{
|
||||||
|
ID: c.ID.String(),
|
||||||
|
Provider: c.Provider,
|
||||||
|
Kind: c.Kind,
|
||||||
|
SchemaVersion: c.SchemaVersion,
|
||||||
|
Name: c.Name,
|
||||||
|
ScopeKind: c.ScopeKind,
|
||||||
|
ScopeVersion: c.ScopeVersion,
|
||||||
|
Scope: dto.RawJSON(c.Scope),
|
||||||
|
AccountID: c.AccountID,
|
||||||
|
Region: c.Region,
|
||||||
|
CreatedAt: c.CreatedAt.UTC().Format(time.RFC3339),
|
||||||
|
UpdatedAt: c.UpdatedAt.UTC().Format(time.RFC3339),
|
||||||
|
}
|
||||||
|
}
|
||||||
34
internal/handlers/dto/clusters.go
Normal file
34
internal/handlers/dto/clusters.go
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
package dto
|
||||||
|
|
||||||
|
import (
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/google/uuid"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ClusterResponse struct {
|
||||||
|
ID uuid.UUID `json:"id"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
Provider string `json:"provider"`
|
||||||
|
Region string `json:"region"`
|
||||||
|
Status string `json:"status"`
|
||||||
|
CaptainDomain string `json:"captain_domain"`
|
||||||
|
ClusterLoadBalancer string `json:"cluster_load_balancer"`
|
||||||
|
RandomToken string `json:"random_token"`
|
||||||
|
CertificateKey string `json:"certificate_key"`
|
||||||
|
ControlLoadBalancer string `json:"control_load_balancer"`
|
||||||
|
NodePools []NodePoolResponse `json:"node_pools,omitempty"`
|
||||||
|
BastionServer *ServerResponse `json:"bastion_server,omitempty"`
|
||||||
|
CreatedAt time.Time `json:"created_at"`
|
||||||
|
UpdatedAt time.Time `json:"updated_at"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type CreateClusterRequest struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
Provider string `json:"provider"`
|
||||||
|
Region string `json:"region"`
|
||||||
|
Status string `json:"status"`
|
||||||
|
CaptainDomain string `json:"captain_domain"`
|
||||||
|
ClusterLoadBalancer *string `json:"cluster_load_balancer"`
|
||||||
|
ControlLoadBalancer *string `json:"control_load_balancer"`
|
||||||
|
}
|
||||||
138
internal/handlers/dto/credentials.go
Normal file
138
internal/handlers/dto/credentials.go
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
package dto
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
|
||||||
|
"github.com/go-playground/validator/v10"
|
||||||
|
)
|
||||||
|
|
||||||
|
// RawJSON is a swagger-friendly wrapper for json.RawMessage.
|
||||||
|
type RawJSON = json.RawMessage
|
||||||
|
|
||||||
|
var Validate = validator.New()
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
_ = Validate.RegisterValidation("awsarn", func(fl validator.FieldLevel) bool {
|
||||||
|
v := fl.Field().String()
|
||||||
|
return len(v) > 10 && len(v) < 2048 && len(v) >= 4 && v[:4] == "arn:"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/*** Shapes for secrets ***/
|
||||||
|
|
||||||
|
type AWSCredential struct {
|
||||||
|
AccessKeyID string `json:"access_key_id" validate:"required,alphanum,len=20"`
|
||||||
|
SecretAccessKey string `json:"secret_access_key" validate:"required"`
|
||||||
|
Region string `json:"region" validate:"omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type BasicAuth struct {
|
||||||
|
Username string `json:"username" validate:"required"`
|
||||||
|
Password string `json:"password" validate:"required"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type APIToken struct {
|
||||||
|
Token string `json:"token" validate:"required"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type OAuth2Credential struct {
|
||||||
|
ClientID string `json:"client_id" validate:"required"`
|
||||||
|
ClientSecret string `json:"client_secret" validate:"required"`
|
||||||
|
RefreshToken string `json:"refresh_token" validate:"required"`
|
||||||
|
}
|
||||||
|
|
||||||
|
/*** Shapes for scopes ***/
|
||||||
|
|
||||||
|
type AWSProviderScope struct{}
|
||||||
|
|
||||||
|
type AWSServiceScope struct {
|
||||||
|
Service string `json:"service" validate:"required,oneof=route53 s3 ec2 iam rds dynamodb"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type AWSResourceScope struct {
|
||||||
|
ARN string `json:"arn" validate:"required,awsarn"`
|
||||||
|
}
|
||||||
|
|
||||||
|
/*** Registries ***/
|
||||||
|
|
||||||
|
type ProviderDef struct {
|
||||||
|
New func() any
|
||||||
|
Validate func(any) error
|
||||||
|
}
|
||||||
|
|
||||||
|
type ScopeDef struct {
|
||||||
|
New func() any
|
||||||
|
Validate func(any) error
|
||||||
|
Specificity int // 0=provider, 1=service, 2=resource
|
||||||
|
}
|
||||||
|
|
||||||
|
// Secret shapes per provider/kind/version
|
||||||
|
|
||||||
|
var CredentialRegistry = map[string]map[string]map[int]ProviderDef{
|
||||||
|
"aws": {
|
||||||
|
"aws_access_key": {
|
||||||
|
1: {New: func() any { return &AWSCredential{} }, Validate: func(x any) error { return Validate.Struct(x) }},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"cloudflare": {"api_token": {1: {New: func() any { return &APIToken{} }, Validate: func(x any) error { return Validate.Struct(x) }}}},
|
||||||
|
"hetzner": {"api_token": {1: {New: func() any { return &APIToken{} }, Validate: func(x any) error { return Validate.Struct(x) }}}},
|
||||||
|
"digitalocean": {"api_token": {1: {New: func() any { return &APIToken{} }, Validate: func(x any) error { return Validate.Struct(x) }}}},
|
||||||
|
"generic": {
|
||||||
|
"basic_auth": {1: {New: func() any { return &BasicAuth{} }, Validate: func(x any) error { return Validate.Struct(x) }}},
|
||||||
|
"oauth2": {1: {New: func() any { return &OAuth2Credential{} }, Validate: func(x any) error { return Validate.Struct(x) }}},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
// Scope shapes per provider/scopeKind/version
|
||||||
|
|
||||||
|
var ScopeRegistry = map[string]map[string]map[int]ScopeDef{
|
||||||
|
"aws": {
|
||||||
|
"provider": {1: {New: func() any { return &AWSProviderScope{} }, Validate: func(any) error { return nil }, Specificity: 0}},
|
||||||
|
"service": {1: {New: func() any { return &AWSServiceScope{} }, Validate: func(x any) error { return Validate.Struct(x) }, Specificity: 1}},
|
||||||
|
"resource": {1: {New: func() any { return &AWSResourceScope{} }, Validate: func(x any) error { return Validate.Struct(x) }, Specificity: 2}},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
/*** API DTOs used by swagger ***/
|
||||||
|
|
||||||
|
// CreateCredentialRequest represents the POST /credentials payload
|
||||||
|
type CreateCredentialRequest struct {
|
||||||
|
Provider string `json:"provider" validate:"required,oneof=aws cloudflare hetzner digitalocean generic"`
|
||||||
|
Kind string `json:"kind" validate:"required"` // aws_access_key, api_token, basic_auth, oauth2
|
||||||
|
SchemaVersion int `json:"schema_version" validate:"required,gte=1"` // secret schema version
|
||||||
|
Name string `json:"name" validate:"omitempty,max=100"` // human label
|
||||||
|
ScopeKind string `json:"scope_kind" validate:"required,oneof=provider service resource"`
|
||||||
|
ScopeVersion int `json:"scope_version" validate:"required,gte=1"` // scope schema version
|
||||||
|
Scope RawJSON `json:"scope" validate:"required" swaggertype:"object"` // {"service":"route53"} or {"arn":"..."}
|
||||||
|
AccountID string `json:"account_id,omitempty" validate:"omitempty,max=32"`
|
||||||
|
Region string `json:"region,omitempty" validate:"omitempty,max=32"`
|
||||||
|
Secret RawJSON `json:"secret" validate:"required" swaggertype:"object"` // encrypted later
|
||||||
|
}
|
||||||
|
|
||||||
|
// UpdateCredentialRequest represents PATCH /credentials/{id}
|
||||||
|
type UpdateCredentialRequest struct {
|
||||||
|
Name *string `json:"name,omitempty"`
|
||||||
|
AccountID *string `json:"account_id,omitempty"`
|
||||||
|
Region *string `json:"region,omitempty"`
|
||||||
|
ScopeKind *string `json:"scope_kind,omitempty"`
|
||||||
|
ScopeVersion *int `json:"scope_version,omitempty"`
|
||||||
|
Scope *RawJSON `json:"scope,omitempty" swaggertype:"object"`
|
||||||
|
Secret *RawJSON `json:"secret,omitempty" swaggertype:"object"` // set if rotating
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// CredentialOut is what we return (no secrets)
|
||||||
|
type CredentialOut struct {
|
||||||
|
ID string `json:"id"`
|
||||||
|
Provider string `json:"provider"`
|
||||||
|
Kind string `json:"kind"`
|
||||||
|
SchemaVersion int `json:"schema_version"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
ScopeKind string `json:"scope_kind"`
|
||||||
|
ScopeVersion int `json:"scope_version"`
|
||||||
|
Scope RawJSON `json:"scope" swaggertype:"object"`
|
||||||
|
AccountID string `json:"account_id,omitempty"`
|
||||||
|
Region string `json:"region,omitempty"`
|
||||||
|
CreatedAt string `json:"created_at"`
|
||||||
|
UpdatedAt string `json:"updated_at"`
|
||||||
|
}
|
||||||
@@ -57,6 +57,6 @@ type PageJob struct {
|
|||||||
type EnqueueRequest struct {
|
type EnqueueRequest struct {
|
||||||
Queue string `json:"queue" example:"default"`
|
Queue string `json:"queue" example:"default"`
|
||||||
Type string `json:"type" example:"email.send"`
|
Type string `json:"type" example:"email.send"`
|
||||||
Payload json.RawMessage `json:"payload"`
|
Payload json.RawMessage `json:"payload" swaggertype:"object"`
|
||||||
RunAt *time.Time `json:"run_at" example:"2025-11-05T08:00:00Z"`
|
RunAt *time.Time `json:"run_at" example:"2025-11-05T08:00:00Z"`
|
||||||
}
|
}
|
||||||
|
|||||||
46
internal/handlers/dto/node_pools.go
Normal file
46
internal/handlers/dto/node_pools.go
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
package dto
|
||||||
|
|
||||||
|
import "github.com/glueops/autoglue/internal/common"
|
||||||
|
|
||||||
|
type NodeRole string
|
||||||
|
|
||||||
|
const (
|
||||||
|
NodeRoleMaster NodeRole = "master"
|
||||||
|
NodeRoleWorker NodeRole = "worker"
|
||||||
|
)
|
||||||
|
|
||||||
|
type CreateNodePoolRequest struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
Role NodeRole `json:"role" enums:"master,worker" swaggertype:"string"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type UpdateNodePoolRequest struct {
|
||||||
|
Name *string `json:"name"`
|
||||||
|
Role *NodeRole `json:"role" enums:"master,worker" swaggertype:"string"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type NodePoolResponse struct {
|
||||||
|
common.AuditFields
|
||||||
|
Name string `json:"name"`
|
||||||
|
Role NodeRole `json:"role" enums:"master,worker" swaggertype:"string"`
|
||||||
|
Servers []ServerResponse `json:"servers"`
|
||||||
|
Annotations []AnnotationResponse `json:"annotations"`
|
||||||
|
Labels []LabelResponse `json:"labels"`
|
||||||
|
Taints []TaintResponse `json:"taints"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type AttachServersRequest struct {
|
||||||
|
ServerIDs []string `json:"server_ids"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type AttachTaintsRequest struct {
|
||||||
|
TaintIDs []string `json:"taint_ids"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type AttachLabelsRequest struct {
|
||||||
|
LabelIDs []string `json:"label_ids"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type AttachAnnotationsRequest struct {
|
||||||
|
AnnotationIDs []string `json:"annotation_ids"`
|
||||||
|
}
|
||||||
@@ -8,8 +8,8 @@ type CreateServerRequest struct {
|
|||||||
PrivateIPAddress string `json:"private_ip_address"`
|
PrivateIPAddress string `json:"private_ip_address"`
|
||||||
SSHUser string `json:"ssh_user"`
|
SSHUser string `json:"ssh_user"`
|
||||||
SshKeyID string `json:"ssh_key_id"`
|
SshKeyID string `json:"ssh_key_id"`
|
||||||
Role string `json:"role" example:"master|worker|bastion"`
|
Role string `json:"role" example:"master|worker|bastion" enums:"master,worker,bastion"`
|
||||||
Status string `json:"status,omitempty" example:"pending|provisioning|ready|failed"`
|
Status string `json:"status,omitempty" example:"pending|provisioning|ready|failed" enums:"pending,provisioning,ready,failed"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateServerRequest struct {
|
type UpdateServerRequest struct {
|
||||||
@@ -18,8 +18,8 @@ type UpdateServerRequest struct {
|
|||||||
PrivateIPAddress *string `json:"private_ip_address,omitempty"`
|
PrivateIPAddress *string `json:"private_ip_address,omitempty"`
|
||||||
SSHUser *string `json:"ssh_user,omitempty"`
|
SSHUser *string `json:"ssh_user,omitempty"`
|
||||||
SshKeyID *string `json:"ssh_key_id,omitempty"`
|
SshKeyID *string `json:"ssh_key_id,omitempty"`
|
||||||
Role *string `json:"role,omitempty" example:"master|worker|bastion"`
|
Role *string `json:"role" example:"master|worker|bastion" enums:"master,worker,bastion"`
|
||||||
Status *string `json:"status,omitempty" example:"pending|provisioning|ready|failed"`
|
Status *string `json:"status,omitempty" example:"pending|provisioning|ready|failed" enums:"pending,provisioning,ready,failed"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ServerResponse struct {
|
type ServerResponse struct {
|
||||||
@@ -30,8 +30,8 @@ type ServerResponse struct {
|
|||||||
PrivateIPAddress string `json:"private_ip_address"`
|
PrivateIPAddress string `json:"private_ip_address"`
|
||||||
SSHUser string `json:"ssh_user"`
|
SSHUser string `json:"ssh_user"`
|
||||||
SshKeyID uuid.UUID `json:"ssh_key_id"`
|
SshKeyID uuid.UUID `json:"ssh_key_id"`
|
||||||
Role string `json:"role"`
|
Role string `json:"role" example:"master|worker|bastion" enums:"master,worker,bastion"`
|
||||||
Status string `json:"status"`
|
Status string `json:"status,omitempty" example:"pending|provisioning|ready|failed" enums:"pending,provisioning,ready,failed"`
|
||||||
CreatedAt string `json:"created_at,omitempty"`
|
CreatedAt string `json:"created_at,omitempty"`
|
||||||
UpdatedAt string `json:"updated_at,omitempty"`
|
UpdatedAt string `json:"updated_at,omitempty"`
|
||||||
}
|
}
|
||||||
|
|||||||
1270
internal/handlers/node_pools.go
Normal file
1270
internal/handlers/node_pools.go
Normal file
File diff suppressed because it is too large
Load Diff
@@ -382,7 +382,6 @@ func DownloadSSHKey(db *gorm.DB) http.HandlerFunc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if mode == "json" {
|
if mode == "json" {
|
||||||
prefix := keyFilenamePrefix(key.PublicKey)
|
|
||||||
resp := dto.SshMaterialJSON{
|
resp := dto.SshMaterialJSON{
|
||||||
ID: key.ID.String(),
|
ID: key.ID.String(),
|
||||||
Name: key.Name,
|
Name: key.Name,
|
||||||
@@ -392,7 +391,7 @@ func DownloadSSHKey(db *gorm.DB) http.HandlerFunc {
|
|||||||
case "public":
|
case "public":
|
||||||
pub := key.PublicKey
|
pub := key.PublicKey
|
||||||
resp.PublicKey = &pub
|
resp.PublicKey = &pub
|
||||||
resp.Filenames = []string{fmt.Sprintf("%s_%s.pub", prefix, key.ID.String())}
|
resp.Filenames = []string{fmt.Sprintf("%s.pub", key.ID.String())}
|
||||||
utils.WriteJSON(w, http.StatusOK, resp)
|
utils.WriteJSON(w, http.StatusOK, resp)
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -403,7 +402,7 @@ func DownloadSSHKey(db *gorm.DB) http.HandlerFunc {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
resp.PrivatePEM = &plain
|
resp.PrivatePEM = &plain
|
||||||
resp.Filenames = []string{fmt.Sprintf("%s_%s.pem", prefix, key.ID.String())}
|
resp.Filenames = []string{fmt.Sprintf("%s.pem", key.ID.String())}
|
||||||
utils.WriteJSON(w, http.StatusOK, resp)
|
utils.WriteJSON(w, http.StatusOK, resp)
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -416,16 +415,16 @@ func DownloadSSHKey(db *gorm.DB) http.HandlerFunc {
|
|||||||
|
|
||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
zw := zip.NewWriter(&buf)
|
zw := zip.NewWriter(&buf)
|
||||||
_ = toZipFile(fmt.Sprintf("%s_%s.pem", prefix, key.ID.String()), []byte(plain), zw)
|
_ = toZipFile(fmt.Sprintf("%s.pem", key.ID.String()), []byte(plain), zw)
|
||||||
_ = toZipFile(fmt.Sprintf("%s_%s.pub", prefix, key.ID.String()), []byte(key.PublicKey), zw)
|
_ = toZipFile(fmt.Sprintf("%s.pub", key.ID.String()), []byte(key.PublicKey), zw)
|
||||||
_ = zw.Close()
|
_ = zw.Close()
|
||||||
|
|
||||||
b64 := utils.EncodeB64(buf.Bytes())
|
b64 := utils.EncodeB64(buf.Bytes())
|
||||||
resp.ZipBase64 = &b64
|
resp.ZipBase64 = &b64
|
||||||
resp.Filenames = []string{
|
resp.Filenames = []string{
|
||||||
fmt.Sprintf("%s_%s.zip", prefix, key.ID.String()),
|
fmt.Sprintf("%s.zip", key.ID.String()),
|
||||||
fmt.Sprintf("%s_%s.pem", prefix, key.ID.String()),
|
fmt.Sprintf("%s.pem", key.ID.String()),
|
||||||
fmt.Sprintf("%s_%s.pub", prefix, key.ID.String()),
|
fmt.Sprintf("%s.pub", key.ID.String()),
|
||||||
}
|
}
|
||||||
utils.WriteJSON(w, http.StatusOK, resp)
|
utils.WriteJSON(w, http.StatusOK, resp)
|
||||||
return
|
return
|
||||||
@@ -436,11 +435,9 @@ func DownloadSSHKey(db *gorm.DB) http.HandlerFunc {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
prefix := keyFilenamePrefix(key.PublicKey)
|
|
||||||
|
|
||||||
switch part {
|
switch part {
|
||||||
case "public":
|
case "public":
|
||||||
filename := fmt.Sprintf("%s_%s.pub", prefix, key.ID.String())
|
filename := fmt.Sprintf("%s.pub", key.ID.String())
|
||||||
w.Header().Set("Content-Type", "text/plain")
|
w.Header().Set("Content-Type", "text/plain")
|
||||||
w.Header().Set("Content-Disposition", fmt.Sprintf(`attachment; filename="%s"`, filename))
|
w.Header().Set("Content-Disposition", fmt.Sprintf(`attachment; filename="%s"`, filename))
|
||||||
_, _ = w.Write([]byte(key.PublicKey))
|
_, _ = w.Write([]byte(key.PublicKey))
|
||||||
@@ -452,7 +449,7 @@ func DownloadSSHKey(db *gorm.DB) http.HandlerFunc {
|
|||||||
utils.WriteError(w, http.StatusInternalServerError, "db_error", "failed to decrypt ssh key")
|
utils.WriteError(w, http.StatusInternalServerError, "db_error", "failed to decrypt ssh key")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
filename := fmt.Sprintf("%s_%s.pem", prefix, key.ID.String())
|
filename := fmt.Sprintf("%s.pem", key.ID.String())
|
||||||
w.Header().Set("Content-Type", "application/x-pem-file")
|
w.Header().Set("Content-Type", "application/x-pem-file")
|
||||||
w.Header().Set("Content-Disposition", fmt.Sprintf(`attachment; filename="%s"`, filename))
|
w.Header().Set("Content-Disposition", fmt.Sprintf(`attachment; filename="%s"`, filename))
|
||||||
_, _ = w.Write([]byte(plain))
|
_, _ = w.Write([]byte(plain))
|
||||||
@@ -467,8 +464,8 @@ func DownloadSSHKey(db *gorm.DB) http.HandlerFunc {
|
|||||||
|
|
||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
zw := zip.NewWriter(&buf)
|
zw := zip.NewWriter(&buf)
|
||||||
_ = toZipFile(fmt.Sprintf("%s_%s.pem", prefix, key.ID.String()), []byte(plain), zw)
|
_ = toZipFile(fmt.Sprintf("%s.pem", key.ID.String()), []byte(plain), zw)
|
||||||
_ = toZipFile(fmt.Sprintf("%s_%s.pub", prefix, key.ID.String()), []byte(key.PublicKey), zw)
|
_ = toZipFile(fmt.Sprintf("%s.pub", key.ID.String()), []byte(key.PublicKey), zw)
|
||||||
_ = zw.Close()
|
_ = zw.Close()
|
||||||
|
|
||||||
filename := fmt.Sprintf("ssh_key_%s.zip", key.ID.String())
|
filename := fmt.Sprintf("ssh_key_%s.zip", key.ID.String())
|
||||||
|
|||||||
65
internal/handlers/version.go
Normal file
65
internal/handlers/version.go
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
package handlers
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
"runtime"
|
||||||
|
"runtime/debug"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"github.com/glueops/autoglue/internal/utils"
|
||||||
|
"github.com/glueops/autoglue/internal/version"
|
||||||
|
)
|
||||||
|
|
||||||
|
type VersionResponse struct {
|
||||||
|
Version string `json:"version" example:"1.4.2"`
|
||||||
|
Commit string `json:"commit" example:"a1b2c3d"`
|
||||||
|
Built string `json:"built" example:"2025-11-08T12:34:56Z"`
|
||||||
|
BuiltBy string `json:"builtBy" example:"ci"`
|
||||||
|
Go string `json:"go" example:"go1.23.3"`
|
||||||
|
GOOS string `json:"goOS" example:"linux"`
|
||||||
|
GOARCH string `json:"goArch" example:"amd64"`
|
||||||
|
VCS string `json:"vcs,omitempty" example:"git"`
|
||||||
|
Revision string `json:"revision,omitempty" example:"a1b2c3d4e5f6abcdef"`
|
||||||
|
CommitTime string `json:"commitTime,omitempty" example:"2025-11-08T12:31:00Z"`
|
||||||
|
Modified *bool `json:"modified,omitempty" example:"false"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Version godoc
|
||||||
|
//
|
||||||
|
// @Summary Service version information
|
||||||
|
// @Description Returns build/runtime metadata for the running service.
|
||||||
|
// @Tags Meta
|
||||||
|
// @ID Version // operationId
|
||||||
|
// @Accept json
|
||||||
|
// @Produce json
|
||||||
|
// @Success 200 {object} VersionResponse
|
||||||
|
// @Router /version [get]
|
||||||
|
func Version(w http.ResponseWriter, r *http.Request) {
|
||||||
|
resp := VersionResponse{
|
||||||
|
Version: version.Version,
|
||||||
|
Commit: version.Commit,
|
||||||
|
Built: version.Date,
|
||||||
|
BuiltBy: version.BuiltBy,
|
||||||
|
Go: runtime.Version(),
|
||||||
|
GOOS: runtime.GOOS,
|
||||||
|
GOARCH: runtime.GOARCH,
|
||||||
|
}
|
||||||
|
|
||||||
|
if bi, ok := debug.ReadBuildInfo(); ok {
|
||||||
|
for _, s := range bi.Settings {
|
||||||
|
switch s.Key {
|
||||||
|
case "vcs":
|
||||||
|
resp.VCS = s.Value
|
||||||
|
case "vcs.revision":
|
||||||
|
resp.Revision = s.Value
|
||||||
|
case "vcs.time":
|
||||||
|
resp.CommitTime = s.Value
|
||||||
|
case "vcs.modified":
|
||||||
|
if b, err := strconv.ParseBool(s.Value); err == nil {
|
||||||
|
resp.Modified = &b
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
utils.WriteJSON(w, http.StatusOK, resp)
|
||||||
|
}
|
||||||
@@ -9,4 +9,5 @@ type Annotation struct {
|
|||||||
Organization Organization `gorm:"foreignKey:OrganizationID;constraint:OnDelete:CASCADE" json:"organization"`
|
Organization Organization `gorm:"foreignKey:OrganizationID;constraint:OnDelete:CASCADE" json:"organization"`
|
||||||
Key string `gorm:"not null" json:"key"`
|
Key string `gorm:"not null" json:"key"`
|
||||||
Value string `gorm:"not null" json:"value"`
|
Value string `gorm:"not null" json:"value"`
|
||||||
|
NodePools []NodePool `gorm:"many2many:node_annotations;constraint:OnDelete:CASCADE" json:"node_pools,omitempty"`
|
||||||
}
|
}
|
||||||
|
|||||||
33
internal/models/cluster.go
Normal file
33
internal/models/cluster.go
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
package models
|
||||||
|
|
||||||
|
import (
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/google/uuid"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Cluster struct {
|
||||||
|
ID uuid.UUID `gorm:"type:uuid;default:gen_random_uuid();primaryKey" json:"id"`
|
||||||
|
OrganizationID uuid.UUID `gorm:"type:uuid;not null" json:"organization_id"`
|
||||||
|
Organization Organization `gorm:"foreignKey:OrganizationID;constraint:OnDelete:CASCADE" json:"organization"`
|
||||||
|
Name string `gorm:"not null" json:"name"`
|
||||||
|
Provider string `json:"provider"`
|
||||||
|
Region string `json:"region"`
|
||||||
|
Status string `json:"status"`
|
||||||
|
CaptainDomain string `gorm:"not null" json:"captain_domain"` // nonprod.earth.onglueops.rocks
|
||||||
|
AppsLoadBalancer string `json:"cluster_load_balancer"` // {public_ip: 1.2.3.4, private_ip: 10.0.30.1, name: apps.CaqptainDomain}
|
||||||
|
GlueOpsLoadBalancer string `json:"control_load_balancer"` // {public_ip: 5.6.7.8, private_ip: 10.0.22.1, name: CaptainDomain}
|
||||||
|
|
||||||
|
ControlPlane string `json:"control_plane"` // <- dns cntlpn
|
||||||
|
|
||||||
|
RandomToken string `json:"random_token"`
|
||||||
|
CertificateKey string `json:"certificate_key"`
|
||||||
|
EncryptedKubeconfig string `gorm:"type:text" json:"-"`
|
||||||
|
KubeIV string `json:"-"`
|
||||||
|
KubeTag string `json:"-"`
|
||||||
|
NodePools []NodePool `gorm:"many2many:cluster_node_pools;constraint:OnDelete:CASCADE" json:"node_pools,omitempty"`
|
||||||
|
BastionServerID *uuid.UUID `gorm:"type:uuid" json:"bastion_server_id,omitempty"`
|
||||||
|
BastionServer *Server `gorm:"foreignKey:BastionServerID" json:"bastion_server,omitempty"`
|
||||||
|
CreatedAt time.Time `json:"created_at,omitempty" gorm:"type:timestamptz;column:created_at;not null;default:now()"`
|
||||||
|
UpdatedAt time.Time `json:"updated_at,omitempty" gorm:"type:timestamptz;autoUpdateTime;column:updated_at;not null;default:now()"`
|
||||||
|
}
|
||||||
29
internal/models/credential.go
Normal file
29
internal/models/credential.go
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
package models
|
||||||
|
|
||||||
|
import (
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/google/uuid"
|
||||||
|
"gorm.io/datatypes"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Credential struct {
|
||||||
|
ID uuid.UUID `gorm:"type:uuid;primaryKey;default:gen_random_uuid()"`
|
||||||
|
OrganizationID uuid.UUID `gorm:"type:uuid;not null;index" json:"organization_id"`
|
||||||
|
Organization Organization `gorm:"foreignKey:OrganizationID;constraint:OnDelete:CASCADE" json:"organization"`
|
||||||
|
Provider string `gorm:"type:varchar(50);not null;uniqueIndex:uniq_org_provider_scopekind_scope,priority:2;index:idx_provider_kind"`
|
||||||
|
Kind string `gorm:"type:varchar(50);not null;index:idx_provider_kind;index:idx_kind_scope"`
|
||||||
|
ScopeKind string `gorm:"type:varchar(20);not null;uniqueIndex:uniq_org_provider_scopekind_scope,priority:3"`
|
||||||
|
Scope datatypes.JSON `gorm:"type:jsonb;not null;default:'{}';index:idx_kind_scope"`
|
||||||
|
ScopeFingerprint string `gorm:"type:char(64);not null;uniqueIndex:uniq_org_provider_scopekind_scope,priority:4;index"`
|
||||||
|
SchemaVersion int `gorm:"not null;default:1"`
|
||||||
|
Name string `gorm:"type:varchar(100);not null;default:''"`
|
||||||
|
ScopeVersion int `gorm:"not null;default:1"`
|
||||||
|
AccountID string `gorm:"type:varchar(32)"`
|
||||||
|
Region string `gorm:"type:varchar(32)"`
|
||||||
|
EncryptedData string `gorm:"not null"`
|
||||||
|
IV string `gorm:"not null"`
|
||||||
|
Tag string `gorm:"not null"`
|
||||||
|
CreatedAt time.Time `json:"created_at,omitempty" gorm:"type:timestamptz;column:created_at;not null;default:now()" format:"date-time"`
|
||||||
|
UpdatedAt time.Time `json:"updated_at,omitempty" gorm:"type:timestamptz;autoUpdateTime;column:updated_at;not null;default:now()" format:"date-time"`
|
||||||
|
}
|
||||||
21
internal/models/domain.go
Normal file
21
internal/models/domain.go
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
package models
|
||||||
|
|
||||||
|
import (
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/google/uuid"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Domain struct {
|
||||||
|
ID uuid.UUID `gorm:"type:uuid;primaryKey;default:gen_random_uuid()"`
|
||||||
|
OrganizationID uuid.UUID `gorm:"type:uuid;not null;uniqueIndex:idx_credentials_org_provider" json:"organization_id"`
|
||||||
|
Organization Organization `gorm:"foreignKey:OrganizationID;constraint:OnDelete:CASCADE" json:"organization"`
|
||||||
|
ClusterID *uuid.UUID `gorm:"type:uuid" json:"cluster_id,omitempty"`
|
||||||
|
Cluster *Cluster `gorm:"foreignKey:ClusterID" json:"cluster,omitempty"`
|
||||||
|
DomainName string `gorm:"not null;index" json:"domain_name,omitempty"`
|
||||||
|
DomainID string
|
||||||
|
CredentialID uuid.UUID `gorm:"type:uuid;not null" json:"credential_id"`
|
||||||
|
Credential Credential `gorm:"foreignKey:CredentialID" json:"credential,omitempty"`
|
||||||
|
CreatedAt time.Time `json:"created_at,omitempty" gorm:"type:timestamptz;column:created_at;not null;default:now()"`
|
||||||
|
UpdatedAt time.Time `json:"updated_at,omitempty" gorm:"type:timestamptz;autoUpdateTime;column:updated_at;not null;default:now()"`
|
||||||
|
}
|
||||||
@@ -9,5 +9,5 @@ type Label struct {
|
|||||||
Organization Organization `gorm:"foreignKey:OrganizationID;constraint:OnDelete:CASCADE" json:"organization"`
|
Organization Organization `gorm:"foreignKey:OrganizationID;constraint:OnDelete:CASCADE" json:"organization"`
|
||||||
Key string `gorm:"not null" json:"key"`
|
Key string `gorm:"not null" json:"key"`
|
||||||
Value string `gorm:"not null" json:"value"`
|
Value string `gorm:"not null" json:"value"`
|
||||||
NodePools []NodePool `gorm:"many2many:node_labels;constraint:OnDelete:CASCADE" json:"servers,omitempty"`
|
NodePools []NodePool `gorm:"many2many:node_labels;constraint:OnDelete:CASCADE" json:"node_pools,omitempty"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,23 +1,18 @@
|
|||||||
package models
|
package models
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"time"
|
"github.com/glueops/autoglue/internal/common"
|
||||||
|
|
||||||
"github.com/google/uuid"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type NodePool struct {
|
type NodePool struct {
|
||||||
ID uuid.UUID `gorm:"type:uuid;primaryKey;default:gen_random_uuid()" json:"id"`
|
common.AuditFields
|
||||||
OrganizationID uuid.UUID `gorm:"type:uuid;not null" json:"organization_id"`
|
Organization Organization `gorm:"foreignKey:OrganizationID;constraint:OnDelete:CASCADE" json:"organization"`
|
||||||
Organization Organization `gorm:"foreignKey:OrganizationID;constraint:OnDelete:CASCADE" json:"organization"`
|
Name string `gorm:"not null" json:"name"`
|
||||||
Name string `gorm:"not null" json:"name"`
|
Servers []Server `gorm:"many2many:node_servers;constraint:OnDelete:CASCADE" json:"servers,omitempty"`
|
||||||
Servers []Server `gorm:"many2many:node_servers;constraint:OnDelete:CASCADE" json:"servers,omitempty"`
|
Annotations []Annotation `gorm:"many2many:node_annotations;constraint:OnDelete:CASCADE" json:"annotations,omitempty"`
|
||||||
Annotations []Annotation `gorm:"many2many:node_annotations;constraint:OnDelete:CASCADE" json:"annotations,omitempty"`
|
Labels []Label `gorm:"many2many:node_labels;constraint:OnDelete:CASCADE" json:"labels,omitempty"`
|
||||||
Labels []Label `gorm:"many2many:node_labels;constraint:OnDelete:CASCADE" json:"labels,omitempty"`
|
Taints []Taint `gorm:"many2many:node_taints;constraint:OnDelete:CASCADE" json:"taints,omitempty"`
|
||||||
Taints []Taint `gorm:"many2many:node_taints;constraint:OnDelete:CASCADE" json:"taints,omitempty"`
|
Clusters []Cluster `gorm:"many2many:cluster_node_pools;constraint:OnDelete:CASCADE" json:"clusters,omitempty"`
|
||||||
//Clusters []Cluster `gorm:"many2many:cluster_node_pools;constraint:OnDelete:CASCADE" json:"clusters,omitempty"`
|
|
||||||
//Topology string `gorm:"not null,default:'stacked'" json:"topology,omitempty"` // stacked or external
|
//Topology string `gorm:"not null,default:'stacked'" json:"topology,omitempty"` // stacked or external
|
||||||
Role string `gorm:"not null,default:'worker'" json:"role,omitempty"` // master, worker, or etcd (etcd only if topology = external
|
Role string `gorm:"not null,default:'worker'" json:"role,omitempty"` // master, worker, or etcd (etcd only if topology = external
|
||||||
CreatedAt time.Time `gorm:"not null;default:now()" json:"created_at" format:"date-time"`
|
|
||||||
UpdatedAt time.Time `gorm:"not null;default:now()" json:"updated_at" format:"date-time"`
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,8 +19,9 @@ type Server struct {
|
|||||||
SSHUser string `gorm:"not null" json:"ssh_user"`
|
SSHUser string `gorm:"not null" json:"ssh_user"`
|
||||||
SshKeyID uuid.UUID `gorm:"type:uuid;not null" json:"ssh_key_id"`
|
SshKeyID uuid.UUID `gorm:"type:uuid;not null" json:"ssh_key_id"`
|
||||||
SshKey SshKey `gorm:"foreignKey:SshKeyID" json:"ssh_key"`
|
SshKey SshKey `gorm:"foreignKey:SshKeyID" json:"ssh_key"`
|
||||||
Role string `gorm:"not null" json:"role"` // e.g., "master", "worker", "bastion"
|
Role string `gorm:"not null" json:"role" enums:"master,worker,bastion"` // e.g., "master", "worker", "bastion"
|
||||||
Status string `gorm:"default:'pending'" json:"status"` // pending, provisioning, ready, failed
|
Status string `gorm:"default:'pending'" json:"status" enums:"pending, provisioning, ready, failed"` // pending, provisioning, ready, failed
|
||||||
|
NodePools []NodePool `gorm:"many2many:node_servers;constraint:OnDelete:CASCADE" json:"node_pools,omitempty"`
|
||||||
CreatedAt time.Time `gorm:"not null;default:now()" json:"created_at" format:"date-time"`
|
CreatedAt time.Time `gorm:"not null;default:now()" json:"created_at" format:"date-time"`
|
||||||
UpdatedAt time.Time `gorm:"not null;default:now()" json:"updated_at" format:"date-time"`
|
UpdatedAt time.Time `gorm:"not null;default:now()" json:"updated_at" format:"date-time"`
|
||||||
}
|
}
|
||||||
|
|||||||
79
internal/web/dist/assets/index-52pog1DZ.js
vendored
Normal file
79
internal/web/dist/assets/index-52pog1DZ.js
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
internal/web/dist/assets/index-52pog1DZ.js.br
vendored
Normal file
BIN
internal/web/dist/assets/index-52pog1DZ.js.br
vendored
Normal file
Binary file not shown.
BIN
internal/web/dist/assets/index-52pog1DZ.js.gz
vendored
Normal file
BIN
internal/web/dist/assets/index-52pog1DZ.js.gz
vendored
Normal file
Binary file not shown.
1
internal/web/dist/assets/index-52pog1DZ.js.map
vendored
Normal file
1
internal/web/dist/assets/index-52pog1DZ.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
2
internal/web/dist/assets/index-CjaTfP6H.css
vendored
2
internal/web/dist/assets/index-CjaTfP6H.css
vendored
File diff suppressed because one or more lines are too long
BIN
internal/web/dist/assets/index-CjaTfP6H.css.br
vendored
BIN
internal/web/dist/assets/index-CjaTfP6H.css.br
vendored
Binary file not shown.
BIN
internal/web/dist/assets/index-CjaTfP6H.css.gz
vendored
BIN
internal/web/dist/assets/index-CjaTfP6H.css.gz
vendored
Binary file not shown.
79
internal/web/dist/assets/index-DbPirwVN.js
vendored
79
internal/web/dist/assets/index-DbPirwVN.js
vendored
File diff suppressed because one or more lines are too long
BIN
internal/web/dist/assets/index-DbPirwVN.js.br
vendored
BIN
internal/web/dist/assets/index-DbPirwVN.js.br
vendored
Binary file not shown.
BIN
internal/web/dist/assets/index-DbPirwVN.js.gz
vendored
BIN
internal/web/dist/assets/index-DbPirwVN.js.gz
vendored
Binary file not shown.
File diff suppressed because one or more lines are too long
2
internal/web/dist/assets/index-tX4seA_J.css
vendored
Normal file
2
internal/web/dist/assets/index-tX4seA_J.css
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
internal/web/dist/assets/index-tX4seA_J.css.br
vendored
Normal file
BIN
internal/web/dist/assets/index-tX4seA_J.css.br
vendored
Normal file
Binary file not shown.
BIN
internal/web/dist/assets/index-tX4seA_J.css.gz
vendored
Normal file
BIN
internal/web/dist/assets/index-tX4seA_J.css.gz
vendored
Normal file
Binary file not shown.
BIN
internal/web/dist/assets/react-B75e6Si-.js.gz
vendored
BIN
internal/web/dist/assets/react-B75e6Si-.js.gz
vendored
Binary file not shown.
4
internal/web/dist/index.html
vendored
4
internal/web/dist/index.html
vendored
@@ -5,9 +5,9 @@
|
|||||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>AutoGlue</title>
|
<title>AutoGlue</title>
|
||||||
<script type="module" crossorigin src="/assets/index-DbPirwVN.js"></script>
|
<script type="module" crossorigin src="/assets/index-52pog1DZ.js"></script>
|
||||||
<link rel="modulepreload" crossorigin href="/assets/react-B75e6Si-.js">
|
<link rel="modulepreload" crossorigin href="/assets/react-B75e6Si-.js">
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-CjaTfP6H.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-tX4seA_J.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
|||||||
BIN
internal/web/dist/index.html.br
vendored
BIN
internal/web/dist/index.html.br
vendored
Binary file not shown.
BIN
internal/web/dist/index.html.gz
vendored
BIN
internal/web/dist/index.html.gz
vendored
Binary file not shown.
3
internal/web/dist/vite.svg
vendored
3
internal/web/dist/vite.svg
vendored
@@ -1 +1,2 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88"
|
||||||
|
height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
||||||
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.4 KiB |
85
internal/web/pgweb_embed.go
Normal file
85
internal/web/pgweb_embed.go
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
package web
|
||||||
|
|
||||||
|
import (
|
||||||
|
"crypto/sha256"
|
||||||
|
"embed"
|
||||||
|
"encoding/hex"
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
|
)
|
||||||
|
|
||||||
|
//go:embed pgwebbin/*
|
||||||
|
var pgwebFS embed.FS
|
||||||
|
|
||||||
|
type pgwebAsset struct {
|
||||||
|
Path string
|
||||||
|
SHA256 string
|
||||||
|
}
|
||||||
|
|
||||||
|
var pgwebIndex = map[string]pgwebAsset{
|
||||||
|
"linux/amd64": {Path: "pgwebbin/pgweb-linux-amd64", SHA256: ""},
|
||||||
|
"linux/arm64": {Path: "pgwebbin/pgweb-linux-arm64", SHA256: ""},
|
||||||
|
"darwin/amd64": {Path: "pgwebbin/pgweb-darwin-amd64", SHA256: ""},
|
||||||
|
"darwin/arm64": {Path: "pgwebbin/pgweb-darwin-arm64", SHA256: ""},
|
||||||
|
}
|
||||||
|
|
||||||
|
func ExtractPgweb() (string, error) {
|
||||||
|
key := runtime.GOOS + "/" + runtime.GOARCH
|
||||||
|
as, ok := pgwebIndex[key]
|
||||||
|
if !ok {
|
||||||
|
return "", fmt.Errorf("pgweb not embedded for %s", key)
|
||||||
|
}
|
||||||
|
f, err := pgwebFS.Open(as.Path)
|
||||||
|
if err != nil {
|
||||||
|
return "", fmt.Errorf("embedded pgweb missing: %w", err)
|
||||||
|
}
|
||||||
|
defer f.Close()
|
||||||
|
|
||||||
|
tmpDir, err := os.MkdirTemp("", "pgweb-*")
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
filename := "pgweb"
|
||||||
|
if runtime.GOOS == "windows" {
|
||||||
|
filename += ".exe"
|
||||||
|
}
|
||||||
|
outPath := filepath.Join(tmpDir, filename)
|
||||||
|
|
||||||
|
out, err := os.OpenFile(outPath, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0o700)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
defer out.Close()
|
||||||
|
|
||||||
|
h := sha256.New()
|
||||||
|
if _, err = io.Copy(io.MultiWriter(out, h), f); err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
if as.SHA256 != "" {
|
||||||
|
got := hex.EncodeToString(h.Sum(nil))
|
||||||
|
if got != as.SHA256 {
|
||||||
|
return "", fmt.Errorf("pgweb checksum mismatch: got=%s want=%s", got, as.SHA256)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Make sure it’s executable on Unix; Windows ignores this.
|
||||||
|
_ = os.Chmod(outPath, 0o700)
|
||||||
|
return outPath, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func CleanupPgweb(pgwebPath string) error {
|
||||||
|
if pgwebPath == "" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
dir := filepath.Dir(pgwebPath)
|
||||||
|
if dir == "" || dir == "/" || dir == "." {
|
||||||
|
return errors.New("refusing to remove suspicious directory")
|
||||||
|
}
|
||||||
|
return os.RemoveAll(dir)
|
||||||
|
}
|
||||||
106
internal/web/pgweb_proxy.go
Normal file
106
internal/web/pgweb_proxy.go
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
package web
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"net"
|
||||||
|
"net/http"
|
||||||
|
"net/http/httputil"
|
||||||
|
"net/url"
|
||||||
|
"os"
|
||||||
|
"os/exec"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Pgweb struct {
|
||||||
|
cmd *exec.Cmd
|
||||||
|
host string
|
||||||
|
port string
|
||||||
|
bin string
|
||||||
|
}
|
||||||
|
|
||||||
|
func StartPgweb(dbURL, host, port string, readonly bool, user, pass string) (*Pgweb, error) {
|
||||||
|
// pick random port if 0/empty
|
||||||
|
if port == "" || port == "0" {
|
||||||
|
l, err := net.Listen("tcp", net.JoinHostPort(host, "0"))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
defer l.Close()
|
||||||
|
_, p, _ := net.SplitHostPort(l.Addr().String())
|
||||||
|
port = p
|
||||||
|
}
|
||||||
|
|
||||||
|
args := []string{
|
||||||
|
"--url", dbURL,
|
||||||
|
"--bind", host,
|
||||||
|
"--listen", port,
|
||||||
|
"--skip-open",
|
||||||
|
}
|
||||||
|
if readonly {
|
||||||
|
args = append(args, "--readonly")
|
||||||
|
}
|
||||||
|
if user != "" && pass != "" {
|
||||||
|
args = append(args, "--auth-user", user, "--auth-pass", pass)
|
||||||
|
}
|
||||||
|
|
||||||
|
pgwebBinary, err := ExtractPgweb()
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("pgweb extract: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
cmd := exec.Command(pgwebBinary, args...)
|
||||||
|
cmd.Stdout = os.Stdout
|
||||||
|
cmd.Stderr = os.Stderr
|
||||||
|
|
||||||
|
if err := cmd.Start(); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// wait for port to be ready
|
||||||
|
deadline := time.Now().Add(4 * time.Second)
|
||||||
|
for time.Now().Before(deadline) {
|
||||||
|
c, err := net.DialTimeout("tcp", net.JoinHostPort(host, port), 200*time.Millisecond)
|
||||||
|
if err == nil {
|
||||||
|
_ = c.Close()
|
||||||
|
return &Pgweb{cmd: cmd, host: host, port: port}, nil
|
||||||
|
}
|
||||||
|
time.Sleep(120 * time.Millisecond)
|
||||||
|
}
|
||||||
|
// still return object so caller can Stop()
|
||||||
|
//return &Pgweb{cmd: cmd, host: host, port: port, bin: pgwebBinary}, nil
|
||||||
|
return nil, fmt.Errorf("pgweb did not become ready on %s:%s", host, port)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *Pgweb) Proxy() http.HandlerFunc {
|
||||||
|
target, _ := url.Parse("http://" + net.JoinHostPort(p.host, p.port))
|
||||||
|
proxy := httputil.NewSingleHostReverseProxy(target)
|
||||||
|
proxy.FlushInterval = 100 * time.Millisecond
|
||||||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
r.Host = target.Host
|
||||||
|
// Let pgweb handle its paths; we mount it at a prefix.
|
||||||
|
proxy.ServeHTTP(w, r)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *Pgweb) Stop(ctx context.Context) error {
|
||||||
|
if p == nil || p.cmd == nil || p.cmd.Process == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
_ = p.cmd.Process.Kill()
|
||||||
|
done := make(chan struct{})
|
||||||
|
go func() { _, _ = p.cmd.Process.Wait(); close(done) }()
|
||||||
|
select {
|
||||||
|
case <-done:
|
||||||
|
if p.bin != "" {
|
||||||
|
_ = CleanupPgweb(p.bin)
|
||||||
|
}
|
||||||
|
case <-ctx.Done():
|
||||||
|
return ctx.Err()
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *Pgweb) Port() string {
|
||||||
|
return p.port
|
||||||
|
}
|
||||||
BIN
internal/web/pgwebbin/pgweb-darwin-amd64
Executable file
BIN
internal/web/pgwebbin/pgweb-darwin-amd64
Executable file
Binary file not shown.
BIN
internal/web/pgwebbin/pgweb-darwin-arm64
Executable file
BIN
internal/web/pgwebbin/pgweb-darwin-arm64
Executable file
Binary file not shown.
BIN
internal/web/pgwebbin/pgweb-linux-amd64
Executable file
BIN
internal/web/pgwebbin/pgweb-linux-amd64
Executable file
Binary file not shown.
BIN
internal/web/pgwebbin/pgweb-linux-arm64
Executable file
BIN
internal/web/pgwebbin/pgweb-linux-arm64
Executable file
Binary file not shown.
@@ -61,6 +61,7 @@ func SPAHandler() (http.Handler, error) {
|
|||||||
if strings.HasPrefix(r.URL.Path, "/api/") ||
|
if strings.HasPrefix(r.URL.Path, "/api/") ||
|
||||||
r.URL.Path == "/api" ||
|
r.URL.Path == "/api" ||
|
||||||
strings.HasPrefix(r.URL.Path, "/swagger") ||
|
strings.HasPrefix(r.URL.Path, "/swagger") ||
|
||||||
|
strings.HasPrefix(r.URL.Path, "/db-studio") ||
|
||||||
strings.HasPrefix(r.URL.Path, "/debug/pprof") {
|
strings.HasPrefix(r.URL.Path, "/debug/pprof") {
|
||||||
http.NotFound(w, r)
|
http.NotFound(w, r)
|
||||||
return
|
return
|
||||||
|
|||||||
24
sdk/go/.gitignore
vendored
24
sdk/go/.gitignore
vendored
@@ -1,24 +0,0 @@
|
|||||||
# Compiled Object files, Static and Dynamic libs (Shared Objects)
|
|
||||||
*.o
|
|
||||||
*.a
|
|
||||||
*.so
|
|
||||||
|
|
||||||
# Folders
|
|
||||||
_obj
|
|
||||||
_test
|
|
||||||
|
|
||||||
# Architecture specific extensions/prefixes
|
|
||||||
*.[568vq]
|
|
||||||
[568vq].out
|
|
||||||
|
|
||||||
*.cgo1.go
|
|
||||||
*.cgo2.c
|
|
||||||
_cgo_defun.c
|
|
||||||
_cgo_gotypes.go
|
|
||||||
_cgo_export.*
|
|
||||||
|
|
||||||
_testmain.go
|
|
||||||
|
|
||||||
*.exe
|
|
||||||
*.test
|
|
||||||
*.prof
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
# OpenAPI Generator Ignore
|
|
||||||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
|
||||||
|
|
||||||
# Use this file to prevent files from being overwritten by the generator.
|
|
||||||
# The patterns follow closely to .gitignore or .dockerignore.
|
|
||||||
|
|
||||||
# As an example, the C# client generator defines ApiClient.cs.
|
|
||||||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
|
||||||
#ApiClient.cs
|
|
||||||
|
|
||||||
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
|
||||||
#foo/*/qux
|
|
||||||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
|
||||||
|
|
||||||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
|
||||||
#foo/**/qux
|
|
||||||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
|
||||||
|
|
||||||
# You can also negate patterns with an exclamation (!).
|
|
||||||
# For example, you can ignore all files in a docs folder with the file extension .md:
|
|
||||||
#docs/*.md
|
|
||||||
# Then explicitly reverse the ignore rule for a single file:
|
|
||||||
#!docs/README.md
|
|
||||||
@@ -1,127 +0,0 @@
|
|||||||
.gitignore
|
|
||||||
.openapi-generator-ignore
|
|
||||||
.travis.yml
|
|
||||||
README.md
|
|
||||||
api/openapi.yaml
|
|
||||||
api_annotations.go
|
|
||||||
api_archer_admin.go
|
|
||||||
api_auth.go
|
|
||||||
api_health.go
|
|
||||||
api_labels.go
|
|
||||||
api_me.go
|
|
||||||
api_me_api_keys.go
|
|
||||||
api_orgs.go
|
|
||||||
api_servers.go
|
|
||||||
api_ssh.go
|
|
||||||
api_taints.go
|
|
||||||
client.go
|
|
||||||
configuration.go
|
|
||||||
docs/AnnotationsAPI.md
|
|
||||||
docs/ArcherAdminAPI.md
|
|
||||||
docs/AuthAPI.md
|
|
||||||
docs/DtoAnnotationResponse.md
|
|
||||||
docs/DtoAuthStartResponse.md
|
|
||||||
docs/DtoCreateAnnotationRequest.md
|
|
||||||
docs/DtoCreateLabelRequest.md
|
|
||||||
docs/DtoCreateSSHRequest.md
|
|
||||||
docs/DtoCreateServerRequest.md
|
|
||||||
docs/DtoCreateTaintRequest.md
|
|
||||||
docs/DtoJWK.md
|
|
||||||
docs/DtoJWKS.md
|
|
||||||
docs/DtoJob.md
|
|
||||||
docs/DtoJobStatus.md
|
|
||||||
docs/DtoLabelResponse.md
|
|
||||||
docs/DtoLogoutRequest.md
|
|
||||||
docs/DtoPageJob.md
|
|
||||||
docs/DtoQueueInfo.md
|
|
||||||
docs/DtoRefreshRequest.md
|
|
||||||
docs/DtoServerResponse.md
|
|
||||||
docs/DtoSshResponse.md
|
|
||||||
docs/DtoSshRevealResponse.md
|
|
||||||
docs/DtoTaintResponse.md
|
|
||||||
docs/DtoTokenPair.md
|
|
||||||
docs/DtoUpdateAnnotationRequest.md
|
|
||||||
docs/DtoUpdateLabelRequest.md
|
|
||||||
docs/DtoUpdateServerRequest.md
|
|
||||||
docs/DtoUpdateTaintRequest.md
|
|
||||||
docs/HandlersCreateUserKeyRequest.md
|
|
||||||
docs/HandlersHealthStatus.md
|
|
||||||
docs/HandlersMeResponse.md
|
|
||||||
docs/HandlersMemberOut.md
|
|
||||||
docs/HandlersMemberUpsertReq.md
|
|
||||||
docs/HandlersOrgCreateReq.md
|
|
||||||
docs/HandlersOrgKeyCreateReq.md
|
|
||||||
docs/HandlersOrgKeyCreateResp.md
|
|
||||||
docs/HandlersOrgUpdateReq.md
|
|
||||||
docs/HandlersUpdateMeRequest.md
|
|
||||||
docs/HandlersUserAPIKeyOut.md
|
|
||||||
docs/HealthAPI.md
|
|
||||||
docs/LabelsAPI.md
|
|
||||||
docs/MeAPI.md
|
|
||||||
docs/MeAPIKeysAPI.md
|
|
||||||
docs/ModelsAPIKey.md
|
|
||||||
docs/ModelsOrganization.md
|
|
||||||
docs/ModelsUser.md
|
|
||||||
docs/ModelsUserEmail.md
|
|
||||||
docs/OrgsAPI.md
|
|
||||||
docs/ServersAPI.md
|
|
||||||
docs/SshAPI.md
|
|
||||||
docs/TaintsAPI.md
|
|
||||||
docs/UtilsErrorResponse.md
|
|
||||||
git_push.sh
|
|
||||||
go.mod
|
|
||||||
go.sum
|
|
||||||
model_dto_annotation_response.go
|
|
||||||
model_dto_auth_start_response.go
|
|
||||||
model_dto_create_annotation_request.go
|
|
||||||
model_dto_create_label_request.go
|
|
||||||
model_dto_create_server_request.go
|
|
||||||
model_dto_create_ssh_request.go
|
|
||||||
model_dto_create_taint_request.go
|
|
||||||
model_dto_job.go
|
|
||||||
model_dto_job_status.go
|
|
||||||
model_dto_jwk.go
|
|
||||||
model_dto_jwks.go
|
|
||||||
model_dto_label_response.go
|
|
||||||
model_dto_logout_request.go
|
|
||||||
model_dto_page_job.go
|
|
||||||
model_dto_queue_info.go
|
|
||||||
model_dto_refresh_request.go
|
|
||||||
model_dto_server_response.go
|
|
||||||
model_dto_ssh_response.go
|
|
||||||
model_dto_ssh_reveal_response.go
|
|
||||||
model_dto_taint_response.go
|
|
||||||
model_dto_token_pair.go
|
|
||||||
model_dto_update_annotation_request.go
|
|
||||||
model_dto_update_label_request.go
|
|
||||||
model_dto_update_server_request.go
|
|
||||||
model_dto_update_taint_request.go
|
|
||||||
model_handlers_create_user_key_request.go
|
|
||||||
model_handlers_health_status.go
|
|
||||||
model_handlers_me_response.go
|
|
||||||
model_handlers_member_out.go
|
|
||||||
model_handlers_member_upsert_req.go
|
|
||||||
model_handlers_org_create_req.go
|
|
||||||
model_handlers_org_key_create_req.go
|
|
||||||
model_handlers_org_key_create_resp.go
|
|
||||||
model_handlers_org_update_req.go
|
|
||||||
model_handlers_update_me_request.go
|
|
||||||
model_handlers_user_api_key_out.go
|
|
||||||
model_models_api_key.go
|
|
||||||
model_models_organization.go
|
|
||||||
model_models_user.go
|
|
||||||
model_models_user_email.go
|
|
||||||
model_utils_error_response.go
|
|
||||||
response.go
|
|
||||||
test/api_annotations_test.go
|
|
||||||
test/api_archer_admin_test.go
|
|
||||||
test/api_auth_test.go
|
|
||||||
test/api_health_test.go
|
|
||||||
test/api_labels_test.go
|
|
||||||
test/api_me_api_keys_test.go
|
|
||||||
test/api_me_test.go
|
|
||||||
test/api_orgs_test.go
|
|
||||||
test/api_servers_test.go
|
|
||||||
test/api_ssh_test.go
|
|
||||||
test/api_taints_test.go
|
|
||||||
utils.go
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
7.17.0
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
language: go
|
|
||||||
|
|
||||||
install:
|
|
||||||
- go get -d -v .
|
|
||||||
|
|
||||||
script:
|
|
||||||
- go build -v ./
|
|
||||||
|
|
||||||
288
sdk/go/README.md
288
sdk/go/README.md
@@ -1,288 +0,0 @@
|
|||||||
# Go API client for autoglue
|
|
||||||
|
|
||||||
API for managing K3s clusters across cloud providers
|
|
||||||
|
|
||||||
## Overview
|
|
||||||
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client.
|
|
||||||
|
|
||||||
- API version: 1.0
|
|
||||||
- Package version: 1.0.0
|
|
||||||
- Generator version: 7.17.0
|
|
||||||
- Build package: org.openapitools.codegen.languages.GoClientCodegen
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
Install the following dependencies:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
go get github.com/stretchr/testify/assert
|
|
||||||
go get golang.org/x/net/context
|
|
||||||
```
|
|
||||||
|
|
||||||
Put the package under your project folder and add the following in import:
|
|
||||||
|
|
||||||
```go
|
|
||||||
import autoglue "github.com/glueops/autoglue-sdk-go"
|
|
||||||
```
|
|
||||||
|
|
||||||
To use a proxy, set the environment variable `HTTP_PROXY`:
|
|
||||||
|
|
||||||
```go
|
|
||||||
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
|
|
||||||
```
|
|
||||||
|
|
||||||
## Configuration of Server URL
|
|
||||||
|
|
||||||
Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification.
|
|
||||||
|
|
||||||
### Select Server Configuration
|
|
||||||
|
|
||||||
For using other server than the one defined on index 0 set context value `autoglue.ContextServerIndex` of type `int`.
|
|
||||||
|
|
||||||
```go
|
|
||||||
ctx := context.WithValue(context.Background(), autoglue.ContextServerIndex, 1)
|
|
||||||
```
|
|
||||||
|
|
||||||
### Templated Server URL
|
|
||||||
|
|
||||||
Templated server URL is formatted using default variables from configuration or from context value `autoglue.ContextServerVariables` of type `map[string]string`.
|
|
||||||
|
|
||||||
```go
|
|
||||||
ctx := context.WithValue(context.Background(), autoglue.ContextServerVariables, map[string]string{
|
|
||||||
"basePath": "v2",
|
|
||||||
})
|
|
||||||
```
|
|
||||||
|
|
||||||
Note, enum values are always validated and all unused variables are silently ignored.
|
|
||||||
|
|
||||||
### URLs Configuration per Operation
|
|
||||||
|
|
||||||
Each operation can use different server URL defined using `OperationServers` map in the `Configuration`.
|
|
||||||
An operation is uniquely identified by `"{classname}Service.{nickname}"` string.
|
|
||||||
Similar rules for overriding default operation server index and variables applies by using `autoglue.ContextOperationServerIndices` and `autoglue.ContextOperationServerVariables` context maps.
|
|
||||||
|
|
||||||
```go
|
|
||||||
ctx := context.WithValue(context.Background(), autoglue.ContextOperationServerIndices, map[string]int{
|
|
||||||
"{classname}Service.{nickname}": 2,
|
|
||||||
})
|
|
||||||
ctx = context.WithValue(context.Background(), autoglue.ContextOperationServerVariables, map[string]map[string]string{
|
|
||||||
"{classname}Service.{nickname}": {
|
|
||||||
"port": "8443",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
```
|
|
||||||
|
|
||||||
## Documentation for API Endpoints
|
|
||||||
|
|
||||||
All URIs are relative to *http://localhost:8080/api/v1*
|
|
||||||
|
|
||||||
Class | Method | HTTP request | Description
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
*AnnotationsAPI* | [**CreateAnnotation**](docs/AnnotationsAPI.md#createannotation) | **Post** /annotations | Create annotation (org scoped)
|
|
||||||
*AnnotationsAPI* | [**DeleteAnnotation**](docs/AnnotationsAPI.md#deleteannotation) | **Delete** /annotations/{id} | Delete annotation (org scoped)
|
|
||||||
*AnnotationsAPI* | [**GetAnnotation**](docs/AnnotationsAPI.md#getannotation) | **Get** /annotations/{id} | Get annotation by ID (org scoped)
|
|
||||||
*AnnotationsAPI* | [**ListAnnotations**](docs/AnnotationsAPI.md#listannotations) | **Get** /annotations | List annotations (org scoped)
|
|
||||||
*AnnotationsAPI* | [**UpdateAnnotation**](docs/AnnotationsAPI.md#updateannotation) | **Patch** /annotations/{id} | Update annotation (org scoped)
|
|
||||||
*ArcherAdminAPI* | [**AdminCancelArcherJob**](docs/ArcherAdminAPI.md#admincancelarcherjob) | **Post** /admin/archer/jobs/{id}/cancel | Cancel an Archer job (admin)
|
|
||||||
*ArcherAdminAPI* | [**AdminEnqueueArcherJob**](docs/ArcherAdminAPI.md#adminenqueuearcherjob) | **Post** /admin/archer/jobs | Enqueue a new Archer job (admin)
|
|
||||||
*ArcherAdminAPI* | [**AdminListArcherJobs**](docs/ArcherAdminAPI.md#adminlistarcherjobs) | **Get** /admin/archer/jobs | List Archer jobs (admin)
|
|
||||||
*ArcherAdminAPI* | [**AdminListArcherQueues**](docs/ArcherAdminAPI.md#adminlistarcherqueues) | **Get** /admin/archer/queues | List Archer queues (admin)
|
|
||||||
*ArcherAdminAPI* | [**AdminRetryArcherJob**](docs/ArcherAdminAPI.md#adminretryarcherjob) | **Post** /admin/archer/jobs/{id}/retry | Retry a failed/canceled Archer job (admin)
|
|
||||||
*AuthAPI* | [**AuthCallback**](docs/AuthAPI.md#authcallback) | **Get** /auth/{provider}/callback | Handle social login callback
|
|
||||||
*AuthAPI* | [**AuthStart**](docs/AuthAPI.md#authstart) | **Post** /auth/{provider}/start | Begin social login
|
|
||||||
*AuthAPI* | [**GetJWKS**](docs/AuthAPI.md#getjwks) | **Get** /.well-known/jwks.json | Get JWKS
|
|
||||||
*AuthAPI* | [**Logout**](docs/AuthAPI.md#logout) | **Post** /auth/logout | Revoke refresh token family (logout everywhere)
|
|
||||||
*AuthAPI* | [**Refresh**](docs/AuthAPI.md#refresh) | **Post** /auth/refresh | Rotate refresh token
|
|
||||||
*HealthAPI* | [**HealthCheckOperationId**](docs/HealthAPI.md#healthcheckoperationid) | **Get** /healthz | Basic health check
|
|
||||||
*LabelsAPI* | [**CreateLabel**](docs/LabelsAPI.md#createlabel) | **Post** /labels | Create label (org scoped)
|
|
||||||
*LabelsAPI* | [**DeleteLabel**](docs/LabelsAPI.md#deletelabel) | **Delete** /labels/{id} | Delete label (org scoped)
|
|
||||||
*LabelsAPI* | [**GetLabel**](docs/LabelsAPI.md#getlabel) | **Get** /labels/{id} | Get label by ID (org scoped)
|
|
||||||
*LabelsAPI* | [**ListLabels**](docs/LabelsAPI.md#listlabels) | **Get** /labels | List node labels (org scoped)
|
|
||||||
*LabelsAPI* | [**UpdateLabel**](docs/LabelsAPI.md#updatelabel) | **Patch** /labels/{id} | Update label (org scoped)
|
|
||||||
*MeAPI* | [**GetMe**](docs/MeAPI.md#getme) | **Get** /me | Get current user profile
|
|
||||||
*MeAPI* | [**UpdateMe**](docs/MeAPI.md#updateme) | **Patch** /me | Update current user profile
|
|
||||||
*MeAPIKeysAPI* | [**CreateUserAPIKey**](docs/MeAPIKeysAPI.md#createuserapikey) | **Post** /me/api-keys | Create a new user API key
|
|
||||||
*MeAPIKeysAPI* | [**DeleteUserAPIKey**](docs/MeAPIKeysAPI.md#deleteuserapikey) | **Delete** /me/api-keys/{id} | Delete a user API key
|
|
||||||
*MeAPIKeysAPI* | [**ListUserAPIKeys**](docs/MeAPIKeysAPI.md#listuserapikeys) | **Get** /me/api-keys | List my API keys
|
|
||||||
*OrgsAPI* | [**AddOrUpdateMember**](docs/OrgsAPI.md#addorupdatemember) | **Post** /orgs/{id}/members | Add or update a member (owner/admin)
|
|
||||||
*OrgsAPI* | [**CreateOrg**](docs/OrgsAPI.md#createorg) | **Post** /orgs | Create organization
|
|
||||||
*OrgsAPI* | [**CreateOrgKey**](docs/OrgsAPI.md#createorgkey) | **Post** /orgs/{id}/api-keys | Create org key/secret pair (owner/admin)
|
|
||||||
*OrgsAPI* | [**DeleteOrg**](docs/OrgsAPI.md#deleteorg) | **Delete** /orgs/{id} | Delete organization (owner)
|
|
||||||
*OrgsAPI* | [**DeleteOrgKey**](docs/OrgsAPI.md#deleteorgkey) | **Delete** /orgs/{id}/api-keys/{key_id} | Delete org key (owner/admin)
|
|
||||||
*OrgsAPI* | [**GetOrg**](docs/OrgsAPI.md#getorg) | **Get** /orgs/{id} | Get organization
|
|
||||||
*OrgsAPI* | [**ListMembers**](docs/OrgsAPI.md#listmembers) | **Get** /orgs/{id}/members | List members in org
|
|
||||||
*OrgsAPI* | [**ListMyOrgs**](docs/OrgsAPI.md#listmyorgs) | **Get** /orgs | List organizations I belong to
|
|
||||||
*OrgsAPI* | [**ListOrgKeys**](docs/OrgsAPI.md#listorgkeys) | **Get** /orgs/{id}/api-keys | List org-scoped API keys (no secrets)
|
|
||||||
*OrgsAPI* | [**RemoveMember**](docs/OrgsAPI.md#removemember) | **Delete** /orgs/{id}/members/{user_id} | Remove a member (owner/admin)
|
|
||||||
*OrgsAPI* | [**UpdateOrg**](docs/OrgsAPI.md#updateorg) | **Patch** /orgs/{id} | Update organization (owner/admin)
|
|
||||||
*ServersAPI* | [**CreateServer**](docs/ServersAPI.md#createserver) | **Post** /servers | Create server (org scoped)
|
|
||||||
*ServersAPI* | [**DeleteServer**](docs/ServersAPI.md#deleteserver) | **Delete** /servers/{id} | Delete server (org scoped)
|
|
||||||
*ServersAPI* | [**GetServer**](docs/ServersAPI.md#getserver) | **Get** /servers/{id} | Get server by ID (org scoped)
|
|
||||||
*ServersAPI* | [**ListServers**](docs/ServersAPI.md#listservers) | **Get** /servers | List servers (org scoped)
|
|
||||||
*ServersAPI* | [**UpdateServer**](docs/ServersAPI.md#updateserver) | **Patch** /servers/{id} | Update server (org scoped)
|
|
||||||
*SshAPI* | [**CreateSSHKey**](docs/SshAPI.md#createsshkey) | **Post** /ssh | Create ssh keypair (org scoped)
|
|
||||||
*SshAPI* | [**DeleteSSHKey**](docs/SshAPI.md#deletesshkey) | **Delete** /ssh/{id} | Delete ssh keypair (org scoped)
|
|
||||||
*SshAPI* | [**DownloadSSHKey**](docs/SshAPI.md#downloadsshkey) | **Get** /ssh/{id}/download | Download ssh key files by ID (org scoped)
|
|
||||||
*SshAPI* | [**GetSSHKey**](docs/SshAPI.md#getsshkey) | **Get** /ssh/{id} | Get ssh key by ID (org scoped)
|
|
||||||
*SshAPI* | [**ListPublicSshKeys**](docs/SshAPI.md#listpublicsshkeys) | **Get** /ssh | List ssh keys (org scoped)
|
|
||||||
*TaintsAPI* | [**CreateTaint**](docs/TaintsAPI.md#createtaint) | **Post** /taints | Create node taint (org scoped)
|
|
||||||
*TaintsAPI* | [**DeleteTaint**](docs/TaintsAPI.md#deletetaint) | **Delete** /taints/{id} | Delete taint (org scoped)
|
|
||||||
*TaintsAPI* | [**GetTaint**](docs/TaintsAPI.md#gettaint) | **Get** /taints/{id} | Get node taint by ID (org scoped)
|
|
||||||
*TaintsAPI* | [**ListTaints**](docs/TaintsAPI.md#listtaints) | **Get** /taints | List node pool taints (org scoped)
|
|
||||||
*TaintsAPI* | [**UpdateTaint**](docs/TaintsAPI.md#updatetaint) | **Patch** /taints/{id} | Update node taint (org scoped)
|
|
||||||
|
|
||||||
|
|
||||||
## Documentation For Models
|
|
||||||
|
|
||||||
- [DtoAnnotationResponse](docs/DtoAnnotationResponse.md)
|
|
||||||
- [DtoAuthStartResponse](docs/DtoAuthStartResponse.md)
|
|
||||||
- [DtoCreateAnnotationRequest](docs/DtoCreateAnnotationRequest.md)
|
|
||||||
- [DtoCreateLabelRequest](docs/DtoCreateLabelRequest.md)
|
|
||||||
- [DtoCreateSSHRequest](docs/DtoCreateSSHRequest.md)
|
|
||||||
- [DtoCreateServerRequest](docs/DtoCreateServerRequest.md)
|
|
||||||
- [DtoCreateTaintRequest](docs/DtoCreateTaintRequest.md)
|
|
||||||
- [DtoJWK](docs/DtoJWK.md)
|
|
||||||
- [DtoJWKS](docs/DtoJWKS.md)
|
|
||||||
- [DtoJob](docs/DtoJob.md)
|
|
||||||
- [DtoJobStatus](docs/DtoJobStatus.md)
|
|
||||||
- [DtoLabelResponse](docs/DtoLabelResponse.md)
|
|
||||||
- [DtoLogoutRequest](docs/DtoLogoutRequest.md)
|
|
||||||
- [DtoPageJob](docs/DtoPageJob.md)
|
|
||||||
- [DtoQueueInfo](docs/DtoQueueInfo.md)
|
|
||||||
- [DtoRefreshRequest](docs/DtoRefreshRequest.md)
|
|
||||||
- [DtoServerResponse](docs/DtoServerResponse.md)
|
|
||||||
- [DtoSshResponse](docs/DtoSshResponse.md)
|
|
||||||
- [DtoSshRevealResponse](docs/DtoSshRevealResponse.md)
|
|
||||||
- [DtoTaintResponse](docs/DtoTaintResponse.md)
|
|
||||||
- [DtoTokenPair](docs/DtoTokenPair.md)
|
|
||||||
- [DtoUpdateAnnotationRequest](docs/DtoUpdateAnnotationRequest.md)
|
|
||||||
- [DtoUpdateLabelRequest](docs/DtoUpdateLabelRequest.md)
|
|
||||||
- [DtoUpdateServerRequest](docs/DtoUpdateServerRequest.md)
|
|
||||||
- [DtoUpdateTaintRequest](docs/DtoUpdateTaintRequest.md)
|
|
||||||
- [HandlersCreateUserKeyRequest](docs/HandlersCreateUserKeyRequest.md)
|
|
||||||
- [HandlersHealthStatus](docs/HandlersHealthStatus.md)
|
|
||||||
- [HandlersMeResponse](docs/HandlersMeResponse.md)
|
|
||||||
- [HandlersMemberOut](docs/HandlersMemberOut.md)
|
|
||||||
- [HandlersMemberUpsertReq](docs/HandlersMemberUpsertReq.md)
|
|
||||||
- [HandlersOrgCreateReq](docs/HandlersOrgCreateReq.md)
|
|
||||||
- [HandlersOrgKeyCreateReq](docs/HandlersOrgKeyCreateReq.md)
|
|
||||||
- [HandlersOrgKeyCreateResp](docs/HandlersOrgKeyCreateResp.md)
|
|
||||||
- [HandlersOrgUpdateReq](docs/HandlersOrgUpdateReq.md)
|
|
||||||
- [HandlersUpdateMeRequest](docs/HandlersUpdateMeRequest.md)
|
|
||||||
- [HandlersUserAPIKeyOut](docs/HandlersUserAPIKeyOut.md)
|
|
||||||
- [ModelsAPIKey](docs/ModelsAPIKey.md)
|
|
||||||
- [ModelsOrganization](docs/ModelsOrganization.md)
|
|
||||||
- [ModelsUser](docs/ModelsUser.md)
|
|
||||||
- [ModelsUserEmail](docs/ModelsUserEmail.md)
|
|
||||||
- [UtilsErrorResponse](docs/UtilsErrorResponse.md)
|
|
||||||
|
|
||||||
|
|
||||||
## Documentation For Authorization
|
|
||||||
|
|
||||||
|
|
||||||
Authentication schemes defined for the API:
|
|
||||||
### ApiKeyAuth
|
|
||||||
|
|
||||||
- **Type**: API key
|
|
||||||
- **API key parameter name**: X-API-KEY
|
|
||||||
- **Location**: HTTP header
|
|
||||||
|
|
||||||
Note, each API key must be added to a map of `map[string]APIKey` where the key is: ApiKeyAuth and passed in as the auth context for each request.
|
|
||||||
|
|
||||||
Example
|
|
||||||
|
|
||||||
```go
|
|
||||||
auth := context.WithValue(
|
|
||||||
context.Background(),
|
|
||||||
autoglue.ContextAPIKeys,
|
|
||||||
map[string]autoglue.APIKey{
|
|
||||||
"ApiKeyAuth": {Key: "API_KEY_STRING"},
|
|
||||||
},
|
|
||||||
)
|
|
||||||
r, err := client.Service.Operation(auth, args)
|
|
||||||
```
|
|
||||||
|
|
||||||
### BearerAuth
|
|
||||||
|
|
||||||
- **Type**: API key
|
|
||||||
- **API key parameter name**: Authorization
|
|
||||||
- **Location**: HTTP header
|
|
||||||
|
|
||||||
Note, each API key must be added to a map of `map[string]APIKey` where the key is: BearerAuth and passed in as the auth context for each request.
|
|
||||||
|
|
||||||
Example
|
|
||||||
|
|
||||||
```go
|
|
||||||
auth := context.WithValue(
|
|
||||||
context.Background(),
|
|
||||||
autoglue.ContextAPIKeys,
|
|
||||||
map[string]autoglue.APIKey{
|
|
||||||
"BearerAuth": {Key: "API_KEY_STRING"},
|
|
||||||
},
|
|
||||||
)
|
|
||||||
r, err := client.Service.Operation(auth, args)
|
|
||||||
```
|
|
||||||
|
|
||||||
### OrgKeyAuth
|
|
||||||
|
|
||||||
- **Type**: API key
|
|
||||||
- **API key parameter name**: X-ORG-KEY
|
|
||||||
- **Location**: HTTP header
|
|
||||||
|
|
||||||
Note, each API key must be added to a map of `map[string]APIKey` where the key is: OrgKeyAuth and passed in as the auth context for each request.
|
|
||||||
|
|
||||||
Example
|
|
||||||
|
|
||||||
```go
|
|
||||||
auth := context.WithValue(
|
|
||||||
context.Background(),
|
|
||||||
autoglue.ContextAPIKeys,
|
|
||||||
map[string]autoglue.APIKey{
|
|
||||||
"OrgKeyAuth": {Key: "API_KEY_STRING"},
|
|
||||||
},
|
|
||||||
)
|
|
||||||
r, err := client.Service.Operation(auth, args)
|
|
||||||
```
|
|
||||||
|
|
||||||
### OrgSecretAuth
|
|
||||||
|
|
||||||
- **Type**: API key
|
|
||||||
- **API key parameter name**: X-ORG-SECRET
|
|
||||||
- **Location**: HTTP header
|
|
||||||
|
|
||||||
Note, each API key must be added to a map of `map[string]APIKey` where the key is: OrgSecretAuth and passed in as the auth context for each request.
|
|
||||||
|
|
||||||
Example
|
|
||||||
|
|
||||||
```go
|
|
||||||
auth := context.WithValue(
|
|
||||||
context.Background(),
|
|
||||||
autoglue.ContextAPIKeys,
|
|
||||||
map[string]autoglue.APIKey{
|
|
||||||
"OrgSecretAuth": {Key: "API_KEY_STRING"},
|
|
||||||
},
|
|
||||||
)
|
|
||||||
r, err := client.Service.Operation(auth, args)
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
## Documentation for Utility Methods
|
|
||||||
|
|
||||||
Due to the fact that model structure members are all pointers, this package contains
|
|
||||||
a number of utility functions to easily obtain pointers to values of basic types.
|
|
||||||
Each of these functions takes a value of the given basic type and returns a pointer to it:
|
|
||||||
|
|
||||||
* `PtrBool`
|
|
||||||
* `PtrInt`
|
|
||||||
* `PtrInt32`
|
|
||||||
* `PtrInt64`
|
|
||||||
* `PtrFloat`
|
|
||||||
* `PtrFloat32`
|
|
||||||
* `PtrFloat64`
|
|
||||||
* `PtrString`
|
|
||||||
* `PtrTime`
|
|
||||||
|
|
||||||
## Author
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,864 +0,0 @@
|
|||||||
/*
|
|
||||||
AutoGlue API
|
|
||||||
|
|
||||||
API for managing K3s clusters across cloud providers
|
|
||||||
|
|
||||||
API version: 1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
||||||
|
|
||||||
package autoglue
|
|
||||||
|
|
||||||
import (
|
|
||||||
"bytes"
|
|
||||||
"context"
|
|
||||||
"io"
|
|
||||||
"net/http"
|
|
||||||
"net/url"
|
|
||||||
"strings"
|
|
||||||
)
|
|
||||||
|
|
||||||
// ArcherAdminAPIService ArcherAdminAPI service
|
|
||||||
type ArcherAdminAPIService service
|
|
||||||
|
|
||||||
type ApiAdminCancelArcherJobRequest struct {
|
|
||||||
ctx context.Context
|
|
||||||
ApiService *ArcherAdminAPIService
|
|
||||||
id string
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r ApiAdminCancelArcherJobRequest) Execute() (*DtoJob, *http.Response, error) {
|
|
||||||
return r.ApiService.AdminCancelArcherJobExecute(r)
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
AdminCancelArcherJob Cancel an Archer job (admin)
|
|
||||||
|
|
||||||
Set job status to canceled if cancellable. For running jobs, this only affects future picks; wire to Archer if you need active kill.
|
|
||||||
|
|
||||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
||||||
@param id Job ID
|
|
||||||
@return ApiAdminCancelArcherJobRequest
|
|
||||||
*/
|
|
||||||
func (a *ArcherAdminAPIService) AdminCancelArcherJob(ctx context.Context, id string) ApiAdminCancelArcherJobRequest {
|
|
||||||
return ApiAdminCancelArcherJobRequest{
|
|
||||||
ApiService: a,
|
|
||||||
ctx: ctx,
|
|
||||||
id: id,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Execute executes the request
|
|
||||||
//
|
|
||||||
// @return DtoJob
|
|
||||||
func (a *ArcherAdminAPIService) AdminCancelArcherJobExecute(r ApiAdminCancelArcherJobRequest) (*DtoJob, *http.Response, error) {
|
|
||||||
var (
|
|
||||||
localVarHTTPMethod = http.MethodPost
|
|
||||||
localVarPostBody interface{}
|
|
||||||
formFiles []formFile
|
|
||||||
localVarReturnValue *DtoJob
|
|
||||||
)
|
|
||||||
|
|
||||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ArcherAdminAPIService.AdminCancelArcherJob")
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarPath := localBasePath + "/admin/archer/jobs/{id}/cancel"
|
|
||||||
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1)
|
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
|
||||||
localVarQueryParams := url.Values{}
|
|
||||||
localVarFormParams := url.Values{}
|
|
||||||
|
|
||||||
// to determine the Content-Type header
|
|
||||||
localVarHTTPContentTypes := []string{}
|
|
||||||
|
|
||||||
// set Content-Type header
|
|
||||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
||||||
if localVarHTTPContentType != "" {
|
|
||||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
|
||||||
}
|
|
||||||
|
|
||||||
// to determine the Accept header
|
|
||||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
|
||||||
|
|
||||||
// set Accept header
|
|
||||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
||||||
if localVarHTTPHeaderAccept != "" {
|
|
||||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
|
||||||
}
|
|
||||||
if r.ctx != nil {
|
|
||||||
// API Key Authentication
|
|
||||||
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
|
|
||||||
if apiKey, ok := auth["BearerAuth"]; ok {
|
|
||||||
var key string
|
|
||||||
if apiKey.Prefix != "" {
|
|
||||||
key = apiKey.Prefix + " " + apiKey.Key
|
|
||||||
} else {
|
|
||||||
key = apiKey.Key
|
|
||||||
}
|
|
||||||
localVarHeaderParams["Authorization"] = key
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
||||||
if err != nil || localVarHTTPResponse == nil {
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, err
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
|
||||||
localVarHTTPResponse.Body.Close()
|
|
||||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if localVarHTTPResponse.StatusCode >= 300 {
|
|
||||||
newErr := &GenericOpenAPIError{
|
|
||||||
body: localVarBody,
|
|
||||||
error: localVarHTTPResponse.Status,
|
|
||||||
}
|
|
||||||
if localVarHTTPResponse.StatusCode == 400 {
|
|
||||||
var v string
|
|
||||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
||||||
if err != nil {
|
|
||||||
newErr.error = err.Error()
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
|
||||||
newErr.model = v
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
if localVarHTTPResponse.StatusCode == 401 {
|
|
||||||
var v string
|
|
||||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
||||||
if err != nil {
|
|
||||||
newErr.error = err.Error()
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
|
||||||
newErr.model = v
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
if localVarHTTPResponse.StatusCode == 403 {
|
|
||||||
var v string
|
|
||||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
||||||
if err != nil {
|
|
||||||
newErr.error = err.Error()
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
|
||||||
newErr.model = v
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
if localVarHTTPResponse.StatusCode == 404 {
|
|
||||||
var v string
|
|
||||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
||||||
if err != nil {
|
|
||||||
newErr.error = err.Error()
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
|
||||||
newErr.model = v
|
|
||||||
}
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
|
|
||||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
||||||
if err != nil {
|
|
||||||
newErr := &GenericOpenAPIError{
|
|
||||||
body: localVarBody,
|
|
||||||
error: err.Error(),
|
|
||||||
}
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type ApiAdminEnqueueArcherJobRequest struct {
|
|
||||||
ctx context.Context
|
|
||||||
ApiService *ArcherAdminAPIService
|
|
||||||
body *map[string]interface{}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Job parameters
|
|
||||||
func (r ApiAdminEnqueueArcherJobRequest) Body(body map[string]interface{}) ApiAdminEnqueueArcherJobRequest {
|
|
||||||
r.body = &body
|
|
||||||
return r
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r ApiAdminEnqueueArcherJobRequest) Execute() (*DtoJob, *http.Response, error) {
|
|
||||||
return r.ApiService.AdminEnqueueArcherJobExecute(r)
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
AdminEnqueueArcherJob Enqueue a new Archer job (admin)
|
|
||||||
|
|
||||||
Create a job immediately or schedule it for the future via `run_at`.
|
|
||||||
|
|
||||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
||||||
@return ApiAdminEnqueueArcherJobRequest
|
|
||||||
*/
|
|
||||||
func (a *ArcherAdminAPIService) AdminEnqueueArcherJob(ctx context.Context) ApiAdminEnqueueArcherJobRequest {
|
|
||||||
return ApiAdminEnqueueArcherJobRequest{
|
|
||||||
ApiService: a,
|
|
||||||
ctx: ctx,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Execute executes the request
|
|
||||||
//
|
|
||||||
// @return DtoJob
|
|
||||||
func (a *ArcherAdminAPIService) AdminEnqueueArcherJobExecute(r ApiAdminEnqueueArcherJobRequest) (*DtoJob, *http.Response, error) {
|
|
||||||
var (
|
|
||||||
localVarHTTPMethod = http.MethodPost
|
|
||||||
localVarPostBody interface{}
|
|
||||||
formFiles []formFile
|
|
||||||
localVarReturnValue *DtoJob
|
|
||||||
)
|
|
||||||
|
|
||||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ArcherAdminAPIService.AdminEnqueueArcherJob")
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarPath := localBasePath + "/admin/archer/jobs"
|
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
|
||||||
localVarQueryParams := url.Values{}
|
|
||||||
localVarFormParams := url.Values{}
|
|
||||||
if r.body == nil {
|
|
||||||
return localVarReturnValue, nil, reportError("body is required and must be specified")
|
|
||||||
}
|
|
||||||
|
|
||||||
// to determine the Content-Type header
|
|
||||||
localVarHTTPContentTypes := []string{"application/json"}
|
|
||||||
|
|
||||||
// set Content-Type header
|
|
||||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
||||||
if localVarHTTPContentType != "" {
|
|
||||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
|
||||||
}
|
|
||||||
|
|
||||||
// to determine the Accept header
|
|
||||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
|
||||||
|
|
||||||
// set Accept header
|
|
||||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
||||||
if localVarHTTPHeaderAccept != "" {
|
|
||||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
|
||||||
}
|
|
||||||
// body params
|
|
||||||
localVarPostBody = r.body
|
|
||||||
if r.ctx != nil {
|
|
||||||
// API Key Authentication
|
|
||||||
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
|
|
||||||
if apiKey, ok := auth["BearerAuth"]; ok {
|
|
||||||
var key string
|
|
||||||
if apiKey.Prefix != "" {
|
|
||||||
key = apiKey.Prefix + " " + apiKey.Key
|
|
||||||
} else {
|
|
||||||
key = apiKey.Key
|
|
||||||
}
|
|
||||||
localVarHeaderParams["Authorization"] = key
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
||||||
if err != nil || localVarHTTPResponse == nil {
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, err
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
|
||||||
localVarHTTPResponse.Body.Close()
|
|
||||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if localVarHTTPResponse.StatusCode >= 300 {
|
|
||||||
newErr := &GenericOpenAPIError{
|
|
||||||
body: localVarBody,
|
|
||||||
error: localVarHTTPResponse.Status,
|
|
||||||
}
|
|
||||||
if localVarHTTPResponse.StatusCode == 400 {
|
|
||||||
var v string
|
|
||||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
||||||
if err != nil {
|
|
||||||
newErr.error = err.Error()
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
|
||||||
newErr.model = v
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
if localVarHTTPResponse.StatusCode == 401 {
|
|
||||||
var v string
|
|
||||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
||||||
if err != nil {
|
|
||||||
newErr.error = err.Error()
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
|
||||||
newErr.model = v
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
if localVarHTTPResponse.StatusCode == 403 {
|
|
||||||
var v string
|
|
||||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
||||||
if err != nil {
|
|
||||||
newErr.error = err.Error()
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
|
||||||
newErr.model = v
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
if localVarHTTPResponse.StatusCode == 500 {
|
|
||||||
var v string
|
|
||||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
||||||
if err != nil {
|
|
||||||
newErr.error = err.Error()
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
|
||||||
newErr.model = v
|
|
||||||
}
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
|
|
||||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
||||||
if err != nil {
|
|
||||||
newErr := &GenericOpenAPIError{
|
|
||||||
body: localVarBody,
|
|
||||||
error: err.Error(),
|
|
||||||
}
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type ApiAdminListArcherJobsRequest struct {
|
|
||||||
ctx context.Context
|
|
||||||
ApiService *ArcherAdminAPIService
|
|
||||||
status *string
|
|
||||||
queue *string
|
|
||||||
q *string
|
|
||||||
page *int32
|
|
||||||
pageSize *int32
|
|
||||||
}
|
|
||||||
|
|
||||||
// Filter by status
|
|
||||||
func (r ApiAdminListArcherJobsRequest) Status(status string) ApiAdminListArcherJobsRequest {
|
|
||||||
r.status = &status
|
|
||||||
return r
|
|
||||||
}
|
|
||||||
|
|
||||||
// Filter by queue name / worker name
|
|
||||||
func (r ApiAdminListArcherJobsRequest) Queue(queue string) ApiAdminListArcherJobsRequest {
|
|
||||||
r.queue = &queue
|
|
||||||
return r
|
|
||||||
}
|
|
||||||
|
|
||||||
// Free-text search
|
|
||||||
func (r ApiAdminListArcherJobsRequest) Q(q string) ApiAdminListArcherJobsRequest {
|
|
||||||
r.q = &q
|
|
||||||
return r
|
|
||||||
}
|
|
||||||
|
|
||||||
// Page number
|
|
||||||
func (r ApiAdminListArcherJobsRequest) Page(page int32) ApiAdminListArcherJobsRequest {
|
|
||||||
r.page = &page
|
|
||||||
return r
|
|
||||||
}
|
|
||||||
|
|
||||||
// Items per page
|
|
||||||
func (r ApiAdminListArcherJobsRequest) PageSize(pageSize int32) ApiAdminListArcherJobsRequest {
|
|
||||||
r.pageSize = &pageSize
|
|
||||||
return r
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r ApiAdminListArcherJobsRequest) Execute() (*DtoPageJob, *http.Response, error) {
|
|
||||||
return r.ApiService.AdminListArcherJobsExecute(r)
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
AdminListArcherJobs List Archer jobs (admin)
|
|
||||||
|
|
||||||
Paginated background jobs with optional filters. Search `q` may match id, type, error, payload (implementation-dependent).
|
|
||||||
|
|
||||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
||||||
@return ApiAdminListArcherJobsRequest
|
|
||||||
*/
|
|
||||||
func (a *ArcherAdminAPIService) AdminListArcherJobs(ctx context.Context) ApiAdminListArcherJobsRequest {
|
|
||||||
return ApiAdminListArcherJobsRequest{
|
|
||||||
ApiService: a,
|
|
||||||
ctx: ctx,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Execute executes the request
|
|
||||||
//
|
|
||||||
// @return DtoPageJob
|
|
||||||
func (a *ArcherAdminAPIService) AdminListArcherJobsExecute(r ApiAdminListArcherJobsRequest) (*DtoPageJob, *http.Response, error) {
|
|
||||||
var (
|
|
||||||
localVarHTTPMethod = http.MethodGet
|
|
||||||
localVarPostBody interface{}
|
|
||||||
formFiles []formFile
|
|
||||||
localVarReturnValue *DtoPageJob
|
|
||||||
)
|
|
||||||
|
|
||||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ArcherAdminAPIService.AdminListArcherJobs")
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarPath := localBasePath + "/admin/archer/jobs"
|
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
|
||||||
localVarQueryParams := url.Values{}
|
|
||||||
localVarFormParams := url.Values{}
|
|
||||||
|
|
||||||
if r.status != nil {
|
|
||||||
parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "", "")
|
|
||||||
}
|
|
||||||
if r.queue != nil {
|
|
||||||
parameterAddToHeaderOrQuery(localVarQueryParams, "queue", r.queue, "", "")
|
|
||||||
}
|
|
||||||
if r.q != nil {
|
|
||||||
parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "", "")
|
|
||||||
}
|
|
||||||
if r.page != nil {
|
|
||||||
parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "", "")
|
|
||||||
} else {
|
|
||||||
var defaultValue int32 = 1
|
|
||||||
parameterAddToHeaderOrQuery(localVarQueryParams, "page", defaultValue, "", "")
|
|
||||||
r.page = &defaultValue
|
|
||||||
}
|
|
||||||
if r.pageSize != nil {
|
|
||||||
parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "", "")
|
|
||||||
} else {
|
|
||||||
var defaultValue int32 = 25
|
|
||||||
parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", defaultValue, "", "")
|
|
||||||
r.pageSize = &defaultValue
|
|
||||||
}
|
|
||||||
// to determine the Content-Type header
|
|
||||||
localVarHTTPContentTypes := []string{}
|
|
||||||
|
|
||||||
// set Content-Type header
|
|
||||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
||||||
if localVarHTTPContentType != "" {
|
|
||||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
|
||||||
}
|
|
||||||
|
|
||||||
// to determine the Accept header
|
|
||||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
|
||||||
|
|
||||||
// set Accept header
|
|
||||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
||||||
if localVarHTTPHeaderAccept != "" {
|
|
||||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
|
||||||
}
|
|
||||||
if r.ctx != nil {
|
|
||||||
// API Key Authentication
|
|
||||||
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
|
|
||||||
if apiKey, ok := auth["BearerAuth"]; ok {
|
|
||||||
var key string
|
|
||||||
if apiKey.Prefix != "" {
|
|
||||||
key = apiKey.Prefix + " " + apiKey.Key
|
|
||||||
} else {
|
|
||||||
key = apiKey.Key
|
|
||||||
}
|
|
||||||
localVarHeaderParams["Authorization"] = key
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
||||||
if err != nil || localVarHTTPResponse == nil {
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, err
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
|
||||||
localVarHTTPResponse.Body.Close()
|
|
||||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if localVarHTTPResponse.StatusCode >= 300 {
|
|
||||||
newErr := &GenericOpenAPIError{
|
|
||||||
body: localVarBody,
|
|
||||||
error: localVarHTTPResponse.Status,
|
|
||||||
}
|
|
||||||
if localVarHTTPResponse.StatusCode == 401 {
|
|
||||||
var v string
|
|
||||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
||||||
if err != nil {
|
|
||||||
newErr.error = err.Error()
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
|
||||||
newErr.model = v
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
if localVarHTTPResponse.StatusCode == 403 {
|
|
||||||
var v string
|
|
||||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
||||||
if err != nil {
|
|
||||||
newErr.error = err.Error()
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
|
||||||
newErr.model = v
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
if localVarHTTPResponse.StatusCode == 500 {
|
|
||||||
var v string
|
|
||||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
||||||
if err != nil {
|
|
||||||
newErr.error = err.Error()
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
|
||||||
newErr.model = v
|
|
||||||
}
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
|
|
||||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
||||||
if err != nil {
|
|
||||||
newErr := &GenericOpenAPIError{
|
|
||||||
body: localVarBody,
|
|
||||||
error: err.Error(),
|
|
||||||
}
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type ApiAdminListArcherQueuesRequest struct {
|
|
||||||
ctx context.Context
|
|
||||||
ApiService *ArcherAdminAPIService
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r ApiAdminListArcherQueuesRequest) Execute() ([]DtoQueueInfo, *http.Response, error) {
|
|
||||||
return r.ApiService.AdminListArcherQueuesExecute(r)
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
AdminListArcherQueues List Archer queues (admin)
|
|
||||||
|
|
||||||
Summary metrics per queue (pending, running, failed, scheduled).
|
|
||||||
|
|
||||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
||||||
@return ApiAdminListArcherQueuesRequest
|
|
||||||
*/
|
|
||||||
func (a *ArcherAdminAPIService) AdminListArcherQueues(ctx context.Context) ApiAdminListArcherQueuesRequest {
|
|
||||||
return ApiAdminListArcherQueuesRequest{
|
|
||||||
ApiService: a,
|
|
||||||
ctx: ctx,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Execute executes the request
|
|
||||||
//
|
|
||||||
// @return []DtoQueueInfo
|
|
||||||
func (a *ArcherAdminAPIService) AdminListArcherQueuesExecute(r ApiAdminListArcherQueuesRequest) ([]DtoQueueInfo, *http.Response, error) {
|
|
||||||
var (
|
|
||||||
localVarHTTPMethod = http.MethodGet
|
|
||||||
localVarPostBody interface{}
|
|
||||||
formFiles []formFile
|
|
||||||
localVarReturnValue []DtoQueueInfo
|
|
||||||
)
|
|
||||||
|
|
||||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ArcherAdminAPIService.AdminListArcherQueues")
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarPath := localBasePath + "/admin/archer/queues"
|
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
|
||||||
localVarQueryParams := url.Values{}
|
|
||||||
localVarFormParams := url.Values{}
|
|
||||||
|
|
||||||
// to determine the Content-Type header
|
|
||||||
localVarHTTPContentTypes := []string{}
|
|
||||||
|
|
||||||
// set Content-Type header
|
|
||||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
||||||
if localVarHTTPContentType != "" {
|
|
||||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
|
||||||
}
|
|
||||||
|
|
||||||
// to determine the Accept header
|
|
||||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
|
||||||
|
|
||||||
// set Accept header
|
|
||||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
||||||
if localVarHTTPHeaderAccept != "" {
|
|
||||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
|
||||||
}
|
|
||||||
if r.ctx != nil {
|
|
||||||
// API Key Authentication
|
|
||||||
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
|
|
||||||
if apiKey, ok := auth["BearerAuth"]; ok {
|
|
||||||
var key string
|
|
||||||
if apiKey.Prefix != "" {
|
|
||||||
key = apiKey.Prefix + " " + apiKey.Key
|
|
||||||
} else {
|
|
||||||
key = apiKey.Key
|
|
||||||
}
|
|
||||||
localVarHeaderParams["Authorization"] = key
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
||||||
if err != nil || localVarHTTPResponse == nil {
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, err
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
|
||||||
localVarHTTPResponse.Body.Close()
|
|
||||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if localVarHTTPResponse.StatusCode >= 300 {
|
|
||||||
newErr := &GenericOpenAPIError{
|
|
||||||
body: localVarBody,
|
|
||||||
error: localVarHTTPResponse.Status,
|
|
||||||
}
|
|
||||||
if localVarHTTPResponse.StatusCode == 401 {
|
|
||||||
var v string
|
|
||||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
||||||
if err != nil {
|
|
||||||
newErr.error = err.Error()
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
|
||||||
newErr.model = v
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
if localVarHTTPResponse.StatusCode == 403 {
|
|
||||||
var v string
|
|
||||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
||||||
if err != nil {
|
|
||||||
newErr.error = err.Error()
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
|
||||||
newErr.model = v
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
if localVarHTTPResponse.StatusCode == 500 {
|
|
||||||
var v string
|
|
||||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
||||||
if err != nil {
|
|
||||||
newErr.error = err.Error()
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
|
||||||
newErr.model = v
|
|
||||||
}
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
|
|
||||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
||||||
if err != nil {
|
|
||||||
newErr := &GenericOpenAPIError{
|
|
||||||
body: localVarBody,
|
|
||||||
error: err.Error(),
|
|
||||||
}
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type ApiAdminRetryArcherJobRequest struct {
|
|
||||||
ctx context.Context
|
|
||||||
ApiService *ArcherAdminAPIService
|
|
||||||
id string
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r ApiAdminRetryArcherJobRequest) Execute() (*DtoJob, *http.Response, error) {
|
|
||||||
return r.ApiService.AdminRetryArcherJobExecute(r)
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
AdminRetryArcherJob Retry a failed/canceled Archer job (admin)
|
|
||||||
|
|
||||||
Marks the job retriable (DB flip). Swap this for an Archer admin call if you expose one.
|
|
||||||
|
|
||||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
||||||
@param id Job ID
|
|
||||||
@return ApiAdminRetryArcherJobRequest
|
|
||||||
*/
|
|
||||||
func (a *ArcherAdminAPIService) AdminRetryArcherJob(ctx context.Context, id string) ApiAdminRetryArcherJobRequest {
|
|
||||||
return ApiAdminRetryArcherJobRequest{
|
|
||||||
ApiService: a,
|
|
||||||
ctx: ctx,
|
|
||||||
id: id,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Execute executes the request
|
|
||||||
//
|
|
||||||
// @return DtoJob
|
|
||||||
func (a *ArcherAdminAPIService) AdminRetryArcherJobExecute(r ApiAdminRetryArcherJobRequest) (*DtoJob, *http.Response, error) {
|
|
||||||
var (
|
|
||||||
localVarHTTPMethod = http.MethodPost
|
|
||||||
localVarPostBody interface{}
|
|
||||||
formFiles []formFile
|
|
||||||
localVarReturnValue *DtoJob
|
|
||||||
)
|
|
||||||
|
|
||||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ArcherAdminAPIService.AdminRetryArcherJob")
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarPath := localBasePath + "/admin/archer/jobs/{id}/retry"
|
|
||||||
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1)
|
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
|
||||||
localVarQueryParams := url.Values{}
|
|
||||||
localVarFormParams := url.Values{}
|
|
||||||
|
|
||||||
// to determine the Content-Type header
|
|
||||||
localVarHTTPContentTypes := []string{}
|
|
||||||
|
|
||||||
// set Content-Type header
|
|
||||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
||||||
if localVarHTTPContentType != "" {
|
|
||||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
|
||||||
}
|
|
||||||
|
|
||||||
// to determine the Accept header
|
|
||||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
|
||||||
|
|
||||||
// set Accept header
|
|
||||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
||||||
if localVarHTTPHeaderAccept != "" {
|
|
||||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
|
||||||
}
|
|
||||||
if r.ctx != nil {
|
|
||||||
// API Key Authentication
|
|
||||||
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
|
|
||||||
if apiKey, ok := auth["BearerAuth"]; ok {
|
|
||||||
var key string
|
|
||||||
if apiKey.Prefix != "" {
|
|
||||||
key = apiKey.Prefix + " " + apiKey.Key
|
|
||||||
} else {
|
|
||||||
key = apiKey.Key
|
|
||||||
}
|
|
||||||
localVarHeaderParams["Authorization"] = key
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
||||||
if err != nil || localVarHTTPResponse == nil {
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, err
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
|
||||||
localVarHTTPResponse.Body.Close()
|
|
||||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if localVarHTTPResponse.StatusCode >= 300 {
|
|
||||||
newErr := &GenericOpenAPIError{
|
|
||||||
body: localVarBody,
|
|
||||||
error: localVarHTTPResponse.Status,
|
|
||||||
}
|
|
||||||
if localVarHTTPResponse.StatusCode == 400 {
|
|
||||||
var v string
|
|
||||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
||||||
if err != nil {
|
|
||||||
newErr.error = err.Error()
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
|
||||||
newErr.model = v
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
if localVarHTTPResponse.StatusCode == 401 {
|
|
||||||
var v string
|
|
||||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
||||||
if err != nil {
|
|
||||||
newErr.error = err.Error()
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
|
||||||
newErr.model = v
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
if localVarHTTPResponse.StatusCode == 403 {
|
|
||||||
var v string
|
|
||||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
||||||
if err != nil {
|
|
||||||
newErr.error = err.Error()
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
|
||||||
newErr.model = v
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
if localVarHTTPResponse.StatusCode == 404 {
|
|
||||||
var v string
|
|
||||||
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
||||||
if err != nil {
|
|
||||||
newErr.error = err.Error()
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
|
|
||||||
newErr.model = v
|
|
||||||
}
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
|
|
||||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
||||||
if err != nil {
|
|
||||||
newErr := &GenericOpenAPIError{
|
|
||||||
body: localVarBody,
|
|
||||||
error: err.Error(),
|
|
||||||
}
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, nil
|
|
||||||
}
|
|
||||||
@@ -1,537 +0,0 @@
|
|||||||
/*
|
|
||||||
AutoGlue API
|
|
||||||
|
|
||||||
API for managing K3s clusters across cloud providers
|
|
||||||
|
|
||||||
API version: 1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
||||||
|
|
||||||
package autoglue
|
|
||||||
|
|
||||||
import (
|
|
||||||
"bytes"
|
|
||||||
"context"
|
|
||||||
"io"
|
|
||||||
"net/http"
|
|
||||||
"net/url"
|
|
||||||
"strings"
|
|
||||||
)
|
|
||||||
|
|
||||||
// AuthAPIService AuthAPI service
|
|
||||||
type AuthAPIService service
|
|
||||||
|
|
||||||
type ApiAuthCallbackRequest struct {
|
|
||||||
ctx context.Context
|
|
||||||
ApiService *AuthAPIService
|
|
||||||
provider string
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r ApiAuthCallbackRequest) Execute() (*DtoTokenPair, *http.Response, error) {
|
|
||||||
return r.ApiService.AuthCallbackExecute(r)
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
AuthCallback Handle social login callback
|
|
||||||
|
|
||||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
||||||
@param provider google|github
|
|
||||||
@return ApiAuthCallbackRequest
|
|
||||||
*/
|
|
||||||
func (a *AuthAPIService) AuthCallback(ctx context.Context, provider string) ApiAuthCallbackRequest {
|
|
||||||
return ApiAuthCallbackRequest{
|
|
||||||
ApiService: a,
|
|
||||||
ctx: ctx,
|
|
||||||
provider: provider,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Execute executes the request
|
|
||||||
//
|
|
||||||
// @return DtoTokenPair
|
|
||||||
func (a *AuthAPIService) AuthCallbackExecute(r ApiAuthCallbackRequest) (*DtoTokenPair, *http.Response, error) {
|
|
||||||
var (
|
|
||||||
localVarHTTPMethod = http.MethodGet
|
|
||||||
localVarPostBody interface{}
|
|
||||||
formFiles []formFile
|
|
||||||
localVarReturnValue *DtoTokenPair
|
|
||||||
)
|
|
||||||
|
|
||||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthAPIService.AuthCallback")
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarPath := localBasePath + "/auth/{provider}/callback"
|
|
||||||
localVarPath = strings.Replace(localVarPath, "{"+"provider"+"}", url.PathEscape(parameterValueToString(r.provider, "provider")), -1)
|
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
|
||||||
localVarQueryParams := url.Values{}
|
|
||||||
localVarFormParams := url.Values{}
|
|
||||||
|
|
||||||
// to determine the Content-Type header
|
|
||||||
localVarHTTPContentTypes := []string{}
|
|
||||||
|
|
||||||
// set Content-Type header
|
|
||||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
||||||
if localVarHTTPContentType != "" {
|
|
||||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
|
||||||
}
|
|
||||||
|
|
||||||
// to determine the Accept header
|
|
||||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
|
||||||
|
|
||||||
// set Accept header
|
|
||||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
||||||
if localVarHTTPHeaderAccept != "" {
|
|
||||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
|
||||||
}
|
|
||||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
||||||
if err != nil || localVarHTTPResponse == nil {
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, err
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
|
||||||
localVarHTTPResponse.Body.Close()
|
|
||||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if localVarHTTPResponse.StatusCode >= 300 {
|
|
||||||
newErr := &GenericOpenAPIError{
|
|
||||||
body: localVarBody,
|
|
||||||
error: localVarHTTPResponse.Status,
|
|
||||||
}
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
|
|
||||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
||||||
if err != nil {
|
|
||||||
newErr := &GenericOpenAPIError{
|
|
||||||
body: localVarBody,
|
|
||||||
error: err.Error(),
|
|
||||||
}
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type ApiAuthStartRequest struct {
|
|
||||||
ctx context.Context
|
|
||||||
ApiService *AuthAPIService
|
|
||||||
provider string
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r ApiAuthStartRequest) Execute() (*DtoAuthStartResponse, *http.Response, error) {
|
|
||||||
return r.ApiService.AuthStartExecute(r)
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
AuthStart Begin social login
|
|
||||||
|
|
||||||
Returns provider authorization URL for the frontend to redirect
|
|
||||||
|
|
||||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
||||||
@param provider google|github
|
|
||||||
@return ApiAuthStartRequest
|
|
||||||
*/
|
|
||||||
func (a *AuthAPIService) AuthStart(ctx context.Context, provider string) ApiAuthStartRequest {
|
|
||||||
return ApiAuthStartRequest{
|
|
||||||
ApiService: a,
|
|
||||||
ctx: ctx,
|
|
||||||
provider: provider,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Execute executes the request
|
|
||||||
//
|
|
||||||
// @return DtoAuthStartResponse
|
|
||||||
func (a *AuthAPIService) AuthStartExecute(r ApiAuthStartRequest) (*DtoAuthStartResponse, *http.Response, error) {
|
|
||||||
var (
|
|
||||||
localVarHTTPMethod = http.MethodPost
|
|
||||||
localVarPostBody interface{}
|
|
||||||
formFiles []formFile
|
|
||||||
localVarReturnValue *DtoAuthStartResponse
|
|
||||||
)
|
|
||||||
|
|
||||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthAPIService.AuthStart")
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarPath := localBasePath + "/auth/{provider}/start"
|
|
||||||
localVarPath = strings.Replace(localVarPath, "{"+"provider"+"}", url.PathEscape(parameterValueToString(r.provider, "provider")), -1)
|
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
|
||||||
localVarQueryParams := url.Values{}
|
|
||||||
localVarFormParams := url.Values{}
|
|
||||||
|
|
||||||
// to determine the Content-Type header
|
|
||||||
localVarHTTPContentTypes := []string{}
|
|
||||||
|
|
||||||
// set Content-Type header
|
|
||||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
||||||
if localVarHTTPContentType != "" {
|
|
||||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
|
||||||
}
|
|
||||||
|
|
||||||
// to determine the Accept header
|
|
||||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
|
||||||
|
|
||||||
// set Accept header
|
|
||||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
||||||
if localVarHTTPHeaderAccept != "" {
|
|
||||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
|
||||||
}
|
|
||||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
||||||
if err != nil || localVarHTTPResponse == nil {
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, err
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
|
||||||
localVarHTTPResponse.Body.Close()
|
|
||||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if localVarHTTPResponse.StatusCode >= 300 {
|
|
||||||
newErr := &GenericOpenAPIError{
|
|
||||||
body: localVarBody,
|
|
||||||
error: localVarHTTPResponse.Status,
|
|
||||||
}
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
|
|
||||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
||||||
if err != nil {
|
|
||||||
newErr := &GenericOpenAPIError{
|
|
||||||
body: localVarBody,
|
|
||||||
error: err.Error(),
|
|
||||||
}
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type ApiGetJWKSRequest struct {
|
|
||||||
ctx context.Context
|
|
||||||
ApiService *AuthAPIService
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r ApiGetJWKSRequest) Execute() (*DtoJWKS, *http.Response, error) {
|
|
||||||
return r.ApiService.GetJWKSExecute(r)
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
GetJWKS Get JWKS
|
|
||||||
|
|
||||||
Returns the JSON Web Key Set for token verification
|
|
||||||
|
|
||||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
||||||
@return ApiGetJWKSRequest
|
|
||||||
*/
|
|
||||||
func (a *AuthAPIService) GetJWKS(ctx context.Context) ApiGetJWKSRequest {
|
|
||||||
return ApiGetJWKSRequest{
|
|
||||||
ApiService: a,
|
|
||||||
ctx: ctx,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Execute executes the request
|
|
||||||
//
|
|
||||||
// @return DtoJWKS
|
|
||||||
func (a *AuthAPIService) GetJWKSExecute(r ApiGetJWKSRequest) (*DtoJWKS, *http.Response, error) {
|
|
||||||
var (
|
|
||||||
localVarHTTPMethod = http.MethodGet
|
|
||||||
localVarPostBody interface{}
|
|
||||||
formFiles []formFile
|
|
||||||
localVarReturnValue *DtoJWKS
|
|
||||||
)
|
|
||||||
|
|
||||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthAPIService.GetJWKS")
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarPath := localBasePath + "/.well-known/jwks.json"
|
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
|
||||||
localVarQueryParams := url.Values{}
|
|
||||||
localVarFormParams := url.Values{}
|
|
||||||
|
|
||||||
// to determine the Content-Type header
|
|
||||||
localVarHTTPContentTypes := []string{}
|
|
||||||
|
|
||||||
// set Content-Type header
|
|
||||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
||||||
if localVarHTTPContentType != "" {
|
|
||||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
|
||||||
}
|
|
||||||
|
|
||||||
// to determine the Accept header
|
|
||||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
|
||||||
|
|
||||||
// set Accept header
|
|
||||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
||||||
if localVarHTTPHeaderAccept != "" {
|
|
||||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
|
||||||
}
|
|
||||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
||||||
if err != nil || localVarHTTPResponse == nil {
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, err
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
|
||||||
localVarHTTPResponse.Body.Close()
|
|
||||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if localVarHTTPResponse.StatusCode >= 300 {
|
|
||||||
newErr := &GenericOpenAPIError{
|
|
||||||
body: localVarBody,
|
|
||||||
error: localVarHTTPResponse.Status,
|
|
||||||
}
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
|
|
||||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
||||||
if err != nil {
|
|
||||||
newErr := &GenericOpenAPIError{
|
|
||||||
body: localVarBody,
|
|
||||||
error: err.Error(),
|
|
||||||
}
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type ApiLogoutRequest struct {
|
|
||||||
ctx context.Context
|
|
||||||
ApiService *AuthAPIService
|
|
||||||
body *DtoLogoutRequest
|
|
||||||
}
|
|
||||||
|
|
||||||
// Refresh token
|
|
||||||
func (r ApiLogoutRequest) Body(body DtoLogoutRequest) ApiLogoutRequest {
|
|
||||||
r.body = &body
|
|
||||||
return r
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r ApiLogoutRequest) Execute() (*http.Response, error) {
|
|
||||||
return r.ApiService.LogoutExecute(r)
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
Logout Revoke refresh token family (logout everywhere)
|
|
||||||
|
|
||||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
||||||
@return ApiLogoutRequest
|
|
||||||
*/
|
|
||||||
func (a *AuthAPIService) Logout(ctx context.Context) ApiLogoutRequest {
|
|
||||||
return ApiLogoutRequest{
|
|
||||||
ApiService: a,
|
|
||||||
ctx: ctx,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Execute executes the request
|
|
||||||
func (a *AuthAPIService) LogoutExecute(r ApiLogoutRequest) (*http.Response, error) {
|
|
||||||
var (
|
|
||||||
localVarHTTPMethod = http.MethodPost
|
|
||||||
localVarPostBody interface{}
|
|
||||||
formFiles []formFile
|
|
||||||
)
|
|
||||||
|
|
||||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthAPIService.Logout")
|
|
||||||
if err != nil {
|
|
||||||
return nil, &GenericOpenAPIError{error: err.Error()}
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarPath := localBasePath + "/auth/logout"
|
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
|
||||||
localVarQueryParams := url.Values{}
|
|
||||||
localVarFormParams := url.Values{}
|
|
||||||
if r.body == nil {
|
|
||||||
return nil, reportError("body is required and must be specified")
|
|
||||||
}
|
|
||||||
|
|
||||||
// to determine the Content-Type header
|
|
||||||
localVarHTTPContentTypes := []string{"application/json"}
|
|
||||||
|
|
||||||
// set Content-Type header
|
|
||||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
||||||
if localVarHTTPContentType != "" {
|
|
||||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
|
||||||
}
|
|
||||||
|
|
||||||
// to determine the Accept header
|
|
||||||
localVarHTTPHeaderAccepts := []string{}
|
|
||||||
|
|
||||||
// set Accept header
|
|
||||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
||||||
if localVarHTTPHeaderAccept != "" {
|
|
||||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
|
||||||
}
|
|
||||||
// body params
|
|
||||||
localVarPostBody = r.body
|
|
||||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
||||||
if err != nil || localVarHTTPResponse == nil {
|
|
||||||
return localVarHTTPResponse, err
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
|
||||||
localVarHTTPResponse.Body.Close()
|
|
||||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
|
||||||
if err != nil {
|
|
||||||
return localVarHTTPResponse, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if localVarHTTPResponse.StatusCode >= 300 {
|
|
||||||
newErr := &GenericOpenAPIError{
|
|
||||||
body: localVarBody,
|
|
||||||
error: localVarHTTPResponse.Status,
|
|
||||||
}
|
|
||||||
return localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
|
|
||||||
return localVarHTTPResponse, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type ApiRefreshRequest struct {
|
|
||||||
ctx context.Context
|
|
||||||
ApiService *AuthAPIService
|
|
||||||
body *DtoRefreshRequest
|
|
||||||
}
|
|
||||||
|
|
||||||
// Refresh token
|
|
||||||
func (r ApiRefreshRequest) Body(body DtoRefreshRequest) ApiRefreshRequest {
|
|
||||||
r.body = &body
|
|
||||||
return r
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r ApiRefreshRequest) Execute() (*DtoTokenPair, *http.Response, error) {
|
|
||||||
return r.ApiService.RefreshExecute(r)
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
Refresh Rotate refresh token
|
|
||||||
|
|
||||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
||||||
@return ApiRefreshRequest
|
|
||||||
*/
|
|
||||||
func (a *AuthAPIService) Refresh(ctx context.Context) ApiRefreshRequest {
|
|
||||||
return ApiRefreshRequest{
|
|
||||||
ApiService: a,
|
|
||||||
ctx: ctx,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Execute executes the request
|
|
||||||
//
|
|
||||||
// @return DtoTokenPair
|
|
||||||
func (a *AuthAPIService) RefreshExecute(r ApiRefreshRequest) (*DtoTokenPair, *http.Response, error) {
|
|
||||||
var (
|
|
||||||
localVarHTTPMethod = http.MethodPost
|
|
||||||
localVarPostBody interface{}
|
|
||||||
formFiles []formFile
|
|
||||||
localVarReturnValue *DtoTokenPair
|
|
||||||
)
|
|
||||||
|
|
||||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthAPIService.Refresh")
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarPath := localBasePath + "/auth/refresh"
|
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
|
||||||
localVarQueryParams := url.Values{}
|
|
||||||
localVarFormParams := url.Values{}
|
|
||||||
if r.body == nil {
|
|
||||||
return localVarReturnValue, nil, reportError("body is required and must be specified")
|
|
||||||
}
|
|
||||||
|
|
||||||
// to determine the Content-Type header
|
|
||||||
localVarHTTPContentTypes := []string{"application/json"}
|
|
||||||
|
|
||||||
// set Content-Type header
|
|
||||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
||||||
if localVarHTTPContentType != "" {
|
|
||||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
|
||||||
}
|
|
||||||
|
|
||||||
// to determine the Accept header
|
|
||||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
|
||||||
|
|
||||||
// set Accept header
|
|
||||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
||||||
if localVarHTTPHeaderAccept != "" {
|
|
||||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
|
||||||
}
|
|
||||||
// body params
|
|
||||||
localVarPostBody = r.body
|
|
||||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
||||||
if err != nil || localVarHTTPResponse == nil {
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, err
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
|
||||||
localVarHTTPResponse.Body.Close()
|
|
||||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if localVarHTTPResponse.StatusCode >= 300 {
|
|
||||||
newErr := &GenericOpenAPIError{
|
|
||||||
body: localVarBody,
|
|
||||||
error: localVarHTTPResponse.Status,
|
|
||||||
}
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
|
|
||||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
||||||
if err != nil {
|
|
||||||
newErr := &GenericOpenAPIError{
|
|
||||||
body: localVarBody,
|
|
||||||
error: err.Error(),
|
|
||||||
}
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, nil
|
|
||||||
}
|
|
||||||
@@ -1,122 +0,0 @@
|
|||||||
/*
|
|
||||||
AutoGlue API
|
|
||||||
|
|
||||||
API for managing K3s clusters across cloud providers
|
|
||||||
|
|
||||||
API version: 1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
||||||
|
|
||||||
package autoglue
|
|
||||||
|
|
||||||
import (
|
|
||||||
"bytes"
|
|
||||||
"context"
|
|
||||||
"io"
|
|
||||||
"net/http"
|
|
||||||
"net/url"
|
|
||||||
)
|
|
||||||
|
|
||||||
// HealthAPIService HealthAPI service
|
|
||||||
type HealthAPIService service
|
|
||||||
|
|
||||||
type ApiHealthCheckOperationIdRequest struct {
|
|
||||||
ctx context.Context
|
|
||||||
ApiService *HealthAPIService
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r ApiHealthCheckOperationIdRequest) Execute() (*HandlersHealthStatus, *http.Response, error) {
|
|
||||||
return r.ApiService.HealthCheckOperationIdExecute(r)
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
HealthCheckOperationId Basic health check
|
|
||||||
|
|
||||||
Returns 200 OK when the service is up
|
|
||||||
|
|
||||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
||||||
@return ApiHealthCheckOperationIdRequest
|
|
||||||
*/
|
|
||||||
func (a *HealthAPIService) HealthCheckOperationId(ctx context.Context) ApiHealthCheckOperationIdRequest {
|
|
||||||
return ApiHealthCheckOperationIdRequest{
|
|
||||||
ApiService: a,
|
|
||||||
ctx: ctx,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Execute executes the request
|
|
||||||
//
|
|
||||||
// @return HandlersHealthStatus
|
|
||||||
func (a *HealthAPIService) HealthCheckOperationIdExecute(r ApiHealthCheckOperationIdRequest) (*HandlersHealthStatus, *http.Response, error) {
|
|
||||||
var (
|
|
||||||
localVarHTTPMethod = http.MethodGet
|
|
||||||
localVarPostBody interface{}
|
|
||||||
formFiles []formFile
|
|
||||||
localVarReturnValue *HandlersHealthStatus
|
|
||||||
)
|
|
||||||
|
|
||||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "HealthAPIService.HealthCheckOperationId")
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarPath := localBasePath + "/healthz"
|
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
|
||||||
localVarQueryParams := url.Values{}
|
|
||||||
localVarFormParams := url.Values{}
|
|
||||||
|
|
||||||
// to determine the Content-Type header
|
|
||||||
localVarHTTPContentTypes := []string{}
|
|
||||||
|
|
||||||
// set Content-Type header
|
|
||||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
||||||
if localVarHTTPContentType != "" {
|
|
||||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
|
||||||
}
|
|
||||||
|
|
||||||
// to determine the Accept header
|
|
||||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
|
||||||
|
|
||||||
// set Accept header
|
|
||||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
||||||
if localVarHTTPHeaderAccept != "" {
|
|
||||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
|
||||||
}
|
|
||||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
||||||
if err != nil || localVarHTTPResponse == nil {
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, err
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
|
||||||
localVarHTTPResponse.Body.Close()
|
|
||||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if localVarHTTPResponse.StatusCode >= 300 {
|
|
||||||
newErr := &GenericOpenAPIError{
|
|
||||||
body: localVarBody,
|
|
||||||
error: localVarHTTPResponse.Status,
|
|
||||||
}
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
|
|
||||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
||||||
if err != nil {
|
|
||||||
newErr := &GenericOpenAPIError{
|
|
||||||
body: localVarBody,
|
|
||||||
error: err.Error(),
|
|
||||||
}
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, nil
|
|
||||||
}
|
|
||||||
1075
sdk/go/api_labels.go
1075
sdk/go/api_labels.go
File diff suppressed because it is too large
Load Diff
286
sdk/go/api_me.go
286
sdk/go/api_me.go
@@ -1,286 +0,0 @@
|
|||||||
/*
|
|
||||||
AutoGlue API
|
|
||||||
|
|
||||||
API for managing K3s clusters across cloud providers
|
|
||||||
|
|
||||||
API version: 1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
||||||
|
|
||||||
package autoglue
|
|
||||||
|
|
||||||
import (
|
|
||||||
"bytes"
|
|
||||||
"context"
|
|
||||||
"io"
|
|
||||||
"net/http"
|
|
||||||
"net/url"
|
|
||||||
)
|
|
||||||
|
|
||||||
// MeAPIService MeAPI service
|
|
||||||
type MeAPIService service
|
|
||||||
|
|
||||||
type ApiGetMeRequest struct {
|
|
||||||
ctx context.Context
|
|
||||||
ApiService *MeAPIService
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r ApiGetMeRequest) Execute() (*HandlersMeResponse, *http.Response, error) {
|
|
||||||
return r.ApiService.GetMeExecute(r)
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
GetMe Get current user profile
|
|
||||||
|
|
||||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
||||||
@return ApiGetMeRequest
|
|
||||||
*/
|
|
||||||
func (a *MeAPIService) GetMe(ctx context.Context) ApiGetMeRequest {
|
|
||||||
return ApiGetMeRequest{
|
|
||||||
ApiService: a,
|
|
||||||
ctx: ctx,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Execute executes the request
|
|
||||||
//
|
|
||||||
// @return HandlersMeResponse
|
|
||||||
func (a *MeAPIService) GetMeExecute(r ApiGetMeRequest) (*HandlersMeResponse, *http.Response, error) {
|
|
||||||
var (
|
|
||||||
localVarHTTPMethod = http.MethodGet
|
|
||||||
localVarPostBody interface{}
|
|
||||||
formFiles []formFile
|
|
||||||
localVarReturnValue *HandlersMeResponse
|
|
||||||
)
|
|
||||||
|
|
||||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MeAPIService.GetMe")
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarPath := localBasePath + "/me"
|
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
|
||||||
localVarQueryParams := url.Values{}
|
|
||||||
localVarFormParams := url.Values{}
|
|
||||||
|
|
||||||
// to determine the Content-Type header
|
|
||||||
localVarHTTPContentTypes := []string{}
|
|
||||||
|
|
||||||
// set Content-Type header
|
|
||||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
||||||
if localVarHTTPContentType != "" {
|
|
||||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
|
||||||
}
|
|
||||||
|
|
||||||
// to determine the Accept header
|
|
||||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
|
||||||
|
|
||||||
// set Accept header
|
|
||||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
||||||
if localVarHTTPHeaderAccept != "" {
|
|
||||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
|
||||||
}
|
|
||||||
if r.ctx != nil {
|
|
||||||
// API Key Authentication
|
|
||||||
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
|
|
||||||
if apiKey, ok := auth["ApiKeyAuth"]; ok {
|
|
||||||
var key string
|
|
||||||
if apiKey.Prefix != "" {
|
|
||||||
key = apiKey.Prefix + " " + apiKey.Key
|
|
||||||
} else {
|
|
||||||
key = apiKey.Key
|
|
||||||
}
|
|
||||||
localVarHeaderParams["X-API-KEY"] = key
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if r.ctx != nil {
|
|
||||||
// API Key Authentication
|
|
||||||
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
|
|
||||||
if apiKey, ok := auth["BearerAuth"]; ok {
|
|
||||||
var key string
|
|
||||||
if apiKey.Prefix != "" {
|
|
||||||
key = apiKey.Prefix + " " + apiKey.Key
|
|
||||||
} else {
|
|
||||||
key = apiKey.Key
|
|
||||||
}
|
|
||||||
localVarHeaderParams["Authorization"] = key
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
||||||
if err != nil || localVarHTTPResponse == nil {
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, err
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
|
||||||
localVarHTTPResponse.Body.Close()
|
|
||||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if localVarHTTPResponse.StatusCode >= 300 {
|
|
||||||
newErr := &GenericOpenAPIError{
|
|
||||||
body: localVarBody,
|
|
||||||
error: localVarHTTPResponse.Status,
|
|
||||||
}
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
|
|
||||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
||||||
if err != nil {
|
|
||||||
newErr := &GenericOpenAPIError{
|
|
||||||
body: localVarBody,
|
|
||||||
error: err.Error(),
|
|
||||||
}
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type ApiUpdateMeRequest struct {
|
|
||||||
ctx context.Context
|
|
||||||
ApiService *MeAPIService
|
|
||||||
body *HandlersUpdateMeRequest
|
|
||||||
}
|
|
||||||
|
|
||||||
// Patch profile
|
|
||||||
func (r ApiUpdateMeRequest) Body(body HandlersUpdateMeRequest) ApiUpdateMeRequest {
|
|
||||||
r.body = &body
|
|
||||||
return r
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r ApiUpdateMeRequest) Execute() (*ModelsUser, *http.Response, error) {
|
|
||||||
return r.ApiService.UpdateMeExecute(r)
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
UpdateMe Update current user profile
|
|
||||||
|
|
||||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
||||||
@return ApiUpdateMeRequest
|
|
||||||
*/
|
|
||||||
func (a *MeAPIService) UpdateMe(ctx context.Context) ApiUpdateMeRequest {
|
|
||||||
return ApiUpdateMeRequest{
|
|
||||||
ApiService: a,
|
|
||||||
ctx: ctx,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Execute executes the request
|
|
||||||
//
|
|
||||||
// @return ModelsUser
|
|
||||||
func (a *MeAPIService) UpdateMeExecute(r ApiUpdateMeRequest) (*ModelsUser, *http.Response, error) {
|
|
||||||
var (
|
|
||||||
localVarHTTPMethod = http.MethodPatch
|
|
||||||
localVarPostBody interface{}
|
|
||||||
formFiles []formFile
|
|
||||||
localVarReturnValue *ModelsUser
|
|
||||||
)
|
|
||||||
|
|
||||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MeAPIService.UpdateMe")
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarPath := localBasePath + "/me"
|
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
|
||||||
localVarQueryParams := url.Values{}
|
|
||||||
localVarFormParams := url.Values{}
|
|
||||||
if r.body == nil {
|
|
||||||
return localVarReturnValue, nil, reportError("body is required and must be specified")
|
|
||||||
}
|
|
||||||
|
|
||||||
// to determine the Content-Type header
|
|
||||||
localVarHTTPContentTypes := []string{"application/json"}
|
|
||||||
|
|
||||||
// set Content-Type header
|
|
||||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
||||||
if localVarHTTPContentType != "" {
|
|
||||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
|
||||||
}
|
|
||||||
|
|
||||||
// to determine the Accept header
|
|
||||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
|
||||||
|
|
||||||
// set Accept header
|
|
||||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
||||||
if localVarHTTPHeaderAccept != "" {
|
|
||||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
|
||||||
}
|
|
||||||
// body params
|
|
||||||
localVarPostBody = r.body
|
|
||||||
if r.ctx != nil {
|
|
||||||
// API Key Authentication
|
|
||||||
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
|
|
||||||
if apiKey, ok := auth["ApiKeyAuth"]; ok {
|
|
||||||
var key string
|
|
||||||
if apiKey.Prefix != "" {
|
|
||||||
key = apiKey.Prefix + " " + apiKey.Key
|
|
||||||
} else {
|
|
||||||
key = apiKey.Key
|
|
||||||
}
|
|
||||||
localVarHeaderParams["X-API-KEY"] = key
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if r.ctx != nil {
|
|
||||||
// API Key Authentication
|
|
||||||
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
|
|
||||||
if apiKey, ok := auth["BearerAuth"]; ok {
|
|
||||||
var key string
|
|
||||||
if apiKey.Prefix != "" {
|
|
||||||
key = apiKey.Prefix + " " + apiKey.Key
|
|
||||||
} else {
|
|
||||||
key = apiKey.Key
|
|
||||||
}
|
|
||||||
localVarHeaderParams["Authorization"] = key
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
||||||
if err != nil || localVarHTTPResponse == nil {
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, err
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
|
||||||
localVarHTTPResponse.Body.Close()
|
|
||||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if localVarHTTPResponse.StatusCode >= 300 {
|
|
||||||
newErr := &GenericOpenAPIError{
|
|
||||||
body: localVarBody,
|
|
||||||
error: localVarHTTPResponse.Status,
|
|
||||||
}
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
|
|
||||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
||||||
if err != nil {
|
|
||||||
newErr := &GenericOpenAPIError{
|
|
||||||
body: localVarBody,
|
|
||||||
error: err.Error(),
|
|
||||||
}
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, nil
|
|
||||||
}
|
|
||||||
@@ -1,393 +0,0 @@
|
|||||||
/*
|
|
||||||
AutoGlue API
|
|
||||||
|
|
||||||
API for managing K3s clusters across cloud providers
|
|
||||||
|
|
||||||
API version: 1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
||||||
|
|
||||||
package autoglue
|
|
||||||
|
|
||||||
import (
|
|
||||||
"bytes"
|
|
||||||
"context"
|
|
||||||
"io"
|
|
||||||
"net/http"
|
|
||||||
"net/url"
|
|
||||||
"strings"
|
|
||||||
)
|
|
||||||
|
|
||||||
// MeAPIKeysAPIService MeAPIKeysAPI service
|
|
||||||
type MeAPIKeysAPIService service
|
|
||||||
|
|
||||||
type ApiCreateUserAPIKeyRequest struct {
|
|
||||||
ctx context.Context
|
|
||||||
ApiService *MeAPIKeysAPIService
|
|
||||||
body *HandlersCreateUserKeyRequest
|
|
||||||
}
|
|
||||||
|
|
||||||
// Key options
|
|
||||||
func (r ApiCreateUserAPIKeyRequest) Body(body HandlersCreateUserKeyRequest) ApiCreateUserAPIKeyRequest {
|
|
||||||
r.body = &body
|
|
||||||
return r
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r ApiCreateUserAPIKeyRequest) Execute() (*HandlersUserAPIKeyOut, *http.Response, error) {
|
|
||||||
return r.ApiService.CreateUserAPIKeyExecute(r)
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
CreateUserAPIKey Create a new user API key
|
|
||||||
|
|
||||||
Returns the plaintext key once. Store it securely on the client side.
|
|
||||||
|
|
||||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
||||||
@return ApiCreateUserAPIKeyRequest
|
|
||||||
*/
|
|
||||||
func (a *MeAPIKeysAPIService) CreateUserAPIKey(ctx context.Context) ApiCreateUserAPIKeyRequest {
|
|
||||||
return ApiCreateUserAPIKeyRequest{
|
|
||||||
ApiService: a,
|
|
||||||
ctx: ctx,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Execute executes the request
|
|
||||||
//
|
|
||||||
// @return HandlersUserAPIKeyOut
|
|
||||||
func (a *MeAPIKeysAPIService) CreateUserAPIKeyExecute(r ApiCreateUserAPIKeyRequest) (*HandlersUserAPIKeyOut, *http.Response, error) {
|
|
||||||
var (
|
|
||||||
localVarHTTPMethod = http.MethodPost
|
|
||||||
localVarPostBody interface{}
|
|
||||||
formFiles []formFile
|
|
||||||
localVarReturnValue *HandlersUserAPIKeyOut
|
|
||||||
)
|
|
||||||
|
|
||||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MeAPIKeysAPIService.CreateUserAPIKey")
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarPath := localBasePath + "/me/api-keys"
|
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
|
||||||
localVarQueryParams := url.Values{}
|
|
||||||
localVarFormParams := url.Values{}
|
|
||||||
if r.body == nil {
|
|
||||||
return localVarReturnValue, nil, reportError("body is required and must be specified")
|
|
||||||
}
|
|
||||||
|
|
||||||
// to determine the Content-Type header
|
|
||||||
localVarHTTPContentTypes := []string{"application/json"}
|
|
||||||
|
|
||||||
// set Content-Type header
|
|
||||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
||||||
if localVarHTTPContentType != "" {
|
|
||||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
|
||||||
}
|
|
||||||
|
|
||||||
// to determine the Accept header
|
|
||||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
|
||||||
|
|
||||||
// set Accept header
|
|
||||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
||||||
if localVarHTTPHeaderAccept != "" {
|
|
||||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
|
||||||
}
|
|
||||||
// body params
|
|
||||||
localVarPostBody = r.body
|
|
||||||
if r.ctx != nil {
|
|
||||||
// API Key Authentication
|
|
||||||
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
|
|
||||||
if apiKey, ok := auth["ApiKeyAuth"]; ok {
|
|
||||||
var key string
|
|
||||||
if apiKey.Prefix != "" {
|
|
||||||
key = apiKey.Prefix + " " + apiKey.Key
|
|
||||||
} else {
|
|
||||||
key = apiKey.Key
|
|
||||||
}
|
|
||||||
localVarHeaderParams["X-API-KEY"] = key
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if r.ctx != nil {
|
|
||||||
// API Key Authentication
|
|
||||||
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
|
|
||||||
if apiKey, ok := auth["BearerAuth"]; ok {
|
|
||||||
var key string
|
|
||||||
if apiKey.Prefix != "" {
|
|
||||||
key = apiKey.Prefix + " " + apiKey.Key
|
|
||||||
} else {
|
|
||||||
key = apiKey.Key
|
|
||||||
}
|
|
||||||
localVarHeaderParams["Authorization"] = key
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
||||||
if err != nil || localVarHTTPResponse == nil {
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, err
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
|
||||||
localVarHTTPResponse.Body.Close()
|
|
||||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if localVarHTTPResponse.StatusCode >= 300 {
|
|
||||||
newErr := &GenericOpenAPIError{
|
|
||||||
body: localVarBody,
|
|
||||||
error: localVarHTTPResponse.Status,
|
|
||||||
}
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
|
|
||||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
||||||
if err != nil {
|
|
||||||
newErr := &GenericOpenAPIError{
|
|
||||||
body: localVarBody,
|
|
||||||
error: err.Error(),
|
|
||||||
}
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type ApiDeleteUserAPIKeyRequest struct {
|
|
||||||
ctx context.Context
|
|
||||||
ApiService *MeAPIKeysAPIService
|
|
||||||
id string
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r ApiDeleteUserAPIKeyRequest) Execute() (*http.Response, error) {
|
|
||||||
return r.ApiService.DeleteUserAPIKeyExecute(r)
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
DeleteUserAPIKey Delete a user API key
|
|
||||||
|
|
||||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
||||||
@param id Key ID (UUID)
|
|
||||||
@return ApiDeleteUserAPIKeyRequest
|
|
||||||
*/
|
|
||||||
func (a *MeAPIKeysAPIService) DeleteUserAPIKey(ctx context.Context, id string) ApiDeleteUserAPIKeyRequest {
|
|
||||||
return ApiDeleteUserAPIKeyRequest{
|
|
||||||
ApiService: a,
|
|
||||||
ctx: ctx,
|
|
||||||
id: id,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Execute executes the request
|
|
||||||
func (a *MeAPIKeysAPIService) DeleteUserAPIKeyExecute(r ApiDeleteUserAPIKeyRequest) (*http.Response, error) {
|
|
||||||
var (
|
|
||||||
localVarHTTPMethod = http.MethodDelete
|
|
||||||
localVarPostBody interface{}
|
|
||||||
formFiles []formFile
|
|
||||||
)
|
|
||||||
|
|
||||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MeAPIKeysAPIService.DeleteUserAPIKey")
|
|
||||||
if err != nil {
|
|
||||||
return nil, &GenericOpenAPIError{error: err.Error()}
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarPath := localBasePath + "/me/api-keys/{id}"
|
|
||||||
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1)
|
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
|
||||||
localVarQueryParams := url.Values{}
|
|
||||||
localVarFormParams := url.Values{}
|
|
||||||
|
|
||||||
// to determine the Content-Type header
|
|
||||||
localVarHTTPContentTypes := []string{}
|
|
||||||
|
|
||||||
// set Content-Type header
|
|
||||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
||||||
if localVarHTTPContentType != "" {
|
|
||||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
|
||||||
}
|
|
||||||
|
|
||||||
// to determine the Accept header
|
|
||||||
localVarHTTPHeaderAccepts := []string{}
|
|
||||||
|
|
||||||
// set Accept header
|
|
||||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
||||||
if localVarHTTPHeaderAccept != "" {
|
|
||||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
|
||||||
}
|
|
||||||
if r.ctx != nil {
|
|
||||||
// API Key Authentication
|
|
||||||
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
|
|
||||||
if apiKey, ok := auth["BearerAuth"]; ok {
|
|
||||||
var key string
|
|
||||||
if apiKey.Prefix != "" {
|
|
||||||
key = apiKey.Prefix + " " + apiKey.Key
|
|
||||||
} else {
|
|
||||||
key = apiKey.Key
|
|
||||||
}
|
|
||||||
localVarHeaderParams["Authorization"] = key
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
||||||
if err != nil || localVarHTTPResponse == nil {
|
|
||||||
return localVarHTTPResponse, err
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
|
||||||
localVarHTTPResponse.Body.Close()
|
|
||||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
|
||||||
if err != nil {
|
|
||||||
return localVarHTTPResponse, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if localVarHTTPResponse.StatusCode >= 300 {
|
|
||||||
newErr := &GenericOpenAPIError{
|
|
||||||
body: localVarBody,
|
|
||||||
error: localVarHTTPResponse.Status,
|
|
||||||
}
|
|
||||||
return localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
|
|
||||||
return localVarHTTPResponse, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type ApiListUserAPIKeysRequest struct {
|
|
||||||
ctx context.Context
|
|
||||||
ApiService *MeAPIKeysAPIService
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r ApiListUserAPIKeysRequest) Execute() ([]HandlersUserAPIKeyOut, *http.Response, error) {
|
|
||||||
return r.ApiService.ListUserAPIKeysExecute(r)
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
ListUserAPIKeys List my API keys
|
|
||||||
|
|
||||||
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
|
||||||
@return ApiListUserAPIKeysRequest
|
|
||||||
*/
|
|
||||||
func (a *MeAPIKeysAPIService) ListUserAPIKeys(ctx context.Context) ApiListUserAPIKeysRequest {
|
|
||||||
return ApiListUserAPIKeysRequest{
|
|
||||||
ApiService: a,
|
|
||||||
ctx: ctx,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Execute executes the request
|
|
||||||
//
|
|
||||||
// @return []HandlersUserAPIKeyOut
|
|
||||||
func (a *MeAPIKeysAPIService) ListUserAPIKeysExecute(r ApiListUserAPIKeysRequest) ([]HandlersUserAPIKeyOut, *http.Response, error) {
|
|
||||||
var (
|
|
||||||
localVarHTTPMethod = http.MethodGet
|
|
||||||
localVarPostBody interface{}
|
|
||||||
formFiles []formFile
|
|
||||||
localVarReturnValue []HandlersUserAPIKeyOut
|
|
||||||
)
|
|
||||||
|
|
||||||
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "MeAPIKeysAPIService.ListUserAPIKeys")
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarPath := localBasePath + "/me/api-keys"
|
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
|
||||||
localVarQueryParams := url.Values{}
|
|
||||||
localVarFormParams := url.Values{}
|
|
||||||
|
|
||||||
// to determine the Content-Type header
|
|
||||||
localVarHTTPContentTypes := []string{}
|
|
||||||
|
|
||||||
// set Content-Type header
|
|
||||||
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
|
||||||
if localVarHTTPContentType != "" {
|
|
||||||
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
|
||||||
}
|
|
||||||
|
|
||||||
// to determine the Accept header
|
|
||||||
localVarHTTPHeaderAccepts := []string{"application/json"}
|
|
||||||
|
|
||||||
// set Accept header
|
|
||||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
|
||||||
if localVarHTTPHeaderAccept != "" {
|
|
||||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
|
||||||
}
|
|
||||||
if r.ctx != nil {
|
|
||||||
// API Key Authentication
|
|
||||||
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
|
|
||||||
if apiKey, ok := auth["ApiKeyAuth"]; ok {
|
|
||||||
var key string
|
|
||||||
if apiKey.Prefix != "" {
|
|
||||||
key = apiKey.Prefix + " " + apiKey.Key
|
|
||||||
} else {
|
|
||||||
key = apiKey.Key
|
|
||||||
}
|
|
||||||
localVarHeaderParams["X-API-KEY"] = key
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if r.ctx != nil {
|
|
||||||
// API Key Authentication
|
|
||||||
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
|
|
||||||
if apiKey, ok := auth["BearerAuth"]; ok {
|
|
||||||
var key string
|
|
||||||
if apiKey.Prefix != "" {
|
|
||||||
key = apiKey.Prefix + " " + apiKey.Key
|
|
||||||
} else {
|
|
||||||
key = apiKey.Key
|
|
||||||
}
|
|
||||||
localVarHeaderParams["Authorization"] = key
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarHTTPResponse, err := a.client.callAPI(req)
|
|
||||||
if err != nil || localVarHTTPResponse == nil {
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, err
|
|
||||||
}
|
|
||||||
|
|
||||||
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
|
|
||||||
localVarHTTPResponse.Body.Close()
|
|
||||||
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
|
|
||||||
if err != nil {
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if localVarHTTPResponse.StatusCode >= 300 {
|
|
||||||
newErr := &GenericOpenAPIError{
|
|
||||||
body: localVarBody,
|
|
||||||
error: localVarHTTPResponse.Status,
|
|
||||||
}
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
|
|
||||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
|
|
||||||
if err != nil {
|
|
||||||
newErr := &GenericOpenAPIError{
|
|
||||||
body: localVarBody,
|
|
||||||
error: err.Error(),
|
|
||||||
}
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, newErr
|
|
||||||
}
|
|
||||||
|
|
||||||
return localVarReturnValue, localVarHTTPResponse, nil
|
|
||||||
}
|
|
||||||
1476
sdk/go/api_orgs.go
1476
sdk/go/api_orgs.go
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1055
sdk/go/api_ssh.go
1055
sdk/go/api_ssh.go
File diff suppressed because it is too large
Load Diff
1073
sdk/go/api_taints.go
1073
sdk/go/api_taints.go
File diff suppressed because it is too large
Load Diff
685
sdk/go/client.go
685
sdk/go/client.go
@@ -1,685 +0,0 @@
|
|||||||
/*
|
|
||||||
AutoGlue API
|
|
||||||
|
|
||||||
API for managing K3s clusters across cloud providers
|
|
||||||
|
|
||||||
API version: 1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
||||||
|
|
||||||
package autoglue
|
|
||||||
|
|
||||||
import (
|
|
||||||
"bytes"
|
|
||||||
"context"
|
|
||||||
"encoding/json"
|
|
||||||
"encoding/xml"
|
|
||||||
"errors"
|
|
||||||
"fmt"
|
|
||||||
"io"
|
|
||||||
"log"
|
|
||||||
"mime/multipart"
|
|
||||||
"net/http"
|
|
||||||
"net/http/httputil"
|
|
||||||
"net/url"
|
|
||||||
"os"
|
|
||||||
"path/filepath"
|
|
||||||
"reflect"
|
|
||||||
"regexp"
|
|
||||||
"strconv"
|
|
||||||
"strings"
|
|
||||||
"time"
|
|
||||||
"unicode/utf8"
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`)
|
|
||||||
XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`)
|
|
||||||
queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`)
|
|
||||||
queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]")
|
|
||||||
)
|
|
||||||
|
|
||||||
// APIClient manages communication with the AutoGlue API API v1.0
|
|
||||||
// In most cases there should be only one, shared, APIClient.
|
|
||||||
type APIClient struct {
|
|
||||||
cfg *Configuration
|
|
||||||
common service // Reuse a single struct instead of allocating one for each service on the heap.
|
|
||||||
|
|
||||||
// API Services
|
|
||||||
|
|
||||||
AnnotationsAPI *AnnotationsAPIService
|
|
||||||
|
|
||||||
ArcherAdminAPI *ArcherAdminAPIService
|
|
||||||
|
|
||||||
AuthAPI *AuthAPIService
|
|
||||||
|
|
||||||
HealthAPI *HealthAPIService
|
|
||||||
|
|
||||||
LabelsAPI *LabelsAPIService
|
|
||||||
|
|
||||||
MeAPI *MeAPIService
|
|
||||||
|
|
||||||
MeAPIKeysAPI *MeAPIKeysAPIService
|
|
||||||
|
|
||||||
OrgsAPI *OrgsAPIService
|
|
||||||
|
|
||||||
ServersAPI *ServersAPIService
|
|
||||||
|
|
||||||
SshAPI *SshAPIService
|
|
||||||
|
|
||||||
TaintsAPI *TaintsAPIService
|
|
||||||
}
|
|
||||||
|
|
||||||
type service struct {
|
|
||||||
client *APIClient
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewAPIClient creates a new API client. Requires a userAgent string describing your application.
|
|
||||||
// optionally a custom http.Client to allow for advanced features such as caching.
|
|
||||||
func NewAPIClient(cfg *Configuration) *APIClient {
|
|
||||||
if cfg.HTTPClient == nil {
|
|
||||||
cfg.HTTPClient = http.DefaultClient
|
|
||||||
}
|
|
||||||
|
|
||||||
c := &APIClient{}
|
|
||||||
c.cfg = cfg
|
|
||||||
c.common.client = c
|
|
||||||
|
|
||||||
// API Services
|
|
||||||
c.AnnotationsAPI = (*AnnotationsAPIService)(&c.common)
|
|
||||||
c.ArcherAdminAPI = (*ArcherAdminAPIService)(&c.common)
|
|
||||||
c.AuthAPI = (*AuthAPIService)(&c.common)
|
|
||||||
c.HealthAPI = (*HealthAPIService)(&c.common)
|
|
||||||
c.LabelsAPI = (*LabelsAPIService)(&c.common)
|
|
||||||
c.MeAPI = (*MeAPIService)(&c.common)
|
|
||||||
c.MeAPIKeysAPI = (*MeAPIKeysAPIService)(&c.common)
|
|
||||||
c.OrgsAPI = (*OrgsAPIService)(&c.common)
|
|
||||||
c.ServersAPI = (*ServersAPIService)(&c.common)
|
|
||||||
c.SshAPI = (*SshAPIService)(&c.common)
|
|
||||||
c.TaintsAPI = (*TaintsAPIService)(&c.common)
|
|
||||||
|
|
||||||
return c
|
|
||||||
}
|
|
||||||
|
|
||||||
func atoi(in string) (int, error) {
|
|
||||||
return strconv.Atoi(in)
|
|
||||||
}
|
|
||||||
|
|
||||||
// selectHeaderContentType select a content type from the available list.
|
|
||||||
func selectHeaderContentType(contentTypes []string) string {
|
|
||||||
if len(contentTypes) == 0 {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
if contains(contentTypes, "application/json") {
|
|
||||||
return "application/json"
|
|
||||||
}
|
|
||||||
return contentTypes[0] // use the first content type specified in 'consumes'
|
|
||||||
}
|
|
||||||
|
|
||||||
// selectHeaderAccept join all accept types and return
|
|
||||||
func selectHeaderAccept(accepts []string) string {
|
|
||||||
if len(accepts) == 0 {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
if contains(accepts, "application/json") {
|
|
||||||
return "application/json"
|
|
||||||
}
|
|
||||||
|
|
||||||
return strings.Join(accepts, ",")
|
|
||||||
}
|
|
||||||
|
|
||||||
// contains is a case insensitive match, finding needle in a haystack
|
|
||||||
func contains(haystack []string, needle string) bool {
|
|
||||||
for _, a := range haystack {
|
|
||||||
if strings.EqualFold(a, needle) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// Verify optional parameters are of the correct type.
|
|
||||||
func typeCheckParameter(obj interface{}, expected string, name string) error {
|
|
||||||
// Make sure there is an object.
|
|
||||||
if obj == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check the type is as expected.
|
|
||||||
if reflect.TypeOf(obj).String() != expected {
|
|
||||||
return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String())
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func parameterValueToString(obj interface{}, key string) string {
|
|
||||||
if reflect.TypeOf(obj).Kind() != reflect.Ptr {
|
|
||||||
if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok {
|
|
||||||
return fmt.Sprintf("%v", actualObj.GetActualInstanceValue())
|
|
||||||
}
|
|
||||||
|
|
||||||
return fmt.Sprintf("%v", obj)
|
|
||||||
}
|
|
||||||
var param, ok = obj.(MappedNullable)
|
|
||||||
if !ok {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
dataMap, err := param.ToMap()
|
|
||||||
if err != nil {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
return fmt.Sprintf("%v", dataMap[key])
|
|
||||||
}
|
|
||||||
|
|
||||||
// parameterAddToHeaderOrQuery adds the provided object to the request header or url query
|
|
||||||
// supporting deep object syntax
|
|
||||||
func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) {
|
|
||||||
var v = reflect.ValueOf(obj)
|
|
||||||
var value = ""
|
|
||||||
if v == reflect.ValueOf(nil) {
|
|
||||||
value = "null"
|
|
||||||
} else {
|
|
||||||
switch v.Kind() {
|
|
||||||
case reflect.Invalid:
|
|
||||||
value = "invalid"
|
|
||||||
|
|
||||||
case reflect.Struct:
|
|
||||||
if t, ok := obj.(MappedNullable); ok {
|
|
||||||
dataMap, err := t.ToMap()
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if t, ok := obj.(time.Time); ok {
|
|
||||||
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
value = v.Type().String() + " value"
|
|
||||||
case reflect.Slice:
|
|
||||||
var indValue = reflect.ValueOf(obj)
|
|
||||||
if indValue == reflect.ValueOf(nil) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var lenIndValue = indValue.Len()
|
|
||||||
for i := 0; i < lenIndValue; i++ {
|
|
||||||
var arrayValue = indValue.Index(i)
|
|
||||||
var keyPrefixForCollectionType = keyPrefix
|
|
||||||
if style == "deepObject" {
|
|
||||||
keyPrefixForCollectionType = keyPrefix + "[" + strconv.Itoa(i) + "]"
|
|
||||||
}
|
|
||||||
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefixForCollectionType, arrayValue.Interface(), style, collectionType)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
|
|
||||||
case reflect.Map:
|
|
||||||
var indValue = reflect.ValueOf(obj)
|
|
||||||
if indValue == reflect.ValueOf(nil) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
iter := indValue.MapRange()
|
|
||||||
for iter.Next() {
|
|
||||||
k, v := iter.Key(), iter.Value()
|
|
||||||
parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
|
|
||||||
case reflect.Interface:
|
|
||||||
fallthrough
|
|
||||||
case reflect.Ptr:
|
|
||||||
parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), style, collectionType)
|
|
||||||
return
|
|
||||||
|
|
||||||
case reflect.Int, reflect.Int8, reflect.Int16,
|
|
||||||
reflect.Int32, reflect.Int64:
|
|
||||||
value = strconv.FormatInt(v.Int(), 10)
|
|
||||||
case reflect.Uint, reflect.Uint8, reflect.Uint16,
|
|
||||||
reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
|
||||||
value = strconv.FormatUint(v.Uint(), 10)
|
|
||||||
case reflect.Float32, reflect.Float64:
|
|
||||||
value = strconv.FormatFloat(v.Float(), 'g', -1, 32)
|
|
||||||
case reflect.Bool:
|
|
||||||
value = strconv.FormatBool(v.Bool())
|
|
||||||
case reflect.String:
|
|
||||||
value = v.String()
|
|
||||||
default:
|
|
||||||
value = v.Type().String() + " value"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
switch valuesMap := headerOrQueryParams.(type) {
|
|
||||||
case url.Values:
|
|
||||||
if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" {
|
|
||||||
valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value)
|
|
||||||
} else {
|
|
||||||
valuesMap.Add(keyPrefix, value)
|
|
||||||
}
|
|
||||||
break
|
|
||||||
case map[string]string:
|
|
||||||
valuesMap[keyPrefix] = value
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// helper for converting interface{} parameters to json strings
|
|
||||||
func parameterToJson(obj interface{}) (string, error) {
|
|
||||||
jsonBuf, err := json.Marshal(obj)
|
|
||||||
if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
return string(jsonBuf), err
|
|
||||||
}
|
|
||||||
|
|
||||||
// callAPI do the request.
|
|
||||||
func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) {
|
|
||||||
if c.cfg.Debug {
|
|
||||||
dump, err := httputil.DumpRequestOut(request, true)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
log.Printf("\n%s\n", string(dump))
|
|
||||||
}
|
|
||||||
|
|
||||||
resp, err := c.cfg.HTTPClient.Do(request)
|
|
||||||
if err != nil {
|
|
||||||
return resp, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if c.cfg.Debug {
|
|
||||||
dump, err := httputil.DumpResponse(resp, true)
|
|
||||||
if err != nil {
|
|
||||||
return resp, err
|
|
||||||
}
|
|
||||||
log.Printf("\n%s\n", string(dump))
|
|
||||||
}
|
|
||||||
return resp, err
|
|
||||||
}
|
|
||||||
|
|
||||||
// Allow modification of underlying config for alternate implementations and testing
|
|
||||||
// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior
|
|
||||||
func (c *APIClient) GetConfig() *Configuration {
|
|
||||||
return c.cfg
|
|
||||||
}
|
|
||||||
|
|
||||||
type formFile struct {
|
|
||||||
fileBytes []byte
|
|
||||||
fileName string
|
|
||||||
formFileName string
|
|
||||||
}
|
|
||||||
|
|
||||||
// prepareRequest build the request
|
|
||||||
func (c *APIClient) prepareRequest(
|
|
||||||
ctx context.Context,
|
|
||||||
path string, method string,
|
|
||||||
postBody interface{},
|
|
||||||
headerParams map[string]string,
|
|
||||||
queryParams url.Values,
|
|
||||||
formParams url.Values,
|
|
||||||
formFiles []formFile) (localVarRequest *http.Request, err error) {
|
|
||||||
|
|
||||||
var body *bytes.Buffer
|
|
||||||
|
|
||||||
// Detect postBody type and post.
|
|
||||||
if postBody != nil {
|
|
||||||
contentType := headerParams["Content-Type"]
|
|
||||||
if contentType == "" {
|
|
||||||
contentType = detectContentType(postBody)
|
|
||||||
headerParams["Content-Type"] = contentType
|
|
||||||
}
|
|
||||||
|
|
||||||
body, err = setBody(postBody, contentType)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// add form parameters and file if available.
|
|
||||||
if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) {
|
|
||||||
if body != nil {
|
|
||||||
return nil, errors.New("Cannot specify postBody and multipart form at the same time.")
|
|
||||||
}
|
|
||||||
body = &bytes.Buffer{}
|
|
||||||
w := multipart.NewWriter(body)
|
|
||||||
|
|
||||||
for k, v := range formParams {
|
|
||||||
for _, iv := range v {
|
|
||||||
if strings.HasPrefix(k, "@") { // file
|
|
||||||
err = addFile(w, k[1:], iv)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
} else { // form value
|
|
||||||
w.WriteField(k, iv)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for _, formFile := range formFiles {
|
|
||||||
if len(formFile.fileBytes) > 0 && formFile.fileName != "" {
|
|
||||||
w.Boundary()
|
|
||||||
part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName))
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
_, err = part.Write(formFile.fileBytes)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set the Boundary in the Content-Type
|
|
||||||
headerParams["Content-Type"] = w.FormDataContentType()
|
|
||||||
|
|
||||||
// Set Content-Length
|
|
||||||
headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len())
|
|
||||||
w.Close()
|
|
||||||
}
|
|
||||||
|
|
||||||
if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 {
|
|
||||||
if body != nil {
|
|
||||||
return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.")
|
|
||||||
}
|
|
||||||
body = &bytes.Buffer{}
|
|
||||||
body.WriteString(formParams.Encode())
|
|
||||||
// Set Content-Length
|
|
||||||
headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len())
|
|
||||||
}
|
|
||||||
|
|
||||||
// Setup path and query parameters
|
|
||||||
url, err := url.Parse(path)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
// Override request host, if applicable
|
|
||||||
if c.cfg.Host != "" {
|
|
||||||
url.Host = c.cfg.Host
|
|
||||||
}
|
|
||||||
|
|
||||||
// Override request scheme, if applicable
|
|
||||||
if c.cfg.Scheme != "" {
|
|
||||||
url.Scheme = c.cfg.Scheme
|
|
||||||
}
|
|
||||||
|
|
||||||
// Adding Query Param
|
|
||||||
query := url.Query()
|
|
||||||
for k, v := range queryParams {
|
|
||||||
for _, iv := range v {
|
|
||||||
query.Add(k, iv)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Encode the parameters.
|
|
||||||
url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string {
|
|
||||||
pieces := strings.Split(s, "=")
|
|
||||||
pieces[0] = queryDescape.Replace(pieces[0])
|
|
||||||
return strings.Join(pieces, "=")
|
|
||||||
})
|
|
||||||
|
|
||||||
// Generate a new request
|
|
||||||
if body != nil {
|
|
||||||
localVarRequest, err = http.NewRequest(method, url.String(), body)
|
|
||||||
} else {
|
|
||||||
localVarRequest, err = http.NewRequest(method, url.String(), nil)
|
|
||||||
}
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
// add header parameters, if any
|
|
||||||
if len(headerParams) > 0 {
|
|
||||||
headers := http.Header{}
|
|
||||||
for h, v := range headerParams {
|
|
||||||
headers[h] = []string{v}
|
|
||||||
}
|
|
||||||
localVarRequest.Header = headers
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add the user agent to the request.
|
|
||||||
localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent)
|
|
||||||
|
|
||||||
if ctx != nil {
|
|
||||||
// add context to the request
|
|
||||||
localVarRequest = localVarRequest.WithContext(ctx)
|
|
||||||
|
|
||||||
// Walk through any authentication.
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
for header, value := range c.cfg.DefaultHeader {
|
|
||||||
localVarRequest.Header.Add(header, value)
|
|
||||||
}
|
|
||||||
return localVarRequest, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) {
|
|
||||||
if len(b) == 0 {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
if s, ok := v.(*string); ok {
|
|
||||||
*s = string(b)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
if f, ok := v.(*os.File); ok {
|
|
||||||
f, err = os.CreateTemp("", "HttpClientFile")
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, err = f.Write(b)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, err = f.Seek(0, io.SeekStart)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if f, ok := v.(**os.File); ok {
|
|
||||||
*f, err = os.CreateTemp("", "HttpClientFile")
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, err = (*f).Write(b)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, err = (*f).Seek(0, io.SeekStart)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if XmlCheck.MatchString(contentType) {
|
|
||||||
if err = xml.Unmarshal(b, v); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
if JsonCheck.MatchString(contentType) {
|
|
||||||
if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas
|
|
||||||
if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined
|
|
||||||
if err = unmarshalObj.UnmarshalJSON(b); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined")
|
|
||||||
}
|
|
||||||
} else if err = json.Unmarshal(b, v); err != nil { // simple model
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
return errors.New("undefined response type")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add a file to the multipart request
|
|
||||||
func addFile(w *multipart.Writer, fieldName, path string) error {
|
|
||||||
file, err := os.Open(filepath.Clean(path))
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
err = file.Close()
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
part, err := w.CreateFormFile(fieldName, filepath.Base(path))
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
_, err = io.Copy(part, file)
|
|
||||||
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set request body from an interface{}
|
|
||||||
func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) {
|
|
||||||
if bodyBuf == nil {
|
|
||||||
bodyBuf = &bytes.Buffer{}
|
|
||||||
}
|
|
||||||
|
|
||||||
if reader, ok := body.(io.Reader); ok {
|
|
||||||
_, err = bodyBuf.ReadFrom(reader)
|
|
||||||
} else if fp, ok := body.(*os.File); ok {
|
|
||||||
_, err = bodyBuf.ReadFrom(fp)
|
|
||||||
} else if b, ok := body.([]byte); ok {
|
|
||||||
_, err = bodyBuf.Write(b)
|
|
||||||
} else if s, ok := body.(string); ok {
|
|
||||||
_, err = bodyBuf.WriteString(s)
|
|
||||||
} else if s, ok := body.(*string); ok {
|
|
||||||
_, err = bodyBuf.WriteString(*s)
|
|
||||||
} else if JsonCheck.MatchString(contentType) {
|
|
||||||
err = json.NewEncoder(bodyBuf).Encode(body)
|
|
||||||
} else if XmlCheck.MatchString(contentType) {
|
|
||||||
var bs []byte
|
|
||||||
bs, err = xml.Marshal(body)
|
|
||||||
if err == nil {
|
|
||||||
bodyBuf.Write(bs)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if bodyBuf.Len() == 0 {
|
|
||||||
err = fmt.Errorf("invalid body type %s\n", contentType)
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return bodyBuf, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// detectContentType method is used to figure out `Request.Body` content type for request header
|
|
||||||
func detectContentType(body interface{}) string {
|
|
||||||
contentType := "text/plain; charset=utf-8"
|
|
||||||
kind := reflect.TypeOf(body).Kind()
|
|
||||||
|
|
||||||
switch kind {
|
|
||||||
case reflect.Struct, reflect.Map, reflect.Ptr:
|
|
||||||
contentType = "application/json; charset=utf-8"
|
|
||||||
case reflect.String:
|
|
||||||
contentType = "text/plain; charset=utf-8"
|
|
||||||
default:
|
|
||||||
if b, ok := body.([]byte); ok {
|
|
||||||
contentType = http.DetectContentType(b)
|
|
||||||
} else if kind == reflect.Slice {
|
|
||||||
contentType = "application/json; charset=utf-8"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return contentType
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go
|
|
||||||
type cacheControl map[string]string
|
|
||||||
|
|
||||||
func parseCacheControl(headers http.Header) cacheControl {
|
|
||||||
cc := cacheControl{}
|
|
||||||
ccHeader := headers.Get("Cache-Control")
|
|
||||||
for _, part := range strings.Split(ccHeader, ",") {
|
|
||||||
part = strings.Trim(part, " ")
|
|
||||||
if part == "" {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if strings.ContainsRune(part, '=') {
|
|
||||||
keyval := strings.Split(part, "=")
|
|
||||||
cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",")
|
|
||||||
} else {
|
|
||||||
cc[part] = ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return cc
|
|
||||||
}
|
|
||||||
|
|
||||||
// CacheExpires helper function to determine remaining time before repeating a request.
|
|
||||||
func CacheExpires(r *http.Response) time.Time {
|
|
||||||
// Figure out when the cache expires.
|
|
||||||
var expires time.Time
|
|
||||||
now, err := time.Parse(time.RFC1123, r.Header.Get("date"))
|
|
||||||
if err != nil {
|
|
||||||
return time.Now()
|
|
||||||
}
|
|
||||||
respCacheControl := parseCacheControl(r.Header)
|
|
||||||
|
|
||||||
if maxAge, ok := respCacheControl["max-age"]; ok {
|
|
||||||
lifetime, err := time.ParseDuration(maxAge + "s")
|
|
||||||
if err != nil {
|
|
||||||
expires = now
|
|
||||||
} else {
|
|
||||||
expires = now.Add(lifetime)
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
expiresHeader := r.Header.Get("Expires")
|
|
||||||
if expiresHeader != "" {
|
|
||||||
expires, err = time.Parse(time.RFC1123, expiresHeader)
|
|
||||||
if err != nil {
|
|
||||||
expires = now
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return expires
|
|
||||||
}
|
|
||||||
|
|
||||||
func strlen(s string) int {
|
|
||||||
return utf8.RuneCountInString(s)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GenericOpenAPIError Provides access to the body, error and model on returned errors.
|
|
||||||
type GenericOpenAPIError struct {
|
|
||||||
body []byte
|
|
||||||
error string
|
|
||||||
model interface{}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Error returns non-empty string if there was an error.
|
|
||||||
func (e GenericOpenAPIError) Error() string {
|
|
||||||
return e.error
|
|
||||||
}
|
|
||||||
|
|
||||||
// Body returns the raw bytes of the response
|
|
||||||
func (e GenericOpenAPIError) Body() []byte {
|
|
||||||
return e.body
|
|
||||||
}
|
|
||||||
|
|
||||||
// Model returns the unpacked model of the error
|
|
||||||
func (e GenericOpenAPIError) Model() interface{} {
|
|
||||||
return e.model
|
|
||||||
}
|
|
||||||
|
|
||||||
// format error message using title and detail when model implements rfc7807
|
|
||||||
func formatErrorMessage(status string, v interface{}) string {
|
|
||||||
str := ""
|
|
||||||
metaValue := reflect.ValueOf(v).Elem()
|
|
||||||
|
|
||||||
if metaValue.Kind() == reflect.Struct {
|
|
||||||
field := metaValue.FieldByName("Title")
|
|
||||||
if field != (reflect.Value{}) {
|
|
||||||
str = fmt.Sprintf("%s", field.Interface())
|
|
||||||
}
|
|
||||||
|
|
||||||
field = metaValue.FieldByName("Detail")
|
|
||||||
if field != (reflect.Value{}) {
|
|
||||||
str = fmt.Sprintf("%s (%s)", str, field.Interface())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return strings.TrimSpace(fmt.Sprintf("%s %s", status, str))
|
|
||||||
}
|
|
||||||
@@ -1,221 +0,0 @@
|
|||||||
/*
|
|
||||||
AutoGlue API
|
|
||||||
|
|
||||||
API for managing K3s clusters across cloud providers
|
|
||||||
|
|
||||||
API version: 1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
||||||
|
|
||||||
package autoglue
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"fmt"
|
|
||||||
"net/http"
|
|
||||||
"strings"
|
|
||||||
)
|
|
||||||
|
|
||||||
// contextKeys are used to identify the type of value in the context.
|
|
||||||
// Since these are string, it is possible to get a short description of the
|
|
||||||
// context key for logging and debugging using key.String().
|
|
||||||
|
|
||||||
type contextKey string
|
|
||||||
|
|
||||||
func (c contextKey) String() string {
|
|
||||||
return "auth " + string(c)
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
|
||||||
// ContextAPIKeys takes a string apikey as authentication for the request
|
|
||||||
ContextAPIKeys = contextKey("apiKeys")
|
|
||||||
|
|
||||||
// ContextServerIndex uses a server configuration from the index.
|
|
||||||
ContextServerIndex = contextKey("serverIndex")
|
|
||||||
|
|
||||||
// ContextOperationServerIndices uses a server configuration from the index mapping.
|
|
||||||
ContextOperationServerIndices = contextKey("serverOperationIndices")
|
|
||||||
|
|
||||||
// ContextServerVariables overrides a server configuration variables.
|
|
||||||
ContextServerVariables = contextKey("serverVariables")
|
|
||||||
|
|
||||||
// ContextOperationServerVariables overrides a server configuration variables using operation specific values.
|
|
||||||
ContextOperationServerVariables = contextKey("serverOperationVariables")
|
|
||||||
)
|
|
||||||
|
|
||||||
// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth
|
|
||||||
type BasicAuth struct {
|
|
||||||
UserName string `json:"userName,omitempty"`
|
|
||||||
Password string `json:"password,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// APIKey provides API key based authentication to a request passed via context using ContextAPIKey
|
|
||||||
type APIKey struct {
|
|
||||||
Key string
|
|
||||||
Prefix string
|
|
||||||
}
|
|
||||||
|
|
||||||
// ServerVariable stores the information about a server variable
|
|
||||||
type ServerVariable struct {
|
|
||||||
Description string
|
|
||||||
DefaultValue string
|
|
||||||
EnumValues []string
|
|
||||||
}
|
|
||||||
|
|
||||||
// ServerConfiguration stores the information about a server
|
|
||||||
type ServerConfiguration struct {
|
|
||||||
URL string
|
|
||||||
Description string
|
|
||||||
Variables map[string]ServerVariable
|
|
||||||
}
|
|
||||||
|
|
||||||
// ServerConfigurations stores multiple ServerConfiguration items
|
|
||||||
type ServerConfigurations []ServerConfiguration
|
|
||||||
|
|
||||||
// Configuration stores the configuration of the API client
|
|
||||||
type Configuration struct {
|
|
||||||
Host string `json:"host,omitempty"`
|
|
||||||
Scheme string `json:"scheme,omitempty"`
|
|
||||||
DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
|
|
||||||
UserAgent string `json:"userAgent,omitempty"`
|
|
||||||
Debug bool `json:"debug,omitempty"`
|
|
||||||
Servers ServerConfigurations
|
|
||||||
OperationServers map[string]ServerConfigurations
|
|
||||||
HTTPClient *http.Client
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewConfiguration returns a new Configuration object
|
|
||||||
func NewConfiguration() *Configuration {
|
|
||||||
cfg := &Configuration{
|
|
||||||
DefaultHeader: make(map[string]string),
|
|
||||||
UserAgent: "OpenAPI-Generator/1.0.0/go",
|
|
||||||
Debug: false,
|
|
||||||
Servers: ServerConfigurations{
|
|
||||||
{
|
|
||||||
URL: "http://localhost:8080/api/v1",
|
|
||||||
Description: "No description provided",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
URL: "https://localhost:8080/api/v1",
|
|
||||||
Description: "No description provided",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
OperationServers: map[string]ServerConfigurations{},
|
|
||||||
}
|
|
||||||
return cfg
|
|
||||||
}
|
|
||||||
|
|
||||||
// AddDefaultHeader adds a new HTTP header to the default header in the request
|
|
||||||
func (c *Configuration) AddDefaultHeader(key string, value string) {
|
|
||||||
c.DefaultHeader[key] = value
|
|
||||||
}
|
|
||||||
|
|
||||||
// URL formats template on a index using given variables
|
|
||||||
func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) {
|
|
||||||
if index < 0 || len(sc) <= index {
|
|
||||||
return "", fmt.Errorf("index %v out of range %v", index, len(sc)-1)
|
|
||||||
}
|
|
||||||
server := sc[index]
|
|
||||||
url := server.URL
|
|
||||||
|
|
||||||
// go through variables and replace placeholders
|
|
||||||
for name, variable := range server.Variables {
|
|
||||||
if value, ok := variables[name]; ok {
|
|
||||||
found := bool(len(variable.EnumValues) == 0)
|
|
||||||
for _, enumValue := range variable.EnumValues {
|
|
||||||
if value == enumValue {
|
|
||||||
found = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if !found {
|
|
||||||
return "", fmt.Errorf("the variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues)
|
|
||||||
}
|
|
||||||
url = strings.Replace(url, "{"+name+"}", value, -1)
|
|
||||||
} else {
|
|
||||||
url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return url, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// ServerURL returns URL based on server settings
|
|
||||||
func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) {
|
|
||||||
return c.Servers.URL(index, variables)
|
|
||||||
}
|
|
||||||
|
|
||||||
func getServerIndex(ctx context.Context) (int, error) {
|
|
||||||
si := ctx.Value(ContextServerIndex)
|
|
||||||
if si != nil {
|
|
||||||
if index, ok := si.(int); ok {
|
|
||||||
return index, nil
|
|
||||||
}
|
|
||||||
return 0, reportError("Invalid type %T should be int", si)
|
|
||||||
}
|
|
||||||
return 0, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) {
|
|
||||||
osi := ctx.Value(ContextOperationServerIndices)
|
|
||||||
if osi != nil {
|
|
||||||
if operationIndices, ok := osi.(map[string]int); !ok {
|
|
||||||
return 0, reportError("Invalid type %T should be map[string]int", osi)
|
|
||||||
} else {
|
|
||||||
index, ok := operationIndices[endpoint]
|
|
||||||
if ok {
|
|
||||||
return index, nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return getServerIndex(ctx)
|
|
||||||
}
|
|
||||||
|
|
||||||
func getServerVariables(ctx context.Context) (map[string]string, error) {
|
|
||||||
sv := ctx.Value(ContextServerVariables)
|
|
||||||
if sv != nil {
|
|
||||||
if variables, ok := sv.(map[string]string); ok {
|
|
||||||
return variables, nil
|
|
||||||
}
|
|
||||||
return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv)
|
|
||||||
}
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) {
|
|
||||||
osv := ctx.Value(ContextOperationServerVariables)
|
|
||||||
if osv != nil {
|
|
||||||
if operationVariables, ok := osv.(map[string]map[string]string); !ok {
|
|
||||||
return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv)
|
|
||||||
} else {
|
|
||||||
variables, ok := operationVariables[endpoint]
|
|
||||||
if ok {
|
|
||||||
return variables, nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return getServerVariables(ctx)
|
|
||||||
}
|
|
||||||
|
|
||||||
// ServerURLWithContext returns a new server URL given an endpoint
|
|
||||||
func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) {
|
|
||||||
sc, ok := c.OperationServers[endpoint]
|
|
||||||
if !ok {
|
|
||||||
sc = c.Servers
|
|
||||||
}
|
|
||||||
|
|
||||||
if ctx == nil {
|
|
||||||
return sc.URL(0, nil)
|
|
||||||
}
|
|
||||||
|
|
||||||
index, err := getServerOperationIndex(ctx, endpoint)
|
|
||||||
if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
|
|
||||||
variables, err := getServerOperationVariables(ctx, endpoint)
|
|
||||||
if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
|
|
||||||
return sc.URL(index, variables)
|
|
||||||
}
|
|
||||||
@@ -1,371 +0,0 @@
|
|||||||
# \AnnotationsAPI
|
|
||||||
|
|
||||||
All URIs are relative to *http://localhost:8080/api/v1*
|
|
||||||
|
|
||||||
Method | HTTP request | Description
|
|
||||||
------------- | ------------- | -------------
|
|
||||||
[**CreateAnnotation**](AnnotationsAPI.md#CreateAnnotation) | **Post** /annotations | Create annotation (org scoped)
|
|
||||||
[**DeleteAnnotation**](AnnotationsAPI.md#DeleteAnnotation) | **Delete** /annotations/{id} | Delete annotation (org scoped)
|
|
||||||
[**GetAnnotation**](AnnotationsAPI.md#GetAnnotation) | **Get** /annotations/{id} | Get annotation by ID (org scoped)
|
|
||||||
[**ListAnnotations**](AnnotationsAPI.md#ListAnnotations) | **Get** /annotations | List annotations (org scoped)
|
|
||||||
[**UpdateAnnotation**](AnnotationsAPI.md#UpdateAnnotation) | **Patch** /annotations/{id} | Update annotation (org scoped)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## CreateAnnotation
|
|
||||||
|
|
||||||
> DtoAnnotationResponse CreateAnnotation(ctx).Body(body).XOrgID(xOrgID).Execute()
|
|
||||||
|
|
||||||
Create annotation (org scoped)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Example
|
|
||||||
|
|
||||||
```go
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
openapiclient "github.com/glueops/autoglue-sdk-go"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
body := *openapiclient.NewDtoCreateAnnotationRequest() // DtoCreateAnnotationRequest | Annotation payload
|
|
||||||
xOrgID := "xOrgID_example" // string | Organization UUID (optional)
|
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
|
||||||
resp, r, err := apiClient.AnnotationsAPI.CreateAnnotation(context.Background()).Body(body).XOrgID(xOrgID).Execute()
|
|
||||||
if err != nil {
|
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `AnnotationsAPI.CreateAnnotation``: %v\n", err)
|
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
|
||||||
}
|
|
||||||
// response from `CreateAnnotation`: DtoAnnotationResponse
|
|
||||||
fmt.Fprintf(os.Stdout, "Response from `AnnotationsAPI.CreateAnnotation`: %v\n", resp)
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Path Parameters
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Other Parameters
|
|
||||||
|
|
||||||
Other parameters are passed through a pointer to a apiCreateAnnotationRequest struct via the builder pattern
|
|
||||||
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------- | ------------- | ------------- | -------------
|
|
||||||
**body** | [**DtoCreateAnnotationRequest**](DtoCreateAnnotationRequest.md) | Annotation payload |
|
|
||||||
**xOrgID** | **string** | Organization UUID |
|
|
||||||
|
|
||||||
### Return type
|
|
||||||
|
|
||||||
[**DtoAnnotationResponse**](DtoAnnotationResponse.md)
|
|
||||||
|
|
||||||
### Authorization
|
|
||||||
|
|
||||||
[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth)
|
|
||||||
|
|
||||||
### HTTP request headers
|
|
||||||
|
|
||||||
- **Content-Type**: application/json
|
|
||||||
- **Accept**: application/json
|
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models)
|
|
||||||
[[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
||||||
## DeleteAnnotation
|
|
||||||
|
|
||||||
> string DeleteAnnotation(ctx, id).XOrgID(xOrgID).Execute()
|
|
||||||
|
|
||||||
Delete annotation (org scoped)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Example
|
|
||||||
|
|
||||||
```go
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
openapiclient "github.com/glueops/autoglue-sdk-go"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
id := "id_example" // string | Annotation ID (UUID)
|
|
||||||
xOrgID := "xOrgID_example" // string | Organization UUID (optional)
|
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
|
||||||
resp, r, err := apiClient.AnnotationsAPI.DeleteAnnotation(context.Background(), id).XOrgID(xOrgID).Execute()
|
|
||||||
if err != nil {
|
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `AnnotationsAPI.DeleteAnnotation``: %v\n", err)
|
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
|
||||||
}
|
|
||||||
// response from `DeleteAnnotation`: string
|
|
||||||
fmt.Fprintf(os.Stdout, "Response from `AnnotationsAPI.DeleteAnnotation`: %v\n", resp)
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Path Parameters
|
|
||||||
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------- | ------------- | ------------- | -------------
|
|
||||||
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
|
||||||
**id** | **string** | Annotation ID (UUID) |
|
|
||||||
|
|
||||||
### Other Parameters
|
|
||||||
|
|
||||||
Other parameters are passed through a pointer to a apiDeleteAnnotationRequest struct via the builder pattern
|
|
||||||
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------- | ------------- | ------------- | -------------
|
|
||||||
|
|
||||||
**xOrgID** | **string** | Organization UUID |
|
|
||||||
|
|
||||||
### Return type
|
|
||||||
|
|
||||||
**string**
|
|
||||||
|
|
||||||
### Authorization
|
|
||||||
|
|
||||||
[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth)
|
|
||||||
|
|
||||||
### HTTP request headers
|
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
|
||||||
- **Accept**: application/json
|
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models)
|
|
||||||
[[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
||||||
## GetAnnotation
|
|
||||||
|
|
||||||
> DtoAnnotationResponse GetAnnotation(ctx, id).XOrgID(xOrgID).Execute()
|
|
||||||
|
|
||||||
Get annotation by ID (org scoped)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Example
|
|
||||||
|
|
||||||
```go
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
openapiclient "github.com/glueops/autoglue-sdk-go"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
id := "id_example" // string | Annotation ID (UUID)
|
|
||||||
xOrgID := "xOrgID_example" // string | Organization UUID (optional)
|
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
|
||||||
resp, r, err := apiClient.AnnotationsAPI.GetAnnotation(context.Background(), id).XOrgID(xOrgID).Execute()
|
|
||||||
if err != nil {
|
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `AnnotationsAPI.GetAnnotation``: %v\n", err)
|
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
|
||||||
}
|
|
||||||
// response from `GetAnnotation`: DtoAnnotationResponse
|
|
||||||
fmt.Fprintf(os.Stdout, "Response from `AnnotationsAPI.GetAnnotation`: %v\n", resp)
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Path Parameters
|
|
||||||
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------- | ------------- | ------------- | -------------
|
|
||||||
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
|
||||||
**id** | **string** | Annotation ID (UUID) |
|
|
||||||
|
|
||||||
### Other Parameters
|
|
||||||
|
|
||||||
Other parameters are passed through a pointer to a apiGetAnnotationRequest struct via the builder pattern
|
|
||||||
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------- | ------------- | ------------- | -------------
|
|
||||||
|
|
||||||
**xOrgID** | **string** | Organization UUID |
|
|
||||||
|
|
||||||
### Return type
|
|
||||||
|
|
||||||
[**DtoAnnotationResponse**](DtoAnnotationResponse.md)
|
|
||||||
|
|
||||||
### Authorization
|
|
||||||
|
|
||||||
[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth)
|
|
||||||
|
|
||||||
### HTTP request headers
|
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
|
||||||
- **Accept**: application/json
|
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models)
|
|
||||||
[[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
||||||
## ListAnnotations
|
|
||||||
|
|
||||||
> []DtoAnnotationResponse ListAnnotations(ctx).XOrgID(xOrgID).Key(key).Value(value).Q(q).Execute()
|
|
||||||
|
|
||||||
List annotations (org scoped)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Example
|
|
||||||
|
|
||||||
```go
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
openapiclient "github.com/glueops/autoglue-sdk-go"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
xOrgID := "xOrgID_example" // string | Organization UUID (optional)
|
|
||||||
key := "key_example" // string | Exact key (optional)
|
|
||||||
value := "value_example" // string | Exact value (optional)
|
|
||||||
q := "q_example" // string | key contains (case-insensitive) (optional)
|
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
|
||||||
resp, r, err := apiClient.AnnotationsAPI.ListAnnotations(context.Background()).XOrgID(xOrgID).Key(key).Value(value).Q(q).Execute()
|
|
||||||
if err != nil {
|
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `AnnotationsAPI.ListAnnotations``: %v\n", err)
|
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
|
||||||
}
|
|
||||||
// response from `ListAnnotations`: []DtoAnnotationResponse
|
|
||||||
fmt.Fprintf(os.Stdout, "Response from `AnnotationsAPI.ListAnnotations`: %v\n", resp)
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Path Parameters
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Other Parameters
|
|
||||||
|
|
||||||
Other parameters are passed through a pointer to a apiListAnnotationsRequest struct via the builder pattern
|
|
||||||
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------- | ------------- | ------------- | -------------
|
|
||||||
**xOrgID** | **string** | Organization UUID |
|
|
||||||
**key** | **string** | Exact key |
|
|
||||||
**value** | **string** | Exact value |
|
|
||||||
**q** | **string** | key contains (case-insensitive) |
|
|
||||||
|
|
||||||
### Return type
|
|
||||||
|
|
||||||
[**[]DtoAnnotationResponse**](DtoAnnotationResponse.md)
|
|
||||||
|
|
||||||
### Authorization
|
|
||||||
|
|
||||||
[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth)
|
|
||||||
|
|
||||||
### HTTP request headers
|
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
|
||||||
- **Accept**: application/json
|
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models)
|
|
||||||
[[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
||||||
## UpdateAnnotation
|
|
||||||
|
|
||||||
> DtoAnnotationResponse UpdateAnnotation(ctx, id).Body(body).XOrgID(xOrgID).Execute()
|
|
||||||
|
|
||||||
Update annotation (org scoped)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Example
|
|
||||||
|
|
||||||
```go
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
openapiclient "github.com/glueops/autoglue-sdk-go"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
id := "id_example" // string | Annotation ID (UUID)
|
|
||||||
body := *openapiclient.NewDtoUpdateAnnotationRequest() // DtoUpdateAnnotationRequest | Fields to update
|
|
||||||
xOrgID := "xOrgID_example" // string | Organization UUID (optional)
|
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
|
||||||
resp, r, err := apiClient.AnnotationsAPI.UpdateAnnotation(context.Background(), id).Body(body).XOrgID(xOrgID).Execute()
|
|
||||||
if err != nil {
|
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `AnnotationsAPI.UpdateAnnotation``: %v\n", err)
|
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
|
||||||
}
|
|
||||||
// response from `UpdateAnnotation`: DtoAnnotationResponse
|
|
||||||
fmt.Fprintf(os.Stdout, "Response from `AnnotationsAPI.UpdateAnnotation`: %v\n", resp)
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Path Parameters
|
|
||||||
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------- | ------------- | ------------- | -------------
|
|
||||||
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
|
||||||
**id** | **string** | Annotation ID (UUID) |
|
|
||||||
|
|
||||||
### Other Parameters
|
|
||||||
|
|
||||||
Other parameters are passed through a pointer to a apiUpdateAnnotationRequest struct via the builder pattern
|
|
||||||
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------- | ------------- | ------------- | -------------
|
|
||||||
|
|
||||||
**body** | [**DtoUpdateAnnotationRequest**](DtoUpdateAnnotationRequest.md) | Fields to update |
|
|
||||||
**xOrgID** | **string** | Organization UUID |
|
|
||||||
|
|
||||||
### Return type
|
|
||||||
|
|
||||||
[**DtoAnnotationResponse**](DtoAnnotationResponse.md)
|
|
||||||
|
|
||||||
### Authorization
|
|
||||||
|
|
||||||
[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth)
|
|
||||||
|
|
||||||
### HTTP request headers
|
|
||||||
|
|
||||||
- **Content-Type**: application/json
|
|
||||||
- **Accept**: application/json
|
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models)
|
|
||||||
[[Back to README]](../README.md)
|
|
||||||
|
|
||||||
@@ -1,354 +0,0 @@
|
|||||||
# \ArcherAdminAPI
|
|
||||||
|
|
||||||
All URIs are relative to *http://localhost:8080/api/v1*
|
|
||||||
|
|
||||||
Method | HTTP request | Description
|
|
||||||
------------- | ------------- | -------------
|
|
||||||
[**AdminCancelArcherJob**](ArcherAdminAPI.md#AdminCancelArcherJob) | **Post** /admin/archer/jobs/{id}/cancel | Cancel an Archer job (admin)
|
|
||||||
[**AdminEnqueueArcherJob**](ArcherAdminAPI.md#AdminEnqueueArcherJob) | **Post** /admin/archer/jobs | Enqueue a new Archer job (admin)
|
|
||||||
[**AdminListArcherJobs**](ArcherAdminAPI.md#AdminListArcherJobs) | **Get** /admin/archer/jobs | List Archer jobs (admin)
|
|
||||||
[**AdminListArcherQueues**](ArcherAdminAPI.md#AdminListArcherQueues) | **Get** /admin/archer/queues | List Archer queues (admin)
|
|
||||||
[**AdminRetryArcherJob**](ArcherAdminAPI.md#AdminRetryArcherJob) | **Post** /admin/archer/jobs/{id}/retry | Retry a failed/canceled Archer job (admin)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## AdminCancelArcherJob
|
|
||||||
|
|
||||||
> DtoJob AdminCancelArcherJob(ctx, id).Execute()
|
|
||||||
|
|
||||||
Cancel an Archer job (admin)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Example
|
|
||||||
|
|
||||||
```go
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
openapiclient "github.com/glueops/autoglue-sdk-go"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
id := "id_example" // string | Job ID
|
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
|
||||||
resp, r, err := apiClient.ArcherAdminAPI.AdminCancelArcherJob(context.Background(), id).Execute()
|
|
||||||
if err != nil {
|
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `ArcherAdminAPI.AdminCancelArcherJob``: %v\n", err)
|
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
|
||||||
}
|
|
||||||
// response from `AdminCancelArcherJob`: DtoJob
|
|
||||||
fmt.Fprintf(os.Stdout, "Response from `ArcherAdminAPI.AdminCancelArcherJob`: %v\n", resp)
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Path Parameters
|
|
||||||
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------- | ------------- | ------------- | -------------
|
|
||||||
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
|
||||||
**id** | **string** | Job ID |
|
|
||||||
|
|
||||||
### Other Parameters
|
|
||||||
|
|
||||||
Other parameters are passed through a pointer to a apiAdminCancelArcherJobRequest struct via the builder pattern
|
|
||||||
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------- | ------------- | ------------- | -------------
|
|
||||||
|
|
||||||
|
|
||||||
### Return type
|
|
||||||
|
|
||||||
[**DtoJob**](DtoJob.md)
|
|
||||||
|
|
||||||
### Authorization
|
|
||||||
|
|
||||||
[BearerAuth](../README.md#BearerAuth)
|
|
||||||
|
|
||||||
### HTTP request headers
|
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
|
||||||
- **Accept**: application/json
|
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models)
|
|
||||||
[[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
||||||
## AdminEnqueueArcherJob
|
|
||||||
|
|
||||||
> DtoJob AdminEnqueueArcherJob(ctx).Body(body).Execute()
|
|
||||||
|
|
||||||
Enqueue a new Archer job (admin)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Example
|
|
||||||
|
|
||||||
```go
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
openapiclient "github.com/glueops/autoglue-sdk-go"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
body := map[string]interface{}{ ... } // map[string]interface{} | Job parameters
|
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
|
||||||
resp, r, err := apiClient.ArcherAdminAPI.AdminEnqueueArcherJob(context.Background()).Body(body).Execute()
|
|
||||||
if err != nil {
|
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `ArcherAdminAPI.AdminEnqueueArcherJob``: %v\n", err)
|
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
|
||||||
}
|
|
||||||
// response from `AdminEnqueueArcherJob`: DtoJob
|
|
||||||
fmt.Fprintf(os.Stdout, "Response from `ArcherAdminAPI.AdminEnqueueArcherJob`: %v\n", resp)
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Path Parameters
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Other Parameters
|
|
||||||
|
|
||||||
Other parameters are passed through a pointer to a apiAdminEnqueueArcherJobRequest struct via the builder pattern
|
|
||||||
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------- | ------------- | ------------- | -------------
|
|
||||||
**body** | **map[string]interface{}** | Job parameters |
|
|
||||||
|
|
||||||
### Return type
|
|
||||||
|
|
||||||
[**DtoJob**](DtoJob.md)
|
|
||||||
|
|
||||||
### Authorization
|
|
||||||
|
|
||||||
[BearerAuth](../README.md#BearerAuth)
|
|
||||||
|
|
||||||
### HTTP request headers
|
|
||||||
|
|
||||||
- **Content-Type**: application/json
|
|
||||||
- **Accept**: application/json
|
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models)
|
|
||||||
[[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
||||||
## AdminListArcherJobs
|
|
||||||
|
|
||||||
> DtoPageJob AdminListArcherJobs(ctx).Status(status).Queue(queue).Q(q).Page(page).PageSize(pageSize).Execute()
|
|
||||||
|
|
||||||
List Archer jobs (admin)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Example
|
|
||||||
|
|
||||||
```go
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
openapiclient "github.com/glueops/autoglue-sdk-go"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
status := "status_example" // string | Filter by status (optional)
|
|
||||||
queue := "queue_example" // string | Filter by queue name / worker name (optional)
|
|
||||||
q := "q_example" // string | Free-text search (optional)
|
|
||||||
page := int32(56) // int32 | Page number (optional) (default to 1)
|
|
||||||
pageSize := int32(56) // int32 | Items per page (optional) (default to 25)
|
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
|
||||||
resp, r, err := apiClient.ArcherAdminAPI.AdminListArcherJobs(context.Background()).Status(status).Queue(queue).Q(q).Page(page).PageSize(pageSize).Execute()
|
|
||||||
if err != nil {
|
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `ArcherAdminAPI.AdminListArcherJobs``: %v\n", err)
|
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
|
||||||
}
|
|
||||||
// response from `AdminListArcherJobs`: DtoPageJob
|
|
||||||
fmt.Fprintf(os.Stdout, "Response from `ArcherAdminAPI.AdminListArcherJobs`: %v\n", resp)
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Path Parameters
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Other Parameters
|
|
||||||
|
|
||||||
Other parameters are passed through a pointer to a apiAdminListArcherJobsRequest struct via the builder pattern
|
|
||||||
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------- | ------------- | ------------- | -------------
|
|
||||||
**status** | **string** | Filter by status |
|
|
||||||
**queue** | **string** | Filter by queue name / worker name |
|
|
||||||
**q** | **string** | Free-text search |
|
|
||||||
**page** | **int32** | Page number | [default to 1]
|
|
||||||
**pageSize** | **int32** | Items per page | [default to 25]
|
|
||||||
|
|
||||||
### Return type
|
|
||||||
|
|
||||||
[**DtoPageJob**](DtoPageJob.md)
|
|
||||||
|
|
||||||
### Authorization
|
|
||||||
|
|
||||||
[BearerAuth](../README.md#BearerAuth)
|
|
||||||
|
|
||||||
### HTTP request headers
|
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
|
||||||
- **Accept**: application/json
|
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models)
|
|
||||||
[[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
||||||
## AdminListArcherQueues
|
|
||||||
|
|
||||||
> []DtoQueueInfo AdminListArcherQueues(ctx).Execute()
|
|
||||||
|
|
||||||
List Archer queues (admin)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Example
|
|
||||||
|
|
||||||
```go
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
openapiclient "github.com/glueops/autoglue-sdk-go"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
|
||||||
resp, r, err := apiClient.ArcherAdminAPI.AdminListArcherQueues(context.Background()).Execute()
|
|
||||||
if err != nil {
|
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `ArcherAdminAPI.AdminListArcherQueues``: %v\n", err)
|
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
|
||||||
}
|
|
||||||
// response from `AdminListArcherQueues`: []DtoQueueInfo
|
|
||||||
fmt.Fprintf(os.Stdout, "Response from `ArcherAdminAPI.AdminListArcherQueues`: %v\n", resp)
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Path Parameters
|
|
||||||
|
|
||||||
This endpoint does not need any parameter.
|
|
||||||
|
|
||||||
### Other Parameters
|
|
||||||
|
|
||||||
Other parameters are passed through a pointer to a apiAdminListArcherQueuesRequest struct via the builder pattern
|
|
||||||
|
|
||||||
|
|
||||||
### Return type
|
|
||||||
|
|
||||||
[**[]DtoQueueInfo**](DtoQueueInfo.md)
|
|
||||||
|
|
||||||
### Authorization
|
|
||||||
|
|
||||||
[BearerAuth](../README.md#BearerAuth)
|
|
||||||
|
|
||||||
### HTTP request headers
|
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
|
||||||
- **Accept**: application/json
|
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models)
|
|
||||||
[[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
||||||
## AdminRetryArcherJob
|
|
||||||
|
|
||||||
> DtoJob AdminRetryArcherJob(ctx, id).Execute()
|
|
||||||
|
|
||||||
Retry a failed/canceled Archer job (admin)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Example
|
|
||||||
|
|
||||||
```go
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
openapiclient "github.com/glueops/autoglue-sdk-go"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
id := "id_example" // string | Job ID
|
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
|
||||||
resp, r, err := apiClient.ArcherAdminAPI.AdminRetryArcherJob(context.Background(), id).Execute()
|
|
||||||
if err != nil {
|
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `ArcherAdminAPI.AdminRetryArcherJob``: %v\n", err)
|
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
|
||||||
}
|
|
||||||
// response from `AdminRetryArcherJob`: DtoJob
|
|
||||||
fmt.Fprintf(os.Stdout, "Response from `ArcherAdminAPI.AdminRetryArcherJob`: %v\n", resp)
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Path Parameters
|
|
||||||
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------- | ------------- | ------------- | -------------
|
|
||||||
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
|
||||||
**id** | **string** | Job ID |
|
|
||||||
|
|
||||||
### Other Parameters
|
|
||||||
|
|
||||||
Other parameters are passed through a pointer to a apiAdminRetryArcherJobRequest struct via the builder pattern
|
|
||||||
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------- | ------------- | ------------- | -------------
|
|
||||||
|
|
||||||
|
|
||||||
### Return type
|
|
||||||
|
|
||||||
[**DtoJob**](DtoJob.md)
|
|
||||||
|
|
||||||
### Authorization
|
|
||||||
|
|
||||||
[BearerAuth](../README.md#BearerAuth)
|
|
||||||
|
|
||||||
### HTTP request headers
|
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
|
||||||
- **Accept**: application/json
|
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models)
|
|
||||||
[[Back to README]](../README.md)
|
|
||||||
|
|
||||||
@@ -1,338 +0,0 @@
|
|||||||
# \AuthAPI
|
|
||||||
|
|
||||||
All URIs are relative to *http://localhost:8080/api/v1*
|
|
||||||
|
|
||||||
Method | HTTP request | Description
|
|
||||||
------------- | ------------- | -------------
|
|
||||||
[**AuthCallback**](AuthAPI.md#AuthCallback) | **Get** /auth/{provider}/callback | Handle social login callback
|
|
||||||
[**AuthStart**](AuthAPI.md#AuthStart) | **Post** /auth/{provider}/start | Begin social login
|
|
||||||
[**GetJWKS**](AuthAPI.md#GetJWKS) | **Get** /.well-known/jwks.json | Get JWKS
|
|
||||||
[**Logout**](AuthAPI.md#Logout) | **Post** /auth/logout | Revoke refresh token family (logout everywhere)
|
|
||||||
[**Refresh**](AuthAPI.md#Refresh) | **Post** /auth/refresh | Rotate refresh token
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## AuthCallback
|
|
||||||
|
|
||||||
> DtoTokenPair AuthCallback(ctx, provider).Execute()
|
|
||||||
|
|
||||||
Handle social login callback
|
|
||||||
|
|
||||||
### Example
|
|
||||||
|
|
||||||
```go
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
openapiclient "github.com/glueops/autoglue-sdk-go"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
provider := "provider_example" // string | google|github
|
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
|
||||||
resp, r, err := apiClient.AuthAPI.AuthCallback(context.Background(), provider).Execute()
|
|
||||||
if err != nil {
|
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `AuthAPI.AuthCallback``: %v\n", err)
|
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
|
||||||
}
|
|
||||||
// response from `AuthCallback`: DtoTokenPair
|
|
||||||
fmt.Fprintf(os.Stdout, "Response from `AuthAPI.AuthCallback`: %v\n", resp)
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Path Parameters
|
|
||||||
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------- | ------------- | ------------- | -------------
|
|
||||||
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
|
||||||
**provider** | **string** | google|github |
|
|
||||||
|
|
||||||
### Other Parameters
|
|
||||||
|
|
||||||
Other parameters are passed through a pointer to a apiAuthCallbackRequest struct via the builder pattern
|
|
||||||
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------- | ------------- | ------------- | -------------
|
|
||||||
|
|
||||||
|
|
||||||
### Return type
|
|
||||||
|
|
||||||
[**DtoTokenPair**](DtoTokenPair.md)
|
|
||||||
|
|
||||||
### Authorization
|
|
||||||
|
|
||||||
No authorization required
|
|
||||||
|
|
||||||
### HTTP request headers
|
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
|
||||||
- **Accept**: application/json
|
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models)
|
|
||||||
[[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
||||||
## AuthStart
|
|
||||||
|
|
||||||
> DtoAuthStartResponse AuthStart(ctx, provider).Execute()
|
|
||||||
|
|
||||||
Begin social login
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Example
|
|
||||||
|
|
||||||
```go
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
openapiclient "github.com/glueops/autoglue-sdk-go"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
provider := "provider_example" // string | google|github
|
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
|
||||||
resp, r, err := apiClient.AuthAPI.AuthStart(context.Background(), provider).Execute()
|
|
||||||
if err != nil {
|
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `AuthAPI.AuthStart``: %v\n", err)
|
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
|
||||||
}
|
|
||||||
// response from `AuthStart`: DtoAuthStartResponse
|
|
||||||
fmt.Fprintf(os.Stdout, "Response from `AuthAPI.AuthStart`: %v\n", resp)
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Path Parameters
|
|
||||||
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------- | ------------- | ------------- | -------------
|
|
||||||
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
|
||||||
**provider** | **string** | google|github |
|
|
||||||
|
|
||||||
### Other Parameters
|
|
||||||
|
|
||||||
Other parameters are passed through a pointer to a apiAuthStartRequest struct via the builder pattern
|
|
||||||
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------- | ------------- | ------------- | -------------
|
|
||||||
|
|
||||||
|
|
||||||
### Return type
|
|
||||||
|
|
||||||
[**DtoAuthStartResponse**](DtoAuthStartResponse.md)
|
|
||||||
|
|
||||||
### Authorization
|
|
||||||
|
|
||||||
No authorization required
|
|
||||||
|
|
||||||
### HTTP request headers
|
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
|
||||||
- **Accept**: application/json
|
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models)
|
|
||||||
[[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
||||||
## GetJWKS
|
|
||||||
|
|
||||||
> DtoJWKS GetJWKS(ctx).Execute()
|
|
||||||
|
|
||||||
Get JWKS
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Example
|
|
||||||
|
|
||||||
```go
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
openapiclient "github.com/glueops/autoglue-sdk-go"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
|
||||||
resp, r, err := apiClient.AuthAPI.GetJWKS(context.Background()).Execute()
|
|
||||||
if err != nil {
|
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `AuthAPI.GetJWKS``: %v\n", err)
|
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
|
||||||
}
|
|
||||||
// response from `GetJWKS`: DtoJWKS
|
|
||||||
fmt.Fprintf(os.Stdout, "Response from `AuthAPI.GetJWKS`: %v\n", resp)
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Path Parameters
|
|
||||||
|
|
||||||
This endpoint does not need any parameter.
|
|
||||||
|
|
||||||
### Other Parameters
|
|
||||||
|
|
||||||
Other parameters are passed through a pointer to a apiGetJWKSRequest struct via the builder pattern
|
|
||||||
|
|
||||||
|
|
||||||
### Return type
|
|
||||||
|
|
||||||
[**DtoJWKS**](DtoJWKS.md)
|
|
||||||
|
|
||||||
### Authorization
|
|
||||||
|
|
||||||
No authorization required
|
|
||||||
|
|
||||||
### HTTP request headers
|
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
|
||||||
- **Accept**: application/json
|
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models)
|
|
||||||
[[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
||||||
## Logout
|
|
||||||
|
|
||||||
> Logout(ctx).Body(body).Execute()
|
|
||||||
|
|
||||||
Revoke refresh token family (logout everywhere)
|
|
||||||
|
|
||||||
### Example
|
|
||||||
|
|
||||||
```go
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
openapiclient "github.com/glueops/autoglue-sdk-go"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
body := *openapiclient.NewDtoLogoutRequest() // DtoLogoutRequest | Refresh token
|
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
|
||||||
r, err := apiClient.AuthAPI.Logout(context.Background()).Body(body).Execute()
|
|
||||||
if err != nil {
|
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `AuthAPI.Logout``: %v\n", err)
|
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Path Parameters
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Other Parameters
|
|
||||||
|
|
||||||
Other parameters are passed through a pointer to a apiLogoutRequest struct via the builder pattern
|
|
||||||
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------- | ------------- | ------------- | -------------
|
|
||||||
**body** | [**DtoLogoutRequest**](DtoLogoutRequest.md) | Refresh token |
|
|
||||||
|
|
||||||
### Return type
|
|
||||||
|
|
||||||
(empty response body)
|
|
||||||
|
|
||||||
### Authorization
|
|
||||||
|
|
||||||
No authorization required
|
|
||||||
|
|
||||||
### HTTP request headers
|
|
||||||
|
|
||||||
- **Content-Type**: application/json
|
|
||||||
- **Accept**: Not defined
|
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models)
|
|
||||||
[[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
||||||
## Refresh
|
|
||||||
|
|
||||||
> DtoTokenPair Refresh(ctx).Body(body).Execute()
|
|
||||||
|
|
||||||
Rotate refresh token
|
|
||||||
|
|
||||||
### Example
|
|
||||||
|
|
||||||
```go
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
openapiclient "github.com/glueops/autoglue-sdk-go"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
body := *openapiclient.NewDtoRefreshRequest() // DtoRefreshRequest | Refresh token
|
|
||||||
|
|
||||||
configuration := openapiclient.NewConfiguration()
|
|
||||||
apiClient := openapiclient.NewAPIClient(configuration)
|
|
||||||
resp, r, err := apiClient.AuthAPI.Refresh(context.Background()).Body(body).Execute()
|
|
||||||
if err != nil {
|
|
||||||
fmt.Fprintf(os.Stderr, "Error when calling `AuthAPI.Refresh``: %v\n", err)
|
|
||||||
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
|
||||||
}
|
|
||||||
// response from `Refresh`: DtoTokenPair
|
|
||||||
fmt.Fprintf(os.Stdout, "Response from `AuthAPI.Refresh`: %v\n", resp)
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Path Parameters
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Other Parameters
|
|
||||||
|
|
||||||
Other parameters are passed through a pointer to a apiRefreshRequest struct via the builder pattern
|
|
||||||
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------- | ------------- | ------------- | -------------
|
|
||||||
**body** | [**DtoRefreshRequest**](DtoRefreshRequest.md) | Refresh token |
|
|
||||||
|
|
||||||
### Return type
|
|
||||||
|
|
||||||
[**DtoTokenPair**](DtoTokenPair.md)
|
|
||||||
|
|
||||||
### Authorization
|
|
||||||
|
|
||||||
No authorization required
|
|
||||||
|
|
||||||
### HTTP request headers
|
|
||||||
|
|
||||||
- **Content-Type**: application/json
|
|
||||||
- **Accept**: application/json
|
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models)
|
|
||||||
[[Back to README]](../README.md)
|
|
||||||
|
|
||||||
@@ -1,186 +0,0 @@
|
|||||||
# DtoAnnotationResponse
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**CreatedAt** | Pointer to **string** | | [optional]
|
|
||||||
**Id** | Pointer to **string** | | [optional]
|
|
||||||
**Key** | Pointer to **string** | | [optional]
|
|
||||||
**OrganizationId** | Pointer to **string** | | [optional]
|
|
||||||
**UpdatedAt** | Pointer to **string** | | [optional]
|
|
||||||
**Value** | Pointer to **string** | | [optional]
|
|
||||||
|
|
||||||
## Methods
|
|
||||||
|
|
||||||
### NewDtoAnnotationResponse
|
|
||||||
|
|
||||||
`func NewDtoAnnotationResponse() *DtoAnnotationResponse`
|
|
||||||
|
|
||||||
NewDtoAnnotationResponse instantiates a new DtoAnnotationResponse object
|
|
||||||
This constructor will assign default values to properties that have it defined,
|
|
||||||
and makes sure properties required by API are set, but the set of arguments
|
|
||||||
will change when the set of required properties is changed
|
|
||||||
|
|
||||||
### NewDtoAnnotationResponseWithDefaults
|
|
||||||
|
|
||||||
`func NewDtoAnnotationResponseWithDefaults() *DtoAnnotationResponse`
|
|
||||||
|
|
||||||
NewDtoAnnotationResponseWithDefaults instantiates a new DtoAnnotationResponse object
|
|
||||||
This constructor will only assign default values to properties that have it defined,
|
|
||||||
but it doesn't guarantee that properties required by API are set
|
|
||||||
|
|
||||||
### GetCreatedAt
|
|
||||||
|
|
||||||
`func (o *DtoAnnotationResponse) GetCreatedAt() string`
|
|
||||||
|
|
||||||
GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetCreatedAtOk
|
|
||||||
|
|
||||||
`func (o *DtoAnnotationResponse) GetCreatedAtOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetCreatedAt
|
|
||||||
|
|
||||||
`func (o *DtoAnnotationResponse) SetCreatedAt(v string)`
|
|
||||||
|
|
||||||
SetCreatedAt sets CreatedAt field to given value.
|
|
||||||
|
|
||||||
### HasCreatedAt
|
|
||||||
|
|
||||||
`func (o *DtoAnnotationResponse) HasCreatedAt() bool`
|
|
||||||
|
|
||||||
HasCreatedAt returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetId
|
|
||||||
|
|
||||||
`func (o *DtoAnnotationResponse) GetId() string`
|
|
||||||
|
|
||||||
GetId returns the Id field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetIdOk
|
|
||||||
|
|
||||||
`func (o *DtoAnnotationResponse) GetIdOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetId
|
|
||||||
|
|
||||||
`func (o *DtoAnnotationResponse) SetId(v string)`
|
|
||||||
|
|
||||||
SetId sets Id field to given value.
|
|
||||||
|
|
||||||
### HasId
|
|
||||||
|
|
||||||
`func (o *DtoAnnotationResponse) HasId() bool`
|
|
||||||
|
|
||||||
HasId returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetKey
|
|
||||||
|
|
||||||
`func (o *DtoAnnotationResponse) GetKey() string`
|
|
||||||
|
|
||||||
GetKey returns the Key field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetKeyOk
|
|
||||||
|
|
||||||
`func (o *DtoAnnotationResponse) GetKeyOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetKey
|
|
||||||
|
|
||||||
`func (o *DtoAnnotationResponse) SetKey(v string)`
|
|
||||||
|
|
||||||
SetKey sets Key field to given value.
|
|
||||||
|
|
||||||
### HasKey
|
|
||||||
|
|
||||||
`func (o *DtoAnnotationResponse) HasKey() bool`
|
|
||||||
|
|
||||||
HasKey returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetOrganizationId
|
|
||||||
|
|
||||||
`func (o *DtoAnnotationResponse) GetOrganizationId() string`
|
|
||||||
|
|
||||||
GetOrganizationId returns the OrganizationId field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetOrganizationIdOk
|
|
||||||
|
|
||||||
`func (o *DtoAnnotationResponse) GetOrganizationIdOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetOrganizationIdOk returns a tuple with the OrganizationId field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetOrganizationId
|
|
||||||
|
|
||||||
`func (o *DtoAnnotationResponse) SetOrganizationId(v string)`
|
|
||||||
|
|
||||||
SetOrganizationId sets OrganizationId field to given value.
|
|
||||||
|
|
||||||
### HasOrganizationId
|
|
||||||
|
|
||||||
`func (o *DtoAnnotationResponse) HasOrganizationId() bool`
|
|
||||||
|
|
||||||
HasOrganizationId returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetUpdatedAt
|
|
||||||
|
|
||||||
`func (o *DtoAnnotationResponse) GetUpdatedAt() string`
|
|
||||||
|
|
||||||
GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetUpdatedAtOk
|
|
||||||
|
|
||||||
`func (o *DtoAnnotationResponse) GetUpdatedAtOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetUpdatedAt
|
|
||||||
|
|
||||||
`func (o *DtoAnnotationResponse) SetUpdatedAt(v string)`
|
|
||||||
|
|
||||||
SetUpdatedAt sets UpdatedAt field to given value.
|
|
||||||
|
|
||||||
### HasUpdatedAt
|
|
||||||
|
|
||||||
`func (o *DtoAnnotationResponse) HasUpdatedAt() bool`
|
|
||||||
|
|
||||||
HasUpdatedAt returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetValue
|
|
||||||
|
|
||||||
`func (o *DtoAnnotationResponse) GetValue() string`
|
|
||||||
|
|
||||||
GetValue returns the Value field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetValueOk
|
|
||||||
|
|
||||||
`func (o *DtoAnnotationResponse) GetValueOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetValue
|
|
||||||
|
|
||||||
`func (o *DtoAnnotationResponse) SetValue(v string)`
|
|
||||||
|
|
||||||
SetValue sets Value field to given value.
|
|
||||||
|
|
||||||
### HasValue
|
|
||||||
|
|
||||||
`func (o *DtoAnnotationResponse) HasValue() bool`
|
|
||||||
|
|
||||||
HasValue returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
# DtoAuthStartResponse
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**AuthUrl** | Pointer to **string** | | [optional]
|
|
||||||
|
|
||||||
## Methods
|
|
||||||
|
|
||||||
### NewDtoAuthStartResponse
|
|
||||||
|
|
||||||
`func NewDtoAuthStartResponse() *DtoAuthStartResponse`
|
|
||||||
|
|
||||||
NewDtoAuthStartResponse instantiates a new DtoAuthStartResponse object
|
|
||||||
This constructor will assign default values to properties that have it defined,
|
|
||||||
and makes sure properties required by API are set, but the set of arguments
|
|
||||||
will change when the set of required properties is changed
|
|
||||||
|
|
||||||
### NewDtoAuthStartResponseWithDefaults
|
|
||||||
|
|
||||||
`func NewDtoAuthStartResponseWithDefaults() *DtoAuthStartResponse`
|
|
||||||
|
|
||||||
NewDtoAuthStartResponseWithDefaults instantiates a new DtoAuthStartResponse object
|
|
||||||
This constructor will only assign default values to properties that have it defined,
|
|
||||||
but it doesn't guarantee that properties required by API are set
|
|
||||||
|
|
||||||
### GetAuthUrl
|
|
||||||
|
|
||||||
`func (o *DtoAuthStartResponse) GetAuthUrl() string`
|
|
||||||
|
|
||||||
GetAuthUrl returns the AuthUrl field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetAuthUrlOk
|
|
||||||
|
|
||||||
`func (o *DtoAuthStartResponse) GetAuthUrlOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetAuthUrlOk returns a tuple with the AuthUrl field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetAuthUrl
|
|
||||||
|
|
||||||
`func (o *DtoAuthStartResponse) SetAuthUrl(v string)`
|
|
||||||
|
|
||||||
SetAuthUrl sets AuthUrl field to given value.
|
|
||||||
|
|
||||||
### HasAuthUrl
|
|
||||||
|
|
||||||
`func (o *DtoAuthStartResponse) HasAuthUrl() bool`
|
|
||||||
|
|
||||||
HasAuthUrl returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
# DtoCreateAnnotationRequest
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**Key** | Pointer to **string** | | [optional]
|
|
||||||
**Value** | Pointer to **string** | | [optional]
|
|
||||||
|
|
||||||
## Methods
|
|
||||||
|
|
||||||
### NewDtoCreateAnnotationRequest
|
|
||||||
|
|
||||||
`func NewDtoCreateAnnotationRequest() *DtoCreateAnnotationRequest`
|
|
||||||
|
|
||||||
NewDtoCreateAnnotationRequest instantiates a new DtoCreateAnnotationRequest object
|
|
||||||
This constructor will assign default values to properties that have it defined,
|
|
||||||
and makes sure properties required by API are set, but the set of arguments
|
|
||||||
will change when the set of required properties is changed
|
|
||||||
|
|
||||||
### NewDtoCreateAnnotationRequestWithDefaults
|
|
||||||
|
|
||||||
`func NewDtoCreateAnnotationRequestWithDefaults() *DtoCreateAnnotationRequest`
|
|
||||||
|
|
||||||
NewDtoCreateAnnotationRequestWithDefaults instantiates a new DtoCreateAnnotationRequest object
|
|
||||||
This constructor will only assign default values to properties that have it defined,
|
|
||||||
but it doesn't guarantee that properties required by API are set
|
|
||||||
|
|
||||||
### GetKey
|
|
||||||
|
|
||||||
`func (o *DtoCreateAnnotationRequest) GetKey() string`
|
|
||||||
|
|
||||||
GetKey returns the Key field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetKeyOk
|
|
||||||
|
|
||||||
`func (o *DtoCreateAnnotationRequest) GetKeyOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetKey
|
|
||||||
|
|
||||||
`func (o *DtoCreateAnnotationRequest) SetKey(v string)`
|
|
||||||
|
|
||||||
SetKey sets Key field to given value.
|
|
||||||
|
|
||||||
### HasKey
|
|
||||||
|
|
||||||
`func (o *DtoCreateAnnotationRequest) HasKey() bool`
|
|
||||||
|
|
||||||
HasKey returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetValue
|
|
||||||
|
|
||||||
`func (o *DtoCreateAnnotationRequest) GetValue() string`
|
|
||||||
|
|
||||||
GetValue returns the Value field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetValueOk
|
|
||||||
|
|
||||||
`func (o *DtoCreateAnnotationRequest) GetValueOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetValue
|
|
||||||
|
|
||||||
`func (o *DtoCreateAnnotationRequest) SetValue(v string)`
|
|
||||||
|
|
||||||
SetValue sets Value field to given value.
|
|
||||||
|
|
||||||
### HasValue
|
|
||||||
|
|
||||||
`func (o *DtoCreateAnnotationRequest) HasValue() bool`
|
|
||||||
|
|
||||||
HasValue returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
# DtoCreateLabelRequest
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**Key** | Pointer to **string** | | [optional]
|
|
||||||
**Value** | Pointer to **string** | | [optional]
|
|
||||||
|
|
||||||
## Methods
|
|
||||||
|
|
||||||
### NewDtoCreateLabelRequest
|
|
||||||
|
|
||||||
`func NewDtoCreateLabelRequest() *DtoCreateLabelRequest`
|
|
||||||
|
|
||||||
NewDtoCreateLabelRequest instantiates a new DtoCreateLabelRequest object
|
|
||||||
This constructor will assign default values to properties that have it defined,
|
|
||||||
and makes sure properties required by API are set, but the set of arguments
|
|
||||||
will change when the set of required properties is changed
|
|
||||||
|
|
||||||
### NewDtoCreateLabelRequestWithDefaults
|
|
||||||
|
|
||||||
`func NewDtoCreateLabelRequestWithDefaults() *DtoCreateLabelRequest`
|
|
||||||
|
|
||||||
NewDtoCreateLabelRequestWithDefaults instantiates a new DtoCreateLabelRequest object
|
|
||||||
This constructor will only assign default values to properties that have it defined,
|
|
||||||
but it doesn't guarantee that properties required by API are set
|
|
||||||
|
|
||||||
### GetKey
|
|
||||||
|
|
||||||
`func (o *DtoCreateLabelRequest) GetKey() string`
|
|
||||||
|
|
||||||
GetKey returns the Key field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetKeyOk
|
|
||||||
|
|
||||||
`func (o *DtoCreateLabelRequest) GetKeyOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetKey
|
|
||||||
|
|
||||||
`func (o *DtoCreateLabelRequest) SetKey(v string)`
|
|
||||||
|
|
||||||
SetKey sets Key field to given value.
|
|
||||||
|
|
||||||
### HasKey
|
|
||||||
|
|
||||||
`func (o *DtoCreateLabelRequest) HasKey() bool`
|
|
||||||
|
|
||||||
HasKey returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetValue
|
|
||||||
|
|
||||||
`func (o *DtoCreateLabelRequest) GetValue() string`
|
|
||||||
|
|
||||||
GetValue returns the Value field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetValueOk
|
|
||||||
|
|
||||||
`func (o *DtoCreateLabelRequest) GetValueOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetValue
|
|
||||||
|
|
||||||
`func (o *DtoCreateLabelRequest) SetValue(v string)`
|
|
||||||
|
|
||||||
SetValue sets Value field to given value.
|
|
||||||
|
|
||||||
### HasValue
|
|
||||||
|
|
||||||
`func (o *DtoCreateLabelRequest) HasValue() bool`
|
|
||||||
|
|
||||||
HasValue returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,134 +0,0 @@
|
|||||||
# DtoCreateSSHRequest
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**Bits** | Pointer to **int32** | Only for RSA | [optional]
|
|
||||||
**Comment** | Pointer to **string** | | [optional]
|
|
||||||
**Name** | Pointer to **string** | | [optional]
|
|
||||||
**Type** | Pointer to **string** | \"rsa\" (default) or \"ed25519\" | [optional]
|
|
||||||
|
|
||||||
## Methods
|
|
||||||
|
|
||||||
### NewDtoCreateSSHRequest
|
|
||||||
|
|
||||||
`func NewDtoCreateSSHRequest() *DtoCreateSSHRequest`
|
|
||||||
|
|
||||||
NewDtoCreateSSHRequest instantiates a new DtoCreateSSHRequest object
|
|
||||||
This constructor will assign default values to properties that have it defined,
|
|
||||||
and makes sure properties required by API are set, but the set of arguments
|
|
||||||
will change when the set of required properties is changed
|
|
||||||
|
|
||||||
### NewDtoCreateSSHRequestWithDefaults
|
|
||||||
|
|
||||||
`func NewDtoCreateSSHRequestWithDefaults() *DtoCreateSSHRequest`
|
|
||||||
|
|
||||||
NewDtoCreateSSHRequestWithDefaults instantiates a new DtoCreateSSHRequest object
|
|
||||||
This constructor will only assign default values to properties that have it defined,
|
|
||||||
but it doesn't guarantee that properties required by API are set
|
|
||||||
|
|
||||||
### GetBits
|
|
||||||
|
|
||||||
`func (o *DtoCreateSSHRequest) GetBits() int32`
|
|
||||||
|
|
||||||
GetBits returns the Bits field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetBitsOk
|
|
||||||
|
|
||||||
`func (o *DtoCreateSSHRequest) GetBitsOk() (*int32, bool)`
|
|
||||||
|
|
||||||
GetBitsOk returns a tuple with the Bits field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetBits
|
|
||||||
|
|
||||||
`func (o *DtoCreateSSHRequest) SetBits(v int32)`
|
|
||||||
|
|
||||||
SetBits sets Bits field to given value.
|
|
||||||
|
|
||||||
### HasBits
|
|
||||||
|
|
||||||
`func (o *DtoCreateSSHRequest) HasBits() bool`
|
|
||||||
|
|
||||||
HasBits returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetComment
|
|
||||||
|
|
||||||
`func (o *DtoCreateSSHRequest) GetComment() string`
|
|
||||||
|
|
||||||
GetComment returns the Comment field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetCommentOk
|
|
||||||
|
|
||||||
`func (o *DtoCreateSSHRequest) GetCommentOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetCommentOk returns a tuple with the Comment field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetComment
|
|
||||||
|
|
||||||
`func (o *DtoCreateSSHRequest) SetComment(v string)`
|
|
||||||
|
|
||||||
SetComment sets Comment field to given value.
|
|
||||||
|
|
||||||
### HasComment
|
|
||||||
|
|
||||||
`func (o *DtoCreateSSHRequest) HasComment() bool`
|
|
||||||
|
|
||||||
HasComment returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetName
|
|
||||||
|
|
||||||
`func (o *DtoCreateSSHRequest) GetName() string`
|
|
||||||
|
|
||||||
GetName returns the Name field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetNameOk
|
|
||||||
|
|
||||||
`func (o *DtoCreateSSHRequest) GetNameOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetName
|
|
||||||
|
|
||||||
`func (o *DtoCreateSSHRequest) SetName(v string)`
|
|
||||||
|
|
||||||
SetName sets Name field to given value.
|
|
||||||
|
|
||||||
### HasName
|
|
||||||
|
|
||||||
`func (o *DtoCreateSSHRequest) HasName() bool`
|
|
||||||
|
|
||||||
HasName returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetType
|
|
||||||
|
|
||||||
`func (o *DtoCreateSSHRequest) GetType() string`
|
|
||||||
|
|
||||||
GetType returns the Type field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetTypeOk
|
|
||||||
|
|
||||||
`func (o *DtoCreateSSHRequest) GetTypeOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetType
|
|
||||||
|
|
||||||
`func (o *DtoCreateSSHRequest) SetType(v string)`
|
|
||||||
|
|
||||||
SetType sets Type field to given value.
|
|
||||||
|
|
||||||
### HasType
|
|
||||||
|
|
||||||
`func (o *DtoCreateSSHRequest) HasType() bool`
|
|
||||||
|
|
||||||
HasType returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,212 +0,0 @@
|
|||||||
# DtoCreateServerRequest
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**Hostname** | Pointer to **string** | | [optional]
|
|
||||||
**PrivateIpAddress** | Pointer to **string** | | [optional]
|
|
||||||
**PublicIpAddress** | Pointer to **string** | | [optional]
|
|
||||||
**Role** | Pointer to **string** | | [optional]
|
|
||||||
**SshKeyId** | Pointer to **string** | | [optional]
|
|
||||||
**SshUser** | Pointer to **string** | | [optional]
|
|
||||||
**Status** | Pointer to **string** | | [optional]
|
|
||||||
|
|
||||||
## Methods
|
|
||||||
|
|
||||||
### NewDtoCreateServerRequest
|
|
||||||
|
|
||||||
`func NewDtoCreateServerRequest() *DtoCreateServerRequest`
|
|
||||||
|
|
||||||
NewDtoCreateServerRequest instantiates a new DtoCreateServerRequest object
|
|
||||||
This constructor will assign default values to properties that have it defined,
|
|
||||||
and makes sure properties required by API are set, but the set of arguments
|
|
||||||
will change when the set of required properties is changed
|
|
||||||
|
|
||||||
### NewDtoCreateServerRequestWithDefaults
|
|
||||||
|
|
||||||
`func NewDtoCreateServerRequestWithDefaults() *DtoCreateServerRequest`
|
|
||||||
|
|
||||||
NewDtoCreateServerRequestWithDefaults instantiates a new DtoCreateServerRequest object
|
|
||||||
This constructor will only assign default values to properties that have it defined,
|
|
||||||
but it doesn't guarantee that properties required by API are set
|
|
||||||
|
|
||||||
### GetHostname
|
|
||||||
|
|
||||||
`func (o *DtoCreateServerRequest) GetHostname() string`
|
|
||||||
|
|
||||||
GetHostname returns the Hostname field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetHostnameOk
|
|
||||||
|
|
||||||
`func (o *DtoCreateServerRequest) GetHostnameOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetHostnameOk returns a tuple with the Hostname field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetHostname
|
|
||||||
|
|
||||||
`func (o *DtoCreateServerRequest) SetHostname(v string)`
|
|
||||||
|
|
||||||
SetHostname sets Hostname field to given value.
|
|
||||||
|
|
||||||
### HasHostname
|
|
||||||
|
|
||||||
`func (o *DtoCreateServerRequest) HasHostname() bool`
|
|
||||||
|
|
||||||
HasHostname returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetPrivateIpAddress
|
|
||||||
|
|
||||||
`func (o *DtoCreateServerRequest) GetPrivateIpAddress() string`
|
|
||||||
|
|
||||||
GetPrivateIpAddress returns the PrivateIpAddress field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetPrivateIpAddressOk
|
|
||||||
|
|
||||||
`func (o *DtoCreateServerRequest) GetPrivateIpAddressOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetPrivateIpAddressOk returns a tuple with the PrivateIpAddress field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetPrivateIpAddress
|
|
||||||
|
|
||||||
`func (o *DtoCreateServerRequest) SetPrivateIpAddress(v string)`
|
|
||||||
|
|
||||||
SetPrivateIpAddress sets PrivateIpAddress field to given value.
|
|
||||||
|
|
||||||
### HasPrivateIpAddress
|
|
||||||
|
|
||||||
`func (o *DtoCreateServerRequest) HasPrivateIpAddress() bool`
|
|
||||||
|
|
||||||
HasPrivateIpAddress returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetPublicIpAddress
|
|
||||||
|
|
||||||
`func (o *DtoCreateServerRequest) GetPublicIpAddress() string`
|
|
||||||
|
|
||||||
GetPublicIpAddress returns the PublicIpAddress field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetPublicIpAddressOk
|
|
||||||
|
|
||||||
`func (o *DtoCreateServerRequest) GetPublicIpAddressOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetPublicIpAddressOk returns a tuple with the PublicIpAddress field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetPublicIpAddress
|
|
||||||
|
|
||||||
`func (o *DtoCreateServerRequest) SetPublicIpAddress(v string)`
|
|
||||||
|
|
||||||
SetPublicIpAddress sets PublicIpAddress field to given value.
|
|
||||||
|
|
||||||
### HasPublicIpAddress
|
|
||||||
|
|
||||||
`func (o *DtoCreateServerRequest) HasPublicIpAddress() bool`
|
|
||||||
|
|
||||||
HasPublicIpAddress returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetRole
|
|
||||||
|
|
||||||
`func (o *DtoCreateServerRequest) GetRole() string`
|
|
||||||
|
|
||||||
GetRole returns the Role field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetRoleOk
|
|
||||||
|
|
||||||
`func (o *DtoCreateServerRequest) GetRoleOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetRoleOk returns a tuple with the Role field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetRole
|
|
||||||
|
|
||||||
`func (o *DtoCreateServerRequest) SetRole(v string)`
|
|
||||||
|
|
||||||
SetRole sets Role field to given value.
|
|
||||||
|
|
||||||
### HasRole
|
|
||||||
|
|
||||||
`func (o *DtoCreateServerRequest) HasRole() bool`
|
|
||||||
|
|
||||||
HasRole returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetSshKeyId
|
|
||||||
|
|
||||||
`func (o *DtoCreateServerRequest) GetSshKeyId() string`
|
|
||||||
|
|
||||||
GetSshKeyId returns the SshKeyId field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetSshKeyIdOk
|
|
||||||
|
|
||||||
`func (o *DtoCreateServerRequest) GetSshKeyIdOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetSshKeyIdOk returns a tuple with the SshKeyId field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetSshKeyId
|
|
||||||
|
|
||||||
`func (o *DtoCreateServerRequest) SetSshKeyId(v string)`
|
|
||||||
|
|
||||||
SetSshKeyId sets SshKeyId field to given value.
|
|
||||||
|
|
||||||
### HasSshKeyId
|
|
||||||
|
|
||||||
`func (o *DtoCreateServerRequest) HasSshKeyId() bool`
|
|
||||||
|
|
||||||
HasSshKeyId returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetSshUser
|
|
||||||
|
|
||||||
`func (o *DtoCreateServerRequest) GetSshUser() string`
|
|
||||||
|
|
||||||
GetSshUser returns the SshUser field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetSshUserOk
|
|
||||||
|
|
||||||
`func (o *DtoCreateServerRequest) GetSshUserOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetSshUserOk returns a tuple with the SshUser field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetSshUser
|
|
||||||
|
|
||||||
`func (o *DtoCreateServerRequest) SetSshUser(v string)`
|
|
||||||
|
|
||||||
SetSshUser sets SshUser field to given value.
|
|
||||||
|
|
||||||
### HasSshUser
|
|
||||||
|
|
||||||
`func (o *DtoCreateServerRequest) HasSshUser() bool`
|
|
||||||
|
|
||||||
HasSshUser returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetStatus
|
|
||||||
|
|
||||||
`func (o *DtoCreateServerRequest) GetStatus() string`
|
|
||||||
|
|
||||||
GetStatus returns the Status field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetStatusOk
|
|
||||||
|
|
||||||
`func (o *DtoCreateServerRequest) GetStatusOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetStatus
|
|
||||||
|
|
||||||
`func (o *DtoCreateServerRequest) SetStatus(v string)`
|
|
||||||
|
|
||||||
SetStatus sets Status field to given value.
|
|
||||||
|
|
||||||
### HasStatus
|
|
||||||
|
|
||||||
`func (o *DtoCreateServerRequest) HasStatus() bool`
|
|
||||||
|
|
||||||
HasStatus returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,108 +0,0 @@
|
|||||||
# DtoCreateTaintRequest
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**Effect** | Pointer to **string** | | [optional]
|
|
||||||
**Key** | Pointer to **string** | | [optional]
|
|
||||||
**Value** | Pointer to **string** | | [optional]
|
|
||||||
|
|
||||||
## Methods
|
|
||||||
|
|
||||||
### NewDtoCreateTaintRequest
|
|
||||||
|
|
||||||
`func NewDtoCreateTaintRequest() *DtoCreateTaintRequest`
|
|
||||||
|
|
||||||
NewDtoCreateTaintRequest instantiates a new DtoCreateTaintRequest object
|
|
||||||
This constructor will assign default values to properties that have it defined,
|
|
||||||
and makes sure properties required by API are set, but the set of arguments
|
|
||||||
will change when the set of required properties is changed
|
|
||||||
|
|
||||||
### NewDtoCreateTaintRequestWithDefaults
|
|
||||||
|
|
||||||
`func NewDtoCreateTaintRequestWithDefaults() *DtoCreateTaintRequest`
|
|
||||||
|
|
||||||
NewDtoCreateTaintRequestWithDefaults instantiates a new DtoCreateTaintRequest object
|
|
||||||
This constructor will only assign default values to properties that have it defined,
|
|
||||||
but it doesn't guarantee that properties required by API are set
|
|
||||||
|
|
||||||
### GetEffect
|
|
||||||
|
|
||||||
`func (o *DtoCreateTaintRequest) GetEffect() string`
|
|
||||||
|
|
||||||
GetEffect returns the Effect field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetEffectOk
|
|
||||||
|
|
||||||
`func (o *DtoCreateTaintRequest) GetEffectOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetEffectOk returns a tuple with the Effect field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetEffect
|
|
||||||
|
|
||||||
`func (o *DtoCreateTaintRequest) SetEffect(v string)`
|
|
||||||
|
|
||||||
SetEffect sets Effect field to given value.
|
|
||||||
|
|
||||||
### HasEffect
|
|
||||||
|
|
||||||
`func (o *DtoCreateTaintRequest) HasEffect() bool`
|
|
||||||
|
|
||||||
HasEffect returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetKey
|
|
||||||
|
|
||||||
`func (o *DtoCreateTaintRequest) GetKey() string`
|
|
||||||
|
|
||||||
GetKey returns the Key field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetKeyOk
|
|
||||||
|
|
||||||
`func (o *DtoCreateTaintRequest) GetKeyOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetKey
|
|
||||||
|
|
||||||
`func (o *DtoCreateTaintRequest) SetKey(v string)`
|
|
||||||
|
|
||||||
SetKey sets Key field to given value.
|
|
||||||
|
|
||||||
### HasKey
|
|
||||||
|
|
||||||
`func (o *DtoCreateTaintRequest) HasKey() bool`
|
|
||||||
|
|
||||||
HasKey returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetValue
|
|
||||||
|
|
||||||
`func (o *DtoCreateTaintRequest) GetValue() string`
|
|
||||||
|
|
||||||
GetValue returns the Value field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetValueOk
|
|
||||||
|
|
||||||
`func (o *DtoCreateTaintRequest) GetValueOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetValue
|
|
||||||
|
|
||||||
`func (o *DtoCreateTaintRequest) SetValue(v string)`
|
|
||||||
|
|
||||||
SetValue sets Value field to given value.
|
|
||||||
|
|
||||||
### HasValue
|
|
||||||
|
|
||||||
`func (o *DtoCreateTaintRequest) HasValue() bool`
|
|
||||||
|
|
||||||
HasValue returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,212 +0,0 @@
|
|||||||
# DtoJWK
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**Alg** | Pointer to **string** | | [optional]
|
|
||||||
**E** | Pointer to **string** | | [optional]
|
|
||||||
**Kid** | Pointer to **string** | | [optional]
|
|
||||||
**Kty** | Pointer to **string** | | [optional]
|
|
||||||
**N** | Pointer to **string** | | [optional]
|
|
||||||
**Use** | Pointer to **string** | | [optional]
|
|
||||||
**X** | Pointer to **string** | | [optional]
|
|
||||||
|
|
||||||
## Methods
|
|
||||||
|
|
||||||
### NewDtoJWK
|
|
||||||
|
|
||||||
`func NewDtoJWK() *DtoJWK`
|
|
||||||
|
|
||||||
NewDtoJWK instantiates a new DtoJWK object
|
|
||||||
This constructor will assign default values to properties that have it defined,
|
|
||||||
and makes sure properties required by API are set, but the set of arguments
|
|
||||||
will change when the set of required properties is changed
|
|
||||||
|
|
||||||
### NewDtoJWKWithDefaults
|
|
||||||
|
|
||||||
`func NewDtoJWKWithDefaults() *DtoJWK`
|
|
||||||
|
|
||||||
NewDtoJWKWithDefaults instantiates a new DtoJWK object
|
|
||||||
This constructor will only assign default values to properties that have it defined,
|
|
||||||
but it doesn't guarantee that properties required by API are set
|
|
||||||
|
|
||||||
### GetAlg
|
|
||||||
|
|
||||||
`func (o *DtoJWK) GetAlg() string`
|
|
||||||
|
|
||||||
GetAlg returns the Alg field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetAlgOk
|
|
||||||
|
|
||||||
`func (o *DtoJWK) GetAlgOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetAlgOk returns a tuple with the Alg field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetAlg
|
|
||||||
|
|
||||||
`func (o *DtoJWK) SetAlg(v string)`
|
|
||||||
|
|
||||||
SetAlg sets Alg field to given value.
|
|
||||||
|
|
||||||
### HasAlg
|
|
||||||
|
|
||||||
`func (o *DtoJWK) HasAlg() bool`
|
|
||||||
|
|
||||||
HasAlg returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetE
|
|
||||||
|
|
||||||
`func (o *DtoJWK) GetE() string`
|
|
||||||
|
|
||||||
GetE returns the E field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetEOk
|
|
||||||
|
|
||||||
`func (o *DtoJWK) GetEOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetEOk returns a tuple with the E field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetE
|
|
||||||
|
|
||||||
`func (o *DtoJWK) SetE(v string)`
|
|
||||||
|
|
||||||
SetE sets E field to given value.
|
|
||||||
|
|
||||||
### HasE
|
|
||||||
|
|
||||||
`func (o *DtoJWK) HasE() bool`
|
|
||||||
|
|
||||||
HasE returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetKid
|
|
||||||
|
|
||||||
`func (o *DtoJWK) GetKid() string`
|
|
||||||
|
|
||||||
GetKid returns the Kid field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetKidOk
|
|
||||||
|
|
||||||
`func (o *DtoJWK) GetKidOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetKidOk returns a tuple with the Kid field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetKid
|
|
||||||
|
|
||||||
`func (o *DtoJWK) SetKid(v string)`
|
|
||||||
|
|
||||||
SetKid sets Kid field to given value.
|
|
||||||
|
|
||||||
### HasKid
|
|
||||||
|
|
||||||
`func (o *DtoJWK) HasKid() bool`
|
|
||||||
|
|
||||||
HasKid returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetKty
|
|
||||||
|
|
||||||
`func (o *DtoJWK) GetKty() string`
|
|
||||||
|
|
||||||
GetKty returns the Kty field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetKtyOk
|
|
||||||
|
|
||||||
`func (o *DtoJWK) GetKtyOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetKtyOk returns a tuple with the Kty field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetKty
|
|
||||||
|
|
||||||
`func (o *DtoJWK) SetKty(v string)`
|
|
||||||
|
|
||||||
SetKty sets Kty field to given value.
|
|
||||||
|
|
||||||
### HasKty
|
|
||||||
|
|
||||||
`func (o *DtoJWK) HasKty() bool`
|
|
||||||
|
|
||||||
HasKty returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetN
|
|
||||||
|
|
||||||
`func (o *DtoJWK) GetN() string`
|
|
||||||
|
|
||||||
GetN returns the N field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetNOk
|
|
||||||
|
|
||||||
`func (o *DtoJWK) GetNOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetNOk returns a tuple with the N field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetN
|
|
||||||
|
|
||||||
`func (o *DtoJWK) SetN(v string)`
|
|
||||||
|
|
||||||
SetN sets N field to given value.
|
|
||||||
|
|
||||||
### HasN
|
|
||||||
|
|
||||||
`func (o *DtoJWK) HasN() bool`
|
|
||||||
|
|
||||||
HasN returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetUse
|
|
||||||
|
|
||||||
`func (o *DtoJWK) GetUse() string`
|
|
||||||
|
|
||||||
GetUse returns the Use field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetUseOk
|
|
||||||
|
|
||||||
`func (o *DtoJWK) GetUseOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetUseOk returns a tuple with the Use field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetUse
|
|
||||||
|
|
||||||
`func (o *DtoJWK) SetUse(v string)`
|
|
||||||
|
|
||||||
SetUse sets Use field to given value.
|
|
||||||
|
|
||||||
### HasUse
|
|
||||||
|
|
||||||
`func (o *DtoJWK) HasUse() bool`
|
|
||||||
|
|
||||||
HasUse returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetX
|
|
||||||
|
|
||||||
`func (o *DtoJWK) GetX() string`
|
|
||||||
|
|
||||||
GetX returns the X field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetXOk
|
|
||||||
|
|
||||||
`func (o *DtoJWK) GetXOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetXOk returns a tuple with the X field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetX
|
|
||||||
|
|
||||||
`func (o *DtoJWK) SetX(v string)`
|
|
||||||
|
|
||||||
SetX sets X field to given value.
|
|
||||||
|
|
||||||
### HasX
|
|
||||||
|
|
||||||
`func (o *DtoJWK) HasX() bool`
|
|
||||||
|
|
||||||
HasX returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
# DtoJWKS
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**Keys** | Pointer to [**[]DtoJWK**](DtoJWK.md) | | [optional]
|
|
||||||
|
|
||||||
## Methods
|
|
||||||
|
|
||||||
### NewDtoJWKS
|
|
||||||
|
|
||||||
`func NewDtoJWKS() *DtoJWKS`
|
|
||||||
|
|
||||||
NewDtoJWKS instantiates a new DtoJWKS object
|
|
||||||
This constructor will assign default values to properties that have it defined,
|
|
||||||
and makes sure properties required by API are set, but the set of arguments
|
|
||||||
will change when the set of required properties is changed
|
|
||||||
|
|
||||||
### NewDtoJWKSWithDefaults
|
|
||||||
|
|
||||||
`func NewDtoJWKSWithDefaults() *DtoJWKS`
|
|
||||||
|
|
||||||
NewDtoJWKSWithDefaults instantiates a new DtoJWKS object
|
|
||||||
This constructor will only assign default values to properties that have it defined,
|
|
||||||
but it doesn't guarantee that properties required by API are set
|
|
||||||
|
|
||||||
### GetKeys
|
|
||||||
|
|
||||||
`func (o *DtoJWKS) GetKeys() []DtoJWK`
|
|
||||||
|
|
||||||
GetKeys returns the Keys field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetKeysOk
|
|
||||||
|
|
||||||
`func (o *DtoJWKS) GetKeysOk() (*[]DtoJWK, bool)`
|
|
||||||
|
|
||||||
GetKeysOk returns a tuple with the Keys field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetKeys
|
|
||||||
|
|
||||||
`func (o *DtoJWKS) SetKeys(v []DtoJWK)`
|
|
||||||
|
|
||||||
SetKeys sets Keys field to given value.
|
|
||||||
|
|
||||||
### HasKeys
|
|
||||||
|
|
||||||
`func (o *DtoJWKS) HasKeys() bool`
|
|
||||||
|
|
||||||
HasKeys returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,316 +0,0 @@
|
|||||||
# DtoJob
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**Attempts** | Pointer to **int32** | | [optional]
|
|
||||||
**CreatedAt** | Pointer to **string** | | [optional]
|
|
||||||
**Id** | Pointer to **string** | | [optional]
|
|
||||||
**LastError** | Pointer to **string** | | [optional]
|
|
||||||
**MaxAttempts** | Pointer to **int32** | | [optional]
|
|
||||||
**Payload** | Pointer to **map[string]interface{}** | | [optional]
|
|
||||||
**Queue** | Pointer to **string** | | [optional]
|
|
||||||
**RunAt** | Pointer to **string** | | [optional]
|
|
||||||
**Status** | Pointer to [**DtoJobStatus**](DtoJobStatus.md) | | [optional]
|
|
||||||
**Type** | Pointer to **string** | | [optional]
|
|
||||||
**UpdatedAt** | Pointer to **string** | | [optional]
|
|
||||||
|
|
||||||
## Methods
|
|
||||||
|
|
||||||
### NewDtoJob
|
|
||||||
|
|
||||||
`func NewDtoJob() *DtoJob`
|
|
||||||
|
|
||||||
NewDtoJob instantiates a new DtoJob object
|
|
||||||
This constructor will assign default values to properties that have it defined,
|
|
||||||
and makes sure properties required by API are set, but the set of arguments
|
|
||||||
will change when the set of required properties is changed
|
|
||||||
|
|
||||||
### NewDtoJobWithDefaults
|
|
||||||
|
|
||||||
`func NewDtoJobWithDefaults() *DtoJob`
|
|
||||||
|
|
||||||
NewDtoJobWithDefaults instantiates a new DtoJob object
|
|
||||||
This constructor will only assign default values to properties that have it defined,
|
|
||||||
but it doesn't guarantee that properties required by API are set
|
|
||||||
|
|
||||||
### GetAttempts
|
|
||||||
|
|
||||||
`func (o *DtoJob) GetAttempts() int32`
|
|
||||||
|
|
||||||
GetAttempts returns the Attempts field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetAttemptsOk
|
|
||||||
|
|
||||||
`func (o *DtoJob) GetAttemptsOk() (*int32, bool)`
|
|
||||||
|
|
||||||
GetAttemptsOk returns a tuple with the Attempts field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetAttempts
|
|
||||||
|
|
||||||
`func (o *DtoJob) SetAttempts(v int32)`
|
|
||||||
|
|
||||||
SetAttempts sets Attempts field to given value.
|
|
||||||
|
|
||||||
### HasAttempts
|
|
||||||
|
|
||||||
`func (o *DtoJob) HasAttempts() bool`
|
|
||||||
|
|
||||||
HasAttempts returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetCreatedAt
|
|
||||||
|
|
||||||
`func (o *DtoJob) GetCreatedAt() string`
|
|
||||||
|
|
||||||
GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetCreatedAtOk
|
|
||||||
|
|
||||||
`func (o *DtoJob) GetCreatedAtOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetCreatedAt
|
|
||||||
|
|
||||||
`func (o *DtoJob) SetCreatedAt(v string)`
|
|
||||||
|
|
||||||
SetCreatedAt sets CreatedAt field to given value.
|
|
||||||
|
|
||||||
### HasCreatedAt
|
|
||||||
|
|
||||||
`func (o *DtoJob) HasCreatedAt() bool`
|
|
||||||
|
|
||||||
HasCreatedAt returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetId
|
|
||||||
|
|
||||||
`func (o *DtoJob) GetId() string`
|
|
||||||
|
|
||||||
GetId returns the Id field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetIdOk
|
|
||||||
|
|
||||||
`func (o *DtoJob) GetIdOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetId
|
|
||||||
|
|
||||||
`func (o *DtoJob) SetId(v string)`
|
|
||||||
|
|
||||||
SetId sets Id field to given value.
|
|
||||||
|
|
||||||
### HasId
|
|
||||||
|
|
||||||
`func (o *DtoJob) HasId() bool`
|
|
||||||
|
|
||||||
HasId returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetLastError
|
|
||||||
|
|
||||||
`func (o *DtoJob) GetLastError() string`
|
|
||||||
|
|
||||||
GetLastError returns the LastError field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetLastErrorOk
|
|
||||||
|
|
||||||
`func (o *DtoJob) GetLastErrorOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetLastErrorOk returns a tuple with the LastError field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetLastError
|
|
||||||
|
|
||||||
`func (o *DtoJob) SetLastError(v string)`
|
|
||||||
|
|
||||||
SetLastError sets LastError field to given value.
|
|
||||||
|
|
||||||
### HasLastError
|
|
||||||
|
|
||||||
`func (o *DtoJob) HasLastError() bool`
|
|
||||||
|
|
||||||
HasLastError returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetMaxAttempts
|
|
||||||
|
|
||||||
`func (o *DtoJob) GetMaxAttempts() int32`
|
|
||||||
|
|
||||||
GetMaxAttempts returns the MaxAttempts field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetMaxAttemptsOk
|
|
||||||
|
|
||||||
`func (o *DtoJob) GetMaxAttemptsOk() (*int32, bool)`
|
|
||||||
|
|
||||||
GetMaxAttemptsOk returns a tuple with the MaxAttempts field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetMaxAttempts
|
|
||||||
|
|
||||||
`func (o *DtoJob) SetMaxAttempts(v int32)`
|
|
||||||
|
|
||||||
SetMaxAttempts sets MaxAttempts field to given value.
|
|
||||||
|
|
||||||
### HasMaxAttempts
|
|
||||||
|
|
||||||
`func (o *DtoJob) HasMaxAttempts() bool`
|
|
||||||
|
|
||||||
HasMaxAttempts returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetPayload
|
|
||||||
|
|
||||||
`func (o *DtoJob) GetPayload() map[string]interface{}`
|
|
||||||
|
|
||||||
GetPayload returns the Payload field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetPayloadOk
|
|
||||||
|
|
||||||
`func (o *DtoJob) GetPayloadOk() (*map[string]interface{}, bool)`
|
|
||||||
|
|
||||||
GetPayloadOk returns a tuple with the Payload field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetPayload
|
|
||||||
|
|
||||||
`func (o *DtoJob) SetPayload(v map[string]interface{})`
|
|
||||||
|
|
||||||
SetPayload sets Payload field to given value.
|
|
||||||
|
|
||||||
### HasPayload
|
|
||||||
|
|
||||||
`func (o *DtoJob) HasPayload() bool`
|
|
||||||
|
|
||||||
HasPayload returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetQueue
|
|
||||||
|
|
||||||
`func (o *DtoJob) GetQueue() string`
|
|
||||||
|
|
||||||
GetQueue returns the Queue field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetQueueOk
|
|
||||||
|
|
||||||
`func (o *DtoJob) GetQueueOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetQueueOk returns a tuple with the Queue field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetQueue
|
|
||||||
|
|
||||||
`func (o *DtoJob) SetQueue(v string)`
|
|
||||||
|
|
||||||
SetQueue sets Queue field to given value.
|
|
||||||
|
|
||||||
### HasQueue
|
|
||||||
|
|
||||||
`func (o *DtoJob) HasQueue() bool`
|
|
||||||
|
|
||||||
HasQueue returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetRunAt
|
|
||||||
|
|
||||||
`func (o *DtoJob) GetRunAt() string`
|
|
||||||
|
|
||||||
GetRunAt returns the RunAt field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetRunAtOk
|
|
||||||
|
|
||||||
`func (o *DtoJob) GetRunAtOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetRunAtOk returns a tuple with the RunAt field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetRunAt
|
|
||||||
|
|
||||||
`func (o *DtoJob) SetRunAt(v string)`
|
|
||||||
|
|
||||||
SetRunAt sets RunAt field to given value.
|
|
||||||
|
|
||||||
### HasRunAt
|
|
||||||
|
|
||||||
`func (o *DtoJob) HasRunAt() bool`
|
|
||||||
|
|
||||||
HasRunAt returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetStatus
|
|
||||||
|
|
||||||
`func (o *DtoJob) GetStatus() DtoJobStatus`
|
|
||||||
|
|
||||||
GetStatus returns the Status field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetStatusOk
|
|
||||||
|
|
||||||
`func (o *DtoJob) GetStatusOk() (*DtoJobStatus, bool)`
|
|
||||||
|
|
||||||
GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetStatus
|
|
||||||
|
|
||||||
`func (o *DtoJob) SetStatus(v DtoJobStatus)`
|
|
||||||
|
|
||||||
SetStatus sets Status field to given value.
|
|
||||||
|
|
||||||
### HasStatus
|
|
||||||
|
|
||||||
`func (o *DtoJob) HasStatus() bool`
|
|
||||||
|
|
||||||
HasStatus returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetType
|
|
||||||
|
|
||||||
`func (o *DtoJob) GetType() string`
|
|
||||||
|
|
||||||
GetType returns the Type field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetTypeOk
|
|
||||||
|
|
||||||
`func (o *DtoJob) GetTypeOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetType
|
|
||||||
|
|
||||||
`func (o *DtoJob) SetType(v string)`
|
|
||||||
|
|
||||||
SetType sets Type field to given value.
|
|
||||||
|
|
||||||
### HasType
|
|
||||||
|
|
||||||
`func (o *DtoJob) HasType() bool`
|
|
||||||
|
|
||||||
HasType returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetUpdatedAt
|
|
||||||
|
|
||||||
`func (o *DtoJob) GetUpdatedAt() string`
|
|
||||||
|
|
||||||
GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetUpdatedAtOk
|
|
||||||
|
|
||||||
`func (o *DtoJob) GetUpdatedAtOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetUpdatedAt
|
|
||||||
|
|
||||||
`func (o *DtoJob) SetUpdatedAt(v string)`
|
|
||||||
|
|
||||||
SetUpdatedAt sets UpdatedAt field to given value.
|
|
||||||
|
|
||||||
### HasUpdatedAt
|
|
||||||
|
|
||||||
`func (o *DtoJob) HasUpdatedAt() bool`
|
|
||||||
|
|
||||||
HasUpdatedAt returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
# DtoJobStatus
|
|
||||||
|
|
||||||
## Enum
|
|
||||||
|
|
||||||
|
|
||||||
* `StatusQueued` (value: `"queued"`)
|
|
||||||
|
|
||||||
* `StatusRunning` (value: `"running"`)
|
|
||||||
|
|
||||||
* `StatusSucceeded` (value: `"succeeded"`)
|
|
||||||
|
|
||||||
* `StatusFailed` (value: `"failed"`)
|
|
||||||
|
|
||||||
* `StatusCanceled` (value: `"canceled"`)
|
|
||||||
|
|
||||||
* `StatusRetrying` (value: `"retrying"`)
|
|
||||||
|
|
||||||
* `StatusScheduled` (value: `"scheduled"`)
|
|
||||||
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,186 +0,0 @@
|
|||||||
# DtoLabelResponse
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**CreatedAt** | Pointer to **string** | | [optional]
|
|
||||||
**Id** | Pointer to **string** | | [optional]
|
|
||||||
**Key** | Pointer to **string** | | [optional]
|
|
||||||
**OrganizationId** | Pointer to **string** | | [optional]
|
|
||||||
**UpdatedAt** | Pointer to **string** | | [optional]
|
|
||||||
**Value** | Pointer to **string** | | [optional]
|
|
||||||
|
|
||||||
## Methods
|
|
||||||
|
|
||||||
### NewDtoLabelResponse
|
|
||||||
|
|
||||||
`func NewDtoLabelResponse() *DtoLabelResponse`
|
|
||||||
|
|
||||||
NewDtoLabelResponse instantiates a new DtoLabelResponse object
|
|
||||||
This constructor will assign default values to properties that have it defined,
|
|
||||||
and makes sure properties required by API are set, but the set of arguments
|
|
||||||
will change when the set of required properties is changed
|
|
||||||
|
|
||||||
### NewDtoLabelResponseWithDefaults
|
|
||||||
|
|
||||||
`func NewDtoLabelResponseWithDefaults() *DtoLabelResponse`
|
|
||||||
|
|
||||||
NewDtoLabelResponseWithDefaults instantiates a new DtoLabelResponse object
|
|
||||||
This constructor will only assign default values to properties that have it defined,
|
|
||||||
but it doesn't guarantee that properties required by API are set
|
|
||||||
|
|
||||||
### GetCreatedAt
|
|
||||||
|
|
||||||
`func (o *DtoLabelResponse) GetCreatedAt() string`
|
|
||||||
|
|
||||||
GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetCreatedAtOk
|
|
||||||
|
|
||||||
`func (o *DtoLabelResponse) GetCreatedAtOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetCreatedAt
|
|
||||||
|
|
||||||
`func (o *DtoLabelResponse) SetCreatedAt(v string)`
|
|
||||||
|
|
||||||
SetCreatedAt sets CreatedAt field to given value.
|
|
||||||
|
|
||||||
### HasCreatedAt
|
|
||||||
|
|
||||||
`func (o *DtoLabelResponse) HasCreatedAt() bool`
|
|
||||||
|
|
||||||
HasCreatedAt returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetId
|
|
||||||
|
|
||||||
`func (o *DtoLabelResponse) GetId() string`
|
|
||||||
|
|
||||||
GetId returns the Id field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetIdOk
|
|
||||||
|
|
||||||
`func (o *DtoLabelResponse) GetIdOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetId
|
|
||||||
|
|
||||||
`func (o *DtoLabelResponse) SetId(v string)`
|
|
||||||
|
|
||||||
SetId sets Id field to given value.
|
|
||||||
|
|
||||||
### HasId
|
|
||||||
|
|
||||||
`func (o *DtoLabelResponse) HasId() bool`
|
|
||||||
|
|
||||||
HasId returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetKey
|
|
||||||
|
|
||||||
`func (o *DtoLabelResponse) GetKey() string`
|
|
||||||
|
|
||||||
GetKey returns the Key field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetKeyOk
|
|
||||||
|
|
||||||
`func (o *DtoLabelResponse) GetKeyOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetKey
|
|
||||||
|
|
||||||
`func (o *DtoLabelResponse) SetKey(v string)`
|
|
||||||
|
|
||||||
SetKey sets Key field to given value.
|
|
||||||
|
|
||||||
### HasKey
|
|
||||||
|
|
||||||
`func (o *DtoLabelResponse) HasKey() bool`
|
|
||||||
|
|
||||||
HasKey returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetOrganizationId
|
|
||||||
|
|
||||||
`func (o *DtoLabelResponse) GetOrganizationId() string`
|
|
||||||
|
|
||||||
GetOrganizationId returns the OrganizationId field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetOrganizationIdOk
|
|
||||||
|
|
||||||
`func (o *DtoLabelResponse) GetOrganizationIdOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetOrganizationIdOk returns a tuple with the OrganizationId field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetOrganizationId
|
|
||||||
|
|
||||||
`func (o *DtoLabelResponse) SetOrganizationId(v string)`
|
|
||||||
|
|
||||||
SetOrganizationId sets OrganizationId field to given value.
|
|
||||||
|
|
||||||
### HasOrganizationId
|
|
||||||
|
|
||||||
`func (o *DtoLabelResponse) HasOrganizationId() bool`
|
|
||||||
|
|
||||||
HasOrganizationId returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetUpdatedAt
|
|
||||||
|
|
||||||
`func (o *DtoLabelResponse) GetUpdatedAt() string`
|
|
||||||
|
|
||||||
GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetUpdatedAtOk
|
|
||||||
|
|
||||||
`func (o *DtoLabelResponse) GetUpdatedAtOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetUpdatedAt
|
|
||||||
|
|
||||||
`func (o *DtoLabelResponse) SetUpdatedAt(v string)`
|
|
||||||
|
|
||||||
SetUpdatedAt sets UpdatedAt field to given value.
|
|
||||||
|
|
||||||
### HasUpdatedAt
|
|
||||||
|
|
||||||
`func (o *DtoLabelResponse) HasUpdatedAt() bool`
|
|
||||||
|
|
||||||
HasUpdatedAt returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetValue
|
|
||||||
|
|
||||||
`func (o *DtoLabelResponse) GetValue() string`
|
|
||||||
|
|
||||||
GetValue returns the Value field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetValueOk
|
|
||||||
|
|
||||||
`func (o *DtoLabelResponse) GetValueOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetValue
|
|
||||||
|
|
||||||
`func (o *DtoLabelResponse) SetValue(v string)`
|
|
||||||
|
|
||||||
SetValue sets Value field to given value.
|
|
||||||
|
|
||||||
### HasValue
|
|
||||||
|
|
||||||
`func (o *DtoLabelResponse) HasValue() bool`
|
|
||||||
|
|
||||||
HasValue returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
# DtoLogoutRequest
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**RefreshToken** | Pointer to **string** | | [optional]
|
|
||||||
|
|
||||||
## Methods
|
|
||||||
|
|
||||||
### NewDtoLogoutRequest
|
|
||||||
|
|
||||||
`func NewDtoLogoutRequest() *DtoLogoutRequest`
|
|
||||||
|
|
||||||
NewDtoLogoutRequest instantiates a new DtoLogoutRequest object
|
|
||||||
This constructor will assign default values to properties that have it defined,
|
|
||||||
and makes sure properties required by API are set, but the set of arguments
|
|
||||||
will change when the set of required properties is changed
|
|
||||||
|
|
||||||
### NewDtoLogoutRequestWithDefaults
|
|
||||||
|
|
||||||
`func NewDtoLogoutRequestWithDefaults() *DtoLogoutRequest`
|
|
||||||
|
|
||||||
NewDtoLogoutRequestWithDefaults instantiates a new DtoLogoutRequest object
|
|
||||||
This constructor will only assign default values to properties that have it defined,
|
|
||||||
but it doesn't guarantee that properties required by API are set
|
|
||||||
|
|
||||||
### GetRefreshToken
|
|
||||||
|
|
||||||
`func (o *DtoLogoutRequest) GetRefreshToken() string`
|
|
||||||
|
|
||||||
GetRefreshToken returns the RefreshToken field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetRefreshTokenOk
|
|
||||||
|
|
||||||
`func (o *DtoLogoutRequest) GetRefreshTokenOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetRefreshTokenOk returns a tuple with the RefreshToken field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetRefreshToken
|
|
||||||
|
|
||||||
`func (o *DtoLogoutRequest) SetRefreshToken(v string)`
|
|
||||||
|
|
||||||
SetRefreshToken sets RefreshToken field to given value.
|
|
||||||
|
|
||||||
### HasRefreshToken
|
|
||||||
|
|
||||||
`func (o *DtoLogoutRequest) HasRefreshToken() bool`
|
|
||||||
|
|
||||||
HasRefreshToken returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,134 +0,0 @@
|
|||||||
# DtoPageJob
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**Items** | Pointer to [**[]DtoJob**](DtoJob.md) | | [optional]
|
|
||||||
**Page** | Pointer to **int32** | | [optional]
|
|
||||||
**PageSize** | Pointer to **int32** | | [optional]
|
|
||||||
**Total** | Pointer to **int32** | | [optional]
|
|
||||||
|
|
||||||
## Methods
|
|
||||||
|
|
||||||
### NewDtoPageJob
|
|
||||||
|
|
||||||
`func NewDtoPageJob() *DtoPageJob`
|
|
||||||
|
|
||||||
NewDtoPageJob instantiates a new DtoPageJob object
|
|
||||||
This constructor will assign default values to properties that have it defined,
|
|
||||||
and makes sure properties required by API are set, but the set of arguments
|
|
||||||
will change when the set of required properties is changed
|
|
||||||
|
|
||||||
### NewDtoPageJobWithDefaults
|
|
||||||
|
|
||||||
`func NewDtoPageJobWithDefaults() *DtoPageJob`
|
|
||||||
|
|
||||||
NewDtoPageJobWithDefaults instantiates a new DtoPageJob object
|
|
||||||
This constructor will only assign default values to properties that have it defined,
|
|
||||||
but it doesn't guarantee that properties required by API are set
|
|
||||||
|
|
||||||
### GetItems
|
|
||||||
|
|
||||||
`func (o *DtoPageJob) GetItems() []DtoJob`
|
|
||||||
|
|
||||||
GetItems returns the Items field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetItemsOk
|
|
||||||
|
|
||||||
`func (o *DtoPageJob) GetItemsOk() (*[]DtoJob, bool)`
|
|
||||||
|
|
||||||
GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetItems
|
|
||||||
|
|
||||||
`func (o *DtoPageJob) SetItems(v []DtoJob)`
|
|
||||||
|
|
||||||
SetItems sets Items field to given value.
|
|
||||||
|
|
||||||
### HasItems
|
|
||||||
|
|
||||||
`func (o *DtoPageJob) HasItems() bool`
|
|
||||||
|
|
||||||
HasItems returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetPage
|
|
||||||
|
|
||||||
`func (o *DtoPageJob) GetPage() int32`
|
|
||||||
|
|
||||||
GetPage returns the Page field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetPageOk
|
|
||||||
|
|
||||||
`func (o *DtoPageJob) GetPageOk() (*int32, bool)`
|
|
||||||
|
|
||||||
GetPageOk returns a tuple with the Page field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetPage
|
|
||||||
|
|
||||||
`func (o *DtoPageJob) SetPage(v int32)`
|
|
||||||
|
|
||||||
SetPage sets Page field to given value.
|
|
||||||
|
|
||||||
### HasPage
|
|
||||||
|
|
||||||
`func (o *DtoPageJob) HasPage() bool`
|
|
||||||
|
|
||||||
HasPage returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetPageSize
|
|
||||||
|
|
||||||
`func (o *DtoPageJob) GetPageSize() int32`
|
|
||||||
|
|
||||||
GetPageSize returns the PageSize field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetPageSizeOk
|
|
||||||
|
|
||||||
`func (o *DtoPageJob) GetPageSizeOk() (*int32, bool)`
|
|
||||||
|
|
||||||
GetPageSizeOk returns a tuple with the PageSize field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetPageSize
|
|
||||||
|
|
||||||
`func (o *DtoPageJob) SetPageSize(v int32)`
|
|
||||||
|
|
||||||
SetPageSize sets PageSize field to given value.
|
|
||||||
|
|
||||||
### HasPageSize
|
|
||||||
|
|
||||||
`func (o *DtoPageJob) HasPageSize() bool`
|
|
||||||
|
|
||||||
HasPageSize returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetTotal
|
|
||||||
|
|
||||||
`func (o *DtoPageJob) GetTotal() int32`
|
|
||||||
|
|
||||||
GetTotal returns the Total field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetTotalOk
|
|
||||||
|
|
||||||
`func (o *DtoPageJob) GetTotalOk() (*int32, bool)`
|
|
||||||
|
|
||||||
GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetTotal
|
|
||||||
|
|
||||||
`func (o *DtoPageJob) SetTotal(v int32)`
|
|
||||||
|
|
||||||
SetTotal sets Total field to given value.
|
|
||||||
|
|
||||||
### HasTotal
|
|
||||||
|
|
||||||
`func (o *DtoPageJob) HasTotal() bool`
|
|
||||||
|
|
||||||
HasTotal returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,160 +0,0 @@
|
|||||||
# DtoQueueInfo
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**Failed** | Pointer to **int32** | | [optional]
|
|
||||||
**Name** | Pointer to **string** | | [optional]
|
|
||||||
**Pending** | Pointer to **int32** | | [optional]
|
|
||||||
**Running** | Pointer to **int32** | | [optional]
|
|
||||||
**Scheduled** | Pointer to **int32** | | [optional]
|
|
||||||
|
|
||||||
## Methods
|
|
||||||
|
|
||||||
### NewDtoQueueInfo
|
|
||||||
|
|
||||||
`func NewDtoQueueInfo() *DtoQueueInfo`
|
|
||||||
|
|
||||||
NewDtoQueueInfo instantiates a new DtoQueueInfo object
|
|
||||||
This constructor will assign default values to properties that have it defined,
|
|
||||||
and makes sure properties required by API are set, but the set of arguments
|
|
||||||
will change when the set of required properties is changed
|
|
||||||
|
|
||||||
### NewDtoQueueInfoWithDefaults
|
|
||||||
|
|
||||||
`func NewDtoQueueInfoWithDefaults() *DtoQueueInfo`
|
|
||||||
|
|
||||||
NewDtoQueueInfoWithDefaults instantiates a new DtoQueueInfo object
|
|
||||||
This constructor will only assign default values to properties that have it defined,
|
|
||||||
but it doesn't guarantee that properties required by API are set
|
|
||||||
|
|
||||||
### GetFailed
|
|
||||||
|
|
||||||
`func (o *DtoQueueInfo) GetFailed() int32`
|
|
||||||
|
|
||||||
GetFailed returns the Failed field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetFailedOk
|
|
||||||
|
|
||||||
`func (o *DtoQueueInfo) GetFailedOk() (*int32, bool)`
|
|
||||||
|
|
||||||
GetFailedOk returns a tuple with the Failed field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetFailed
|
|
||||||
|
|
||||||
`func (o *DtoQueueInfo) SetFailed(v int32)`
|
|
||||||
|
|
||||||
SetFailed sets Failed field to given value.
|
|
||||||
|
|
||||||
### HasFailed
|
|
||||||
|
|
||||||
`func (o *DtoQueueInfo) HasFailed() bool`
|
|
||||||
|
|
||||||
HasFailed returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetName
|
|
||||||
|
|
||||||
`func (o *DtoQueueInfo) GetName() string`
|
|
||||||
|
|
||||||
GetName returns the Name field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetNameOk
|
|
||||||
|
|
||||||
`func (o *DtoQueueInfo) GetNameOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetName
|
|
||||||
|
|
||||||
`func (o *DtoQueueInfo) SetName(v string)`
|
|
||||||
|
|
||||||
SetName sets Name field to given value.
|
|
||||||
|
|
||||||
### HasName
|
|
||||||
|
|
||||||
`func (o *DtoQueueInfo) HasName() bool`
|
|
||||||
|
|
||||||
HasName returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetPending
|
|
||||||
|
|
||||||
`func (o *DtoQueueInfo) GetPending() int32`
|
|
||||||
|
|
||||||
GetPending returns the Pending field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetPendingOk
|
|
||||||
|
|
||||||
`func (o *DtoQueueInfo) GetPendingOk() (*int32, bool)`
|
|
||||||
|
|
||||||
GetPendingOk returns a tuple with the Pending field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetPending
|
|
||||||
|
|
||||||
`func (o *DtoQueueInfo) SetPending(v int32)`
|
|
||||||
|
|
||||||
SetPending sets Pending field to given value.
|
|
||||||
|
|
||||||
### HasPending
|
|
||||||
|
|
||||||
`func (o *DtoQueueInfo) HasPending() bool`
|
|
||||||
|
|
||||||
HasPending returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetRunning
|
|
||||||
|
|
||||||
`func (o *DtoQueueInfo) GetRunning() int32`
|
|
||||||
|
|
||||||
GetRunning returns the Running field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetRunningOk
|
|
||||||
|
|
||||||
`func (o *DtoQueueInfo) GetRunningOk() (*int32, bool)`
|
|
||||||
|
|
||||||
GetRunningOk returns a tuple with the Running field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetRunning
|
|
||||||
|
|
||||||
`func (o *DtoQueueInfo) SetRunning(v int32)`
|
|
||||||
|
|
||||||
SetRunning sets Running field to given value.
|
|
||||||
|
|
||||||
### HasRunning
|
|
||||||
|
|
||||||
`func (o *DtoQueueInfo) HasRunning() bool`
|
|
||||||
|
|
||||||
HasRunning returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
### GetScheduled
|
|
||||||
|
|
||||||
`func (o *DtoQueueInfo) GetScheduled() int32`
|
|
||||||
|
|
||||||
GetScheduled returns the Scheduled field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetScheduledOk
|
|
||||||
|
|
||||||
`func (o *DtoQueueInfo) GetScheduledOk() (*int32, bool)`
|
|
||||||
|
|
||||||
GetScheduledOk returns a tuple with the Scheduled field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetScheduled
|
|
||||||
|
|
||||||
`func (o *DtoQueueInfo) SetScheduled(v int32)`
|
|
||||||
|
|
||||||
SetScheduled sets Scheduled field to given value.
|
|
||||||
|
|
||||||
### HasScheduled
|
|
||||||
|
|
||||||
`func (o *DtoQueueInfo) HasScheduled() bool`
|
|
||||||
|
|
||||||
HasScheduled returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
# DtoRefreshRequest
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**RefreshToken** | Pointer to **string** | | [optional]
|
|
||||||
|
|
||||||
## Methods
|
|
||||||
|
|
||||||
### NewDtoRefreshRequest
|
|
||||||
|
|
||||||
`func NewDtoRefreshRequest() *DtoRefreshRequest`
|
|
||||||
|
|
||||||
NewDtoRefreshRequest instantiates a new DtoRefreshRequest object
|
|
||||||
This constructor will assign default values to properties that have it defined,
|
|
||||||
and makes sure properties required by API are set, but the set of arguments
|
|
||||||
will change when the set of required properties is changed
|
|
||||||
|
|
||||||
### NewDtoRefreshRequestWithDefaults
|
|
||||||
|
|
||||||
`func NewDtoRefreshRequestWithDefaults() *DtoRefreshRequest`
|
|
||||||
|
|
||||||
NewDtoRefreshRequestWithDefaults instantiates a new DtoRefreshRequest object
|
|
||||||
This constructor will only assign default values to properties that have it defined,
|
|
||||||
but it doesn't guarantee that properties required by API are set
|
|
||||||
|
|
||||||
### GetRefreshToken
|
|
||||||
|
|
||||||
`func (o *DtoRefreshRequest) GetRefreshToken() string`
|
|
||||||
|
|
||||||
GetRefreshToken returns the RefreshToken field if non-nil, zero value otherwise.
|
|
||||||
|
|
||||||
### GetRefreshTokenOk
|
|
||||||
|
|
||||||
`func (o *DtoRefreshRequest) GetRefreshTokenOk() (*string, bool)`
|
|
||||||
|
|
||||||
GetRefreshTokenOk returns a tuple with the RefreshToken field if it's non-nil, zero value otherwise
|
|
||||||
and a boolean to check if the value has been set.
|
|
||||||
|
|
||||||
### SetRefreshToken
|
|
||||||
|
|
||||||
`func (o *DtoRefreshRequest) SetRefreshToken(v string)`
|
|
||||||
|
|
||||||
SetRefreshToken sets RefreshToken field to given value.
|
|
||||||
|
|
||||||
### HasRefreshToken
|
|
||||||
|
|
||||||
`func (o *DtoRefreshRequest) HasRefreshToken() bool`
|
|
||||||
|
|
||||||
HasRefreshToken returns a boolean if a field has been set.
|
|
||||||
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user