diff --git a/go.mod b/go.mod index 4e83ce72..611e6552 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/nais/cli -go 1.26.9 +go 1.26.4 tool ( github.com/Khan/genqlient @@ -26,12 +26,12 @@ require ( github.com/lestrrat-go/jwx/v3 v3.1.1 github.com/lib/pq v1.12.3 github.com/mailgun/raymond/v2 v2.0.48 - github.com/mark3labs/mcp-go v0.54.1 + github.com/mark3labs/mcp-go v1.2.1 github.com/mitchellh/go-ps v1.0.0 github.com/nais/device v1.16.1 github.com/nais/krakend/pkg/migration v0.0.0-20260828065656-ff6408beb421 github.com/nais/liberator v0.0.0-20260526061822-791cc0e0457c - github.com/nais/naistrix v0.37.1 + github.com/nais/naistrix v0.38.0 github.com/pterm/pterm v0.12.83 github.com/quic-go/quic-go v0.59.1 github.com/stretchr/testify v1.12.1 @@ -119,8 +119,8 @@ require ( github.com/fsnotify/fsnotify v1.10.1 // indirect github.com/fxamacker/cbor/v2 v2.9.0 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect - github.com/go-git/go-billy/v5 v5.9.0 // indirect - github.com/go-git/go-git/v5 v5.19.1 // indirect + github.com/go-git/go-billy/v5 v5.9.2 // indirect + github.com/go-git/go-git/v5 v5.19.3 // indirect github.com/go-jose/go-jose/v4 v4.1.4 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-openapi/jsonpointer v0.21.0 // indirect @@ -156,7 +156,6 @@ require ( github.com/json-iterator/go v1.1.12 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect github.com/klauspost/compress v1.19.0 // indirect - github.com/klauspost/cpuid/v2 v2.3.0 // indirect github.com/klauspost/pgzip v1.2.6 // indirect github.com/lestrrat-go/blackmagic v1.0.4 // indirect github.com/lestrrat-go/dsig v1.2.1 // indirect @@ -187,7 +186,7 @@ require ( github.com/opencontainers/image-spec v1.1.1 // indirect github.com/pb33f/ordered-map/v2 v2.3.1 // indirect github.com/pelletier/go-toml/v2 v2.4.3 // indirect - github.com/pjbgf/sha1cd v0.6.0 // indirect + github.com/pjbgf/sha1cd v0.7.0 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.23.2 // indirect github.com/prometheus/client_model v0.6.2 // indirect @@ -267,5 +266,5 @@ require ( sigs.k8s.io/randfill v1.0.0 // indirect sigs.k8s.io/structured-merge-diff/v6 v6.3.2 // indirect sigs.k8s.io/yaml v1.6.0 // indirect - software.sslmate.com/src/go-pkcs12 v0.7.1 // indirect + software.sslmate.com/src/go-pkcs12 v0.7.3 // indirect ) diff --git a/go.sum b/go.sum index 9d5badca..988f385f 100644 --- a/go.sum +++ b/go.sum @@ -185,12 +185,12 @@ github.com/go-chi/chi/v5 v5.2.5 h1:Eg4myHZBjyvJmAFjFvWgrqDTXFyOzjj7YIm3L3mu6Ug= github.com/go-chi/chi/v5 v5.2.5/go.mod h1:X7Gx4mteadT3eDOMTsXzmI4/rwUpOwBHLpAfupzFJP0= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= -github.com/go-git/go-billy/v5 v5.9.0 h1:jItGXszUDRtR/AlferWPTMN4j38BQ88XnXKbilmmBPA= -github.com/go-git/go-billy/v5 v5.9.0/go.mod h1:jCnQMLj9eUgGU7+ludSTYoZL/GGmii14RxKFj7ROgHw= +github.com/go-git/go-billy/v5 v5.9.2 h1:OXFSRyz4g20upsGDJgQG9Bak1l/ZEv8GHVYB52O71sE= +github.com/go-git/go-billy/v5 v5.9.2/go.mod h1:ExsU+jcGwXTBOnyilvAnEM1wug1IxHr4yP2ZXsNRtV0= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4= github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= -github.com/go-git/go-git/v5 v5.19.1 h1:nX27AnaU43/K5bKktKwgBmR9lawoYVe1Ckg0rgzzN00= -github.com/go-git/go-git/v5 v5.19.1/go.mod h1:Pb1v0c7/g8aGQJwx9Us09W85yGoyvSwuhEGMH7zjDKQ= +github.com/go-git/go-git/v5 v5.19.3 h1:qHttbZ+Am7wEjdTpR1XMQ4rl42FK9SIXzZ4o9x7s6M4= +github.com/go-git/go-git/v5 v5.19.3/go.mod h1:Ye4C8dVigkqrv9UsB4NMdSLV4yAIkLiIhW61gcOyhl4= github.com/go-jose/go-jose/v4 v4.1.4 h1:moDMcTHmvE6Groj34emNPLs/qtYXRVcd6S7NHbHz3kA= github.com/go-jose/go-jose/v4 v4.1.4/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= @@ -367,8 +367,8 @@ github.com/mailgun/raymond/v2 v2.0.48 h1:5dmlB680ZkFG2RN/0lvTAghrSxIESeu9/2aeDqA github.com/mailgun/raymond/v2 v2.0.48/go.mod h1:lsgvL50kgt1ylcFJYZiULi5fjPBkkhNfj4KA0W54Z18= github.com/mailru/easyjson v0.9.2 h1:dX8U45hQsZpxd80nLvDGihsQ/OxlvTkVUXH2r/8cb2M= github.com/mailru/easyjson v0.9.2/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= -github.com/mark3labs/mcp-go v0.54.1 h1:Ap/ptEB9FtWzFKM8NDsTA7QDxerQOC06eZigrTldVj0= -github.com/mark3labs/mcp-go v0.54.1/go.mod h1:+8WclSK1ZUweCP3hvktSji8n8ABG/95QaEkeVE/Uwas= +github.com/mark3labs/mcp-go v1.2.1 h1:gd8VD3feMAVycwAM0x1nhv42Q1oLLjfOyowoUzHULB8= +github.com/mark3labs/mcp-go v1.2.1/go.mod h1:r2fW4o3wsoJ7IMsx1Wuq5xeP8PRGXPDfNveoGAYbb/s= github.com/matryer/is v1.4.1 h1:55ehd8zaGABKLXQUe2awZ99BD/PTc2ls+KV/dXphgEQ= github.com/matryer/is v1.4.1/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU= github.com/mattn/go-runewidth v0.0.31 h1:1oCV4ReTlosDBc6rYRw5cL8S/4y8iv5oRl4SJ5IBgwo= @@ -413,8 +413,8 @@ github.com/nais/krakend/pkg/migration v0.0.0-20260828065656-ff6408beb421 h1:nEcK github.com/nais/krakend/pkg/migration v0.0.0-20260828065656-ff6408beb421/go.mod h1:Siwxo1B39dMTFYEwTzPwr1+Rg5r/0OAtHC3BbKh/XPA= github.com/nais/liberator v0.0.0-20260526061822-791cc0e0457c h1:IS4qWh2Of5rV7UY4YnQKg7rxP9lx5BzfFv1XNMZbCtI= github.com/nais/liberator v0.0.0-20260526061822-791cc0e0457c/go.mod h1:MT3N4X8eK6cJ94zoybdIY8JCaPrHCnw4Pde8piMS/v4= -github.com/nais/naistrix v0.37.1 h1:cDEvy88FslqPHTNoNWhOet30rKliTZKzgozthHkwofs= -github.com/nais/naistrix v0.37.1/go.mod h1:yrDLe3FbYjsPmyF+X6ax9Afw2jWPjc0ihwwvcm5McDU= +github.com/nais/naistrix v0.38.0 h1:nzgvr7EnAnG/+pRER7+GfE3x1JRbqN48JUYKw1IcLqc= +github.com/nais/naistrix v0.38.0/go.mod h1:yrDLe3FbYjsPmyF+X6ax9Afw2jWPjc0ihwwvcm5McDU= github.com/nais/pgrator v0.0.0-20260113113020-3944d387b42d h1:Ciq0quRhHOeeOTWy9WNmLe04uNYhe7l9qIrFTpFC5y0= github.com/nais/pgrator v0.0.0-20260113113020-3944d387b42d/go.mod h1:jpksYq94zmmjIIhjOBl+9GpEkTbaeLrrcINPQx9REx4= github.com/onsi/ginkgo/v2 v2.32.1 h1:6tlvcDm/3sE8lGJbZ4+d4mO3RLy24/tQWOFzVSQNIfw= @@ -431,8 +431,8 @@ github.com/pb33f/ordered-map/v2 v2.3.1 h1:5319HDO0aw4DA4gzi+zv4FXU9UlSs3xGZ40wcP github.com/pb33f/ordered-map/v2 v2.3.1/go.mod h1:qxFQgd0PkVUtOMCkTapqotNgzRhMPL7VvaHKbd1HnmQ= github.com/pelletier/go-toml/v2 v2.4.3 h1:GTRvJQutkOSftxIFD5xw9aepkYNuPWmVJpffdDPYVpY= github.com/pelletier/go-toml/v2 v2.4.3/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= -github.com/pjbgf/sha1cd v0.6.0 h1:3WJ8Wz8gvDz29quX1OcEmkAlUg9diU4GxJHqs0/XiwU= -github.com/pjbgf/sha1cd v0.6.0/go.mod h1:lhpGlyHLpQZoxMv8HcgXvZEhcGs0PG/vsZnEJ7H0iCM= +github.com/pjbgf/sha1cd v0.7.0 h1:ZRNPKHj+gfkLBf0KJv/p1Hmz+7bqCT5o311YX0nq+DA= +github.com/pjbgf/sha1cd v0.7.0/go.mod h1:pKR5Li+qTCo+ebqITZfwPlJGoCFCvSO00qxjbNtTUFQ= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -781,5 +781,5 @@ sigs.k8s.io/structured-merge-diff/v6 v6.3.2 h1:kwVWMx5yS1CrnFWA/2QHyRVJ8jM6dBA80 sigs.k8s.io/structured-merge-diff/v6 v6.3.2/go.mod h1:M3W8sfWvn2HhQDIbGWj3S099YozAsymCo/wrT5ohRUE= sigs.k8s.io/yaml v1.6.0 h1:G8fkbMSAFqgEFgh4b1wmtzDnioxFCUgTZhlbj5P9QYs= sigs.k8s.io/yaml v1.6.0/go.mod h1:796bPqUfzR/0jLAl6XjHl3Ck7MiyVv8dbTdyT3/pMf4= -software.sslmate.com/src/go-pkcs12 v0.7.1 h1:bxkUPRsvTPNRBZa4M/aSX4PyMOEbq3V8I6hbkG4F4Q8= -software.sslmate.com/src/go-pkcs12 v0.7.1/go.mod h1:Qiz0EyvDRJjjxGyUQa2cCNZn/wMyzrRJ/qcDXOQazLI= +software.sslmate.com/src/go-pkcs12 v0.7.3 h1:JBQD3FDqYjTeyDAeZQklj2ar88ykBLtALloPJHyAauU= +software.sslmate.com/src/go-pkcs12 v0.7.3/go.mod h1:Qiz0EyvDRJjjxGyUQa2cCNZn/wMyzrRJ/qcDXOQazLI= diff --git a/internal/activity/activity_test.go b/internal/activity/activity_test.go index 0d5ce50f..82d4b6b6 100644 --- a/internal/activity/activity_test.go +++ b/internal/activity/activity_test.go @@ -12,15 +12,19 @@ func TestPostgresActivityEntriesCanBeListed(t *testing.T) { {"__typename":"PostgresBranchCreatedActivityLogEntry","actor":"user@example.com","createdAt":"2026-10-05T08:21:46Z","message":"Postgres branch created: restore","environmentName":"dev-gcp","resourceType":"POSTGRES","resourceName":"relay-test"}, {"__typename":"PostgresBranchActivatedActivityLogEntry","actor":"user@example.com","createdAt":"2026-10-05T08:23:46Z","message":"Postgres branch activated: restore","environmentName":"dev-gcp","resourceType":"POSTGRES","resourceName":"relay-test"}, {"__typename":"PostgresBranchDeletedActivityLogEntry","actor":"user@example.com","createdAt":"2026-10-05T08:25:46Z","message":"Postgres branch deleted: main","environmentName":"dev-gcp","resourceType":"POSTGRES","resourceName":"relay-test"}, - {"__typename":"PostgresBranchActivityLogEntry","actor":"user@example.com","createdAt":"2026-10-05T08:26:46Z","message":"Postgres branch created: legacy","environmentName":"dev-gcp","resourceType":"POSTGRES","resourceName":"relay-test"}, + {"__typename":"PostgresCreatedActivityLogEntry","actor":"user@example.com","createdAt":"2026-10-05T08:26:46Z","message":"Created Postgres","environmentName":"dev-gcp","resourceType":"POSTGRES","resourceName":"relay-test"}, {"__typename":"PostgresUpdatedActivityLogEntry","actor":"user@example.com","createdAt":"2026-10-05T08:27:42Z","message":"Updated Postgres","environmentName":"dev-gcp","resourceType":"POSTGRES","resourceName":"relay-test"}, {"__typename":"PostgresDeletedActivityLogEntry","actor":"user@example.com","createdAt":"2026-10-05T08:31:16Z","message":"Deleted Postgres","environmentName":"dev-gcp","resourceType":"POSTGRES","resourceName":"relay-test"} ]}` var entries gql.GetTeamActivityTeamActivityLogActivityLogEntryConnection if err := json.Unmarshal([]byte(response), &entries); err != nil { - t.Fatalf("decoding branch and historical Postgres activity: %v", err) + t.Fatalf("decoding Postgres branch and instance activity: %v", err) } - for i, want := range []string{"Postgres branch created: restore", "Postgres branch activated: restore", "Postgres branch deleted: main", "Postgres branch created: legacy", "Updated Postgres", "Deleted Postgres"} { + wantMessages := []string{"Postgres branch created: restore", "Postgres branch activated: restore", "Postgres branch deleted: main", "Created Postgres", "Updated Postgres", "Deleted Postgres"} + if got := len(entries.Nodes); got != len(wantMessages) { + t.Fatalf("got %d entries, want %d", got, len(wantMessages)) + } + for i, want := range wantMessages { if got := entries.Nodes[i].GetMessage(); got != want { t.Errorf("entry %d: got %q, want %q", i, got, want) } diff --git a/internal/alpha/postgres/command/access.go b/internal/alpha/postgres/command/access.go index 312bd804..0c413aa5 100644 --- a/internal/alpha/postgres/command/access.go +++ b/internal/alpha/postgres/command/access.go @@ -30,7 +30,7 @@ func psqlCommand(parent *flag.Postgres) *naistrix.Command { return &naistrix.Command{ Name: "psql", Title: "Connect to Nais Postgres via psql (experimental).", Description: "Request personal access, open a local relay tunnel and start psql with end-to-end TLS verification. If --reason is omitted, prompt for an audit reason interactively.", - Args: []naistrix.Argument{{Name: "postgres"}}, Flags: f, + Args: []naistrix.Argument{{Name: "postgres", Prompt: "Name of the Postgres instance to connect to"}}, Flags: f, AutoCompleteFunc: autoCompletePostgresNames(f.Postgres), RunFunc: func(ctx context.Context, args *naistrix.Arguments, out *naistrix.OutputWriter) error { request, err := prepareAccessRequest(args.Get("postgres"), f, out) @@ -98,7 +98,7 @@ func proxyCommand(parent *flag.Postgres) *naistrix.Command { return &naistrix.Command{ Name: "proxy", Title: "Expose a Nais Postgres relay tunnel locally (experimental).", Description: "Request personal access and listen on loopback. If --reason is omitted, prompt for an audit reason interactively. PostgreSQL clients must verify the server certificate; use psql for automatic TLS setup. Credentials are not printed unless --print-password is set.", - Args: []naistrix.Argument{{Name: "postgres"}}, Flags: f, + Args: []naistrix.Argument{{Name: "postgres", Prompt: "Name of the Postgres instance to proxy"}}, Flags: f, AutoCompleteFunc: autoCompletePostgresNames(f.Postgres), RunFunc: func(ctx context.Context, args *naistrix.Arguments, out *naistrix.OutputWriter) error { if net.ParseIP(f.Host) == nil || !net.ParseIP(f.Host).IsLoopback() { diff --git a/internal/alpha/postgres/command/branch.go b/internal/alpha/postgres/command/branch.go index 3fa006a3..b05a458c 100644 --- a/internal/alpha/postgres/command/branch.go +++ b/internal/alpha/postgres/command/branch.go @@ -32,7 +32,7 @@ func branchListCommand(parent *flag.Postgres) *naistrix.Command { return &naistrix.Command{ Name: "list", Title: "List branches of a Postgres.", Description: "List the branches of a Postgres with their status and whether each one is active.", - Args: []naistrix.Argument{{Name: "postgres"}}, Flags: f, + Args: []naistrix.Argument{{Name: "postgres", Prompt: "Name of the Postgres instance to list branches for"}}, Flags: f, AutoCompleteFunc: autoCompletePostgresNames(parent), RunFunc: func(ctx context.Context, args *naistrix.Arguments, out *naistrix.OutputWriter) error { env, err := branchEnvironment(ctx, parent, args.Get("postgres")) @@ -86,7 +86,7 @@ func branchCreateCommand(parent *flag.Postgres) *naistrix.Command { {Description: "Restore from the active branch at a UTC timestamp (Z means UTC).", Command: "my-postgres restored --at 2026-10-06T10:00:00Z"}, {Description: "Restore from a specific source branch.", Command: "my-postgres restored --from main --at 2026-10-06T10:00:00Z"}, }, - Args: []naistrix.Argument{{Name: "postgres", Repeatable: true}}, + Args: []naistrix.Argument{{Name: "postgres", Prompt: "Name of the Postgres instance; optionally add a new branch name next", Repeatable: true}}, AutoCompleteFunc: autoCompletePostgresNames(parent), ValidateFunc: naistrix.ValidateFuncs( validation.RequireTeam(f), @@ -161,7 +161,7 @@ func branchActivateCommand(parent *flag.Postgres) *naistrix.Command { return &naistrix.Command{ Name: "activate", Title: "Request activation of a Postgres branch.", Flags: f, Description: "Request that a branch becomes the active branch of the Postgres. Activation continues asynchronously; use branch list to check progress.", - Args: []naistrix.Argument{{Name: "postgres"}, {Name: "branch"}}, + Args: []naistrix.Argument{{Name: "postgres", Prompt: "Name of the Postgres instance"}, {Name: "branch", Prompt: "Name of the branch to activate"}}, AutoCompleteFunc: autoCompletePostgresBranches(parent), RunFunc: func(ctx context.Context, args *naistrix.Arguments, out *naistrix.OutputWriter) error { env, err := branchEnvironment(ctx, parent, args.Get("postgres")) @@ -203,7 +203,7 @@ func branchDeleteCommand(parent *flag.Postgres) *naistrix.Command { return &naistrix.Command{ Name: "delete", Title: "Delete an inactive Postgres branch.", Flags: f, Description: "Delete an inactive branch, even if workloads still use it. Referring apps/jobs are listed with a warning before confirmation. --yes skips confirmation, not the usage check or warning.", - Args: []naistrix.Argument{{Name: "postgres"}, {Name: "branch"}}, + Args: []naistrix.Argument{{Name: "postgres", Prompt: "Name of the Postgres instance"}, {Name: "branch", Prompt: "Name of the inactive branch to delete"}}, AutoCompleteFunc: autoCompletePostgresBranches(parent), RunFunc: func(ctx context.Context, args *naistrix.Arguments, out *naistrix.OutputWriter) error { env, err := branchEnvironment(ctx, parent, args.Get("postgres")) diff --git a/internal/alpha/postgres/command/get.go b/internal/alpha/postgres/command/get.go index a39293e1..98001078 100644 --- a/internal/alpha/postgres/command/get.go +++ b/internal/alpha/postgres/command/get.go @@ -51,7 +51,7 @@ func instanceGetCommand(parent *flag.Postgres) *naistrix.Command { return &naistrix.Command{ Name: "get", Title: "Get Postgres details and readiness.", Description: "Show configured settings and a coarse platform-reported status, not SQL connectivity, workload readiness, or completion of end-to-end resource updates. Omitted resource requests are not configured; defaults are not inferred. Detailed provisioning stages are unavailable. Use branch commands to inspect branches.", - Args: []naistrix.Argument{{Name: "postgres"}}, Flags: f, + Args: []naistrix.Argument{{Name: "postgres", Prompt: "Name of the Postgres instance to inspect"}}, Flags: f, AutoCompleteFunc: autoCompletePostgresNames(parent), Examples: []naistrix.Example{ {Description: "Describe a Postgres in a specific environment.", Command: "my-postgres -t my-team -e dev-gcp"}, diff --git a/internal/alpha/postgres/command/instance.go b/internal/alpha/postgres/command/instance.go index fa410789..a9346b2b 100644 --- a/internal/alpha/postgres/command/instance.go +++ b/internal/alpha/postgres/command/instance.go @@ -18,7 +18,7 @@ func instanceCreateCommand(parent *flag.Postgres) *naistrix.Command { return &naistrix.Command{ Name: "create", Title: "Create a Postgres instance.", Flags: f, Description: "Create a new Postgres instance. Provisioning continues asynchronously.", - Args: []naistrix.Argument{{Name: "postgres"}}, + Args: []naistrix.Argument{{Name: "postgres", Prompt: "Name of the new Postgres instance"}}, Examples: []naistrix.Example{ {Description: "Select the destination environment interactively and create a Postgres with platform defaults.", Command: "my-postgres -t my-team"}, {Description: "Create a Postgres in a specific environment.", Command: "my-postgres -t my-team -e dev-gcp"}, @@ -75,7 +75,7 @@ func instanceUpdateCommand(parent *flag.Postgres) *naistrix.Command { return &naistrix.Command{ Name: "update", Title: "Update a Postgres instance.", Flags: f, Description: "Compare configured values with the requested changes before updating provided fields. Current resource values are configured requests, not effective runtime resources or SQL readiness. A subsequent nais apply may overwrite API updates on manifest-managed Postgres.", - Args: []naistrix.Argument{{Name: "postgres"}}, AutoCompleteFunc: autoCompletePostgresNames(parent), + Args: []naistrix.Argument{{Name: "postgres", Prompt: "Name of the Postgres instance to update"}}, AutoCompleteFunc: autoCompletePostgresNames(parent), Examples: []naistrix.Example{ {Description: "Change requested CPU and memory.", Command: "my-postgres -t my-team -e dev-gcp --cpu 200m --memory 1Gi"}, {Description: "Disable high availability.", Command: "my-postgres -t my-team -e dev-gcp --high-availability false"}, @@ -153,7 +153,7 @@ func instanceDeleteCommand(parent *flag.Postgres) *naistrix.Command { return &naistrix.Command{ Name: "delete", Title: "Request deletion of an entire Postgres instance.", Flags: f, Description: "Irreversibly delete a Postgres and all its branches and data. Unlike branch delete, this removes the whole instance. Workloads and bindings must no longer reference it.", - Args: []naistrix.Argument{{Name: "postgres"}}, AutoCompleteFunc: autoCompletePostgresNames(parent), + Args: []naistrix.Argument{{Name: "postgres", Prompt: "Name of the Postgres instance to delete"}}, AutoCompleteFunc: autoCompletePostgresNames(parent), Examples: []naistrix.Example{{Description: "Request deletion of an entire Postgres after removing its consumers.", Command: "my-postgres -t my-team -e dev-gcp"}}, RunFunc: func(ctx context.Context, args *naistrix.Arguments, out *naistrix.OutputWriter) error { if parent.Team == "" { diff --git a/internal/app/command/activity.go b/internal/app/command/activity.go index e9cab0f2..73d8aa29 100644 --- a/internal/app/command/activity.go +++ b/internal/app/command/activity.go @@ -22,7 +22,7 @@ func activity(parentFlags *flag.App) *naistrix.Command { Title: "Show activity for an application.", Description: "Displays recent events for a specific application, such as deployments and configuration changes. Results can be filtered by activity type.", Args: []naistrix.Argument{ - {Name: "name"}, + {Name: "name", Prompt: "Name of the application to show activity for"}, }, Flags: flags, RunFunc: func(ctx context.Context, args *naistrix.Arguments, out *naistrix.OutputWriter) error { diff --git a/internal/app/command/delete.go b/internal/app/command/delete.go index c60b900b..9dbb4059 100644 --- a/internal/app/command/delete.go +++ b/internal/app/command/delete.go @@ -21,7 +21,7 @@ func del(parentFlags *flag.App) *naistrix.Command { Description: "Permanently deletes an application.", Flags: flags, Args: []naistrix.Argument{ - {Name: "name"}, + {Name: "name", Prompt: "Name of the application to delete"}, }, RunFunc: func(ctx context.Context, args *naistrix.Arguments, out *naistrix.OutputWriter) error { name := args.Get("name") diff --git a/internal/app/command/env.go b/internal/app/command/env.go index 208e7b31..bd4b5db4 100644 --- a/internal/app/command/env.go +++ b/internal/app/command/env.go @@ -19,7 +19,7 @@ func env(parentFlags *flag.App) *naistrix.Command { Title: "Show environment variables for an application.", Description: "Lists all environment variables configured for the application with their values and sources. Secret values are hidden — use 'nais secret get --with-values' to reveal them.", Args: []naistrix.Argument{ - {Name: "name"}, + {Name: "name", Prompt: "Name of the application to show environment variables for"}, }, Flags: flags, RunFunc: func(ctx context.Context, args *naistrix.Arguments, out *naistrix.OutputWriter) error { diff --git a/internal/app/command/files.go b/internal/app/command/files.go index 65a41344..58a80f46 100644 --- a/internal/app/command/files.go +++ b/internal/app/command/files.go @@ -19,7 +19,7 @@ func files(parentFlags *flag.App) *naistrix.Command { Title: "Show mounted files for an application.", Description: "Lists all files mounted into the application from Secrets and Configs, with their paths and sources. Use 'nais secret get --with-values' to inspect secret contents.", Args: []naistrix.Argument{ - {Name: "name"}, + {Name: "name", Prompt: "Name of the application to show mounted files for"}, }, Flags: flags, RunFunc: func(ctx context.Context, args *naistrix.Arguments, out *naistrix.OutputWriter) error { diff --git a/internal/app/command/issues.go b/internal/app/command/issues.go index 9aee67d5..1d9b63c4 100644 --- a/internal/app/command/issues.go +++ b/internal/app/command/issues.go @@ -19,7 +19,7 @@ func issues(parentFlags *flag.App) *naistrix.Command { Title: "Show issues for an application.", Description: "Lists all active issues detected for a specific application, such as missing resources, configuration errors, or runtime problems.", Args: []naistrix.Argument{ - {Name: "name"}, + {Name: "name", Prompt: "Name of the application to show issues for"}, }, Flags: flags, RunFunc: func(ctx context.Context, args *naistrix.Arguments, out *naistrix.OutputWriter) error { diff --git a/internal/app/command/labels_list.go b/internal/app/command/labels_list.go index 3ee0747e..2bd554e8 100644 --- a/internal/app/command/labels_list.go +++ b/internal/app/command/labels_list.go @@ -16,7 +16,7 @@ func labelsList(parentFlags *flag.Labels) *naistrix.Command { Title: "List labels for an application.", Description: "Lists labels configured on an application in a specific environment.", Args: []naistrix.Argument{ - {Name: "name"}, + {Name: "name", Prompt: "Name of the application to list labels for"}, }, Flags: flags, RunFunc: func(ctx context.Context, args *naistrix.Arguments, out *naistrix.OutputWriter) error { diff --git a/internal/app/command/labels_set.go b/internal/app/command/labels_set.go index 48362e1f..39767651 100644 --- a/internal/app/command/labels_set.go +++ b/internal/app/command/labels_set.go @@ -18,7 +18,7 @@ func labelsSet(parentFlags *flag.Labels) *naistrix.Command { Title: "Set labels for an application.", Description: "Sets one or more labels on an application. Use --label KEY=VALUE and repeat the flag for multiple labels.", Args: []naistrix.Argument{ - {Name: "name"}, + {Name: "name", Prompt: "Name of the application to set labels for"}, }, Flags: flags, ValidateFunc: func(_ context.Context, _ *naistrix.Arguments) error { diff --git a/internal/app/command/log.go b/internal/app/command/log.go index e9637c8a..972e7eac 100644 --- a/internal/app/command/log.go +++ b/internal/app/command/log.go @@ -24,7 +24,7 @@ func log(parentFlags *flag.App) *naistrix.Command { Title: "Show logs for an application.", Description: "Fetch and stream logs from an application.", Args: []naistrix.Argument{ - {Name: "name"}, + {Name: "name", Prompt: "Name of the application to show logs for"}, }, Flags: flags, RunFunc: func(ctx context.Context, args *naistrix.Arguments, out *naistrix.OutputWriter) error { diff --git a/internal/app/command/restart.go b/internal/app/command/restart.go index 0c13f9de..67a309da 100644 --- a/internal/app/command/restart.go +++ b/internal/app/command/restart.go @@ -19,7 +19,7 @@ func restart(parentFlags *flag.App) *naistrix.Command { Description: "Triggers a rolling restart of the application.", Flags: flags, Args: []naistrix.Argument{ - {Name: "name"}, + {Name: "name", Prompt: "Name of the application to restart"}, }, RunFunc: func(ctx context.Context, args *naistrix.Arguments, out *naistrix.OutputWriter) error { name := args.Get("name") diff --git a/internal/app/command/set_env.go b/internal/app/command/set_env.go index 4860b1cd..53ddde3e 100644 --- a/internal/app/command/set_env.go +++ b/internal/app/command/set_env.go @@ -33,8 +33,8 @@ func setEnv(parentFlags *flag.App) *naistrix.Command { }, }, Args: []naistrix.Argument{ - {Name: "name"}, - {Name: "env_vars", Repeatable: true}, + {Name: "name", Prompt: "Name of the application to update environment variables for"}, + {Name: "env_vars", Prompt: "Environment variable to set (KEY=VALUE) or remove (KEY-)", Repeatable: true}, }, Flags: flags, ValidateFunc: func(_ context.Context, args *naistrix.Arguments) error { diff --git a/internal/app/command/set_image.go b/internal/app/command/set_image.go index f71473e9..091be78d 100644 --- a/internal/app/command/set_image.go +++ b/internal/app/command/set_image.go @@ -47,7 +47,7 @@ func setImage(parentFlags *flag.App) *naistrix.Command { }, }, Args: []naistrix.Argument{ - {Name: "name"}, + {Name: "name", Prompt: "Name of the application to change the image for"}, }, Flags: flags, AutoCompleteFunc: autoCompleteAppNames(parentFlags), diff --git a/internal/app/command/set_replicas.go b/internal/app/command/set_replicas.go index e9cd8504..98c92d88 100644 --- a/internal/app/command/set_replicas.go +++ b/internal/app/command/set_replicas.go @@ -26,7 +26,7 @@ func setReplicas(parentFlags *flag.App) *naistrix.Command { }, }, Args: []naistrix.Argument{ - {Name: "name"}, + {Name: "name", Prompt: "Name of the application to scale"}, }, Flags: flags, ValidateFunc: func(_ context.Context, _ *naistrix.Arguments) error { diff --git a/internal/app/command/status.go b/internal/app/command/status.go index a09981c5..b47ef327 100644 --- a/internal/app/command/status.go +++ b/internal/app/command/status.go @@ -21,7 +21,7 @@ func status(parentFlags *flag.App) *naistrix.Command { Title: "Show instance status for an application.", Description: "Shows instance groups and their instances with current status, image, and restart counts. During rolling updates, both current and incoming groups are shown.", Args: []naistrix.Argument{ - {Name: "name"}, + {Name: "name", Prompt: "Name of the application to show instance status for"}, }, Flags: flags, RunFunc: func(ctx context.Context, args *naistrix.Arguments, out *naistrix.OutputWriter) error { diff --git a/internal/app/command/stop.go b/internal/app/command/stop.go index 13d0da0e..8c905d0c 100644 --- a/internal/app/command/stop.go +++ b/internal/app/command/stop.go @@ -21,7 +21,7 @@ func stop(parentFlags *flag.App) *naistrix.Command { Description: "Stops an application by setting replicas to 0. Changes are temporary and will be overwritten on next deploy.", Flags: flags, Args: []naistrix.Argument{ - {Name: "name"}, + {Name: "name", Prompt: "Name of the application to stop"}, }, ValidateFunc: func(_ context.Context, _ *naistrix.Arguments) error { if flags.Environment == "" { diff --git a/internal/app/files.go b/internal/app/files.go index d315523d..8255f11d 100644 --- a/internal/app/files.go +++ b/internal/app/files.go @@ -98,13 +98,3 @@ func GetApplicationFiles(ctx context.Context, slug, name, env string) ([]Mounted } return ret, nil } - -// HasSecretFiles returns true if any mounted file comes from a Secret source. -func HasSecretFiles(files []MountedFile) bool { - for _, f := range files { - if f.Source.Kind == "SECRET" { - return true - } - } - return false -} diff --git a/internal/application/application_test.go b/internal/application/application_test.go index b1a724b6..b7999615 100644 --- a/internal/application/application_test.go +++ b/internal/application/application_test.go @@ -23,6 +23,27 @@ func TestHelpForAllCommands(t *testing.T) { } } +func TestAllArgumentsHavePrompts(t *testing.T) { + app, _, err := New(io.Discard) + if err != nil { + t.Fatalf("unable to create application: %v", err) + } + + var checkCommands func([]*naistrix.Command, string) + checkCommands = func(commands []*naistrix.Command, parent string) { + for _, cmd := range commands { + path := parent + " " + cmd.Name + for _, arg := range cmd.Args { + if strings.TrimSpace(arg.Prompt) == "" { + t.Errorf("command %q argument %q is missing a prompt", path, arg.Name) + } + } + checkCommands(cmd.SubCommands, path) + } + } + checkCommands(app.Commands, "nais") +} + func runCommand(t *testing.T, ctx context.Context, app *naistrix.Application, cmd *naistrix.Command, parentCommands []string) { t.Helper() diff --git a/internal/apply/command/apply.go b/internal/apply/command/apply.go index 6e0959e5..dd54ed7b 100644 --- a/internal/apply/command/apply.go +++ b/internal/apply/command/apply.go @@ -33,7 +33,7 @@ func Apply(parentFlags *flags.GlobalFlags) *naistrix.Command { }, }, Args: []naistrix.Argument{ - {Name: "path"}, + {Name: "path", Prompt: "Path to a Nais manifest file or directory to apply"}, }, AutoCompleteExtensions: []string{"yaml", "yml"}, Flags: flags, diff --git a/internal/cloudsql/command/enable_audit.go b/internal/cloudsql/command/enable_audit.go index 3240f624..c90b578f 100644 --- a/internal/cloudsql/command/enable_audit.go +++ b/internal/cloudsql/command/enable_audit.go @@ -17,7 +17,7 @@ func enableAuditCommand(parentFlags *flag.CloudSQL) *naistrix.Command { Title: "Enable audit extension in SQL instance database.", Description: "This is done by creating pgaudit extension in the database and enabling audit logging for personal user accounts.", Args: []naistrix.Argument{ - {Name: "app_name"}, + {Name: "app_name", Prompt: "Name of the application whose Cloud SQL database should have auditing enabled"}, }, Flags: flags, ValidateFunc: validation.RequireTeamAndEnvironment(flags), diff --git a/internal/cloudsql/command/grant.go b/internal/cloudsql/command/grant.go index 0b62de5a..87f2eac4 100644 --- a/internal/cloudsql/command/grant.go +++ b/internal/cloudsql/command/grant.go @@ -21,7 +21,7 @@ func grantCommand(parentFlags *flag.CloudSQL) *naistrix.Command { Not needed if you are a member of a Cloud SQL IAM group on the instance; use prepare --group to grant access to the group instead. `), Args: []naistrix.Argument{ - {Name: "app_name"}, + {Name: "app_name", Prompt: "Name of the application whose Cloud SQL database you need access to"}, }, Flags: flags, ValidateFunc: validation.RequireTeamAndEnvironment(flags), diff --git a/internal/cloudsql/command/password.go b/internal/cloudsql/command/password.go index 6644f1bf..2b095fa8 100644 --- a/internal/cloudsql/command/password.go +++ b/internal/cloudsql/command/password.go @@ -22,7 +22,7 @@ func passwordCommand(parentFlags *flag.CloudSQL) *naistrix.Command { Title: "Rotate the SQL instance password.", Description: "The rotation is done in GCP and in the Kubernetes secret.", Args: []naistrix.Argument{ - {Name: "app_name"}, + {Name: "app_name", Prompt: "Name of the application whose Cloud SQL password should be rotated"}, }, ValidateFunc: validation.RequireTeamAndEnvironment(flags), RunFunc: func(ctx context.Context, args *naistrix.Arguments, out *naistrix.OutputWriter) error { diff --git a/internal/cloudsql/command/prepare.go b/internal/cloudsql/command/prepare.go index 1b45f3d9..c1d999a9 100644 --- a/internal/cloudsql/command/prepare.go +++ b/internal/cloudsql/command/prepare.go @@ -29,7 +29,7 @@ func prepareCommand(parentFlags *flag.CloudSQL) *naistrix.Command { Group membership determines who inherits the group's database privileges. `), Args: []naistrix.Argument{ - {Name: "app_name"}, + {Name: "app_name", Prompt: "Name of the application whose Cloud SQL database should have access prepared"}, }, Flags: flags, ValidateFunc: validation.RequireTeamAndEnvironment(flags), diff --git a/internal/cloudsql/command/proxy.go b/internal/cloudsql/command/proxy.go index 44a57d97..61199f15 100644 --- a/internal/cloudsql/command/proxy.go +++ b/internal/cloudsql/command/proxy.go @@ -20,7 +20,7 @@ func proxyCommand(parentFlags *flag.CloudSQL) *naistrix.Command { Title: "Create a proxy to a SQL instance.", Description: "Allows your user to connect to databases and starts a proxy.", Args: []naistrix.Argument{ - {Name: "app_name"}, + {Name: "app_name", Prompt: "Name of the application whose Cloud SQL instance you want to proxy"}, }, Flags: flags, ValidateFunc: validation.RequireTeamAndEnvironment(flags), diff --git a/internal/cloudsql/command/psql.go b/internal/cloudsql/command/psql.go index ea6c41ab..04ac317c 100644 --- a/internal/cloudsql/command/psql.go +++ b/internal/cloudsql/command/psql.go @@ -16,7 +16,7 @@ func psqlCommand(parentFlags *flag.CloudSQL) *naistrix.Command { Title: "Connect to the database using psql.", Description: "Create a shell to the SQL instance by opening a proxy on a random port (see the proxy command for more info) and opening a psql shell.", Args: []naistrix.Argument{ - {Name: "app_name"}, + {Name: "app_name", Prompt: "Name of the application whose Cloud SQL database you want to connect to"}, }, Flags: flags, ValidateFunc: validation.RequireTeamAndEnvironment(flags), diff --git a/internal/cloudsql/command/revoke.go b/internal/cloudsql/command/revoke.go index e282575a..6210199c 100644 --- a/internal/cloudsql/command/revoke.go +++ b/internal/cloudsql/command/revoke.go @@ -26,7 +26,7 @@ func revokeCommand(parentFlags *flag.CloudSQL) *naistrix.Command { This uses the application credentials and affects tables, sequences and default privileges in the chosen schema. `), Args: []naistrix.Argument{ - {Name: "app_name"}, + {Name: "app_name", Prompt: "Name of the application whose Cloud SQL database access should be revoked"}, }, Flags: flags, ValidateFunc: validation.RequireTeamAndEnvironment(flags), diff --git a/internal/cloudsql/command/users.go b/internal/cloudsql/command/users.go index c09e3cac..1d086515 100644 --- a/internal/cloudsql/command/users.go +++ b/internal/cloudsql/command/users.go @@ -35,9 +35,9 @@ func addCommand(parentFlags *flag.User) *naistrix.Command { Title: "Add a user to a SQL instance.", Description: "Will grant a user access to tables in public schema.", Args: []naistrix.Argument{ - {Name: "app_name"}, - {Name: "username"}, - {Name: "password"}, + {Name: "app_name", Prompt: "Name of the application whose Cloud SQL database should have a user added"}, + {Name: "username", Prompt: "Username of the new database user"}, + {Name: "password", Prompt: "Password for the new database user"}, }, Flags: flags, RunFunc: func(ctx context.Context, args *naistrix.Arguments, out *naistrix.OutputWriter) error { @@ -53,7 +53,7 @@ func listUsersCommand(parentFlags *flag.User) *naistrix.Command { Title: "List users in a SQL instance database.", Description: "List all users in a Cloud SQL instance database for a given application.", Args: []naistrix.Argument{ - {Name: "app_name"}, + {Name: "app_name", Prompt: "Name of the application whose Cloud SQL database users you want to list"}, }, Flags: flags, RunFunc: func(ctx context.Context, args *naistrix.Arguments, out *naistrix.OutputWriter) error { @@ -69,8 +69,8 @@ func dropCommand(parentFlags *flag.User) *naistrix.Command { Title: "Drop a user from a SQL instance database.", Description: "Remove a user from a Cloud SQL instance database.", Args: []naistrix.Argument{ - {Name: "app_name"}, - {Name: "username"}, + {Name: "app_name", Prompt: "Name of the application whose Cloud SQL database should have a user removed"}, + {Name: "username", Prompt: "Username of the database user to remove"}, }, Flags: flags, RunFunc: func(ctx context.Context, args *naistrix.Arguments, out *naistrix.OutputWriter) error { diff --git a/internal/cloudsql/command/verify_audit.go b/internal/cloudsql/command/verify_audit.go index de9f7613..3c847589 100644 --- a/internal/cloudsql/command/verify_audit.go +++ b/internal/cloudsql/command/verify_audit.go @@ -17,7 +17,7 @@ func verifyAuditCommand(parentFlags *flag.CloudSQL) *naistrix.Command { Title: "Verify audit extension and configuration in SQL instance database.", Description: "This verifies that the pgaudit extension is installed and that audit logging is properly configured for the application user.", Args: []naistrix.Argument{ - {Name: "app_name"}, + {Name: "app_name", Prompt: "Name of the application whose Cloud SQL audit configuration you want to verify"}, }, Flags: flags, ValidateFunc: validation.RequireTeamAndEnvironment(flags), diff --git a/internal/config/command/command.go b/internal/config/command/command.go index 8cade793..b89b11ee 100644 --- a/internal/config/command/command.go +++ b/internal/config/command/command.go @@ -34,7 +34,7 @@ func Config(parentFlags *flags.GlobalFlags) *naistrix.Command { } var defaultArgs = []naistrix.Argument{ - {Name: "name"}, + {Name: "name", Prompt: "Name of the config"}, } func validateArgs(_ context.Context, args *naistrix.Arguments) error { diff --git a/internal/debug/command/debug.go b/internal/debug/command/debug.go index 26eaf845..617bd013 100644 --- a/internal/debug/command/debug.go +++ b/internal/debug/command/debug.go @@ -24,7 +24,7 @@ func Debug(parentFlags *flags.GlobalFlags) *naistrix.Command { You can only reconnect to the debug session if the pod is running. `), Args: []naistrix.Argument{ - {Name: "app_name"}, + {Name: "app_name", Prompt: "Name of the application to debug"}, }, Flags: debugFlags, ValidateFunc: validation.RequireTeamAndEnvironment(debugFlags), diff --git a/internal/job/command/activity.go b/internal/job/command/activity.go index 62d0aa79..da5714f1 100644 --- a/internal/job/command/activity.go +++ b/internal/job/command/activity.go @@ -21,7 +21,7 @@ func activity(parentFlags *flag.Job) *naistrix.Command { Title: "Show activity for a job.", Description: "Displays recent events for a specific job, such as triggers, completions, and failures.", Args: []naistrix.Argument{ - {Name: "name"}, + {Name: "name", Prompt: "Name of the job to show activity for"}, }, Flags: flags, RunFunc: func(ctx context.Context, args *naistrix.Arguments, out *naistrix.OutputWriter) error { diff --git a/internal/job/command/issues.go b/internal/job/command/issues.go index 980f4623..50452254 100644 --- a/internal/job/command/issues.go +++ b/internal/job/command/issues.go @@ -17,7 +17,7 @@ func issues(parentFlags *flag.Job) *naistrix.Command { Title: "Show issues for a job.", Description: "Lists all active issues detected for a specific job, such as failed runs, configuration errors, or runtime problems.", Args: []naistrix.Argument{ - {Name: "name"}, + {Name: "name", Prompt: "Name of the job to show issues for"}, }, Flags: flags, RunFunc: func(ctx context.Context, args *naistrix.Arguments, out *naistrix.OutputWriter) error { diff --git a/internal/job/command/log.go b/internal/job/command/log.go index 91e5819f..fc383339 100644 --- a/internal/job/command/log.go +++ b/internal/job/command/log.go @@ -29,7 +29,7 @@ func log(parentFlags *flag.Job) *naistrix.Command { Title: "Show logs for a job.", Description: "Fetch and stream logs from a job.", Args: []naistrix.Argument{ - {Name: "name"}, + {Name: "name", Prompt: "Name of the job to show logs for"}, }, Flags: flags, ValidateFunc: func(_ context.Context, args *naistrix.Arguments) error { diff --git a/internal/job/command/run_delete.go b/internal/job/command/run_delete.go index eebd088f..14f78e1d 100644 --- a/internal/job/command/run_delete.go +++ b/internal/job/command/run_delete.go @@ -17,7 +17,7 @@ func deleteRun(parentFlags *flag.Job) *naistrix.Command { Title: "Delete a job run.", Description: "This command deletes an individual job run (a Kubernetes batch/v1 Job).", Args: []naistrix.Argument{ - {Name: "run-name"}, + {Name: "run-name", Prompt: "Name of the job run to delete"}, }, Flags: flags, AutoCompleteFunc: func(ctx context.Context, args *naistrix.Arguments, _ string) ([]string, string) { diff --git a/internal/job/command/run_list.go b/internal/job/command/run_list.go index fc9a3fc8..4d39c294 100644 --- a/internal/job/command/run_list.go +++ b/internal/job/command/run_list.go @@ -18,7 +18,7 @@ func listRuns(parentFlags *flag.Job) *naistrix.Command { Title: "List runs for a job.", Description: "This command lists all runs for a specific job in a given environment.", Args: []naistrix.Argument{ - {Name: "job-name"}, + {Name: "job-name", Prompt: "Name of the job to list runs for"}, }, Flags: flags, AutoCompleteFunc: autoCompleteJobNames(parentFlags), diff --git a/internal/job/command/set_env.go b/internal/job/command/set_env.go index fee3fc3d..135fd763 100644 --- a/internal/job/command/set_env.go +++ b/internal/job/command/set_env.go @@ -33,8 +33,8 @@ func setEnv(parentFlags *flag.Job) *naistrix.Command { }, }, Args: []naistrix.Argument{ - {Name: "name"}, - {Name: "env_vars", Repeatable: true}, + {Name: "name", Prompt: "Name of the job to update environment variables for"}, + {Name: "env_vars", Prompt: "Environment variable to set (KEY=VALUE) or remove (KEY-)", Repeatable: true}, }, Flags: flags, ValidateFunc: func(_ context.Context, args *naistrix.Arguments) error { diff --git a/internal/job/command/trigger.go b/internal/job/command/trigger.go index e463e4c0..146224b5 100644 --- a/internal/job/command/trigger.go +++ b/internal/job/command/trigger.go @@ -17,7 +17,7 @@ func trigger(parentFlags *flag.Job) *naistrix.Command { Title: "Trigger a job manually.", Description: "Creates a new run of the specified job outside of its normal schedule. Requires exactly one environment to be specified.", Args: []naistrix.Argument{ - {Name: "name"}, + {Name: "name", Prompt: "Name of the job to trigger"}, }, Flags: flags, ValidateFunc: func(context.Context, *naistrix.Arguments) error { diff --git a/internal/kafka/command/flag/flag.go b/internal/kafka/command/flag/flag.go index c26bcf9c..8af04b2e 100644 --- a/internal/kafka/command/flag/flag.go +++ b/internal/kafka/command/flag/flag.go @@ -7,6 +7,7 @@ import ( "github.com/nais/cli/internal/flags" "github.com/nais/cli/internal/labels" + "github.com/nais/cli/internal/naisapi/gql" "github.com/nais/naistrix" ) @@ -31,11 +32,20 @@ func (o *CredentialsOutput) AutoComplete(context.Context, *naistrix.Arguments, s } func (a *KafkaTopicGrantAccess) AutoComplete(context.Context, *naistrix.Arguments, string, any) ([]string, string) { - return []string{"read", "write", "readwrite"}, "Available access levels." + return KafkaTopicGrantAccessChoices(), "Available access levels." +} + +// KafkaTopicGrantAccessChoices returns the GraphQL access levels in their CLI lowercase form. +func KafkaTopicGrantAccessChoices() []string { + choices := make([]string, len(gql.AllKafkaTopicGrantAccess)) + for i, access := range gql.AllKafkaTopicGrantAccess { + choices[i] = strings.ToLower(string(access)) + } + return choices } func (a KafkaTopicGrantAccess) Validate() error { - valid := []string{"read", "write", "readwrite"} + valid := KafkaTopicGrantAccessChoices() if a == "" { return naistrix.Errorf("access level is required, must be one of: %s", strings.Join(valid, ", ")) } diff --git a/internal/kafka/command/grant_access.go b/internal/kafka/command/grant_access.go index b61422c7..b372de33 100644 --- a/internal/kafka/command/grant_access.go +++ b/internal/kafka/command/grant_access.go @@ -22,8 +22,8 @@ func grantAccess(parentFlags *flag.Kafka) *naistrix.Command { Description: "It adds an ACL entry for a user on a Kafka Topic with the specified access level.", Flags: grantAccessTopicFlags, Args: []naistrix.Argument{ - {Name: "username"}, - {Name: "topic"}, + {Name: "username", Prompt: "Name of the Kafka service user to grant access to"}, + {Name: "topic", Prompt: "Name of the Kafka topic to grant access to"}, }, ValidateFunc: naistrix.ValidateFuncs( validation.RequireTeamAndEnvironment(grantAccessTopicFlags), diff --git a/internal/kafka/command/list_grants.go b/internal/kafka/command/list_grants.go index 648f3550..197af882 100644 --- a/internal/kafka/command/list_grants.go +++ b/internal/kafka/command/list_grants.go @@ -19,7 +19,7 @@ func listGrants(parentFlags *flag.Kafka) *naistrix.Command { Description: "Shows the workloads that have been granted access to a Kafka topic.", Flags: flags, Args: []naistrix.Argument{ - {Name: "topic"}, + {Name: "topic", Prompt: "Name of the Kafka topic to list grants for"}, }, ValidateFunc: validation.RequireTeamAndEnvironment(flags), AutoCompleteFunc: autoCompleteKafkaTopicName(flags.Kafka, 0), diff --git a/internal/kafka/command/list_grants_test.go b/internal/kafka/command/list_grants_test.go index 1a947352..51e3ef9a 100644 --- a/internal/kafka/command/list_grants_test.go +++ b/internal/kafka/command/list_grants_test.go @@ -1,11 +1,32 @@ package command import ( + "slices" "testing" "github.com/nais/cli/internal/kafka/command/flag" ) +func TestRevokeGrantArgumentChoices(t *testing.T) { + cmd := revokeGrant(&flag.Kafka{}) + if got, want := cmd.Args[2].Choices, []string{"read", "write", "readwrite"}; !slices.Equal(got, want) { + t.Errorf("access choices = %v, want %v", got, want) + } + if !cmd.Args[2].ChoicesCaseInsensitive { + t.Error("access choices must be case-insensitive") + } + for _, choice := range cmd.Args[2].Choices { + if err := flag.KafkaTopicGrantAccess(choice).Validate(); err != nil { + t.Errorf("access choice %q is invalid: %v", choice, err) + } + } + for _, arg := range cmd.Args[:2] { + if len(arg.Choices) != 0 { + t.Errorf("%s must not have static choices", arg.Name) + } + } +} + func TestKafkaTopicGrantAccessValidate(t *testing.T) { for _, access := range []flag.KafkaTopicGrantAccess{"", "admin", "read"} { err := access.Validate() diff --git a/internal/kafka/command/revoke_grant.go b/internal/kafka/command/revoke_grant.go index 7b0ab458..a476372a 100644 --- a/internal/kafka/command/revoke_grant.go +++ b/internal/kafka/command/revoke_grant.go @@ -18,9 +18,9 @@ func revokeGrant(parentFlags *flag.Kafka) *naistrix.Command { Title: "Revoke a user's service-user access to a Kafka topic.", Description: "Removes an ACL entry for a user on a Kafka topic with the specified access level.", Args: []naistrix.Argument{ - {Name: "username"}, - {Name: "topic"}, - {Name: "access"}, + {Name: "username", Prompt: "Name of the Kafka service user to revoke access from"}, + {Name: "topic", Prompt: "Name of the Kafka topic to revoke access to"}, + {Name: "access", Prompt: "Access level to revoke", Choices: flag.KafkaTopicGrantAccessChoices(), ChoicesCaseInsensitive: true}, }, ValidateFunc: naistrix.ValidateFuncs( validation.RequireTeamAndEnvironment(parentFlags), diff --git a/internal/kubeconfig/gcpcluster.go b/internal/kubeconfig/gcpcluster.go index 760e280c..bbe99524 100644 --- a/internal/kubeconfig/gcpcluster.go +++ b/internal/kubeconfig/gcpcluster.go @@ -81,8 +81,7 @@ func getGCPClusters(ctx context.Context, project project, options filterOptions, call := svc.Projects.Locations.Clusters.List("projects/" + project.ID + "/locations/-") response, err := call.Do() if err != nil { - var googleErr *googleapi.Error - if errors.As(err, &googleErr) { + if googleErr, ok := errors.AsType[*googleapi.Error](err); ok { if googleErr.Code == http.StatusForbidden { if options.verbose { out.Printf("No access to project %s, skipping\n", project.ID) diff --git a/internal/member/command/add.go b/internal/member/command/add.go index 10bb4fa4..d9ba4736 100644 --- a/internal/member/command/add.go +++ b/internal/member/command/add.go @@ -33,7 +33,7 @@ func add(parentFlags *flag.Member) *naistrix.Command { }, }, Args: []naistrix.Argument{ - {Name: "member"}, + {Name: "member", Prompt: "Email address of the user to add to the team"}, }, Flags: flags, RunFunc: func(ctx context.Context, args *naistrix.Arguments, out *naistrix.OutputWriter) error { diff --git a/internal/member/command/remove.go b/internal/member/command/remove.go index e6a6b02b..6b6f4716 100644 --- a/internal/member/command/remove.go +++ b/internal/member/command/remove.go @@ -24,7 +24,7 @@ func remove(parentFlags *flag.Member) *naistrix.Command { }, }, Args: []naistrix.Argument{ - {Name: "member"}, + {Name: "member", Prompt: "Email address of the user to remove from the team"}, }, Flags: flags, RunFunc: func(ctx context.Context, args *naistrix.Arguments, out *naistrix.OutputWriter) error { diff --git a/internal/member/command/setrole.go b/internal/member/command/setrole.go index b13037ed..2fcbf917 100644 --- a/internal/member/command/setrole.go +++ b/internal/member/command/setrole.go @@ -2,6 +2,7 @@ package command import ( "context" + "strings" "github.com/nais/cli/internal/member" "github.com/nais/cli/internal/member/command/flag" @@ -21,20 +22,21 @@ func setRole(parentFlags *flag.Member) *naistrix.Command { Examples: []naistrix.Example{ { Description: "Assign some-user@example.com as owner.", - Command: "OWNER some-user@example.com", + Command: "owner some-user@example.com", }, { Description: "Assign some-user@example.com as member.", - Command: "MEMBER some-user@example.com", + Command: "member some-user@example.com", }, }, Args: []naistrix.Argument{ - {Name: "role"}, - {Name: "member"}, + {Name: "role", Prompt: "Role to assign to the team member", Choices: teamMemberRoleChoices(), ChoicesCaseInsensitive: true}, + {Name: "member", Prompt: "Email address of the team member to assign the role to"}, }, Flags: flags, RunFunc: func(ctx context.Context, args *naistrix.Arguments, out *naistrix.OutputWriter) error { - if err := member.SetRole(ctx, flags.Team, args.Get("member"), gql.TeamMemberRole(args.Get("role"))); err != nil { + role := gql.TeamMemberRole(strings.ToUpper(args.Get("role"))) + if err := member.SetRole(ctx, flags.Team, args.Get("member"), role); err != nil { return naistrix.Errorf("Unable to set role %q for member %q in team %q\n\n%s", args.Get("role"), args.Get("member"), flags.Team, err) } @@ -43,7 +45,7 @@ func setRole(parentFlags *flag.Member) *naistrix.Command { }, AutoCompleteFunc: func(ctx context.Context, args *naistrix.Arguments, toComplete string) ([]string, string) { if args.Len() == 0 { - return toStrings(gql.AllTeamMemberRole), "Choose the role to assign to the team member." + return teamMemberRoleChoices(), "Choose the role to assign to the team member." } if args.Len() == 1 { @@ -65,10 +67,10 @@ func setRole(parentFlags *flag.Member) *naistrix.Command { } } -func toStrings[T ~string](in []T) []string { - ret := make([]string, len(in)) - for i, s := range in { - ret[i] = string(s) +func teamMemberRoleChoices() []string { + ret := make([]string, len(gql.AllTeamMemberRole)) + for i, role := range gql.AllTeamMemberRole { + ret[i] = strings.ToLower(string(role)) } return ret } diff --git a/internal/member/command/setrole_test.go b/internal/member/command/setrole_test.go new file mode 100644 index 00000000..d2aa6608 --- /dev/null +++ b/internal/member/command/setrole_test.go @@ -0,0 +1,56 @@ +package command + +import ( + "context" + "slices" + "strings" + "testing" + + "github.com/nais/cli/internal/member/command/flag" + "github.com/nais/naistrix" +) + +func TestSetRoleArgumentChoices(t *testing.T) { + cmd := setRole(&flag.Member{}) + if got, want := cmd.Args[0].Choices, []string{"member", "owner"}; !slices.Equal(got, want) { + t.Errorf("role choices = %v, want %v", got, want) + } + if len(cmd.Args[1].Choices) != 0 { + t.Error("member emails must not have static choices") + } +} + +func TestSetRoleAcceptsCaseInsensitiveRoles(t *testing.T) { + for _, role := range []string{"member", "MEMBER", "Member", "owner", "OWNER", "Owner"} { + t.Run(role, func(t *testing.T) { + cmd := setRole(&flag.Member{}) + cmd.Flags = nil + var got string + cmd.RunFunc = func(_ context.Context, args *naistrix.Arguments, _ *naistrix.OutputWriter) error { + got = args.Get("role") + return nil + } + app, _, err := naistrix.NewApplication("test", "Test", "v0.0.0") + if err != nil { + t.Fatal(err) + } + if err := app.AddCommand(cmd); err != nil { + t.Fatal(err) + } + if err := app.Run(naistrix.RunWithArgs([]string{"set-role", role, "user@example.com"})); err != nil { + t.Fatal(err) + } + if want := strings.ToLower(role); got != want { + t.Errorf("role = %q, want %q", got, want) + } + }) + } +} + +func TestSetRoleCompletionMatchesChoices(t *testing.T) { + cmd := setRole(&flag.Member{}) + got, _ := cmd.AutoCompleteFunc(context.Background(), &naistrix.Arguments{}, "") + if !slices.Equal(got, cmd.Args[0].Choices) { + t.Errorf("role completions = %v, want %v", got, cmd.Args[0].Choices) + } +} diff --git a/internal/naisapi/gql/generated.go b/internal/naisapi/gql/generated.go index 8d18b6f6..b2c3541f 100644 --- a/internal/naisapi/gql/generated.go +++ b/internal/naisapi/gql/generated.go @@ -17,6 +17,7 @@ import ( // // Result of requesting activation; compare desiredActiveBranch to activeBranch while reconciling. type ActivatePostgresBranchActivatePostgresBranchActivatePostgresBranchPayload struct { + // Postgres with desired and observed branch selection. Postgres ActivatePostgresBranchActivatePostgresBranchActivatePostgresBranchPayloadPostgres `json:"postgres"` } @@ -60,12 +61,16 @@ func (v *ActivatePostgresBranchActivatePostgresBranchActivatePostgresBranchPaylo return v.Name } -// Select an available branch for normal workloads. +// Request a branch for normal workloads; pgrator activates it once its cluster is ready. type ActivatePostgresBranchInput struct { - Postgres string `json:"postgres"` - Branch string `json:"branch"` + // Request a branch for normal workloads; pgrator activates it once its cluster is ready. + Postgres string `json:"postgres"` + // Request a branch for normal workloads; pgrator activates it once its cluster is ready. + Branch string `json:"branch"` + // Request a branch for normal workloads; pgrator activates it once its cluster is ready. EnvironmentName string `json:"environmentName"` - TeamSlug string `json:"teamSlug"` + // Request a branch for normal workloads; pgrator activates it once its cluster is ready. + TeamSlug string `json:"teamSlug"` } // GetPostgres returns ActivatePostgresBranchInput.Postgres, and is useful for accessing the field via an interface. @@ -138,6 +143,10 @@ const ( ActivityLogActivityTypeOpensearchMaintenanceStarted ActivityLogActivityType = "OPENSEARCH_MAINTENANCE_STARTED" // Filter for credential creation events. ActivityLogActivityTypeOpensearchCredentialsCreated ActivityLogActivityType = "OPENSEARCH_CREDENTIALS_CREATED" + // A Postgres was created + ActivityLogActivityTypePostgresCreated ActivityLogActivityType = "POSTGRES_CREATED" + // A Postgres was updated + ActivityLogActivityTypePostgresUpdated ActivityLogActivityType = "POSTGRES_UPDATED" // A user was granted access to a Postgres cluster ActivityLogActivityTypePostgresGrantAccess ActivityLogActivityType = "POSTGRES_GRANT_ACCESS" // A personal Postgres access was created through the API broker @@ -146,10 +155,8 @@ const ( ActivityLogActivityTypePostgresPersonalAccessConnection ActivityLogActivityType = "POSTGRES_PERSONAL_ACCESS_CONNECTION" // A Postgres branch was deleted (historical entries without branch name) ActivityLogActivityTypePostgresDeleted ActivityLogActivityType = "POSTGRES_DELETED" - // A Postgres was created - ActivityLogActivityTypePostgresCreated ActivityLogActivityType = "POSTGRES_CREATED" - // A Postgres was updated - ActivityLogActivityTypePostgresUpdated ActivityLogActivityType = "POSTGRES_UPDATED" + // A request to delete a whole Postgres was accepted; cleanup continues asynchronously. + ActivityLogActivityTypePostgresDeletionRequested ActivityLogActivityType = "POSTGRES_DELETION_REQUESTED" // A Postgres branch was created. ActivityLogActivityTypePostgresBranchCreated ActivityLogActivityType = "POSTGRES_BRANCH_CREATED" // A Postgres branch was activated. @@ -263,12 +270,13 @@ var AllActivityLogActivityType = []ActivityLogActivityType{ ActivityLogActivityTypeOpensearchDeleted, ActivityLogActivityTypeOpensearchMaintenanceStarted, ActivityLogActivityTypeOpensearchCredentialsCreated, + ActivityLogActivityTypePostgresCreated, + ActivityLogActivityTypePostgresUpdated, ActivityLogActivityTypePostgresGrantAccess, ActivityLogActivityTypePostgresPersonalAccessCreated, ActivityLogActivityTypePostgresPersonalAccessConnection, ActivityLogActivityTypePostgresDeleted, - ActivityLogActivityTypePostgresCreated, - ActivityLogActivityTypePostgresUpdated, + ActivityLogActivityTypePostgresDeletionRequested, ActivityLogActivityTypePostgresBranchCreated, ActivityLogActivityTypePostgresBranchActivated, ActivityLogActivityTypePostgresBranchDeleted, @@ -823,7 +831,7 @@ func (v *ApplicationStatusTeamEnvironmentApplicationInstanceGroupsInstanceGroupI type CVEPriority string const ( - // Vulnerability is known to be actively exploited and requires immediate action. + // Requires immediate action based on workload context, including internet exposure. Not assigned to CVEs at global scope; a KEV entry alone does not imply URGENT. CVEPriorityUrgent CVEPriority = "URGENT" // Vulnerability is associated with ransomware or has a high EPSS percentile. CVEPriorityHigh CVEPriority = "HIGH" @@ -1154,19 +1162,19 @@ func (v *CreatePostgresAccessCreatePostgresAccessCreatePostgresAccessPayload) Ge // Input for creating a time-limited personal Postgres access. type CreatePostgresAccessInput struct { - // Name of the Postgres containing the branch. + // Input for creating a time-limited personal Postgres access. Postgres string `json:"postgres"` - // Local name of the branch to access. + // Input for creating a time-limited personal Postgres access. Branch string `json:"branch"` - // Team that owns the Postgres branch. + // Input for creating a time-limited personal Postgres access. TeamSlug string `json:"teamSlug"` - // Environment containing the Postgres branch. + // Input for creating a time-limited personal Postgres access. EnvironmentName string `json:"environmentName"` - // Privileges requested for the personal database role. + // Input for creating a time-limited personal Postgres access. AccessLevel PostgresAccessLevel `json:"accessLevel"` - // Reason for personal database access. Must be at least 10 characters. + // Input for creating a time-limited personal Postgres access. Reason string `json:"reason"` - // Requested access lifetime (for example '30m' or '1h'). Defaults to '1h' and cannot exceed '1h'. + // Input for creating a time-limited personal Postgres access. Ttl *string `json:"ttl"` } @@ -1209,6 +1217,7 @@ func (v *CreatePostgresAccessResponse) GetCreatePostgresAccess() CreatePostgresA // // Result of creating a branch; provisioning continues asynchronously. type CreatePostgresBranchCreatePostgresBranchCreatePostgresBranchPayload struct { + // The new branch. PostgresBranch CreatePostgresBranchCreatePostgresBranchCreatePostgresBranchPayloadPostgresBranch `json:"postgresBranch"` } @@ -1238,14 +1247,20 @@ func (v *CreatePostgresBranchCreatePostgresBranchCreatePostgresBranchPayloadPost return v.State } -// Recovery request for a new, inactive branch. +// Recovery request for a new, inactive branch. A branch cannot be re-created with different recovery settings. type CreatePostgresBranchInput struct { - Postgres string `json:"postgres"` - Branch string `json:"branch"` - SourceBranch string `json:"sourceBranch"` - TargetTime time.Time `json:"targetTime"` - EnvironmentName string `json:"environmentName"` - TeamSlug string `json:"teamSlug"` + // Recovery request for a new, inactive branch. A branch cannot be re-created with different recovery settings. + Postgres string `json:"postgres"` + // Recovery request for a new, inactive branch. A branch cannot be re-created with different recovery settings. + Branch string `json:"branch"` + // Recovery request for a new, inactive branch. A branch cannot be re-created with different recovery settings. + SourceBranch string `json:"sourceBranch"` + // Recovery request for a new, inactive branch. A branch cannot be re-created with different recovery settings. + TargetTime time.Time `json:"targetTime"` + // Recovery request for a new, inactive branch. A branch cannot be re-created with different recovery settings. + EnvironmentName string `json:"environmentName"` + // Recovery request for a new, inactive branch. A branch cannot be re-created with different recovery settings. + TeamSlug string `json:"teamSlug"` } // GetPostgres returns CreatePostgresBranchInput.Postgres, and is useful for accessing the field via an interface. @@ -1282,6 +1297,7 @@ func (v *CreatePostgresBranchResponse) GetCreatePostgresBranch() CreatePostgresB // // Result of creating a Postgres. type CreatePostgresCreatePostgresCreatePostgresPayload struct { + // The Postgres that was created. Postgres CreatePostgresCreatePostgresCreatePostgresPayloadPostgres `json:"postgres"` } @@ -1304,14 +1320,22 @@ func (v *CreatePostgresCreatePostgresCreatePostgresPayloadPostgres) GetName() st // Input for creating a Postgres. type CreatePostgresInput struct { - Name string `json:"name"` - EnvironmentName string `json:"environmentName"` - TeamSlug string `json:"teamSlug"` - MajorVersion string `json:"majorVersion"` - HighAvailability *bool `json:"highAvailability,omitempty"` - Cpu *string `json:"cpu,omitempty"` - Memory *string `json:"memory,omitempty"` - DiskSize *string `json:"diskSize,omitempty"` + // Input for creating a Postgres. + Name string `json:"name"` + // Input for creating a Postgres. + EnvironmentName string `json:"environmentName"` + // Input for creating a Postgres. + TeamSlug string `json:"teamSlug"` + // Input for creating a Postgres. + MajorVersion string `json:"majorVersion"` + // Input for creating a Postgres. + HighAvailability *bool `json:"highAvailability,omitempty"` + // Input for creating a Postgres. + Cpu *string `json:"cpu,omitempty"` + // Input for creating a Postgres. + Memory *string `json:"memory,omitempty"` + // Input for creating a Postgres. + DiskSize *string `json:"diskSize,omitempty"` } // GetName returns CreatePostgresInput.Name, and is useful for accessing the field via an interface. @@ -1478,6 +1502,7 @@ type CreateValkeyInput struct { TeamSlug string `json:"teamSlug"` Tier ValkeyTier `json:"tier"` Memory ValkeyMemory `json:"memory"` + Version ValkeyMajorVersion `json:"version"` MaxMemoryPolicy *ValkeyMaxMemoryPolicy `json:"maxMemoryPolicy,omitempty"` NotifyKeyspaceEvents *string `json:"notifyKeyspaceEvents,omitempty"` Databases *int `json:"databases,omitempty"` @@ -1499,6 +1524,9 @@ func (v *CreateValkeyInput) GetTier() ValkeyTier { return v.Tier } // GetMemory returns CreateValkeyInput.Memory, and is useful for accessing the field via an interface. func (v *CreateValkeyInput) GetMemory() ValkeyMemory { return v.Memory } +// GetVersion returns CreateValkeyInput.Version, and is useful for accessing the field via an interface. +func (v *CreateValkeyInput) GetVersion() ValkeyMajorVersion { return v.Version } + // GetMaxMemoryPolicy returns CreateValkeyInput.MaxMemoryPolicy, and is useful for accessing the field via an interface. func (v *CreateValkeyInput) GetMaxMemoryPolicy() *ValkeyMaxMemoryPolicy { return v.MaxMemoryPolicy } @@ -1618,14 +1646,10 @@ func (v *DeletePostgresBranchDeletePostgresBranchDeletePostgresBranchPayload) Ge } type DeletePostgresBranchInput struct { - // Name of the Postgres containing the branch. - Postgres string `json:"postgres"` - // Local name of the branch to delete. - Branch string `json:"branch"` - // The environment containing the PostgresBranch. + Postgres string `json:"postgres"` + Branch string `json:"branch"` EnvironmentName string `json:"environmentName"` - // The team that owns the PostgresBranch. - TeamSlug string `json:"teamSlug"` + TeamSlug string `json:"teamSlug"` } // GetPostgres returns DeletePostgresBranchInput.Postgres, and is useful for accessing the field via an interface. @@ -1656,6 +1680,7 @@ func (v *DeletePostgresBranchResponse) GetDeletePostgresBranch() DeletePostgresB // // Result of accepting a Postgres deletion request, not proof of cleanup. type DeletePostgresDeletePostgresDeletePostgresPayload struct { + // True if Kubernetes accepted the deletion request; data deletion may still be pending. DeletionRequested bool `json:"deletionRequested"` } @@ -1666,8 +1691,11 @@ func (v *DeletePostgresDeletePostgresDeletePostgresPayload) GetDeletionRequested // Select the Postgres to delete. All branches and stored data are removed asynchronously by the platform. type DeletePostgresInput struct { - Name string `json:"name"` - TeamSlug string `json:"teamSlug"` + // Select the Postgres to delete. All branches and stored data are removed asynchronously by the platform. + Name string `json:"name"` + // Select the Postgres to delete. All branches and stored data are removed asynchronously by the platform. + TeamSlug string `json:"teamSlug"` + // Select the Postgres to delete. All branches and stored data are removed asynchronously by the platform. EnvironmentName string `json:"environmentName"` } @@ -5844,7 +5872,6 @@ func (v *GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplica // GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesOpenSearchDeletedActivityLogEntry // GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesOpenSearchUpdatedActivityLogEntry // GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesPostgresBranchActivatedActivityLogEntry -// GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry // GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesPostgresBranchCreatedActivityLogEntry // GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesPostgresBranchDeletedActivityLogEntry // GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesPostgresCreatedActivityLogEntry @@ -5970,8 +5997,6 @@ func (v *GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplica } func (v *GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesPostgresBranchActivatedActivityLogEntry) implementsGraphQLInterfaceGetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesActivityLogEntry() { } -func (v *GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) implementsGraphQLInterfaceGetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesActivityLogEntry() { -} func (v *GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesPostgresBranchCreatedActivityLogEntry) implementsGraphQLInterfaceGetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesActivityLogEntry() { } func (v *GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesPostgresBranchDeletedActivityLogEntry) implementsGraphQLInterfaceGetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesActivityLogEntry() { @@ -6156,9 +6181,6 @@ func __unmarshalGetApplicationActivityTeamApplicationsApplicationConnectionNodes case "PostgresBranchActivatedActivityLogEntry": *v = new(GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesPostgresBranchActivatedActivityLogEntry) return json.Unmarshal(b, *v) - case "PostgresBranchActivityLogEntry": - *v = new(GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) - return json.Unmarshal(b, *v) case "PostgresBranchCreatedActivityLogEntry": *v = new(GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesPostgresBranchCreatedActivityLogEntry) return json.Unmarshal(b, *v) @@ -6506,14 +6528,6 @@ func __marshalGetApplicationActivityTeamApplicationsApplicationConnectionNodesAp *GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesPostgresBranchActivatedActivityLogEntry }{typename, v} return json.Marshal(result) - case *GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry: - typename = "PostgresBranchActivityLogEntry" - - result := struct { - TypeName string `json:"__typename"` - *GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry - }{typename, v} - return json.Marshal(result) case *GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesPostgresBranchCreatedActivityLogEntry: typename = "PostgresBranchCreatedActivityLogEntry" @@ -7809,44 +7823,6 @@ func (v *GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplica return v.EnvironmentName } -// GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry includes the requested fields of the GraphQL type PostgresBranchActivityLogEntry. -type GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry struct { - Typename *string `json:"__typename"` - // Interface for activity log entries. - Actor string `json:"actor"` - // Interface for activity log entries. - CreatedAt time.Time `json:"createdAt"` - // Interface for activity log entries. - Message string `json:"message"` - // Interface for activity log entries. - EnvironmentName *string `json:"environmentName"` -} - -// GetTypename returns GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry.Typename, and is useful for accessing the field via an interface. -func (v *GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) GetTypename() *string { - return v.Typename -} - -// GetActor returns GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry.Actor, and is useful for accessing the field via an interface. -func (v *GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) GetActor() string { - return v.Actor -} - -// GetCreatedAt returns GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry.CreatedAt, and is useful for accessing the field via an interface. -func (v *GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) GetCreatedAt() time.Time { - return v.CreatedAt -} - -// GetMessage returns GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry.Message, and is useful for accessing the field via an interface. -func (v *GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) GetMessage() string { - return v.Message -} - -// GetEnvironmentName returns GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry.EnvironmentName, and is useful for accessing the field via an interface. -func (v *GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) GetEnvironmentName() *string { - return v.EnvironmentName -} - // GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesPostgresBranchCreatedActivityLogEntry includes the requested fields of the GraphQL type PostgresBranchCreatedActivityLogEntry. // The GraphQL type's documentation follows. // @@ -7930,6 +7906,9 @@ func (v *GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplica } // GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesPostgresCreatedActivityLogEntry includes the requested fields of the GraphQL type PostgresCreatedActivityLogEntry. +// The GraphQL type's documentation follows. +// +// Activity log entry for a Postgres that was created. type GetApplicationActivityTeamApplicationsApplicationConnectionNodesApplicationActivityLogActivityLogEntryConnectionNodesPostgresCreatedActivityLogEntry struct { Typename *string `json:"__typename"` // Interface for activity log entries. @@ -11602,7 +11581,6 @@ func (v *GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActiv // GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesOpenSearchDeletedActivityLogEntry // GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesOpenSearchUpdatedActivityLogEntry // GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesPostgresBranchActivatedActivityLogEntry -// GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry // GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesPostgresBranchCreatedActivityLogEntry // GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesPostgresBranchDeletedActivityLogEntry // GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesPostgresCreatedActivityLogEntry @@ -11728,8 +11706,6 @@ func (v *GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActiv } func (v *GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesPostgresBranchActivatedActivityLogEntry) implementsGraphQLInterfaceGetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesActivityLogEntry() { } -func (v *GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) implementsGraphQLInterfaceGetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesActivityLogEntry() { -} func (v *GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesPostgresBranchCreatedActivityLogEntry) implementsGraphQLInterfaceGetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesActivityLogEntry() { } func (v *GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesPostgresBranchDeletedActivityLogEntry) implementsGraphQLInterfaceGetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesActivityLogEntry() { @@ -11914,9 +11890,6 @@ func __unmarshalGetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityL case "PostgresBranchActivatedActivityLogEntry": *v = new(GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesPostgresBranchActivatedActivityLogEntry) return json.Unmarshal(b, *v) - case "PostgresBranchActivityLogEntry": - *v = new(GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) - return json.Unmarshal(b, *v) case "PostgresBranchCreatedActivityLogEntry": *v = new(GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesPostgresBranchCreatedActivityLogEntry) return json.Unmarshal(b, *v) @@ -12264,14 +12237,6 @@ func __marshalGetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLog *GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesPostgresBranchActivatedActivityLogEntry }{typename, v} return json.Marshal(result) - case *GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry: - typename = "PostgresBranchActivityLogEntry" - - result := struct { - TypeName string `json:"__typename"` - *GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry - }{typename, v} - return json.Marshal(result) case *GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesPostgresBranchCreatedActivityLogEntry: typename = "PostgresBranchCreatedActivityLogEntry" @@ -13567,44 +13532,6 @@ func (v *GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActiv return v.EnvironmentName } -// GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry includes the requested fields of the GraphQL type PostgresBranchActivityLogEntry. -type GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry struct { - Typename *string `json:"__typename"` - // Interface for activity log entries. - Actor string `json:"actor"` - // Interface for activity log entries. - CreatedAt time.Time `json:"createdAt"` - // Interface for activity log entries. - Message string `json:"message"` - // Interface for activity log entries. - EnvironmentName *string `json:"environmentName"` -} - -// GetTypename returns GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry.Typename, and is useful for accessing the field via an interface. -func (v *GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) GetTypename() *string { - return v.Typename -} - -// GetActor returns GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry.Actor, and is useful for accessing the field via an interface. -func (v *GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) GetActor() string { - return v.Actor -} - -// GetCreatedAt returns GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry.CreatedAt, and is useful for accessing the field via an interface. -func (v *GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) GetCreatedAt() time.Time { - return v.CreatedAt -} - -// GetMessage returns GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry.Message, and is useful for accessing the field via an interface. -func (v *GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) GetMessage() string { - return v.Message -} - -// GetEnvironmentName returns GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry.EnvironmentName, and is useful for accessing the field via an interface. -func (v *GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) GetEnvironmentName() *string { - return v.EnvironmentName -} - // GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesPostgresBranchCreatedActivityLogEntry includes the requested fields of the GraphQL type PostgresBranchCreatedActivityLogEntry. // The GraphQL type's documentation follows. // @@ -13688,6 +13615,9 @@ func (v *GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActiv } // GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesPostgresCreatedActivityLogEntry includes the requested fields of the GraphQL type PostgresCreatedActivityLogEntry. +// The GraphQL type's documentation follows. +// +// Activity log entry for a Postgres that was created. type GetConfigActivityTeamConfigsConfigConnectionNodesConfigActivityLogActivityLogEntryConnectionNodesPostgresCreatedActivityLogEntry struct { Typename *string `json:"__typename"` // Interface for activity log entries. @@ -16208,7 +16138,6 @@ func (v *GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryC // GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesOpenSearchDeletedActivityLogEntry // GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesOpenSearchUpdatedActivityLogEntry // GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesPostgresBranchActivatedActivityLogEntry -// GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry // GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesPostgresBranchCreatedActivityLogEntry // GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesPostgresBranchDeletedActivityLogEntry // GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesPostgresCreatedActivityLogEntry @@ -16334,8 +16263,6 @@ func (v *GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryC } func (v *GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesPostgresBranchActivatedActivityLogEntry) implementsGraphQLInterfaceGetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesActivityLogEntry() { } -func (v *GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) implementsGraphQLInterfaceGetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesActivityLogEntry() { -} func (v *GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesPostgresBranchCreatedActivityLogEntry) implementsGraphQLInterfaceGetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesActivityLogEntry() { } func (v *GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesPostgresBranchDeletedActivityLogEntry) implementsGraphQLInterfaceGetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesActivityLogEntry() { @@ -16520,9 +16447,6 @@ func __unmarshalGetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLo case "PostgresBranchActivatedActivityLogEntry": *v = new(GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesPostgresBranchActivatedActivityLogEntry) return json.Unmarshal(b, *v) - case "PostgresBranchActivityLogEntry": - *v = new(GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) - return json.Unmarshal(b, *v) case "PostgresBranchCreatedActivityLogEntry": *v = new(GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesPostgresBranchCreatedActivityLogEntry) return json.Unmarshal(b, *v) @@ -16870,14 +16794,6 @@ func __marshalGetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogE *GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesPostgresBranchActivatedActivityLogEntry }{typename, v} return json.Marshal(result) - case *GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry: - typename = "PostgresBranchActivityLogEntry" - - result := struct { - TypeName string `json:"__typename"` - *GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry - }{typename, v} - return json.Marshal(result) case *GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesPostgresBranchCreatedActivityLogEntry: typename = "PostgresBranchCreatedActivityLogEntry" @@ -18173,44 +18089,6 @@ func (v *GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryC return v.EnvironmentName } -// GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry includes the requested fields of the GraphQL type PostgresBranchActivityLogEntry. -type GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry struct { - Typename *string `json:"__typename"` - // Interface for activity log entries. - Actor string `json:"actor"` - // Interface for activity log entries. - CreatedAt time.Time `json:"createdAt"` - // Interface for activity log entries. - Message string `json:"message"` - // Interface for activity log entries. - EnvironmentName *string `json:"environmentName"` -} - -// GetTypename returns GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry.Typename, and is useful for accessing the field via an interface. -func (v *GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) GetTypename() *string { - return v.Typename -} - -// GetActor returns GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry.Actor, and is useful for accessing the field via an interface. -func (v *GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) GetActor() string { - return v.Actor -} - -// GetCreatedAt returns GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry.CreatedAt, and is useful for accessing the field via an interface. -func (v *GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) GetCreatedAt() time.Time { - return v.CreatedAt -} - -// GetMessage returns GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry.Message, and is useful for accessing the field via an interface. -func (v *GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) GetMessage() string { - return v.Message -} - -// GetEnvironmentName returns GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry.EnvironmentName, and is useful for accessing the field via an interface. -func (v *GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) GetEnvironmentName() *string { - return v.EnvironmentName -} - // GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesPostgresBranchCreatedActivityLogEntry includes the requested fields of the GraphQL type PostgresBranchCreatedActivityLogEntry. // The GraphQL type's documentation follows. // @@ -18294,6 +18172,9 @@ func (v *GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryC } // GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesPostgresCreatedActivityLogEntry includes the requested fields of the GraphQL type PostgresCreatedActivityLogEntry. +// The GraphQL type's documentation follows. +// +// Activity log entry for a Postgres that was created. type GetJobActivityTeamJobsJobConnectionNodesJobActivityLogActivityLogEntryConnectionNodesPostgresCreatedActivityLogEntry struct { Typename *string `json:"__typename"` // Interface for activity log entries. @@ -22204,7 +22085,7 @@ func (v *GetPostgresBranchWorkloadsTeamEnvironmentPostgres) GetBranch() GetPostg // // A named PostgresBranch belonging to a Postgres. type GetPostgresBranchWorkloadsTeamEnvironmentPostgresBranch struct { - // Workloads using this branch while it is active. + // Workloads explicitly using this branch, or following it while it is active. Workloads GetPostgresBranchWorkloadsTeamEnvironmentPostgresBranchWorkloadsWorkloadConnection `json:"workloads"` } @@ -22815,7 +22696,6 @@ func (v *GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActiv // GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesOpenSearchDeletedActivityLogEntry // GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesOpenSearchUpdatedActivityLogEntry // GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesPostgresBranchActivatedActivityLogEntry -// GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry // GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesPostgresBranchCreatedActivityLogEntry // GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesPostgresBranchDeletedActivityLogEntry // GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesPostgresCreatedActivityLogEntry @@ -22941,8 +22821,6 @@ func (v *GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActiv } func (v *GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesPostgresBranchActivatedActivityLogEntry) implementsGraphQLInterfaceGetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesActivityLogEntry() { } -func (v *GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) implementsGraphQLInterfaceGetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesActivityLogEntry() { -} func (v *GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesPostgresBranchCreatedActivityLogEntry) implementsGraphQLInterfaceGetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesActivityLogEntry() { } func (v *GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesPostgresBranchDeletedActivityLogEntry) implementsGraphQLInterfaceGetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesActivityLogEntry() { @@ -23127,9 +23005,6 @@ func __unmarshalGetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityL case "PostgresBranchActivatedActivityLogEntry": *v = new(GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesPostgresBranchActivatedActivityLogEntry) return json.Unmarshal(b, *v) - case "PostgresBranchActivityLogEntry": - *v = new(GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) - return json.Unmarshal(b, *v) case "PostgresBranchCreatedActivityLogEntry": *v = new(GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesPostgresBranchCreatedActivityLogEntry) return json.Unmarshal(b, *v) @@ -23477,14 +23352,6 @@ func __marshalGetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLog *GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesPostgresBranchActivatedActivityLogEntry }{typename, v} return json.Marshal(result) - case *GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry: - typename = "PostgresBranchActivityLogEntry" - - result := struct { - TypeName string `json:"__typename"` - *GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry - }{typename, v} - return json.Marshal(result) case *GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesPostgresBranchCreatedActivityLogEntry: typename = "PostgresBranchCreatedActivityLogEntry" @@ -24780,44 +24647,6 @@ func (v *GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActiv return v.EnvironmentName } -// GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry includes the requested fields of the GraphQL type PostgresBranchActivityLogEntry. -type GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry struct { - Typename *string `json:"__typename"` - // Interface for activity log entries. - Actor string `json:"actor"` - // Interface for activity log entries. - CreatedAt time.Time `json:"createdAt"` - // Interface for activity log entries. - Message string `json:"message"` - // Interface for activity log entries. - EnvironmentName *string `json:"environmentName"` -} - -// GetTypename returns GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry.Typename, and is useful for accessing the field via an interface. -func (v *GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) GetTypename() *string { - return v.Typename -} - -// GetActor returns GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry.Actor, and is useful for accessing the field via an interface. -func (v *GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) GetActor() string { - return v.Actor -} - -// GetCreatedAt returns GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry.CreatedAt, and is useful for accessing the field via an interface. -func (v *GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) GetCreatedAt() time.Time { - return v.CreatedAt -} - -// GetMessage returns GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry.Message, and is useful for accessing the field via an interface. -func (v *GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) GetMessage() string { - return v.Message -} - -// GetEnvironmentName returns GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry.EnvironmentName, and is useful for accessing the field via an interface. -func (v *GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) GetEnvironmentName() *string { - return v.EnvironmentName -} - // GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesPostgresBranchCreatedActivityLogEntry includes the requested fields of the GraphQL type PostgresBranchCreatedActivityLogEntry. // The GraphQL type's documentation follows. // @@ -24901,6 +24730,9 @@ func (v *GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActiv } // GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesPostgresCreatedActivityLogEntry includes the requested fields of the GraphQL type PostgresCreatedActivityLogEntry. +// The GraphQL type's documentation follows. +// +// Activity log entry for a Postgres that was created. type GetSecretActivityTeamSecretsSecretConnectionNodesSecretActivityLogActivityLogEntryConnectionNodesPostgresCreatedActivityLogEntry struct { Typename *string `json:"__typename"` // Interface for activity log entries. @@ -27228,7 +27060,6 @@ func (v *GetTeamActivityTeamActivityLogActivityLogEntryConnection) __premarshalJ // GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesOpenSearchDeletedActivityLogEntry // GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesOpenSearchUpdatedActivityLogEntry // GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresBranchActivatedActivityLogEntry -// GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry // GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresBranchCreatedActivityLogEntry // GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresBranchDeletedActivityLogEntry // GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresCreatedActivityLogEntry @@ -27364,8 +27195,6 @@ func (v *GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesOpenSearch } func (v *GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresBranchActivatedActivityLogEntry) implementsGraphQLInterfaceGetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesActivityLogEntry() { } -func (v *GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) implementsGraphQLInterfaceGetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesActivityLogEntry() { -} func (v *GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresBranchCreatedActivityLogEntry) implementsGraphQLInterfaceGetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesActivityLogEntry() { } func (v *GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresBranchDeletedActivityLogEntry) implementsGraphQLInterfaceGetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesActivityLogEntry() { @@ -27550,9 +27379,6 @@ func __unmarshalGetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesAct case "PostgresBranchActivatedActivityLogEntry": *v = new(GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresBranchActivatedActivityLogEntry) return json.Unmarshal(b, *v) - case "PostgresBranchActivityLogEntry": - *v = new(GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) - return json.Unmarshal(b, *v) case "PostgresBranchCreatedActivityLogEntry": *v = new(GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresBranchCreatedActivityLogEntry) return json.Unmarshal(b, *v) @@ -27900,14 +27726,6 @@ func __marshalGetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesActiv *GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresBranchActivatedActivityLogEntry }{typename, v} return json.Marshal(result) - case *GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry: - typename = "PostgresBranchActivityLogEntry" - - result := struct { - TypeName string `json:"__typename"` - *GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry - }{typename, v} - return json.Marshal(result) case *GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresBranchCreatedActivityLogEntry: typename = "PostgresBranchCreatedActivityLogEntry" @@ -29525,58 +29343,6 @@ func (v *GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresBr return v.ResourceName } -// GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry includes the requested fields of the GraphQL type PostgresBranchActivityLogEntry. -type GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry struct { - Typename *string `json:"__typename"` - // Interface for activity log entries. - Actor string `json:"actor"` - // Interface for activity log entries. - CreatedAt time.Time `json:"createdAt"` - // Interface for activity log entries. - Message string `json:"message"` - // Interface for activity log entries. - EnvironmentName *string `json:"environmentName"` - // Interface for activity log entries. - ResourceType ActivityLogEntryResourceType `json:"resourceType"` - // Interface for activity log entries. - ResourceName string `json:"resourceName"` -} - -// GetTypename returns GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry.Typename, and is useful for accessing the field via an interface. -func (v *GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) GetTypename() *string { - return v.Typename -} - -// GetActor returns GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry.Actor, and is useful for accessing the field via an interface. -func (v *GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) GetActor() string { - return v.Actor -} - -// GetCreatedAt returns GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry.CreatedAt, and is useful for accessing the field via an interface. -func (v *GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) GetCreatedAt() time.Time { - return v.CreatedAt -} - -// GetMessage returns GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry.Message, and is useful for accessing the field via an interface. -func (v *GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) GetMessage() string { - return v.Message -} - -// GetEnvironmentName returns GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry.EnvironmentName, and is useful for accessing the field via an interface. -func (v *GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) GetEnvironmentName() *string { - return v.EnvironmentName -} - -// GetResourceType returns GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry.ResourceType, and is useful for accessing the field via an interface. -func (v *GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) GetResourceType() ActivityLogEntryResourceType { - return v.ResourceType -} - -// GetResourceName returns GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry.ResourceName, and is useful for accessing the field via an interface. -func (v *GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresBranchActivityLogEntry) GetResourceName() string { - return v.ResourceName -} - // GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresBranchCreatedActivityLogEntry includes the requested fields of the GraphQL type PostgresBranchCreatedActivityLogEntry. // The GraphQL type's documentation follows. // @@ -29688,6 +29454,9 @@ func (v *GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresBr } // GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresCreatedActivityLogEntry includes the requested fields of the GraphQL type PostgresCreatedActivityLogEntry. +// The GraphQL type's documentation follows. +// +// Activity log entry for a Postgres that was created. type GetTeamActivityTeamActivityLogActivityLogEntryConnectionNodesPostgresCreatedActivityLogEntry struct { Typename *string `json:"__typename"` // Interface for activity log entries. @@ -35736,6 +35505,27 @@ func (v *RevokeAccessFromKafkaTopicUpdateKafkaTopicUpdateKafkaTopicPayloadKafkaT return v.Id } +// The SBOM pipeline status for an image or workload. +type SBOMStatus string + +const ( + // SBOM generation is in progress. + SBOMStatusProcessing SBOMStatus = "PROCESSING" + // SBOM data is available. + SBOMStatusReady SBOMStatus = "READY" + // No SBOM is available for this image or workload. + SBOMStatusNoSbom SBOMStatus = "NO_SBOM" + // SBOM generation failed. + SBOMStatusFailed SBOMStatus = "FAILED" +) + +var AllSBOMStatus = []SBOMStatus{ + SBOMStatusProcessing, + SBOMStatusReady, + SBOMStatusNoSbom, + SBOMStatusFailed, +} + // Input for filtering the secrets of a team. type SecretFilter struct { // Input for filtering the secrets of a team. @@ -36214,9 +36004,9 @@ func (v *TeamMembersTeamMembersTeamMemberConnectionNodesTeamMemberUser) GetEmail // Filter a team's Postgres databases by environment and user-defined labels. type TeamPostgresFilter struct { - // Filter by environments. + // Filter a team's Postgres databases by environment and user-defined labels. Environments []string `json:"environments"` - // All listed labels must match. + // Filter a team's Postgres databases by environment and user-defined labels. Labels []LabelFilter `json:"labels"` } @@ -36502,21 +36292,33 @@ type TeamVulnerabilitySummaryFilter struct { // Input for filtering team vulnerability summaries. EnvironmentName *string `json:"environmentName"` // Input for filtering team vulnerability summaries. + Priorities []CVEPriority `json:"priorities"` + // Input for filtering team vulnerability summaries. Priority *CVEPriority `json:"priority"` + // Input for filtering team vulnerability summaries. + HasKevEntry *bool `json:"hasKevEntry"` } // GetEnvironmentName returns TeamVulnerabilitySummaryFilter.EnvironmentName, and is useful for accessing the field via an interface. func (v *TeamVulnerabilitySummaryFilter) GetEnvironmentName() *string { return v.EnvironmentName } +// GetPriorities returns TeamVulnerabilitySummaryFilter.Priorities, and is useful for accessing the field via an interface. +func (v *TeamVulnerabilitySummaryFilter) GetPriorities() []CVEPriority { return v.Priorities } + // GetPriority returns TeamVulnerabilitySummaryFilter.Priority, and is useful for accessing the field via an interface. func (v *TeamVulnerabilitySummaryFilter) GetPriority() *CVEPriority { return v.Priority } +// GetHasKevEntry returns TeamVulnerabilitySummaryFilter.HasKevEntry, and is useful for accessing the field via an interface. +func (v *TeamVulnerabilitySummaryFilter) GetHasKevEntry() *bool { return v.HasKevEntry } + // Input for filtering team workloads. type TeamWorkloadsFilter struct { // Input for filtering team workloads. Environments []string `json:"environments"` // Input for filtering team workloads. Labels []LabelFilter `json:"labels"` + // Input for filtering team workloads. + SbomStatus *SBOMStatus `json:"sbomStatus"` } // GetEnvironments returns TeamWorkloadsFilter.Environments, and is useful for accessing the field via an interface. @@ -36525,6 +36327,9 @@ func (v *TeamWorkloadsFilter) GetEnvironments() []string { return v.Environments // GetLabels returns TeamWorkloadsFilter.Labels, and is useful for accessing the field via an interface. func (v *TeamWorkloadsFilter) GetLabels() []LabelFilter { return v.Labels } +// GetSbomStatus returns TeamWorkloadsFilter.SbomStatus, and is useful for accessing the field via an interface. +func (v *TeamWorkloadsFilter) GetSbomStatus() *SBOMStatus { return v.SbomStatus } + // TeamsResponse is returned by Teams on success. type TeamsResponse struct { // Get a list of teams. @@ -36751,13 +36556,20 @@ func (v *UpdateOpenSearchUpdateOpenSearchUpdateOpenSearchPayloadOpenSearch) GetN // Input for updating a Postgres. Omitted fields are left unchanged. type UpdatePostgresInput struct { - Name string `json:"name"` - EnvironmentName string `json:"environmentName"` - TeamSlug string `json:"teamSlug"` - HighAvailability *bool `json:"highAvailability,omitempty"` - Cpu *string `json:"cpu,omitempty"` - Memory *string `json:"memory,omitempty"` - DiskSize *string `json:"diskSize,omitempty"` + // Input for updating a Postgres. Omitted fields are left unchanged. + Name string `json:"name"` + // Input for updating a Postgres. Omitted fields are left unchanged. + EnvironmentName string `json:"environmentName"` + // Input for updating a Postgres. Omitted fields are left unchanged. + TeamSlug string `json:"teamSlug"` + // Input for updating a Postgres. Omitted fields are left unchanged. + HighAvailability *bool `json:"highAvailability,omitempty"` + // Input for updating a Postgres. Omitted fields are left unchanged. + Cpu *string `json:"cpu,omitempty"` + // Input for updating a Postgres. Omitted fields are left unchanged. + Memory *string `json:"memory,omitempty"` + // Input for updating a Postgres. Omitted fields are left unchanged. + DiskSize *string `json:"diskSize,omitempty"` } // GetName returns UpdatePostgresInput.Name, and is useful for accessing the field via an interface. @@ -36797,6 +36609,7 @@ func (v *UpdatePostgresResponse) GetUpdatePostgres() UpdatePostgresUpdatePostgre // // Result of updating a Postgres. type UpdatePostgresUpdatePostgresUpdatePostgresPayload struct { + // The Postgres that was updated. Postgres UpdatePostgresUpdatePostgresUpdatePostgresPayloadPostgres `json:"postgres"` } @@ -36866,6 +36679,7 @@ type UpdateValkeyInput struct { TeamSlug string `json:"teamSlug"` Tier ValkeyTier `json:"tier"` Memory ValkeyMemory `json:"memory"` + Version *ValkeyMajorVersion `json:"version"` MaxMemoryPolicy *ValkeyMaxMemoryPolicy `json:"maxMemoryPolicy,omitempty"` NotifyKeyspaceEvents *string `json:"notifyKeyspaceEvents,omitempty"` Databases *int `json:"databases,omitempty"` @@ -36888,6 +36702,9 @@ func (v *UpdateValkeyInput) GetTier() ValkeyTier { return v.Tier } // GetMemory returns UpdateValkeyInput.Memory, and is useful for accessing the field via an interface. func (v *UpdateValkeyInput) GetMemory() ValkeyMemory { return v.Memory } +// GetVersion returns UpdateValkeyInput.Version, and is useful for accessing the field via an interface. +func (v *UpdateValkeyInput) GetVersion() *ValkeyMajorVersion { return v.Version } + // GetMaxMemoryPolicy returns UpdateValkeyInput.MaxMemoryPolicy, and is useful for accessing the field via an interface. func (v *UpdateValkeyInput) GetMaxMemoryPolicy() *ValkeyMaxMemoryPolicy { return v.MaxMemoryPolicy } @@ -37242,6 +37059,20 @@ func (v *ValkeyFilter) GetTiers() []ValkeyTier { return v.Tiers } // GetLabels returns ValkeyFilter.Labels, and is useful for accessing the field via an interface. func (v *ValkeyFilter) GetLabels() []LabelFilter { return v.Labels } +type ValkeyMajorVersion string + +const ( + // Valkey Version 9.1.x. Default for new instances. + ValkeyMajorVersionV91 ValkeyMajorVersion = "V9_1" + // Valkey Version 8.1.x + ValkeyMajorVersionV81 ValkeyMajorVersion = "V8_1" +) + +var AllValkeyMajorVersion = []ValkeyMajorVersion{ + ValkeyMajorVersionV91, + ValkeyMajorVersionV81, +} + type ValkeyMaxMemoryPolicy string const ( diff --git a/internal/naisdevice/command/config_set.go b/internal/naisdevice/command/config_set.go index 0ca9f53f..54900bf7 100644 --- a/internal/naisdevice/command/config_set.go +++ b/internal/naisdevice/command/config_set.go @@ -2,8 +2,6 @@ package command import ( "context" - "fmt" - "strconv" "github.com/nais/cli/internal/naisdevice" "github.com/nais/naistrix" @@ -15,16 +13,13 @@ func set() *naistrix.Command { Title: "Set a configuration value.", Description: "Set a naisdevice configuration value. The setting name and a boolean value (true/false) are required.", Args: []naistrix.Argument{ - {Name: "setting"}, - {Name: "value"}, + {Name: "setting", Prompt: "Name of the naisdevice setting to update"}, + {Name: "value", Prompt: "Value to set", Choices: []string{"true", "false"}, ChoicesCaseInsensitive: true}, }, AutoCompleteFunc: naisdevice.AutocompleteSet, RunFunc: func(ctx context.Context, args *naistrix.Arguments, out *naistrix.OutputWriter) error { setting := args.Get("setting") - value, err := strconv.ParseBool(args.Get("value")) - if err != nil { - return fmt.Errorf("invalid bool value: %v", err) - } + value := args.Get("value") == "true" if err := naisdevice.SetConfig(ctx, setting, value); err != nil { return err diff --git a/internal/naisdevice/command/config_set_test.go b/internal/naisdevice/command/config_set_test.go new file mode 100644 index 00000000..86546c7c --- /dev/null +++ b/internal/naisdevice/command/config_set_test.go @@ -0,0 +1,63 @@ +package command + +import ( + "context" + "slices" + "strings" + "testing" + + "github.com/nais/naistrix" +) + +func TestConfigValueArgumentChoices(t *testing.T) { + cmd := set() + choices := cmd.Args[1].Choices + if want := []string{"true", "false"}; !slices.Equal(choices, want) { + t.Errorf("boolean choices = %v, want %v", choices, want) + } +} + +func TestConfigValueCaseInsensitiveChoices(t *testing.T) { + for _, value := range []string{"true", "TRUE", "True", "false", "FALSE", "False", "1", "0", "t", "f", "invalid"} { + t.Run(value, func(t *testing.T) { + cmd := set() + var got string + cmd.RunFunc = func(_ context.Context, args *naistrix.Arguments, _ *naistrix.OutputWriter) error { + got = args.Get("value") + return nil + } + app, _, err := naistrix.NewApplication("test", "Test", "v0.0.0") + if err != nil { + t.Fatal(err) + } + if err := app.AddCommand(cmd); err != nil { + t.Fatal(err) + } + err = app.Run(naistrix.RunWithArgs([]string{"set", "AutoConnect", value})) + want := strings.ToLower(value) + if want != "true" && want != "false" { + if err == nil || !strings.Contains(err.Error(), "invalid value") { + t.Fatalf("expected invalid value error, got %v", err) + } + if got != "" { + t.Error("command ran with an invalid boolean") + } + return + } + if err != nil { + t.Fatal(err) + } + if got != want { + t.Errorf("value = %q, want %q", got, want) + } + }) + } +} + +func TestConfigSettingArgumentsRemainUnrestricted(t *testing.T) { + for _, cmd := range []*naistrix.Command{get(), set()} { + if len(cmd.Args[0].Choices) != 0 { + t.Errorf("%s setting choices must remain empty to allow case-insensitive and hidden settings", cmd.Name) + } + } +} diff --git a/internal/naisdevice/command/conifg_get.go b/internal/naisdevice/command/conifg_get.go index dddb0207..7f05978b 100644 --- a/internal/naisdevice/command/conifg_get.go +++ b/internal/naisdevice/command/conifg_get.go @@ -15,7 +15,7 @@ func get() *naistrix.Command { Title: "Get a naisdevice setting.", Description: "Retrieve the current value of a naisdevice configuration setting. Available settings include autoconnect.", Args: []naistrix.Argument{ - {Name: "setting"}, + {Name: "setting", Prompt: "Name of the naisdevice setting to inspect"}, }, RunFunc: func(ctx context.Context, args *naistrix.Arguments, out *naistrix.OutputWriter) error { setting := args.Get("setting") diff --git a/internal/naisdevice/command/gateway.go b/internal/naisdevice/command/gateway.go index 65e88a9a..a8009621 100644 --- a/internal/naisdevice/command/gateway.go +++ b/internal/naisdevice/command/gateway.go @@ -93,7 +93,7 @@ func describeCommand(parentFlags *flag.Gateway) *naistrix.Command { Description: "Show detailed information about a specific gateway, including its endpoint, IP addresses, routes, and access group IDs.", Flags: flags, Args: []naistrix.Argument{ - {Name: "gateway"}, + {Name: "gateway", Prompt: "Name of the gateway to inspect"}, }, AutoCompleteFunc: func(ctx context.Context, args *naistrix.Arguments, toComplete string) (completions []string, activeHelp string) { gateways, err := naisdevice.GetGateways(ctx) @@ -149,7 +149,7 @@ func grantAccessCommand(parentFlags *flag.Gateway) *naistrix.Command { Description: "Request just-in-time access (JITA) to one or more privileged gateways. Only gateways that require JITA are affected; non-privileged gateways are already connected automatically.", Flags: flags, Args: []naistrix.Argument{ - {Name: "gateway", Repeatable: true}, + {Name: "gateway", Prompt: "Name of a privileged gateway to request access to", Repeatable: true}, }, AutoCompleteFunc: func(ctx context.Context, args *naistrix.Arguments, _ string) ([]string, string) { gateways, err := naisdevice.GetGateways(ctx) diff --git a/internal/naisdevice/config_set.go b/internal/naisdevice/config_set.go index e08d0a3e..b442c468 100644 --- a/internal/naisdevice/config_set.go +++ b/internal/naisdevice/config_set.go @@ -69,7 +69,7 @@ func SetConfig(ctx context.Context, setting string, value bool) error { case "iloveninetiesboybands": configResponse.Config.ILoveNinetiesBoybands = value default: - return fmt.Errorf("setting must be one of [%v]", strings.Join(GetAllowedSettings(false, false), ", ")) + return fmt.Errorf("setting must be one of: %v", strings.Join(GetAllowedSettings(false, false), ", ")) } setConfigRequest := &pb.SetAgentConfigurationRequest{Config: configResponse.Config} diff --git a/internal/opensearch/command/create.go b/internal/opensearch/command/create.go index f0e30577..92b5707c 100644 --- a/internal/opensearch/command/create.go +++ b/internal/opensearch/command/create.go @@ -22,7 +22,7 @@ func create(parentFlags *flag.OpenSearch) *naistrix.Command { Description: "This command creates an OpenSearch instance.", Flags: flags, Args: []naistrix.Argument{ - {Name: "name"}, + {Name: "name", Prompt: "Name of the new OpenSearch instance"}, }, ValidateFunc: naistrix.ValidateFuncs( validation.RequireEnvironment(flags), diff --git a/internal/opensearch/command/credentials.go b/internal/opensearch/command/credentials.go index a07a69d0..e7c68f6a 100644 --- a/internal/opensearch/command/credentials.go +++ b/internal/opensearch/command/credentials.go @@ -21,7 +21,7 @@ func credentials(parentFlags *flag.OpenSearch) *naistrix.Command { Description: "Creates temporary credentials for accessing an OpenSearch instance. The credentials are printed to stdout as environment variables.", Flags: flags, Args: []naistrix.Argument{ - {Name: "name"}, + {Name: "name", Prompt: "Name of the OpenSearch instance to create credentials for"}, }, ValidateFunc: naistrix.ValidateFuncs( validation.RequireEnvironment(flags), diff --git a/internal/opensearch/command/delete.go b/internal/opensearch/command/delete.go index 980f39a5..d0e8515d 100644 --- a/internal/opensearch/command/delete.go +++ b/internal/opensearch/command/delete.go @@ -20,7 +20,7 @@ func delete(parentFlags *flag.OpenSearch) *naistrix.Command { Description: "This command deletes an existing OpenSearch instance.", Flags: flags, Args: []naistrix.Argument{ - {Name: "name"}, + {Name: "name", Prompt: "Name of the OpenSearch instance to delete"}, }, ValidateFunc: naistrix.ValidateFuncs( validation.RequireEnvironment(flags), diff --git a/internal/opensearch/command/get.go b/internal/opensearch/command/get.go index e211a8e8..516eca67 100644 --- a/internal/opensearch/command/get.go +++ b/internal/opensearch/command/get.go @@ -21,7 +21,7 @@ func get(parentFlags *flag.OpenSearch) *naistrix.Command { Description: "This command describes an OpenSearch instance, listing its current configuration and access list.", Flags: flags, Args: []naistrix.Argument{ - {Name: "name"}, + {Name: "name", Prompt: "Name of the OpenSearch instance to inspect"}, }, ValidateFunc: naistrix.ValidateFuncs( validation.RequireEnvironment(flags), diff --git a/internal/opensearch/command/update.go b/internal/opensearch/command/update.go index 3a697ef7..440bf4ac 100644 --- a/internal/opensearch/command/update.go +++ b/internal/opensearch/command/update.go @@ -23,7 +23,7 @@ func update(parentFlags *flag.OpenSearch) *naistrix.Command { Description: "This command updates an existing Opensearch instance.", Flags: flags, Args: []naistrix.Argument{ - {Name: "name"}, + {Name: "name", Prompt: "Name of the OpenSearch instance to update"}, }, ValidateFunc: naistrix.ValidateFuncs( validation.RequireEnvironment(flags), diff --git a/internal/secret/command/command.go b/internal/secret/command/command.go index 6ebeba58..f4b37cdd 100644 --- a/internal/secret/command/command.go +++ b/internal/secret/command/command.go @@ -35,7 +35,7 @@ func Secrets(parentFlags *flags.GlobalFlags) *naistrix.Command { } var defaultArgs = []naistrix.Argument{ - {Name: "name"}, + {Name: "name", Prompt: "Name of the secret"}, } func validateArgs(_ context.Context, args *naistrix.Arguments) error { diff --git a/internal/validate/command/validate.go b/internal/validate/command/validate.go index 9ec7e6fa..4ae97576 100644 --- a/internal/validate/command/validate.go +++ b/internal/validate/command/validate.go @@ -16,7 +16,7 @@ func Validate(parentFlags *flags.GlobalFlags) *naistrix.Command { Title: "Validate one or more Nais manifest files.", Description: "Validate Nais manifest files (YAML/JSON) against the Nais JSON schema. Accepts one or more file paths.", Args: []naistrix.Argument{ - {Name: "file", Repeatable: true}, + {Name: "file", Prompt: "Path to a Nais manifest file to validate", Repeatable: true}, }, AutoCompleteExtensions: []string{"yaml", "yml", "json"}, Flags: flags, diff --git a/internal/valkey/command/command.go b/internal/valkey/command/command.go index 48cc8756..175c4c81 100644 --- a/internal/valkey/command/command.go +++ b/internal/valkey/command/command.go @@ -34,7 +34,7 @@ func Valkey(parentFlags *flags.GlobalFlags) *naistrix.Command { } var defaultArgs = []naistrix.Argument{ - {Name: "name"}, + {Name: "name", Prompt: "Name of the Valkey instance"}, } func validateArgs(_ context.Context, args *naistrix.Arguments) error { diff --git a/internal/vulnerability/command/command.go b/internal/vulnerability/command/command.go index 90fbc30a..d657d05f 100644 --- a/internal/vulnerability/command/command.go +++ b/internal/vulnerability/command/command.go @@ -26,7 +26,7 @@ func Vulnerabilities(parentFlags *flags.GlobalFlags) *naistrix.Command { } var cveArgs = []naistrix.Argument{ - {Name: "cve_id"}, + {Name: "cve_id", Prompt: "CVE identifier (e.g. CVE-2026-12345)"}, } func validateCVEArgs(args *naistrix.Arguments) error { diff --git a/mise/config.toml b/mise/config.toml index 58c4bbc2..48a92be6 100644 --- a/mise/config.toml +++ b/mise/config.toml @@ -1,8 +1,8 @@ [tools] -git-cliff = "2.10.1" -go = "1.26.9" -golangci-lint = "2.12.2" -yamlfmt = "0.17.2" +git-cliff = "2.14.2" +go = "1.27.2" +golangci-lint = "2.14.0" +yamlfmt = "0.21.0" [settings] pin = true diff --git a/schema.graphql b/schema.graphql index 211f0c04..a85d3479 100644 --- a/schema.graphql +++ b/schema.graphql @@ -57,6 +57,38 @@ The URL that specifies the behavior of this scalar. url: String! ) on SCALAR +""" +Request a branch for normal workloads; pgrator activates it once its cluster is ready. +""" +input ActivatePostgresBranchInput { +""" +Request a branch for normal workloads; pgrator activates it once its cluster is ready. +""" + postgres: String! +""" +Request a branch for normal workloads; pgrator activates it once its cluster is ready. +""" + branch: String! +""" +Request a branch for normal workloads; pgrator activates it once its cluster is ready. +""" + environmentName: String! +""" +Request a branch for normal workloads; pgrator activates it once its cluster is ready. +""" + teamSlug: Slug! +} + +""" +Result of requesting activation; compare desiredActiveBranch to activeBranch while reconciling. +""" +type ActivatePostgresBranchPayload { +""" +Postgres with desired and observed branch selection. +""" + postgres: Postgres! +} + enum ActivityLogActivityType { """ An application was deleted. @@ -147,24 +179,44 @@ Filter for credential creation events. """ OPENSEARCH_CREDENTIALS_CREATED """ +A Postgres was created +""" + POSTGRES_CREATED +""" +A Postgres was updated +""" + POSTGRES_UPDATED +""" A user was granted access to a Postgres cluster """ POSTGRES_GRANT_ACCESS - "A personal Postgres access was created through the API broker" +""" +A personal Postgres access was created through the API broker +""" POSTGRES_PERSONAL_ACCESS_CREATED - "Personal Postgres connection materials were retrieved" +""" +Personal Postgres connection materials were retrieved +""" POSTGRES_PERSONAL_ACCESS_CONNECTION - "A Postgres branch was deleted (historical entries without branch name)" +""" +A Postgres branch was deleted (historical entries without branch name) +""" POSTGRES_DELETED - "A Postgres was created" - POSTGRES_CREATED - "A Postgres was updated" - POSTGRES_UPDATED - "A Postgres branch was created." +""" +A request to delete a whole Postgres was accepted; cleanup continues asynchronously. +""" + POSTGRES_DELETION_REQUESTED +""" +A Postgres branch was created. +""" POSTGRES_BRANCH_CREATED - "A Postgres branch was activated." +""" +A Postgres branch was activated. +""" POSTGRES_BRANCH_ACTIVATED - "A Postgres branch was deleted." +""" +A Postgres branch was deleted. +""" POSTGRES_BRANCH_DELETED """ Reconciler enabled activity log entry. @@ -360,6 +412,10 @@ Interface for activity log entries. actor: String! """ Interface for activity log entries. +""" + gitHubActorClaims: GitHubActorClaims +""" +Interface for activity log entries. """ createdAt: Time! """ @@ -995,13 +1051,10 @@ Network policies for the application. OpenSearch instance referenced by the workload. """ openSearch: OpenSearch -"Active PostgresBranches for all Postgres entries in uses.postgres." - postgresBranches( """ -Ordering options for items returned from the connection. +Postgres databases referenced by uses.postgres, whether or not they have an active branch. """ - orderBy: PostgresBranchOrder - ): PostgresBranchConnection! + postgreses: PostgresConnection! """ Secrets used by the application. """ @@ -1102,6 +1155,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -1141,6 +1198,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -1405,6 +1466,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -1440,6 +1505,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -1534,6 +1603,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -1574,7 +1647,7 @@ The fields that changed during the update. """ GitHub Actions OIDC token claims at the time of the apply. Only present when the request was authenticated via a GitHub token. """ - gitHubActorClaims: GitHubActorClaims + gitHubActorClaims: GitHubActorClaims @deprecated(reason: "Use gitHubActorClaims on the activity log entry instead.") } input AssignRoleToServiceAccountInput { @@ -1863,27 +1936,31 @@ Link to the CVE details. """ CVSS score of the CVE. """ - cvssScore: Float + cvssScore: Float @deprecated(reason: "Use riskAssessment.cvssScore instead.") """ Priority of the CVE based on threat intelligence signals. """ - priority: CVEPriority! + priority: CVEPriority! @deprecated(reason: "Use riskAssessment.priority instead.") """ EPSS score of the CVE (probability of exploitation). """ - epssScore: Float + epssScore: Float @deprecated(reason: "Use riskAssessment.epssScore instead.") """ -EPSS percentile of the CVE. +EPSS percentile of the CVE (0-1). """ - epssPercentile: Float + epssPercentile: Float @deprecated(reason: "Use riskAssessment.epssPercentile instead.") """ Whether the CVE has a Known Exploited Vulnerability (KEV) entry. """ - hasKevEntry: Boolean! + hasKevEntry: Boolean! @deprecated(reason: "Use riskAssessment.hasKevEntry instead.") """ Whether the CVE is known to be used in ransomware attacks. """ - knownRansomwareUse: Boolean! + knownRansomwareUse: Boolean! @deprecated(reason: "Use riskAssessment.knownRansomwareUse instead.") +""" +Risk and threat intelligence signals used to prioritize the CVE. +""" + riskAssessment: VulnerabilityRiskAssessment! """ Affected workloads """ @@ -1937,6 +2014,16 @@ The CVE. node: CVE! } +""" +Filter active CVEs by their calculated risk assessment. +""" +input CVEFilter { +""" +Filter active CVEs by their calculated risk assessment. +""" + priority: CVEPriority +} + """ Ordering options when fetching CVEs. """ @@ -1979,7 +2066,7 @@ Operational priority levels for vulnerabilities and CVEs. """ enum CVEPriority { """ -Vulnerability is known to be actively exploited and requires immediate action. +Requires immediate action based on workload context, including internet exposure. Not assigned to CVEs at global scope; a KEV entry alone does not imply URGENT. """ URGENT """ @@ -2027,6 +2114,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -2223,6 +2314,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -2258,6 +2353,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -2364,6 +2463,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -2687,6 +2790,142 @@ OpenSearch instance that was created. openSearch: OpenSearch! } +""" +Input for creating a time-limited personal Postgres access. +""" +input CreatePostgresAccessInput { +""" +Input for creating a time-limited personal Postgres access. +""" + postgres: String! +""" +Input for creating a time-limited personal Postgres access. +""" + branch: String! +""" +Input for creating a time-limited personal Postgres access. +""" + teamSlug: Slug! +""" +Input for creating a time-limited personal Postgres access. +""" + environmentName: String! +""" +Input for creating a time-limited personal Postgres access. +""" + accessLevel: PostgresAccessLevel! +""" +Input for creating a time-limited personal Postgres access. +""" + reason: String! +""" +Input for creating a time-limited personal Postgres access. +""" + ttl: String +} + +""" +Result of creating a personal Postgres access. +""" +type CreatePostgresAccessPayload { +""" +Name of the newly created PostgresAccess resource. +""" + name: String! +""" +Server-controlled expiry for this personal access. +""" + expiresAt: Time! +} + +""" +Recovery request for a new, inactive branch. A branch cannot be re-created with different recovery settings. +""" +input CreatePostgresBranchInput { +""" +Recovery request for a new, inactive branch. A branch cannot be re-created with different recovery settings. +""" + postgres: String! +""" +Recovery request for a new, inactive branch. A branch cannot be re-created with different recovery settings. +""" + branch: String! +""" +Recovery request for a new, inactive branch. A branch cannot be re-created with different recovery settings. +""" + sourceBranch: String! +""" +Recovery request for a new, inactive branch. A branch cannot be re-created with different recovery settings. +""" + targetTime: Time! +""" +Recovery request for a new, inactive branch. A branch cannot be re-created with different recovery settings. +""" + environmentName: String! +""" +Recovery request for a new, inactive branch. A branch cannot be re-created with different recovery settings. +""" + teamSlug: Slug! +} + +""" +Result of creating a branch; provisioning continues asynchronously. +""" +type CreatePostgresBranchPayload { +""" +The new branch. +""" + postgresBranch: PostgresBranch! +} + +""" +Input for creating a Postgres. +""" +input CreatePostgresInput { +""" +Input for creating a Postgres. +""" + name: String! +""" +Input for creating a Postgres. +""" + environmentName: String! +""" +Input for creating a Postgres. +""" + teamSlug: Slug! +""" +Input for creating a Postgres. +""" + majorVersion: String! +""" +Input for creating a Postgres. +""" + highAvailability: Boolean +""" +Input for creating a Postgres. +""" + cpu: String +""" +Input for creating a Postgres. +""" + memory: String +""" +Input for creating a Postgres. +""" + diskSize: String +} + +""" +Result of creating a Postgres. +""" +type CreatePostgresPayload { +""" +The Postgres that was created. +""" + postgres: Postgres! +} + input CreateSecretInput { name: String! environment: String! @@ -2801,6 +3040,7 @@ input CreateValkeyInput { teamSlug: Slug! tier: ValkeyTier! memory: ValkeyMemory! + version: ValkeyMajorVersion! maxMemoryPolicy: ValkeyMaxMemoryPolicy notifyKeyspaceEvents: String databases: Int @@ -2917,132 +3157,49 @@ Whether or not the OpenSearch instance was deleted. openSearchDeleted: Boolean } -"Result of creating a personal Postgres access." -type CreatePostgresAccessPayload { - "Name of the newly created PostgresAccess resource." - name: String! - "Server-controlled expiry for this personal access." - expiresAt: Time! -} - -"Input for creating a time-limited personal Postgres access." -input CreatePostgresAccessInput { - "Name of the Postgres containing the branch." +input DeletePostgresBranchInput { postgres: String! - "Local name of the branch to access." branch: String! - "Team that owns the Postgres branch." - teamSlug: Slug! - "Environment containing the Postgres branch." environmentName: String! - "Privileges requested for the personal database role." - accessLevel: PostgresAccessLevel! - "Reason for personal database access. Must be at least 10 characters." - reason: String! - "Requested access lifetime (for example '30m' or '1h'). Defaults to '1h' and cannot exceed '1h'." - ttl: String + teamSlug: Slug! } -"Privilege level granted to a personal Postgres database role." -enum PostgresAccessLevel { - "Read data without modifying it." - READ - "Read and modify existing data." - READWRITE - "Read, modify, and create database objects where supported." - READWRITECREATE +type DeletePostgresBranchPayload { +""" +Whether the PostgresBranch was deleted. +""" + postgresBranchDeleted: Boolean } -"Input for creating a Postgres." -input CreatePostgresInput { +""" +Select the Postgres to delete. All branches and stored data are removed asynchronously by the platform. +""" +input DeletePostgresInput { +""" +Select the Postgres to delete. All branches and stored data are removed asynchronously by the platform. +""" name: String! - environmentName: String! +""" +Select the Postgres to delete. All branches and stored data are removed asynchronously by the platform. +""" teamSlug: Slug! - majorVersion: String! - highAvailability: Boolean - cpu: String - memory: String - diskSize: String +""" +Select the Postgres to delete. All branches and stored data are removed asynchronously by the platform. +""" + environmentName: String! } -"Result of creating a Postgres." -type CreatePostgresPayload { - postgres: Postgres! +""" +Result of accepting a Postgres deletion request, not proof of cleanup. +""" +type DeletePostgresPayload { +""" +True if Kubernetes accepted the deletion request; data deletion may still be pending. +""" + deletionRequested: Boolean! } -"Input for updating a Postgres. Omitted fields are left unchanged." -input UpdatePostgresInput { - name: String! - environmentName: String! - teamSlug: Slug! - highAvailability: Boolean - cpu: String - memory: String - diskSize: String -} - -"Result of updating a Postgres." -type UpdatePostgresPayload { - postgres: Postgres! -} - -"Recovery request for a new, inactive branch." -input CreatePostgresBranchInput { - postgres: String! - branch: String! - sourceBranch: String! - targetTime: Time! - environmentName: String! - teamSlug: Slug! -} - -"Result of creating a branch; provisioning continues asynchronously." -type CreatePostgresBranchPayload { - postgresBranch: PostgresBranch! -} - -"Select an available branch for normal workloads." -input ActivatePostgresBranchInput { - postgres: String! - branch: String! - environmentName: String! - teamSlug: Slug! -} - -"Result of requesting activation; compare desiredActiveBranch to activeBranch while reconciling." -type ActivatePostgresBranchPayload { - postgres: Postgres! -} - -"Select the Postgres to delete. All branches and stored data are removed asynchronously by the platform." -input DeletePostgresInput { - name: String! - teamSlug: Slug! - environmentName: String! -} - -"Result of accepting a Postgres deletion request, not proof of cleanup." -type DeletePostgresPayload { - deletionRequested: Boolean! -} - -input DeletePostgresBranchInput { - "Name of the Postgres containing the branch." - postgres: String! - "Local name of the branch to delete." - branch: String! - "The environment containing the PostgresBranch." - environmentName: String! - "The team that owns the PostgresBranch." - teamSlug: Slug! -} - -type DeletePostgresBranchPayload { -"Whether the PostgresBranch was deleted." - postgresBranchDeleted: Boolean -} - -input DeleteSecretInput { +input DeleteSecretInput { name: String! environment: String! team: Slug! @@ -3208,6 +3365,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -3772,6 +3933,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -3820,18 +3985,59 @@ The fields that changed during the apply. Only populated for updates. """ GitHub Actions OIDC token claims at the time of the apply. Only present when the request was authenticated via a GitHub token. """ - gitHubActorClaims: GitHubActorClaims + gitHubActorClaims: GitHubActorClaims @deprecated(reason: "Use gitHubActorClaims on the activity log entry instead.") } """ -GitHub Actions OIDC token claims captured at the time of an apply operation. +GitHub Actions OIDC token claims captured when an activity log entry is created. +See https://docs.github.com/en/actions/reference/security/oidc#custom-claims-provided-by-github """ type GitHubActorClaims { """ +The GitHub username that triggered the workflow. +""" + actor: String! +""" +The ID of the personal account that initiated the workflow run. +""" + actorID: String +""" +The target branch of the pull request in a workflow run. +""" + baseRef: String +""" +The check run ID of the current job. +""" + checkRunID: String +""" +The GitHub deployment environment name, if the job targets one. +""" + environment: String! +""" +The event that triggered the workflow, e.g. 'push' or 'workflow_dispatch'. +""" + eventName: String! +""" +The source branch of the pull request in a workflow run. +""" + headRef: String +""" +The ref of the reusable workflow called by this job, if any. E.g. 'org/repo/.github/workflows/deploy.yaml@refs/heads/main'. +""" + jobWorkflowRef: String! +""" +The commit SHA for the reusable workflow file, if the job uses one. +""" + jobWorkflowSha: String +""" The git ref that triggered the workflow, e.g. 'refs/heads/main'. """ ref: String! """ +The type of ref, e.g. 'branch'. +""" + refType: String +""" The repository name that triggered the workflow, e.g. 'org/repo'. """ repository: String! @@ -3840,45 +4046,45 @@ The immutable numeric GitHub repository ID. """ repositoryID: String! """ -The unique identifier of the Actions workflow run. Links to https://github.com//actions/runs/. +The name of the organization in which the repository is stored. """ - runID: String! + repositoryOwner: String +""" +The ID of the organization in which the repository is stored. +""" + repositoryOwnerID: String +""" +The visibility of the repository, e.g. 'internal', 'private', or 'public'. +""" + repositoryVisibility: String """ The attempt number of the workflow run (1-indexed). """ runAttempt: String! """ -The GitHub username that triggered the workflow. +The unique identifier of the Actions workflow run. Links to https://github.com//actions/runs/. """ - actor: String! + runID: String! """ -The path to the workflow file, e.g. '.github/workflows/deploy.yaml'. +The type of runner used by the job, e.g. 'github-hosted' or 'self-hosted'. """ - workflow: String! + runnerEnvironment: String """ -The event that triggered the workflow, e.g. 'push' or 'workflow_dispatch'. +The number of times this workflow has been run. """ - eventName: String! + runNumber: String """ -The GitHub deployment environment name, if the job targets one. +The path to the workflow file, e.g. '.github/workflows/deploy.yaml'. """ - environment: String! + workflow: String! """ -The ref of the reusable workflow called by this job, if any. E.g. 'org/repo/.github/workflows/deploy.yaml@refs/heads/main'. +The ref path to the workflow, e.g. 'org/repo/.github/workflows/deploy.yaml@refs/heads/main'. """ - jobWorkflowRef: String! -} - -input GrantPostgresAccessInput { - clusterName: String! - teamSlug: Slug! - environmentName: String! - grantee: String! - duration: String! -} - -type GrantPostgresAccessPayload { - error: String + workflowRef: String +""" +The commit SHA for the workflow file. +""" + workflowSha: String } """ @@ -3914,7 +4120,11 @@ Severity of the vulnerability. """ Priority of the vulnerability based on threat intelligence signals. """ - priority: CVEPriority! + priority: CVEPriority! @deprecated(reason: "Use riskAssessment.priority instead.") +""" +Risk and threat intelligence signals used to prioritize the image vulnerability. +""" + riskAssessment: VulnerabilityRiskAssessment! """ Description of the vulnerability. """ @@ -3924,38 +4134,46 @@ Package name of the vulnerability. """ package: String! """ -First known package version that contains a fix. +CVSS score of the vulnerability. """ - fixVersion: String - suppression: ImageVulnerabilitySuppression + cvssScore: Float @deprecated(reason: "Use riskAssessment.cvssScore instead.") """ -Timestamp of when the vulnerability got its current severity. +EPSS score of the vulnerability. """ - severitySince: Time + epssScore: Float @deprecated(reason: "Use riskAssessment.epssScore instead.") """ -Link to the vulnerability details. +EPSS percentile of the vulnerability (0-1). """ - vulnerabilityDetailsLink: String! + epssPercentile: Float @deprecated(reason: "Use riskAssessment.epssPercentile instead.") """ -CVSS score of the vulnerability. +Whether the vulnerability has a CISA KEV entry. """ - cvssScore: Float + hasKevEntry: Boolean! @deprecated(reason: "Use riskAssessment.hasKevEntry instead.") """ -EPSS score of the vulnerability. +Whether the vulnerability has known ransomware use. """ - epssScore: Float + knownRansomwareUse: Boolean! @deprecated(reason: "Use riskAssessment.knownRansomwareUse instead.") """ -EPSS percentile of the vulnerability (0-1). +Package version information used to remediate the image vulnerability. """ - epssPercentile: Float + remediation: VulnerabilityRemediation! """ -Whether the vulnerability has a CISA KEV entry. +First known package version that contains a fix. """ - hasKevEntry: Boolean! + fixVersion: String @deprecated(reason: "Use remediation.fixVersion instead.") """ -Whether the vulnerability has known ransomware use. +Latest available version of the package. """ - knownRansomwareUse: Boolean! + latestVersion: String @deprecated(reason: "Use remediation.latestVersion instead.") + suppression: ImageVulnerabilitySuppression +""" +Timestamp of when the vulnerability got its current severity. +""" + severitySince: Time +""" +Link to the vulnerability details. +""" + vulnerabilityDetailsLink: String! } type ImageVulnerabilityConnection { @@ -3996,6 +4214,14 @@ Input for filtering image vulnerabilities. Input for filtering image vulnerabilities. """ severitySince: Time +""" +Input for filtering image vulnerabilities. +""" + priorities: [CVEPriority!] +""" +Input for filtering image vulnerabilities. +""" + hasKevEntry: Boolean } type ImageVulnerabilityHistory { @@ -4123,9 +4349,13 @@ Vulnerability counts grouped by operational priority. """ type ImageVulnerabilitySummaryCountsByPriority { """ -Known-exploited vulnerabilities that require immediate action. +Deprecated. Always 0 at image and summary scope; use knownExploited for the KEV count. +""" + urgent: Int! @deprecated(reason: "Always 0 at image and summary scope. Use knownExploited for the KEV count.") +""" +Number of vulnerabilities with a CISA Known Exploited Vulnerabilities (KEV) entry. """ - urgent: Int! + knownExploited: Int! """ Vulnerabilities with strong exploitation indicators. """ @@ -4742,13 +4972,10 @@ Network policies for the job. OpenSearch instance referenced by the workload. """ openSearch: OpenSearch -"Active PostgresBranches for all Postgres entries in uses.postgres." - postgresBranches( """ -Ordering options for items returned from the connection. +Postgres databases referenced by uses.postgres, whether or not they have an active branch. """ - orderBy: PostgresBranchOrder - ): PostgresBranchConnection! + postgreses: PostgresConnection! """ Secrets used by the job. """ @@ -4842,6 +5069,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -4881,6 +5112,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -5057,6 +5292,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -5237,6 +5476,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -5275,6 +5518,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -5315,7 +5562,7 @@ The fields that changed during the update. """ GitHub Actions OIDC token claims at the time of the apply. Only present when the request was authenticated via a GitHub token. """ - gitHubActorClaims: GitHubActorClaims + gitHubActorClaims: GitHubActorClaims @deprecated(reason: "Use gitHubActorClaims on the activity log entry instead.") } type KafkaCredentials { @@ -5355,6 +5602,10 @@ The identity of the actor who performed the action. """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -5588,6 +5839,10 @@ The identity of the actor who performed the action. """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -6039,31 +6294,49 @@ Create temporary credentials for an OpenSearch instance. input: CreateOpenSearchCredentialsInput! ): CreateOpenSearchCredentialsPayload! """ -Grant temporary access to a Postgres cluster. -""" - grantPostgresAccess( - input: GrantPostgresAccessInput! - ): GrantPostgresAccessPayload! - """ - EXPERIMENTAL: DO NOT USE - Create time-limited personal access to a NAIS Postgres branch through the brokered PostgresAccess and relay flow. - When the access is ready, retrieve its connection materials through PostgresAccess.connection. - """ - createPostgresAccess(input: CreatePostgresAccessInput!): CreatePostgresAccessPayload! - "Create a new Postgres. Its first branch, main, is created and activated by the platform." - createPostgres(input: CreatePostgresInput!): CreatePostgresPayload! - "Update an existing Postgres. The PostgreSQL major version cannot be changed." - updatePostgres(input: UpdatePostgresInput!): UpdatePostgresPayload! - "Create an inactive PostgresBranch recovered from a source branch archive at a UTC point in time." - createPostgresBranch(input: CreatePostgresBranchInput!): CreatePostgresBranchPayload! - "Request activation of an available PostgresBranch. The observed active branch may lag behind the request." - activatePostgresBranch(input: ActivatePostgresBranchInput!): ActivatePostgresBranchPayload! -"Delete a PostgresBranch that is not active on its Postgres." +EXPERIMENTAL: DO NOT USE +Create time-limited personal access to a NAIS Postgres branch through the brokered PostgresAccess and relay flow. +When the access is ready, retrieve its connection materials through PostgresAccess.connection. +""" + createPostgresAccess( + input: CreatePostgresAccessInput! + ): CreatePostgresAccessPayload! +""" +Create a new Postgres. Its first branch, main, is created and activated by the platform. +""" + createPostgres( + input: CreatePostgresInput! + ): CreatePostgresPayload! +""" +Update an existing Postgres. The PostgreSQL major version cannot be changed. +""" + updatePostgres( + input: UpdatePostgresInput! + ): UpdatePostgresPayload! +""" +Create an inactive PostgresBranch recovered from a source branch archive at a UTC point in time. +""" + createPostgresBranch( + input: CreatePostgresBranchInput! + ): CreatePostgresBranchPayload! +""" +Request activation of an available PostgresBranch. The observed active branch may lag behind the request. +""" + activatePostgresBranch( + input: ActivatePostgresBranchInput! + ): ActivatePostgresBranchPayload! +""" +Delete a PostgresBranch that is not active on its Postgres. +""" deletePostgresBranch( input: DeletePostgresBranchInput! ): DeletePostgresBranchPayload! - "Request deletion of an entire Postgres and all its branches/data. Fails while workloads or bindings reference it; cleanup is asynchronous." - deletePostgres(input: DeletePostgresInput!): DeletePostgresPayload! +""" +Request deletion of an entire Postgres and all its branches/data. Fails while workloads or bindings reference it; cleanup is asynchronous. +""" + deletePostgres( + input: DeletePostgresInput! + ): DeletePostgresPayload! """ Enable a reconciler @@ -6581,6 +6854,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -6639,6 +6916,10 @@ The identity of the actor who performed the action. """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -6689,6 +6970,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -6944,6 +7229,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -7066,110 +7355,537 @@ interface Persistence { labels: [ResourceLabel!]! } -"A Postgres branch was created." -type PostgresBranchCreatedActivityLogEntry implements ActivityLogEntry & Node { - id: ID! - actor: String! - gitHubActorClaims: GitHubActorClaims - createdAt: Time! - message: String! - resourceType: ActivityLogEntryResourceType! - "Name of the Postgres containing the branch." - resourceName: String! - teamSlug: Slug! - environmentName: String - data: PostgresBranchActivityLogEntryData! -} - -"A request to activate a Postgres branch was accepted; the switchover may still be pending." -type PostgresBranchActivatedActivityLogEntry implements ActivityLogEntry & Node { - id: ID! - actor: String! - gitHubActorClaims: GitHubActorClaims - createdAt: Time! - message: String! - resourceType: ActivityLogEntryResourceType! - "Name of the Postgres containing the branch." - resourceName: String! - teamSlug: Slug! - environmentName: String - data: PostgresBranchActivityLogEntryData! -} - -"A Postgres branch was deleted." -type PostgresBranchDeletedActivityLogEntry implements ActivityLogEntry & Node { - id: ID! - actor: String! - gitHubActorClaims: GitHubActorClaims - createdAt: Time! - message: String! - resourceType: ActivityLogEntryResourceType! - "Name of the Postgres containing the branch." - resourceName: String! - teamSlug: Slug! - environmentName: String - data: PostgresBranchActivityLogEntryData! -} - -# Kept for CLI compatibility with API versions deployed before the branch activity split. -type PostgresBranchActivityLogEntry implements ActivityLogEntry & Node { +""" +A Postgres whose active branch can change. +""" +type Postgres implements Node & ActivityLogger{ +""" +Opaque identifier for this Postgres. +""" id: ID! - actor: String! - gitHubActorClaims: GitHubActorClaims - createdAt: Time! - message: String! - resourceType: ActivityLogEntryResourceType! +""" +Team environment containing this Postgres. +""" + teamEnvironment: TeamEnvironment! +""" +Name of this Postgres. +""" + name: String! +""" +Configured PostgreSQL major version. +""" + majorVersion: String! +""" +Whether high availability is configured. +""" + highAvailability: Boolean! +""" +Requested CPU, memory and disk size, when present on this Postgres. +""" + resources: PostgresResources! +""" +Branch requested for activation; may differ from the observed active branch while reconciliation runs. +""" + desiredActiveBranch: String +""" +Currently observed active branch, if selected. +""" + activeBranch: PostgresBranch +""" +Branch with this local name in this Postgres. +""" + branch( + name: String! + ): PostgresBranch! +""" +Branches belonging to this Postgres. +""" + branches( + first: Int + after: Cursor + last: Int + before: Cursor + orderBy: PostgresBranchOrder + ): PostgresBranchConnection! +""" +User-defined labels on this Postgres. +""" + labels: [ResourceLabel!]! +""" +Activity log associated with this Postgres. +""" + activityLog( +""" +Get the first n items in the connection. This can be used in combination with the after parameter. +""" + first: Int +""" +Get items after this cursor. +""" + after: Cursor +""" +Get the last n items in the connection. This can be used in combination with the before parameter. +""" + last: Int +""" +Get items before this cursor. +""" + before: Cursor +""" +Filter items. +""" + filter: ActivityLogFilter + ): ActivityLogEntryConnection! +} + +""" +A time-limited personal access request for a Postgres branch. +""" +type PostgresAccess implements Node{ +""" +Opaque ID for this PostgresAccess resource. +""" + id: ID! +""" +Name of the PostgresAccess resource. +""" + name: String! +""" +Team that owns the access. +""" + team: Team! +""" +Environment for the access. +""" + teamEnvironment: TeamEnvironment! +""" +PostgresBranch selected by this access. +""" + postgresBranch: PostgresBranch! +""" +Requested access level. +""" + accessLevel: PostgresAccessLevel! +""" +Server-controlled expiry for this personal access. +""" + expiresAt: Time! +""" +High-level state of the access. +""" + state: PostgresAccessState! +""" +Human-readable message for the current state. +""" + message: String +""" +Name of the controller-owned relay mapping, once created. Contains no credential. +""" + relayAccess: String +""" +EXPERIMENTAL: DO NOT USE +Get connection materials for this ready access. Only its owner can read them. +""" + connection: PostgresAccessConnectionDetails +} + +""" +Sensitive connection materials for a ready personal Postgres access. +""" +type PostgresAccessConnectionDetails { +""" +Database username for the caller's personal role. +""" + username: String! +""" +Short-lived password for the caller's database role. +""" + password: String! +""" +CA certificate required to verify the PostgreSQL server certificate. +""" + caCertificate: String! +""" +PostgreSQL server name used for TLS verification. +""" + serverName: String! +""" +Public HTTP/3 relay endpoint. +""" + relayEndpoint: String! +""" +Relay-Access header value (namespace/name). +""" + relayAccess: String! +""" +Owner-only bearer token for this access; never log it. +""" + relayToken: String! +} + +""" +Privilege level granted to a personal Postgres database role. +""" +enum PostgresAccessLevel { +""" +Read data without modifying it. +""" + READ +""" +Read and modify existing data. +""" + READWRITE +""" +Read, modify, and create database objects where supported. +""" + READWRITECREATE +} + +""" +High-level reconciliation state of a personal Postgres access. +""" +enum PostgresAccessState { +""" +The controller has not finished provisioning the access. +""" + PENDING +""" +The access and its connection materials are ready. +""" + READY +""" +The controller cannot provision the requested access. +""" + FAILED +""" +The server-controlled expiry time has passed. +""" + EXPIRED +} + +""" +A named PostgresBranch belonging to a Postgres. +""" +type PostgresBranch implements Persistence & Node{ + id: ID! +""" +Local name of this branch within its Postgres. +""" + name: String! + team: Team! + teamEnvironment: TeamEnvironment! +""" +Postgres owning this PostgresBranch. +""" + postgres: Postgres! +""" +Workloads explicitly using this branch, or following it while it is active. +""" + workloads( +""" +Get the first n items in the connection. This can be used in combination with the after parameter. +""" + first: Int +""" +Get items after this cursor. +""" + after: Cursor +""" +Get the last n items in the connection. This can be used in combination with the before parameter. +""" + last: Int +""" +Get items before this cursor. +""" + before: Cursor + ): WorkloadConnection! +""" +Current observed state of the branch. +""" + state: PostgresBranchState! +""" +User-defined labels on this branch. +""" + labels: [ResourceLabel!]! +} + +""" +A request to activate a Postgres branch was accepted; the switchover may still be pending. +""" +type PostgresBranchActivatedActivityLogEntry implements ActivityLogEntry & Node{ + id: ID! + actor: String! + gitHubActorClaims: GitHubActorClaims + createdAt: Time! + message: String! + resourceType: ActivityLogEntryResourceType! +""" +Name of the Postgres containing the branch. +""" + resourceName: String! + teamSlug: Slug! + environmentName: String + data: PostgresBranchActivityLogEntryData! +} + +type PostgresBranchActivityLogEntryData { + branch: String! +""" +Source branch, populated for branch creation. +""" + sourceBranch: String +""" +Recovery instant, populated for branch creation. +""" + targetTime: Time +} + +type PostgresBranchConnection { + pageInfo: PageInfo! + nodes: [PostgresBranch!]! + edges: [PostgresBranchEdge!]! +""" +Facets for Postgres branches. Provides distribution counts to help narrow down results. +Facet counts are computed over the full result set (ignoring pagination) but respect the current filter. +""" + facets: PostgresBranchFacets +} + +""" +A Postgres branch was created. +""" +type PostgresBranchCreatedActivityLogEntry implements ActivityLogEntry & Node{ + id: ID! + actor: String! + gitHubActorClaims: GitHubActorClaims + createdAt: Time! + message: String! + resourceType: ActivityLogEntryResourceType! +""" +Name of the Postgres containing the branch. +""" resourceName: String! teamSlug: Slug! environmentName: String data: PostgresBranchActivityLogEntryData! } -type PostgresBranchActivityLogEntryData { - branch: String! - "Source branch, populated for branch creation." - sourceBranch: String - "Recovery instant, populated for branch creation." - targetTime: Time +""" +A Postgres branch was deleted. +""" +type PostgresBranchDeletedActivityLogEntry implements ActivityLogEntry & Node{ + id: ID! + actor: String! + gitHubActorClaims: GitHubActorClaims + createdAt: Time! + message: String! + resourceType: ActivityLogEntryResourceType! +""" +Name of the Postgres containing the branch. +""" + resourceName: String! + teamSlug: Slug! + environmentName: String + data: PostgresBranchActivityLogEntryData! +} + +type PostgresBranchEdge { + cursor: Cursor! + node: PostgresBranch! +} + +""" +Facets for Postgres branches, providing distribution counts across different dimensions. +""" +type PostgresBranchFacets { +""" +Distribution of branches by environment. +""" + environments: [StringFacetItem!]! +""" +Distribution of branches by state. +""" + states: [PostgresBranchStateFacetItem!]! +""" +Distribution of branches by user-defined labels. +""" + labels: [LabelFacetItem!]! +} + +""" +Input for filtering Postgres branches. +""" +input PostgresBranchFilter { +""" +Input for filtering Postgres branches. +""" + name: String +""" +Input for filtering Postgres branches. +""" + environments: [String!] +""" +Input for filtering Postgres branches. +""" + states: [PostgresBranchState!] +""" +Input for filtering Postgres branches. +""" + labels: [LabelFilter!] +} + +input PostgresBranchOrder { + field: PostgresBranchOrderField! + direction: OrderDirection! +} + +enum PostgresBranchOrderField { + NAME + ENVIRONMENT +} + +""" +Reconciliation and observed health of a PostgresBranch. +""" +enum PostgresBranchState { +""" +The branch is healthy and ready. +""" + AVAILABLE +""" +The branch is provisioning or its state has not been observed yet. +""" + PROGRESSING +""" +The branch has reported a failure. +""" + DEGRADED +} + +""" +A single facet item for Postgres branch states. +""" +type PostgresBranchStateFacetItem { +""" +The Postgres branch state. +""" + state: PostgresBranchState! +""" +Number of matching branches. +""" + count: Int! +} + +""" +A paginated list of Postgres databases. +""" +type PostgresConnection { + pageInfo: PageInfo! + nodes: [Postgres!]! + edges: [PostgresEdge!]! +""" +Labels across team Postgres databases, independent of pagination. +""" + facets: PostgresFacets! } -type PostgresCreatedActivityLogEntry implements ActivityLogEntry & Node { +""" +Activity log entry for a Postgres that was created. +""" +type PostgresCreatedActivityLogEntry implements ActivityLogEntry & Node{ +""" +ID of the entry. +""" id: ID! +""" +The identity of the actor who performed the action. The value is either the name of a service account, or the email address of a user. +""" actor: String! +""" +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" gitHubActorClaims: GitHubActorClaims +""" +Creation time of the entry. +""" createdAt: Time! +""" +Message that summarizes the entry. +""" message: String! +""" +Type of the resource that was affected by the action. +""" resourceType: ActivityLogEntryResourceType! +""" +Name of the resource that was affected by the action. +""" resourceName: String! +""" +The team slug that the entry belongs to. +""" teamSlug: Slug! +""" +The environment name that the entry belongs to. +""" environmentName: String } -"Activity log entry for a Postgres that was updated." -type PostgresUpdatedActivityLogEntry implements ActivityLogEntry & Node { +type PostgresDeletedActivityLogEntry implements ActivityLogEntry & Node{ +""" +ID of the entry. +""" id: ID! +""" +The identity of the actor who performed the action. The value is either the name of a service account, or the email address of a user. +""" actor: String! +""" +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" gitHubActorClaims: GitHubActorClaims +""" +Creation time of the entry. +""" createdAt: Time! +""" +Message that summarizes the entry. +""" message: String! +""" +Type of the resource that was affected by the action. +""" resourceType: ActivityLogEntryResourceType! +""" +Name of the resource that was affected by the action. +""" resourceName: String! +""" +The team slug that the entry belongs to. +""" teamSlug: Slug! +""" +The environment name that the entry belongs to. +""" environmentName: String - data: PostgresUpdatedActivityLogEntryData! } -type PostgresUpdatedActivityLogEntryData { - updatedFields: [PostgresUpdatedActivityLogEntryDataUpdatedField!]! +type PostgresEdge { + cursor: Cursor! + node: Postgres! } -type PostgresUpdatedActivityLogEntryDataUpdatedField { - field: String! - oldValue: String - newValue: String +""" +Facets for Postgres databases. +""" +type PostgresFacets { +""" +User-defined labels on team Postgres databases. +""" + labels: [LabelFacetItem!]! } -type PostgresDeletedActivityLogEntry implements ActivityLogEntry & Node{ +type PostgresGrantAccessActivityLogEntry implements ActivityLogEntry & Node{ """ ID of the entry. """ @@ -7178,7 +7894,9 @@ ID of the entry. The identity of the actor who performed the action. The value is either the name of a service account, or the email address of a user. """ actor: String! - "GitHub Actions OIDC claims when authenticated by a GitHub repository." +""" +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" gitHubActorClaims: GitHubActorClaims """ Creation time of the entry. @@ -7199,14 +7917,154 @@ Name of the resource that was affected by the action. """ The team slug that the entry belongs to. """ - teamSlug: Slug! + teamSlug: Slug! +""" +The environment name that the entry belongs to. +""" + environmentName: String +""" +Data associated with the update. +""" + data: PostgresGrantAccessActivityLogEntryData! +} + +type PostgresGrantAccessActivityLogEntryData { + grantee: String! + until: Time! +} + +""" +An audit-log entry for retrieval of personal Postgres connection materials. +""" +type PostgresPersonalAccessConnectionActivityLogEntry implements ActivityLogEntry & Node{ +""" +ID of the entry. +""" + id: ID! +""" +Identity that retrieved the connection materials. +""" + actor: String! +""" +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" +Creation time of the entry. +""" + createdAt: Time! +""" +Message that summarizes the entry. +""" + message: String! +""" +Type of the affected resource. +""" + resourceType: ActivityLogEntryResourceType! +""" +Name of the affected PostgresAccess resource. +""" + resourceName: String! +""" +Team slug that the entry belongs to. +""" + teamSlug: Slug! +""" +Environment name that the entry belongs to. +""" + environmentName: String +} + +""" +An audit-log entry for personal Postgres access created through the API broker. +""" +type PostgresPersonalAccessCreatedActivityLogEntry implements ActivityLogEntry & Node{ +""" +ID of the entry. +""" + id: ID! +""" +The identity of the actor who created the personal access. +""" + actor: String! +""" +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" +Creation time of the entry. +""" + createdAt: Time! +""" +Message that summarizes the entry. +""" + message: String! +""" +Type of the affected resource. +""" + resourceType: ActivityLogEntryResourceType! +""" +Name of the affected Postgres branch. +""" + resourceName: String! +""" +The team slug that the entry belongs to. +""" + teamSlug: Slug! +""" +The environment name that the entry belongs to. +""" + environmentName: String +""" +Personal-access specific audit data. +""" + data: PostgresPersonalAccessCreatedActivityLogEntryData! +} + +""" +Personal-access-specific audit data. +""" +type PostgresPersonalAccessCreatedActivityLogEntryData { +""" +Identity that owns the new personal access. +""" + username: String! +""" +Requested privilege level; null for events recorded before this field was added. +""" + accessLevel: PostgresAccessLevel +""" +Server-controlled expiry of the access. +""" + expiresAt: Time! +""" +Caller-provided audit reason. +""" + reason: String! +} + +""" +Resource requests configured on Postgres. Omitted requests are null. +""" +type PostgresResources { +""" +Requested CPU. +""" + cpu: String +""" +Requested memory. +""" + memory: String """ -The environment name that the entry belongs to. +Requested disk size. """ - environmentName: String + diskSize: String } -type PostgresGrantAccessActivityLogEntry implements ActivityLogEntry & Node{ +""" +Activity log entry for a Postgres that was updated. +""" +type PostgresUpdatedActivityLogEntry implements ActivityLogEntry & Node{ """ ID of the entry. """ @@ -7215,7 +8073,9 @@ ID of the entry. The identity of the actor who performed the action. The value is either the name of a service account, or the email address of a user. """ actor: String! - "GitHub Actions OIDC claims when authenticated by a GitHub repository." +""" +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" gitHubActorClaims: GitHubActorClaims """ Creation time of the entry. @@ -7242,297 +8102,37 @@ The environment name that the entry belongs to. """ environmentName: String """ -Data associated with the update. +Data associated with the entry. """ - data: PostgresGrantAccessActivityLogEntryData! -} - -type PostgresGrantAccessActivityLogEntryData { - grantee: String! - until: Time! -} - -"An audit-log entry for personal Postgres access created through the API broker." -type PostgresPersonalAccessCreatedActivityLogEntry implements ActivityLogEntry & Node { - "ID of the entry." - id: ID! - "The identity of the actor who created the personal access." - actor: String! - "GitHub Actions OIDC claims when authenticated by a GitHub repository." - gitHubActorClaims: GitHubActorClaims - "Creation time of the entry." - createdAt: Time! - "Message that summarizes the entry." - message: String! - "Type of the affected resource." - resourceType: ActivityLogEntryResourceType! - "Name of the affected Postgres branch." - resourceName: String! - "The team slug that the entry belongs to." - teamSlug: Slug! - "The environment name that the entry belongs to." - environmentName: String - "Personal-access specific audit data." - data: PostgresPersonalAccessCreatedActivityLogEntryData! -} - -"Personal-access-specific audit data." -type PostgresPersonalAccessCreatedActivityLogEntryData { - "Identity that owns the new personal access." - username: String! - "Requested privilege level; null for events recorded before this field was added." - accessLevel: PostgresAccessLevel - "Server-controlled expiry of the access." - expiresAt: Time! - "Caller-provided audit reason." - reason: String! -} - -"An audit-log entry for retrieval of personal Postgres connection materials." -type PostgresPersonalAccessConnectionActivityLogEntry implements ActivityLogEntry & Node { - "ID of the entry." - id: ID! - "Identity that retrieved the connection materials." - actor: String! - "GitHub Actions OIDC claims when authenticated by a GitHub repository." - gitHubActorClaims: GitHubActorClaims - "Creation time of the entry." - createdAt: Time! - "Message that summarizes the entry." - message: String! - "Type of the affected resource." - resourceType: ActivityLogEntryResourceType! - "Name of the affected PostgresAccess resource." - resourceName: String! - "Team slug that the entry belongs to." - teamSlug: Slug! - "Environment name that the entry belongs to." - environmentName: String + data: PostgresUpdatedActivityLogEntryData! } -"A named PostgresBranch belonging to a Postgres." -type PostgresBranch implements Persistence & Node{ - id: ID! - "Local name of this branch within its Postgres." - name: String! - team: Team! - teamEnvironment: TeamEnvironment! - "Postgres owning this PostgresBranch." - postgres: Postgres! - "Workloads using this branch while it is active." - workloads( """ -Get the first n items in the connection. This can be used in combination with the after parameter. +Data associated with a Postgres update. """ - first: Int +type PostgresUpdatedActivityLogEntryData { """ -Get items after this cursor. +The fields that were changed. """ - after: Cursor + updatedFields: [PostgresUpdatedActivityLogEntryDataUpdatedField!]! +} + """ -Get the last n items in the connection. This can be used in combination with the before parameter. +A single field that was changed by a Postgres update. """ - last: Int +type PostgresUpdatedActivityLogEntryDataUpdatedField { """ -Get items before this cursor. +The name of the field. """ - before: Cursor - ): WorkloadConnection! -"Current observed state of the branch." - state: PostgresBranchState! - "User-defined labels on this branch." - labels: [ResourceLabel!]! -} - -"A Postgres whose active branch can change." -type Postgres implements Node { - "Opaque identifier for this Postgres." - id: ID! - "Team environment containing this Postgres." - teamEnvironment: TeamEnvironment! - "Name of this Postgres." - name: String! - "Configured PostgreSQL major version." - majorVersion: String! - "Whether high availability is configured." - highAvailability: Boolean! - "Requested CPU, memory and disk size, when present on this Postgres." - resources: PostgresResources! - "Branch requested for activation; may differ from the observed active branch while reconciliation runs." - desiredActiveBranch: String - "Currently observed active branch, if selected." - activeBranch: PostgresBranch - "Branch with this local name in this Postgres." - branch(name: String!): PostgresBranch! - "Branches belonging to this Postgres." - branches(first: Int, after: Cursor, last: Int, before: Cursor, orderBy: PostgresBranchOrder): PostgresBranchConnection! - "User-defined labels on this Postgres." - labels: [ResourceLabel!]! -} - -"A paginated list of Postgres databases." -type PostgresConnection { - pageInfo: PageInfo! - nodes: [Postgres!]! - edges: [PostgresEdge!]! - "Labels across team Postgres databases, independent of pagination." - facets: PostgresFacets! -} - -"Facets for Postgres databases." -type PostgresFacets { - "User-defined labels on team Postgres databases." - labels: [LabelFacetItem!]! -} - -type PostgresEdge { - cursor: Cursor! - node: Postgres! -} - -"Filter a team's Postgres databases by environment and user-defined labels." -input TeamPostgresFilter { - "Filter by environments." - environments: [String!] - "All listed labels must match." - labels: [LabelFilter!] -} - -"Resource requests configured on Postgres. Omitted requests are null." -type PostgresResources { - "Requested CPU." - cpu: String - "Requested memory." - memory: String - "Requested disk size." - diskSize: String -} - -"A time-limited personal access request for a Postgres branch." -type PostgresAccess implements Node { - "Opaque ID for this PostgresAccess resource." - id: ID! - "Name of the PostgresAccess resource." - name: String! - "Team that owns the access." - team: Team! - "Environment for the access." - teamEnvironment: TeamEnvironment! - "PostgresBranch selected by this access." - postgresBranch: PostgresBranch! - "Requested access level." - accessLevel: PostgresAccessLevel! - "Server-controlled expiry for this personal access." - expiresAt: Time! - "High-level state of the access." - state: PostgresAccessState! - "Human-readable message for the current state." - message: String - "Name of the controller-owned relay mapping, once created. Contains no credential." - relayAccess: String - """ - EXPERIMENTAL: DO NOT USE - Get connection materials for this ready access. Only its owner can read them. - """ - connection: PostgresAccessConnectionDetails -} - -"High-level reconciliation state of a personal Postgres access." -enum PostgresAccessState { - "The controller has not finished provisioning the access." - PENDING - "The access and its connection materials are ready." - READY - "The controller cannot provision the requested access." - FAILED - "The server-controlled expiry time has passed." - EXPIRED -} - -"Sensitive connection materials for a ready personal Postgres access." -type PostgresAccessConnectionDetails { - "Database username for the caller's personal role." - username: String! - "Short-lived password for the caller's database role." - password: String! - "CA certificate required to verify the PostgreSQL server certificate." - caCertificate: String! - "PostgreSQL server name used for TLS verification." - serverName: String! - "Public HTTP/3 relay endpoint." - relayEndpoint: String! - "Relay-Access header value (namespace/name)." - relayAccess: String! - "Owner-only bearer token for this access; never log it." - relayToken: String! -} - -type PostgresBranchConnection { - pageInfo: PageInfo! - nodes: [PostgresBranch!]! - edges: [PostgresBranchEdge!]! + field: String! """ -Facets for Postgres branches. Provides distribution counts to help narrow down results. -Facet counts are computed over the full result set (ignoring pagination) but respect the current filter. +The old value of the field, if it had one. """ - facets: PostgresBranchFacets -} - -type PostgresBranchEdge { - cursor: Cursor! - node: PostgresBranch! -} - + oldValue: String """ -Facets for Postgres branches, providing distribution counts across different dimensions. +The new value of the field. """ -type PostgresBranchFacets { - "Distribution of branches by environment." - environments: [StringFacetItem!]! - "Distribution of branches by state." - states: [PostgresBranchStateFacetItem!]! - "Distribution of branches by user-defined labels." - labels: [LabelFacetItem!]! -} - -"Input for filtering Postgres branches." -input PostgresBranchFilter { - "Filter by the name of the branch." - name: String - "Filter by environments." - environments: [String!] - "Filter by branch state." - states: [PostgresBranchState!] - "Filter by user-defined labels. All listed labels must match." - labels: [LabelFilter!] -} - -input PostgresBranchOrder { - field: PostgresBranchOrderField! - direction: OrderDirection! -} - -enum PostgresBranchOrderField { - NAME - ENVIRONMENT -} - -"Reconciliation and observed health of a PostgresBranch." -enum PostgresBranchState { - "The branch is healthy and ready." - AVAILABLE - "The branch is provisioning or its state has not been observed yet." - PROGRESSING - "The branch has reported a failure." - DEGRADED -} - -"A single facet item for Postgres branch states." -type PostgresBranchStateFacetItem { - "The Postgres branch state." - state: PostgresBranchState! - "Number of matching branches." - count: Int! + newValue: String } type Price { @@ -7925,6 +8525,35 @@ Get the vulnerability summary for the tenant. """ vulnerabilitySummary: TenantVulnerabilitySummary! """ +List per-workload vulnerability summaries across all teams. +""" + vulnerabilitySummaries( +""" +Get the first n items in the connection. This can be used in combination with the after parameter. +""" + first: Int +""" +Get items after this cursor. +""" + after: Cursor +""" +Get the last n items in the connection. This can be used in combination with the before parameter. +""" + last: Int +""" +Get items before this cursor. +""" + before: Cursor +""" +Filter workload vulnerability summaries across all teams. +""" + filter: TenantVulnerabilitySummaryFilter +""" +Order workload vulnerability summaries across all teams. +""" + orderBy: VulnerabilitySummaryOrder + ): WorkloadVulnerabilitySummaryConnection! +""" Get the mean time to fix history for all teams. """ vulnerabilityFixHistory( @@ -7960,6 +8589,10 @@ Get items before this cursor. Ordering options for items returned from the connection. """ orderBy: CVEOrder +""" +Filter CVEs before pagination. Totals cover the entire filtered selection. +""" + filter: CVEFilter ): CVEConnection! } @@ -8097,6 +8730,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -8158,6 +8795,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -8204,6 +8845,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -8374,6 +9019,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -8456,6 +9105,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -8615,6 +9268,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -8725,6 +9382,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -9066,6 +9727,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -9101,6 +9766,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -9207,6 +9876,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -9283,6 +9956,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -9335,6 +10012,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -9381,6 +10062,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -9430,6 +10115,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -9620,6 +10309,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -9655,6 +10348,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -9747,6 +10444,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -9793,6 +10494,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -9850,6 +10555,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -9915,6 +10624,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -10020,6 +10733,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -10100,6 +10817,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -10180,6 +10901,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -10951,12 +11676,29 @@ Filtering options for items returned from the connection. """ filter: OpenSearchFilter ): OpenSearchConnection! -"Postgres databases owned by the team, including those without branches." +""" +Postgres databases owned by the team, including those without branches. +""" postgreses( +""" +Get the first n items in the connection. This can be used in combination with the after parameter. +""" first: Int +""" +Get items after this cursor. +""" after: Cursor +""" +Get the last n items in the connection. This can be used in combination with the before parameter. +""" last: Int +""" +Get items before this cursor. +""" before: Cursor +""" +Filter Postgres databases by environment or labels. +""" filter: TeamPostgresFilter ): PostgresConnection! repositories( @@ -11230,6 +11972,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -11335,6 +12081,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -11370,6 +12120,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -11428,6 +12182,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -11578,15 +12336,19 @@ OpenSearch instance in the team environment. Postgres in the team environment. """ postgres( - "Name of the Postgres in this team environment." +""" +Name of the Postgres in this team environment. +""" name: String! ): Postgres! - """ - EXPERIMENTAL: DO NOT USE - Get a PostgresAccess and its state. Available to authorized team members. - """ +""" +EXPERIMENTAL: DO NOT USE +Get a PostgresAccess and its state. Available to authorized team members. +""" postgresAccess( - "Name of the PostgresAccess in this team environment." +""" +Name of the PostgresAccess in this team environment. +""" name: String! ): PostgresAccess! """ @@ -11658,6 +12420,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -11740,6 +12506,10 @@ input TeamFilter { Input for filtering teams. """ hasWorkloads: Boolean +""" +Input for filtering teams. +""" + vulnerabilityPriorityGroup: TeamVulnerabilityPriorityGroup } type TeamGitHubTeam { @@ -11932,6 +12702,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -12044,6 +12818,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -12108,6 +12886,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -12206,6 +12988,24 @@ The accumulated number of unassigned vulnerabilities of the teams workloads. The team's software bill of materials (SBOM) coverage. """ SBOM_COVERAGE +""" +The accumulated number of known exploited vulnerabilities (KEV) of the teams workloads. +""" + KNOWN_EXPLOITED_VULNERABILITIES +} + +""" +Filter a team's Postgres databases by environment and user-defined labels. +""" +input TeamPostgresFilter { +""" +Filter a team's Postgres databases by environment and user-defined labels. +""" + environments: [String!] +""" +Filter a team's Postgres databases by environment and user-defined labels. +""" + labels: [LabelFilter!] } input TeamRepositoryFilter { @@ -12250,6 +13050,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -12320,6 +13124,28 @@ The environment for the utilization data. teamEnvironment: TeamEnvironment! } +""" +Mutually exclusive groups based on the highest operational vulnerability priority. +""" +enum TeamVulnerabilityPriorityGroup { +""" +At least one high-risk finding. +""" + HIGH +""" +No high-risk findings and at least one elevated-risk finding. +""" + ELEVATED +""" +No high-risk or elevated-risk findings and at least one monitor finding. +""" + MONITOR +""" +A valid summary confirms no high-risk, elevated-risk or monitor findings. +""" + NONE +} + enum TeamVulnerabilityRiskScoreTrend { """ Risk score is increasing. @@ -12349,6 +13175,33 @@ Vulnerability counts grouped by operational priority. """ countsByPriority: ImageVulnerabilitySummaryCountsByPriority! """ +Number of workloads whose highest vulnerability priority is HIGH. + +Counts workloads, not findings. Use countsByPriority.highRisk for the number +of findings. Each workload is counted under exactly one priority, and +workloads without unsuppressed findings are not counted at all, so these +counts do not necessarily sum to the total number of workloads. +""" + highWorkloadCount: Int! +""" +Number of workloads whose highest vulnerability priority is ELEVATED. + +Counts workloads, not findings. Use countsByPriority.elevatedRisk for the +number of findings. Each workload is counted under exactly one priority, and +workloads without unsuppressed findings are not counted at all, so these +counts do not necessarily sum to the total number of workloads. +""" + elevatedWorkloadCount: Int! +""" +Number of workloads whose highest vulnerability priority is MONITOR. + +Counts workloads, not findings. Use countsByPriority.monitor for the number +of findings. Each workload is counted under exactly one priority, and +workloads without unsuppressed findings are not counted at all, so these +counts do not necessarily sum to the total number of workloads. +""" + monitorWorkloadCount: Int! +""" Number of vulnerabilities with severity CRITICAL. """ critical: Int! @deprecated(reason: "Use countsBySeverity.critical instead.") @@ -12396,8 +13249,16 @@ Input for filtering team vulnerability summaries. environmentName: String """ Input for filtering team vulnerability summaries. +""" + priorities: [CVEPriority!] +""" +Input for filtering team vulnerability summaries. """ priority: CVEPriority +""" +Input for filtering team vulnerability summaries. +""" + hasKevEntry: Boolean } """ @@ -12412,6 +13273,10 @@ Input for filtering team workloads. Input for filtering team workloads. """ labels: [LabelFilter!] +""" +Input for filtering team workloads. +""" + sbomStatus: SBOMStatus } type TenantVulnerabilitySummary { @@ -12461,6 +13326,20 @@ Timestamp of the last update of the vulnerability summary. lastUpdated: Time } +""" +Input for filtering vulnerability summaries across all teams. +""" +input TenantVulnerabilitySummaryFilter { +""" +Input for filtering vulnerability summaries across all teams. +""" + priorities: [CVEPriority!] +""" +Input for filtering vulnerability summaries across all teams. +""" + hasKevEntry: Boolean +} + """ Time is a string in [RFC 3339](https://rfc-editor.org/rfc/rfc3339.html) format, with sub-second precision added if present. """ @@ -12549,6 +13428,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -12599,6 +13482,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -12702,6 +13589,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -12737,6 +13628,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -12781,6 +13676,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -13043,6 +13942,50 @@ OpenSearch instance that was updated. openSearch: OpenSearch! } +""" +Input for updating a Postgres. Omitted fields are left unchanged. +""" +input UpdatePostgresInput { +""" +Input for updating a Postgres. Omitted fields are left unchanged. +""" + name: String! +""" +Input for updating a Postgres. Omitted fields are left unchanged. +""" + environmentName: String! +""" +Input for updating a Postgres. Omitted fields are left unchanged. +""" + teamSlug: Slug! +""" +Input for updating a Postgres. Omitted fields are left unchanged. +""" + highAvailability: Boolean +""" +Input for updating a Postgres. Omitted fields are left unchanged. +""" + cpu: String +""" +Input for updating a Postgres. Omitted fields are left unchanged. +""" + memory: String +""" +Input for updating a Postgres. Omitted fields are left unchanged. +""" + diskSize: String +} + +""" +Result of updating a Postgres. +""" +type UpdatePostgresPayload { +""" +The Postgres that was updated. +""" + postgres: Postgres! +} + input UpdateSecretInput { name: String! environmentName: String! @@ -13145,6 +14088,7 @@ input UpdateValkeyInput { teamSlug: Slug! tier: ValkeyTier! memory: ValkeyMemory! + version: ValkeyMajorVersion maxMemoryPolicy: ValkeyMaxMemoryPolicy notifyKeyspaceEvents: String databases: Int @@ -13514,6 +14458,10 @@ User-defined labels attached to the instance. workload: Workload @deprecated(reason: "Owners of valkeys have been removed, so this will always be null.") state: ValkeyState! """ +Fetch version for the Valkey instance. +""" + version: ValkeyVersion! +""" Availability tier for the Valkey instance. """ tier: ValkeyTier! @@ -13649,6 +14597,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -13707,6 +14659,10 @@ The identity of the actor who performed the action. """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -13757,6 +14713,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -13906,6 +14866,17 @@ The ValkeyMaintenanceUpdate. node: ValkeyMaintenanceUpdate! } +enum ValkeyMajorVersion { +""" +Valkey Version 9.1.x. Default for new instances. +""" + V9_1 +""" +Valkey Version 8.1.x +""" + V8_1 +} + enum ValkeyMaxMemoryPolicy { """ Keeps frequently used keys; removes least frequently used (LFU) keys @@ -14026,6 +14997,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -14074,6 +15049,17 @@ The new value of the field. newValue: String } +type ValkeyVersion { +""" +The full version string of the Valkey instance. This will be available after the instance is created. +""" + actual: String +""" +The desired major version of the Valkey instance. +""" + desiredMajor: ValkeyMajorVersion! +} + """ Encoding of a secret or config value. """ @@ -14187,6 +15173,50 @@ Total number of workloads with this severity of vulnerabilities. totalWorkloads: Int! } +""" +Package version information that helps remediate an image vulnerability. +""" +type VulnerabilityRemediation { +""" +First known package version that contains a fix. +""" + fixVersion: String +""" +Latest available version of the package, which may include changes beyond the fix. +""" + latestVersion: String +} + +""" +Threat intelligence and scoring signals used to prioritize a vulnerability. +""" +type VulnerabilityRiskAssessment { +""" +Operational priority derived from the available risk signals. +""" + priority: CVEPriority! +""" +CVSS score of the vulnerability. +""" + cvssScore: Float +""" +EPSS score, representing the estimated probability of exploitation. +""" + epssScore: Float +""" +EPSS percentile of the vulnerability as a percentage (0-100). +""" + epssPercentile: Float +""" +Whether the vulnerability has a CISA Known Exploited Vulnerabilities (KEV) entry. +""" + hasKevEntry: Boolean! +""" +Whether the vulnerability is known to be used in ransomware attacks. +""" + knownRansomwareUse: Boolean! +} + """ Ordering options when fetching vulnerability summaries for workloads. """ @@ -14235,12 +15265,9 @@ Order by vulnerability severity unassigned. """ VULNERABILITY_SEVERITY_UNASSIGNED """ -Order by the number of urgent vulnerabilities. - -Urgent vulnerabilities are known to be actively exploited and should be -prioritized for immediate action. +Deprecated. URGENT requires workload internet exposure and cannot be ordered at summary scope. """ - VULNERABILITY_PRIORITY_URGENT + VULNERABILITY_PRIORITY_URGENT @deprecated(reason: "Backed by a count that is always 0. URGENT requires workload internet exposure, so ordering by this value has no effect and falls back to a stable name sort.") """ Order by the number of high-risk vulnerabilities. @@ -14274,6 +15301,10 @@ The identity of the actor who performed the action. The value is either the name """ actor: String! """ +GitHub Actions OIDC claims when authenticated by a GitHub repository. +""" + gitHubActorClaims: GitHubActorClaims +""" Creation time of the entry. """ createdAt: Time! @@ -14463,9 +15494,7 @@ Interface for workloads. """ Interface for workloads. """ - postgresBranches( - orderBy: PostgresBranchOrder - ): PostgresBranchConnection! + postgreses: PostgresConnection! """ Interface for workloads. """