diff --git a/.github/cherry-pick-bot.yml b/.github/cherry-pick-bot.yml new file mode 100644 index 0000000000000..853c088b6e918 --- /dev/null +++ b/.github/cherry-pick-bot.yml @@ -0,0 +1,2 @@ +enabled: true +preservePullRequestTitle: false diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e5180b037a916..5492a2354ede6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -445,7 +445,10 @@ jobs: # C: drive is extremely slow: https://github.com/actions/runner-images/issues/8755 mkdir -p "R:/temp/embedded-pg" go run scripts/embedded-pg/main.go -path "R:/temp/embedded-pg" - DB=ci gotestsum --format standard-quiet -- -v -short -count=1 ./... + # Reduce test parallelism, mirroring what we do for race tests. + # We'd been encountering issues with timing related flakes, and + # this seems to help. + DB=ci gotestsum --format standard-quiet -- -v -short -count=1 -parallel 4 -p 4 ./... else go run scripts/embedded-pg/main.go DB=ci gotestsum --format standard-quiet -- -v -short -count=1 ./... diff --git a/.github/workflows/docs-ci.yaml b/.github/workflows/docs-ci.yaml new file mode 100644 index 0000000000000..5df6e3cec74ba --- /dev/null +++ b/.github/workflows/docs-ci.yaml @@ -0,0 +1,45 @@ +name: Docs CI + +on: + push: + branches: + - main + paths: + - "docs/**" + - "**.md" + - ".github/workflows/docs-ci.yaml" + + pull_request: + paths: + - "docs/**" + - "**.md" + - ".github/workflows/docs-ci.yaml" + +jobs: + docs: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + + - name: Setup Node + uses: ./.github/actions/setup-node + + - uses: tj-actions/changed-files@bab30c2299617f6615ec02a68b9a40d10bd21366 # v45.0.5 + id: changed-files + with: + files: | + docs/** + **.md + separator: "," + + - name: lint + if: steps.changed-files.outputs.any_changed == 'true' + run: | + pnpm exec markdownlint-cli2 ${{ steps.changed-files.outputs.all_changed_files }} + + - name: fmt + if: steps.changed-files.outputs.any_changed == 'true' + run: | + # markdown-table-formatter requires a space separated list of files + echo ${{ steps.changed-files.outputs.all_changed_files }} | tr ',' '\n' | pnpm exec markdown-table-formatter --check diff --git a/.github/workflows/pr-deploy.yaml b/.github/workflows/pr-deploy.yaml index 0adba2b7ce15d..b81baf53e25fa 100644 --- a/.github/workflows/pr-deploy.yaml +++ b/.github/workflows/pr-deploy.yaml @@ -7,6 +7,7 @@ on: push: branches-ignore: - main + - "temp-cherry-pick-*" workflow_dispatch: inputs: experiments: diff --git a/.markdownlint.jsonc b/.markdownlint.jsonc new file mode 100644 index 0000000000000..55221796ce04e --- /dev/null +++ b/.markdownlint.jsonc @@ -0,0 +1,31 @@ +// Example markdownlint configuration with all properties set to their default value +{ + "MD010": { "spaces_per_tab": 4}, // No hard tabs: we use 4 spaces per tab + + "MD013": false, // Line length: we are not following a strict line lnegth in markdown files + + "MD024": { "siblings_only": true }, // Multiple headings with the same content: + + "MD033": false, // Inline HTML: we use it in some places + + "MD034": false, // Bare URL: we use it in some places in generated docs e.g. + // codersdk/deployment.go L597, L1177, L2287, L2495, L2533 + // codersdk/workspaceproxy.go L196, L200-L201 + // coderd/tracing/exporter.go L26 + // cli/exp_scaletest.go L-9 + + "MD041": false, // First line in file should be a top level heading: All of our changelogs do not start with a top level heading + // TODO: We need to update /home/coder/repos/coder/coder/scripts/release/generate_release_notes.sh to generate changelogs that follow this rule + + "MD052": false, // Image reference: Not a valid reference in generated docs + // docs/reference/cli/server.md L628 + + "MD055": false, // Table pipe style: Some of the generated tables do not have ending pipes + // docs/reference/api/schema.md + // docs/reference/api/templates.md + // docs/reference/cli/server.md + + "MD056": false // Table column count: Some of the auto-generated tables have issues. TODO: This is probably because of splitting cell content to multiple lines. + // docs/reference/api/schema.md + // docs/reference/api/templates.md +} diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index 8b84ba3315e25..0000000000000 --- a/.prettierignore +++ /dev/null @@ -1,96 +0,0 @@ -# Code generated by Makefile (.gitignore .prettierignore.include). DO NOT EDIT. - -# .gitignore: -# Common ignore patterns, these rules applies in both root and subdirectories. -.DS_Store -.eslintcache -.gitpod.yml -.idea -**/*.swp -gotests.coverage -gotests.xml -gotests_stats.json -gotests.json -node_modules/ -vendor/ -yarn-error.log - -# VSCode settings. -**/.vscode/* -# Allow VSCode recommendations and default settings in project root. -!/.vscode/extensions.json -!/.vscode/settings.json -# Allow code snippets -!/.vscode/*.code-snippets - -# Front-end ignore patterns. -.next/ -site/build-storybook.log -site/coverage/ -site/storybook-static/ -site/test-results/* -site/e2e/test-results/* -site/e2e/states/*.json -site/e2e/.auth.json -site/playwright-report/* -site/.swc - -# Make target for updating golden files (any dir). -.gen-golden - -# Build -build/ -dist/ -out/ - -# Bundle analysis -site/stats/ - -*.tfstate -*.tfstate.backup -*.tfplan -*.lock.hcl -.terraform/ - -**/.coderv2/* -**/__debug_bin - -# direnv -.envrc -*.test - -# Loadtesting -./scaletest/terraform/.terraform -./scaletest/terraform/.terraform.lock.hcl -scaletest/terraform/secrets.tfvars -.terraform.tfstate.* - -# Nix -result - -# Data dumps from unit tests -**/*.test.sql - -# Filebrowser.db -**/filebrowser.db - -# pnpm -.pnpm-store/ - -# Zed -.zed_server -# .prettierignore.include: -# Helm templates contain variables that are invalid YAML and can't be formatted -# by Prettier. -helm/**/templates/*.yaml - -# Testdata shouldn't be formatted. -testdata/ - -# Ignore generated files -**/pnpm-lock.yaml -**/*.gen.json - -# Everything in site/ is formatted by Biome. For the rest of the repo though, we -# need broader language support. -site/ diff --git a/.prettierignore.include b/.prettierignore.include deleted file mode 100644 index b791f93042e9f..0000000000000 --- a/.prettierignore.include +++ /dev/null @@ -1,14 +0,0 @@ -# Helm templates contain variables that are invalid YAML and can't be formatted -# by Prettier. -helm/**/templates/*.yaml - -# Testdata shouldn't be formatted. -testdata/ - -# Ignore generated files -**/pnpm-lock.yaml -**/*.gen.json - -# Everything in site/ is formatted by Biome. For the rest of the repo though, we -# need broader language support. -site/ diff --git a/.vscode/extensions.json b/.vscode/extensions.json index bf33cb08c3196..e2d5e0464f5d2 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,16 +1,16 @@ { "recommendations": [ + "biomejs.biome", + "bradlc.vscode-tailwindcss", + "DavidAnson.vscode-markdownlint", + "EditorConfig.EditorConfig", + "emeraldwalk.runonsave", + "foxundermoon.shell-format", "github.vscode-codeql", "golang.go", "hashicorp.terraform", - "esbenp.prettier-vscode", - "foxundermoon.shell-format", - "emeraldwalk.runonsave", - "zxh404.vscode-proto3", "redhat.vscode-yaml", "tekumara.typos-vscode", - "EditorConfig.EditorConfig", - "biomejs.biome", - "bradlc.vscode-tailwindcss" + "zxh404.vscode-proto3" ] } diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index c1fd547fddcf4..37dadd19667d4 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1 +1,2 @@ -[https://coder.com/docs/coder-oss/latest/contributing/CODE_OF_CONDUCT](https://coder.com/docs/contributing/CODE_OF_CONDUCT) + +[https://coder.com/docs/contributing/CODE_OF_CONDUCT](https://coder.com/docs/contributing/CODE_OF_CONDUCT) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f051fa9726da4..3c2ee6b88df58 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1 +1,2 @@ -https://coder.com/docs/CONTRIBUTING + +[https://coder.com/docs/CONTRIBUTING](https://coder.com/docs/CONTRIBUTING) diff --git a/Makefile b/Makefile index bc109983ca695..2cd40a7dabfa3 100644 --- a/Makefile +++ b/Makefile @@ -260,6 +260,7 @@ $(CODER_DYLIBS): go.mod go.sum $(GO_SRC_FILES) # This task builds both dylibs build/coder-dylib: $(CODER_DYLIBS) +.PHONY: build/coder-dylib # This task builds all archives. It parses the target name to get the metadata # for the build, so it must be specified in this format: @@ -387,15 +388,25 @@ $(foreach chart,$(charts),build/$(chart)_helm_$(VERSION).tgz): build/%_helm_$(VE --chart $* \ --output "$@" -site/out/index.html: site/package.json $(shell find ./site $(FIND_EXCLUSIONS) -type f \( -name '*.ts' -o -name '*.tsx' \)) - cd site +node_modules/.installed: package.json + ./scripts/pnpm_install.sh + +offlinedocs/node_modules/.installed: offlinedocs/package.json + cd offlinedocs/ + ../scripts/pnpm_install.sh + +site/node_modules/.installed: site/package.json + cd site/ + ../scripts/pnpm_install.sh + +site/out/index.html: site/node_modules/.installed $(shell find ./site $(FIND_EXCLUSIONS) -type f \( -name '*.ts' -o -name '*.tsx' \)) + cd site/ # prevents this directory from getting to big, and causing "too much data" errors rm -rf out/assets/ - ../scripts/pnpm_install.sh pnpm build -offlinedocs/out/index.html: $(shell find ./offlinedocs $(FIND_EXCLUSIONS) -type f) $(shell find ./docs $(FIND_EXCLUSIONS) -type f | sed 's: :\\ :g') - cd offlinedocs +offlinedocs/out/index.html: offlinedocs/node_modules/.installed $(shell find ./offlinedocs $(FIND_EXCLUSIONS) -type f) $(shell find ./docs $(FIND_EXCLUSIONS) -type f | sed 's: :\\ :g') + cd offlinedocs/ ../scripts/pnpm_install.sh pnpm export @@ -414,7 +425,7 @@ BOLD := $(shell tput bold 2>/dev/null) GREEN := $(shell tput setaf 2 2>/dev/null) RESET := $(shell tput sgr0 2>/dev/null) -fmt: fmt/ts fmt/go fmt/terraform fmt/shfmt fmt/prettier +fmt: fmt/ts fmt/go fmt/terraform fmt/shfmt fmt/biome fmt/markdown .PHONY: fmt fmt/go: @@ -427,7 +438,7 @@ fmt/go: xargs -0 go run mvdan.cc/gofumpt@v0.4.0 -w -l .PHONY: fmt/go -fmt/ts: +fmt/ts: site/node_modules/.installed echo "$(GREEN)==>$(RESET) $(BOLD)fmt/ts$(RESET)" cd site # Avoid writing files in CI to reduce file write activity @@ -438,15 +449,16 @@ else endif .PHONY: fmt/ts -fmt/prettier: .prettierignore - echo "$(GREEN)==>$(RESET) $(BOLD)fmt/prettier$(RESET)" +fmt/biome: site/node_modules/.installed + echo "$(GREEN)==>$(RESET) $(BOLD)fmt/biome$(RESET)" + cd site/ # Avoid writing files in CI to reduce file write activity ifdef CI pnpm run format:check else pnpm run format endif -.PHONY: fmt/prettier +.PHONY: fmt/biome fmt/terraform: $(wildcard *.tf) echo "$(GREEN)==>$(RESET) $(BOLD)fmt/terraform$(RESET)" @@ -463,15 +475,20 @@ else endif .PHONY: fmt/shfmt -lint: lint/shellcheck lint/go lint/ts lint/examples lint/helm lint/site-icons +fmt/markdown: node_modules/.installed + echo "$(GREEN)==>$(RESET) $(BOLD)fmt/markdown$(RESET)" + pnpm format-docs +.PHONY: fmt/markdown + +lint: lint/shellcheck lint/go lint/ts lint/examples lint/helm lint/site-icons lint/markdown .PHONY: lint lint/site-icons: ./scripts/check_site_icons.sh .PHONY: lint/site-icons -lint/ts: - cd site +lint/ts: site/node_modules/.installed + cd site/ pnpm lint .PHONY: lint/ts @@ -493,10 +510,14 @@ lint/shellcheck: $(SHELL_SRC_FILES) .PHONY: lint/shellcheck lint/helm: - cd helm + cd helm/ make lint .PHONY: lint/helm +lint/markdown: node_modules/.installed + pnpm lint-docs +.PHONY: lint/markdown + # All files generated by the database should be added here, and this can be used # as a target for jobs that need to run after the database is generated. DB_GEN_FILES := \ @@ -530,8 +551,6 @@ GEN_FILES := \ docs/reference/cli/index.md \ docs/admin/security/audit-logs.md \ coderd/apidoc/swagger.json \ - .prettierignore.include \ - .prettierignore \ provisioner/terraform/testdata/version \ site/e2e/provisionerGenerated.ts \ site/src/theme/icons.json \ @@ -566,8 +585,6 @@ gen/mark-fresh: docs/reference/cli/index.md \ docs/admin/security/audit-logs.md \ coderd/apidoc/swagger.json \ - .prettierignore.include \ - .prettierignore \ site/e2e/provisionerGenerated.ts \ site/src/theme/icons.json \ examples/examples.gen.json \ @@ -583,7 +600,7 @@ gen/mark-fresh: fi # touch sets the mtime of the file to the current time - touch $$file + touch "$$file" done .PHONY: gen/mark-fresh @@ -645,19 +662,20 @@ vpn/vpn.pb.go: vpn/vpn.proto --go_opt=paths=source_relative \ ./vpn/vpn.proto -site/src/api/typesGenerated.ts: $(wildcard scripts/apitypings/*) $(shell find ./codersdk $(FIND_EXCLUSIONS) -type f -name '*.go') +site/src/api/typesGenerated.ts: site/node_modules/.installed $(wildcard scripts/apitypings/*) $(shell find ./codersdk $(FIND_EXCLUSIONS) -type f -name '*.go') # -C sets the directory for the go run command go run -C ./scripts/apitypings main.go > $@ + cd site/ + pnpm exec biome format --write src/api/typesGenerated.ts -site/e2e/provisionerGenerated.ts: provisionerd/proto/provisionerd.pb.go provisionersdk/proto/provisioner.pb.go - cd site - ../scripts/pnpm_install.sh +site/e2e/provisionerGenerated.ts: site/node_modules/.installed provisionerd/proto/provisionerd.pb.go provisionersdk/proto/provisioner.pb.go + cd site/ pnpm run gen:provisioner -site/src/theme/icons.json: $(wildcard scripts/gensite/*) $(wildcard site/static/icon/*) +site/src/theme/icons.json: site/node_modules/.installed $(wildcard scripts/gensite/*) $(wildcard site/static/icon/*) go run ./scripts/gensite/ -icons "$@" - ./scripts/pnpm_install.sh - pnpm -C site/ exec biome format --write src/theme/icons.json + cd site/ + pnpm exec biome format --write src/theme/icons.json examples/examples.gen.json: scripts/examplegen/main.go examples/examples.go $(shell find ./examples/templates) go run ./scripts/examplegen/main.go > examples/examples.gen.json @@ -674,31 +692,39 @@ codersdk/rbacresources_gen.go: scripts/typegen/codersdk.gotmpl scripts/typegen/m go run scripts/typegen/main.go rbac codersdk > /tmp/rbacresources_gen.go mv /tmp/rbacresources_gen.go codersdk/rbacresources_gen.go -site/src/api/rbacresourcesGenerated.ts: scripts/typegen/codersdk.gotmpl scripts/typegen/main.go coderd/rbac/object.go coderd/rbac/policy/policy.go +site/src/api/rbacresourcesGenerated.ts: site/node_modules/.installed scripts/typegen/codersdk.gotmpl scripts/typegen/main.go coderd/rbac/object.go coderd/rbac/policy/policy.go go run scripts/typegen/main.go rbac typescript > "$@" + cd site/ + pnpm exec biome format --write src/api/rbacresourcesGenerated.ts -site/src/api/countriesGenerated.ts: scripts/typegen/countries.tstmpl scripts/typegen/main.go codersdk/countries.go +site/src/api/countriesGenerated.ts: site/node_modules/.installed scripts/typegen/countries.tstmpl scripts/typegen/main.go codersdk/countries.go go run scripts/typegen/main.go countries > "$@" + cd site/ + pnpm exec biome format --write src/api/countriesGenerated.ts -docs/admin/integrations/prometheus.md: scripts/metricsdocgen/main.go scripts/metricsdocgen/metrics +docs/admin/integrations/prometheus.md: node_modules/.installed scripts/metricsdocgen/main.go scripts/metricsdocgen/metrics go run scripts/metricsdocgen/main.go - ./scripts/pnpm_install.sh - pnpm exec prettier --write ./docs/admin/integrations/prometheus.md + pnpm exec markdownlint-cli2 --fix ./docs/admin/integrations/prometheus.md + pnpm exec markdown-table-formatter ./docs/admin/integrations/prometheus.md -docs/reference/cli/index.md: scripts/clidocgen/main.go examples/examples.gen.json $(GO_SRC_FILES) +docs/reference/cli/index.md: node_modules/.installed site/node_modules/.installed scripts/clidocgen/main.go examples/examples.gen.json $(GO_SRC_FILES) CI=true BASE_PATH="." go run ./scripts/clidocgen - ./scripts/pnpm_install.sh - pnpm exec prettier --write ./docs/reference/cli/index.md ./docs/reference/cli/*.md ./docs/manifest.json + pnpm exec markdownlint-cli2 --fix ./docs/reference/cli/*.md + pnpm exec markdown-table-formatter ./docs/reference/cli/*.md + cd site/ + pnpm exec biome format --write ../docs/manifest.json -docs/admin/security/audit-logs.md: coderd/database/querier.go scripts/auditdocgen/main.go enterprise/audit/table.go coderd/rbac/object_gen.go +docs/admin/security/audit-logs.md: node_modules/.installed coderd/database/querier.go scripts/auditdocgen/main.go enterprise/audit/table.go coderd/rbac/object_gen.go go run scripts/auditdocgen/main.go - ./scripts/pnpm_install.sh - pnpm exec prettier --write ./docs/admin/security/audit-logs.md + pnpm exec markdownlint-cli2 --fix ./docs/admin/security/audit-logs.md + pnpm exec markdown-table-formatter ./docs/admin/security/audit-logs.md -coderd/apidoc/swagger.json: $(shell find ./scripts/apidocgen $(FIND_EXCLUSIONS) -type f) $(wildcard coderd/*.go) $(wildcard enterprise/coderd/*.go) $(wildcard codersdk/*.go) $(wildcard enterprise/wsproxy/wsproxysdk/*.go) $(DB_GEN_FILES) .swaggo docs/manifest.json coderd/rbac/object_gen.go +coderd/apidoc/swagger.json: node_modules/.installed site/node_modules/.installed $(shell find ./scripts/apidocgen $(FIND_EXCLUSIONS) -type f) $(wildcard coderd/*.go) $(wildcard enterprise/coderd/*.go) $(wildcard codersdk/*.go) $(wildcard enterprise/wsproxy/wsproxysdk/*.go) $(DB_GEN_FILES) .swaggo docs/manifest.json coderd/rbac/object_gen.go ./scripts/apidocgen/generate.sh - ./scripts/pnpm_install.sh - pnpm exec prettier --write ./docs/reference/api ./docs/manifest.json ./coderd/apidoc/swagger.json + pnpm exec markdownlint-cli2 --fix ./docs/reference/api/*.md + pnpm exec markdown-table-formatter ./docs/reference/api/*.md + cd site/ + pnpm exec biome format --write ../docs/manifest.json ../coderd/apidoc/swagger.json update-golden-files: \ cli/testdata/.gen-golden \ @@ -769,15 +795,6 @@ provisioner/terraform/testdata/version: fi .PHONY: provisioner/terraform/testdata/version -# Combine .gitignore with .prettierignore.include to generate .prettierignore. -.prettierignore: .gitignore .prettierignore.include - echo "# Code generated by Makefile ($^). DO NOT EDIT." > "$@" - echo "" >> "$@" - for f in $^; do - echo "# $${f}:" >> "$@" - cat "$$f" >> "$@" - done - test: $(GIT_FLAGS) gotestsum --format standard-quiet -- -v -short -count=1 ./... .PHONY: test @@ -834,6 +851,7 @@ test-migrations: test-postgres-docker if [[ "$${COMMIT_FROM}" == "$${COMMIT_TO}" ]]; then echo "Nothing to do!"; exit 0; fi echo "DROP DATABASE IF EXISTS migrate_test_$${COMMIT_FROM}; CREATE DATABASE migrate_test_$${COMMIT_FROM};" | psql 'postgresql://postgres:postgres@localhost:5432/postgres?sslmode=disable' go run ./scripts/migrate-test/main.go --from="$$COMMIT_FROM" --to="$$COMMIT_TO" --postgres-url="postgresql://postgres:postgres@localhost:5432/migrate_test_$${COMMIT_FROM}?sslmode=disable" +.PHONY: test-migrations # NOTE: we set --memory to the same size as a GitHub runner. test-postgres-docker: @@ -881,6 +899,7 @@ test-tailnet-integration: -timeout=5m \ -count=1 \ ./tailnet/test/integration +.PHONY: test-tailnet-integration # Note: we used to add this to the test target, but it's not necessary and we can # achieve the desired result by specifying -count=1 in the go test invocation @@ -889,6 +908,11 @@ test-clean: go clean -testcache .PHONY: test-clean +test-e2e: site/node_modules/.installed site/out/index.html + cd site/ +ifdef CI + DEBUG=pw:api pnpm playwright:test --forbid-only --workers 1 +else + pnpm playwright:test +endif .PHONY: test-e2e -test-e2e: - cd ./site && DEBUG=pw:api pnpm playwright:test --forbid-only --workers 1 diff --git a/README.md b/README.md index 2048f6ba1fd83..f0c939bee6b9d 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,10 @@ +
- + Coder Logo Light - + Coder Logo Dark

@@ -11,10 +12,10 @@

- + Coder Banner Light - + Coder Banner Dark
@@ -40,14 +41,14 @@ - Onboard developers in seconds instead of days

- + Coder Hero Image

## Quickstart The most convenient way to try Coder is to install it on your local machine and experiment with provisioning cloud development environments using Docker (works on Linux, macOS, and Windows). -``` +```shell # First, install Coder curl -L https://coder.com/install.sh | sh @@ -65,7 +66,7 @@ The easiest way to install Coder is to use our and macOS. For Windows, use the latest `..._installer.exe` file from GitHub Releases. -```bash +```shell curl -L https://coder.com/install.sh | sh ``` diff --git a/SECURITY.md b/SECURITY.md index ee5ac8075eaf9..04be6e417548b 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -8,7 +8,7 @@ to us, what we expect, what you can expect from us. You can see the pretty version [here](https://coder.com/security/policy) -# Why Coder's security matters +## Why Coder's security matters If an attacker could fully compromise a Coder installation, they could spin up expensive workstations, steal valuable credentials, or steal proprietary source @@ -16,13 +16,13 @@ code. We take this risk very seriously and employ routine pen testing, vulnerability scanning, and code reviews. We also welcome the contributions from the community that helped make this product possible. -# Where should I report security issues? +## Where should I report security issues? -Please report security issues to security@coder.com, providing all relevant +Please report security issues to , providing all relevant information. The more details you provide, the easier it will be for us to triage and fix the issue. -# Out of Scope +## Out of Scope Our primary concern is around an abuse of the Coder application that allows an attacker to gain access to another users workspace, or spin up unwanted @@ -40,7 +40,7 @@ workspaces. out-of-scope systems should be reported to the appropriate vendor or applicable authority. -# Our Commitments +## Our Commitments When working with us, according to this policy, you can expect us to: @@ -53,7 +53,7 @@ When working with us, according to this policy, you can expect us to: - Extend Safe Harbor for your vulnerability research that is related to this policy. -# Our Expectations +## Our Expectations In participating in our vulnerability disclosure program in good faith, we ask that you: diff --git a/agent/agent_test.go b/agent/agent_test.go index f1dfcd8c42a02..7674c906ff486 100644 --- a/agent/agent_test.go +++ b/agent/agent_test.go @@ -58,7 +58,7 @@ import ( ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + goleak.VerifyTestMain(m, testutil.GoleakOptions...) } // NOTE: These tests only work when your default shell is bash for some reason. diff --git a/agent/agentscripts/agentscripts_test.go b/agent/agentscripts/agentscripts_test.go index 572f7b509d4d2..0d6e41772cdb7 100644 --- a/agent/agentscripts/agentscripts_test.go +++ b/agent/agentscripts/agentscripts_test.go @@ -24,7 +24,7 @@ import ( ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + goleak.VerifyTestMain(m, testutil.GoleakOptions...) } func TestExecuteBasic(t *testing.T) { diff --git a/agent/agentssh/agentssh_test.go b/agent/agentssh/agentssh_test.go index dfe67290c358b..76321e6e19d85 100644 --- a/agent/agentssh/agentssh_test.go +++ b/agent/agentssh/agentssh_test.go @@ -29,7 +29,7 @@ import ( ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + goleak.VerifyTestMain(m, testutil.GoleakOptions...) } func TestNewServer_ServeClient(t *testing.T) { diff --git a/cli/clitest/clitest_test.go b/cli/clitest/clitest_test.go index db31513d182c7..c2149813875dc 100644 --- a/cli/clitest/clitest_test.go +++ b/cli/clitest/clitest_test.go @@ -8,10 +8,11 @@ import ( "github.com/coder/coder/v2/cli/clitest" "github.com/coder/coder/v2/coderd/coderdtest" "github.com/coder/coder/v2/pty/ptytest" + "github.com/coder/coder/v2/testutil" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + goleak.VerifyTestMain(m, testutil.GoleakOptions...) } func TestCli(t *testing.T) { diff --git a/cli/exp_scaletest_test.go b/cli/exp_scaletest_test.go index 27f1adaac6c7d..afcd213fc9d00 100644 --- a/cli/exp_scaletest_test.go +++ b/cli/exp_scaletest_test.go @@ -18,6 +18,10 @@ import ( func TestScaleTestCreateWorkspaces(t *testing.T) { t.Parallel() + if testutil.RaceEnabled() { + t.Skip("Skipping due to race detector") + } + // This test only validates that the CLI command accepts known arguments. // More thorough testing is done in scaletest/createworkspaces/run_test.go. ctx, cancelFunc := context.WithTimeout(context.Background(), testutil.WaitLong) @@ -65,6 +69,10 @@ func TestScaleTestCreateWorkspaces(t *testing.T) { func TestScaleTestWorkspaceTraffic(t *testing.T) { t.Parallel() + if testutil.RaceEnabled() { + t.Skip("Skipping due to race detector") + } + ctx, cancelFunc := context.WithTimeout(context.Background(), testutil.WaitMedium) defer cancelFunc() @@ -95,6 +103,10 @@ func TestScaleTestWorkspaceTraffic(t *testing.T) { func TestScaleTestWorkspaceTraffic_Template(t *testing.T) { t.Parallel() + if testutil.RaceEnabled() { + t.Skip("Skipping due to race detector") + } + ctx, cancelFunc := context.WithTimeout(context.Background(), testutil.WaitMedium) defer cancelFunc() @@ -120,6 +132,10 @@ func TestScaleTestWorkspaceTraffic_Template(t *testing.T) { func TestScaleTestWorkspaceTraffic_TargetWorkspaces(t *testing.T) { t.Parallel() + if testutil.RaceEnabled() { + t.Skip("Skipping due to race detector") + } + ctx, cancelFunc := context.WithTimeout(context.Background(), testutil.WaitMedium) defer cancelFunc() @@ -145,6 +161,10 @@ func TestScaleTestWorkspaceTraffic_TargetWorkspaces(t *testing.T) { func TestScaleTestCleanup_Template(t *testing.T) { t.Parallel() + if testutil.RaceEnabled() { + t.Skip("Skipping due to race detector") + } + ctx, cancelFunc := context.WithTimeout(context.Background(), testutil.WaitMedium) defer cancelFunc() @@ -169,6 +189,10 @@ func TestScaleTestCleanup_Template(t *testing.T) { // This test just validates that the CLI command accepts its known arguments. func TestScaleTestDashboard(t *testing.T) { t.Parallel() + if testutil.RaceEnabled() { + t.Skip("Skipping due to race detector") + } + t.Run("MinWait", func(t *testing.T) { t.Parallel() ctx, cancelFunc := context.WithTimeout(context.Background(), testutil.WaitShort) diff --git a/cli/resetpassword.go b/cli/resetpassword.go index 2aacc8a6e6c44..f77ed81d14db4 100644 --- a/cli/resetpassword.go +++ b/cli/resetpassword.go @@ -3,22 +3,27 @@ package cli import ( - "database/sql" "fmt" "golang.org/x/xerrors" + "cdr.dev/slog" + "cdr.dev/slog/sloggers/sloghuman" + "github.com/coder/coder/v2/coderd/database/awsiamrds" + "github.com/coder/coder/v2/codersdk" "github.com/coder/pretty" "github.com/coder/serpent" "github.com/coder/coder/v2/cli/cliui" "github.com/coder/coder/v2/coderd/database" - "github.com/coder/coder/v2/coderd/database/migrations" "github.com/coder/coder/v2/coderd/userpassword" ) func (*RootCmd) resetPassword() *serpent.Command { - var postgresURL string + var ( + postgresURL string + postgresAuth string + ) root := &serpent.Command{ Use: "reset-password ", @@ -27,20 +32,26 @@ func (*RootCmd) resetPassword() *serpent.Command { Handler: func(inv *serpent.Invocation) error { username := inv.Args[0] - sqlDB, err := sql.Open("postgres", postgresURL) - if err != nil { - return xerrors.Errorf("dial postgres: %w", err) + logger := slog.Make(sloghuman.Sink(inv.Stdout)) + if ok, _ := inv.ParsedFlags().GetBool("verbose"); ok { + logger = logger.Leveled(slog.LevelDebug) } - defer sqlDB.Close() - err = sqlDB.Ping() - if err != nil { - return xerrors.Errorf("ping postgres: %w", err) + + sqlDriver := "postgres" + if codersdk.PostgresAuth(postgresAuth) == codersdk.PostgresAuthAWSIAMRDS { + var err error + sqlDriver, err = awsiamrds.Register(inv.Context(), sqlDriver) + if err != nil { + return xerrors.Errorf("register aws rds iam auth: %w", err) + } } - err = migrations.EnsureClean(sqlDB) + sqlDB, err := ConnectToPostgres(inv.Context(), logger, sqlDriver, postgresURL, nil) if err != nil { - return xerrors.Errorf("database needs migration: %w", err) + return xerrors.Errorf("dial postgres: %w", err) } + defer sqlDB.Close() + db := database.New(sqlDB) user, err := db.GetUserByEmailOrUsername(inv.Context(), database.GetUserByEmailOrUsernameParams{ @@ -97,6 +108,14 @@ func (*RootCmd) resetPassword() *serpent.Command { Env: "CODER_PG_CONNECTION_URL", Value: serpent.StringOf(&postgresURL), }, + serpent.Option{ + Name: "Postgres Connection Auth", + Description: "Type of auth to use when connecting to postgres.", + Flag: "postgres-connection-auth", + Env: "CODER_PG_CONNECTION_AUTH", + Default: "password", + Value: serpent.EnumOf(&postgresAuth, codersdk.PostgresAuthDrivers...), + }, } return root diff --git a/cli/root_internal_test.go b/cli/root_internal_test.go index c10c853769900..f95ab04c1c9ec 100644 --- a/cli/root_internal_test.go +++ b/cli/root_internal_test.go @@ -19,6 +19,7 @@ import ( "github.com/coder/coder/v2/cli/cliui" "github.com/coder/coder/v2/cli/telemetry" "github.com/coder/coder/v2/codersdk" + "github.com/coder/coder/v2/testutil" "github.com/coder/pretty" "github.com/coder/serpent" ) @@ -29,15 +30,7 @@ func TestMain(m *testing.M) { // See: https://github.com/coder/coder/issues/8954 os.Exit(m.Run()) } - goleak.VerifyTestMain(m, - // The lumberjack library is used by by agent and seems to leave - // goroutines after Close(), fails TestGitSSH tests. - // https://github.com/natefinch/lumberjack/pull/100 - goleak.IgnoreTopFunction("gopkg.in/natefinch/lumberjack%2ev2.(*Logger).millRun"), - goleak.IgnoreTopFunction("gopkg.in/natefinch/lumberjack%2ev2.(*Logger).mill.func1"), - // The pq library appears to leave around a goroutine after Close(). - goleak.IgnoreTopFunction("github.com/lib/pq.NewDialListener"), - ) + goleak.VerifyTestMain(m, testutil.GoleakOptions...) } func Test_formatExamples(t *testing.T) { diff --git a/cli/server.go b/cli/server.go index ff8b2963e0eb4..9bb4cfb0a72f2 100644 --- a/cli/server.go +++ b/cli/server.go @@ -697,7 +697,7 @@ func (r *RootCmd) Server(newAPI func(context.Context, *coderd.Options) (*coderd. options.Database = dbmem.New() options.Pubsub = pubsub.NewInMemory() } else { - sqlDB, dbURL, err := getPostgresDB(ctx, logger, vals.PostgresURL.String(), codersdk.PostgresAuth(vals.PostgresAuth), sqlDriver) + sqlDB, dbURL, err := getAndMigratePostgresDB(ctx, logger, vals.PostgresURL.String(), codersdk.PostgresAuth(vals.PostgresAuth), sqlDriver) if err != nil { return xerrors.Errorf("connect to postgres: %w", err) } @@ -2090,9 +2090,18 @@ func IsLocalhost(host string) bool { return host == "localhost" || host == "127.0.0.1" || host == "::1" } -func ConnectToPostgres(ctx context.Context, logger slog.Logger, driver string, dbURL string) (sqlDB *sql.DB, err error) { +// ConnectToPostgres takes in the migration command to run on the database once +// it connects. To avoid running migrations, pass in `nil` or a no-op function. +// Regardless of the passed in migration function, if the database is not fully +// migrated, an error will be returned. This can happen if the database is on a +// future or past migration version. +// +// If no error is returned, the database is fully migrated and up to date. +func ConnectToPostgres(ctx context.Context, logger slog.Logger, driver string, dbURL string, migrate func(db *sql.DB) error) (*sql.DB, error) { logger.Debug(ctx, "connecting to postgresql") + var err error + var sqlDB *sql.DB // Try to connect for 30 seconds. ctx, cancel := context.WithTimeout(ctx, 30*time.Second) defer cancel() @@ -2155,9 +2164,16 @@ func ConnectToPostgres(ctx context.Context, logger slog.Logger, driver string, d } logger.Debug(ctx, "connected to postgresql", slog.F("version", versionNum)) - err = migrations.Up(sqlDB) + if migrate != nil { + err = migrate(sqlDB) + if err != nil { + return nil, xerrors.Errorf("migrate up: %w", err) + } + } + + err = migrations.EnsureClean(sqlDB) if err != nil { - return nil, xerrors.Errorf("migrate up: %w", err) + return nil, xerrors.Errorf("migrations in database: %w", err) } // The default is 0 but the request will fail with a 500 if the DB // cannot accept new connections, so we try to limit that here. @@ -2561,7 +2577,7 @@ func signalNotifyContext(ctx context.Context, inv *serpent.Invocation, sig ...os return inv.SignalNotifyContext(ctx, sig...) } -func getPostgresDB(ctx context.Context, logger slog.Logger, postgresURL string, auth codersdk.PostgresAuth, sqlDriver string) (*sql.DB, string, error) { +func getAndMigratePostgresDB(ctx context.Context, logger slog.Logger, postgresURL string, auth codersdk.PostgresAuth, sqlDriver string) (*sql.DB, string, error) { dbURL, err := escapePostgresURLUserInfo(postgresURL) if err != nil { return nil, "", xerrors.Errorf("escaping postgres URL: %w", err) @@ -2574,7 +2590,7 @@ func getPostgresDB(ctx context.Context, logger slog.Logger, postgresURL string, } } - sqlDB, err := ConnectToPostgres(ctx, logger, sqlDriver, dbURL) + sqlDB, err := ConnectToPostgres(ctx, logger, sqlDriver, dbURL, migrations.Up) if err != nil { return nil, "", xerrors.Errorf("connect to postgres: %w", err) } diff --git a/cli/server_createadminuser.go b/cli/server_createadminuser.go index 7ef95e7e093e6..ed9c7b9bcc921 100644 --- a/cli/server_createadminuser.go +++ b/cli/server_createadminuser.go @@ -72,7 +72,7 @@ func (r *RootCmd) newCreateAdminUserCommand() *serpent.Command { } } - sqlDB, err := ConnectToPostgres(ctx, logger, sqlDriver, newUserDBURL) + sqlDB, err := ConnectToPostgres(ctx, logger, sqlDriver, newUserDBURL, nil) if err != nil { return xerrors.Errorf("connect to postgres: %w", err) } diff --git a/cli/server_test.go b/cli/server_test.go index 9ba963d484548..0dba63e7c2fe3 100644 --- a/cli/server_test.go +++ b/cli/server_test.go @@ -38,11 +38,13 @@ import ( "tailscale.com/derp/derphttp" "tailscale.com/types/key" + "cdr.dev/slog/sloggers/slogtest" "github.com/coder/coder/v2/cli" "github.com/coder/coder/v2/cli/clitest" "github.com/coder/coder/v2/cli/config" "github.com/coder/coder/v2/coderd/coderdtest" "github.com/coder/coder/v2/coderd/database/dbtestutil" + "github.com/coder/coder/v2/coderd/database/migrations" "github.com/coder/coder/v2/coderd/httpapi" "github.com/coder/coder/v2/coderd/telemetry" "github.com/coder/coder/v2/codersdk" @@ -1828,20 +1830,51 @@ func TestConnectToPostgres(t *testing.T) { if !dbtestutil.WillUsePostgres() { t.Skip("this test does not make sense without postgres") } - ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort) - t.Cleanup(cancel) - log := testutil.Logger(t) + t.Run("Migrate", func(t *testing.T) { + t.Parallel() - dbURL, err := dbtestutil.Open(t) - require.NoError(t, err) + ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort) + t.Cleanup(cancel) - sqlDB, err := cli.ConnectToPostgres(ctx, log, "postgres", dbURL) - require.NoError(t, err) - t.Cleanup(func() { - _ = sqlDB.Close() + log := testutil.Logger(t) + + dbURL, err := dbtestutil.Open(t) + require.NoError(t, err) + + sqlDB, err := cli.ConnectToPostgres(ctx, log, "postgres", dbURL, migrations.Up) + require.NoError(t, err) + t.Cleanup(func() { + _ = sqlDB.Close() + }) + require.NoError(t, sqlDB.PingContext(ctx)) + }) + + t.Run("NoMigrate", func(t *testing.T) { + t.Parallel() + + ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitShort) + t.Cleanup(cancel) + + log := slogtest.Make(t, &slogtest.Options{IgnoreErrors: true}) + + dbURL, err := dbtestutil.Open(t) + require.NoError(t, err) + + okDB, err := cli.ConnectToPostgres(ctx, log, "postgres", dbURL, nil) + require.NoError(t, err) + defer okDB.Close() + + // Set the migration number forward + _, err = okDB.Exec(`UPDATE schema_migrations SET version = version + 1`) + require.NoError(t, err) + + _, err = cli.ConnectToPostgres(ctx, log, "postgres", dbURL, nil) + require.Error(t, err) + require.ErrorContains(t, err, "database needs migration") + + require.NoError(t, okDB.PingContext(ctx)) }) - require.NoError(t, sqlDB.PingContext(ctx)) } func TestServer_InvalidDERP(t *testing.T) { diff --git a/cli/ssh.go b/cli/ssh.go index 7df590946fd6b..7a1d5940bfd01 100644 --- a/cli/ssh.go +++ b/cli/ssh.go @@ -657,12 +657,19 @@ func getWorkspaceAndAgent(ctx context.Context, inv *serpent.Invocation, client * // workspaces with the active version. _, _ = fmt.Fprintf(inv.Stderr, "Workspace was stopped, starting workspace to allow connecting to %q...\n", workspace.Name) _, err = startWorkspace(inv, client, workspace, workspaceParameterFlags{}, buildFlags{}, WorkspaceStart) - if cerr, ok := codersdk.AsError(err); ok && cerr.StatusCode() == http.StatusForbidden { - _, err = startWorkspace(inv, client, workspace, workspaceParameterFlags{}, buildFlags{}, WorkspaceUpdate) - if err != nil { - return codersdk.Workspace{}, codersdk.WorkspaceAgent{}, xerrors.Errorf("start workspace with active template version: %w", err) + if cerr, ok := codersdk.AsError(err); ok { + switch cerr.StatusCode() { + case http.StatusConflict: + _, _ = fmt.Fprintln(inv.Stderr, "Unable to start the workspace due to conflict, the workspace may be starting, retrying without autostart...") + return getWorkspaceAndAgent(ctx, inv, client, false, input) + + case http.StatusForbidden: + _, err = startWorkspace(inv, client, workspace, workspaceParameterFlags{}, buildFlags{}, WorkspaceUpdate) + if err != nil { + return codersdk.Workspace{}, codersdk.WorkspaceAgent{}, xerrors.Errorf("start workspace with active template version: %w", err) + } + _, _ = fmt.Fprintln(inv.Stdout, "Unable to start the workspace with template version from last build. Your workspace has been updated to the current active template version.") } - _, _ = fmt.Fprintln(inv.Stdout, "Unable to start the workspace with template version from last build. Your workspace has been updated to the current active template version.") } else if err != nil { return codersdk.Workspace{}, codersdk.WorkspaceAgent{}, xerrors.Errorf("start workspace with current template version: %w", err) } diff --git a/cli/ssh_test.go b/cli/ssh_test.go index 62feaf2b61e95..4fd52971df1cf 100644 --- a/cli/ssh_test.go +++ b/cli/ssh_test.go @@ -17,6 +17,7 @@ import ( "os/exec" "path" "path/filepath" + "regexp" "runtime" "strings" "testing" @@ -145,6 +146,101 @@ func TestSSH(t *testing.T) { pty.WriteLine("exit") <-cmdDone }) + t.Run("StartStoppedWorkspaceConflict", func(t *testing.T) { + t.Parallel() + + // Intercept builds to synchronize execution of the SSH command. + // The purpose here is to make sure all commands try to trigger + // a start build of the workspace. + isFirstBuild := true + buildURL := regexp.MustCompile("/api/v2/workspaces/.*/builds") + buildPause := make(chan bool) + buildDone := make(chan struct{}) + buildSyncMW := func(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.Method == http.MethodPost && buildURL.MatchString(r.URL.Path) { + if !isFirstBuild { + t.Log("buildSyncMW: pausing build") + if shouldContinue := <-buildPause; !shouldContinue { + // We can't force the API to trigger a build conflict (racy) so we fake it. + t.Log("buildSyncMW: return conflict") + w.WriteHeader(http.StatusConflict) + return + } + t.Log("buildSyncMW: resuming build") + defer func() { + t.Log("buildSyncMW: sending build done") + buildDone <- struct{}{} + t.Log("buildSyncMW: done") + }() + } else { + isFirstBuild = false + } + } + next.ServeHTTP(w, r) + }) + } + + authToken := uuid.NewString() + ownerClient := coderdtest.New(t, &coderdtest.Options{ + IncludeProvisionerDaemon: true, + APIMiddleware: buildSyncMW, + }) + owner := coderdtest.CreateFirstUser(t, ownerClient) + client, _ := coderdtest.CreateAnotherUser(t, ownerClient, owner.OrganizationID, rbac.RoleTemplateAdmin()) + version := coderdtest.CreateTemplateVersion(t, client, owner.OrganizationID, &echo.Responses{ + Parse: echo.ParseComplete, + ProvisionPlan: echo.PlanComplete, + ProvisionApply: echo.ProvisionApplyWithAgent(authToken), + }) + coderdtest.AwaitTemplateVersionJobCompleted(t, client, version.ID) + template := coderdtest.CreateTemplate(t, client, owner.OrganizationID, version.ID) + workspace := coderdtest.CreateWorkspace(t, client, template.ID) + coderdtest.AwaitWorkspaceBuildJobCompleted(t, client, workspace.LatestBuild.ID) + // Stop the workspace + workspaceBuild := coderdtest.CreateWorkspaceBuild(t, client, workspace, database.WorkspaceTransitionStop) + coderdtest.AwaitWorkspaceBuildJobCompleted(t, client, workspaceBuild.ID) + + ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitMedium) + defer cancel() + + var ptys []*ptytest.PTY + for i := 0; i < 3; i++ { + // SSH to the workspace which should autostart it + inv, root := clitest.New(t, "ssh", workspace.Name) + + pty := ptytest.New(t).Attach(inv) + ptys = append(ptys, pty) + clitest.SetupConfig(t, client, root) + testutil.Go(t, func() { + _ = inv.WithContext(ctx).Run() + }) + } + + for _, pty := range ptys { + pty.ExpectMatchContext(ctx, "Workspace was stopped, starting workspace to allow connecting to") + } + + // Allow one build to complete. + testutil.RequireSendCtx(ctx, t, buildPause, true) + testutil.RequireRecvCtx(ctx, t, buildDone) + + // Allow the remaining builds to continue. + for i := 0; i < len(ptys)-1; i++ { + testutil.RequireSendCtx(ctx, t, buildPause, false) + } + + var foundConflict int + for _, pty := range ptys { + // Either allow the command to start the workspace or fail + // due to conflict (race), in which case it retries. + match := pty.ExpectRegexMatchContext(ctx, "Waiting for the workspace agent to connect") + if strings.Contains(match, "Unable to start the workspace due to conflict, the workspace may be starting, retrying without autostart...") { + foundConflict++ + } + } + require.Equal(t, 2, foundConflict, "expected 2 conflicts") + }) t.Run("RequireActiveVersion", func(t *testing.T) { t.Parallel() diff --git a/cli/testdata/coder_reset-password_--help.golden b/cli/testdata/coder_reset-password_--help.golden index a7d53df12ad90..ccefb412d8fb7 100644 --- a/cli/testdata/coder_reset-password_--help.golden +++ b/cli/testdata/coder_reset-password_--help.golden @@ -6,6 +6,9 @@ USAGE: Directly connect to the database to reset a user's password OPTIONS: + --postgres-connection-auth password|awsiamrds, $CODER_PG_CONNECTION_AUTH (default: password) + Type of auth to use when connecting to postgres. + --postgres-url string, $CODER_PG_CONNECTION_URL URL of a PostgreSQL database to connect to. diff --git a/cli/testdata/server-config.yaml.golden b/cli/testdata/server-config.yaml.golden index 29b5d1f46cfa5..5db0e9f59698e 100644 --- a/cli/testdata/server-config.yaml.golden +++ b/cli/testdata/server-config.yaml.golden @@ -459,8 +459,8 @@ termsOfServiceURL: "" # (default: ed25519, type: string) sshKeygenAlgorithm: ed25519 # URL to use for agent troubleshooting when not set in the template. -# (default: https://coder.com/docs/templates/troubleshooting, type: url) -agentFallbackTroubleshootingURL: https://coder.com/docs/templates/troubleshooting +# (default: https://coder.com/docs/admin/templates/troubleshooting, type: url) +agentFallbackTroubleshootingURL: https://coder.com/docs/admin/templates/troubleshooting # Disable workspace apps that are not served from subdomains. Path-based apps can # make requests to the Coder API and pose a security risk when the workspace # serves malicious JavaScript. This is recommended for security purposes if a diff --git a/coderd/agentapi/apps_test.go b/coderd/agentapi/apps_test.go index 41d520efc2fc2..1564c48b04e35 100644 --- a/coderd/agentapi/apps_test.go +++ b/coderd/agentapi/apps_test.go @@ -30,6 +30,7 @@ func TestBatchUpdateAppHealths(t *testing.T) { DisplayName: "code-server 1", HealthcheckUrl: "http://localhost:3000", Health: database.WorkspaceAppHealthInitializing, + OpenIn: database.WorkspaceAppOpenInSlimWindow, } app2 = database.WorkspaceApp{ ID: uuid.New(), @@ -38,6 +39,7 @@ func TestBatchUpdateAppHealths(t *testing.T) { DisplayName: "code-server 2", HealthcheckUrl: "http://localhost:3001", Health: database.WorkspaceAppHealthHealthy, + OpenIn: database.WorkspaceAppOpenInSlimWindow, } ) @@ -163,6 +165,7 @@ func TestBatchUpdateAppHealths(t *testing.T) { AgentID: agent.ID, Slug: "code-server-3", DisplayName: "code-server 3", + OpenIn: database.WorkspaceAppOpenInSlimWindow, } dbM := dbmock.NewMockStore(gomock.NewController(t)) diff --git a/coderd/apidoc/docs.go b/coderd/apidoc/docs.go index 5780443a42de1..a8bfcb2af3b19 100644 --- a/coderd/apidoc/docs.go +++ b/coderd/apidoc/docs.go @@ -3170,6 +3170,52 @@ const docTemplate = `{ } } }, + "/organizations/{organization}/settings/idpsync/field-values": { + "get": { + "security": [ + { + "CoderSessionToken": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Get the organization idp sync claim field values", + "operationId": "get-the-organization-idp-sync-claim-field-values", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "string", + "description": "Claim Field", + "name": "claimField", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, "/organizations/{organization}/settings/idpsync/groups": { "get": { "security": [ @@ -3952,6 +3998,52 @@ const docTemplate = `{ } } }, + "/settings/idpsync/field-values": { + "get": { + "security": [ + { + "CoderSessionToken": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "Enterprise" + ], + "summary": "Get the idp sync claim field values", + "operationId": "get-the-idp-sync-claim-field-values", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "string", + "description": "Claim Field", + "name": "claimField", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, "/settings/idpsync/organization": { "get": { "security": [ @@ -7696,13 +7788,13 @@ const docTemplate = `{ }, { "type": "integer", - "description": "Before Unix timestamp", + "description": "Before log id", "name": "before", "in": "query" }, { "type": "integer", - "description": "After Unix timestamp", + "description": "After log id", "name": "after", "in": "query" }, @@ -15079,6 +15171,9 @@ const docTemplate = `{ "type": "string", "format": "uuid" }, + "open_in": { + "$ref": "#/definitions/codersdk.WorkspaceAppOpenIn" + }, "sharing_level": { "enum": [ "owner", @@ -15124,6 +15219,19 @@ const docTemplate = `{ "WorkspaceAppHealthUnhealthy" ] }, + "codersdk.WorkspaceAppOpenIn": { + "type": "string", + "enum": [ + "slim-window", + "window", + "tab" + ], + "x-enum-varnames": [ + "WorkspaceAppOpenInSlimWindow", + "WorkspaceAppOpenInWindow", + "WorkspaceAppOpenInTab" + ] + }, "codersdk.WorkspaceAppSharingLevel": { "type": "string", "enum": [ diff --git a/coderd/apidoc/swagger.json b/coderd/apidoc/swagger.json index 1ecb6d185e03c..d7c32d8a33a52 100644 --- a/coderd/apidoc/swagger.json +++ b/coderd/apidoc/swagger.json @@ -2788,6 +2788,48 @@ } } }, + "/organizations/{organization}/settings/idpsync/field-values": { + "get": { + "security": [ + { + "CoderSessionToken": [] + } + ], + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Get the organization idp sync claim field values", + "operationId": "get-the-organization-idp-sync-claim-field-values", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "string", + "description": "Claim Field", + "name": "claimField", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, "/organizations/{organization}/settings/idpsync/groups": { "get": { "security": [ @@ -3478,6 +3520,48 @@ } } }, + "/settings/idpsync/field-values": { + "get": { + "security": [ + { + "CoderSessionToken": [] + } + ], + "produces": ["application/json"], + "tags": ["Enterprise"], + "summary": "Get the idp sync claim field values", + "operationId": "get-the-idp-sync-claim-field-values", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Organization ID", + "name": "organization", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "string", + "description": "Claim Field", + "name": "claimField", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + }, "/settings/idpsync/organization": { "get": { "security": [ @@ -6798,13 +6882,13 @@ }, { "type": "integer", - "description": "Before Unix timestamp", + "description": "Before log id", "name": "before", "in": "query" }, { "type": "integer", - "description": "After Unix timestamp", + "description": "After log id", "name": "after", "in": "query" }, @@ -13728,6 +13812,9 @@ "type": "string", "format": "uuid" }, + "open_in": { + "$ref": "#/definitions/codersdk.WorkspaceAppOpenIn" + }, "sharing_level": { "enum": ["owner", "authenticated", "public"], "allOf": [ @@ -13764,6 +13851,15 @@ "WorkspaceAppHealthUnhealthy" ] }, + "codersdk.WorkspaceAppOpenIn": { + "type": "string", + "enum": ["slim-window", "window", "tab"], + "x-enum-varnames": [ + "WorkspaceAppOpenInSlimWindow", + "WorkspaceAppOpenInWindow", + "WorkspaceAppOpenInTab" + ] + }, "codersdk.WorkspaceAppSharingLevel": { "type": "string", "enum": ["owner", "authenticated", "public"], diff --git a/coderd/autobuild/lifecycle_executor_test.go b/coderd/autobuild/lifecycle_executor_test.go index c700773028d0a..3eb779376cc5c 100644 --- a/coderd/autobuild/lifecycle_executor_test.go +++ b/coderd/autobuild/lifecycle_executor_test.go @@ -1256,5 +1256,5 @@ func mustWorkspaceParameters(t *testing.T, client *codersdk.Client, workspaceID } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + goleak.VerifyTestMain(m, testutil.GoleakOptions...) } diff --git a/coderd/autobuild/notify/notifier_test.go b/coderd/autobuild/notify/notifier_test.go index 5cfdb33e1acd5..4c87a745aba0c 100644 --- a/coderd/autobuild/notify/notifier_test.go +++ b/coderd/autobuild/notify/notifier_test.go @@ -122,5 +122,5 @@ func durations(ds ...time.Duration) []time.Duration { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + goleak.VerifyTestMain(m, testutil.GoleakOptions...) } diff --git a/coderd/coderd_test.go b/coderd/coderd_test.go index 4d15961a6388e..c94462814999e 100644 --- a/coderd/coderd_test.go +++ b/coderd/coderd_test.go @@ -39,7 +39,7 @@ import ( var updateGoldenFiles = flag.Bool("update", false, "Update golden files") func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + goleak.VerifyTestMain(m, testutil.GoleakOptions...) } func TestBuildInfo(t *testing.T) { diff --git a/coderd/coderdtest/authorize.go b/coderd/coderdtest/authorize.go index c10f954140ea5..af52f7fc70f53 100644 --- a/coderd/coderdtest/authorize.go +++ b/coderd/coderdtest/authorize.go @@ -358,6 +358,7 @@ func (s *PreparedRecorder) CompileToSQL(ctx context.Context, cfg regosql.Convert // Meaning 'FakeAuthorizer' by default will never return "unauthorized". type FakeAuthorizer struct { ConditionalReturn func(context.Context, rbac.Subject, policy.Action, rbac.Object) error + sqlFilter string } var _ rbac.Authorizer = (*FakeAuthorizer)(nil) @@ -370,6 +371,12 @@ func (d *FakeAuthorizer) AlwaysReturn(err error) *FakeAuthorizer { return d } +// OverrideSQLFilter sets the SQL filter that will always be returned by CompileToSQL. +func (d *FakeAuthorizer) OverrideSQLFilter(filter string) *FakeAuthorizer { + d.sqlFilter = filter + return d +} + func (d *FakeAuthorizer) Authorize(ctx context.Context, subject rbac.Subject, action policy.Action, object rbac.Object) error { if d.ConditionalReturn != nil { return d.ConditionalReturn(ctx, subject, action, object) @@ -400,10 +407,12 @@ func (f *fakePreparedAuthorizer) Authorize(ctx context.Context, object rbac.Obje return f.Original.Authorize(ctx, f.Subject, f.Action, object) } -// CompileToSQL returns a compiled version of the authorizer that will work for -// in memory databases. This fake version will not work against a SQL database. -func (*fakePreparedAuthorizer) CompileToSQL(_ context.Context, _ regosql.ConvertConfig) (string, error) { - return "not a valid sql string", nil +func (f *fakePreparedAuthorizer) CompileToSQL(_ context.Context, _ regosql.ConvertConfig) (string, error) { + if f.Original.sqlFilter != "" { + return f.Original.sqlFilter, nil + } + // By default, allow all SQL queries. + return "TRUE", nil } // Random rbac helper funcs diff --git a/coderd/coderdtest/authorize_test.go b/coderd/coderdtest/authorize_test.go index 5cdcd26869cf3..75f9a5d843481 100644 --- a/coderd/coderdtest/authorize_test.go +++ b/coderd/coderdtest/authorize_test.go @@ -44,7 +44,7 @@ func TestAuthzRecorder(t *testing.T) { require.NoError(t, rec.AllAsserted(), "all assertions should have been made") }) - t.Run("Authorize&Prepared", func(t *testing.T) { + t.Run("Authorize_Prepared", func(t *testing.T) { t.Parallel() rec := &coderdtest.RecordingAuthorizer{ diff --git a/coderd/coderdtest/coderdtest.go b/coderd/coderdtest/coderdtest.go index bd1ed740a7ce7..aa096707b8fb7 100644 --- a/coderd/coderdtest/coderdtest.go +++ b/coderd/coderdtest/coderdtest.go @@ -33,6 +33,7 @@ import ( "cloud.google.com/go/compute/metadata" "github.com/fullsailor/pkcs7" + "github.com/go-chi/chi/v5" "github.com/golang-jwt/jwt/v4" "github.com/google/uuid" "github.com/moby/moby/pkg/namesgenerator" @@ -146,6 +147,11 @@ type Options struct { Database database.Store Pubsub pubsub.Pubsub + // APIMiddleware inserts middleware before api.RootHandler, this can be + // useful in certain tests where you want to intercept requests before + // passing them on to the API, e.g. for synchronization of execution. + APIMiddleware func(http.Handler) http.Handler + ConfigSSH codersdk.SSHConfigResponse SwaggerEndpoint bool @@ -555,7 +561,14 @@ func NewWithAPI(t testing.TB, options *Options) (*codersdk.Client, io.Closer, *c setHandler, cancelFunc, serverURL, newOptions := NewOptions(t, options) // We set the handler after server creation for the access URL. coderAPI := coderd.New(newOptions) - setHandler(coderAPI.RootHandler) + rootHandler := coderAPI.RootHandler + if options.APIMiddleware != nil { + r := chi.NewRouter() + r.Use(options.APIMiddleware) + r.Mount("/", rootHandler) + rootHandler = r + } + setHandler(rootHandler) var provisionerCloser io.Closer = nopcloser{} if options.IncludeProvisionerDaemon { provisionerCloser = NewTaggedProvisionerDaemon(t, coderAPI, "test", options.ProvisionerDaemonTags) diff --git a/coderd/coderdtest/coderdtest_test.go b/coderd/coderdtest/coderdtest_test.go index d4dfae6529e8b..8bd4898fe2f21 100644 --- a/coderd/coderdtest/coderdtest_test.go +++ b/coderd/coderdtest/coderdtest_test.go @@ -6,10 +6,11 @@ import ( "go.uber.org/goleak" "github.com/coder/coder/v2/coderd/coderdtest" + "github.com/coder/coder/v2/testutil" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + goleak.VerifyTestMain(m, testutil.GoleakOptions...) } func TestNew(t *testing.T) { diff --git a/coderd/coderdtest/oidctest/idp.go b/coderd/coderdtest/oidctest/idp.go index 90c9c386628f1..d6c7e6259f760 100644 --- a/coderd/coderdtest/oidctest/idp.go +++ b/coderd/coderdtest/oidctest/idp.go @@ -25,7 +25,7 @@ import ( "github.com/coreos/go-oidc/v3/oidc" "github.com/go-chi/chi/v5" - "github.com/go-jose/go-jose/v3" + "github.com/go-jose/go-jose/v4" "github.com/golang-jwt/jwt/v4" "github.com/google/uuid" "github.com/prometheus/client_golang/prometheus" diff --git a/coderd/cryptokeys/cache_test.go b/coderd/cryptokeys/cache_test.go index 0f732e3f171bc..8039d27233b59 100644 --- a/coderd/cryptokeys/cache_test.go +++ b/coderd/cryptokeys/cache_test.go @@ -18,7 +18,7 @@ import ( ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + goleak.VerifyTestMain(m, testutil.GoleakOptions...) } func TestCryptoKeyCache(t *testing.T) { diff --git a/coderd/database/awsiamrds/awsiamrds_test.go b/coderd/database/awsiamrds/awsiamrds_test.go index 844b85b119850..d52da4aab7bfe 100644 --- a/coderd/database/awsiamrds/awsiamrds_test.go +++ b/coderd/database/awsiamrds/awsiamrds_test.go @@ -9,6 +9,7 @@ import ( "github.com/coder/coder/v2/cli" "github.com/coder/coder/v2/coderd/database/awsiamrds" + "github.com/coder/coder/v2/coderd/database/migrations" "github.com/coder/coder/v2/coderd/database/pubsub" "github.com/coder/coder/v2/testutil" ) @@ -32,7 +33,7 @@ func TestDriver(t *testing.T) { sqlDriver, err := awsiamrds.Register(ctx, "postgres") require.NoError(t, err) - db, err := cli.ConnectToPostgres(ctx, testutil.Logger(t), sqlDriver, url) + db, err := cli.ConnectToPostgres(ctx, testutil.Logger(t), sqlDriver, url, migrations.Up) require.NoError(t, err) defer func() { _ = db.Close() diff --git a/coderd/database/db2sdk/db2sdk.go b/coderd/database/db2sdk/db2sdk.go index 19f0d7201106d..aabebcd14b7ac 100644 --- a/coderd/database/db2sdk/db2sdk.go +++ b/coderd/database/db2sdk/db2sdk.go @@ -518,6 +518,7 @@ func Apps(dbApps []database.WorkspaceApp, agent database.WorkspaceAgent, ownerNa }, Health: codersdk.WorkspaceAppHealth(dbApp.Health), Hidden: dbApp.Hidden, + OpenIn: codersdk.WorkspaceAppOpenIn(dbApp.OpenIn), }) } return apps diff --git a/coderd/database/dbauthz/dbauthz.go b/coderd/database/dbauthz/dbauthz.go index f64dbcc166591..0a35667ed0178 100644 --- a/coderd/database/dbauthz/dbauthz.go +++ b/coderd/database/dbauthz/dbauthz.go @@ -8,6 +8,7 @@ import ( "fmt" "strings" "sync/atomic" + "testing" "time" "github.com/google/uuid" @@ -1366,6 +1367,13 @@ func (q *querier) DeleteWorkspaceAgentPortSharesByTemplate(ctx context.Context, return q.db.DeleteWorkspaceAgentPortSharesByTemplate(ctx, templateID) } +func (q *querier) DisableForeignKeysAndTriggers(ctx context.Context) error { + if !testing.Testing() { + return xerrors.Errorf("DisableForeignKeysAndTriggers is only allowed in tests") + } + return q.db.DisableForeignKeysAndTriggers(ctx) +} + func (q *querier) EnqueueNotificationMessage(ctx context.Context, arg database.EnqueueNotificationMessageParams) error { if err := q.authorizeContext(ctx, policy.ActionCreate, rbac.ResourceNotificationMessage); err != nil { return err diff --git a/coderd/database/dbauthz/dbauthz_test.go b/coderd/database/dbauthz/dbauthz_test.go index 961f5d535b280..93e9a4318d1ed 100644 --- a/coderd/database/dbauthz/dbauthz_test.go +++ b/coderd/database/dbauthz/dbauthz_test.go @@ -4,18 +4,22 @@ import ( "context" "database/sql" "encoding/json" + "fmt" + "net" "reflect" "strings" "testing" "time" "github.com/google/uuid" + "github.com/sqlc-dev/pqtype" "github.com/stretchr/testify/require" "golang.org/x/xerrors" "cdr.dev/slog" "github.com/coder/coder/v2/coderd/database/db2sdk" + "github.com/coder/coder/v2/coderd/database/dbmem" "github.com/coder/coder/v2/coderd/notifications" "github.com/coder/coder/v2/coderd/rbac/policy" "github.com/coder/coder/v2/codersdk" @@ -24,7 +28,7 @@ import ( "github.com/coder/coder/v2/coderd/database" "github.com/coder/coder/v2/coderd/database/dbauthz" "github.com/coder/coder/v2/coderd/database/dbgen" - "github.com/coder/coder/v2/coderd/database/dbmem" + "github.com/coder/coder/v2/coderd/database/dbtestutil" "github.com/coder/coder/v2/coderd/database/dbtime" "github.com/coder/coder/v2/coderd/rbac" "github.com/coder/coder/v2/coderd/util/slice" @@ -70,7 +74,8 @@ func TestAsNoActor(t *testing.T) { func TestPing(t *testing.T) { t.Parallel() - q := dbauthz.New(dbmem.New(), &coderdtest.RecordingAuthorizer{}, slog.Make(), coderdtest.AccessControlStorePointer()) + db, _ := dbtestutil.NewDB(t) + q := dbauthz.New(db, &coderdtest.RecordingAuthorizer{}, slog.Make(), coderdtest.AccessControlStorePointer()) _, err := q.Ping(context.Background()) require.NoError(t, err, "must not error") } @@ -79,7 +84,7 @@ func TestPing(t *testing.T) { func TestInTX(t *testing.T) { t.Parallel() - db := dbmem.New() + db, _ := dbtestutil.NewDB(t) q := dbauthz.New(db, &coderdtest.RecordingAuthorizer{ Wrapped: (&coderdtest.FakeAuthorizer{}).AlwaysReturn(xerrors.New("custom error")), }, slog.Make(), coderdtest.AccessControlStorePointer()) @@ -89,8 +94,17 @@ func TestInTX(t *testing.T) { Groups: []string{}, Scope: rbac.ScopeAll, } - - w := dbgen.Workspace(t, db, database.WorkspaceTable{}) + u := dbgen.User(t, db, database.User{}) + o := dbgen.Organization(t, db, database.Organization{}) + tpl := dbgen.Template(t, db, database.Template{ + CreatedBy: u.ID, + OrganizationID: o.ID, + }) + w := dbgen.Workspace(t, db, database.WorkspaceTable{ + OwnerID: u.ID, + TemplateID: tpl.ID, + OrganizationID: o.ID, + }) ctx := dbauthz.As(context.Background(), actor) err := q.InTx(func(tx database.Store) error { // The inner tx should use the parent's authz @@ -107,15 +121,24 @@ func TestNew(t *testing.T) { t.Parallel() var ( - db = dbmem.New() - exp = dbgen.Workspace(t, db, database.WorkspaceTable{}) - rec = &coderdtest.RecordingAuthorizer{ + db, _ = dbtestutil.NewDB(t) + rec = &coderdtest.RecordingAuthorizer{ Wrapped: &coderdtest.FakeAuthorizer{}, } subj = rbac.Subject{} ctx = dbauthz.As(context.Background(), rbac.Subject{}) ) - + u := dbgen.User(t, db, database.User{}) + org := dbgen.Organization(t, db, database.Organization{}) + tpl := dbgen.Template(t, db, database.Template{ + OrganizationID: org.ID, + CreatedBy: u.ID, + }) + exp := dbgen.Workspace(t, db, database.WorkspaceTable{ + OwnerID: u.ID, + OrganizationID: org.ID, + TemplateID: tpl.ID, + }) // Double wrap should not cause an actual double wrap. So only 1 rbac call // should be made. az := dbauthz.New(db, rec, slog.Make(), coderdtest.AccessControlStorePointer()) @@ -134,7 +157,8 @@ func TestNew(t *testing.T) { // as only the first db call will be made. But it is better than nothing. func TestDBAuthzRecursive(t *testing.T) { t.Parallel() - q := dbauthz.New(dbmem.New(), &coderdtest.RecordingAuthorizer{ + db, _ := dbtestutil.NewDB(t) + q := dbauthz.New(db, &coderdtest.RecordingAuthorizer{ Wrapped: &coderdtest.FakeAuthorizer{}, }, slog.Make(), coderdtest.AccessControlStorePointer()) actor := rbac.Subject{ @@ -173,16 +197,29 @@ func must[T any](value T, err error) T { return value } +func defaultIPAddress() pqtype.Inet { + return pqtype.Inet{ + IPNet: net.IPNet{ + IP: net.IPv4(127, 0, 0, 1), + Mask: net.IPv4Mask(255, 255, 255, 255), + }, + Valid: true, + } +} + func (s *MethodTestSuite) TestAPIKey() { s.Run("DeleteAPIKeyByID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) key, _ := dbgen.APIKey(s.T(), db, database.APIKey{}) check.Args(key.ID).Asserts(key, policy.ActionDelete).Returns() })) s.Run("GetAPIKeyByID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) key, _ := dbgen.APIKey(s.T(), db, database.APIKey{}) check.Args(key.ID).Asserts(key, policy.ActionRead).Returns(key) })) s.Run("GetAPIKeyByName", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) key, _ := dbgen.APIKey(s.T(), db, database.APIKey{ TokenName: "marge-cat", LoginType: database.LoginTypeToken, @@ -193,6 +230,7 @@ func (s *MethodTestSuite) TestAPIKey() { }).Asserts(key, policy.ActionRead).Returns(key) })) s.Run("GetAPIKeysByLoginType", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) a, _ := dbgen.APIKey(s.T(), db, database.APIKey{LoginType: database.LoginTypePassword}) b, _ := dbgen.APIKey(s.T(), db, database.APIKey{LoginType: database.LoginTypePassword}) _, _ = dbgen.APIKey(s.T(), db, database.APIKey{LoginType: database.LoginTypeGithub}) @@ -201,18 +239,19 @@ func (s *MethodTestSuite) TestAPIKey() { Returns(slice.New(a, b)) })) s.Run("GetAPIKeysByUserID", s.Subtest(func(db database.Store, check *expects) { - idAB := uuid.New() - idC := uuid.New() + u1 := dbgen.User(s.T(), db, database.User{}) + u2 := dbgen.User(s.T(), db, database.User{}) - keyA, _ := dbgen.APIKey(s.T(), db, database.APIKey{UserID: idAB, LoginType: database.LoginTypeToken}) - keyB, _ := dbgen.APIKey(s.T(), db, database.APIKey{UserID: idAB, LoginType: database.LoginTypeToken}) - _, _ = dbgen.APIKey(s.T(), db, database.APIKey{UserID: idC, LoginType: database.LoginTypeToken}) + keyA, _ := dbgen.APIKey(s.T(), db, database.APIKey{UserID: u1.ID, LoginType: database.LoginTypeToken, TokenName: "key-a"}) + keyB, _ := dbgen.APIKey(s.T(), db, database.APIKey{UserID: u1.ID, LoginType: database.LoginTypeToken, TokenName: "key-b"}) + _, _ = dbgen.APIKey(s.T(), db, database.APIKey{UserID: u2.ID, LoginType: database.LoginTypeToken}) - check.Args(database.GetAPIKeysByUserIDParams{LoginType: database.LoginTypeToken, UserID: idAB}). + check.Args(database.GetAPIKeysByUserIDParams{LoginType: database.LoginTypeToken, UserID: u1.ID}). Asserts(keyA, policy.ActionRead, keyB, policy.ActionRead). Returns(slice.New(keyA, keyB)) })) s.Run("GetAPIKeysLastUsedAfter", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) a, _ := dbgen.APIKey(s.T(), db, database.APIKey{LastUsed: time.Now().Add(time.Hour)}) b, _ := dbgen.APIKey(s.T(), db, database.APIKey{LastUsed: time.Now().Add(time.Hour)}) _, _ = dbgen.APIKey(s.T(), db, database.APIKey{LastUsed: time.Now().Add(-time.Hour)}) @@ -222,19 +261,26 @@ func (s *MethodTestSuite) TestAPIKey() { })) s.Run("InsertAPIKey", s.Subtest(func(db database.Store, check *expects) { u := dbgen.User(s.T(), db, database.User{}) + check.Args(database.InsertAPIKeyParams{ UserID: u.ID, LoginType: database.LoginTypePassword, Scope: database.APIKeyScopeAll, + IPAddress: defaultIPAddress(), }).Asserts(rbac.ResourceApiKey.WithOwner(u.ID.String()), policy.ActionCreate) })) s.Run("UpdateAPIKeyByID", s.Subtest(func(db database.Store, check *expects) { - a, _ := dbgen.APIKey(s.T(), db, database.APIKey{}) + u := dbgen.User(s.T(), db, database.User{}) + a, _ := dbgen.APIKey(s.T(), db, database.APIKey{UserID: u.ID, IPAddress: defaultIPAddress()}) check.Args(database.UpdateAPIKeyByIDParams{ - ID: a.ID, + ID: a.ID, + IPAddress: defaultIPAddress(), + LastUsed: time.Now(), + ExpiresAt: time.Now().Add(time.Hour), }).Asserts(a, policy.ActionUpdate).Returns() })) s.Run("DeleteApplicationConnectAPIKeysByUserID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) a, _ := dbgen.APIKey(s.T(), db, database.APIKey{ Scope: database.APIKeyScopeApplicationConnect, }) @@ -261,8 +307,10 @@ func (s *MethodTestSuite) TestAPIKey() { func (s *MethodTestSuite) TestAuditLogs() { s.Run("InsertAuditLog", s.Subtest(func(db database.Store, check *expects) { check.Args(database.InsertAuditLogParams{ - ResourceType: database.ResourceTypeOrganization, - Action: database.AuditActionCreate, + ResourceType: database.ResourceTypeOrganization, + Action: database.AuditActionCreate, + Diff: json.RawMessage("{}"), + AdditionalFields: json.RawMessage("{}"), }).Asserts(rbac.ResourceAuditLog, policy.ActionCreate) })) s.Run("GetAuditLogsOffset", s.Subtest(func(db database.Store, check *expects) { @@ -270,9 +318,10 @@ func (s *MethodTestSuite) TestAuditLogs() { _ = dbgen.AuditLog(s.T(), db, database.AuditLog{}) check.Args(database.GetAuditLogsOffsetParams{ LimitOpt: 10, - }).Asserts(rbac.ResourceAuditLog, policy.ActionRead) + }).Asserts(rbac.ResourceAuditLog, policy.ActionRead).WithNotAuthorized("nil") })) s.Run("GetAuthorizedAuditLogsOffset", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) _ = dbgen.AuditLog(s.T(), db, database.AuditLog{}) _ = dbgen.AuditLog(s.T(), db, database.AuditLog{}) check.Args(database.GetAuditLogsOffsetParams{ @@ -303,10 +352,12 @@ func (s *MethodTestSuite) TestFile() { func (s *MethodTestSuite) TestGroup() { s.Run("DeleteGroupByID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) g := dbgen.Group(s.T(), db, database.Group{}) check.Args(g.ID).Asserts(g, policy.ActionDelete).Returns() })) s.Run("DeleteGroupMemberFromGroup", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) g := dbgen.Group(s.T(), db, database.Group{}) u := dbgen.User(s.T(), db, database.User{}) m := dbgen.GroupMember(s.T(), db, database.GroupMemberTable{ @@ -319,10 +370,12 @@ func (s *MethodTestSuite) TestGroup() { }).Asserts(g, policy.ActionUpdate).Returns() })) s.Run("GetGroupByID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) g := dbgen.Group(s.T(), db, database.Group{}) check.Args(g.ID).Asserts(g, policy.ActionRead).Returns(g) })) s.Run("GetGroupByOrgAndName", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) g := dbgen.Group(s.T(), db, database.Group{}) check.Args(database.GetGroupByOrgAndNameParams{ OrganizationID: g.OrganizationID, @@ -330,28 +383,33 @@ func (s *MethodTestSuite) TestGroup() { }).Asserts(g, policy.ActionRead).Returns(g) })) s.Run("GetGroupMembersByGroupID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) g := dbgen.Group(s.T(), db, database.Group{}) u := dbgen.User(s.T(), db, database.User{}) gm := dbgen.GroupMember(s.T(), db, database.GroupMemberTable{GroupID: g.ID, UserID: u.ID}) check.Args(g.ID).Asserts(gm, policy.ActionRead) })) s.Run("GetGroupMembersCountByGroupID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) g := dbgen.Group(s.T(), db, database.Group{}) check.Args(g.ID).Asserts(g, policy.ActionRead) })) s.Run("GetGroupMembers", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) g := dbgen.Group(s.T(), db, database.Group{}) u := dbgen.User(s.T(), db, database.User{}) dbgen.GroupMember(s.T(), db, database.GroupMemberTable{GroupID: g.ID, UserID: u.ID}) check.Asserts(rbac.ResourceSystem, policy.ActionRead) })) s.Run("System/GetGroups", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) _ = dbgen.Group(s.T(), db, database.Group{}) check.Args(database.GetGroupsParams{}). Asserts(rbac.ResourceSystem, policy.ActionRead) })) s.Run("GetGroups", s.Subtest(func(db database.Store, check *expects) { - g := dbgen.Group(s.T(), db, database.Group{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + g := dbgen.Group(s.T(), db, database.Group{OrganizationID: o.ID}) u := dbgen.User(s.T(), db, database.User{}) gm := dbgen.GroupMember(s.T(), db, database.GroupMemberTable{GroupID: g.ID, UserID: u.ID}) check.Args(database.GetGroupsParams{ @@ -373,6 +431,7 @@ func (s *MethodTestSuite) TestGroup() { }).Asserts(rbac.ResourceGroup.InOrg(o.ID), policy.ActionCreate) })) s.Run("InsertGroupMember", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) g := dbgen.Group(s.T(), db, database.Group{}) check.Args(database.InsertGroupMemberParams{ UserID: uuid.New(), @@ -384,7 +443,6 @@ func (s *MethodTestSuite) TestGroup() { u1 := dbgen.User(s.T(), db, database.User{}) g1 := dbgen.Group(s.T(), db, database.Group{OrganizationID: o.ID}) g2 := dbgen.Group(s.T(), db, database.Group{OrganizationID: o.ID}) - _ = dbgen.GroupMember(s.T(), db, database.GroupMemberTable{GroupID: g1.ID, UserID: u1.ID}) check.Args(database.InsertUserGroupsByNameParams{ OrganizationID: o.ID, UserID: u1.ID, @@ -396,11 +454,16 @@ func (s *MethodTestSuite) TestGroup() { u1 := dbgen.User(s.T(), db, database.User{}) g1 := dbgen.Group(s.T(), db, database.Group{OrganizationID: o.ID}) g2 := dbgen.Group(s.T(), db, database.Group{OrganizationID: o.ID}) + g3 := dbgen.Group(s.T(), db, database.Group{OrganizationID: o.ID}) _ = dbgen.GroupMember(s.T(), db, database.GroupMemberTable{GroupID: g1.ID, UserID: u1.ID}) + returns := slice.New(g2.ID, g3.ID) + if !dbtestutil.WillUsePostgres() { + returns = slice.New(g1.ID, g2.ID, g3.ID) + } check.Args(database.InsertUserGroupsByIDParams{ UserID: u1.ID, - GroupIds: slice.New(g1.ID, g2.ID), - }).Asserts(rbac.ResourceSystem, policy.ActionUpdate).Returns(slice.New(g1.ID, g2.ID)) + GroupIds: slice.New(g1.ID, g2.ID, g3.ID), + }).Asserts(rbac.ResourceSystem, policy.ActionUpdate).Returns(returns) })) s.Run("RemoveUserFromAllGroups", s.Subtest(func(db database.Store, check *expects) { o := dbgen.Organization(s.T(), db, database.Organization{}) @@ -424,6 +487,7 @@ func (s *MethodTestSuite) TestGroup() { }).Asserts(rbac.ResourceSystem, policy.ActionUpdate).Returns(slice.New(g1.ID, g2.ID)) })) s.Run("UpdateGroupByID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) g := dbgen.Group(s.T(), db, database.Group{}) check.Args(database.UpdateGroupByIDParams{ ID: g.ID, @@ -433,6 +497,7 @@ func (s *MethodTestSuite) TestGroup() { func (s *MethodTestSuite) TestProvisionerJob() { s.Run("ArchiveUnusedTemplateVersions", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ Type: database.ProvisionerJobTypeTemplateVersionImport, Error: sql.NullString{ @@ -453,6 +518,7 @@ func (s *MethodTestSuite) TestProvisionerJob() { }).Asserts(v.RBACObject(tpl), policy.ActionUpdate) })) s.Run("UnarchiveTemplateVersion", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ Type: database.ProvisionerJobTypeTemplateVersionImport, }) @@ -468,14 +534,35 @@ func (s *MethodTestSuite) TestProvisionerJob() { }).Asserts(v.RBACObject(tpl), policy.ActionUpdate) })) s.Run("Build/GetProvisionerJobByID", s.Subtest(func(db database.Store, check *expects) { - w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + OwnerID: u.ID, + OrganizationID: o.ID, + TemplateID: tpl.ID, + }) j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ Type: database.ProvisionerJobTypeWorkspaceBuild, }) - _ = dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{JobID: j.ID, WorkspaceID: w.ID}) + tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, + JobID: j.ID, + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + _ = dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{ + JobID: j.ID, + WorkspaceID: w.ID, + TemplateVersionID: tv.ID, + }) check.Args(j.ID).Asserts(w, policy.ActionRead).Returns(j) })) s.Run("TemplateVersion/GetProvisionerJobByID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ Type: database.ProvisionerJobTypeTemplateVersionImport, }) @@ -487,6 +574,7 @@ func (s *MethodTestSuite) TestProvisionerJob() { check.Args(j.ID).Asserts(v.RBACObject(tpl), policy.ActionRead).Returns(j) })) s.Run("TemplateVersionDryRun/GetProvisionerJobByID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) tpl := dbgen.Template(s.T(), db, database.Template{}) v := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, @@ -500,24 +588,59 @@ func (s *MethodTestSuite) TestProvisionerJob() { check.Args(j.ID).Asserts(v.RBACObject(tpl), policy.ActionRead).Returns(j) })) s.Run("Build/UpdateProvisionerJobWithCancelByID", s.Subtest(func(db database.Store, check *expects) { - tpl := dbgen.Template(s.T(), db, database.Template{AllowUserCancelWorkspaceJobs: true}) - w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{TemplateID: tpl.ID}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + AllowUserCancelWorkspaceJobs: true, + }) + tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ Type: database.ProvisionerJobTypeWorkspaceBuild, }) - _ = dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{JobID: j.ID, WorkspaceID: w.ID}) + _ = dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{ + JobID: j.ID, + WorkspaceID: w.ID, + TemplateVersionID: tv.ID, + }) check.Args(database.UpdateProvisionerJobWithCancelByIDParams{ID: j.ID}).Asserts(w, policy.ActionUpdate).Returns() })) s.Run("BuildFalseCancel/UpdateProvisionerJobWithCancelByID", s.Subtest(func(db database.Store, check *expects) { - tpl := dbgen.Template(s.T(), db, database.Template{AllowUserCancelWorkspaceJobs: false}) - w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{TemplateID: tpl.ID}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + AllowUserCancelWorkspaceJobs: false, + }) + tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{TemplateID: tpl.ID, OrganizationID: o.ID, OwnerID: u.ID}) j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ Type: database.ProvisionerJobTypeWorkspaceBuild, }) - _ = dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{JobID: j.ID, WorkspaceID: w.ID}) + _ = dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{ + JobID: j.ID, + WorkspaceID: w.ID, + TemplateVersionID: tv.ID, + }) check.Args(database.UpdateProvisionerJobWithCancelByIDParams{ID: j.ID}).Asserts(w, policy.ActionUpdate).Returns() })) s.Run("TemplateVersion/UpdateProvisionerJobWithCancelByID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ Type: database.ProvisionerJobTypeTemplateVersionImport, }) @@ -530,6 +653,7 @@ func (s *MethodTestSuite) TestProvisionerJob() { Asserts(v.RBACObject(tpl), []policy.Action{policy.ActionRead, policy.ActionUpdate}).Returns() })) s.Run("TemplateVersionNoTemplate/UpdateProvisionerJobWithCancelByID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ Type: database.ProvisionerJobTypeTemplateVersionImport, }) @@ -541,6 +665,7 @@ func (s *MethodTestSuite) TestProvisionerJob() { Asserts(v.RBACObjectNoTemplate(), []policy.Action{policy.ActionRead, policy.ActionUpdate}).Returns() })) s.Run("TemplateVersionDryRun/UpdateProvisionerJobWithCancelByID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) tpl := dbgen.Template(s.T(), db, database.Template{}) v := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, @@ -560,11 +685,30 @@ func (s *MethodTestSuite) TestProvisionerJob() { check.Args([]uuid.UUID{a.ID, b.ID}).Asserts().Returns(slice.New(a, b)) })) s.Run("GetProvisionerLogsAfterID", s.Subtest(func(db database.Store, check *expects) { - w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + OrganizationID: o.ID, + OwnerID: u.ID, + TemplateID: tpl.ID, + }) + tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, + OrganizationID: o.ID, + CreatedBy: u.ID, + }) j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ Type: database.ProvisionerJobTypeWorkspaceBuild, }) - _ = dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{JobID: j.ID, WorkspaceID: w.ID}) + _ = dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{ + JobID: j.ID, + WorkspaceID: w.ID, + TemplateVersionID: tv.ID, + }) check.Args(database.GetProvisionerLogsAfterIDParams{ JobID: j.ID, }).Asserts(w, policy.ActionRead).Returns([]database.ProvisionerJobLog{}) @@ -605,7 +749,8 @@ func (s *MethodTestSuite) TestLicense() { check.Args(l.ID).Asserts(l, policy.ActionDelete) })) s.Run("GetDeploymentID", s.Subtest(func(db database.Store, check *expects) { - check.Args().Asserts().Returns("") + db.InsertDeploymentID(context.Background(), "value") + check.Args().Asserts().Returns("value") })) s.Run("GetDefaultProxyConfig", s.Subtest(func(db database.Store, check *expects) { check.Args().Asserts().Returns(database.GetDefaultProxyConfigRow{ @@ -675,10 +820,12 @@ func (s *MethodTestSuite) TestOrganization() { s.Run("GetOrganizationIDsByMemberIDs", s.Subtest(func(db database.Store, check *expects) { oa := dbgen.Organization(s.T(), db, database.Organization{}) ob := dbgen.Organization(s.T(), db, database.Organization{}) - ma := dbgen.OrganizationMember(s.T(), db, database.OrganizationMember{OrganizationID: oa.ID}) - mb := dbgen.OrganizationMember(s.T(), db, database.OrganizationMember{OrganizationID: ob.ID}) + ua := dbgen.User(s.T(), db, database.User{}) + ub := dbgen.User(s.T(), db, database.User{}) + ma := dbgen.OrganizationMember(s.T(), db, database.OrganizationMember{OrganizationID: oa.ID, UserID: ua.ID}) + mb := dbgen.OrganizationMember(s.T(), db, database.OrganizationMember{OrganizationID: ob.ID, UserID: ub.ID}) check.Args([]uuid.UUID{ma.UserID, mb.UserID}). - Asserts(rbac.ResourceUserObject(ma.UserID), policy.ActionRead, rbac.ResourceUserObject(mb.UserID), policy.ActionRead) + Asserts(rbac.ResourceUserObject(ma.UserID), policy.ActionRead, rbac.ResourceUserObject(mb.UserID), policy.ActionRead).OutOfOrder() })) s.Run("GetOrganizations", s.Subtest(func(db database.Store, check *expects) { def, _ := db.GetDefaultOrganization(context.Background()) @@ -717,6 +864,11 @@ func (s *MethodTestSuite) TestOrganization() { u := dbgen.User(s.T(), db, database.User{}) member := dbgen.OrganizationMember(s.T(), db, database.OrganizationMember{UserID: u.ID, OrganizationID: o.ID}) + cancelledErr := "fetch object: context canceled" + if !dbtestutil.WillUsePostgres() { + cancelledErr = sql.ErrNoRows.Error() + } + check.Args(database.DeleteOrganizationMemberParams{ OrganizationID: o.ID, UserID: u.ID, @@ -724,10 +876,9 @@ func (s *MethodTestSuite) TestOrganization() { // Reads the org member before it tries to delete it member, policy.ActionRead, member, policy.ActionDelete). - // SQL Filter returns a 404 WithNotAuthorized("no rows"). - WithCancelled("no rows"). - Errors(sql.ErrNoRows) + WithCancelled(cancelledErr). + ErrorsWithInMemDB(sql.ErrNoRows) })) s.Run("UpdateOrganization", s.Subtest(func(db database.Store, check *expects) { o := dbgen.Organization(s.T(), db, database.Organization{ @@ -773,13 +924,18 @@ func (s *MethodTestSuite) TestOrganization() { out := mem out.Roles = []string{} + cancelledErr := "fetch object: context canceled" + if !dbtestutil.WillUsePostgres() { + cancelledErr = sql.ErrNoRows.Error() + } + check.Args(database.UpdateMemberRolesParams{ GrantedRoles: []string{}, UserID: u.ID, OrgID: o.ID, }). WithNotAuthorized(sql.ErrNoRows.Error()). - WithCancelled(sql.ErrNoRows.Error()). + WithCancelled(cancelledErr). Asserts( mem, policy.ActionRead, rbac.ResourceAssignOrgRole.InOrg(o.ID), policy.ActionAssign, // org-mem @@ -832,10 +988,12 @@ func (s *MethodTestSuite) TestTemplate() { s.Run("GetPreviousTemplateVersion", s.Subtest(func(db database.Store, check *expects) { tvid := uuid.New() now := time.Now() + u := dbgen.User(s.T(), db, database.User{}) o1 := dbgen.Organization(s.T(), db, database.Organization{}) t1 := dbgen.Template(s.T(), db, database.Template{ OrganizationID: o1.ID, ActiveVersionID: tvid, + CreatedBy: u.ID, }) _ = dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ CreatedAt: now.Add(-time.Hour), @@ -843,12 +1001,14 @@ func (s *MethodTestSuite) TestTemplate() { Name: t1.Name, OrganizationID: o1.ID, TemplateID: uuid.NullUUID{UUID: t1.ID, Valid: true}, + CreatedBy: u.ID, }) b := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ CreatedAt: now.Add(-2 * time.Hour), - Name: t1.Name, + Name: t1.Name + "b", OrganizationID: o1.ID, TemplateID: uuid.NullUUID{UUID: t1.ID, Valid: true}, + CreatedBy: u.ID, }) check.Args(database.GetPreviousTemplateVersionParams{ Name: t1.Name, @@ -857,10 +1017,12 @@ func (s *MethodTestSuite) TestTemplate() { }).Asserts(t1, policy.ActionRead).Returns(b) })) s.Run("GetTemplateByID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) t1 := dbgen.Template(s.T(), db, database.Template{}) check.Args(t1.ID).Asserts(t1, policy.ActionRead).Returns(t1) })) s.Run("GetTemplateByOrganizationAndName", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) o1 := dbgen.Organization(s.T(), db, database.Organization{}) t1 := dbgen.Template(s.T(), db, database.Template{ OrganizationID: o1.ID, @@ -871,6 +1033,7 @@ func (s *MethodTestSuite) TestTemplate() { }).Asserts(t1, policy.ActionRead).Returns(t1) })) s.Run("GetTemplateVersionByJobID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) t1 := dbgen.Template(s.T(), db, database.Template{}) tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ TemplateID: uuid.NullUUID{UUID: t1.ID, Valid: true}, @@ -878,6 +1041,7 @@ func (s *MethodTestSuite) TestTemplate() { check.Args(tv.JobID).Asserts(t1, policy.ActionRead).Returns(tv) })) s.Run("GetTemplateVersionByTemplateIDAndName", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) t1 := dbgen.Template(s.T(), db, database.Template{}) tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ TemplateID: uuid.NullUUID{UUID: t1.ID, Valid: true}, @@ -888,6 +1052,7 @@ func (s *MethodTestSuite) TestTemplate() { }).Asserts(t1, policy.ActionRead).Returns(tv) })) s.Run("GetTemplateVersionParameters", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) t1 := dbgen.Template(s.T(), db, database.Template{}) tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ TemplateID: uuid.NullUUID{UUID: t1.ID, Valid: true}, @@ -895,6 +1060,7 @@ func (s *MethodTestSuite) TestTemplate() { check.Args(tv.ID).Asserts(t1, policy.ActionRead).Returns([]database.TemplateVersionParameter{}) })) s.Run("GetTemplateVersionVariables", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) t1 := dbgen.Template(s.T(), db, database.Template{}) tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ TemplateID: uuid.NullUUID{UUID: t1.ID, Valid: true}, @@ -905,6 +1071,7 @@ func (s *MethodTestSuite) TestTemplate() { check.Args(tv.ID).Asserts(t1, policy.ActionRead).Returns([]database.TemplateVersionVariable{tvv1}) })) s.Run("GetTemplateVersionWorkspaceTags", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) t1 := dbgen.Template(s.T(), db, database.Template{}) tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ TemplateID: uuid.NullUUID{UUID: t1.ID, Valid: true}, @@ -915,14 +1082,17 @@ func (s *MethodTestSuite) TestTemplate() { check.Args(tv.ID).Asserts(t1, policy.ActionRead).Returns([]database.TemplateVersionWorkspaceTag{wt1}) })) s.Run("GetTemplateGroupRoles", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) t1 := dbgen.Template(s.T(), db, database.Template{}) check.Args(t1.ID).Asserts(t1, policy.ActionUpdate) })) s.Run("GetTemplateUserRoles", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) t1 := dbgen.Template(s.T(), db, database.Template{}) check.Args(t1.ID).Asserts(t1, policy.ActionUpdate) })) s.Run("GetTemplateVersionByID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) t1 := dbgen.Template(s.T(), db, database.Template{}) tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ TemplateID: uuid.NullUUID{UUID: t1.ID, Valid: true}, @@ -930,6 +1100,7 @@ func (s *MethodTestSuite) TestTemplate() { check.Args(tv.ID).Asserts(t1, policy.ActionRead).Returns(tv) })) s.Run("GetTemplateVersionsByTemplateID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) t1 := dbgen.Template(s.T(), db, database.Template{}) a := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ TemplateID: uuid.NullUUID{UUID: t1.ID, Valid: true}, @@ -943,6 +1114,7 @@ func (s *MethodTestSuite) TestTemplate() { Returns(slice.New(a, b)) })) s.Run("GetTemplateVersionsCreatedAfter", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) now := time.Now() t1 := dbgen.Template(s.T(), db, database.Template{}) _ = dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ @@ -956,12 +1128,18 @@ func (s *MethodTestSuite) TestTemplate() { check.Args(now.Add(-time.Hour)).Asserts(rbac.ResourceTemplate.All(), policy.ActionRead) })) s.Run("GetTemplatesWithFilter", s.Subtest(func(db database.Store, check *expects) { - a := dbgen.Template(s.T(), db, database.Template{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + u := dbgen.User(s.T(), db, database.User{}) + a := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) // No asserts because SQLFilter. check.Args(database.GetTemplatesWithFilterParams{}). Asserts().Returns(slice.New(a)) })) s.Run("GetAuthorizedTemplates", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) a := dbgen.Template(s.T(), db, database.Template{}) // No asserts because SQLFilter. check.Args(database.GetTemplatesWithFilterParams{}, emptyPreparedAuthorized{}). @@ -969,6 +1147,7 @@ func (s *MethodTestSuite) TestTemplate() { Returns(slice.New(a)) })) s.Run("InsertTemplate", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) orgID := uuid.New() check.Args(database.InsertTemplateParams{ Provisioner: "echo", @@ -977,6 +1156,7 @@ func (s *MethodTestSuite) TestTemplate() { }).Asserts(rbac.ResourceTemplate.InOrg(orgID), policy.ActionCreate) })) s.Run("InsertTemplateVersion", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) t1 := dbgen.Template(s.T(), db, database.Template{}) check.Args(database.InsertTemplateVersionParams{ TemplateID: uuid.NullUUID{UUID: t1.ID, Valid: true}, @@ -984,46 +1164,54 @@ func (s *MethodTestSuite) TestTemplate() { }).Asserts(t1, policy.ActionRead, t1, policy.ActionCreate) })) s.Run("SoftDeleteTemplateByID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) t1 := dbgen.Template(s.T(), db, database.Template{}) check.Args(t1.ID).Asserts(t1, policy.ActionDelete) })) s.Run("UpdateTemplateACLByID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) t1 := dbgen.Template(s.T(), db, database.Template{}) check.Args(database.UpdateTemplateACLByIDParams{ ID: t1.ID, }).Asserts(t1, policy.ActionCreate) })) s.Run("UpdateTemplateAccessControlByID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) t1 := dbgen.Template(s.T(), db, database.Template{}) check.Args(database.UpdateTemplateAccessControlByIDParams{ ID: t1.ID, }).Asserts(t1, policy.ActionUpdate) })) s.Run("UpdateTemplateScheduleByID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) t1 := dbgen.Template(s.T(), db, database.Template{}) check.Args(database.UpdateTemplateScheduleByIDParams{ ID: t1.ID, }).Asserts(t1, policy.ActionUpdate) })) s.Run("UpdateTemplateWorkspacesLastUsedAt", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) t1 := dbgen.Template(s.T(), db, database.Template{}) check.Args(database.UpdateTemplateWorkspacesLastUsedAtParams{ TemplateID: t1.ID, }).Asserts(t1, policy.ActionUpdate) })) s.Run("UpdateWorkspacesDormantDeletingAtByTemplateID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) t1 := dbgen.Template(s.T(), db, database.Template{}) check.Args(database.UpdateWorkspacesDormantDeletingAtByTemplateIDParams{ TemplateID: t1.ID, }).Asserts(t1, policy.ActionUpdate) })) s.Run("UpdateWorkspacesTTLByTemplateID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) t1 := dbgen.Template(s.T(), db, database.Template{}) check.Args(database.UpdateWorkspacesTTLByTemplateIDParams{ TemplateID: t1.ID, }).Asserts(t1, policy.ActionUpdate) })) s.Run("UpdateTemplateActiveVersionByID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) t1 := dbgen.Template(s.T(), db, database.Template{ ActiveVersionID: uuid.New(), }) @@ -1037,6 +1225,7 @@ func (s *MethodTestSuite) TestTemplate() { }).Asserts(t1, policy.ActionUpdate).Returns() })) s.Run("UpdateTemplateDeletedByID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) t1 := dbgen.Template(s.T(), db, database.Template{}) check.Args(database.UpdateTemplateDeletedByIDParams{ ID: t1.ID, @@ -1044,6 +1233,7 @@ func (s *MethodTestSuite) TestTemplate() { }).Asserts(t1, policy.ActionDelete).Returns() })) s.Run("UpdateTemplateMetaByID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) t1 := dbgen.Template(s.T(), db, database.Template{}) check.Args(database.UpdateTemplateMetaByIDParams{ ID: t1.ID, @@ -1051,6 +1241,7 @@ func (s *MethodTestSuite) TestTemplate() { }).Asserts(t1, policy.ActionUpdate) })) s.Run("UpdateTemplateVersionByID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) t1 := dbgen.Template(s.T(), db, database.Template{}) tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ TemplateID: uuid.NullUUID{UUID: t1.ID, Valid: true}, @@ -1063,6 +1254,7 @@ func (s *MethodTestSuite) TestTemplate() { }).Asserts(t1, policy.ActionUpdate) })) s.Run("UpdateTemplateVersionDescriptionByJobID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) jobID := uuid.New() t1 := dbgen.Template(s.T(), db, database.Template{}) _ = dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ @@ -1076,13 +1268,21 @@ func (s *MethodTestSuite) TestTemplate() { })) s.Run("UpdateTemplateVersionExternalAuthProvidersByJobID", s.Subtest(func(db database.Store, check *expects) { jobID := uuid.New() - t1 := dbgen.Template(s.T(), db, database.Template{}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + t1 := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) _ = dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ - TemplateID: uuid.NullUUID{UUID: t1.ID, Valid: true}, - JobID: jobID, + TemplateID: uuid.NullUUID{UUID: t1.ID, Valid: true}, + CreatedBy: u.ID, + OrganizationID: o.ID, + JobID: jobID, }) check.Args(database.UpdateTemplateVersionExternalAuthProvidersByJobIDParams{ - JobID: jobID, + JobID: jobID, + ExternalAuthProviders: json.RawMessage("{}"), }).Asserts(t1, policy.ActionUpdate).Returns() })) s.Run("GetTemplateInsights", s.Subtest(func(db database.Store, check *expects) { @@ -1092,13 +1292,19 @@ func (s *MethodTestSuite) TestTemplate() { check.Args(database.GetUserLatencyInsightsParams{}).Asserts(rbac.ResourceTemplate, policy.ActionViewInsights) })) s.Run("GetUserActivityInsights", s.Subtest(func(db database.Store, check *expects) { - check.Args(database.GetUserActivityInsightsParams{}).Asserts(rbac.ResourceTemplate, policy.ActionViewInsights).Errors(sql.ErrNoRows) + check.Args(database.GetUserActivityInsightsParams{}).Asserts(rbac.ResourceTemplate, policy.ActionViewInsights). + ErrorsWithInMemDB(sql.ErrNoRows). + Returns([]database.GetUserActivityInsightsRow{}) })) s.Run("GetTemplateParameterInsights", s.Subtest(func(db database.Store, check *expects) { check.Args(database.GetTemplateParameterInsightsParams{}).Asserts(rbac.ResourceTemplate, policy.ActionViewInsights) })) s.Run("GetTemplateInsightsByInterval", s.Subtest(func(db database.Store, check *expects) { - check.Args(database.GetTemplateInsightsByIntervalParams{}).Asserts(rbac.ResourceTemplate, policy.ActionViewInsights) + check.Args(database.GetTemplateInsightsByIntervalParams{ + IntervalDays: 7, + StartTime: dbtime.Now().Add(-time.Hour * 24 * 7), + EndTime: dbtime.Now(), + }).Asserts(rbac.ResourceTemplate, policy.ActionViewInsights) })) s.Run("GetTemplateInsightsByTemplate", s.Subtest(func(db database.Store, check *expects) { check.Args(database.GetTemplateInsightsByTemplateParams{}).Asserts(rbac.ResourceTemplate, policy.ActionViewInsights) @@ -1110,7 +1316,9 @@ func (s *MethodTestSuite) TestTemplate() { check.Args(database.GetTemplateAppInsightsByTemplateParams{}).Asserts(rbac.ResourceTemplate, policy.ActionViewInsights) })) s.Run("GetTemplateUsageStats", s.Subtest(func(db database.Store, check *expects) { - check.Args(database.GetTemplateUsageStatsParams{}).Asserts(rbac.ResourceTemplate, policy.ActionViewInsights).Errors(sql.ErrNoRows) + check.Args(database.GetTemplateUsageStatsParams{}).Asserts(rbac.ResourceTemplate, policy.ActionViewInsights). + ErrorsWithInMemDB(sql.ErrNoRows). + Returns([]database.TemplateUsageStat{}) })) s.Run("UpsertTemplateUsageStats", s.Subtest(func(db database.Store, check *expects) { check.Asserts(rbac.ResourceSystem, policy.ActionUpdate) @@ -1119,6 +1327,7 @@ func (s *MethodTestSuite) TestTemplate() { func (s *MethodTestSuite) TestUser() { s.Run("GetAuthorizedUsers", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) dbgen.User(s.T(), db, database.User{}) // No asserts because SQLFilter. check.Args(database.GetUsersParams{}, emptyPreparedAuthorized{}). @@ -1161,6 +1370,7 @@ func (s *MethodTestSuite) TestUser() { Returns(slice.New(a, b)) })) s.Run("GetUsers", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) dbgen.User(s.T(), db, database.User{Username: "GetUsers-a-user"}) dbgen.User(s.T(), db, database.User{Username: "GetUsers-b-user"}) check.Args(database.GetUsersParams{}). @@ -1171,6 +1381,7 @@ func (s *MethodTestSuite) TestUser() { check.Args(database.InsertUserParams{ ID: uuid.New(), LoginType: database.LoginTypePassword, + RBACRoles: []string{}, }).Asserts(rbac.ResourceAssignRole, policy.ActionAssign, rbac.ResourceUser, policy.ActionCreate) })) s.Run("InsertUserLink", s.Subtest(func(db database.Store, check *expects) { @@ -1199,7 +1410,9 @@ func (s *MethodTestSuite) TestUser() { s.Run("UpdateUserHashedOneTimePasscode", s.Subtest(func(db database.Store, check *expects) { u := dbgen.User(s.T(), db, database.User{}) check.Args(database.UpdateUserHashedOneTimePasscodeParams{ - ID: u.ID, + ID: u.ID, + HashedOneTimePasscode: []byte{}, + OneTimePasscodeExpiresAt: sql.NullTime{Time: u.CreatedAt, Valid: true}, }).Asserts(rbac.ResourceSystem, policy.ActionUpdate).Returns() })) s.Run("UpdateUserQuietHoursSchedule", s.Subtest(func(db database.Store, check *expects) { @@ -1254,10 +1467,12 @@ func (s *MethodTestSuite) TestUser() { }).Asserts(u, policy.ActionUpdate).Returns(u) })) s.Run("DeleteGitSSHKey", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) key := dbgen.GitSSHKey(s.T(), db, database.GitSSHKey{}) check.Args(key.UserID).Asserts(rbac.ResourceUserObject(key.UserID), policy.ActionUpdatePersonal).Returns() })) s.Run("GetGitSSHKey", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) key := dbgen.GitSSHKey(s.T(), db, database.GitSSHKey{}) check.Args(key.UserID).Asserts(rbac.ResourceUserObject(key.UserID), policy.ActionReadPersonal).Returns(key) })) @@ -1268,6 +1483,7 @@ func (s *MethodTestSuite) TestUser() { }).Asserts(u, policy.ActionUpdatePersonal) })) s.Run("UpdateGitSSHKey", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) key := dbgen.GitSSHKey(s.T(), db, database.GitSSHKey{}) check.Args(database.UpdateGitSSHKeyParams{ UserID: key.UserID, @@ -1310,6 +1526,7 @@ func (s *MethodTestSuite) TestUser() { }).Asserts(rbac.ResourceUserObject(link.UserID), policy.ActionUpdatePersonal).Returns(link) })) s.Run("UpdateUserLink", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) link := dbgen.UserLink(s.T(), db, database.UserLink{}) check.Args(database.UpdateUserLinkParams{ OAuthAccessToken: link.OAuthAccessToken, @@ -1367,6 +1584,7 @@ func (s *MethodTestSuite) TestUser() { rbac.ResourceAssignRole, policy.ActionDelete) })) s.Run("Blank/UpdateCustomRole", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) customRole := dbgen.CustomRole(s.T(), db, database.CustomRole{}) // Blank is no perms in the role check.Args(database.UpdateCustomRoleParams{ @@ -1375,7 +1593,7 @@ func (s *MethodTestSuite) TestUser() { SitePermissions: nil, OrgPermissions: nil, UserPermissions: nil, - }).Asserts(rbac.ResourceAssignRole, policy.ActionUpdate) + }).Asserts(rbac.ResourceAssignRole, policy.ActionUpdate).ErrorsWithPG(sql.ErrNoRows) })) s.Run("SitePermissions/UpdateCustomRole", s.Subtest(func(db database.Store, check *expects) { customRole := dbgen.CustomRole(s.T(), db, database.CustomRole{ @@ -1406,7 +1624,7 @@ func (s *MethodTestSuite) TestUser() { rbac.ResourceTemplate, policy.ActionViewInsights, rbac.ResourceWorkspace.WithOwner(testActorID.String()), policy.ActionRead, - ) + ).ErrorsWithPG(sql.ErrNoRows) })) s.Run("OrgPermissions/UpdateCustomRole", s.Subtest(func(db database.Store, check *expects) { orgID := uuid.New() @@ -1494,22 +1712,29 @@ func (s *MethodTestSuite) TestUser() { func (s *MethodTestSuite) TestWorkspace() { s.Run("GetWorkspaceByID", s.Subtest(func(db database.Store, check *expects) { - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + OwnerID: u.ID, + OrganizationID: o.ID, + TemplateID: tpl.ID, + }) check.Args(ws.ID).Asserts(ws, policy.ActionRead) })) - s.Run("GetWorkspaces", s.Subtest(func(db database.Store, check *expects) { - _ = dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) - _ = dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) + s.Run("GetWorkspaces", s.Subtest(func(_ database.Store, check *expects) { // No asserts here because SQLFilter. check.Args(database.GetWorkspacesParams{}).Asserts() })) - s.Run("GetAuthorizedWorkspaces", s.Subtest(func(db database.Store, check *expects) { - _ = dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) - _ = dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) + s.Run("GetAuthorizedWorkspaces", s.Subtest(func(_ database.Store, check *expects) { // No asserts here because SQLFilter. check.Args(database.GetWorkspacesParams{}, emptyPreparedAuthorized{}).Asserts() })) s.Run("GetWorkspacesAndAgentsByOwnerID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: ws.ID, JobID: uuid.New()}) _ = dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ID: build.JobID, Type: database.ProvisionerJobTypeWorkspaceBuild}) @@ -1519,6 +1744,7 @@ func (s *MethodTestSuite) TestWorkspace() { check.Args(ws.OwnerID).Asserts() })) s.Run("GetAuthorizedWorkspacesAndAgentsByOwnerID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: ws.ID, JobID: uuid.New()}) _ = dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ID: build.JobID, Type: database.ProvisionerJobTypeWorkspaceBuild}) @@ -1528,37 +1754,116 @@ func (s *MethodTestSuite) TestWorkspace() { check.Args(ws.OwnerID, emptyPreparedAuthorized{}).Asserts() })) s.Run("GetLatestWorkspaceBuildByWorkspaceID", s.Subtest(func(db database.Store, check *expects) { - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) - b := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: ws.ID}) - check.Args(ws.ID).Asserts(ws, policy.ActionRead).Returns(b) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ + Type: database.ProvisionerJobTypeWorkspaceBuild, + }) + b := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{ + JobID: j.ID, + WorkspaceID: w.ID, + TemplateVersionID: tv.ID, + }) + check.Args(w.ID).Asserts(w, policy.ActionRead).Returns(b) })) s.Run("GetWorkspaceAgentByID", s.Subtest(func(db database.Store, check *expects) { - tpl := dbgen.Template(s.T(), db, database.Template{}) - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ - TemplateID: tpl.ID, + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, }) - build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: ws.ID, JobID: uuid.New()}) - res := dbgen.WorkspaceResource(s.T(), db, database.WorkspaceResource{JobID: build.JobID}) + tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ + Type: database.ProvisionerJobTypeWorkspaceBuild, + }) + b := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{ + JobID: j.ID, + WorkspaceID: w.ID, + TemplateVersionID: tv.ID, + }) + res := dbgen.WorkspaceResource(s.T(), db, database.WorkspaceResource{JobID: b.JobID}) agt := dbgen.WorkspaceAgent(s.T(), db, database.WorkspaceAgent{ResourceID: res.ID}) - check.Args(agt.ID).Asserts(ws, policy.ActionRead).Returns(agt) + check.Args(agt.ID).Asserts(w, policy.ActionRead).Returns(agt) })) s.Run("GetWorkspaceAgentLifecycleStateByID", s.Subtest(func(db database.Store, check *expects) { - tpl := dbgen.Template(s.T(), db, database.Template{}) - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ - TemplateID: tpl.ID, + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, }) - build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: ws.ID, JobID: uuid.New()}) - res := dbgen.WorkspaceResource(s.T(), db, database.WorkspaceResource{JobID: build.JobID}) + tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ + Type: database.ProvisionerJobTypeWorkspaceBuild, + }) + b := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{ + JobID: j.ID, + WorkspaceID: w.ID, + TemplateVersionID: tv.ID, + }) + res := dbgen.WorkspaceResource(s.T(), db, database.WorkspaceResource{JobID: b.JobID}) agt := dbgen.WorkspaceAgent(s.T(), db, database.WorkspaceAgent{ResourceID: res.ID}) - check.Args(agt.ID).Asserts(ws, policy.ActionRead) + check.Args(agt.ID).Asserts(w, policy.ActionRead) })) s.Run("GetWorkspaceAgentMetadata", s.Subtest(func(db database.Store, check *expects) { - tpl := dbgen.Template(s.T(), db, database.Template{}) - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ - TemplateID: tpl.ID, + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, }) - build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: ws.ID, JobID: uuid.New()}) - res := dbgen.WorkspaceResource(s.T(), db, database.WorkspaceResource{JobID: build.JobID}) + tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ + Type: database.ProvisionerJobTypeWorkspaceBuild, + }) + b := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{ + JobID: j.ID, + WorkspaceID: w.ID, + TemplateVersionID: tv.ID, + }) + res := dbgen.WorkspaceResource(s.T(), db, database.WorkspaceResource{JobID: b.JobID}) agt := dbgen.WorkspaceAgent(s.T(), db, database.WorkspaceAgent{ResourceID: res.ID}) _ = db.InsertWorkspaceAgentMetadata(context.Background(), database.InsertWorkspaceAgentMetadataParams{ WorkspaceAgentID: agt.ID, @@ -1568,77 +1873,191 @@ func (s *MethodTestSuite) TestWorkspace() { check.Args(database.GetWorkspaceAgentMetadataParams{ WorkspaceAgentID: agt.ID, Keys: []string{"test"}, - }).Asserts(ws, policy.ActionRead) + }).Asserts(w, policy.ActionRead) })) s.Run("GetWorkspaceAgentByInstanceID", s.Subtest(func(db database.Store, check *expects) { - tpl := dbgen.Template(s.T(), db, database.Template{}) - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ - TemplateID: tpl.ID, + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, }) - build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: ws.ID, JobID: uuid.New()}) - res := dbgen.WorkspaceResource(s.T(), db, database.WorkspaceResource{JobID: build.JobID}) + tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ + Type: database.ProvisionerJobTypeWorkspaceBuild, + }) + b := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{ + JobID: j.ID, + WorkspaceID: w.ID, + TemplateVersionID: tv.ID, + }) + res := dbgen.WorkspaceResource(s.T(), db, database.WorkspaceResource{JobID: b.JobID}) agt := dbgen.WorkspaceAgent(s.T(), db, database.WorkspaceAgent{ResourceID: res.ID}) - check.Args(agt.AuthInstanceID.String).Asserts(ws, policy.ActionRead).Returns(agt) + check.Args(agt.AuthInstanceID.String).Asserts(w, policy.ActionRead).Returns(agt) })) s.Run("UpdateWorkspaceAgentLifecycleStateByID", s.Subtest(func(db database.Store, check *expects) { - tpl := dbgen.Template(s.T(), db, database.Template{}) - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ - TemplateID: tpl.ID, + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, }) - build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: ws.ID, JobID: uuid.New()}) - res := dbgen.WorkspaceResource(s.T(), db, database.WorkspaceResource{JobID: build.JobID}) + tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ + Type: database.ProvisionerJobTypeWorkspaceBuild, + }) + b := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{ + JobID: j.ID, + WorkspaceID: w.ID, + TemplateVersionID: tv.ID, + }) + res := dbgen.WorkspaceResource(s.T(), db, database.WorkspaceResource{JobID: b.JobID}) agt := dbgen.WorkspaceAgent(s.T(), db, database.WorkspaceAgent{ResourceID: res.ID}) check.Args(database.UpdateWorkspaceAgentLifecycleStateByIDParams{ ID: agt.ID, LifecycleState: database.WorkspaceAgentLifecycleStateCreated, - }).Asserts(ws, policy.ActionUpdate).Returns() + }).Asserts(w, policy.ActionUpdate).Returns() })) s.Run("UpdateWorkspaceAgentMetadata", s.Subtest(func(db database.Store, check *expects) { - tpl := dbgen.Template(s.T(), db, database.Template{}) - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ - TemplateID: tpl.ID, + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, }) - build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: ws.ID, JobID: uuid.New()}) - res := dbgen.WorkspaceResource(s.T(), db, database.WorkspaceResource{JobID: build.JobID}) + tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ + Type: database.ProvisionerJobTypeWorkspaceBuild, + }) + b := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{ + JobID: j.ID, + WorkspaceID: w.ID, + TemplateVersionID: tv.ID, + }) + res := dbgen.WorkspaceResource(s.T(), db, database.WorkspaceResource{JobID: b.JobID}) agt := dbgen.WorkspaceAgent(s.T(), db, database.WorkspaceAgent{ResourceID: res.ID}) check.Args(database.UpdateWorkspaceAgentMetadataParams{ WorkspaceAgentID: agt.ID, - }).Asserts(ws, policy.ActionUpdate).Returns() + }).Asserts(w, policy.ActionUpdate).Returns() })) s.Run("UpdateWorkspaceAgentLogOverflowByID", s.Subtest(func(db database.Store, check *expects) { - tpl := dbgen.Template(s.T(), db, database.Template{}) - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ - TemplateID: tpl.ID, + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, }) - build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: ws.ID, JobID: uuid.New()}) - res := dbgen.WorkspaceResource(s.T(), db, database.WorkspaceResource{JobID: build.JobID}) - agt := dbgen.WorkspaceAgent(s.T(), db, database.WorkspaceAgent{ResourceID: res.ID}) - check.Args(database.UpdateWorkspaceAgentLogOverflowByIDParams{ - ID: agt.ID, + tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ + Type: database.ProvisionerJobTypeWorkspaceBuild, + }) + b := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{ + JobID: j.ID, + WorkspaceID: w.ID, + TemplateVersionID: tv.ID, + }) + res := dbgen.WorkspaceResource(s.T(), db, database.WorkspaceResource{JobID: b.JobID}) + agt := dbgen.WorkspaceAgent(s.T(), db, database.WorkspaceAgent{ResourceID: res.ID}) + check.Args(database.UpdateWorkspaceAgentLogOverflowByIDParams{ + ID: agt.ID, LogsOverflowed: true, - }).Asserts(ws, policy.ActionUpdate).Returns() + }).Asserts(w, policy.ActionUpdate).Returns() })) s.Run("UpdateWorkspaceAgentStartupByID", s.Subtest(func(db database.Store, check *expects) { - tpl := dbgen.Template(s.T(), db, database.Template{}) - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ - TemplateID: tpl.ID, + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, }) - build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: ws.ID, JobID: uuid.New()}) - res := dbgen.WorkspaceResource(s.T(), db, database.WorkspaceResource{JobID: build.JobID}) + tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ + Type: database.ProvisionerJobTypeWorkspaceBuild, + }) + b := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{ + JobID: j.ID, + WorkspaceID: w.ID, + TemplateVersionID: tv.ID, + }) + res := dbgen.WorkspaceResource(s.T(), db, database.WorkspaceResource{JobID: b.JobID}) agt := dbgen.WorkspaceAgent(s.T(), db, database.WorkspaceAgent{ResourceID: res.ID}) check.Args(database.UpdateWorkspaceAgentStartupByIDParams{ ID: agt.ID, Subsystems: []database.WorkspaceAgentSubsystem{ database.WorkspaceAgentSubsystemEnvbox, }, - }).Asserts(ws, policy.ActionUpdate).Returns() + }).Asserts(w, policy.ActionUpdate).Returns() })) s.Run("GetWorkspaceAgentLogsAfter", s.Subtest(func(db database.Store, check *expects) { - tpl := dbgen.Template(s.T(), db, database.Template{}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, + OrganizationID: o.ID, + CreatedBy: u.ID, + }) ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ - TemplateID: tpl.ID, + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ + Type: database.ProvisionerJobTypeWorkspaceBuild, + }) + build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{ + JobID: j.ID, + WorkspaceID: ws.ID, + TemplateVersionID: tv.ID, }) - build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: ws.ID, JobID: uuid.New()}) res := dbgen.WorkspaceResource(s.T(), db, database.WorkspaceResource{JobID: build.JobID}) agt := dbgen.WorkspaceAgent(s.T(), db, database.WorkspaceAgent{ResourceID: res.ID}) check.Args(database.GetWorkspaceAgentLogsAfterParams{ @@ -1646,11 +2065,30 @@ func (s *MethodTestSuite) TestWorkspace() { }).Asserts(ws, policy.ActionRead).Returns([]database.WorkspaceAgentLog{}) })) s.Run("GetWorkspaceAppByAgentIDAndSlug", s.Subtest(func(db database.Store, check *expects) { - tpl := dbgen.Template(s.T(), db, database.Template{}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, + OrganizationID: o.ID, + CreatedBy: u.ID, + }) ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ - TemplateID: tpl.ID, + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ + Type: database.ProvisionerJobTypeWorkspaceBuild, + }) + build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{ + JobID: j.ID, + WorkspaceID: ws.ID, + TemplateVersionID: tv.ID, }) - build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: ws.ID, JobID: uuid.New()}) res := dbgen.WorkspaceResource(s.T(), db, database.WorkspaceResource{JobID: build.JobID}) agt := dbgen.WorkspaceAgent(s.T(), db, database.WorkspaceAgent{ResourceID: res.ID}) app := dbgen.WorkspaceApp(s.T(), db, database.WorkspaceApp{AgentID: agt.ID}) @@ -1661,11 +2099,30 @@ func (s *MethodTestSuite) TestWorkspace() { }).Asserts(ws, policy.ActionRead).Returns(app) })) s.Run("GetWorkspaceAppsByAgentID", s.Subtest(func(db database.Store, check *expects) { - tpl := dbgen.Template(s.T(), db, database.Template{}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, + OrganizationID: o.ID, + CreatedBy: u.ID, + }) ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ - TemplateID: tpl.ID, + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ + Type: database.ProvisionerJobTypeWorkspaceBuild, + }) + build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{ + JobID: j.ID, + WorkspaceID: ws.ID, + TemplateVersionID: tv.ID, }) - build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: ws.ID, JobID: uuid.New()}) res := dbgen.WorkspaceResource(s.T(), db, database.WorkspaceResource{JobID: build.JobID}) agt := dbgen.WorkspaceAgent(s.T(), db, database.WorkspaceAgent{ResourceID: res.ID}) a := dbgen.WorkspaceApp(s.T(), db, database.WorkspaceApp{AgentID: agt.ID}) @@ -1674,58 +2131,234 @@ func (s *MethodTestSuite) TestWorkspace() { check.Args(agt.ID).Asserts(ws, policy.ActionRead).Returns(slice.New(a, b)) })) s.Run("GetWorkspaceBuildByID", s.Subtest(func(db database.Store, check *expects) { - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) - build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: ws.ID}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ + Type: database.ProvisionerJobTypeWorkspaceBuild, + }) + build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{ + JobID: j.ID, + WorkspaceID: ws.ID, + TemplateVersionID: tv.ID, + }) check.Args(build.ID).Asserts(ws, policy.ActionRead).Returns(build) })) s.Run("GetWorkspaceBuildByJobID", s.Subtest(func(db database.Store, check *expects) { - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) - build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: ws.ID}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ + Type: database.ProvisionerJobTypeWorkspaceBuild, + }) + build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{ + JobID: j.ID, + WorkspaceID: ws.ID, + TemplateVersionID: tv.ID, + }) check.Args(build.JobID).Asserts(ws, policy.ActionRead).Returns(build) })) s.Run("GetWorkspaceBuildByWorkspaceIDAndBuildNumber", s.Subtest(func(db database.Store, check *expects) { - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) - build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: ws.ID, BuildNumber: 10}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ + Type: database.ProvisionerJobTypeWorkspaceBuild, + }) + build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{ + JobID: j.ID, + WorkspaceID: ws.ID, + TemplateVersionID: tv.ID, + BuildNumber: 10, + }) check.Args(database.GetWorkspaceBuildByWorkspaceIDAndBuildNumberParams{ WorkspaceID: ws.ID, BuildNumber: build.BuildNumber, }).Asserts(ws, policy.ActionRead).Returns(build) })) s.Run("GetWorkspaceBuildParameters", s.Subtest(func(db database.Store, check *expects) { - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) - build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: ws.ID}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ + Type: database.ProvisionerJobTypeWorkspaceBuild, + }) + build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{ + JobID: j.ID, + WorkspaceID: ws.ID, + TemplateVersionID: tv.ID, + }) check.Args(build.ID).Asserts(ws, policy.ActionRead). Returns([]database.WorkspaceBuildParameter{}) })) s.Run("GetWorkspaceBuildsByWorkspaceID", s.Subtest(func(db database.Store, check *expects) { - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) - _ = dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: ws.ID, BuildNumber: 1}) - _ = dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: ws.ID, BuildNumber: 2}) - _ = dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: ws.ID, BuildNumber: 3}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + j1 := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ + Type: database.ProvisionerJobTypeWorkspaceBuild, + }) + _ = dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{ + JobID: j1.ID, + WorkspaceID: ws.ID, + TemplateVersionID: tv.ID, + BuildNumber: 1, + }) + j2 := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ + Type: database.ProvisionerJobTypeWorkspaceBuild, + }) + _ = dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{ + JobID: j2.ID, + WorkspaceID: ws.ID, + TemplateVersionID: tv.ID, + BuildNumber: 2, + }) + j3 := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ + Type: database.ProvisionerJobTypeWorkspaceBuild, + }) + _ = dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{ + JobID: j3.ID, + WorkspaceID: ws.ID, + TemplateVersionID: tv.ID, + BuildNumber: 3, + }) check.Args(database.GetWorkspaceBuildsByWorkspaceIDParams{WorkspaceID: ws.ID}).Asserts(ws, policy.ActionRead) // ordering })) s.Run("GetWorkspaceByAgentID", s.Subtest(func(db database.Store, check *expects) { - tpl := dbgen.Template(s.T(), db, database.Template{}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, + OrganizationID: o.ID, + CreatedBy: u.ID, + }) ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ - TemplateID: tpl.ID, + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ + Type: database.ProvisionerJobTypeWorkspaceBuild, + }) + build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{ + JobID: j.ID, + WorkspaceID: ws.ID, + TemplateVersionID: tv.ID, }) - build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: ws.ID, JobID: uuid.New()}) res := dbgen.WorkspaceResource(s.T(), db, database.WorkspaceResource{JobID: build.JobID}) agt := dbgen.WorkspaceAgent(s.T(), db, database.WorkspaceAgent{ResourceID: res.ID}) check.Args(agt.ID).Asserts(ws, policy.ActionRead) })) s.Run("GetWorkspaceAgentsInLatestBuildByWorkspaceID", s.Subtest(func(db database.Store, check *expects) { - tpl := dbgen.Template(s.T(), db, database.Template{}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, + OrganizationID: o.ID, + CreatedBy: u.ID, + }) ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ - TemplateID: tpl.ID, + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ + Type: database.ProvisionerJobTypeWorkspaceBuild, + }) + build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{ + JobID: j.ID, + WorkspaceID: ws.ID, + TemplateVersionID: tv.ID, }) - build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: ws.ID, JobID: uuid.New()}) res := dbgen.WorkspaceResource(s.T(), db, database.WorkspaceResource{JobID: build.JobID}) dbgen.WorkspaceAgent(s.T(), db, database.WorkspaceAgent{ResourceID: res.ID}) check.Args(ws.ID).Asserts(ws, policy.ActionRead) })) s.Run("GetWorkspaceByOwnerIDAndName", s.Subtest(func(db database.Store, check *expects) { - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) check.Args(database.GetWorkspaceByOwnerIDAndNameParams{ OwnerID: ws.OwnerID, Deleted: ws.Deleted, @@ -1733,58 +2366,157 @@ func (s *MethodTestSuite) TestWorkspace() { }).Asserts(ws, policy.ActionRead) })) s.Run("GetWorkspaceResourceByID", s.Subtest(func(db database.Store, check *expects) { - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) - build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: ws.ID, JobID: uuid.New()}) - _ = dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ID: build.JobID, Type: database.ProvisionerJobTypeWorkspaceBuild}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ + Type: database.ProvisionerJobTypeWorkspaceBuild, + }) + build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{ + JobID: j.ID, + WorkspaceID: ws.ID, + TemplateVersionID: tv.ID, + }) res := dbgen.WorkspaceResource(s.T(), db, database.WorkspaceResource{JobID: build.JobID}) check.Args(res.ID).Asserts(ws, policy.ActionRead).Returns(res) })) s.Run("Build/GetWorkspaceResourcesByJobID", s.Subtest(func(db database.Store, check *expects) { - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) - build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: ws.ID, JobID: uuid.New()}) - job := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ID: build.JobID, Type: database.ProvisionerJobTypeWorkspaceBuild}) - check.Args(job.ID).Asserts(ws, policy.ActionRead).Returns([]database.WorkspaceResource{}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ + Type: database.ProvisionerJobTypeWorkspaceBuild, + }) + build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{ + JobID: j.ID, + WorkspaceID: ws.ID, + TemplateVersionID: tv.ID, + }) + check.Args(build.JobID).Asserts(ws, policy.ActionRead).Returns([]database.WorkspaceResource{}) })) s.Run("Template/GetWorkspaceResourcesByJobID", s.Subtest(func(db database.Store, check *expects) { - tpl := dbgen.Template(s.T(), db, database.Template{}) - v := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, JobID: uuid.New()}) - job := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ID: v.JobID, Type: database.ProvisionerJobTypeTemplateVersionImport}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + v := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, + OrganizationID: o.ID, + CreatedBy: u.ID, + JobID: uuid.New(), + }) + job := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ + ID: v.JobID, + Type: database.ProvisionerJobTypeTemplateVersionImport, + }) check.Args(job.ID).Asserts(v.RBACObject(tpl), []policy.Action{policy.ActionRead, policy.ActionRead}).Returns([]database.WorkspaceResource{}) })) s.Run("InsertWorkspace", s.Subtest(func(db database.Store, check *expects) { u := dbgen.User(s.T(), db, database.User{}) o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) check.Args(database.InsertWorkspaceParams{ ID: uuid.New(), OwnerID: u.ID, OrganizationID: o.ID, AutomaticUpdates: database.AutomaticUpdatesNever, + TemplateID: tpl.ID, }).Asserts(rbac.ResourceWorkspace.WithOwner(u.ID.String()).InOrg(o.ID), policy.ActionCreate) })) s.Run("Start/InsertWorkspaceBuild", s.Subtest(func(db database.Store, check *expects) { - t := dbgen.Template(s.T(), db, database.Template{}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + t := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ - TemplateID: t.ID, + TemplateID: t.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + pj := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ + OrganizationID: o.ID, + }) + tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + TemplateID: uuid.NullUUID{UUID: t.ID, Valid: true}, + OrganizationID: o.ID, + CreatedBy: u.ID, }) check.Args(database.InsertWorkspaceBuildParams{ - WorkspaceID: w.ID, - Transition: database.WorkspaceTransitionStart, - Reason: database.BuildReasonInitiator, + WorkspaceID: w.ID, + TemplateVersionID: tv.ID, + Transition: database.WorkspaceTransitionStart, + Reason: database.BuildReasonInitiator, + JobID: pj.ID, }).Asserts(w, policy.ActionWorkspaceStart) })) s.Run("Stop/InsertWorkspaceBuild", s.Subtest(func(db database.Store, check *expects) { - t := dbgen.Template(s.T(), db, database.Template{}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + t := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ - TemplateID: t.ID, + TemplateID: t.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + TemplateID: uuid.NullUUID{UUID: t.ID, Valid: true}, + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + pj := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ + OrganizationID: o.ID, }) check.Args(database.InsertWorkspaceBuildParams{ - WorkspaceID: w.ID, - Transition: database.WorkspaceTransitionStop, - Reason: database.BuildReasonInitiator, + WorkspaceID: w.ID, + TemplateVersionID: tv.ID, + Transition: database.WorkspaceTransitionStop, + Reason: database.BuildReasonInitiator, + JobID: pj.ID, }).Asserts(w, policy.ActionWorkspaceStop) })) s.Run("Start/RequireActiveVersion/VersionMismatch/InsertWorkspaceBuild", s.Subtest(func(db database.Store, check *expects) { - t := dbgen.Template(s.T(), db, database.Template{}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + t := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) ctx := testutil.Context(s.T(), testutil.WaitShort) err := db.UpdateTemplateAccessControlByID(ctx, database.UpdateTemplateAccessControlByIDParams{ ID: t.ID, @@ -1792,24 +2524,39 @@ func (s *MethodTestSuite) TestWorkspace() { }) require.NoError(s.T(), err) v := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ - TemplateID: uuid.NullUUID{UUID: t.ID}, + TemplateID: uuid.NullUUID{UUID: t.ID}, + OrganizationID: o.ID, + CreatedBy: u.ID, }) w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ - TemplateID: t.ID, + TemplateID: t.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + pj := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ + OrganizationID: o.ID, }) check.Args(database.InsertWorkspaceBuildParams{ WorkspaceID: w.ID, Transition: database.WorkspaceTransitionStart, Reason: database.BuildReasonInitiator, TemplateVersionID: v.ID, + JobID: pj.ID, }).Asserts( w, policy.ActionWorkspaceStart, t, policy.ActionUpdate, ) })) s.Run("Start/RequireActiveVersion/VersionsMatch/InsertWorkspaceBuild", s.Subtest(func(db database.Store, check *expects) { - v := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + v := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) t := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, ActiveVersionID: v.ID, }) @@ -1821,7 +2568,12 @@ func (s *MethodTestSuite) TestWorkspace() { require.NoError(s.T(), err) w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ - TemplateID: t.ID, + TemplateID: t.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + pj := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ + OrganizationID: o.ID, }) // Assert that we do not check for template update permissions // if versions match. @@ -1830,21 +2582,64 @@ func (s *MethodTestSuite) TestWorkspace() { Transition: database.WorkspaceTransitionStart, Reason: database.BuildReasonInitiator, TemplateVersionID: v.ID, + JobID: pj.ID, }).Asserts( w, policy.ActionWorkspaceStart, ) })) s.Run("Delete/InsertWorkspaceBuild", s.Subtest(func(db database.Store, check *expects) { - w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + pj := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ + OrganizationID: o.ID, + }) + tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, + OrganizationID: o.ID, + CreatedBy: u.ID, + }) check.Args(database.InsertWorkspaceBuildParams{ - WorkspaceID: w.ID, - Transition: database.WorkspaceTransitionDelete, - Reason: database.BuildReasonInitiator, + WorkspaceID: w.ID, + Transition: database.WorkspaceTransitionDelete, + Reason: database.BuildReasonInitiator, + TemplateVersionID: tv.ID, + JobID: pj.ID, }).Asserts(w, policy.ActionDelete) })) s.Run("InsertWorkspaceBuildParameters", s.Subtest(func(db database.Store, check *expects) { - w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) - b := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: w.ID}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ + Type: database.ProvisionerJobTypeWorkspaceBuild, + }) + b := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{ + JobID: j.ID, + WorkspaceID: w.ID, + TemplateVersionID: tv.ID, + }) check.Args(database.InsertWorkspaceBuildParametersParams{ WorkspaceBuildID: b.ID, Name: []string{"foo", "bar"}, @@ -1852,7 +2647,17 @@ func (s *MethodTestSuite) TestWorkspace() { }).Asserts(w, policy.ActionUpdate) })) s.Run("UpdateWorkspace", s.Subtest(func(db database.Store, check *expects) { - w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) expected := w expected.Name = "" check.Args(database.UpdateWorkspaceParams{ @@ -1860,64 +2665,180 @@ func (s *MethodTestSuite) TestWorkspace() { }).Asserts(w, policy.ActionUpdate).Returns(expected) })) s.Run("UpdateWorkspaceDormantDeletingAt", s.Subtest(func(db database.Store, check *expects) { - w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) check.Args(database.UpdateWorkspaceDormantDeletingAtParams{ ID: w.ID, }).Asserts(w, policy.ActionUpdate) })) s.Run("UpdateWorkspaceAutomaticUpdates", s.Subtest(func(db database.Store, check *expects) { - w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) check.Args(database.UpdateWorkspaceAutomaticUpdatesParams{ ID: w.ID, AutomaticUpdates: database.AutomaticUpdatesAlways, }).Asserts(w, policy.ActionUpdate) })) s.Run("UpdateWorkspaceAppHealthByID", s.Subtest(func(db database.Store, check *expects) { - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) - build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: ws.ID, JobID: uuid.New()}) - res := dbgen.WorkspaceResource(s.T(), db, database.WorkspaceResource{JobID: build.JobID}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ + Type: database.ProvisionerJobTypeWorkspaceBuild, + }) + b := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{ + JobID: j.ID, + WorkspaceID: w.ID, + TemplateVersionID: tv.ID, + }) + res := dbgen.WorkspaceResource(s.T(), db, database.WorkspaceResource{JobID: b.JobID}) agt := dbgen.WorkspaceAgent(s.T(), db, database.WorkspaceAgent{ResourceID: res.ID}) app := dbgen.WorkspaceApp(s.T(), db, database.WorkspaceApp{AgentID: agt.ID}) check.Args(database.UpdateWorkspaceAppHealthByIDParams{ ID: app.ID, Health: database.WorkspaceAppHealthDisabled, - }).Asserts(ws, policy.ActionUpdate).Returns() + }).Asserts(w, policy.ActionUpdate).Returns() })) s.Run("UpdateWorkspaceAutostart", s.Subtest(func(db database.Store, check *expects) { - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) check.Args(database.UpdateWorkspaceAutostartParams{ - ID: ws.ID, - }).Asserts(ws, policy.ActionUpdate).Returns() + ID: w.ID, + }).Asserts(w, policy.ActionUpdate).Returns() })) s.Run("UpdateWorkspaceBuildDeadlineByID", s.Subtest(func(db database.Store, check *expects) { - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) - build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: ws.ID, JobID: uuid.New()}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ + Type: database.ProvisionerJobTypeWorkspaceBuild, + }) + b := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{ + JobID: j.ID, + WorkspaceID: w.ID, + TemplateVersionID: tv.ID, + }) check.Args(database.UpdateWorkspaceBuildDeadlineByIDParams{ - ID: build.ID, - UpdatedAt: build.UpdatedAt, - Deadline: build.Deadline, - }).Asserts(ws, policy.ActionUpdate) + ID: b.ID, + UpdatedAt: b.UpdatedAt, + Deadline: b.Deadline, + }).Asserts(w, policy.ActionUpdate) })) s.Run("SoftDeleteWorkspaceByID", s.Subtest(func(db database.Store, check *expects) { - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) - ws.Deleted = true - check.Args(ws.ID).Asserts(ws, policy.ActionDelete).Returns() + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + w.Deleted = true + check.Args(w.ID).Asserts(w, policy.ActionDelete).Returns() })) s.Run("UpdateWorkspaceDeletedByID", s.Subtest(func(db database.Store, check *expects) { - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{Deleted: true}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + Deleted: true, + }) check.Args(database.UpdateWorkspaceDeletedByIDParams{ - ID: ws.ID, + ID: w.ID, Deleted: true, - }).Asserts(ws, policy.ActionDelete).Returns() + }).Asserts(w, policy.ActionDelete).Returns() })) s.Run("UpdateWorkspaceLastUsedAt", s.Subtest(func(db database.Store, check *expects) { - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) check.Args(database.UpdateWorkspaceLastUsedAtParams{ - ID: ws.ID, - }).Asserts(ws, policy.ActionUpdate).Returns() + ID: w.ID, + }).Asserts(w, policy.ActionUpdate).Returns() })) s.Run("UpdateWorkspaceNextStartAt", s.Subtest(func(db database.Store, check *expects) { - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) check.Args(database.UpdateWorkspaceNextStartAtParams{ ID: ws.ID, NextStartAt: sql.NullTime{Valid: true, Time: dbtime.Now()}, @@ -1930,50 +2851,144 @@ func (s *MethodTestSuite) TestWorkspace() { }).Asserts(rbac.ResourceWorkspace.All(), policy.ActionUpdate) })) s.Run("BatchUpdateWorkspaceLastUsedAt", s.Subtest(func(db database.Store, check *expects) { - ws1 := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) - ws2 := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + w1 := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + w2 := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) check.Args(database.BatchUpdateWorkspaceLastUsedAtParams{ - IDs: []uuid.UUID{ws1.ID, ws2.ID}, + IDs: []uuid.UUID{w1.ID, w2.ID}, }).Asserts(rbac.ResourceWorkspace.All(), policy.ActionUpdate).Returns() })) s.Run("UpdateWorkspaceTTL", s.Subtest(func(db database.Store, check *expects) { - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) check.Args(database.UpdateWorkspaceTTLParams{ - ID: ws.ID, - }).Asserts(ws, policy.ActionUpdate).Returns() + ID: w.ID, + }).Asserts(w, policy.ActionUpdate).Returns() })) s.Run("GetWorkspaceByWorkspaceAppID", s.Subtest(func(db database.Store, check *expects) { - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) - build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: ws.ID, JobID: uuid.New()}) - res := dbgen.WorkspaceResource(s.T(), db, database.WorkspaceResource{JobID: build.JobID}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ + Type: database.ProvisionerJobTypeWorkspaceBuild, + }) + b := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{ + JobID: j.ID, + WorkspaceID: w.ID, + TemplateVersionID: tv.ID, + }) + res := dbgen.WorkspaceResource(s.T(), db, database.WorkspaceResource{JobID: b.JobID}) agt := dbgen.WorkspaceAgent(s.T(), db, database.WorkspaceAgent{ResourceID: res.ID}) app := dbgen.WorkspaceApp(s.T(), db, database.WorkspaceApp{AgentID: agt.ID}) - check.Args(app.ID).Asserts(ws, policy.ActionRead) + check.Args(app.ID).Asserts(w, policy.ActionRead) })) s.Run("ActivityBumpWorkspace", s.Subtest(func(db database.Store, check *expects) { - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) - build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: ws.ID, JobID: uuid.New()}) - dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ID: build.JobID, Type: database.ProvisionerJobTypeWorkspaceBuild}) + u := dbgen.User(s.T(), db, database.User{}) + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ + Type: database.ProvisionerJobTypeWorkspaceBuild, + }) + _ = dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{ + JobID: j.ID, + WorkspaceID: w.ID, + TemplateVersionID: tv.ID, + }) check.Args(database.ActivityBumpWorkspaceParams{ - WorkspaceID: ws.ID, - }).Asserts(ws, policy.ActionUpdate).Returns() + WorkspaceID: w.ID, + }).Asserts(w, policy.ActionUpdate).Returns() })) s.Run("FavoriteWorkspace", s.Subtest(func(db database.Store, check *expects) { u := dbgen.User(s.T(), db, database.User{}) - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{OwnerID: u.ID}) - check.Args(ws.ID).Asserts(ws, policy.ActionUpdate).Returns() + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + check.Args(w.ID).Asserts(w, policy.ActionUpdate).Returns() })) s.Run("UnfavoriteWorkspace", s.Subtest(func(db database.Store, check *expects) { u := dbgen.User(s.T(), db, database.User{}) - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{OwnerID: u.ID}) - check.Args(ws.ID).Asserts(ws, policy.ActionUpdate).Returns() + o := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: o.ID, + CreatedBy: u.ID, + }) + w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + TemplateID: tpl.ID, + OrganizationID: o.ID, + OwnerID: u.ID, + }) + check.Args(w.ID).Asserts(w, policy.ActionUpdate).Returns() })) } func (s *MethodTestSuite) TestWorkspacePortSharing() { s.Run("UpsertWorkspaceAgentPortShare", s.Subtest(func(db database.Store, check *expects) { u := dbgen.User(s.T(), db, database.User{}) - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{OwnerID: u.ID}) + org := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: org.ID, + CreatedBy: u.ID, + }) + ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + OwnerID: u.ID, + OrganizationID: org.ID, + TemplateID: tpl.ID, + }) ps := dbgen.WorkspaceAgentPortShare(s.T(), db, database.WorkspaceAgentPortShare{WorkspaceID: ws.ID}) //nolint:gosimple // casting is not a simplification check.Args(database.UpsertWorkspaceAgentPortShareParams{ @@ -1986,7 +3001,16 @@ func (s *MethodTestSuite) TestWorkspacePortSharing() { })) s.Run("GetWorkspaceAgentPortShare", s.Subtest(func(db database.Store, check *expects) { u := dbgen.User(s.T(), db, database.User{}) - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{OwnerID: u.ID}) + org := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: org.ID, + CreatedBy: u.ID, + }) + ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + OwnerID: u.ID, + OrganizationID: org.ID, + TemplateID: tpl.ID, + }) ps := dbgen.WorkspaceAgentPortShare(s.T(), db, database.WorkspaceAgentPortShare{WorkspaceID: ws.ID}) check.Args(database.GetWorkspaceAgentPortShareParams{ WorkspaceID: ps.WorkspaceID, @@ -1996,13 +3020,31 @@ func (s *MethodTestSuite) TestWorkspacePortSharing() { })) s.Run("ListWorkspaceAgentPortShares", s.Subtest(func(db database.Store, check *expects) { u := dbgen.User(s.T(), db, database.User{}) - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{OwnerID: u.ID}) + org := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: org.ID, + CreatedBy: u.ID, + }) + ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + OwnerID: u.ID, + OrganizationID: org.ID, + TemplateID: tpl.ID, + }) ps := dbgen.WorkspaceAgentPortShare(s.T(), db, database.WorkspaceAgentPortShare{WorkspaceID: ws.ID}) check.Args(ws.ID).Asserts(ws, policy.ActionRead).Returns([]database.WorkspaceAgentPortShare{ps}) })) s.Run("DeleteWorkspaceAgentPortShare", s.Subtest(func(db database.Store, check *expects) { u := dbgen.User(s.T(), db, database.User{}) - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{OwnerID: u.ID}) + org := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: org.ID, + CreatedBy: u.ID, + }) + ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + OwnerID: u.ID, + OrganizationID: org.ID, + TemplateID: tpl.ID, + }) ps := dbgen.WorkspaceAgentPortShare(s.T(), db, database.WorkspaceAgentPortShare{WorkspaceID: ws.ID}) check.Args(database.DeleteWorkspaceAgentPortShareParams{ WorkspaceID: ps.WorkspaceID, @@ -2012,17 +3054,33 @@ func (s *MethodTestSuite) TestWorkspacePortSharing() { })) s.Run("DeleteWorkspaceAgentPortSharesByTemplate", s.Subtest(func(db database.Store, check *expects) { u := dbgen.User(s.T(), db, database.User{}) - t := dbgen.Template(s.T(), db, database.Template{}) - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{OwnerID: u.ID, TemplateID: t.ID}) + org := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: org.ID, + CreatedBy: u.ID, + }) + ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + OwnerID: u.ID, + OrganizationID: org.ID, + TemplateID: tpl.ID, + }) _ = dbgen.WorkspaceAgentPortShare(s.T(), db, database.WorkspaceAgentPortShare{WorkspaceID: ws.ID}) - check.Args(t.ID).Asserts(t, policy.ActionUpdate).Returns() + check.Args(tpl.ID).Asserts(tpl, policy.ActionUpdate).Returns() })) s.Run("ReduceWorkspaceAgentShareLevelToAuthenticatedByTemplate", s.Subtest(func(db database.Store, check *expects) { u := dbgen.User(s.T(), db, database.User{}) - t := dbgen.Template(s.T(), db, database.Template{}) - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{OwnerID: u.ID, TemplateID: t.ID}) + org := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: org.ID, + CreatedBy: u.ID, + }) + ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + OwnerID: u.ID, + OrganizationID: org.ID, + TemplateID: tpl.ID, + }) _ = dbgen.WorkspaceAgentPortShare(s.T(), db, database.WorkspaceAgentPortShare{WorkspaceID: ws.ID}) - check.Args(t.ID).Asserts(t, policy.ActionUpdate).Returns() + check.Args(tpl.ID).Asserts(tpl, policy.ActionUpdate).Returns() })) } @@ -2031,7 +3089,7 @@ func (s *MethodTestSuite) TestProvisionerKeys() { org := dbgen.Organization(s.T(), db, database.Organization{}) pk := database.ProvisionerKey{ ID: uuid.New(), - CreatedAt: time.Now(), + CreatedAt: dbtestutil.NowInDefaultTimezone(), OrganizationID: org.ID, Name: strings.ToLower(coderdtest.RandomName(s.T())), HashedSecret: []byte(coderdtest.RandomName(s.T())), @@ -2072,6 +3130,7 @@ func (s *MethodTestSuite) TestProvisionerKeys() { CreatedAt: pk.CreatedAt, OrganizationID: pk.OrganizationID, Name: pk.Name, + HashedSecret: pk.HashedSecret, }, } check.Args(org.ID).Asserts(pk, policy.ActionRead).Returns(pks) @@ -2085,6 +3144,7 @@ func (s *MethodTestSuite) TestProvisionerKeys() { CreatedAt: pk.CreatedAt, OrganizationID: pk.OrganizationID, Name: pk.Name, + HashedSecret: pk.HashedSecret, }, } check.Args(org.ID).Asserts(pk, policy.ActionRead).Returns(pks) @@ -2098,7 +3158,9 @@ func (s *MethodTestSuite) TestProvisionerKeys() { func (s *MethodTestSuite) TestExtraMethods() { s.Run("GetProvisionerDaemons", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) d, err := db.UpsertProvisionerDaemon(context.Background(), database.UpsertProvisionerDaemonParams{ + Provisioners: []database.ProvisionerType{}, Tags: database.StringMap(map[string]string{ provisionersdk.TagScope: provisionersdk.ScopeOrganization, }), @@ -2107,9 +3169,11 @@ func (s *MethodTestSuite) TestExtraMethods() { check.Args().Asserts(d, policy.ActionRead) })) s.Run("GetProvisionerDaemonsByOrganization", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) org := dbgen.Organization(s.T(), db, database.Organization{}) d, err := db.UpsertProvisionerDaemon(context.Background(), database.UpsertProvisionerDaemonParams{ OrganizationID: org.ID, + Provisioners: []database.ProvisionerType{}, Tags: database.StringMap(map[string]string{ provisionersdk.TagScope: provisionersdk.ScopeOrganization, }), @@ -2120,6 +3184,7 @@ func (s *MethodTestSuite) TestExtraMethods() { check.Args(database.GetProvisionerDaemonsByOrganizationParams{OrganizationID: org.ID}).Asserts(d, policy.ActionRead).Returns(ds) })) s.Run("GetEligibleProvisionerDaemonsByProvisionerJobIDs", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) org := dbgen.Organization(s.T(), db, database.Organization{}) tags := database.StringMap(map[string]string{ provisionersdk.TagScope: provisionersdk.ScopeOrganization, @@ -2130,6 +3195,7 @@ func (s *MethodTestSuite) TestExtraMethods() { Tags: tags, Provisioner: database.ProvisionerTypeEcho, StorageMethod: database.ProvisionerStorageMethodFile, + Input: json.RawMessage("{}"), }) s.NoError(err, "insert provisioner job") d, err := db.UpsertProvisionerDaemon(context.Background(), database.UpsertProvisionerDaemonParams{ @@ -2143,7 +3209,9 @@ func (s *MethodTestSuite) TestExtraMethods() { check.Args(uuid.UUIDs{j.ID}).Asserts(d, policy.ActionRead).Returns(ds) })) s.Run("DeleteOldProvisionerDaemons", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) _, err := db.UpsertProvisionerDaemon(context.Background(), database.UpsertProvisionerDaemonParams{ + Provisioners: []database.ProvisionerType{}, Tags: database.StringMap(map[string]string{ provisionersdk.TagScope: provisionersdk.ScopeOrganization, }), @@ -2152,7 +3220,9 @@ func (s *MethodTestSuite) TestExtraMethods() { check.Args().Asserts(rbac.ResourceSystem, policy.ActionDelete) })) s.Run("UpdateProvisionerDaemonLastSeenAt", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) d, err := db.UpsertProvisionerDaemon(context.Background(), database.UpsertProvisionerDaemonParams{ + Provisioners: []database.ProvisionerType{}, Tags: database.StringMap(map[string]string{ provisionersdk.TagScope: provisionersdk.ScopeOrganization, }), @@ -2165,145 +3235,151 @@ func (s *MethodTestSuite) TestExtraMethods() { })) } -// All functions in this method test suite are not implemented in dbmem, but -// we still want to assert RBAC checks. func (s *MethodTestSuite) TestTailnetFunctions() { - s.Run("CleanTailnetCoordinators", s.Subtest(func(db database.Store, check *expects) { + s.Run("CleanTailnetCoordinators", s.Subtest(func(_ database.Store, check *expects) { check.Args(). Asserts(rbac.ResourceTailnetCoordinator, policy.ActionDelete). - Errors(dbmem.ErrUnimplemented) + ErrorsWithInMemDB(dbmem.ErrUnimplemented) })) - s.Run("CleanTailnetLostPeers", s.Subtest(func(db database.Store, check *expects) { + s.Run("CleanTailnetLostPeers", s.Subtest(func(_ database.Store, check *expects) { check.Args(). Asserts(rbac.ResourceTailnetCoordinator, policy.ActionDelete). - Errors(dbmem.ErrUnimplemented) + ErrorsWithInMemDB(dbmem.ErrUnimplemented) })) - s.Run("CleanTailnetTunnels", s.Subtest(func(db database.Store, check *expects) { + s.Run("CleanTailnetTunnels", s.Subtest(func(_ database.Store, check *expects) { check.Args(). Asserts(rbac.ResourceTailnetCoordinator, policy.ActionDelete). - Errors(dbmem.ErrUnimplemented) + ErrorsWithInMemDB(dbmem.ErrUnimplemented) })) - s.Run("DeleteAllTailnetClientSubscriptions", s.Subtest(func(db database.Store, check *expects) { + s.Run("DeleteAllTailnetClientSubscriptions", s.Subtest(func(_ database.Store, check *expects) { check.Args(database.DeleteAllTailnetClientSubscriptionsParams{}). Asserts(rbac.ResourceTailnetCoordinator, policy.ActionDelete). - Errors(dbmem.ErrUnimplemented) + ErrorsWithInMemDB(dbmem.ErrUnimplemented) })) - s.Run("DeleteAllTailnetTunnels", s.Subtest(func(db database.Store, check *expects) { + s.Run("DeleteAllTailnetTunnels", s.Subtest(func(_ database.Store, check *expects) { check.Args(database.DeleteAllTailnetTunnelsParams{}). Asserts(rbac.ResourceTailnetCoordinator, policy.ActionDelete). - Errors(dbmem.ErrUnimplemented) + ErrorsWithInMemDB(dbmem.ErrUnimplemented) })) - s.Run("DeleteCoordinator", s.Subtest(func(db database.Store, check *expects) { + s.Run("DeleteCoordinator", s.Subtest(func(_ database.Store, check *expects) { check.Args(uuid.New()). Asserts(rbac.ResourceTailnetCoordinator, policy.ActionDelete). - Errors(dbmem.ErrUnimplemented) + ErrorsWithInMemDB(dbmem.ErrUnimplemented) })) - s.Run("DeleteTailnetAgent", s.Subtest(func(db database.Store, check *expects) { + s.Run("DeleteTailnetAgent", s.Subtest(func(_ database.Store, check *expects) { check.Args(database.DeleteTailnetAgentParams{}). - Asserts(rbac.ResourceTailnetCoordinator, policy.ActionUpdate). - Errors(dbmem.ErrUnimplemented) + Asserts(rbac.ResourceTailnetCoordinator, policy.ActionUpdate).Errors(sql.ErrNoRows). + ErrorsWithInMemDB(dbmem.ErrUnimplemented) })) - s.Run("DeleteTailnetClient", s.Subtest(func(db database.Store, check *expects) { + s.Run("DeleteTailnetClient", s.Subtest(func(_ database.Store, check *expects) { check.Args(database.DeleteTailnetClientParams{}). - Asserts(rbac.ResourceTailnetCoordinator, policy.ActionDelete). - Errors(dbmem.ErrUnimplemented) + Asserts(rbac.ResourceTailnetCoordinator, policy.ActionDelete).Errors(sql.ErrNoRows). + ErrorsWithInMemDB(dbmem.ErrUnimplemented) })) - s.Run("DeleteTailnetClientSubscription", s.Subtest(func(db database.Store, check *expects) { + s.Run("DeleteTailnetClientSubscription", s.Subtest(func(_ database.Store, check *expects) { check.Args(database.DeleteTailnetClientSubscriptionParams{}). Asserts(rbac.ResourceTailnetCoordinator, policy.ActionDelete). - Errors(dbmem.ErrUnimplemented) + ErrorsWithInMemDB(dbmem.ErrUnimplemented) })) - s.Run("DeleteTailnetPeer", s.Subtest(func(db database.Store, check *expects) { + s.Run("DeleteTailnetPeer", s.Subtest(func(_ database.Store, check *expects) { check.Args(database.DeleteTailnetPeerParams{}). Asserts(rbac.ResourceTailnetCoordinator, policy.ActionDelete). - Errors(dbmem.ErrUnimplemented) + ErrorsWithInMemDB(dbmem.ErrUnimplemented). + ErrorsWithPG(sql.ErrNoRows) })) - s.Run("DeleteTailnetTunnel", s.Subtest(func(db database.Store, check *expects) { + s.Run("DeleteTailnetTunnel", s.Subtest(func(_ database.Store, check *expects) { check.Args(database.DeleteTailnetTunnelParams{}). Asserts(rbac.ResourceTailnetCoordinator, policy.ActionDelete). - Errors(dbmem.ErrUnimplemented) + ErrorsWithInMemDB(dbmem.ErrUnimplemented). + ErrorsWithPG(sql.ErrNoRows) })) - s.Run("GetAllTailnetAgents", s.Subtest(func(db database.Store, check *expects) { + s.Run("GetAllTailnetAgents", s.Subtest(func(_ database.Store, check *expects) { check.Args(). Asserts(rbac.ResourceTailnetCoordinator, policy.ActionRead). - Errors(dbmem.ErrUnimplemented) + ErrorsWithInMemDB(dbmem.ErrUnimplemented) })) - s.Run("GetTailnetAgents", s.Subtest(func(db database.Store, check *expects) { + s.Run("GetTailnetAgents", s.Subtest(func(_ database.Store, check *expects) { check.Args(uuid.New()). Asserts(rbac.ResourceTailnetCoordinator, policy.ActionRead). - Errors(dbmem.ErrUnimplemented) + ErrorsWithInMemDB(dbmem.ErrUnimplemented) })) - s.Run("GetTailnetClientsForAgent", s.Subtest(func(db database.Store, check *expects) { + s.Run("GetTailnetClientsForAgent", s.Subtest(func(_ database.Store, check *expects) { check.Args(uuid.New()). Asserts(rbac.ResourceTailnetCoordinator, policy.ActionRead). - Errors(dbmem.ErrUnimplemented) + ErrorsWithInMemDB(dbmem.ErrUnimplemented) })) - s.Run("GetTailnetPeers", s.Subtest(func(db database.Store, check *expects) { + s.Run("GetTailnetPeers", s.Subtest(func(_ database.Store, check *expects) { check.Args(uuid.New()). Asserts(rbac.ResourceTailnetCoordinator, policy.ActionRead). - Errors(dbmem.ErrUnimplemented) + ErrorsWithInMemDB(dbmem.ErrUnimplemented) })) - s.Run("GetTailnetTunnelPeerBindings", s.Subtest(func(db database.Store, check *expects) { + s.Run("GetTailnetTunnelPeerBindings", s.Subtest(func(_ database.Store, check *expects) { check.Args(uuid.New()). Asserts(rbac.ResourceTailnetCoordinator, policy.ActionRead). - Errors(dbmem.ErrUnimplemented) + ErrorsWithInMemDB(dbmem.ErrUnimplemented) })) - s.Run("GetTailnetTunnelPeerIDs", s.Subtest(func(db database.Store, check *expects) { + s.Run("GetTailnetTunnelPeerIDs", s.Subtest(func(_ database.Store, check *expects) { check.Args(uuid.New()). Asserts(rbac.ResourceTailnetCoordinator, policy.ActionRead). - Errors(dbmem.ErrUnimplemented) + ErrorsWithInMemDB(dbmem.ErrUnimplemented) })) - s.Run("GetAllTailnetCoordinators", s.Subtest(func(db database.Store, check *expects) { + s.Run("GetAllTailnetCoordinators", s.Subtest(func(_ database.Store, check *expects) { check.Args(). Asserts(rbac.ResourceTailnetCoordinator, policy.ActionRead). - Errors(dbmem.ErrUnimplemented) + ErrorsWithInMemDB(dbmem.ErrUnimplemented) })) - s.Run("GetAllTailnetPeers", s.Subtest(func(db database.Store, check *expects) { + s.Run("GetAllTailnetPeers", s.Subtest(func(_ database.Store, check *expects) { check.Args(). Asserts(rbac.ResourceTailnetCoordinator, policy.ActionRead). - Errors(dbmem.ErrUnimplemented) + ErrorsWithInMemDB(dbmem.ErrUnimplemented) })) - s.Run("GetAllTailnetTunnels", s.Subtest(func(db database.Store, check *expects) { + s.Run("GetAllTailnetTunnels", s.Subtest(func(_ database.Store, check *expects) { check.Args(). Asserts(rbac.ResourceTailnetCoordinator, policy.ActionRead). - Errors(dbmem.ErrUnimplemented) + ErrorsWithInMemDB(dbmem.ErrUnimplemented) })) s.Run("UpsertTailnetAgent", s.Subtest(func(db database.Store, check *expects) { - check.Args(database.UpsertTailnetAgentParams{}). + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) + check.Args(database.UpsertTailnetAgentParams{Node: json.RawMessage("{}")}). Asserts(rbac.ResourceTailnetCoordinator, policy.ActionUpdate). - Errors(dbmem.ErrUnimplemented) + ErrorsWithInMemDB(dbmem.ErrUnimplemented) })) s.Run("UpsertTailnetClient", s.Subtest(func(db database.Store, check *expects) { - check.Args(database.UpsertTailnetClientParams{}). + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) + check.Args(database.UpsertTailnetClientParams{Node: json.RawMessage("{}")}). Asserts(rbac.ResourceTailnetCoordinator, policy.ActionUpdate). - Errors(dbmem.ErrUnimplemented) + ErrorsWithInMemDB(dbmem.ErrUnimplemented) })) s.Run("UpsertTailnetClientSubscription", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) check.Args(database.UpsertTailnetClientSubscriptionParams{}). Asserts(rbac.ResourceTailnetCoordinator, policy.ActionUpdate). - Errors(dbmem.ErrUnimplemented) + ErrorsWithInMemDB(dbmem.ErrUnimplemented) })) - s.Run("UpsertTailnetCoordinator", s.Subtest(func(db database.Store, check *expects) { + s.Run("UpsertTailnetCoordinator", s.Subtest(func(_ database.Store, check *expects) { check.Args(uuid.New()). Asserts(rbac.ResourceTailnetCoordinator, policy.ActionUpdate). - Errors(dbmem.ErrUnimplemented) + ErrorsWithInMemDB(dbmem.ErrUnimplemented) })) s.Run("UpsertTailnetPeer", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) check.Args(database.UpsertTailnetPeerParams{ Status: database.TailnetStatusOk, }). Asserts(rbac.ResourceTailnetCoordinator, policy.ActionCreate). - Errors(dbmem.ErrUnimplemented) + ErrorsWithInMemDB(dbmem.ErrUnimplemented) })) s.Run("UpsertTailnetTunnel", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) check.Args(database.UpsertTailnetTunnelParams{}). Asserts(rbac.ResourceTailnetCoordinator, policy.ActionCreate). - Errors(dbmem.ErrUnimplemented) + ErrorsWithInMemDB(dbmem.ErrUnimplemented) })) - s.Run("UpdateTailnetPeerStatusByCoordinator", s.Subtest(func(_ database.Store, check *expects) { - check.Args(database.UpdateTailnetPeerStatusByCoordinatorParams{}). + s.Run("UpdateTailnetPeerStatusByCoordinator", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) + check.Args(database.UpdateTailnetPeerStatusByCoordinatorParams{Status: database.TailnetStatusOk}). Asserts(rbac.ResourceTailnetCoordinator, policy.ActionUpdate). - Errors(dbmem.ErrUnimplemented) + ErrorsWithInMemDB(dbmem.ErrUnimplemented) })) } @@ -2395,6 +3471,7 @@ func (s *MethodTestSuite) TestSystemFunctions() { }).Asserts(rbac.ResourceSystem, policy.ActionUpdate).Returns(l) })) s.Run("GetLatestWorkspaceBuildsByWorkspaceIDs", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) b := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: ws.ID}) check.Args([]uuid.UUID{ws.ID}).Asserts(rbac.ResourceSystem, policy.ActionRead).Returns(slice.New(b)) @@ -2403,10 +3480,12 @@ func (s *MethodTestSuite) TestSystemFunctions() { check.Args(database.UpsertDefaultProxyParams{}).Asserts(rbac.ResourceSystem, policy.ActionUpdate).Returns() })) s.Run("GetUserLinkByLinkedID", s.Subtest(func(db database.Store, check *expects) { - l := dbgen.UserLink(s.T(), db, database.UserLink{}) + u := dbgen.User(s.T(), db, database.User{}) + l := dbgen.UserLink(s.T(), db, database.UserLink{UserID: u.ID}) check.Args(l.LinkedID).Asserts(rbac.ResourceSystem, policy.ActionRead).Returns(l) })) s.Run("GetUserLinkByUserIDLoginType", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) l := dbgen.UserLink(s.T(), db, database.UserLink{}) check.Args(database.GetUserLinkByUserIDLoginTypeParams{ UserID: l.UserID, @@ -2414,6 +3493,7 @@ func (s *MethodTestSuite) TestSystemFunctions() { }).Asserts(rbac.ResourceSystem, policy.ActionRead).Returns(l) })) s.Run("GetLatestWorkspaceBuilds", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{}) dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{}) check.Args().Asserts(rbac.ResourceSystem, policy.ActionRead) @@ -2465,10 +3545,12 @@ func (s *MethodTestSuite) TestSystemFunctions() { check.Args().Asserts(rbac.ResourceSystem, policy.ActionRead).Returns(int64(0)) })) s.Run("GetTemplates", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) _ = dbgen.Template(s.T(), db, database.Template{}) check.Args().Asserts(rbac.ResourceSystem, policy.ActionRead) })) s.Run("UpdateWorkspaceBuildCostByID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) b := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{}) o := b o.DailyCost = 10 @@ -2478,6 +3560,7 @@ func (s *MethodTestSuite) TestSystemFunctions() { }).Asserts(rbac.ResourceSystem, policy.ActionUpdate) })) s.Run("UpdateWorkspaceBuildProvisionerStateByID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: ws.ID, JobID: uuid.New()}) check.Args(database.UpdateWorkspaceBuildProvisionerStateByIDParams{ @@ -2494,22 +3577,27 @@ func (s *MethodTestSuite) TestSystemFunctions() { check.Args().Asserts(rbac.ResourceSystem, policy.ActionRead) })) s.Run("GetWorkspaceBuildsCreatedAfter", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) _ = dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{CreatedAt: time.Now().Add(-time.Hour)}) check.Args(time.Now()).Asserts(rbac.ResourceSystem, policy.ActionRead) })) s.Run("GetWorkspaceAgentsCreatedAfter", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) _ = dbgen.WorkspaceAgent(s.T(), db, database.WorkspaceAgent{CreatedAt: time.Now().Add(-time.Hour)}) check.Args(time.Now()).Asserts(rbac.ResourceSystem, policy.ActionRead) })) s.Run("GetWorkspaceAppsCreatedAfter", s.Subtest(func(db database.Store, check *expects) { - _ = dbgen.WorkspaceApp(s.T(), db, database.WorkspaceApp{CreatedAt: time.Now().Add(-time.Hour)}) + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) + _ = dbgen.WorkspaceApp(s.T(), db, database.WorkspaceApp{CreatedAt: time.Now().Add(-time.Hour), OpenIn: database.WorkspaceAppOpenInSlimWindow}) check.Args(time.Now()).Asserts(rbac.ResourceSystem, policy.ActionRead) })) s.Run("GetWorkspaceResourcesCreatedAfter", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) _ = dbgen.WorkspaceResource(s.T(), db, database.WorkspaceResource{CreatedAt: time.Now().Add(-time.Hour)}) check.Args(time.Now()).Asserts(rbac.ResourceSystem, policy.ActionRead) })) s.Run("GetWorkspaceResourceMetadataCreatedAfter", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) _ = dbgen.WorkspaceResourceMetadatums(s.T(), db, database.WorkspaceResourceMetadatum{}) check.Args(time.Now()).Asserts(rbac.ResourceSystem, policy.ActionRead) })) @@ -2522,6 +3610,7 @@ func (s *MethodTestSuite) TestSystemFunctions() { check.Args(time.Now()).Asserts( /*rbac.ResourceSystem, policy.ActionRead*/ ) })) s.Run("GetTemplateVersionsByIDs", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) t1 := dbgen.Template(s.T(), db, database.Template{}) t2 := dbgen.Template(s.T(), db, database.Template{}) tv1 := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ @@ -2538,32 +3627,37 @@ func (s *MethodTestSuite) TestSystemFunctions() { Returns(slice.New(tv1, tv2, tv3)) })) s.Run("GetParameterSchemasByJobID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) tpl := dbgen.Template(s.T(), db, database.Template{}) tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, }) job := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ID: tv.JobID}) check.Args(job.ID). - Asserts(tpl, policy.ActionRead).Errors(sql.ErrNoRows) + Asserts(tpl, policy.ActionRead). + ErrorsWithInMemDB(sql.ErrNoRows). + Returns([]database.ParameterSchema{}) })) s.Run("GetWorkspaceAppsByAgentIDs", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) aWs := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) aBuild := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: aWs.ID, JobID: uuid.New()}) aRes := dbgen.WorkspaceResource(s.T(), db, database.WorkspaceResource{JobID: aBuild.JobID}) aAgt := dbgen.WorkspaceAgent(s.T(), db, database.WorkspaceAgent{ResourceID: aRes.ID}) - a := dbgen.WorkspaceApp(s.T(), db, database.WorkspaceApp{AgentID: aAgt.ID}) + a := dbgen.WorkspaceApp(s.T(), db, database.WorkspaceApp{AgentID: aAgt.ID, OpenIn: database.WorkspaceAppOpenInSlimWindow}) bWs := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) bBuild := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: bWs.ID, JobID: uuid.New()}) bRes := dbgen.WorkspaceResource(s.T(), db, database.WorkspaceResource{JobID: bBuild.JobID}) bAgt := dbgen.WorkspaceAgent(s.T(), db, database.WorkspaceAgent{ResourceID: bRes.ID}) - b := dbgen.WorkspaceApp(s.T(), db, database.WorkspaceApp{AgentID: bAgt.ID}) + b := dbgen.WorkspaceApp(s.T(), db, database.WorkspaceApp{AgentID: bAgt.ID, OpenIn: database.WorkspaceAppOpenInSlimWindow}) check.Args([]uuid.UUID{a.AgentID, b.AgentID}). Asserts(rbac.ResourceSystem, policy.ActionRead). Returns([]database.WorkspaceApp{a, b}) })) s.Run("GetWorkspaceResourcesByJobIDs", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) tpl := dbgen.Template(s.T(), db, database.Template{}) v := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, JobID: uuid.New()}) tJob := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ID: v.JobID, Type: database.ProvisionerJobTypeTemplateVersionImport}) @@ -2576,6 +3670,7 @@ func (s *MethodTestSuite) TestSystemFunctions() { Returns([]database.WorkspaceResource{}) })) s.Run("GetWorkspaceResourceMetadataByResourceIDs", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: ws.ID, JobID: uuid.New()}) _ = dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ID: build.JobID, Type: database.ProvisionerJobTypeWorkspaceBuild}) @@ -2585,6 +3680,7 @@ func (s *MethodTestSuite) TestSystemFunctions() { Asserts(rbac.ResourceSystem, policy.ActionRead) })) s.Run("GetWorkspaceAgentsByResourceIDs", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: ws.ID, JobID: uuid.New()}) res := dbgen.WorkspaceResource(s.T(), db, database.WorkspaceResource{JobID: build.JobID}) @@ -2602,15 +3698,18 @@ func (s *MethodTestSuite) TestSystemFunctions() { Returns(slice.New(a, b)) })) s.Run("InsertWorkspaceAgent", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) check.Args(database.InsertWorkspaceAgentParams{ ID: uuid.New(), }).Asserts(rbac.ResourceSystem, policy.ActionCreate) })) s.Run("InsertWorkspaceApp", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) check.Args(database.InsertWorkspaceAppParams{ ID: uuid.New(), Health: database.WorkspaceAppHealthDisabled, SharingLevel: database.AppSharingLevelOwner, + OpenIn: database.WorkspaceAppOpenInSlimWindow, }).Asserts(rbac.ResourceSystem, policy.ActionCreate) })) s.Run("InsertWorkspaceResourceMetadata", s.Subtest(func(db database.Store, check *expects) { @@ -2619,6 +3718,7 @@ func (s *MethodTestSuite) TestSystemFunctions() { }).Asserts(rbac.ResourceSystem, policy.ActionCreate) })) s.Run("UpdateWorkspaceAgentConnectionByID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) build := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{WorkspaceID: ws.ID, JobID: uuid.New()}) res := dbgen.WorkspaceResource(s.T(), db, database.WorkspaceResource{JobID: build.JobID}) @@ -2631,9 +3731,14 @@ func (s *MethodTestSuite) TestSystemFunctions() { // TODO: we need to create a ProvisionerJob resource j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ StartedAt: sql.NullTime{Valid: false}, + UpdatedAt: time.Now(), }) - check.Args(database.AcquireProvisionerJobParams{OrganizationID: j.OrganizationID, Types: []database.ProvisionerType{j.Provisioner}, ProvisionerTags: must(json.Marshal(j.Tags))}). - Asserts( /*rbac.ResourceSystem, policy.ActionUpdate*/ ) + check.Args(database.AcquireProvisionerJobParams{ + StartedAt: sql.NullTime{Valid: true, Time: time.Now()}, + OrganizationID: j.OrganizationID, + Types: []database.ProvisionerType{j.Provisioner}, + ProvisionerTags: must(json.Marshal(j.Tags)), + }).Asserts( /*rbac.ResourceSystem, policy.ActionUpdate*/ ) })) s.Run("UpdateProvisionerJobWithCompleteByID", s.Subtest(func(db database.Store, check *expects) { // TODO: we need to create a ProvisionerJob resource @@ -2651,12 +3756,14 @@ func (s *MethodTestSuite) TestSystemFunctions() { }).Asserts( /*rbac.ResourceSystem, policy.ActionUpdate*/ ) })) s.Run("InsertProvisionerJob", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) // TODO: we need to create a ProvisionerJob resource check.Args(database.InsertProvisionerJobParams{ ID: uuid.New(), Provisioner: database.ProvisionerTypeEcho, StorageMethod: database.ProvisionerStorageMethodFile, Type: database.ProvisionerJobTypeWorkspaceBuild, + Input: json.RawMessage("{}"), }).Asserts( /*rbac.ResourceSystem, policy.ActionCreate*/ ) })) s.Run("InsertProvisionerJobLogs", s.Subtest(func(db database.Store, check *expects) { @@ -2674,16 +3781,19 @@ func (s *MethodTestSuite) TestSystemFunctions() { }).Asserts( /*rbac.ResourceSystem, policy.ActionCreate*/ ) })) s.Run("UpsertProvisionerDaemon", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) org := dbgen.Organization(s.T(), db, database.Organization{}) pd := rbac.ResourceProvisionerDaemon.InOrg(org.ID) check.Args(database.UpsertProvisionerDaemonParams{ OrganizationID: org.ID, + Provisioners: []database.ProvisionerType{}, Tags: database.StringMap(map[string]string{ provisionersdk.TagScope: provisionersdk.ScopeOrganization, }), }).Asserts(pd, policy.ActionCreate) check.Args(database.UpsertProvisionerDaemonParams{ OrganizationID: org.ID, + Provisioners: []database.ProvisionerType{}, Tags: database.StringMap(map[string]string{ provisionersdk.TagScope: provisionersdk.ScopeUser, provisionersdk.TagOwner: "11111111-1111-1111-1111-111111111111", @@ -2691,15 +3801,17 @@ func (s *MethodTestSuite) TestSystemFunctions() { }).Asserts(pd.WithOwner("11111111-1111-1111-1111-111111111111"), policy.ActionCreate) })) s.Run("InsertTemplateVersionParameter", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) v := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{}) check.Args(database.InsertTemplateVersionParameterParams{ TemplateVersionID: v.ID, + Options: json.RawMessage("{}"), }).Asserts(rbac.ResourceSystem, policy.ActionCreate) })) s.Run("InsertWorkspaceResource", s.Subtest(func(db database.Store, check *expects) { - r := dbgen.WorkspaceResource(s.T(), db, database.WorkspaceResource{}) + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) check.Args(database.InsertWorkspaceResourceParams{ - ID: r.ID, + ID: uuid.New(), Transition: database.WorkspaceTransitionStart, }).Asserts(rbac.ResourceSystem, policy.ActionCreate) })) @@ -2713,6 +3825,7 @@ func (s *MethodTestSuite) TestSystemFunctions() { check.Args(database.InsertWorkspaceAppStatsParams{}).Asserts(rbac.ResourceSystem, policy.ActionCreate) })) s.Run("InsertWorkspaceAgentScriptTimings", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) check.Args(database.InsertWorkspaceAgentScriptTimingsParams{ ScriptID: uuid.New(), Stage: database.WorkspaceAgentScriptTimingStageStart, @@ -2723,6 +3836,7 @@ func (s *MethodTestSuite) TestSystemFunctions() { check.Args(database.InsertWorkspaceAgentScriptsParams{}).Asserts(rbac.ResourceSystem, policy.ActionCreate) })) s.Run("InsertWorkspaceAgentMetadata", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) check.Args(database.InsertWorkspaceAgentMetadataParams{}).Asserts(rbac.ResourceSystem, policy.ActionCreate) })) s.Run("InsertWorkspaceAgentLogs", s.Subtest(func(db database.Store, check *expects) { @@ -2735,13 +3849,16 @@ func (s *MethodTestSuite) TestSystemFunctions() { check.Args(database.GetTemplateDAUsParams{}).Asserts(rbac.ResourceSystem, policy.ActionRead) })) s.Run("GetActiveWorkspaceBuildsByTemplateID", s.Subtest(func(db database.Store, check *expects) { - check.Args(uuid.New()).Asserts(rbac.ResourceSystem, policy.ActionRead).Errors(sql.ErrNoRows) + check.Args(uuid.New()). + Asserts(rbac.ResourceSystem, policy.ActionRead). + ErrorsWithInMemDB(sql.ErrNoRows). + Returns([]database.WorkspaceBuild{}) })) s.Run("GetDeploymentDAUs", s.Subtest(func(db database.Store, check *expects) { check.Args(int32(0)).Asserts(rbac.ResourceSystem, policy.ActionRead) })) s.Run("GetAppSecurityKey", s.Subtest(func(db database.Store, check *expects) { - check.Args().Asserts(rbac.ResourceSystem, policy.ActionRead) + check.Args().Asserts(rbac.ResourceSystem, policy.ActionRead).ErrorsWithPG(sql.ErrNoRows) })) s.Run("UpsertAppSecurityKey", s.Subtest(func(db database.Store, check *expects) { check.Args("foo").Asserts(rbac.ResourceSystem, policy.ActionUpdate) @@ -2835,13 +3952,17 @@ func (s *MethodTestSuite) TestSystemFunctions() { check.Args(time.Time{}).Asserts() })) s.Run("InsertTemplateVersionVariable", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) check.Args(database.InsertTemplateVersionVariableParams{}).Asserts(rbac.ResourceSystem, policy.ActionCreate) })) s.Run("InsertTemplateVersionWorkspaceTag", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) check.Args(database.InsertTemplateVersionWorkspaceTagParams{}).Asserts(rbac.ResourceSystem, policy.ActionCreate) })) s.Run("UpdateInactiveUsersToDormant", s.Subtest(func(db database.Store, check *expects) { - check.Args(database.UpdateInactiveUsersToDormantParams{}).Asserts(rbac.ResourceSystem, policy.ActionCreate).Errors(sql.ErrNoRows) + check.Args(database.UpdateInactiveUsersToDormantParams{}).Asserts(rbac.ResourceSystem, policy.ActionCreate). + ErrorsWithInMemDB(sql.ErrNoRows). + Returns([]database.UpdateInactiveUsersToDormantRow{}) })) s.Run("GetWorkspaceUniqueOwnerCountByTemplateIDs", s.Subtest(func(db database.Store, check *expects) { check.Args([]uuid.UUID{uuid.New()}).Asserts(rbac.ResourceSystem, policy.ActionRead) @@ -2865,8 +3986,24 @@ func (s *MethodTestSuite) TestSystemFunctions() { check.Args(uuid.New()).Asserts(rbac.ResourceSystem, policy.ActionRead) })) s.Run("GetJFrogXrayScanByWorkspaceAndAgentID", s.Subtest(func(db database.Store, check *expects) { - ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) - agent := dbgen.WorkspaceAgent(s.T(), db, database.WorkspaceAgent{}) + u := dbgen.User(s.T(), db, database.User{}) + org := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: org.ID, + CreatedBy: u.ID, + }) + ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + OwnerID: u.ID, + OrganizationID: org.ID, + TemplateID: tpl.ID, + }) + pj := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{}) + res := dbgen.WorkspaceResource(s.T(), db, database.WorkspaceResource{ + JobID: pj.ID, + }) + agent := dbgen.WorkspaceAgent(s.T(), db, database.WorkspaceAgent{ + ResourceID: res.ID, + }) err := db.UpsertJFrogXrayScanByWorkspaceAndAgentID(context.Background(), database.UpsertJFrogXrayScanByWorkspaceAndAgentIDParams{ AgentID: agent.ID, @@ -2893,13 +4030,27 @@ func (s *MethodTestSuite) TestSystemFunctions() { }).Asserts(ws, policy.ActionRead).Returns(expect) })) s.Run("UpsertJFrogXrayScanByWorkspaceAndAgentID", s.Subtest(func(db database.Store, check *expects) { - tpl := dbgen.Template(s.T(), db, database.Template{}) + u := dbgen.User(s.T(), db, database.User{}) + org := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: org.ID, + CreatedBy: u.ID, + }) ws := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ - TemplateID: tpl.ID, + OwnerID: u.ID, + OrganizationID: org.ID, + TemplateID: tpl.ID, + }) + pj := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{}) + res := dbgen.WorkspaceResource(s.T(), db, database.WorkspaceResource{ + JobID: pj.ID, + }) + agent := dbgen.WorkspaceAgent(s.T(), db, database.WorkspaceAgent{ + ResourceID: res.ID, }) check.Args(database.UpsertJFrogXrayScanByWorkspaceAndAgentIDParams{ WorkspaceID: ws.ID, - AgentID: uuid.New(), + AgentID: agent.ID, }).Asserts(tpl, policy.ActionCreate) })) s.Run("DeleteRuntimeConfig", s.Subtest(func(db database.Store, check *expects) { @@ -2941,15 +4092,31 @@ func (s *MethodTestSuite) TestSystemFunctions() { }).Asserts(rbac.ResourceSystem, policy.ActionCreate) })) s.Run("GetProvisionerJobTimingsByJobID", s.Subtest(func(db database.Store, check *expects) { - w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) + u := dbgen.User(s.T(), db, database.User{}) + org := dbgen.Organization(s.T(), db, database.Organization{}) + tpl := dbgen.Template(s.T(), db, database.Template{ + OrganizationID: org.ID, + CreatedBy: u.ID, + }) + tv := dbgen.TemplateVersion(s.T(), db, database.TemplateVersion{ + OrganizationID: org.ID, + TemplateID: uuid.NullUUID{UUID: tpl.ID, Valid: true}, + CreatedBy: u.ID, + }) + w := dbgen.Workspace(s.T(), db, database.WorkspaceTable{ + OwnerID: u.ID, + OrganizationID: org.ID, + TemplateID: tpl.ID, + }) j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ Type: database.ProvisionerJobTypeWorkspaceBuild, }) - b := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{JobID: j.ID, WorkspaceID: w.ID}) + b := dbgen.WorkspaceBuild(s.T(), db, database.WorkspaceBuild{JobID: j.ID, WorkspaceID: w.ID, TemplateVersionID: tv.ID}) t := dbgen.ProvisionerJobTimings(s.T(), db, b, 2) check.Args(j.ID).Asserts(w, policy.ActionRead).Returns(t) })) s.Run("GetWorkspaceAgentScriptTimingsByBuildID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) workspace := dbgen.Workspace(s.T(), db, database.WorkspaceTable{}) job := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ Type: database.ProvisionerJobTypeWorkspaceBuild, @@ -2982,6 +4149,9 @@ func (s *MethodTestSuite) TestSystemFunctions() { } check.Args(build.ID).Asserts(rbac.ResourceSystem, policy.ActionRead).Returns(rows) })) + s.Run("DisableForeignKeysAndTriggers", s.Subtest(func(db database.Store, check *expects) { + check.Args().Asserts() + })) s.Run("InsertWorkspaceModule", s.Subtest(func(db database.Store, check *expects) { j := dbgen.ProvisionerJob(s.T(), db, nil, database.ProvisionerJob{ Type: database.ProvisionerJobTypeWorkspaceBuild, @@ -3013,7 +4183,9 @@ func (s *MethodTestSuite) TestNotifications() { s.Run("DeleteOldNotificationMessages", s.Subtest(func(_ database.Store, check *expects) { check.Args().Asserts(rbac.ResourceNotificationMessage, policy.ActionDelete) })) - s.Run("EnqueueNotificationMessage", s.Subtest(func(_ database.Store, check *expects) { + s.Run("EnqueueNotificationMessage", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) + // TODO: update this test once we have a specific role for notifications check.Args(database.EnqueueNotificationMessageParams{ Method: database.NotificationMethodWebhook, Payload: []byte("{}"), @@ -3021,7 +4193,9 @@ func (s *MethodTestSuite) TestNotifications() { })) s.Run("FetchNewMessageMetadata", s.Subtest(func(db database.Store, check *expects) { u := dbgen.User(s.T(), db, database.User{}) - check.Args(database.FetchNewMessageMetadataParams{UserID: u.ID}).Asserts(rbac.ResourceNotificationMessage, policy.ActionRead) + check.Args(database.FetchNewMessageMetadataParams{UserID: u.ID}). + Asserts(rbac.ResourceNotificationMessage, policy.ActionRead). + ErrorsWithPG(sql.ErrNoRows) })) s.Run("GetNotificationMessagesByStatus", s.Subtest(func(_ database.Store, check *expects) { check.Args(database.GetNotificationMessagesByStatusParams{ @@ -3032,15 +4206,16 @@ func (s *MethodTestSuite) TestNotifications() { // Notification templates s.Run("GetNotificationTemplateByID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) user := dbgen.User(s.T(), db, database.User{}) check.Args(user.ID).Asserts(rbac.ResourceNotificationTemplate, policy.ActionRead). - Errors(dbmem.ErrUnimplemented) + ErrorsWithPG(sql.ErrNoRows). + ErrorsWithInMemDB(dbmem.ErrUnimplemented) })) s.Run("GetNotificationTemplatesByKind", s.Subtest(func(db database.Store, check *expects) { check.Args(database.NotificationTemplateKindSystem). Asserts(). - Errors(dbmem.ErrUnimplemented) - + ErrorsWithInMemDB(dbmem.ErrUnimplemented) // TODO(dannyk): add support for other database.NotificationTemplateKind types once implemented. })) s.Run("UpdateNotificationTemplateMethodByID", s.Subtest(func(db database.Store, check *expects) { @@ -3048,7 +4223,7 @@ func (s *MethodTestSuite) TestNotifications() { Method: database.NullNotificationMethod{NotificationMethod: database.NotificationMethodWebhook, Valid: true}, ID: notifications.TemplateWorkspaceDormant, }).Asserts(rbac.ResourceNotificationTemplate, policy.ActionUpdate). - Errors(dbmem.ErrUnimplemented) + ErrorsWithInMemDB(dbmem.ErrUnimplemented) })) // Notification preferences @@ -3080,12 +4255,23 @@ func (s *MethodTestSuite) TestOAuth2ProviderApps() { check.Args(app.ID).Asserts(rbac.ResourceOauth2App, policy.ActionRead).Returns(app) })) s.Run("GetOAuth2ProviderAppsByUserID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) user := dbgen.User(s.T(), db, database.User{}) key, _ := dbgen.APIKey(s.T(), db, database.APIKey{ UserID: user.ID, }) - app := dbgen.OAuth2ProviderApp(s.T(), db, database.OAuth2ProviderApp{}) - _ = dbgen.OAuth2ProviderApp(s.T(), db, database.OAuth2ProviderApp{}) + createdAt := dbtestutil.NowInDefaultTimezone() + if !dbtestutil.WillUsePostgres() { + createdAt = time.Time{} + } + app := dbgen.OAuth2ProviderApp(s.T(), db, database.OAuth2ProviderApp{ + CreatedAt: createdAt, + UpdatedAt: createdAt, + }) + _ = dbgen.OAuth2ProviderApp(s.T(), db, database.OAuth2ProviderApp{ + CreatedAt: createdAt, + UpdatedAt: createdAt, + }) secret := dbgen.OAuth2ProviderAppSecret(s.T(), db, database.OAuth2ProviderAppSecret{ AppID: app.ID, }) @@ -3093,6 +4279,7 @@ func (s *MethodTestSuite) TestOAuth2ProviderApps() { _ = dbgen.OAuth2ProviderAppToken(s.T(), db, database.OAuth2ProviderAppToken{ AppSecretID: secret.ID, APIKeyID: key.ID, + HashPrefix: []byte(fmt.Sprintf("%d", i)), }) } check.Args(user.ID).Asserts(rbac.ResourceOauth2AppCodeToken.WithOwner(user.ID.String()), policy.ActionRead).Returns([]database.GetOAuth2ProviderAppsByUserIDRow{ @@ -3102,6 +4289,8 @@ func (s *MethodTestSuite) TestOAuth2ProviderApps() { CallbackURL: app.CallbackURL, Icon: app.Icon, Name: app.Name, + CreatedAt: createdAt, + UpdatedAt: createdAt, }, TokenCount: 5, }, @@ -3111,9 +4300,10 @@ func (s *MethodTestSuite) TestOAuth2ProviderApps() { check.Args(database.InsertOAuth2ProviderAppParams{}).Asserts(rbac.ResourceOauth2App, policy.ActionCreate) })) s.Run("UpdateOAuth2ProviderAppByID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) app := dbgen.OAuth2ProviderApp(s.T(), db, database.OAuth2ProviderApp{}) app.Name = "my-new-name" - app.UpdatedAt = time.Now() + app.UpdatedAt = dbtestutil.NowInDefaultTimezone() check.Args(database.UpdateOAuth2ProviderAppByIDParams{ ID: app.ID, Name: app.Name, @@ -3129,19 +4319,23 @@ func (s *MethodTestSuite) TestOAuth2ProviderApps() { func (s *MethodTestSuite) TestOAuth2ProviderAppSecrets() { s.Run("GetOAuth2ProviderAppSecretsByAppID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) app1 := dbgen.OAuth2ProviderApp(s.T(), db, database.OAuth2ProviderApp{}) app2 := dbgen.OAuth2ProviderApp(s.T(), db, database.OAuth2ProviderApp{}) secrets := []database.OAuth2ProviderAppSecret{ dbgen.OAuth2ProviderAppSecret(s.T(), db, database.OAuth2ProviderAppSecret{ - AppID: app1.ID, - CreatedAt: time.Now().Add(-time.Hour), // For ordering. + AppID: app1.ID, + CreatedAt: time.Now().Add(-time.Hour), // For ordering. + SecretPrefix: []byte("1"), }), dbgen.OAuth2ProviderAppSecret(s.T(), db, database.OAuth2ProviderAppSecret{ - AppID: app1.ID, + AppID: app1.ID, + SecretPrefix: []byte("2"), }), } _ = dbgen.OAuth2ProviderAppSecret(s.T(), db, database.OAuth2ProviderAppSecret{ - AppID: app2.ID, + AppID: app2.ID, + SecretPrefix: []byte("3"), }) check.Args(app1.ID).Asserts(rbac.ResourceOauth2AppSecret, policy.ActionRead).Returns(secrets) })) @@ -3166,11 +4360,12 @@ func (s *MethodTestSuite) TestOAuth2ProviderAppSecrets() { }).Asserts(rbac.ResourceOauth2AppSecret, policy.ActionCreate) })) s.Run("UpdateOAuth2ProviderAppSecretByID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) app := dbgen.OAuth2ProviderApp(s.T(), db, database.OAuth2ProviderApp{}) secret := dbgen.OAuth2ProviderAppSecret(s.T(), db, database.OAuth2ProviderAppSecret{ AppID: app.ID, }) - secret.LastUsedAt = sql.NullTime{Time: time.Now(), Valid: true} + secret.LastUsedAt = sql.NullTime{Time: dbtestutil.NowInDefaultTimezone(), Valid: true} check.Args(database.UpdateOAuth2ProviderAppSecretByIDParams{ ID: secret.ID, LastUsedAt: secret.LastUsedAt, @@ -3222,12 +4417,14 @@ func (s *MethodTestSuite) TestOAuth2ProviderAppCodes() { check.Args(code.ID).Asserts(code, policy.ActionDelete) })) s.Run("DeleteOAuth2ProviderAppCodesByAppAndUserID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) user := dbgen.User(s.T(), db, database.User{}) app := dbgen.OAuth2ProviderApp(s.T(), db, database.OAuth2ProviderApp{}) for i := 0; i < 5; i++ { _ = dbgen.OAuth2ProviderAppCode(s.T(), db, database.OAuth2ProviderAppCode{ - AppID: app.ID, - UserID: user.ID, + AppID: app.ID, + UserID: user.ID, + SecretPrefix: []byte(fmt.Sprintf("%d", i)), }) } check.Args(database.DeleteOAuth2ProviderAppCodesByAppAndUserIDParams{ @@ -3268,6 +4465,7 @@ func (s *MethodTestSuite) TestOAuth2ProviderAppTokens() { check.Args(token.HashPrefix).Asserts(rbac.ResourceOauth2AppCodeToken.WithOwner(user.ID.String()), policy.ActionRead) })) s.Run("DeleteOAuth2ProviderAppTokensByAppAndUserID", s.Subtest(func(db database.Store, check *expects) { + dbtestutil.DisableForeignKeysAndTriggers(s.T(), db) user := dbgen.User(s.T(), db, database.User{}) key, _ := dbgen.APIKey(s.T(), db, database.APIKey{ UserID: user.ID, @@ -3280,6 +4478,7 @@ func (s *MethodTestSuite) TestOAuth2ProviderAppTokens() { _ = dbgen.OAuth2ProviderAppToken(s.T(), db, database.OAuth2ProviderAppToken{ AppSecretID: secret.ID, APIKeyID: key.ID, + HashPrefix: []byte(fmt.Sprintf("%d", i)), }) } check.Args(database.DeleteOAuth2ProviderAppTokensByAppAndUserIDParams{ diff --git a/coderd/database/dbauthz/groupsauth_test.go b/coderd/database/dbauthz/groupsauth_test.go index a72c4db3af38a..04d816629ac65 100644 --- a/coderd/database/dbauthz/groupsauth_test.go +++ b/coderd/database/dbauthz/groupsauth_test.go @@ -13,7 +13,6 @@ import ( "github.com/coder/coder/v2/coderd/database" "github.com/coder/coder/v2/coderd/database/dbauthz" "github.com/coder/coder/v2/coderd/database/dbgen" - "github.com/coder/coder/v2/coderd/database/dbmem" "github.com/coder/coder/v2/coderd/database/dbtestutil" "github.com/coder/coder/v2/coderd/rbac" ) @@ -22,13 +21,9 @@ import ( func TestGroupsAuth(t *testing.T) { t.Parallel() - if dbtestutil.WillUsePostgres() { - t.Skip("this test would take too long to run on postgres") - } - authz := rbac.NewAuthorizer(prometheus.NewRegistry()) - - db := dbauthz.New(dbmem.New(), authz, slogtest.Make(t, &slogtest.Options{ + store, _ := dbtestutil.NewDB(t) + db := dbauthz.New(store, authz, slogtest.Make(t, &slogtest.Options{ IgnoreErrors: true, }), coderdtest.AccessControlStorePointer()) diff --git a/coderd/database/dbauthz/setup_test.go b/coderd/database/dbauthz/setup_test.go index 52e8dd42fea9c..fc01e39330d7d 100644 --- a/coderd/database/dbauthz/setup_test.go +++ b/coderd/database/dbauthz/setup_test.go @@ -22,8 +22,8 @@ import ( "github.com/coder/coder/v2/coderd/coderdtest" "github.com/coder/coder/v2/coderd/database" "github.com/coder/coder/v2/coderd/database/dbauthz" - "github.com/coder/coder/v2/coderd/database/dbmem" "github.com/coder/coder/v2/coderd/database/dbmock" + "github.com/coder/coder/v2/coderd/database/dbtestutil" "github.com/coder/coder/v2/coderd/rbac" "github.com/coder/coder/v2/coderd/rbac/regosql" "github.com/coder/coder/v2/coderd/util/slice" @@ -114,7 +114,7 @@ func (s *MethodTestSuite) Subtest(testCaseF func(db database.Store, check *expec methodName := names[len(names)-1] s.methodAccounting[methodName]++ - db := dbmem.New() + db, _ := dbtestutil.NewDB(t) fakeAuthorizer := &coderdtest.FakeAuthorizer{} rec := &coderdtest.RecordingAuthorizer{ Wrapped: fakeAuthorizer, @@ -217,7 +217,11 @@ func (s *MethodTestSuite) Subtest(testCaseF func(db database.Store, check *expec } } - rec.AssertActor(s.T(), actor, pairs...) + if testCase.outOfOrder { + rec.AssertOutOfOrder(s.T(), actor, pairs...) + } else { + rec.AssertActor(s.T(), actor, pairs...) + } s.NoError(rec.AllAsserted(), "all rbac calls must be asserted") }) } @@ -236,6 +240,8 @@ func (s *MethodTestSuite) NoActorErrorTest(callMethod func(ctx context.Context) func (s *MethodTestSuite) NotAuthorizedErrorTest(ctx context.Context, az *coderdtest.FakeAuthorizer, testCase expects, callMethod func(ctx context.Context) ([]reflect.Value, error)) { s.Run("NotAuthorized", func() { az.AlwaysReturn(rbac.ForbiddenWithInternal(xerrors.New("Always fail authz"), rbac.Subject{}, "", rbac.Object{}, nil)) + // Override the SQL filter to always fail. + az.OverrideSQLFilter("FALSE") // If we have assertions, that means the method should FAIL // if RBAC will disallow the request. The returned error should @@ -328,6 +334,14 @@ type expects struct { notAuthorizedExpect string cancelledCtxExpect string successAuthorizer func(ctx context.Context, subject rbac.Subject, action policy.Action, obj rbac.Object) error + outOfOrder bool +} + +// OutOfOrder is optional. It controls whether the assertions should be +// asserted in order. +func (m *expects) OutOfOrder() *expects { + m.outOfOrder = true + return m } // Asserts is required. Asserts the RBAC authorize calls that should be made. @@ -358,6 +372,24 @@ func (m *expects) Errors(err error) *expects { return m } +// ErrorsWithPG is optional. If it is never called, it will not be asserted. +// It will only be asserted if the test is running with a Postgres database. +func (m *expects) ErrorsWithPG(err error) *expects { + if dbtestutil.WillUsePostgres() { + return m.Errors(err) + } + return m +} + +// ErrorsWithInMemDB is optional. If it is never called, it will not be asserted. +// It will only be asserted if the test is running with an in-memory database. +func (m *expects) ErrorsWithInMemDB(err error) *expects { + if !dbtestutil.WillUsePostgres() { + return m.Errors(err) + } + return m +} + func (m *expects) FailSystemObjectChecks() *expects { return m.WithSuccessAuthorizer(func(ctx context.Context, subject rbac.Subject, action policy.Action, obj rbac.Object) error { if obj.Type == rbac.ResourceSystem.Type { diff --git a/coderd/database/dbgen/dbgen.go b/coderd/database/dbgen/dbgen.go index d0bf6a4ce0f50..dd6a3a2cc1490 100644 --- a/coderd/database/dbgen/dbgen.go +++ b/coderd/database/dbgen/dbgen.go @@ -659,6 +659,7 @@ func WorkspaceApp(t testing.TB, db database.Store, orig database.WorkspaceApp) d Health: takeFirst(orig.Health, database.WorkspaceAppHealthHealthy), DisplayOrder: takeFirst(orig.DisplayOrder, 1), Hidden: orig.Hidden, + OpenIn: takeFirst(orig.OpenIn, database.WorkspaceAppOpenInSlimWindow), }) require.NoError(t, err, "insert app") return resource diff --git a/coderd/database/dbmem/dbmem.go b/coderd/database/dbmem/dbmem.go index 7b19790a6d8ea..d3b7b3fb35f5f 100644 --- a/coderd/database/dbmem/dbmem.go +++ b/coderd/database/dbmem/dbmem.go @@ -2206,6 +2206,11 @@ func (q *FakeQuerier) DeleteWorkspaceAgentPortSharesByTemplate(_ context.Context return nil } +func (*FakeQuerier) DisableForeignKeysAndTriggers(_ context.Context) error { + // This is a no-op in the in-memory database. + return nil +} + func (q *FakeQuerier) EnqueueNotificationMessage(_ context.Context, arg database.EnqueueNotificationMessageParams) error { err := validateDatabaseType(arg) if err != nil { @@ -8348,6 +8353,10 @@ func (q *FakeQuerier) InsertWorkspaceApp(_ context.Context, arg database.InsertW arg.SharingLevel = database.AppSharingLevelOwner } + if arg.OpenIn == "" { + arg.OpenIn = database.WorkspaceAppOpenInSlimWindow + } + // nolint:gosimple workspaceApp := database.WorkspaceApp{ ID: arg.ID, @@ -8367,6 +8376,7 @@ func (q *FakeQuerier) InsertWorkspaceApp(_ context.Context, arg database.InsertW Health: arg.Health, Hidden: arg.Hidden, DisplayOrder: arg.DisplayOrder, + OpenIn: arg.OpenIn, } q.workspaceApps = append(q.workspaceApps, workspaceApp) return workspaceApp, nil diff --git a/coderd/database/dbmetrics/querymetrics.go b/coderd/database/dbmetrics/querymetrics.go index 645357d6f095e..5df5c547a20d6 100644 --- a/coderd/database/dbmetrics/querymetrics.go +++ b/coderd/database/dbmetrics/querymetrics.go @@ -413,6 +413,13 @@ func (m queryMetricsStore) DeleteWorkspaceAgentPortSharesByTemplate(ctx context. return r0 } +func (m queryMetricsStore) DisableForeignKeysAndTriggers(ctx context.Context) error { + start := time.Now() + r0 := m.s.DisableForeignKeysAndTriggers(ctx) + m.queryLatencies.WithLabelValues("DisableForeignKeysAndTriggers").Observe(time.Since(start).Seconds()) + return r0 +} + func (m queryMetricsStore) EnqueueNotificationMessage(ctx context.Context, arg database.EnqueueNotificationMessageParams) error { start := time.Now() r0 := m.s.EnqueueNotificationMessage(ctx, arg) diff --git a/coderd/database/dbmock/dbmock.go b/coderd/database/dbmock/dbmock.go index 73a0e6d60af55..6b552fe5060ff 100644 --- a/coderd/database/dbmock/dbmock.go +++ b/coderd/database/dbmock/dbmock.go @@ -728,6 +728,20 @@ func (mr *MockStoreMockRecorder) DeleteWorkspaceAgentPortSharesByTemplate(arg0, return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteWorkspaceAgentPortSharesByTemplate", reflect.TypeOf((*MockStore)(nil).DeleteWorkspaceAgentPortSharesByTemplate), arg0, arg1) } +// DisableForeignKeysAndTriggers mocks base method. +func (m *MockStore) DisableForeignKeysAndTriggers(arg0 context.Context) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DisableForeignKeysAndTriggers", arg0) + ret0, _ := ret[0].(error) + return ret0 +} + +// DisableForeignKeysAndTriggers indicates an expected call of DisableForeignKeysAndTriggers. +func (mr *MockStoreMockRecorder) DisableForeignKeysAndTriggers(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DisableForeignKeysAndTriggers", reflect.TypeOf((*MockStore)(nil).DisableForeignKeysAndTriggers), arg0) +} + // EnqueueNotificationMessage mocks base method. func (m *MockStore) EnqueueNotificationMessage(arg0 context.Context, arg1 database.EnqueueNotificationMessageParams) error { m.ctrl.T.Helper() diff --git a/coderd/database/dbpurge/dbpurge_test.go b/coderd/database/dbpurge/dbpurge_test.go index 671c65c68790e..4677602328c89 100644 --- a/coderd/database/dbpurge/dbpurge_test.go +++ b/coderd/database/dbpurge/dbpurge_test.go @@ -34,7 +34,7 @@ import ( ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + goleak.VerifyTestMain(m, testutil.GoleakOptions...) } // Ensures no goroutines leak. diff --git a/coderd/database/dbrollup/dbrollup_test.go b/coderd/database/dbrollup/dbrollup_test.go index eae7759d2059c..c5c2d8f9243b0 100644 --- a/coderd/database/dbrollup/dbrollup_test.go +++ b/coderd/database/dbrollup/dbrollup_test.go @@ -23,7 +23,7 @@ import ( ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + goleak.VerifyTestMain(m, testutil.GoleakOptions...) } func TestRollup_Close(t *testing.T) { diff --git a/coderd/database/dbtestutil/db.go b/coderd/database/dbtestutil/db.go index b752d7c4c3a97..c76be1ed52a9d 100644 --- a/coderd/database/dbtestutil/db.go +++ b/coderd/database/dbtestutil/db.go @@ -87,6 +87,18 @@ func NewDBWithSQLDB(t testing.TB, opts ...Option) (database.Store, pubsub.Pubsub return db, ps, sqlDB } +var DefaultTimezone = "Canada/Newfoundland" + +// NowInDefaultTimezone returns the current time rounded to the nearest microsecond in the default timezone +// used by postgres in tests. Useful for object equality checks. +func NowInDefaultTimezone() time.Time { + loc, err := time.LoadLocation(DefaultTimezone) + if err != nil { + panic(err) + } + return time.Now().In(loc).Round(time.Microsecond) +} + func NewDB(t testing.TB, opts ...Option) (database.Store, pubsub.Pubsub) { t.Helper() @@ -115,7 +127,7 @@ func NewDB(t testing.TB, opts ...Option) (database.Store, pubsub.Pubsub) { // - It has a non-UTC offset // - It has a fractional hour UTC offset // - It includes a daylight savings time component - o.fixedTimezone = "Canada/Newfoundland" + o.fixedTimezone = DefaultTimezone } dbName := dbNameFromConnectionURL(t, connectionURL) setDBTimezone(t, connectionURL, dbName, o.fixedTimezone) @@ -318,3 +330,15 @@ func normalizeDump(schema []byte) []byte { return schema } + +// Deprecated: disable foreign keys was created to aid in migrating off +// of the test-only in-memory database. Do not use this in new code. +func DisableForeignKeysAndTriggers(t *testing.T, db database.Store) { + err := db.DisableForeignKeysAndTriggers(context.Background()) + if t != nil { + require.NoError(t, err) + } + if err != nil { + panic(err) + } +} diff --git a/coderd/database/dbtestutil/postgres_test.go b/coderd/database/dbtestutil/postgres_test.go index 9cae9411289ad..d4aaacdf909d8 100644 --- a/coderd/database/dbtestutil/postgres_test.go +++ b/coderd/database/dbtestutil/postgres_test.go @@ -12,10 +12,11 @@ import ( "github.com/coder/coder/v2/coderd/database/dbtestutil" "github.com/coder/coder/v2/coderd/database/migrations" + "github.com/coder/coder/v2/testutil" ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + goleak.VerifyTestMain(m, testutil.GoleakOptions...) } func TestOpen(t *testing.T) { diff --git a/coderd/database/dump.sql b/coderd/database/dump.sql index f91a5371f06f6..50519485dc505 100644 --- a/coderd/database/dump.sql +++ b/coderd/database/dump.sql @@ -261,6 +261,12 @@ CREATE TYPE workspace_app_health AS ENUM ( 'unhealthy' ); +CREATE TYPE workspace_app_open_in AS ENUM ( + 'tab', + 'window', + 'slim-window' +); + CREATE TYPE workspace_transition AS ENUM ( 'start', 'stop', @@ -1602,7 +1608,8 @@ CREATE TABLE workspace_apps ( slug text NOT NULL, external boolean DEFAULT false NOT NULL, display_order integer DEFAULT 0 NOT NULL, - hidden boolean DEFAULT false NOT NULL + hidden boolean DEFAULT false NOT NULL, + open_in workspace_app_open_in DEFAULT 'slim-window'::workspace_app_open_in NOT NULL ); COMMENT ON COLUMN workspace_apps.display_order IS 'Specifies the order in which to display agent app in user interfaces.'; diff --git a/coderd/database/migrations/000282_workspace_app_add_open_in.down.sql b/coderd/database/migrations/000282_workspace_app_add_open_in.down.sql new file mode 100644 index 0000000000000..9f866022f555e --- /dev/null +++ b/coderd/database/migrations/000282_workspace_app_add_open_in.down.sql @@ -0,0 +1,3 @@ +ALTER TABLE workspace_apps DROP COLUMN open_in; + +DROP TYPE workspace_app_open_in; diff --git a/coderd/database/migrations/000282_workspace_app_add_open_in.up.sql b/coderd/database/migrations/000282_workspace_app_add_open_in.up.sql new file mode 100644 index 0000000000000..ccde2b09d6557 --- /dev/null +++ b/coderd/database/migrations/000282_workspace_app_add_open_in.up.sql @@ -0,0 +1,3 @@ +CREATE TYPE workspace_app_open_in AS ENUM ('tab', 'window', 'slim-window'); + +ALTER TABLE workspace_apps ADD COLUMN open_in workspace_app_open_in NOT NULL DEFAULT 'slim-window'::workspace_app_open_in; diff --git a/coderd/database/migrations/migrate_test.go b/coderd/database/migrations/migrate_test.go index c64c2436da18d..7d016f7978fb1 100644 --- a/coderd/database/migrations/migrate_test.go +++ b/coderd/database/migrations/migrate_test.go @@ -28,7 +28,7 @@ import ( ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + goleak.VerifyTestMain(m, testutil.GoleakOptions...) } func TestMigrate(t *testing.T) { diff --git a/coderd/database/models.go b/coderd/database/models.go index e9a5f93051ba5..9ca80d119a502 100644 --- a/coderd/database/models.go +++ b/coderd/database/models.go @@ -2151,6 +2151,67 @@ func AllWorkspaceAppHealthValues() []WorkspaceAppHealth { } } +type WorkspaceAppOpenIn string + +const ( + WorkspaceAppOpenInTab WorkspaceAppOpenIn = "tab" + WorkspaceAppOpenInWindow WorkspaceAppOpenIn = "window" + WorkspaceAppOpenInSlimWindow WorkspaceAppOpenIn = "slim-window" +) + +func (e *WorkspaceAppOpenIn) Scan(src interface{}) error { + switch s := src.(type) { + case []byte: + *e = WorkspaceAppOpenIn(s) + case string: + *e = WorkspaceAppOpenIn(s) + default: + return fmt.Errorf("unsupported scan type for WorkspaceAppOpenIn: %T", src) + } + return nil +} + +type NullWorkspaceAppOpenIn struct { + WorkspaceAppOpenIn WorkspaceAppOpenIn `json:"workspace_app_open_in"` + Valid bool `json:"valid"` // Valid is true if WorkspaceAppOpenIn is not NULL +} + +// Scan implements the Scanner interface. +func (ns *NullWorkspaceAppOpenIn) Scan(value interface{}) error { + if value == nil { + ns.WorkspaceAppOpenIn, ns.Valid = "", false + return nil + } + ns.Valid = true + return ns.WorkspaceAppOpenIn.Scan(value) +} + +// Value implements the driver Valuer interface. +func (ns NullWorkspaceAppOpenIn) Value() (driver.Value, error) { + if !ns.Valid { + return nil, nil + } + return string(ns.WorkspaceAppOpenIn), nil +} + +func (e WorkspaceAppOpenIn) Valid() bool { + switch e { + case WorkspaceAppOpenInTab, + WorkspaceAppOpenInWindow, + WorkspaceAppOpenInSlimWindow: + return true + } + return false +} + +func AllWorkspaceAppOpenInValues() []WorkspaceAppOpenIn { + return []WorkspaceAppOpenIn{ + WorkspaceAppOpenInTab, + WorkspaceAppOpenInWindow, + WorkspaceAppOpenInSlimWindow, + } +} + type WorkspaceTransition string const ( @@ -3092,7 +3153,8 @@ type WorkspaceApp struct { // Specifies the order in which to display agent app in user interfaces. DisplayOrder int32 `db:"display_order" json:"display_order"` // Determines if the app is not shown in user interfaces. - Hidden bool `db:"hidden" json:"hidden"` + Hidden bool `db:"hidden" json:"hidden"` + OpenIn WorkspaceAppOpenIn `db:"open_in" json:"open_in"` } // A record of workspace app usage statistics diff --git a/coderd/database/querier.go b/coderd/database/querier.go index 2128315ce6dad..620cc14b3fd26 100644 --- a/coderd/database/querier.go +++ b/coderd/database/querier.go @@ -106,6 +106,10 @@ type sqlcQuerier interface { DeleteTailnetTunnel(ctx context.Context, arg DeleteTailnetTunnelParams) (DeleteTailnetTunnelRow, error) DeleteWorkspaceAgentPortShare(ctx context.Context, arg DeleteWorkspaceAgentPortShareParams) error DeleteWorkspaceAgentPortSharesByTemplate(ctx context.Context, templateID uuid.UUID) error + // Disable foreign keys and triggers for all tables. + // Deprecated: disable foreign keys was created to aid in migrating off + // of the test-only in-memory database. Do not use this in new code. + DisableForeignKeysAndTriggers(ctx context.Context) error EnqueueNotificationMessage(ctx context.Context, arg EnqueueNotificationMessageParams) error FavoriteWorkspace(ctx context.Context, id uuid.UUID) error // This is used to build up the notification_message's JSON payload. diff --git a/coderd/database/queries.sql.go b/coderd/database/queries.sql.go index 1a7911bc64b4d..8fbb7c0b5be6c 100644 --- a/coderd/database/queries.sql.go +++ b/coderd/database/queries.sql.go @@ -9796,6 +9796,33 @@ func (q *sqlQuerier) InsertTemplateVersionWorkspaceTag(ctx context.Context, arg return i, err } +const disableForeignKeysAndTriggers = `-- name: DisableForeignKeysAndTriggers :exec +DO $$ +DECLARE + table_record record; +BEGIN + FOR table_record IN + SELECT table_schema, table_name + FROM information_schema.tables + WHERE table_schema NOT IN ('pg_catalog', 'information_schema') + AND table_type = 'BASE TABLE' + LOOP + EXECUTE format('ALTER TABLE %I.%I DISABLE TRIGGER ALL', + table_record.table_schema, + table_record.table_name); + END LOOP; +END; +$$ +` + +// Disable foreign keys and triggers for all tables. +// Deprecated: disable foreign keys was created to aid in migrating off +// of the test-only in-memory database. Do not use this in new code. +func (q *sqlQuerier) DisableForeignKeysAndTriggers(ctx context.Context) error { + _, err := q.db.ExecContext(ctx, disableForeignKeysAndTriggers) + return err +} + const getUserLinkByLinkedID = `-- name: GetUserLinkByLinkedID :one SELECT user_links.user_id, user_links.login_type, user_links.linked_id, user_links.oauth_access_token, user_links.oauth_refresh_token, user_links.oauth_expiry, user_links.oauth_access_token_key_id, user_links.oauth_refresh_token_key_id, user_links.claims @@ -13157,7 +13184,7 @@ func (q *sqlQuerier) InsertWorkspaceAgentStats(ctx context.Context, arg InsertWo } const getWorkspaceAppByAgentIDAndSlug = `-- name: GetWorkspaceAppByAgentIDAndSlug :one -SELECT id, created_at, agent_id, display_name, icon, command, url, healthcheck_url, healthcheck_interval, healthcheck_threshold, health, subdomain, sharing_level, slug, external, display_order, hidden FROM workspace_apps WHERE agent_id = $1 AND slug = $2 +SELECT id, created_at, agent_id, display_name, icon, command, url, healthcheck_url, healthcheck_interval, healthcheck_threshold, health, subdomain, sharing_level, slug, external, display_order, hidden, open_in FROM workspace_apps WHERE agent_id = $1 AND slug = $2 ` type GetWorkspaceAppByAgentIDAndSlugParams struct { @@ -13186,12 +13213,13 @@ func (q *sqlQuerier) GetWorkspaceAppByAgentIDAndSlug(ctx context.Context, arg Ge &i.External, &i.DisplayOrder, &i.Hidden, + &i.OpenIn, ) return i, err } const getWorkspaceAppsByAgentID = `-- name: GetWorkspaceAppsByAgentID :many -SELECT id, created_at, agent_id, display_name, icon, command, url, healthcheck_url, healthcheck_interval, healthcheck_threshold, health, subdomain, sharing_level, slug, external, display_order, hidden FROM workspace_apps WHERE agent_id = $1 ORDER BY slug ASC +SELECT id, created_at, agent_id, display_name, icon, command, url, healthcheck_url, healthcheck_interval, healthcheck_threshold, health, subdomain, sharing_level, slug, external, display_order, hidden, open_in FROM workspace_apps WHERE agent_id = $1 ORDER BY slug ASC ` func (q *sqlQuerier) GetWorkspaceAppsByAgentID(ctx context.Context, agentID uuid.UUID) ([]WorkspaceApp, error) { @@ -13221,6 +13249,7 @@ func (q *sqlQuerier) GetWorkspaceAppsByAgentID(ctx context.Context, agentID uuid &i.External, &i.DisplayOrder, &i.Hidden, + &i.OpenIn, ); err != nil { return nil, err } @@ -13236,7 +13265,7 @@ func (q *sqlQuerier) GetWorkspaceAppsByAgentID(ctx context.Context, agentID uuid } const getWorkspaceAppsByAgentIDs = `-- name: GetWorkspaceAppsByAgentIDs :many -SELECT id, created_at, agent_id, display_name, icon, command, url, healthcheck_url, healthcheck_interval, healthcheck_threshold, health, subdomain, sharing_level, slug, external, display_order, hidden FROM workspace_apps WHERE agent_id = ANY($1 :: uuid [ ]) ORDER BY slug ASC +SELECT id, created_at, agent_id, display_name, icon, command, url, healthcheck_url, healthcheck_interval, healthcheck_threshold, health, subdomain, sharing_level, slug, external, display_order, hidden, open_in FROM workspace_apps WHERE agent_id = ANY($1 :: uuid [ ]) ORDER BY slug ASC ` func (q *sqlQuerier) GetWorkspaceAppsByAgentIDs(ctx context.Context, ids []uuid.UUID) ([]WorkspaceApp, error) { @@ -13266,6 +13295,7 @@ func (q *sqlQuerier) GetWorkspaceAppsByAgentIDs(ctx context.Context, ids []uuid. &i.External, &i.DisplayOrder, &i.Hidden, + &i.OpenIn, ); err != nil { return nil, err } @@ -13281,7 +13311,7 @@ func (q *sqlQuerier) GetWorkspaceAppsByAgentIDs(ctx context.Context, ids []uuid. } const getWorkspaceAppsCreatedAfter = `-- name: GetWorkspaceAppsCreatedAfter :many -SELECT id, created_at, agent_id, display_name, icon, command, url, healthcheck_url, healthcheck_interval, healthcheck_threshold, health, subdomain, sharing_level, slug, external, display_order, hidden FROM workspace_apps WHERE created_at > $1 ORDER BY slug ASC +SELECT id, created_at, agent_id, display_name, icon, command, url, healthcheck_url, healthcheck_interval, healthcheck_threshold, health, subdomain, sharing_level, slug, external, display_order, hidden, open_in FROM workspace_apps WHERE created_at > $1 ORDER BY slug ASC ` func (q *sqlQuerier) GetWorkspaceAppsCreatedAfter(ctx context.Context, createdAt time.Time) ([]WorkspaceApp, error) { @@ -13311,6 +13341,7 @@ func (q *sqlQuerier) GetWorkspaceAppsCreatedAfter(ctx context.Context, createdAt &i.External, &i.DisplayOrder, &i.Hidden, + &i.OpenIn, ); err != nil { return nil, err } @@ -13344,10 +13375,11 @@ INSERT INTO healthcheck_threshold, health, display_order, - hidden + hidden, + open_in ) VALUES - ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17) RETURNING id, created_at, agent_id, display_name, icon, command, url, healthcheck_url, healthcheck_interval, healthcheck_threshold, health, subdomain, sharing_level, slug, external, display_order, hidden + ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18) RETURNING id, created_at, agent_id, display_name, icon, command, url, healthcheck_url, healthcheck_interval, healthcheck_threshold, health, subdomain, sharing_level, slug, external, display_order, hidden, open_in ` type InsertWorkspaceAppParams struct { @@ -13368,6 +13400,7 @@ type InsertWorkspaceAppParams struct { Health WorkspaceAppHealth `db:"health" json:"health"` DisplayOrder int32 `db:"display_order" json:"display_order"` Hidden bool `db:"hidden" json:"hidden"` + OpenIn WorkspaceAppOpenIn `db:"open_in" json:"open_in"` } func (q *sqlQuerier) InsertWorkspaceApp(ctx context.Context, arg InsertWorkspaceAppParams) (WorkspaceApp, error) { @@ -13389,6 +13422,7 @@ func (q *sqlQuerier) InsertWorkspaceApp(ctx context.Context, arg InsertWorkspace arg.Health, arg.DisplayOrder, arg.Hidden, + arg.OpenIn, ) var i WorkspaceApp err := row.Scan( @@ -13409,6 +13443,7 @@ func (q *sqlQuerier) InsertWorkspaceApp(ctx context.Context, arg InsertWorkspace &i.External, &i.DisplayOrder, &i.Hidden, + &i.OpenIn, ) return i, err } diff --git a/coderd/database/queries/testadmin.sql b/coderd/database/queries/testadmin.sql new file mode 100644 index 0000000000000..77d39ce52768c --- /dev/null +++ b/coderd/database/queries/testadmin.sql @@ -0,0 +1,20 @@ +-- name: DisableForeignKeysAndTriggers :exec +-- Disable foreign keys and triggers for all tables. +-- Deprecated: disable foreign keys was created to aid in migrating off +-- of the test-only in-memory database. Do not use this in new code. +DO $$ +DECLARE + table_record record; +BEGIN + FOR table_record IN + SELECT table_schema, table_name + FROM information_schema.tables + WHERE table_schema NOT IN ('pg_catalog', 'information_schema') + AND table_type = 'BASE TABLE' + LOOP + EXECUTE format('ALTER TABLE %I.%I DISABLE TRIGGER ALL', + table_record.table_schema, + table_record.table_name); + END LOOP; +END; +$$; diff --git a/coderd/database/queries/workspaceapps.sql b/coderd/database/queries/workspaceapps.sql index 9ae1367093efd..2f431268a4c41 100644 --- a/coderd/database/queries/workspaceapps.sql +++ b/coderd/database/queries/workspaceapps.sql @@ -29,10 +29,11 @@ INSERT INTO healthcheck_threshold, health, display_order, - hidden + hidden, + open_in ) VALUES - ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17) RETURNING *; + ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18) RETURNING *; -- name: UpdateWorkspaceAppHealthByID :exec UPDATE diff --git a/coderd/jwtutils/jws.go b/coderd/jwtutils/jws.go index 0c8ca9aa30f39..eca8752e1a88d 100644 --- a/coderd/jwtutils/jws.go +++ b/coderd/jwtutils/jws.go @@ -38,7 +38,7 @@ type Claims interface { } const ( - signingAlgo = jose.HS512 + SigningAlgo = jose.HS512 ) type SigningKeyManager interface { @@ -62,7 +62,7 @@ func Sign(ctx context.Context, s SigningKeyProvider, claims Claims) (string, err } signer, err := jose.NewSigner(jose.SigningKey{ - Algorithm: signingAlgo, + Algorithm: SigningAlgo, Key: key, }, &jose.SignerOptions{ ExtraHeaders: map[jose.HeaderKey]interface{}{ @@ -109,7 +109,7 @@ func Verify(ctx context.Context, v VerifyKeyProvider, token string, claims Claim RegisteredClaims: jwt.Expected{ Time: time.Now(), }, - SignatureAlgorithm: signingAlgo, + SignatureAlgorithm: SigningAlgo, } for _, opt := range opts { @@ -127,8 +127,8 @@ func Verify(ctx context.Context, v VerifyKeyProvider, token string, claims Claim signature := object.Signatures[0] - if signature.Header.Algorithm != string(signingAlgo) { - return xerrors.Errorf("expected JWS algorithm to be %q, got %q", signingAlgo, object.Signatures[0].Header.Algorithm) + if signature.Header.Algorithm != string(SigningAlgo) { + return xerrors.Errorf("expected JWS algorithm to be %q, got %q", SigningAlgo, object.Signatures[0].Header.Algorithm) } kid := signature.Header.KeyID diff --git a/coderd/notifications/dispatch/smtp_test.go b/coderd/notifications/dispatch/smtp_test.go index b448dd2582e67..c424d81d79683 100644 --- a/coderd/notifications/dispatch/smtp_test.go +++ b/coderd/notifications/dispatch/smtp_test.go @@ -26,7 +26,7 @@ import ( ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + goleak.VerifyTestMain(m, testutil.GoleakOptions...) } func TestSMTP(t *testing.T) { diff --git a/coderd/notifications/notifications_test.go b/coderd/notifications/notifications_test.go index 1c4be51974b05..e404f4afb3c19 100644 --- a/coderd/notifications/notifications_test.go +++ b/coderd/notifications/notifications_test.go @@ -56,7 +56,7 @@ import ( var updateGoldenFiles = flag.Bool("update", false, "Update golden files") func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + goleak.VerifyTestMain(m, testutil.GoleakOptions...) } // TestBasicNotificationRoundtrip enqueues a message to the store, waits for it to be acquired by a notifier, diff --git a/coderd/provisionerdserver/acquirer_test.go b/coderd/provisionerdserver/acquirer_test.go index 269b035d50edd..bc8fc3d6f5869 100644 --- a/coderd/provisionerdserver/acquirer_test.go +++ b/coderd/provisionerdserver/acquirer_test.go @@ -28,7 +28,7 @@ import ( ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + goleak.VerifyTestMain(m, testutil.GoleakOptions...) } // TestAcquirer_Store tests that a database.Store is accepted as a provisionerdserver.AcquirerStore diff --git a/coderd/provisionerdserver/provisionerdserver.go b/coderd/provisionerdserver/provisionerdserver.go index 8899aa999f503..e3bbb621e57f6 100644 --- a/coderd/provisionerdserver/provisionerdserver.go +++ b/coderd/provisionerdserver/provisionerdserver.go @@ -1509,6 +1509,7 @@ func (s *server) CompleteJob(ctx context.Context, completed *proto.CompletedJob) dur := time.Duration(protoAgent.GetConnectionTimeoutSeconds()) * time.Second agentTimeouts[dur] = true } + err = InsertWorkspaceResource(ctx, db, job.ID, workspaceBuild.Transition, protoResource, telemetrySnapshot) if err != nil { return xerrors.Errorf("insert provisioner job: %w", err) @@ -2012,6 +2013,14 @@ func InsertWorkspaceResource(ctx context.Context, db database.Store, jobID uuid. sharingLevel = database.AppSharingLevelPublic } + openIn := database.WorkspaceAppOpenInSlimWindow + switch app.OpenIn { + case sdkproto.AppOpenIn_TAB: + openIn = database.WorkspaceAppOpenInTab + case sdkproto.AppOpenIn_WINDOW: + openIn = database.WorkspaceAppOpenInWindow + } + dbApp, err := db.InsertWorkspaceApp(ctx, database.InsertWorkspaceAppParams{ ID: uuid.New(), CreatedAt: dbtime.Now(), @@ -2036,6 +2045,7 @@ func InsertWorkspaceResource(ctx context.Context, db database.Store, jobID uuid. Health: health, DisplayOrder: int32(app.Order), Hidden: app.Hidden, + OpenIn: openIn, }) if err != nil { return xerrors.Errorf("insert app: %w", err) diff --git a/coderd/rbac/README.md b/coderd/rbac/README.md index f6d432d124344..07bfaf061ca94 100644 --- a/coderd/rbac/README.md +++ b/coderd/rbac/README.md @@ -36,7 +36,7 @@ Both **negative** and **positive** permissions override **abstain** at the same This can be represented by the following truth table, where Y represents _positive_, N represents _negative_, and \_ represents _abstain_: | Action | Positive | Negative | Result | -| ------ | -------- | -------- | ------ | +|--------|----------|----------|--------| | read | Y | \_ | Y | | read | Y | N | N | | read | \_ | \_ | \_ | @@ -63,10 +63,10 @@ This can be represented by the following truth table, where Y represents _positi A _role_ is a set of permissions. When evaluating a role's permission to form an action, all the relevant permissions for the role are combined at each level. Permissions at a higher level override permissions at a lower level. The following table shows the per-level role evaluation. -Y indicates that the role provides positive permissions, N indicates the role provides negative permissions, and _ indicates the role does not provide positive or negative permissions. YN_ indicates that the value in the cell does not matter for the access result. +Y indicates that the role provides positive permissions, N indicates the role provides negative permissions, and _indicates the role does not provide positive or negative permissions. YN_ indicates that the value in the cell does not matter for the access result. | Role (example) | Site | Org | User | Result | -| --------------- | ---- | ---- | ---- | ------ | +|-----------------|------|------|------|--------| | site-admin | Y | YN\_ | YN\_ | Y | | no-permission | N | YN\_ | YN\_ | N | | org-admin | \_ | Y | YN\_ | Y | @@ -102,7 +102,7 @@ Example of a scope for a workspace agent token, using an `allow_list` containing } ``` -# Testing +## Testing You can test outside of golang by using the `opa` cli. diff --git a/coderd/rbac/USAGE.md b/coderd/rbac/USAGE.md index 76bff69a88c5a..b2a20bf5cbb4d 100644 --- a/coderd/rbac/USAGE.md +++ b/coderd/rbac/USAGE.md @@ -1,6 +1,6 @@ # Using RBAC -# Overview +## Overview > _NOTE: you should probably read [`README.md`](README.md) beforehand, but it's > not essential._ @@ -19,7 +19,7 @@ We have a number of roles (some of which have legacy connotations back to v1). These can be found in `coderd/rbac/roles.go`. | Role | Description | Example resources (non-exhaustive) | -| -------------------- | ------------------------------------------------------------------- | -------------------------------------------- | +|----------------------|---------------------------------------------------------------------|----------------------------------------------| | **owner** | Super-user, first user in Coder installation, has all\* permissions | all\* | | **member** | A regular user | workspaces, own details, provisioner daemons | | **auditor** | Viewer of audit log events, read-only access to a few resources | audit logs, templates, users, groups | @@ -43,7 +43,7 @@ Roles are collections of permissions (we call them _actions_). These can be found in `coderd/rbac/policy/policy.go`. | Action | Description | -| ----------------------- | --------------------------------------- | +|-------------------------|-----------------------------------------| | **create** | Create a resource | | **read** | Read a resource | | **update** | Update a resource | @@ -58,7 +58,7 @@ These can be found in `coderd/rbac/policy/policy.go`. | **stop** | Stop a workspace | | **assign** | Assign user to role / org | -# Creating a new noun +## Creating a new noun In the following example, we're going to create a new RBAC noun for a new entity called a "frobulator" _(just some nonsense word for demonstration purposes)_. @@ -291,7 +291,7 @@ frobulator, but no test case covered it. **NOTE: don't just add cases which make the tests pass; consider all the ways in which your resource must be used, and test all of those scenarios!** -# Database authorization +## Database authorization Now that we have the RBAC system fully configured, we need to make use of it. @@ -350,7 +350,7 @@ before we validate (this explains the `fetchWithPostFilter` naming). All queries are executed through `dbauthz`, and now our little frobulators are protected! -# API authorization +## API authorization API authorization is not strictly required because we have database authorization in place, but it's a good practice to reject requests as soon as diff --git a/coderd/rbac/authz.go b/coderd/rbac/authz.go index ff4f9ce2371d4..aaba7d6eae3af 100644 --- a/coderd/rbac/authz.go +++ b/coderd/rbac/authz.go @@ -12,7 +12,7 @@ import ( "github.com/ammario/tlru" "github.com/open-policy-agent/opa/ast" - "github.com/open-policy-agent/opa/rego" + "github.com/open-policy-agent/opa/v1/rego" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" "go.opentelemetry.io/otel/attribute" diff --git a/coderd/rbac/error.go b/coderd/rbac/error.go index 98735ade322c4..1ea16dca7f13f 100644 --- a/coderd/rbac/error.go +++ b/coderd/rbac/error.go @@ -6,8 +6,8 @@ import ( "flag" "fmt" - "github.com/open-policy-agent/opa/rego" "github.com/open-policy-agent/opa/topdown" + "github.com/open-policy-agent/opa/v1/rego" "golang.org/x/xerrors" "github.com/coder/coder/v2/coderd/httpapi/httpapiconstraints" diff --git a/coderd/rbac/policy.rego b/coderd/rbac/policy.rego index bf7a38c3cc194..ea381fa88d8e4 100644 --- a/coderd/rbac/policy.rego +++ b/coderd/rbac/policy.rego @@ -1,5 +1,7 @@ package authz -import future.keywords + +import rego.v1 + # A great playground: https://play.openpolicyagent.org/ # Helpful cli commands to debug. # opa eval --format=pretty 'data.authz.allow' -d policy.rego -i input.json @@ -29,67 +31,74 @@ import future.keywords # bool_flip lets you assign a value to an inverted bool. # You cannot do 'x := !false', but you can do 'x := bool_flip(false)' -bool_flip(b) = flipped { - b - flipped = false +bool_flip(b) := flipped if { + b + flipped = false } -bool_flip(b) = flipped { - not b - flipped = true +bool_flip(b) := flipped if { + not b + flipped = true } # number is a quick way to get a set of {true, false} and convert it to # -1: {false, true} or {false} # 0: {} # 1: {true} -number(set) = c { +number(set) := c if { count(set) == 0 - c := 0 + c := 0 } -number(set) = c { +number(set) := c if { false in set - c := -1 + c := -1 } -number(set) = c { +number(set) := c if { not false in set set[_] - c := 1 + c := 1 } # site, org, and user rules are all similar. Each rule should return a number # from [-1, 1]. The number corresponds to "negative", "abstain", and "positive" # for the given level. See the 'allow' rules for how these numbers are used. -default site = 0 +default site := 0 + site := site_allow(input.subject.roles) + default scope_site := 0 + scope_site := site_allow([input.subject.scope]) -site_allow(roles) := num { +site_allow(roles) := num if { # allow is a set of boolean values without duplicates. - allow := { x | + allow := {x | # Iterate over all site permissions in all roles - perm := roles[_].site[_] - perm.action in [input.action, "*"] + perm := roles[_].site[_] + perm.action in [input.action, "*"] perm.resource_type in [input.object.type, "*"] + # x is either 'true' or 'false' if a matching permission exists. - x := bool_flip(perm.negate) - } - num := number(allow) + x := bool_flip(perm.negate) + } + num := number(allow) } # org_members is the list of organizations the actor is apart of. -org_members := { orgID | +org_members := {orgID | input.subject.roles[_].org[orgID] } # org is the same as 'site' except we need to iterate over each organization # that the actor is a member of. -default org = 0 +default org := 0 + org := org_allow(input.subject.roles) + default scope_org := 0 + scope_org := org_allow([input.scope]) # org_allow_set is a helper function that iterates over all orgs that the actor @@ -102,10 +111,10 @@ scope_org := org_allow([input.scope]) # The reason we calculate this for all orgs, and not just the input.object.org_owner # is that sometimes the input.object.org_owner is unknown. In those cases # we have a list of org_ids that can we use in a SQL 'WHERE' clause. -org_allow_set(roles) := allow_set { - allow_set := { id: num | +org_allow_set(roles) := allow_set if { + allow_set := {id: num | id := org_members[_] - set := { x | + set := {x | perm := roles[_].org[id][_] perm.action in [input.action, "*"] perm.resource_type in [input.object.type, "*"] @@ -115,7 +124,7 @@ org_allow_set(roles) := allow_set { } } -org_allow(roles) := num { +org_allow(roles) := num if { # If the object has "any_org" set to true, then use the other # org_allow block. not input.object.any_org @@ -135,78 +144,82 @@ org_allow(roles) := num { # This is useful for UI elements when we want to conclude, "Can the user create # a new template in any organization?" # It is easier than iterating over every organization the user is apart of. -org_allow(roles) := num { +org_allow(roles) := num if { input.object.any_org # if this is false, this code block is not used allow := org_allow_set(roles) - # allow is a map of {"": }. We only care about values # that are 1, and ignore the rest. num := number([ - keep | - # for every value in the mapping - value := allow[_] - # only keep values > 0. - # 1 = allow, 0 = abstain, -1 = deny - # We only need 1 explicit allow to allow the action. - # deny's and abstains are intentionally ignored. - value > 0 - # result set is a set of [true,false,...] - # which "number()" will convert to a number. - keep := true + keep | + # for every value in the mapping + value := allow[_] + + # only keep values > 0. + # 1 = allow, 0 = abstain, -1 = deny + # We only need 1 explicit allow to allow the action. + # deny's and abstains are intentionally ignored. + value > 0 + + # result set is a set of [true,false,...] + # which "number()" will convert to a number. + keep := true ]) } # 'org_mem' is set to true if the user is an org member # If 'any_org' is set to true, use the other block to determine org membership. -org_mem := true { +org_mem if { not input.object.any_org input.object.org_owner != "" input.object.org_owner in org_members } -org_mem := true { +org_mem if { input.object.any_org count(org_members) > 0 } -org_ok { +org_ok if { org_mem } # If the object has no organization, then the user is also considered part of # the non-existent org. -org_ok { +org_ok if { input.object.org_owner == "" not input.object.any_org } # User is the same as the site, except it only applies if the user owns the object and # the user is apart of the org (if the object has an org). -default user = 0 +default user := 0 + user := user_allow(input.subject.roles) + default user_scope := 0 + scope_user := user_allow([input.scope]) -user_allow(roles) := num { - input.object.owner != "" - input.subject.id = input.object.owner - allow := { x | - perm := roles[_].user[_] - perm.action in [input.action, "*"] +user_allow(roles) := num if { + input.object.owner != "" + input.subject.id = input.object.owner + allow := {x | + perm := roles[_].user[_] + perm.action in [input.action, "*"] perm.resource_type in [input.object.type, "*"] - x := bool_flip(perm.negate) - } - num := number(allow) + x := bool_flip(perm.negate) + } + num := number(allow) } # Scope allow_list is a list of resource IDs explicitly allowed by the scope. # If the list is '*', then all resources are allowed. -scope_allow_list { +scope_allow_list if { "*" in input.subject.scope.allow_list } -scope_allow_list { +scope_allow_list if { # If the wildcard is listed in the allow_list, we do not care about the # object.id. This line is included to prevent partial compilations from # ever needing to include the object.id. @@ -226,39 +239,41 @@ scope_allow_list { # Allow query: # data.authz.role_allow = true data.authz.scope_allow = true -role_allow { +role_allow if { site = 1 } -role_allow { +role_allow if { not site = -1 org = 1 } -role_allow { +role_allow if { not site = -1 not org = -1 + # If we are not a member of an org, and the object has an org, then we are # not authorized. This is an "implied -1" for not being in the org. org_ok user = 1 } -scope_allow { +scope_allow if { scope_allow_list scope_site = 1 } -scope_allow { +scope_allow if { scope_allow_list not scope_site = -1 scope_org = 1 } -scope_allow { +scope_allow if { scope_allow_list not scope_site = -1 not scope_org = -1 + # If we are not a member of an org, and the object has an org, then we are # not authorized. This is an "implied -1" for not being in the org. org_ok @@ -266,26 +281,28 @@ scope_allow { } # ACL for users -acl_allow { +acl_allow if { # Should you have to be a member of the org too? perms := input.object.acl_user_list[input.subject.id] + # Either the input action or wildcard [input.action, "*"][_] in perms } # ACL for groups -acl_allow { +acl_allow if { # If there is no organization owner, the object cannot be owned by an # org_scoped team. org_mem group := input.subject.groups[_] perms := input.object.acl_group_list[group] + # Either the input action or wildcard [input.action, "*"][_] in perms } # ACL for 'all_users' special group -acl_allow { +acl_allow if { org_mem perms := input.object.acl_group_list[input.object.org_owner] [input.action, "*"][_] in perms @@ -296,13 +313,13 @@ acl_allow { # The role or the ACL must allow the action. Scopes can be used to limit, # so scope_allow must always be true. -allow { +allow if { role_allow scope_allow } # ACL list must also have the scope_allow to pass -allow { +allow if { acl_allow scope_allow } diff --git a/coderd/rbac/regosql/compile.go b/coderd/rbac/regosql/compile.go index 69ef2a018f36c..7c843d619aa26 100644 --- a/coderd/rbac/regosql/compile.go +++ b/coderd/rbac/regosql/compile.go @@ -5,7 +5,7 @@ import ( "strings" "github.com/open-policy-agent/opa/ast" - "github.com/open-policy-agent/opa/rego" + "github.com/open-policy-agent/opa/v1/rego" "golang.org/x/xerrors" "github.com/coder/coder/v2/coderd/rbac/regosql/sqltypes" diff --git a/coderd/rbac/regosql/compile_test.go b/coderd/rbac/regosql/compile_test.go index be0385bf83699..a6b59d1fdd4bd 100644 --- a/coderd/rbac/regosql/compile_test.go +++ b/coderd/rbac/regosql/compile_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/open-policy-agent/opa/ast" - "github.com/open-policy-agent/opa/rego" + "github.com/open-policy-agent/opa/v1/rego" "github.com/stretchr/testify/require" "github.com/coder/coder/v2/coderd/rbac/regosql" diff --git a/coderd/telemetry/telemetry_test.go b/coderd/telemetry/telemetry_test.go index 2b70cd2a6d2c3..e0cbfd1cfa193 100644 --- a/coderd/telemetry/telemetry_test.go +++ b/coderd/telemetry/telemetry_test.go @@ -27,7 +27,7 @@ import ( ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + goleak.VerifyTestMain(m, testutil.GoleakOptions...) } func TestTelemetry(t *testing.T) { @@ -59,6 +59,7 @@ func TestTelemetry(t *testing.T) { _ = dbgen.WorkspaceApp(t, db, database.WorkspaceApp{ SharingLevel: database.AppSharingLevelOwner, Health: database.WorkspaceAppHealthDisabled, + OpenIn: database.WorkspaceAppOpenInSlimWindow, }) group := dbgen.Group(t, db, database.Group{}) _ = dbgen.GroupMember(t, db, database.GroupMemberTable{UserID: user.ID, GroupID: group.ID}) diff --git a/coderd/templateversions_test.go b/coderd/templateversions_test.go index 1a67508880188..b2ec822f998bc 100644 --- a/coderd/templateversions_test.go +++ b/coderd/templateversions_test.go @@ -293,6 +293,11 @@ func TestPostTemplateVersionsByOrganization(t *testing.T) { type = string default = "2" } + data "coder_parameter" "unrelated" { + name = "unrelated" + type = "list(string)" + default = jsonencode(["a", "b"]) + } resource "null_resource" "test" {}`, }, wantTags: map[string]string{"owner": "", "scope": "organization"}, @@ -301,18 +306,23 @@ func TestPostTemplateVersionsByOrganization(t *testing.T) { name: "main.tf with empty workspace tags", files: map[string]string{ `main.tf`: ` - variable "a" { - type = string - default = "1" - } - data "coder_parameter" "b" { - type = string - default = "2" - } - resource "null_resource" "test" {} - data "coder_workspace_tags" "tags" { - tags = {} - }`, + variable "a" { + type = string + default = "1" + } + data "coder_parameter" "b" { + type = string + default = "2" + } + data "coder_parameter" "unrelated" { + name = "unrelated" + type = "list(string)" + default = jsonencode(["a", "b"]) + } + resource "null_resource" "test" {} + data "coder_workspace_tags" "tags" { + tags = {} + }`, }, wantTags: map[string]string{"owner": "", "scope": "organization"}, }, @@ -328,6 +338,11 @@ func TestPostTemplateVersionsByOrganization(t *testing.T) { type = string default = "2" } + data "coder_parameter" "unrelated" { + name = "unrelated" + type = "list(string)" + default = jsonencode(["a", "b"]) + } resource "null_resource" "test" {} data "coder_workspace_tags" "tags" { tags = { @@ -343,22 +358,28 @@ func TestPostTemplateVersionsByOrganization(t *testing.T) { name: "main.tf with workspace tags and request tags", files: map[string]string{ `main.tf`: ` - variable "a" { - type = string - default = "1" - } - data "coder_parameter" "b" { - type = string - default = "2" - } - resource "null_resource" "test" {} - data "coder_workspace_tags" "tags" { - tags = { - "foo": "bar", - "a": var.a, - "b": data.coder_parameter.b.value, + // This file is the same as the above, except for this comment. + variable "a" { + type = string + default = "1" + } + data "coder_parameter" "b" { + type = string + default = "2" } - }`, + data "coder_parameter" "unrelated" { + name = "unrelated" + type = "list(string)" + default = jsonencode(["a", "b"]) + } + resource "null_resource" "test" {} + data "coder_workspace_tags" "tags" { + tags = { + "foo": "bar", + "a": var.a, + "b": data.coder_parameter.b.value, + } + }`, }, reqTags: map[string]string{"baz": "zap", "foo": "noclobber"}, wantTags: map[string]string{"owner": "", "scope": "organization", "foo": "bar", "baz": "zap", "a": "1", "b": "2"}, @@ -375,6 +396,11 @@ func TestPostTemplateVersionsByOrganization(t *testing.T) { type = string default = "2" } + data "coder_parameter" "unrelated" { + name = "unrelated" + type = "list(string)" + default = jsonencode(["a", "b"]) + } resource "null_resource" "test" { name = "foo" } @@ -401,6 +427,11 @@ func TestPostTemplateVersionsByOrganization(t *testing.T) { type = string default = "2" } + data "coder_parameter" "unrelated" { + name = "unrelated" + type = "list(string)" + default = jsonencode(["a", "b"]) + } resource "null_resource" "test" { name = "foo" } @@ -423,6 +454,11 @@ func TestPostTemplateVersionsByOrganization(t *testing.T) { name: "main.tf with workspace tags that attempts to set user scope", files: map[string]string{ `main.tf`: ` + data "coder_parameter" "unrelated" { + name = "unrelated" + type = "list(string)" + default = jsonencode(["a", "b"]) + } resource "null_resource" "test" {} data "coder_workspace_tags" "tags" { tags = { @@ -437,6 +473,11 @@ func TestPostTemplateVersionsByOrganization(t *testing.T) { name: "main.tf with workspace tags that attempt to clobber org ID", files: map[string]string{ `main.tf`: ` + data "coder_parameter" "unrelated" { + name = "unrelated" + type = "list(string)" + default = jsonencode(["a", "b"]) + } resource "null_resource" "test" {} data "coder_workspace_tags" "tags" { tags = { @@ -451,6 +492,11 @@ func TestPostTemplateVersionsByOrganization(t *testing.T) { name: "main.tf with workspace tags that set scope=user", files: map[string]string{ `main.tf`: ` + data "coder_parameter" "unrelated" { + name = "unrelated" + type = "list(string)" + default = jsonencode(["a", "b"]) + } resource "null_resource" "test" {} data "coder_workspace_tags" "tags" { tags = { @@ -460,6 +506,19 @@ func TestPostTemplateVersionsByOrganization(t *testing.T) { }, wantTags: map[string]string{"owner": templateAdminUser.ID.String(), "scope": "user"}, }, + // Ref: https://github.com/coder/coder/issues/16021 + { + name: "main.tf with no workspace_tags and a function call in a parameter default", + files: map[string]string{ + `main.tf`: ` + data "coder_parameter" "unrelated" { + name = "unrelated" + type = "list(string)" + default = jsonencode(["a", "b"]) + }`, + }, + wantTags: map[string]string{"owner": "", "scope": "organization"}, + }, } { tt := tt t.Run(tt.name, func(t *testing.T) { diff --git a/coderd/unhanger/detector_test.go b/coderd/unhanger/detector_test.go index 4300d7d1b8661..43eb62bfa884b 100644 --- a/coderd/unhanger/detector_test.go +++ b/coderd/unhanger/detector_test.go @@ -28,7 +28,7 @@ import ( ) func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + goleak.VerifyTestMain(m, testutil.GoleakOptions...) } func TestDetectorNoJobs(t *testing.T) { diff --git a/coderd/updatecheck/updatecheck_test.go b/coderd/updatecheck/updatecheck_test.go index afc0f57cbdd41..3e21309c5ff71 100644 --- a/coderd/updatecheck/updatecheck_test.go +++ b/coderd/updatecheck/updatecheck_test.go @@ -154,5 +154,5 @@ func TestChecker_Latest(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + goleak.VerifyTestMain(m, testutil.GoleakOptions...) } diff --git a/coderd/workspaceapps/apptest/apptest.go b/coderd/workspaceapps/apptest/apptest.go index c6e251806230d..91d8d7b3fbd6a 100644 --- a/coderd/workspaceapps/apptest/apptest.go +++ b/coderd/workspaceapps/apptest/apptest.go @@ -20,7 +20,7 @@ import ( "testing" "time" - "github.com/go-jose/go-jose/v3" + "github.com/go-jose/go-jose/v4" "github.com/google/uuid" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" @@ -28,6 +28,7 @@ import ( "github.com/coder/coder/v2/coderd/coderdtest" "github.com/coder/coder/v2/coderd/database" + "github.com/coder/coder/v2/coderd/jwtutils" "github.com/coder/coder/v2/coderd/rbac" "github.com/coder/coder/v2/coderd/workspaceapps" "github.com/coder/coder/v2/codersdk" @@ -430,7 +431,7 @@ func Run(t *testing.T, appHostIsPrimary bool, factory DeploymentFactory) { require.NotNil(t, appTokenCookie, "no signed app token cookie in response") require.Equal(t, appTokenCookie.Path, u.Path, "incorrect path on app token cookie") - object, err := jose.ParseSigned(appTokenCookie.Value) + object, err := jose.ParseSigned(appTokenCookie.Value, []jose.SignatureAlgorithm{jwtutils.SigningAlgo}) require.NoError(t, err) require.Len(t, object.Signatures, 1) @@ -712,7 +713,7 @@ func Run(t *testing.T, appHostIsPrimary bool, factory DeploymentFactory) { // Parse the JWT without verifying it (since we can't access the key // from this test). - object, err := jose.ParseSigned(appTokenCookie.Value) + object, err := jose.ParseSigned(appTokenCookie.Value, []jose.SignatureAlgorithm{jwtutils.SigningAlgo}) require.NoError(t, err) require.Len(t, object.Signatures, 1) @@ -1192,7 +1193,7 @@ func Run(t *testing.T, appHostIsPrimary bool, factory DeploymentFactory) { require.NotNil(t, appTokenCookie, "no signed token cookie in response") require.Equal(t, appTokenCookie.Path, "/", "incorrect path on signed token cookie") - object, err := jose.ParseSigned(appTokenCookie.Value) + object, err := jose.ParseSigned(appTokenCookie.Value, []jose.SignatureAlgorithm{jwtutils.SigningAlgo}) require.NoError(t, err) require.Len(t, object.Signatures, 1) diff --git a/coderd/workspacebuilds.go b/coderd/workspacebuilds.go index 0a19f7dfdaf0a..7ee6398d1d857 100644 --- a/coderd/workspacebuilds.go +++ b/coderd/workspacebuilds.go @@ -655,8 +655,8 @@ func (api *API) workspaceBuildParameters(rw http.ResponseWriter, r *http.Request // @Produce json // @Tags Builds // @Param workspacebuild path string true "Workspace build ID" -// @Param before query int false "Before Unix timestamp" -// @Param after query int false "After Unix timestamp" +// @Param before query int false "Before log id" +// @Param after query int false "After log id" // @Param follow query bool false "Follow log stream" // @Success 200 {array} codersdk.ProvisionerJobLog // @Router /workspacebuilds/{workspacebuild}/logs [get] diff --git a/coderd/workspacestats/tracker_test.go b/coderd/workspacestats/tracker_test.go index e43e297fd2ddd..2803e5a5322b3 100644 --- a/coderd/workspacestats/tracker_test.go +++ b/coderd/workspacestats/tracker_test.go @@ -219,5 +219,5 @@ func TestTracker_MultipleInstances(t *testing.T) { } func TestMain(m *testing.M) { - goleak.VerifyTestMain(m) + goleak.VerifyTestMain(m, testutil.GoleakOptions...) } diff --git a/coderd/wsbuilder/wsbuilder.go b/coderd/wsbuilder/wsbuilder.go index 2123322356a3c..3d757f4c5590b 100644 --- a/coderd/wsbuilder/wsbuilder.go +++ b/coderd/wsbuilder/wsbuilder.go @@ -381,6 +381,10 @@ func (b *Builder) buildTx(authFunc func(action policy.Action, object rbac.Object code := http.StatusInternalServerError if rbac.IsUnauthorizedError(err) { code = http.StatusForbidden + } else if database.IsUniqueViolation(err) { + // Concurrent builds may result in duplicate + // workspace_builds_workspace_id_build_number_key. + code = http.StatusConflict } return BuildError{code, "insert workspace build", err} } diff --git a/codersdk/deployment.go b/codersdk/deployment.go index bfd359402525f..134ce573ca164 100644 --- a/codersdk/deployment.go +++ b/codersdk/deployment.go @@ -793,7 +793,7 @@ func DefaultSupportLinks(docsURL string) []LinkConfig { }, { Name: "Report a bug", - Target: "https://github.com/coder/coder/issues/new?labels=needs+grooming&body=" + buildInfo, + Target: "https://github.com/coder/coder/issues/new?labels=needs+triage&body=" + buildInfo, Icon: "bug", }, { @@ -2376,7 +2376,7 @@ when required by your organization's security policy.`, Flag: "agent-fallback-troubleshooting-url", Env: "CODER_AGENT_FALLBACK_TROUBLESHOOTING_URL", Hidden: true, - Default: "https://coder.com/docs/templates/troubleshooting", + Default: "https://coder.com/docs/admin/templates/troubleshooting", Value: &c.AgentFallbackTroubleshootingURL, YAML: "agentFallbackTroubleshootingURL", }, diff --git a/codersdk/idpsync.go b/codersdk/idpsync.go index 3a2e707ccb623..2cc1f51ee3011 100644 --- a/codersdk/idpsync.go +++ b/codersdk/idpsync.go @@ -5,6 +5,7 @@ import ( "encoding/json" "fmt" "net/http" + "net/url" "regexp" "github.com/google/uuid" @@ -163,3 +164,35 @@ func (c *Client) GetOrganizationAvailableIDPSyncFields(ctx context.Context, orgI var resp []string return resp, json.NewDecoder(res.Body).Decode(&resp) } + +func (c *Client) GetIDPSyncFieldValues(ctx context.Context, claimField string) ([]string, error) { + qv := url.Values{} + qv.Add("claimField", claimField) + res, err := c.Request(ctx, http.MethodGet, fmt.Sprintf("/api/v2/settings/idpsync/field-values?%s", qv.Encode()), nil) + if err != nil { + return nil, xerrors.Errorf("make request: %w", err) + } + defer res.Body.Close() + + if res.StatusCode != http.StatusOK { + return nil, ReadBodyAsError(res) + } + var resp []string + return resp, json.NewDecoder(res.Body).Decode(&resp) +} + +func (c *Client) GetOrganizationIDPSyncFieldValues(ctx context.Context, orgID string, claimField string) ([]string, error) { + qv := url.Values{} + qv.Add("claimField", claimField) + res, err := c.Request(ctx, http.MethodGet, fmt.Sprintf("/api/v2/organizations/%s/settings/idpsync/field-values?%s", orgID, qv.Encode()), nil) + if err != nil { + return nil, xerrors.Errorf("make request: %w", err) + } + defer res.Body.Close() + + if res.StatusCode != http.StatusOK { + return nil, ReadBodyAsError(res) + } + var resp []string + return resp, json.NewDecoder(res.Body).Decode(&resp) +} diff --git a/codersdk/workspaceapps.go b/codersdk/workspaceapps.go index e2ef9f2695419..3b4528087800c 100644 --- a/codersdk/workspaceapps.go +++ b/codersdk/workspaceapps.go @@ -34,6 +34,20 @@ var MapWorkspaceAppSharingLevels = map[WorkspaceAppSharingLevel]struct{}{ WorkspaceAppSharingLevelPublic: {}, } +type WorkspaceAppOpenIn string + +const ( + WorkspaceAppOpenInSlimWindow WorkspaceAppOpenIn = "slim-window" + WorkspaceAppOpenInWindow WorkspaceAppOpenIn = "window" + WorkspaceAppOpenInTab WorkspaceAppOpenIn = "tab" +) + +var MapWorkspaceAppOpenIns = map[WorkspaceAppOpenIn]struct{}{ + WorkspaceAppOpenInSlimWindow: {}, + WorkspaceAppOpenInWindow: {}, + WorkspaceAppOpenInTab: {}, +} + type WorkspaceApp struct { ID uuid.UUID `json:"id" format:"uuid"` // URL is the address being proxied to inside the workspace. @@ -62,6 +76,7 @@ type WorkspaceApp struct { Healthcheck Healthcheck `json:"healthcheck"` Health WorkspaceAppHealth `json:"health"` Hidden bool `json:"hidden"` + OpenIn WorkspaceAppOpenIn `json:"open_in"` } type Healthcheck struct { diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 4ec589f3356bb..22f169c556b9f 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -332,7 +332,7 @@ Breaking changes can be triggered in two ways: ### Security > If you find a vulnerability, **DO NOT FILE AN ISSUE**. Instead, send an email -> to security@coder.com. +> to . The [`security`](https://github.com/coder/coder/issues?q=sort%3Aupdated-desc+label%3Asecurity) diff --git a/docs/admin/external-auth.md b/docs/admin/external-auth.md index d859467aa6d7a..ee6510d751a44 100644 --- a/docs/admin/external-auth.md +++ b/docs/admin/external-auth.md @@ -1,88 +1,98 @@ # External Authentication +Coder supports external authentication via OAuth2.0. This allows enabling any OAuth provider as well as integrations with Git providers, +such as GitHub, GitLab, and Bitbucket. + +External authentication can also be used to integrate with external services +like JFrog Artifactory and others. + To add an external authentication provider, you'll need to create an OAuth -application. The following providers are supported: +application. The following providers have been tested and work with Coder: -- [GitHub](#github) -- [GitLab](https://docs.gitlab.com/ee/integration/oauth_provider.html) -- [BitBucket](https://support.atlassian.com/bitbucket-cloud/docs/use-oauth-on-bitbucket-cloud/) - [Azure DevOps](https://learn.microsoft.com/en-us/azure/devops/integrate/get-started/authentication/oauth?view=azure-devops) - [Azure DevOps (via Entra ID)](https://learn.microsoft.com/en-us/entra/architecture/auth-oauth2) +- [BitBucket](https://support.atlassian.com/bitbucket-cloud/docs/use-oauth-on-bitbucket-cloud/) +- [GitHub](#github) +- [GitLab](https://docs.gitlab.com/ee/integration/oauth_provider.html) + +If you have experience with a provider that is not listed here, please +[file an issue](https://github.com/coder/internal/issues/new?title=request%28docs%29%3A+external-auth+-+request+title+here%0D%0A&labels=["customer-feedback","docs"]&body=doc%3A+%5Bexternal-auth%5D%28https%3A%2F%2Fcoder.com%2Fdocs%2Fadmin%2Fexternal-auth%29%0D%0A%0D%0Aplease+enter+your+request+here%0D%0A) -The next step is to configure the Coder server to use the OAuth application by -setting the following environment variables: +## Configuration + +After you create an OAuth application, set environment variables to configure the Coder server to use it: ```env CODER_EXTERNAL_AUTH_0_ID="" CODER_EXTERNAL_AUTH_0_TYPE= -CODER_EXTERNAL_AUTH_0_CLIENT_ID=xxxxxx -CODER_EXTERNAL_AUTH_0_CLIENT_SECRET=xxxxxxx +CODER_EXTERNAL_AUTH_0_CLIENT_ID= +CODER_EXTERNAL_AUTH_0_CLIENT_SECRET= -# Optionally, configure a custom display name and icon +# Optionally, configure a custom display name and icon: CODER_EXTERNAL_AUTH_0_DISPLAY_NAME="Google Calendar" CODER_EXTERNAL_AUTH_0_DISPLAY_ICON="https://mycustomicon.com/google.svg" ``` The `CODER_EXTERNAL_AUTH_0_ID` environment variable is used for internal -reference. Therefore, it can be set arbitrarily (e.g., `primary-github` for your -GitHub provider). +reference. Set it with a value that helps you identify it. For example, you can use `CODER_EXTERNAL_AUTH_0_ID="primary-github"` for your +GitHub provider. -## GitHub +Add the following code to any template to add a button to the workspace setup page which will allow you to authenticate with your provider: -> If you don't require fine-grained access control, it's easier to configure a -> GitHub OAuth app! +```tf +data "coder_external_auth" "" { + id = "" +} -1. [Create a GitHub App](https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/registering-a-github-app) +# GitHub Example (CODER_EXTERNAL_AUTH_0_ID="primary-github") +# makes a GitHub authentication token available at data.coder_external_auth.github.access_token +data "coder_external_auth" "github" { + id = "primary-github" +} - - Set the callback URL to - `https://coder.example.com/external-auth/USER_DEFINED_ID/callback`. - - Deactivate Webhooks. - - Enable fine-grained access to specific repositories or a subset of - permissions for security. +``` - ![Register GitHub App](../images/admin/github-app-register.png) +Inside your Terraform code, you now have access to authentication variables. Reference the documentation for your chosen provider for more information on how to supply it with a token. -2. Adjust the GitHub App permissions. You can use more or less permissions than - are listed here, this is merely a suggestion that allows users to clone - repositories: +### Workspace CLI - ![Adjust GitHub App Permissions](../images/admin/github-app-permissions.png) +Use [`external-auth`](../reference/cli/external-auth.md) in the Coder CLI to access a token within the workspace: - | Name | Permission | Description | - | ------------- | ------------ | ------------------------------------------------------ | - | Contents | Read & Write | Grants access to code and commit statuses. | - | Pull requests | Read & Write | Grants access to create and update pull requests. | - | Workflows | Read & Write | Grants access to update files in `.github/workflows/`. | - | Metadata | Read-only | Grants access to metadata written by GitHub Apps. | - | Members | Read-only | Grants access to organization members and teams. | +```shell +coder external-auth access-token +``` -3. Install the App for your organization. You may select a subset of - repositories to grant access to. +## Git-provider specific env variables - ![Install GitHub App](../images/admin/github-app-install.png) +### Azure DevOps + +Azure DevOps requires the following environment variables: ```env -CODER_EXTERNAL_AUTH_0_ID="USER_DEFINED_ID" -CODER_EXTERNAL_AUTH_0_TYPE=github +CODER_EXTERNAL_AUTH_0_ID="primary-azure-devops" +CODER_EXTERNAL_AUTH_0_TYPE=azure-devops CODER_EXTERNAL_AUTH_0_CLIENT_ID=xxxxxx +# Ensure this value is your "Client Secret", not "App Secret" CODER_EXTERNAL_AUTH_0_CLIENT_SECRET=xxxxxxx +CODER_EXTERNAL_AUTH_0_AUTH_URL="https://app.vssps.visualstudio.com/oauth2/authorize" +CODER_EXTERNAL_AUTH_0_TOKEN_URL="https://app.vssps.visualstudio.com/oauth2/token" ``` -## GitHub Enterprise +### Azure DevOps (via Entra ID) -GitHub Enterprise requires the following environment variables: +Azure DevOps (via Entra ID) requires the following environment variables: ```env -CODER_EXTERNAL_AUTH_0_ID="primary-github" -CODER_EXTERNAL_AUTH_0_TYPE=github +CODER_EXTERNAL_AUTH_0_ID="primary-azure-devops" +CODER_EXTERNAL_AUTH_0_TYPE=azure-devops-entra CODER_EXTERNAL_AUTH_0_CLIENT_ID=xxxxxx CODER_EXTERNAL_AUTH_0_CLIENT_SECRET=xxxxxxx -CODER_EXTERNAL_AUTH_0_VALIDATE_URL="https://github.example.com/api/v3/user" -CODER_EXTERNAL_AUTH_0_AUTH_URL="https://github.example.com/login/oauth/authorize" -CODER_EXTERNAL_AUTH_0_TOKEN_URL="https://github.example.com/login/oauth/access_token" +CODER_EXTERNAL_AUTH_0_AUTH_URL="https://login.microsoftonline.com//oauth2/authorize" ``` -## Bitbucket Server +> Note: Your app registration in Entra ID requires the `vso.code_write` scope + +### Bitbucket Server Bitbucket Server requires the following environment variables: @@ -94,35 +104,50 @@ CODER_EXTERNAL_AUTH_0_CLIENT_SECRET=xxx CODER_EXTERNAL_AUTH_0_AUTH_URL=https://bitbucket.domain.com/rest/oauth2/latest/authorize ``` -## Azure DevOps +### Gitea -Azure DevOps requires the following environment variables: +```env +CODER_EXTERNAL_AUTH_0_ID="gitea" +CODER_EXTERNAL_AUTH_0_TYPE=gitea +CODER_EXTERNAL_AUTH_0_CLIENT_ID=xxxxxxx +CODER_EXTERNAL_AUTH_0_CLIENT_SECRET=xxxxxxx +# If self managed, set the Auth URL to your Gitea instance +CODER_EXTERNAL_AUTH_0_AUTH_URL="https://gitea.com/login/oauth/authorize" +``` + +The Redirect URI for Gitea should be +`https://coder.company.org/external-auth/gitea/callback`. + +### GitHub + +
+ +If you don't require fine-grained access control, it's easier to [configure a GitHub OAuth app](#configure-a-github-oauth-app). + +
```env -CODER_EXTERNAL_AUTH_0_ID="primary-azure-devops" -CODER_EXTERNAL_AUTH_0_TYPE=azure-devops +CODER_EXTERNAL_AUTH_0_ID="USER_DEFINED_ID" +CODER_EXTERNAL_AUTH_0_TYPE=github CODER_EXTERNAL_AUTH_0_CLIENT_ID=xxxxxx -# Ensure this value is your "Client Secret", not "App Secret" CODER_EXTERNAL_AUTH_0_CLIENT_SECRET=xxxxxxx -CODER_EXTERNAL_AUTH_0_AUTH_URL="https://app.vssps.visualstudio.com/oauth2/authorize" -CODER_EXTERNAL_AUTH_0_TOKEN_URL="https://app.vssps.visualstudio.com/oauth2/token" ``` -## Azure DevOps (via Entra ID) +### GitHub Enterprise -Azure DevOps (via Entra ID) requires the following environment variables: +GitHub Enterprise requires the following environment variables: ```env -CODER_EXTERNAL_AUTH_0_ID="primary-azure-devops" -CODER_EXTERNAL_AUTH_0_TYPE=azure-devops-entra +CODER_EXTERNAL_AUTH_0_ID="primary-github" +CODER_EXTERNAL_AUTH_0_TYPE=github CODER_EXTERNAL_AUTH_0_CLIENT_ID=xxxxxx CODER_EXTERNAL_AUTH_0_CLIENT_SECRET=xxxxxxx -CODER_EXTERNAL_AUTH_0_AUTH_URL="https://login.microsoftonline.com//oauth2/authorize" +CODER_EXTERNAL_AUTH_0_VALIDATE_URL="https://github.example.com/api/v3/user" +CODER_EXTERNAL_AUTH_0_AUTH_URL="https://github.example.com/login/oauth/authorize" +CODER_EXTERNAL_AUTH_0_TOKEN_URL="https://github.example.com/login/oauth/access_token" ``` -> Note: Your app registration in Entra ID requires the `vso.code_write` scope - -## GitLab self-managed +### GitLab self-managed GitLab self-managed requires the following environment variables: @@ -138,21 +163,11 @@ CODER_EXTERNAL_AUTH_0_TOKEN_URL="https://gitlab.company.org/oauth/token" CODER_EXTERNAL_AUTH_0_REGEX=gitlab\.company\.org ``` -## Gitea +### JFrog Artifactory -```env -CODER_EXTERNAL_AUTH_0_ID="gitea" -CODER_EXTERNAL_AUTH_0_TYPE=gitea -CODER_EXTERNAL_AUTH_0_CLIENT_ID=xxxxxxx -CODER_EXTERNAL_AUTH_0_CLIENT_SECRET=xxxxxxx -# If self managed, set the Auth URL to your Gitea instance -CODER_EXTERNAL_AUTH_0_AUTH_URL="https://gitea.com/login/oauth/authorize" -``` +Visit the [JFrog Artifactory](../admin/integrations/jfrog-artifactory.md) guide for instructions on how to set up for JFrog Artifactory. -The Redirect URI for Gitea should be -https://coder.company.org/external-auth/gitea/callback - -## Self-managed git providers +## Self-managed Git providers Custom authentication and token URLs should be used for self-managed Git provider deployments. @@ -166,11 +181,6 @@ CODER_EXTERNAL_AUTH_0_REGEX=github\.company\.org > Note: The `REGEX` variable must be set if using a custom git domain. -## JFrog Artifactory - -See [this](../admin/integrations/jfrog-artifactory.md) guide on instructions on -how to set up for JFrog Artifactory. - ## Custom scopes Optionally, you can request custom scopes: @@ -179,6 +189,39 @@ Optionally, you can request custom scopes: CODER_EXTERNAL_AUTH_0_SCOPES="repo:read repo:write write:gpg_key" ``` +## OAuth provider + +### Configure a GitHub OAuth app + +1. [Create a GitHub App](https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/registering-a-github-app) + + - Set the callback URL to + `https://coder.example.com/external-auth/USER_DEFINED_ID/callback`. + - Deactivate Webhooks. + - Enable fine-grained access to specific repositories or a subset of + permissions for security. + + ![Register GitHub App](../images/admin/github-app-register.png) + +1. Adjust the GitHub app permissions. You can use more or fewer permissions than + are listed here, this example allows users to clone + repositories: + + ![Adjust GitHub App Permissions](../images/admin/github-app-permissions.png) + + | Name | Permission | Description | + |---------------|--------------|--------------------------------------------------------| + | Contents | Read & Write | Grants access to code and commit statuses. | + | Pull requests | Read & Write | Grants access to create and update pull requests. | + | Workflows | Read & Write | Grants access to update files in `.github/workflows/`. | + | Metadata | Read-only | Grants access to metadata written by GitHub Apps. | + | Members | Read-only | Grants access to organization members and teams. | + +1. Install the App for your organization. You may select a subset of + repositories to grant access to. + + ![Install GitHub App](../images/admin/github-app-install.png) + ## Multiple External Providers
@@ -190,6 +233,16 @@ Multiple providers is an Enterprise and Premium feature. Below is an example configuration with multiple providers: +
+ +**Note:** To support regex matching for paths like `github\.com/org`, add the following `git config` line to the [Coder agent startup script](https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent#startup_script): + +```shell +git config --global credential.useHttpPath true +``` + +
+ ```env # Provider 1) github.com CODER_EXTERNAL_AUTH_0_ID=primary-github @@ -208,11 +261,3 @@ CODER_EXTERNAL_AUTH_1_AUTH_URL="https://github.example.com/login/oauth/authorize CODER_EXTERNAL_AUTH_1_TOKEN_URL="https://github.example.com/login/oauth/access_token" CODER_EXTERNAL_AUTH_1_VALIDATE_URL="https://github.example.com/api/v3/user" ``` - -To support regex matching for paths (e.g. `github\.com/org`), you'll need to add -this to the -[Coder agent startup script](https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent#startup_script): - -```shell -git config --global credential.useHttpPath true -``` diff --git a/docs/admin/index.md b/docs/admin/index.md index a1552bcf22b9c..7dcdbc3ce91df 100644 --- a/docs/admin/index.md +++ b/docs/admin/index.md @@ -17,7 +17,7 @@ For any information not strictly contained in these sections, check out our ## What is an image, template, dev container, or workspace -**Image** +### Image - A [base image](./templates/managing-templates/image-management.md) contains OS-level packages and utilities that the Coder workspace is built on. It can @@ -26,28 +26,28 @@ For any information not strictly contained in these sections, check out our defined in each template. - Managed by: Externally to Coder. -**Template** +### Template - [Templates](./templates/index.md) include infrastructure-level dependencies for the workspace. For example, a template can include Kubernetes PersistentVolumeClaims, Docker containers, or EC2 VMs. - Managed by: Template administrators from within the Coder deployment. -**Startup scripts** +### Startup scripts - Agent startup scripts apply to all users of a template. This is an intentionally flexible area that template authors have at their disposal to manage the "last mile" of workspace creation. - Managed by: Coder template administrators. -**Workspace** +### Workspace - A [workspace](../user-guides/workspace-management.md) is the environment that a developer works in. Developers on a team each work from their own workspace and can use [multiple IDEs](../user-guides/workspace-access/index.md). - Managed by: Developers -**Development containers (dev containers)** +### Development containers (dev containers) - A [Development Container](./templates/managing-templates/devcontainers/index.md) @@ -57,7 +57,7 @@ For any information not strictly contained in these sections, check out our will be built on-demand. - Managed by: Dev Teams -**Dotfiles / personalization** +### Dotfiles / personalization - Users may have their own specific preferences relating to shell prompt, custom keybindings, color schemes, and more. Users can leverage Coder's diff --git a/docs/admin/infrastructure/scale-testing.md b/docs/admin/infrastructure/scale-testing.md index 09d6fdc837a91..37a79f5d6f742 100644 --- a/docs/admin/infrastructure/scale-testing.md +++ b/docs/admin/infrastructure/scale-testing.md @@ -40,12 +40,12 @@ Our scale tests include the following stages: The scale tests runner can distribute the workload to overlap single scenarios based on the workflow configuration: -| | T0 | T1 | T2 | T3 | T4 | T5 | T6 | -| -------------------- | --- | --- | --- | --- | --- | --- | --- | -| SSH connections | X | X | X | X | | | | -| Web Terminal (PTY) | | X | X | X | X | | | -| Workspace apps | | | X | X | X | X | | -| Dashboard (headless) | | | | X | X | X | X | +| | T0 | T1 | T2 | T3 | T4 | T5 | T6 | +|----------------------|----|----|----|----|----|----|----| +| SSH connections | X | X | X | X | | | | +| Web Terminal (PTY) | | X | X | X | X | | | +| Workspace apps | | | X | X | X | X | | +| Dashboard (headless) | | | | X | X | X | X | This pattern closely reflects how our customers naturally use the system. SSH connections are heavily utilized because they're the primary communication @@ -137,7 +137,7 @@ When determining scaling requirements, consider the following factors: connections: For a very high number of proxied connections, more memory is required. -**HTTP API latency** +#### HTTP API latency For a reliable Coder deployment dealing with medium to high loads, it's important that API calls for workspace/template queries and workspace build @@ -152,7 +152,7 @@ between users and the load balancer. Fortunately, the latency can be improved with a deployment of Coder [workspace proxies](../networking/workspace-proxies.md). -**Node Autoscaling** +#### Node Autoscaling We recommend disabling the autoscaling for `coderd` nodes. Autoscaling can cause interruptions for user connections, see @@ -186,7 +186,7 @@ When determining scaling requirements, consider the following factors: provisioners are free/available, the more concurrent workspace builds can be performed. -**Node Autoscaling** +#### Node Autoscaling Autoscaling provisioners is not an easy problem to solve unless it can be predicted when a number of concurrent workspace builds increases. @@ -219,7 +219,7 @@ When determining scaling requirements, consider the following factors: running Coder agent and occasional CPU and memory bursts for building projects. -**Node Autoscaling** +#### Node Autoscaling Workspace nodes can be set to operate in autoscaling mode to mitigate the risk of prolonged high resource utilization. diff --git a/docs/admin/infrastructure/scale-utility.md b/docs/admin/infrastructure/scale-utility.md index d5835f0b27706..b3094c49fbca4 100644 --- a/docs/admin/infrastructure/scale-utility.md +++ b/docs/admin/infrastructure/scale-utility.md @@ -17,7 +17,7 @@ Learn more about [Coder’s architecture](./architecture.md) and our > hardware sizing recommendations. | Environment | Coder CPU | Coder RAM | Coder Replicas | Database | Users | Concurrent builds | Concurrent connections (Terminal/SSH) | Coder Version | Last tested | -| ---------------- | --------- | --------- | -------------- | ----------------- | ----- | ----------------- | ------------------------------------- | ------------- | ------------ | +|------------------|-----------|-----------|----------------|-------------------|-------|-------------------|---------------------------------------|---------------|--------------| | Kubernetes (GKE) | 3 cores | 12 GB | 1 | db-f1-micro | 200 | 3 | 200 simulated | `v0.24.1` | Jun 26, 2023 | | Kubernetes (GKE) | 4 cores | 8 GB | 1 | db-custom-1-3840 | 1500 | 20 | 1,500 simulated | `v0.24.1` | Jun 27, 2023 | | Kubernetes (GKE) | 2 cores | 4 GB | 1 | db-custom-1-3840 | 500 | 20 | 500 simulated | `v0.27.2` | Jul 27, 2023 | @@ -48,14 +48,14 @@ specified template and extra parameters. ```shell coder exp scaletest create-workspaces \ - --retry 5 \ - --count "${SCALETEST_PARAM_NUM_WORKSPACES}" \ - --template "${SCALETEST_PARAM_TEMPLATE}" \ - --concurrency "${SCALETEST_PARAM_CREATE_CONCURRENCY}" \ - --timeout 5h \ - --job-timeout 5h \ - --no-cleanup \ - --output json:"${SCALETEST_RESULTS_DIR}/create-workspaces.json" + --retry 5 \ + --count "${SCALETEST_PARAM_NUM_WORKSPACES}" \ + --template "${SCALETEST_PARAM_TEMPLATE}" \ + --concurrency "${SCALETEST_PARAM_CREATE_CONCURRENCY}" \ + --timeout 5h \ + --job-timeout 5h \ + --no-cleanup \ + --output json:"${SCALETEST_RESULTS_DIR}/create-workspaces.json" # Run `coder exp scaletest create-workspaces --help` for all usage ``` @@ -79,14 +79,14 @@ Terminal against those workspaces. ```shell # Produce load at about 1000MB/s (25MB/40ms). coder exp scaletest workspace-traffic \ - --template "${SCALETEST_PARAM_GREEDY_AGENT_TEMPLATE}" \ - --bytes-per-tick $((1024 * 1024 * 25)) \ - --tick-interval 40ms \ - --timeout "$((delay))s" \ - --job-timeout "$((delay))s" \ - --scaletest-prometheus-address 0.0.0.0:21113 \ - --target-workspaces "0:100" \ - --trace=false \ + --template "${SCALETEST_PARAM_GREEDY_AGENT_TEMPLATE}" \ + --bytes-per-tick $((1024 * 1024 * 25)) \ + --tick-interval 40ms \ + --timeout "$((delay))s" \ + --job-timeout "$((delay))s" \ + --scaletest-prometheus-address 0.0.0.0:21113 \ + --target-workspaces "0:100" \ + --trace=false \ --output json:"${SCALETEST_RESULTS_DIR}/traffic-${type}-greedy-agent.json" ``` @@ -114,8 +114,8 @@ wish to clean up all workspaces, you can run the following command: ```shell coder exp scaletest cleanup \ - --cleanup-job-timeout 2h \ - --cleanup-timeout 15min + --cleanup-job-timeout 2h \ + --cleanup-timeout 15min ``` This will delete all workspaces and users with the prefix `scaletest-`. @@ -168,7 +168,7 @@ that operators can deploy depending on the traffic projections. There are a few cluster options available: | Workspace size | vCPU | Memory | Persisted storage | Details | -| -------------- | ---- | ------ | ----------------- | ----------------------------------------------------- | +|----------------|------|--------|-------------------|-------------------------------------------------------| | minimal | 1 | 2 Gi | None | | | small | 1 | 1 Gi | None | | | medium | 2 | 2 Gi | None | Medium-sized cluster offers the greedy agent variant. | diff --git a/docs/admin/infrastructure/validated-architectures/1k-users.md b/docs/admin/infrastructure/validated-architectures/1k-users.md index 158eb10392e79..7828a3d339de8 100644 --- a/docs/admin/infrastructure/validated-architectures/1k-users.md +++ b/docs/admin/infrastructure/validated-architectures/1k-users.md @@ -13,7 +13,7 @@ tech startups, educational units, or small to mid-sized enterprises. ### Coderd nodes | Users | Node capacity | Replicas | GCP | AWS | Azure | -| ----------- | ------------------- | ------------------- | --------------- | ---------- | ----------------- | +|-------------|---------------------|---------------------|-----------------|------------|-------------------| | Up to 1,000 | 2 vCPU, 8 GB memory | 1-2 / 1 coderd each | `n1-standard-2` | `t3.large` | `Standard_D2s_v3` | **Footnotes**: @@ -24,7 +24,7 @@ tech startups, educational units, or small to mid-sized enterprises. ### Provisioner nodes | Users | Node capacity | Replicas | GCP | AWS | Azure | -| ----------- | -------------------- | ------------------------------ | ---------------- | ------------ | ----------------- | +|-------------|----------------------|--------------------------------|------------------|--------------|-------------------| | Up to 1,000 | 8 vCPU, 32 GB memory | 2 nodes / 30 provisioners each | `t2d-standard-8` | `t3.2xlarge` | `Standard_D8s_v3` | **Footnotes**: @@ -34,7 +34,7 @@ tech startups, educational units, or small to mid-sized enterprises. ### Workspace nodes | Users | Node capacity | Replicas | GCP | AWS | Azure | -| ----------- | -------------------- | ----------------------- | ---------------- | ------------ | ----------------- | +|-------------|----------------------|-------------------------|------------------|--------------|-------------------| | Up to 1,000 | 8 vCPU, 32 GB memory | 64 / 16 workspaces each | `t2d-standard-8` | `t3.2xlarge` | `Standard_D8s_v3` | **Footnotes**: @@ -47,5 +47,5 @@ tech startups, educational units, or small to mid-sized enterprises. ### Database nodes | Users | Node capacity | Replicas | Storage | GCP | AWS | Azure | -| ----------- | ------------------- | -------- | ------- | ------------------ | ------------- | ----------------- | +|-------------|---------------------|----------|---------|--------------------|---------------|-------------------| | Up to 1,000 | 2 vCPU, 8 GB memory | 1 | 512 GB | `db-custom-2-7680` | `db.t3.large` | `Standard_D2s_v3` | diff --git a/docs/admin/infrastructure/validated-architectures/2k-users.md b/docs/admin/infrastructure/validated-architectures/2k-users.md index 04ff5bf4ec19a..8c367c52dd914 100644 --- a/docs/admin/infrastructure/validated-architectures/2k-users.md +++ b/docs/admin/infrastructure/validated-architectures/2k-users.md @@ -18,13 +18,13 @@ deployment reliability under load. ### Coderd nodes | Users | Node capacity | Replicas | GCP | AWS | Azure | -| ----------- | -------------------- | ----------------------- | --------------- | ----------- | ----------------- | +|-------------|----------------------|-------------------------|-----------------|-------------|-------------------| | Up to 2,000 | 4 vCPU, 16 GB memory | 2 nodes / 1 coderd each | `n1-standard-4` | `t3.xlarge` | `Standard_D4s_v3` | ### Provisioner nodes | Users | Node capacity | Replicas | GCP | AWS | Azure | -| ----------- | -------------------- | ------------------------------ | ---------------- | ------------ | ----------------- | +|-------------|----------------------|--------------------------------|------------------|--------------|-------------------| | Up to 2,000 | 8 vCPU, 32 GB memory | 4 nodes / 30 provisioners each | `t2d-standard-8` | `t3.2xlarge` | `Standard_D8s_v3` | **Footnotes**: @@ -37,7 +37,7 @@ deployment reliability under load. ### Workspace nodes | Users | Node capacity | Replicas | GCP | AWS | Azure | -| ----------- | -------------------- | ------------------------ | ---------------- | ------------ | ----------------- | +|-------------|----------------------|--------------------------|------------------|--------------|-------------------| | Up to 2,000 | 8 vCPU, 32 GB memory | 128 / 16 workspaces each | `t2d-standard-8` | `t3.2xlarge` | `Standard_D8s_v3` | **Footnotes**: @@ -50,7 +50,7 @@ deployment reliability under load. ### Database nodes | Users | Node capacity | Replicas | Storage | GCP | AWS | Azure | -| ----------- | -------------------- | -------- | ------- | ------------------- | -------------- | ----------------- | +|-------------|----------------------|----------|---------|---------------------|----------------|-------------------| | Up to 2,000 | 4 vCPU, 16 GB memory | 1 | 1 TB | `db-custom-4-15360` | `db.t3.xlarge` | `Standard_D4s_v3` | **Footnotes**: diff --git a/docs/admin/infrastructure/validated-architectures/3k-users.md b/docs/admin/infrastructure/validated-architectures/3k-users.md index 093ec21c5c52c..3d251427cad75 100644 --- a/docs/admin/infrastructure/validated-architectures/3k-users.md +++ b/docs/admin/infrastructure/validated-architectures/3k-users.md @@ -19,13 +19,13 @@ continuously improve the reliability and performance of the platform. ### Coderd nodes | Users | Node capacity | Replicas | GCP | AWS | Azure | -| ----------- | -------------------- | ----------------- | --------------- | ----------- | ----------------- | +|-------------|----------------------|-------------------|-----------------|-------------|-------------------| | Up to 3,000 | 8 vCPU, 32 GB memory | 4 / 1 coderd each | `n1-standard-4` | `t3.xlarge` | `Standard_D4s_v3` | ### Provisioner nodes | Users | Node capacity | Replicas | GCP | AWS | Azure | -| ----------- | -------------------- | ------------------------ | ---------------- | ------------ | ----------------- | +|-------------|----------------------|--------------------------|------------------|--------------|-------------------| | Up to 3,000 | 8 vCPU, 32 GB memory | 8 / 30 provisioners each | `t2d-standard-8` | `t3.2xlarge` | `Standard_D8s_v3` | **Footnotes**: @@ -39,7 +39,7 @@ continuously improve the reliability and performance of the platform. ### Workspace nodes | Users | Node capacity | Replicas | GCP | AWS | Azure | -| ----------- | -------------------- | ------------------------------ | ---------------- | ------------ | ----------------- | +|-------------|----------------------|--------------------------------|------------------|--------------|-------------------| | Up to 3,000 | 8 vCPU, 32 GB memory | 256 nodes / 12 workspaces each | `t2d-standard-8` | `t3.2xlarge` | `Standard_D8s_v3` | **Footnotes**: @@ -53,7 +53,7 @@ continuously improve the reliability and performance of the platform. ### Database nodes | Users | Node capacity | Replicas | Storage | GCP | AWS | Azure | -| ----------- | -------------------- | -------- | ------- | ------------------- | --------------- | ----------------- | +|-------------|----------------------|----------|---------|---------------------|-----------------|-------------------| | Up to 3,000 | 8 vCPU, 32 GB memory | 2 | 1.5 TB | `db-custom-8-30720` | `db.t3.2xlarge` | `Standard_D8s_v3` | **Footnotes**: diff --git a/docs/admin/infrastructure/validated-architectures/index.md b/docs/admin/infrastructure/validated-architectures/index.md index 530f7d62cb5d7..6b81291648e78 100644 --- a/docs/admin/infrastructure/validated-architectures/index.md +++ b/docs/admin/infrastructure/validated-architectures/index.md @@ -23,7 +23,7 @@ This guide targets the following personas. It assumes a basic understanding of cloud/on-premise computing, containerization, and the Coder platform. | Role | Description | -| ------------------------- | ------------------------------------------------------------------------------ | +|---------------------------|--------------------------------------------------------------------------------| | Platform Engineers | Responsible for deploying, operating the Coder deployment and infrastructure | | Enterprise Architects | Responsible for architecting Coder deployments to meet enterprise requirements | | Managed Service Providers | Entities that deploy and run Coder software as a service for customers | @@ -31,7 +31,7 @@ cloud/on-premise computing, containerization, and the Coder platform. ## CVA Guidance | CVA provides: | CVA does not provide: | -| ---------------------------------------------- | ---------------------------------------------------------------------------------------- | +|------------------------------------------------|------------------------------------------------------------------------------------------| | Single and multi-region K8s deployment options | Prescribing OS, or cloud vs. on-premise | | Reference architectures for up to 3,000 users | An approval of your architecture; the CVA solely provides recommendations and guidelines | | Best practices for building a Coder deployment | Recommendations for every possible deployment scenario | diff --git a/docs/admin/integrations/island.md b/docs/admin/integrations/island.md index 74cd449f4257f..d5159e9e28868 100644 --- a/docs/admin/integrations/island.md +++ b/docs/admin/integrations/island.md @@ -3,23 +3,22 @@ April 24, 2024 --- -[Island](https://www.island.io/) is an enterprise-grade browser, offering a -Chromium-based experience similar to popular web browsers like Chrome and Edge. -It includes built-in security features for corporate applications and data, -aiming to bridge the gap between consumer-focused browsers and the security -needs of the enterprise. +[Island](https://www.island.io/) is an enterprise-grade browser, offering a Chromium-based experience +similar to popular web browsers like Chrome and Edge. It includes built-in +security features for corporate applications and data, aiming to bridge the gap +between consumer-focused browsers and the security needs of the enterprise. -Coder natively integrates with Island's feature set, which include data loss -protection (DLP), application awareness, browser session recording, and single -sign-on (SSO). This guide intends to document these feature categories and how -they apply to your Coder deployment. +Coder natively integrates with Island's feature set, which include data +loss protection (DLP), application awareness, browser session recording, and +single sign-on (SSO). This guide intends to document these feature categories +and how they apply to your Coder deployment. ## General Configuration @@ -33,90 +32,85 @@ creating browser policies. ## Advanced Data Loss Protection -Integrate Island's advanced data loss prevention (DLP) capabilities with Coder's -cloud development environment (CDE), enabling you to control the “last mile” -between developers’ CDE and their local devices, ensuring that sensitive IP -remains in your centralized environment. +Integrate Island's advanced data loss prevention (DLP) capabilities with +Coder's cloud development environment (CDE), enabling you to control the +"last mile" between developers' CDE and their local devices, +ensuring that sensitive IP remains in your centralized environment. ### Block cut, copy, paste, printing, screen share -1. [Create a Data Sandbox Profile](https://documentation.island.io/docs/create-and-configure-a-data-sandbox-profile) +1. [Create a Data Sandbox Profile](https://documentation.island.io/docs/create-and-configure-a-data-sandbox-profile). 1. Configure the following actions to allow/block (based on your security - requirements): + requirements). -- Screenshot and Screen Share -- Printing -- Save Page -- Clipboard Limitations + - Screenshot and Screen Share + - Printing + - Save Page + - Clipboard Limitations -1. [Create a Policy Rule](https://documentation.island.io/docs/create-and-configure-a-policy-rule-general) - to apply the Data Sandbox Profile +1. [Create a Policy Rule](https://documentation.island.io/docs/create-and-configure-a-policy-rule-general) to apply the Data Sandbox Profile. -1. Define the Coder Application group as the Destination Object +1. Define the Coder Application group as the Destination Object. 1. Define the Data Sandbox Profile as the Action in the Last Mile Protection - section + section. ### Conditionally allow copy on Coder's CLI authentication page -1. [Create a URL Object](https://documentation.island.io/docs/create-and-configure-a-policy-rule-general) - with the following configuration: +1. [Create a URL Object](https://documentation.island.io/docs/create-and-configure-a-policy-rule-general) with the following configuration. -- **Include** -- **URL type**: Wildcard -- **URL address**: `coder.example.com/cli-auth` -- **Casing**: Insensitive + - **Include** + - **URL type**: Wildcard + - **URL address**: `coder.example.com/cli-auth` + - **Casing**: Insensitive -1. [Create a Data Sandbox Profile](https://documentation.island.io/docs/create-and-configure-a-data-sandbox-profile) +1. [Create a Data Sandbox Profile](https://documentation.island.io/docs/create-and-configure-a-data-sandbox-profile). -1. Configure action to allow copy/paste +1. Configure action to allow copy/paste. -1. [Create a Policy Rule](https://documentation.island.io/docs/create-and-configure-a-policy-rule-general) - to apply the Data Sandbox Profile +1. [Create a Policy Rule](https://documentation.island.io/docs/create-and-configure-a-policy-rule-general) to apply the Data Sandbox Profile. -1. Define the URL Object you created as the Destination Object +1. Define the URL Object you created as the Destination Object. 1. Define the Data Sandbox Profile as the Action in the Last Mile Protection - section + section. ### Prevent file upload/download from the browser -1. Create a Protection Profiles for both upload/download +1. Create a Protection Profiles for both upload/download. -- [Upload documentation](https://documentation.island.io/docs/create-and-configure-an-upload-protection-profile) -- [Download documentation](https://documentation.island.io/v1/docs/en/create-and-configure-a-download-protection-profile) + - [Upload documentation](https://documentation.island.io/docs/create-and-configure-an-upload-protection-profile) + - [Download documentation](https://documentation.island.io/v1/docs/en/create-and-configure-a-download-protection-profile) -1. [Create a Policy Rule](https://documentation.island.io/docs/create-and-configure-a-policy-rule-general) - to apply the Protection Profiles +1. [Create a Policy Rule](https://documentation.island.io/docs/create-and-configure-a-policy-rule-general) to apply the Protection Profiles. -1. Define the Coder Application group as the Destination Object +1. Define the Coder Application group as the Destination Object. 1. Define the applicable Protection Profile as the Action in the Data Protection - section + section. ### Scan files for sensitive data -1. [Create a Data Loss Prevention scanner](https://documentation.island.io/docs/create-a-data-loss-prevention-scanner) +1. [Create a Data Loss Prevention scanner](https://documentation.island.io/docs/create-a-data-loss-prevention-scanner). -1. [Create a Policy Rule](https://documentation.island.io/docs/create-and-configure-a-policy-rule-general) - to apply the DLP Scanner +1. [Create a Policy Rule](https://documentation.island.io/docs/create-and-configure-a-policy-rule-general) to apply the DLP Scanner. -1. Define the Coder Application group as the Destination Object +1. Define the Coder Application group as the Destination Object. -1. Define the DLP Scanner as the Action in the Data Protection section +1. Define the DLP Scanner as the Action in the Data Protection section. ## Application Awareness and Boundaries Ensure that Coder is only accessed through the Island browser, guaranteeing that -your browser-level DLP policies are always enforced, and developers can’t +your browser-level DLP policies are always enforced, and developers can't sidestep such policies simply by using another browser. ### Configure browser enforcement, conditional access policies -1. Create a conditional access policy for your configured identity provider. +Create a conditional access policy for your configured identity provider. -> Note: the configured IdP must be the same for both Coder and Island +Note that the configured IdP must be the same for both Coder and Island. - [Azure Active Directory/Entra ID](https://documentation.island.io/docs/configure-browser-enforcement-for-island-with-azure-ad#create-and-apply-a-conditional-access-policy) - [Okta](https://documentation.island.io/docs/configure-browser-enforcement-for-island-with-okta) @@ -129,35 +123,34 @@ screenshots, mouse clicks, and keystrokes. ### Activity Logging Module -1. [Create an Activity Logging Profile](https://documentation.island.io/docs/create-and-configure-an-activity-logging-profile) +1. [Create an Activity Logging Profile](https://documentation.island.io/docs/create-and-configure-an-activity-logging-profile). Supported browser + events include: -Supported browser events include: + - Web Navigation + - File Download + - File Upload + - Clipboard/Drag & Drop + - Print + - Save As + - Screenshots + - Mouse Clicks + - Keystrokes -- Web Navigation -- File Download -- File Upload -- Clipboard/Drag & Drop -- Print -- Save As -- Screenshots -- Mouse Clicks -- Keystrokes +1. [Create a Policy Rule](https://documentation.island.io/docs/create-and-configure-a-policy-rule-general) to apply the Activity Logging Profile. -1. [Create a Policy Rule](https://documentation.island.io/docs/create-and-configure-a-policy-rule-general) - to apply the Activity Logging Profile - -1. Define the Coder Application group as the Destination Object +1. Define the Coder Application group as the Destination Object. 1. Define the Activity Logging Profile as the Action in the Security & - Visibility section + Visibility section. ## Identity-aware logins (SSO) -Integrate Island's identity management system with Coder's authentication -mechanisms to enable identity-aware logins. +Integrate Island's identity management system with Coder's +authentication mechanisms to enable identity-aware logins. ### Configure single sign-on (SSO) seamless authentication between Coder and Island Configure the same identity provider (IdP) for both your Island and Coder -deployment. Upon initial login to the Island browser, the user's session token -will automatically be passed to Coder and authenticate their Coder session. +deployment. Upon initial login to the Island browser, the user's session +token will automatically be passed to Coder and authenticate their Coder +session. diff --git a/docs/admin/integrations/jfrog-artifactory.md b/docs/admin/integrations/jfrog-artifactory.md index 89a8ac99cf52e..afc94d6158b94 100644 --- a/docs/admin/integrations/jfrog-artifactory.md +++ b/docs/admin/integrations/jfrog-artifactory.md @@ -3,7 +3,7 @@ January 24, 2024 @@ -31,145 +31,122 @@ by using our official Coder [modules](https://registry.coder.com). We publish two type of modules that automate the JFrog Artifactory and Coder integration. 1. [JFrog-OAuth](https://registry.coder.com/modules/jfrog-oauth) -2. [JFrog-Token](https://registry.coder.com/modules/jfrog-token) +1. [JFrog-Token](https://registry.coder.com/modules/jfrog-token) ### JFrog-OAuth This module is usable by JFrog self-hosted (on-premises) Artifactory as it -requires configuring a custom integration. This integration benefits from -Coder's [external-auth](https://coder.com/docs/admin/external-auth) feature and -allows each user to authenticate with Artifactory using an OAuth flow and issues -user-scoped tokens to each user. +requires configuring a custom integration. This integration benefits from Coder's [external-auth](../../admin/external-auth.md) feature allows each user to authenticate with Artifactory using an OAuth flow and issues user-scoped tokens to each user. To set this up, follow these steps: -1. Modify your Helm chart `values.yaml` for JFrog Artifactory to add, - -```yaml -artifactory: - enabled: true - frontend: - extraEnvironmentVariables: - - name: JF_FRONTEND_FEATURETOGGLER_ACCESSINTEGRATION - value: "true" - access: - accessConfig: - integrations-enabled: true - integration-templates: - - id: "1" - name: "CODER" - redirect-uri: "https://CODER_URL/external-auth/jfrog/callback" - scope: "applied-permissions/user" -``` - -> Note Replace `CODER_URL` with your Coder deployment URL, e.g., -> - -2. Create a new Application Integration by going to - and select the +1. Add the following to your Helm chart `values.yaml` for JFrog Artifactory. Replace `CODER_URL` with your JFrog Artifactory base URL: + + ```yaml + artifactory: + enabled: true + frontend: + extraEnvironmentVariables: + - name: JF_FRONTEND_FEATURETOGGLER_ACCESSINTEGRATION + value: "true" + access: + accessConfig: + integrations-enabled: true + integration-templates: + - id: "1" + name: "CODER" + redirect-uri: "https://CODER_URL/external-auth/jfrog/callback" + scope: "applied-permissions/user" + ``` + +1. Create a new Application Integration by going to + `https://JFROG_URL/ui/admin/configuration/integrations/new` and select the Application Type as the integration you created in step 1. -![JFrog Platform new integration](../../images/guides/artifactory-integration/jfrog-oauth-app.png) - -3. Add a new - [external authentication](https://coder.com/docs/admin/external-auth) to - Coder by setting these env variables, - -```env -# JFrog Artifactory External Auth -CODER_EXTERNAL_AUTH_1_ID="jfrog" -CODER_EXTERNAL_AUTH_1_TYPE="jfrog" -CODER_EXTERNAL_AUTH_1_CLIENT_ID="YYYYYYYYYYYYYYY" -CODER_EXTERNAL_AUTH_1_CLIENT_SECRET="XXXXXXXXXXXXXXXXXXX" -CODER_EXTERNAL_AUTH_1_DISPLAY_NAME="JFrog Artifactory" -CODER_EXTERNAL_AUTH_1_DISPLAY_ICON="/icon/jfrog.svg" -CODER_EXTERNAL_AUTH_1_AUTH_URL="https://JFROG_URL/ui/authorization" -CODER_EXTERNAL_AUTH_1_SCOPES="applied-permissions/user" -``` - -> Note Replace `JFROG_URL` with your JFrog Artifactory base URL, e.g., -> - -4. Create or edit a Coder template and use the - [JFrog-OAuth](https://registry.coder.com/modules/jfrog-oauth) module to - configure the integration. - -```tf -module "jfrog" { - source = "registry.coder.com/modules/jfrog-oauth/coder" - version = "1.0.0" - agent_id = coder_agent.example.id - jfrog_url = "https://jfrog.example.com" - configure_code_server = true # this depends on the code-server - username_field = "username" # If you are using GitHub to login to both Coder and Artifactory, use username_field = "username" - package_managers = { - "npm": "npm", - "go": "go", - "pypi": "pypi" - } -} -``` +1. Add a new [external authentication](../../admin/external-auth.md) to Coder by setting these + environment variables in a manner consistent with your Coder deployment. Replace `JFROG_URL` with your JFrog Artifactory base URL: + + ```env + # JFrog Artifactory External Auth + CODER_EXTERNAL_AUTH_1_ID="jfrog" + CODER_EXTERNAL_AUTH_1_TYPE="jfrog" + CODER_EXTERNAL_AUTH_1_CLIENT_ID="YYYYYYYYYYYYYYY" + CODER_EXTERNAL_AUTH_1_CLIENT_SECRET="XXXXXXXXXXXXXXXXXXX" + CODER_EXTERNAL_AUTH_1_DISPLAY_NAME="JFrog Artifactory" + CODER_EXTERNAL_AUTH_1_DISPLAY_ICON="/icon/jfrog.svg" + CODER_EXTERNAL_AUTH_1_AUTH_URL="https://JFROG_URL/ui/authorization" + CODER_EXTERNAL_AUTH_1_SCOPES="applied-permissions/user" + ``` + +1. Create or edit a Coder template and use the [JFrog-OAuth](https://registry.coder.com/modules/jfrog-oauth) module to configure the integration: + + ```tf + module "jfrog" { + source = "registry.coder.com/modules/jfrog-oauth/coder" + version = "1.0.0" + agent_id = coder_agent.example.id + jfrog_url = "https://jfrog.example.com" + configure_code_server = true # this depends on the code-server + username_field = "username" # If you are using GitHub to login to both Coder and Artifactory, use username_field = "username" + package_managers = { + "npm": "npm", + "go": "go", + "pypi": "pypi" + } + } + ``` ### JFrog-Token -This module makes use of the -[Artifactory terraform provider](https://registry.terraform.io/providers/jfrog/artifactory/latest/docs) -and an admin-scoped token to create user-scoped tokens for each user by matching -their Coder email or username with Artifactory. This can be used for both SaaS -and self-hosted(on-premises) Artifactory instances. +This module makes use of the [Artifactory terraform +provider](https://registry.terraform.io/providers/jfrog/artifactory/latest/docs) and an admin-scoped token to create +user-scoped tokens for each user by matching their Coder email or username with +Artifactory. This can be used for both SaaS and self-hosted (on-premises) +Artifactory instances. To set this up, follow these steps: -1. Get a JFrog access token from your Artifactory instance. The token must be an - [admin token](https://registry.terraform.io/providers/jfrog/artifactory/latest/docs#access-token) - with scope `applied-permissions/admin`. -2. Create or edit a Coder template and use the - [JFrog-Token](https://registry.coder.com/modules/jfrog-token) module to - configure the integration and pass the admin token. It is recommended to - store the token in a sensitive terraform variable to prevent it from being - displayed in plain text in the terraform state. - -```tf -variable "artifactory_access_token" { - type = string - sensitive = true -} - -module "jfrog" { - source = "registry.coder.com/modules/jfrog-token/coder" - version = "1.0.0" - agent_id = coder_agent.example.id - jfrog_url = "https://example.jfrog.io" - configure_code_server = true # this depends on the code-server - artifactory_access_token = var.artifactory_access_token - package_managers = { - "npm": "npm", - "go": "go", - "pypi": "pypi" - } -} -``` - -
-The admin-level access token is used to provision user tokens and is never exposed to -developers or stored in workspaces. -
- -If you do not want to use the official modules, you can check example template -that uses Docker as the underlying compute -[here](https://github.com/coder/coder/tree/main/examples/jfrog/docker). The same -concepts apply to all compute types. +1. Get a JFrog access token from your Artifactory instance. The token must be an [admin token](https://registry.terraform.io/providers/jfrog/artifactory/latest/docs#access-token) with scope `applied-permissions/admin`. + +1. Create or edit a Coder template and use the [JFrog-Token](https://registry.coder.com/modules/jfrog-token) module to configure the integration and pass the admin token. It is recommended to store the token in a sensitive Terraform variable to prevent it from being displayed in plain text in the terraform state: + + ```tf + variable "artifactory_access_token" { + type = string + sensitive = true + } + + module "jfrog" { + source = "registry.coder.com/modules/jfrog-token/coder" + version = "1.0.0" + agent_id = coder_agent.example.id + jfrog_url = "https://example.jfrog.io" + configure_code_server = true # this depends on the code-server + artifactory_access_token = var.artifactory_access_token + package_managers = { + "npm": "npm", + "go": "go", + "pypi": "pypi" + } + } + ``` + +
+ + The admin-level access token is used to provision user tokens and is never exposed to developers or stored in workspaces. + +
+ +If you don't want to use the official modules, you can read through the [example template](https://github.com/coder/coder/tree/main/examples/jfrog/docker), which uses Docker as the underlying compute. The +same concepts apply to all compute types. ## Offline Deployments -See the -[offline deployments](../templates/extending-templates/modules.md#offline-installations) -section for instructions on how to use coder-modules in an offline environment -with Artifactory. +See the [offline deployments](../templates/extending-templates/modules.md#offline-installations) section for instructions on how to use Coder modules in an offline environment with Artifactory. + +## Next Steps -## More reading +- See the [full example Docker template](https://github.com/coder/coder/tree/main/examples/jfrog/docker). -- See the full example template - [here](https://github.com/coder/coder/tree/main/examples/jfrog/docker). - To serve extensions from your own VS Code Marketplace, check out [code-marketplace](https://github.com/coder/code-marketplace#artifactory-storage). diff --git a/docs/admin/integrations/jfrog-xray.md b/docs/admin/integrations/jfrog-xray.md index 933bf2e475edd..bb1b9db106611 100644 --- a/docs/admin/integrations/jfrog-xray.md +++ b/docs/admin/integrations/jfrog-xray.md @@ -3,68 +3,71 @@ March 17, 2024 --- -This guide will walk you through the process of adding -[JFrog Xray](https://jfrog.com/xray/) integration to Coder Kubernetes workspaces -using Coder's [JFrog Xray Integration](https://github.com/coder/coder-xray). +This guide describes the process of integrating [JFrog Xray](https://jfrog.com/xray/) to Coder Kubernetes-backed +workspaces using Coder's [JFrog Xray Integration](https://github.com/coder/coder-xray). ## Prerequisites - A self-hosted JFrog Platform instance. - Kubernetes workspaces running on Coder. -## Deploying the Coder - JFrog Xray Integration +## Deploy the **Coder - JFrog Xray** Integration -1. Create a JFrog Platform - [Access Token](https://jfrog.com/help/r/jfrog-platform-administration-documentation/access-tokens) - with a user that has the read - [permission](https://jfrog.com/help/r/jfrog-platform-administration-documentation/permissions) +1. Create a JFrog Platform [Access Token](https://jfrog.com/help/r/jfrog-platform-administration-documentation/access-tokens) with a user that has the `read` [permission](https://jfrog.com/help/r/jfrog-platform-administration-documentation/permissions) for the repositories you want to scan. -1. Create a Coder [token](../../reference/cli/tokens_create.md#tokens-create) - with a user that has the [`owner`](../users/index.md#roles) role. + +1. Create a Coder [token](../../reference/cli/tokens_create.md#tokens-create) with a user that has the [`owner`](../users#roles) role. + 1. Create Kubernetes secrets for the JFrog Xray and Coder tokens. ```bash - kubectl create secret generic coder-token --from-literal=coder-token='' - kubectl create secret generic jfrog-token --from-literal=user='' --from-literal=token='' + kubectl create secret generic coder-token \ + --from-literal=coder-token='' ``` -1. Deploy the Coder - JFrog Xray integration. + ```bash + kubectl create secret generic jfrog-token \ + --from-literal=user='' \ + --from-literal=token='' + ``` + +1. Deploy the **Coder - JFrog Xray** integration. ```bash helm repo add coder-xray https://helm.coder.com/coder-xray + ``` + ```bash helm upgrade --install coder-xray coder-xray/coder-xray \ - --namespace coder-xray \ - --create-namespace \ - --set namespace="" \ # Replace with your Coder workspaces namespace - --set coder.url="https://" \ - --set coder.secretName="coder-token" \ - --set artifactory.url="https://" \ - --set artifactory.secretName="jfrog-token" + --namespace coder-xray \ + --create-namespace \ + --set namespace="" \ + --set coder.url="https://" \ + --set coder.secretName="coder-token" \ + --set artifactory.url="https://" \ + --set artifactory.secretName="jfrog-token" ``` -### Updating the Coder template +
+ + To authenticate with the Artifactory registry, you may need to + create a [Docker config](https://jfrog.com/help/r/jfrog-artifactory-documentation/docker-advanced-topics) and use it in the + `imagePullSecrets` field of the Kubernetes Pod. See the [Defining ImagePullSecrets for Coder workspaces](../../tutorials/image-pull-secret.md) guide for more + information. -[`coder-xray`](https://github.com/coder/coder-xray) will scan all kubernetes -workspaces in the specified namespace. It depends on the `image` available in -Artifactory and indexed by Xray. To ensure that the images are available in -Artifactory, update the Coder template to use the Artifactory registry. +
-```tf -image = "//:" -``` +## Validate your installation -> **Note**: To authenticate with the Artifactory registry, you may need to -> create a -> [Docker config](https://jfrog.com/help/r/jfrog-artifactory-documentation/docker-advanced-topics) -> and use it in the `imagePullSecrets` field of the kubernetes pod. See this -> [guide](../../tutorials/image-pull-secret.md) for more information. +Once installed, configured workspaces will now have a banner appear on any +workspace with vulnerabilities reported by JFrog Xray. -![JFrog Xray Integration](../../images/guides/xray-integration/example.png) +JFrog Xray Integration diff --git a/docs/admin/integrations/prometheus.md b/docs/admin/integrations/prometheus.md index 059e19da126cc..d849f192aaa3d 100644 --- a/docs/admin/integrations/prometheus.md +++ b/docs/admin/integrations/prometheus.md @@ -3,9 +3,8 @@ Coder exposes many metrics which can be consumed by a Prometheus server, and give insight into the current state of a live Coder deployment. -If you don't have an Prometheus server installed, you can follow the Prometheus -[Getting started](https://prometheus.io/docs/prometheus/latest/getting_started/) -guide. +If you don't have a Prometheus server installed, you can follow the Prometheus +[Getting started](https://prometheus.io/docs/prometheus/latest/getting_started/) guide. ## Enable Prometheus metrics @@ -19,7 +18,7 @@ use either the environment variable `CODER_PROMETHEUS_ADDRESS` or the flag address. If `coder server --prometheus-enable` is started locally, you can preview the -metrics endpoint in your browser or by using curl: +metrics endpoint in your browser or with `curl`: ```console $ curl http://localhost:2112/ @@ -31,13 +30,12 @@ coderd_api_active_users_duration_hour 0 ### Kubernetes deployment -The Prometheus endpoint can be enabled in the -[Helm chart's](https://github.com/coder/coder/tree/main/helm) `values.yml` by -setting the environment variable `CODER_PROMETHEUS_ADDRESS` to `0.0.0.0:2112`. -The environment variable `CODER_PROMETHEUS_ENABLE` will be enabled -automatically. A Service Endpoint will not be exposed; if you need to expose the -Prometheus port on a Service, (for example, to use a `ServiceMonitor`), create a -separate headless service instead: +The Prometheus endpoint can be enabled in the [Helm chart's](https://github.com/coder/coder/tree/main/helm) +`values.yml` by setting the environment variable `CODER_PROMETHEUS_ADDRESS` to +`0.0.0.0:2112`. The environment variable `CODER_PROMETHEUS_ENABLE` will be +enabled automatically. A Service Endpoint will not be exposed; if you need to +expose the Prometheus port on a Service, (for example, to use a +`ServiceMonitor`), create a separate headless service instead. ```yaml apiVersion: v1 @@ -61,22 +59,23 @@ spec: ### Prometheus configuration To allow Prometheus to scrape the Coder metrics, you will need to create a -`scape_config` in your `prometheus.yml` file, or in the Prometheus Helm chart -values. Below is an example `scrape_config`: +`scrape_config` in your `prometheus.yml` file, or in the Prometheus Helm chart +values. The following is an example `scrape_config`. ```yaml scrape_configs: - job_name: "coder" scheme: "http" static_configs: - - targets: [":2112"] # replace with the the IP address of the Coder pod or server + # replace with the the IP address of the Coder pod or server + - targets: [":2112"] labels: apps: "coder" ``` To use the Kubernetes Prometheus operator to scrape metrics, you will need to -create a `ServiceMonitor` in your Coder deployment namespace. Below is an -example `ServiceMonitor`: +create a `ServiceMonitor` in your Coder deployment namespace. The following is +an example `ServiceMonitor`. ```yaml apiVersion: monitoring.coreos.com/v1 @@ -96,7 +95,7 @@ spec: ## Available metrics -`coderd_agentstats_*` metrics must first be enabled with the flag +You must first enable `coderd_agentstats_*` with the flag `--prometheus-collect-agent-stats`, or the environment variable `CODER_PROMETHEUS_COLLECT_AGENT_STATS` before they can be retrieved from the deployment. They will always be available from the agent. @@ -104,7 +103,7 @@ deployment. They will always be available from the agent. | Name | Type | Description | Labels | -| ------------------------------------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | +|---------------------------------------------------------------|-----------|----------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------| | `agent_scripts_executed_total` | counter | Total number of scripts executed by the Coder agent. Includes cron scheduled scripts. | `agent_name` `success` `template_name` `username` `workspace_name` | | `coderd_agents_apps` | gauge | Agent applications with statuses. | `agent_name` `app_name` `health` `username` `workspace_name` | | `coderd_agents_connection_latencies_seconds` | gauge | Agent connection latencies in seconds. | `agent_name` `derp_region` `preferred` `username` `workspace_name` | diff --git a/docs/admin/integrations/vault.md b/docs/admin/integrations/vault.md index 4a75008f221cd..4894a7ebda0a1 100644 --- a/docs/admin/integrations/vault.md +++ b/docs/admin/integrations/vault.md @@ -3,29 +3,27 @@ August 05, 2024 --- -This guide will walk you through the process of adding -[HashiCorp Vault](https://www.vaultproject.io/) integration to Coder workspaces. +This guide describes the process of integrating [HashiCorp Vault](https://www.vaultproject.io/) into Coder workspaces. Coder makes it easy to integrate HashiCorp Vault with your workspaces by -providing official terraform modules to integrate Vault with Coder. This guide +providing official Terraform modules to integrate Vault with Coder. This guide will show you how to use these modules to integrate HashiCorp Vault with Coder. -## `vault-github` +## The `vault-github` module -[`vault-github`](https://registry.coder.com/modules/vault-github) is a terraform -module that allows you to authenticate with Vault using a GitHub token. This -modules uses the existing GitHub [external authentication](../external-auth.md) -to get the token and authenticate with Vault. +The [`vault-github`](https://registry.coder.com/modules/vault-github) module is a Terraform module that allows you to +authenticate with Vault using a GitHub token. This module uses the existing +GitHub [external authentication](../external-auth.md) to get the token and authenticate with Vault. -To use this module, you need to add the following code to your terraform -configuration: +To use this module, add the following code to your Terraform configuration. ```tf module "vault" { @@ -37,11 +35,10 @@ module "vault" { } ``` -This module will install and authenticate the `vault` CLI in your Coder -workspace. +This module installs and authenticates the `vault` CLI in your Coder workspace. -Users then can use the `vault` CLI to interact with the vault, e.g., to het a kv -secret, +Users then can use the `vault` CLI to interact with Vault; for example, to fetch +a secret stored in the KV backend. ```shell vault kv get -namespace=YOUR_NAMESPACE -mount=MOUNT_NAME SECRET_NAME diff --git a/docs/admin/monitoring/health-check.md b/docs/admin/monitoring/health-check.md index 51c0e8082afff..0a5c135c6d50f 100644 --- a/docs/admin/monitoring/health-check.md +++ b/docs/admin/monitoring/health-check.md @@ -24,7 +24,7 @@ If there is an issue, you may see one of the following errors reported: ### EACS01 -_Access URL not set_ +### Access URL not set **Problem:** no access URL has been configured. @@ -32,7 +32,7 @@ _Access URL not set_ ### EACS02 -_Access URL invalid_ +#### Access URL invalid **Problem:** `${CODER_ACCESS_URL}/healthz` is not a valid URL. @@ -44,7 +44,7 @@ _Access URL invalid_ ### EACS03 -_Failed to fetch `/healthz`_ +#### Failed to fetch `/healthz` **Problem:** Coder was unable to execute a GET request to `${CODER_ACCESS_URL}/healthz`. @@ -74,7 +74,7 @@ The output of this command should aid further diagnosis. ### EACS04 -_/healthz did not return 200 OK_ +#### /healthz did not return 200 OK **Problem:** Coder was able to execute a GET request to `${CODER_ACCESS_URL}/healthz`, but the response code was not `200 OK` as @@ -97,7 +97,7 @@ its configured database, and also measures the median latency over 5 attempts. ### EDB01 -_Database Ping Failed_ +#### Database Ping Failed **Problem:** This error code is returned if any attempt to execute this database query fails. @@ -106,7 +106,7 @@ query fails. ### EDB02 -_Database Latency High_ +#### Database Latency High **Problem:** This code is returned if the median latency is higher than the [configured threshold](../../reference/cli/server.md#--health-check-threshold-database). @@ -117,14 +117,15 @@ Coder's current activity and usage. It may be necessary to increase the resources allocated to Coder's database. Alternatively, you can raise the configured threshold to a higher value (this will not address the root cause). -> [!TIP] -> -> - You can enable -> [detailed database metrics](../../reference/cli/server.md#--prometheus-collect-db-metrics) -> in Coder's Prometheus endpoint. -> - If you have [tracing enabled](../../reference/cli/server.md#--trace), these -> traces may also contain useful information regarding Coder's database -> activity. +
+ +You can enable +[detailed database metrics](../../reference/cli/server.md#--prometheus-collect-db-metrics) +in Coder's Prometheus endpoint. If you have +[tracing enabled](../../reference/cli/server.md#--trace), these traces may also +contain useful information regarding Coder's database activity. + +
## DERP @@ -138,7 +139,7 @@ following: ### EDERP01 -_DERP Node Uses Websocket_ +#### DERP Node Uses Websocket **Problem:** When Coder attempts to establish a connection to one or more DERP servers, it sends a specific `Upgrade: derp` HTTP header. Some load balancers @@ -149,15 +150,19 @@ This is not necessarily a fatal error, but a possible indication of a misconfigured reverse HTTP proxy. Additionally, while workspace users should still be able to reach their workspaces, connection performance may be degraded. -> **Note:** This may also be shown if you have -> [forced websocket connections for DERP](../../reference/cli/server.md#--derp-force-websockets). +
+ +**Note:** This may also be shown if you have +[forced websocket connections for DERP](../../reference/cli/server.md#--derp-force-websockets). + +
**Solution:** ensure that any proxies you use allow connection upgrade with the `Upgrade: derp` header. ### EDERP02 -_One or more DERP nodes are unhealthy_ +#### One or more DERP nodes are unhealthy **Problem:** This is shown if Coder is unable to reach one or more configured DERP servers. Clients will fall back to use the remaining DERP servers, but @@ -176,7 +181,7 @@ curl -v "https://coder.company.com/derp" ### ESTUN01 -_No STUN servers available._ +#### No STUN servers available **Problem:** This is shown if no STUN servers are available. Coder will use STUN to establish [direct connections](../networking/stun.md). Without at least one @@ -189,7 +194,7 @@ configured port. ### ESTUN02 -_STUN returned different addresses; you may be behind a hard NAT._ +#### STUN returned different addresses; you may be behind a hard NAT **Problem:** This is a warning shown when multiple attempts to determine our public IP address/port via STUN resulted in different `ip:port` combinations. @@ -218,7 +223,7 @@ message over the connection, and attempt to read back that same message. ### EWS01 -_Failed to establish a WebSocket connection_ +#### Failed to establish a WebSocket connection **Problem:** Coder was unable to establish a WebSocket connection over its own Access URL. @@ -237,7 +242,7 @@ Access URL. ### EWS02 -_Failed to echo a WebSocket message_ +#### Failed to echo a WebSocket message **Problem:** Coder was able to establish a WebSocket connection, but was unable to write a message. @@ -258,7 +263,7 @@ Coder will periodically query their availability and show their status here. ### EWP01 -_Error Updating Workspace Proxy Health_ +#### Error Updating Workspace Proxy Health **Problem:** Coder was unable to query the connected workspace proxies for their health status. @@ -268,7 +273,7 @@ connectivity issue. ### EWP02 -_Error Fetching Workspace Proxies_ +#### Error Fetching Workspace Proxies **Problem:** Coder was unable to fetch the stored workspace proxy health data from the database. @@ -278,7 +283,7 @@ issue with Coder's configured database. ### EWP04 -_One or more Workspace Proxies Unhealthy_ +#### One or more Workspace Proxies Unhealthy **Problem:** One or more workspace proxies are not reachable. @@ -287,7 +292,7 @@ workspace proxies. ### EPD01 -_No Provisioner Daemons Available_ +#### No Provisioner Daemons Available **Problem:** No provisioner daemons are registered with Coder. No workspaces can be built until there is at least one provisioner daemon running. @@ -300,12 +305,16 @@ that they are able to successfully connect to Coder. Otherwise, ensure [`--provisioner-daemons`](../../reference/cli/server.md#--provisioner-daemons) is set to a value greater than 0. -> Note: This may be a transient issue if you are currently in the process of -> updating your deployment. +
+ +**Note:** This may be a transient issue if you are currently in the process of +updating your deployment. + +
### EPD02 -_Provisioner Daemon Version Mismatch_ +#### Provisioner Daemon Version Mismatch **Problem:** One or more provisioner daemons are more than one major or minor version out of date with the main deployment. It is important that provisioner @@ -315,12 +324,16 @@ of API incompatibility. **Solution:** Update the provisioner daemon to match the currently running version of Coder. -> Note: This may be a transient issue if you are currently in the process of -> updating your deployment. +
+ +**Note:** This may be a transient issue if you are currently in the process of +updating your deployment. + +
### EPD03 -_Provisioner Daemon API Version Mismatch_ +#### Provisioner Daemon API Version Mismatch **Problem:** One or more provisioner daemons are using APIs that are marked as deprecated. These deprecated APIs may be removed in a future release of Coder, @@ -330,12 +343,16 @@ connect to Coder. **Solution:** Update the provisioner daemon to match the currently running version of Coder. -> Note: This may be a transient issue if you are currently in the process of -> updating your deployment. +
+ +**Note:** This may be a transient issue if you are currently in the process of +updating your deployment. + +
-## EUNKNOWN +### EUNKNOWN -_Unknown Error_ +#### Unknown Error **Problem:** This error is shown when an unexpected error occurred evaluating deployment health. It may resolve on its own. diff --git a/docs/admin/monitoring/metrics.md b/docs/admin/monitoring/metrics.md index 167aa2237159b..5a30076f1db57 100644 --- a/docs/admin/monitoring/metrics.md +++ b/docs/admin/monitoring/metrics.md @@ -8,7 +8,7 @@ If you don't have an Prometheus server installed, you can follow the Prometheus [Getting started](https://prometheus.io/docs/prometheus/latest/getting_started/) guide. -### Setting up metrics +## Setting up metrics To set up metrics monitoring, please read our [Prometheus integration guide](../integrations/prometheus.md). The following diff --git a/docs/admin/monitoring/notifications/index.md b/docs/admin/monitoring/notifications/index.md index f527d7743ff87..aa54ad9c143dc 100644 --- a/docs/admin/monitoring/notifications/index.md +++ b/docs/admin/monitoring/notifications/index.md @@ -64,7 +64,7 @@ You can modify the notification delivery behavior using the following server flags. | Required | CLI | Env | Type | Description | Default | -| :------: | ----------------------------------- | --------------------------------------- | ---------- | --------------------------------------------------------------------------------------------------------------------- | ------- | +|:--------:|-------------------------------------|-----------------------------------------|------------|-----------------------------------------------------------------------------------------------------------------------|---------| | ✔️ | `--notifications-dispatch-timeout` | `CODER_NOTIFICATIONS_DISPATCH_TIMEOUT` | `duration` | How long to wait while a notification is being sent before giving up. | 1m | | ✔️ | `--notifications-method` | `CODER_NOTIFICATIONS_METHOD` | `string` | Which delivery method to use (available options: 'smtp', 'webhook'). See [Delivery Methods](#delivery-methods) below. | smtp | | -️ | `--notifications-max-send-attempts` | `CODER_NOTIFICATIONS_MAX_SEND_ATTEMPTS` | `int` | The upper limit of attempts to send a notification. | 5 | @@ -90,15 +90,15 @@ existing one. **Server Settings:** | Required | CLI | Env | Type | Description | Default | -| :------: | ------------------- | ----------------------- | -------- | ----------------------------------------- | --------- | +|:--------:|---------------------|-------------------------|----------|-------------------------------------------|-----------| | ✔️ | `--email-from` | `CODER_EMAIL_FROM` | `string` | The sender's address to use. | | -| ✔️ | `--email-smarthost` | `CODER_EMAIL_SMARTHOST` | `string` | The SMTP relay to send messages | +| ✔️ | `--email-smarthost` | `CODER_EMAIL_SMARTHOST` | `string` | The SMTP relay to send messages | | | ✔️ | `--email-hello` | `CODER_EMAIL_HELLO` | `string` | The hostname identifying the SMTP server. | localhost | **Authentication Settings:** | Required | CLI | Env | Type | Description | -| :------: | ---------------------------- | -------------------------------- | -------- | ------------------------------------------------------------------------- | +|:--------:|------------------------------|----------------------------------|----------|---------------------------------------------------------------------------| | - | `--email-auth-username` | `CODER_EMAIL_AUTH_USERNAME` | `string` | Username to use with PLAIN/LOGIN authentication. | | - | `--email-auth-password` | `CODER_EMAIL_AUTH_PASSWORD` | `string` | Password to use with PLAIN/LOGIN authentication. | | - | `--email-auth-password-file` | `CODER_EMAIL_AUTH_PASSWORD_FILE` | `string` | File from which to load password for use with PLAIN/LOGIN authentication. | @@ -106,14 +106,14 @@ existing one. **TLS Settings:** -| Required | CLI | Env | Type | Description | Default | -| :------: | --------------------------- | ----------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | -| - | `--email-force-tls` | `CODER_EMAIL_FORCE_TLS` | `bool` | Force a TLS connection to the configured SMTP smarthost. If port 465 is used, TLS will be forced. See https://datatracker.ietf.org/doc/html/rfc8314#section-3.3. | false | -| - | `--email-tls-starttls` | `CODER_EMAIL_TLS_STARTTLS` | `bool` | Enable STARTTLS to upgrade insecure SMTP connections using TLS. Ignored if `CODER_NOTIFICATIONS_EMAIL_FORCE_TLS` is set. | false | -| - | `--email-tls-skip-verify` | `CODER_EMAIL_TLS_SKIPVERIFY` | `bool` | Skip verification of the target server's certificate (**insecure**). | false | -| - | `--email-tls-server-name` | `CODER_EMAIL_TLS_SERVERNAME` | `string` | Server name to verify against the target certificate. | | -| - | `--email-tls-cert-file` | `CODER_EMAIL_TLS_CERTFILE` | `string` | Certificate file to use. | | -| - | `--email-tls-cert-key-file` | `CODER_EMAIL_TLS_CERTKEYFILE` | `string` | Certificate key file to use. | | +| Required | CLI | Env | Type | Description | Default | +|:--------:|-----------------------------|-------------------------------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------| +| - | `--email-force-tls` | `CODER_EMAIL_FORCE_TLS` | `bool` | Force a TLS connection to the configured SMTP smarthost. If port 465 is used, TLS will be forced. See . | false | +| - | `--email-tls-starttls` | `CODER_EMAIL_TLS_STARTTLS` | `bool` | Enable STARTTLS to upgrade insecure SMTP connections using TLS. Ignored if `CODER_NOTIFICATIONS_EMAIL_FORCE_TLS` is set. | false | +| - | `--email-tls-skip-verify` | `CODER_EMAIL_TLS_SKIPVERIFY` | `bool` | Skip verification of the target server's certificate (**insecure**). | false | +| - | `--email-tls-server-name` | `CODER_EMAIL_TLS_SERVERNAME` | `string` | Server name to verify against the target certificate. | | +| - | `--email-tls-cert-file` | `CODER_EMAIL_TLS_CERTFILE` | `string` | Certificate file to use. | | +| - | `--email-tls-cert-key-file` | `CODER_EMAIL_TLS_CERTKEYFILE` | `string` | Certificate key file to use. | | **NOTE:** you _MUST_ use `CODER_EMAIL_FORCE_TLS` if your smarthost supports TLS on a port other than `465`. @@ -123,9 +123,11 @@ on a port other than `465`. After setting the required fields above: 1. Create an [App Password](https://myaccount.google.com/apppasswords) using the - account you wish to send from -2. Set the following configuration options: - ``` + account you wish to send from. + +1. Set the following configuration options: + + ```text CODER_EMAIL_SMARTHOST=smtp.gmail.com:465 CODER_EMAIL_AUTH_USERNAME=@ CODER_EMAIL_AUTH_PASSWORD="" @@ -140,8 +142,9 @@ for more options. After setting the required fields above: 1. Setup an account on Microsoft 365 or outlook.com -2. Set the following configuration options: - ``` +1. Set the following configuration options: + + ```text CODER_EMAIL_SMARTHOST=smtp-mail.outlook.com:587 CODER_EMAIL_TLS_STARTTLS=true CODER_EMAIL_AUTH_USERNAME=@ @@ -161,40 +164,40 @@ systems. **Settings**: | Required | CLI | Env | Type | Description | -| :------: | ---------------------------------- | -------------------------------------- | ----- | --------------------------------------- | +|:--------:|------------------------------------|----------------------------------------|-------|-----------------------------------------| | ✔️ | `--notifications-webhook-endpoint` | `CODER_NOTIFICATIONS_WEBHOOK_ENDPOINT` | `url` | The endpoint to which to send webhooks. | Here is an example payload for Coder's webhook notification: ```json { - "_version": "1.0", - "msg_id": "88750cad-77d4-4663-8bc0-f46855f5019b", - "payload": { - "_version": "1.0", - "notification_name": "Workspace Deleted", - "user_id": "4ac34fcb-8155-44d5-8301-e3cd46e88b35", - "user_email": "danny@coder.com", - "user_name": "danny", - "user_username": "danny", - "actions": [ - { - "label": "View workspaces", - "url": "https://et23ntkhpueak.pit-1.try.coder.app/workspaces" - }, - { - "label": "View templates", - "url": "https://et23ntkhpueak.pit-1.try.coder.app/templates" - } - ], - "labels": { - "initiator": "danny", - "name": "my-workspace", - "reason": "initiated by user" - } - }, - "title": "Workspace \"my-workspace\" deleted", - "body": "Hi danny\n\nYour workspace my-workspace was deleted.\nThe specified reason was \"initiated by user (danny)\"." + "_version": "1.0", + "msg_id": "88750cad-77d4-4663-8bc0-f46855f5019b", + "payload": { + "_version": "1.0", + "notification_name": "Workspace Deleted", + "user_id": "4ac34fcb-8155-44d5-8301-e3cd46e88b35", + "user_email": "danny@coder.com", + "user_name": "danny", + "user_username": "danny", + "actions": [ + { + "label": "View workspaces", + "url": "https://et23ntkhpueak.pit-1.try.coder.app/workspaces" + }, + { + "label": "View templates", + "url": "https://et23ntkhpueak.pit-1.try.coder.app/templates" + } + ], + "labels": { + "initiator": "danny", + "name": "my-workspace", + "reason": "initiated by user" + } + }, + "title": "Workspace \"my-workspace\" deleted", + "body": "Hi danny\n\nYour workspace my-workspace was deleted.\nThe specified reason was \"initiated by user (danny)\"." } ``` diff --git a/docs/admin/monitoring/notifications/slack.md b/docs/admin/monitoring/notifications/slack.md index 8b788dc658fff..58bf9338ea2ae 100644 --- a/docs/admin/monitoring/notifications/slack.md +++ b/docs/admin/monitoring/notifications/slack.md @@ -34,9 +34,9 @@ To integrate Slack with Coder, follow these steps to create a Slack application: 3. Under "OAuth & Permissions", add the following OAuth scopes: -- `chat:write`: To send messages as the app. -- `users:read`: To find the user details. -- `users:read.email`: To find user emails. + - `chat:write`: To send messages as the app. + - `users:read`: To find the user details. + - `users:read.email`: To find user emails. 4. Install the app to your workspace and note down the **Bot User OAuth Token** from the "OAuth & Permissions" section. @@ -52,128 +52,128 @@ To build the server to receive webhooks and interact with Slack: 1. Initialize your project by running: -```bash -npm init -y -``` + ```bash + npm init -y + ``` 2. Install the Bolt library: -```bash -npm install @slack/bolt -``` + ```bash + npm install @slack/bolt + ``` 3. Create and edit the `app.js` file. Below is an example of the basic structure: -```js -const { App, LogLevel, ExpressReceiver } = require("@slack/bolt"); -const bodyParser = require("body-parser"); - -const port = process.env.PORT || 6000; - -// Create a Bolt Receiver -const receiver = new ExpressReceiver({ - signingSecret: process.env.SLACK_SIGNING_SECRET, -}); -receiver.router.use(bodyParser.json()); - -// Create the Bolt App, using the receiver -const app = new App({ - token: process.env.SLACK_BOT_TOKEN, - logLevel: LogLevel.DEBUG, - receiver, -}); - -receiver.router.post("/v1/webhook", async (req, res) => { - try { - if (!req.body) { - return res.status(400).send("Error: request body is missing"); - } - - const { title, body } = req.body; - if (!title || !body) { - return res.status(400).send('Error: missing fields: "title", or "body"'); - } - - const payload = req.body.payload; - if (!payload) { - return res.status(400).send('Error: missing "payload" field'); - } - - const { user_email, actions } = payload; - if (!user_email || !actions) { - return res - .status(400) - .send('Error: missing fields: "user_email", "actions"'); - } - - // Get the user ID using Slack API - const userByEmail = await app.client.users.lookupByEmail({ - email: user_email, - }); - - const slackMessage = { - channel: userByEmail.user.id, - text: body, - blocks: [ - { - type: "header", - text: { type: "plain_text", text: title }, - }, - { - type: "section", - text: { type: "mrkdwn", text: body }, - }, - ], - }; - - // Add action buttons if they exist - if (actions && actions.length > 0) { - slackMessage.blocks.push({ - type: "actions", - elements: actions.map((action) => ({ - type: "button", - text: { type: "plain_text", text: action.label }, - url: action.url, - })), - }); - } - - // Post message to the user on Slack - await app.client.chat.postMessage(slackMessage); - - res.status(204).send(); - } catch (error) { - console.error("Error sending message:", error); - res.status(500).send(); - } -}); - -// Acknowledge clicks on link_button, otherwise Slack UI -// complains about missing events. -app.action("button_click", async ({ body, ack, say }) => { - await ack(); // no specific action needed -}); - -// Start the Bolt app -(async () => { - await app.start(port); - console.log("⚡️ Coder Slack bot is running!"); -})(); -``` - -3. Set environment variables to identify the Slack app: - -```bash -export SLACK_BOT_TOKEN=xoxb-... -export SLACK_SIGNING_SECRET=0da4b... -``` - -4. Start the web application by running: - -```bash -node app.js -``` + ```js + const { App, LogLevel, ExpressReceiver } = require("@slack/bolt"); + const bodyParser = require("body-parser"); + + const port = process.env.PORT || 6000; + + // Create a Bolt Receiver + const receiver = new ExpressReceiver({ + signingSecret: process.env.SLACK_SIGNING_SECRET, + }); + receiver.router.use(bodyParser.json()); + + // Create the Bolt App, using the receiver + const app = new App({ + token: process.env.SLACK_BOT_TOKEN, + logLevel: LogLevel.DEBUG, + receiver, + }); + + receiver.router.post("/v1/webhook", async (req, res) => { + try { + if (!req.body) { + return res.status(400).send("Error: request body is missing"); + } + + const { title, body } = req.body; + if (!title || !body) { + return res.status(400).send('Error: missing fields: "title", or "body"'); + } + + const payload = req.body.payload; + if (!payload) { + return res.status(400).send('Error: missing "payload" field'); + } + + const { user_email, actions } = payload; + if (!user_email || !actions) { + return res + .status(400) + .send('Error: missing fields: "user_email", "actions"'); + } + + // Get the user ID using Slack API + const userByEmail = await app.client.users.lookupByEmail({ + email: user_email, + }); + + const slackMessage = { + channel: userByEmail.user.id, + text: body, + blocks: [ + { + type: "header", + text: { type: "plain_text", text: title }, + }, + { + type: "section", + text: { type: "mrkdwn", text: body }, + }, + ], + }; + + // Add action buttons if they exist + if (actions && actions.length > 0) { + slackMessage.blocks.push({ + type: "actions", + elements: actions.map((action) => ({ + type: "button", + text: { type: "plain_text", text: action.label }, + url: action.url, + })), + }); + } + + // Post message to the user on Slack + await app.client.chat.postMessage(slackMessage); + + res.status(204).send(); + } catch (error) { + console.error("Error sending message:", error); + res.status(500).send(); + } + }); + + // Acknowledge clicks on link_button, otherwise Slack UI + // complains about missing events. + app.action("button_click", async ({ body, ack, say }) => { + await ack(); // no specific action needed + }); + + // Start the Bolt app + (async () => { + await app.start(port); + console.log("⚡️ Coder Slack bot is running!"); + })(); + ``` + +4. Set environment variables to identify the Slack app: + + ```bash + export SLACK_BOT_TOKEN=xoxb-... + export SLACK_SIGNING_SECRET=0da4b... + ``` + +5. Start the web application by running: + + ```bash + node app.js + ``` ## Enable Interactivity in Slack diff --git a/docs/admin/monitoring/notifications/teams.md b/docs/admin/monitoring/notifications/teams.md index bf913ac003ea2..5846cfc83bc48 100644 --- a/docs/admin/monitoring/notifications/teams.md +++ b/docs/admin/monitoring/notifications/teams.md @@ -21,115 +21,115 @@ following: The process of setting up a Teams workflow consists of three key steps: -1. Configure the Webhook Trigger. - - Begin by configuring the trigger: **"When a Teams webhook request is - received"**. - - Ensure the trigger access level is set to **"Anyone"**. - -2. Setup the JSON Parsing Action. - - Next, add the **"Parse JSON"** action, linking the content to the **"Body"** - of the received webhook request. Use the following schema to parse the - notification payload: - - ```json - { - "type": "object", - "properties": { - "_version": { - "type": "string" - }, - "payload": { - "type": "object", - "properties": { - "_version": { - "type": "string" - }, - "user_email": { - "type": "string" - }, - "actions": { - "type": "array", - "items": { - "type": "object", - "properties": { - "label": { - "type": "string" - }, - "url": { - "type": "string" - } - }, - "required": ["label", "url"] - } - } - } - }, - "title": { - "type": "string" - }, - "body": { - "type": "string" - } - } - } - ``` - - This action parses the notification's title, body, and the recipient's email - address. - -3. Configure the Adaptive Card Action. - - Finally, set up the **"Post Adaptive Card in a chat or channel"** action - with the following recommended settings: - - **Post as**: Flow Bot - - **Post in**: Chat with Flow Bot - - **Recipient**: `user_email` - - Use the following _Adaptive Card_ template: - - ```json - { - "$schema": "https://adaptivecards.io/schemas/adaptive-card.json", - "type": "AdaptiveCard", - "version": "1.0", - "body": [ - { - "type": "Image", - "url": "https://coder.com/coder-logo-horizontal.png", - "height": "40px", - "altText": "Coder", - "horizontalAlignment": "center" - }, - { - "type": "TextBlock", - "text": "**@{replace(body('Parse_JSON')?['title'], '"', '\"')}**" - }, - { - "type": "TextBlock", - "text": "@{replace(body('Parse_JSON')?['body'], '"', '\"')}", - "wrap": true - }, - { - "type": "ActionSet", - "actions": [@{replace(replace(join(body('Parse_JSON')?['payload']?['actions'], ','), '{', '{"type": "Action.OpenUrl",'), '"label"', '"title"')}] - } - ] - } - ``` - - _Notice_: The Coder `actions` format differs from the `ActionSet` schema, so - its properties need to be modified: include `Action.OpenUrl` type, rename - `label` to `title`. Unfortunately, there is no straightforward solution for - `for-each` pattern. - - Feel free to customize the payload to modify the logo, notification title, - or body content to suit your needs. +1. Configure the Webhook Trigger. + + Begin by configuring the trigger: **"When a Teams webhook request is + received"**. + + Ensure the trigger access level is set to **"Anyone"**. + +1. Setup the JSON Parsing Action. + + Add the **"Parse JSON"** action, linking the content to the **"Body"** of the + received webhook request. Use the following schema to parse the notification + payload: + + ```json + { + "type": "object", + "properties": { + "_version": { + "type": "string" + }, + "payload": { + "type": "object", + "properties": { + "_version": { + "type": "string" + }, + "user_email": { + "type": "string" + }, + "actions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "required": ["label", "url"] + } + } + } + }, + "title": { + "type": "string" + }, + "body": { + "type": "string" + } + } + } + ``` + + This action parses the notification's title, body, and the recipient's email + address. + +1. Configure the Adaptive Card Action. + + Finally, set up the **"Post Adaptive Card in a chat or channel"** action with + the following recommended settings: + + **Post as**: Flow Bot + + **Post in**: Chat with Flow Bot + + **Recipient**: `user_email` + + Use the following _Adaptive Card_ template: + + ```json + { + "$schema": "https://adaptivecards.io/schemas/adaptive-card.json", + "type": "AdaptiveCard", + "version": "1.0", + "body": [ + { + "type": "Image", + "url": "https://coder.com/coder-logo-horizontal.png", + "height": "40px", + "altText": "Coder", + "horizontalAlignment": "center" + }, + { + "type": "TextBlock", + "text": "**@{replace(body('Parse_JSON')?['title'], '"', '\"')}**" + }, + { + "type": "TextBlock", + "text": "@{replace(body('Parse_JSON')?['body'], '"', '\"')}", + "wrap": true + }, + { + "type": "ActionSet", + "actions": [@{replace(replace(join(body('Parse_JSON')?['payload']?['actions'], ','), '{', '{"type": "Action.OpenUrl",'), '"label"', '"title"')}] + } + ] + } + ``` + + _Notice_: The Coder `actions` format differs from the `ActionSet` schema, so + its properties need to be modified: include `Action.OpenUrl` type, rename + `label` to `title`. Unfortunately, there is no straightforward solution for + `for-each` pattern. + + Feel free to customize the payload to modify the logo, notification title, or + body content to suit your needs. ## Enable Webhook Integration diff --git a/docs/admin/networking/high-availability.md b/docs/admin/networking/high-availability.md index 051175178dd8f..7dee70a2930fc 100644 --- a/docs/admin/networking/high-availability.md +++ b/docs/admin/networking/high-availability.md @@ -42,7 +42,7 @@ rendezvous for the Coder nodes. Here's an example 3-node network configuration setup: | Name | `CODER_HTTP_ADDRESS` | `CODER_DERP_SERVER_RELAY_URL` | `CODER_ACCESS_URL` | -| --------- | -------------------- | ----------------------------- | ------------------------ | +|-----------|----------------------|-------------------------------|--------------------------| | `coder-1` | `*:80` | `http://10.0.0.1:80` | `https://coder.big.corp` | | `coder-2` | `*:80` | `http://10.0.0.2:80` | `https://coder.big.corp` | | `coder-3` | `*:80` | `http://10.0.0.3:80` | `https://coder.big.corp` | diff --git a/docs/admin/networking/index.md b/docs/admin/networking/index.md index e07ee39002d44..34e1ef875a7b4 100644 --- a/docs/admin/networking/index.md +++ b/docs/admin/networking/index.md @@ -168,7 +168,7 @@ After you have custom DERP servers, you can launch Coder with them like so: ``` ```bash -$ coder server --derp-config-path derpmap.json +coder server --derp-config-path derpmap.json ``` ### Dashboard connections diff --git a/docs/admin/networking/port-forwarding.md b/docs/admin/networking/port-forwarding.md index e7a07ab4a4189..34a7133b75855 100644 --- a/docs/admin/networking/port-forwarding.md +++ b/docs/admin/networking/port-forwarding.md @@ -156,7 +156,7 @@ protocol configuration for each shared port individually. You can access any port on the workspace and can configure the port protocol manually by appending a `s` to the port in the URL. -``` +```text # Uses HTTP https://33295--agent--workspace--user--apps.example.com/ # Uses HTTPS @@ -180,8 +180,8 @@ requests cannot be authenticated and you will see an error resembling the following: > Access to fetch at -> 'https://coder.example.com/api/v2/applications/auth-redirect' from origin -> 'https://8000--dev--user--apps.coder.example.com' has been blocked by CORS +> '' from origin +> '' has been blocked by CORS > policy: No 'Access-Control-Allow-Origin' header is present on the requested > resource. If an opaque response serves your needs, set the request's mode to > 'no-cors' to fetch the resource with CORS disabled. @@ -190,7 +190,7 @@ following: Below is a list of the cross-origin headers Coder sets with example values: -``` +```text access-control-allow-credentials: true access-control-allow-methods: PUT access-control-allow-headers: X-Custom-Header diff --git a/docs/admin/networking/workspace-proxies.md b/docs/admin/networking/workspace-proxies.md index 03da5e142f7ce..288c9eab66f97 100644 --- a/docs/admin/networking/workspace-proxies.md +++ b/docs/admin/networking/workspace-proxies.md @@ -14,11 +14,11 @@ connecting with their workspace over SSH, a workspace app, port forwarding, etc. Dashboard connections and API calls (e.g. the workspaces list) are not served over workspace proxies. -# Deploy a workspace proxy +## Deploy a workspace proxy -Each workspace proxy should be a unique instance. At no point should 2 workspace -proxy instances share the same authentication token. They only require port 443 -to be open and are expected to have network connectivity to the coderd +Each workspace proxy should be a unique instance. At no point should two +workspace proxy instances share the same authentication token. They only require +port 443 to be open and are expected to have network connectivity to the coderd dashboard. Workspace proxies **do not** make any database connections. Workspace proxies can be used in the browser by navigating to the user diff --git a/docs/admin/provisioners.md b/docs/admin/provisioners.md index f0c8cc5186a21..1a27cf1d8f25a 100644 --- a/docs/admin/provisioners.md +++ b/docs/admin/provisioners.md @@ -201,33 +201,33 @@ different organizations. This is illustrated in the below table: | Provisioner Tags | Job Tags | Same Org | Can Run Job? | -| ----------------------------------------------------------------- | ---------------------------------------------------------------- | -------- | ------------ | -| scope=organization owner= | scope=organization owner= | ✅ | ✅ | -| scope=organization owner= environment=on-prem | scope=organization owner= environment=on-prem | ✅ | ✅ | -| scope=organization owner= environment=on-prem datacenter=chicago | scope=organization owner= environment=on-prem | ✅ | ✅ | -| scope=organization owner= environment=on-prem datacenter=chicago | scope=organization owner= environment=on-prem datacenter=chicago | ✅ | ✅ | -| scope=user owner=aaa | scope=user owner=aaa | ✅ | ✅ | -| scope=user owner=aaa environment=on-prem | scope=user owner=aaa | ✅ | ✅ | -| scope=user owner=aaa environment=on-prem | scope=user owner=aaa environment=on-prem | ✅ | ✅ | -| scope=user owner=aaa environment=on-prem datacenter=chicago | scope=user owner=aaa environment=on-prem | ✅ | ✅ | -| scope=user owner=aaa environment=on-prem datacenter=chicago | scope=user owner=aaa environment=on-prem datacenter=chicago | ✅ | ✅ | -| scope=organization owner= | scope=organization owner= environment=on-prem | ✅ | ❌ | -| scope=organization owner= environment=on-prem | scope=organization owner= | ✅ | ❌ | -| scope=organization owner= environment=on-prem | scope=organization owner= environment=on-prem datacenter=chicago | ✅ | ❌ | -| scope=organization owner= environment=on-prem datacenter=new_york | scope=organization owner= environment=on-prem datacenter=chicago | ✅ | ❌ | -| scope=user owner=aaa | scope=organization owner= | ✅ | ❌ | -| scope=user owner=aaa | scope=user owner=bbb | ✅ | ❌ | -| scope=organization owner= | scope=user owner=aaa | ✅ | ❌ | -| scope=organization owner= | scope=user owner=aaa environment=on-prem | ✅ | ❌ | -| scope=user owner=aaa | scope=user owner=aaa environment=on-prem | ✅ | ❌ | -| scope=user owner=aaa environment=on-prem | scope=user owner=aaa environment=on-prem datacenter=chicago | ✅ | ❌ | -| scope=user owner=aaa environment=on-prem datacenter=chicago | scope=user owner=aaa environment=on-prem datacenter=new_york | ✅ | ❌ | -| scope=organization owner= environment=on-prem | scope=organization owner= environment=on-prem | ❌ | ❌ | +|-------------------------------------------------------------------|------------------------------------------------------------------|----------|--------------| +| scope=organization owner= | scope=organization owner= | ✅ | ✅ | +| scope=organization owner= environment=on-prem | scope=organization owner= environment=on-prem | ✅ | ✅ | +| scope=organization owner= environment=on-prem datacenter=chicago | scope=organization owner= environment=on-prem | ✅ | ✅ | +| scope=organization owner= environment=on-prem datacenter=chicago | scope=organization owner= environment=on-prem datacenter=chicago | ✅ | ✅ | +| scope=user owner=aaa | scope=user owner=aaa | ✅ | ✅ | +| scope=user owner=aaa environment=on-prem | scope=user owner=aaa | ✅ | ✅ | +| scope=user owner=aaa environment=on-prem | scope=user owner=aaa environment=on-prem | ✅ | ✅ | +| scope=user owner=aaa environment=on-prem datacenter=chicago | scope=user owner=aaa environment=on-prem | ✅ | ✅ | +| scope=user owner=aaa environment=on-prem datacenter=chicago | scope=user owner=aaa environment=on-prem datacenter=chicago | ✅ | ✅ | +| scope=organization owner= | scope=organization owner= environment=on-prem | ✅ | ❌ | +| scope=organization owner= environment=on-prem | scope=organization owner= | ✅ | ❌ | +| scope=organization owner= environment=on-prem | scope=organization owner= environment=on-prem datacenter=chicago | ✅ | ❌ | +| scope=organization owner= environment=on-prem datacenter=new_york | scope=organization owner= environment=on-prem datacenter=chicago | ✅ | ❌ | +| scope=user owner=aaa | scope=organization owner= | ✅ | ❌ | +| scope=user owner=aaa | scope=user owner=bbb | ✅ | ❌ | +| scope=organization owner= | scope=user owner=aaa | ✅ | ❌ | +| scope=organization owner= | scope=user owner=aaa environment=on-prem | ✅ | ❌ | +| scope=user owner=aaa | scope=user owner=aaa environment=on-prem | ✅ | ❌ | +| scope=user owner=aaa environment=on-prem | scope=user owner=aaa environment=on-prem datacenter=chicago | ✅ | ❌ | +| scope=user owner=aaa environment=on-prem datacenter=chicago | scope=user owner=aaa environment=on-prem datacenter=new_york | ✅ | ❌ | +| scope=organization owner= environment=on-prem | scope=organization owner= environment=on-prem | ❌ | ❌ | > **Note to maintainers:** to generate this table, run the following command and > copy the output: > -> ``` +> ```go > go test -v -count=1 ./coderd/provisionerdserver/ -test.run='^TestAcquirer_MatchTags/GenTable$' > ``` diff --git a/docs/admin/security/audit-logs.md b/docs/admin/security/audit-logs.md index 092cb5fba6456..430d03adb0667 100644 --- a/docs/admin/security/audit-logs.md +++ b/docs/admin/security/audit-logs.md @@ -8,30 +8,30 @@ We track the following resources: -| Resource | | -| -------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| APIKey
login, logout, register, create, delete |
FieldTracked
created_attrue
expires_attrue
hashed_secretfalse
idfalse
ip_addressfalse
last_usedtrue
lifetime_secondsfalse
login_typefalse
scopefalse
token_namefalse
updated_atfalse
user_idtrue
| -| AuditOAuthConvertState
|
FieldTracked
created_attrue
expires_attrue
from_login_typetrue
to_login_typetrue
user_idtrue
| -| Group
create, write, delete |
FieldTracked
avatar_urltrue
display_nametrue
idtrue
memberstrue
nametrue
organization_idfalse
quota_allowancetrue
sourcefalse
| -| AuditableOrganizationMember
|
FieldTracked
created_attrue
organization_idfalse
rolestrue
updated_attrue
user_idtrue
usernametrue
| -| CustomRole
|
FieldTracked
created_atfalse
display_nametrue
idfalse
nametrue
org_permissionstrue
organization_idfalse
site_permissionstrue
updated_atfalse
user_permissionstrue
| -| GitSSHKey
create |
FieldTracked
created_atfalse
private_keytrue
public_keytrue
updated_atfalse
user_idtrue
| -| GroupSyncSettings
|
FieldTracked
auto_create_missing_groupstrue
fieldtrue
legacy_group_name_mappingfalse
mappingtrue
regex_filtertrue
| -| HealthSettings
|
FieldTracked
dismissed_healthcheckstrue
idfalse
| -| License
create, delete |
FieldTracked
exptrue
idfalse
jwtfalse
uploaded_attrue
uuidtrue
| -| NotificationTemplate
|
FieldTracked
actionstrue
body_templatetrue
grouptrue
idfalse
kindtrue
methodtrue
nametrue
title_templatetrue
| -| NotificationsSettings
|
FieldTracked
idfalse
notifier_pausedtrue
| -| OAuth2ProviderApp
|
FieldTracked
callback_urltrue
created_atfalse
icontrue
idfalse
nametrue
updated_atfalse
| -| OAuth2ProviderAppSecret
|
FieldTracked
app_idfalse
created_atfalse
display_secretfalse
hashed_secretfalse
idfalse
last_used_atfalse
secret_prefixfalse
| -| Organization
|
FieldTracked
created_atfalse
descriptiontrue
display_nametrue
icontrue
idfalse
is_defaulttrue
nametrue
updated_attrue
| -| OrganizationSyncSettings
|
FieldTracked
assign_defaulttrue
fieldtrue
mappingtrue
| -| RoleSyncSettings
|
FieldTracked
fieldtrue
mappingtrue
| -| Template
write, delete |
FieldTracked
active_version_idtrue
activity_bumptrue
allow_user_autostarttrue
allow_user_autostoptrue
allow_user_cancel_workspace_jobstrue
autostart_block_days_of_weektrue
autostop_requirement_days_of_weektrue
autostop_requirement_weekstrue
created_atfalse
created_bytrue
created_by_avatar_urlfalse
created_by_usernamefalse
default_ttltrue
deletedfalse
deprecatedtrue
descriptiontrue
display_nametrue
failure_ttltrue
group_acltrue
icontrue
idtrue
max_port_sharing_leveltrue
nametrue
organization_display_namefalse
organization_iconfalse
organization_idfalse
organization_namefalse
provisionertrue
require_active_versiontrue
time_til_dormanttrue
time_til_dormant_autodeletetrue
updated_atfalse
user_acltrue
| -| TemplateVersion
create, write |
FieldTracked
archivedtrue
created_atfalse
created_bytrue
created_by_avatar_urlfalse
created_by_usernamefalse
external_auth_providersfalse
idtrue
job_idfalse
messagefalse
nametrue
organization_idfalse
readmetrue
source_example_idfalse
template_idtrue
updated_atfalse
| -| User
create, write, delete |
FieldTracked
avatar_urlfalse
created_atfalse
deletedtrue
emailtrue
github_com_user_idfalse
hashed_one_time_passcodefalse
hashed_passwordtrue
idtrue
last_seen_atfalse
login_typetrue
nametrue
one_time_passcode_expires_attrue
quiet_hours_scheduletrue
rbac_rolestrue
statustrue
theme_preferencefalse
updated_atfalse
usernametrue
| -| WorkspaceBuild
start, stop |
FieldTracked
build_numberfalse
created_atfalse
daily_costfalse
deadlinefalse
idfalse
initiator_by_avatar_urlfalse
initiator_by_usernamefalse
initiator_idfalse
job_idfalse
max_deadlinefalse
provisioner_statefalse
reasonfalse
template_version_idtrue
transitionfalse
updated_atfalse
workspace_idfalse
| -| WorkspaceProxy
|
FieldTracked
created_attrue
deletedfalse
derp_enabledtrue
derp_onlytrue
display_nametrue
icontrue
idtrue
nametrue
region_idtrue
token_hashed_secrettrue
updated_atfalse
urltrue
versiontrue
wildcard_hostnametrue
| -| WorkspaceTable
|
FieldTracked
automatic_updatestrue
autostart_scheduletrue
created_atfalse
deletedfalse
deleting_attrue
dormant_attrue
favoritetrue
idtrue
last_used_atfalse
nametrue
next_start_attrue
organization_idfalse
owner_idtrue
template_idtrue
ttltrue
updated_atfalse
| +| Resource | | | +|----------------------------------------------------------|----------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| APIKey
login, logout, register, create, delete | |
FieldTracked
created_attrue
expires_attrue
hashed_secretfalse
idfalse
ip_addressfalse
last_usedtrue
lifetime_secondsfalse
login_typefalse
scopefalse
token_namefalse
updated_atfalse
user_idtrue
| +| AuditOAuthConvertState
| |
FieldTracked
created_attrue
expires_attrue
from_login_typetrue
to_login_typetrue
user_idtrue
| +| Group
create, write, delete | |
FieldTracked
avatar_urltrue
display_nametrue
idtrue
memberstrue
nametrue
organization_idfalse
quota_allowancetrue
sourcefalse
| +| AuditableOrganizationMember
| |
FieldTracked
created_attrue
organization_idfalse
rolestrue
updated_attrue
user_idtrue
usernametrue
| +| CustomRole
| |
FieldTracked
created_atfalse
display_nametrue
idfalse
nametrue
org_permissionstrue
organization_idfalse
site_permissionstrue
updated_atfalse
user_permissionstrue
| +| GitSSHKey
create | |
FieldTracked
created_atfalse
private_keytrue
public_keytrue
updated_atfalse
user_idtrue
| +| GroupSyncSettings
| |
FieldTracked
auto_create_missing_groupstrue
fieldtrue
legacy_group_name_mappingfalse
mappingtrue
regex_filtertrue
| +| HealthSettings
| |
FieldTracked
dismissed_healthcheckstrue
idfalse
| +| License
create, delete | |
FieldTracked
exptrue
idfalse
jwtfalse
uploaded_attrue
uuidtrue
| +| NotificationTemplate
| |
FieldTracked
actionstrue
body_templatetrue
grouptrue
idfalse
kindtrue
methodtrue
nametrue
title_templatetrue
| +| NotificationsSettings
| |
FieldTracked
idfalse
notifier_pausedtrue
| +| OAuth2ProviderApp
| |
FieldTracked
callback_urltrue
created_atfalse
icontrue
idfalse
nametrue
updated_atfalse
| +| OAuth2ProviderAppSecret
| |
FieldTracked
app_idfalse
created_atfalse
display_secretfalse
hashed_secretfalse
idfalse
last_used_atfalse
secret_prefixfalse
| +| Organization
| |
FieldTracked
created_atfalse
descriptiontrue
display_nametrue
icontrue
idfalse
is_defaulttrue
nametrue
updated_attrue
| +| OrganizationSyncSettings
| |
FieldTracked
assign_defaulttrue
fieldtrue
mappingtrue
| +| RoleSyncSettings
| |
FieldTracked
fieldtrue
mappingtrue
| +| Template
write, delete | |
FieldTracked
active_version_idtrue
activity_bumptrue
allow_user_autostarttrue
allow_user_autostoptrue
allow_user_cancel_workspace_jobstrue
autostart_block_days_of_weektrue
autostop_requirement_days_of_weektrue
autostop_requirement_weekstrue
created_atfalse
created_bytrue
created_by_avatar_urlfalse
created_by_usernamefalse
default_ttltrue
deletedfalse
deprecatedtrue
descriptiontrue
display_nametrue
failure_ttltrue
group_acltrue
icontrue
idtrue
max_port_sharing_leveltrue
nametrue
organization_display_namefalse
organization_iconfalse
organization_idfalse
organization_namefalse
provisionertrue
require_active_versiontrue
time_til_dormanttrue
time_til_dormant_autodeletetrue
updated_atfalse
user_acltrue
| +| TemplateVersion
create, write | |
FieldTracked
archivedtrue
created_atfalse
created_bytrue
created_by_avatar_urlfalse
created_by_usernamefalse
external_auth_providersfalse
idtrue
job_idfalse
messagefalse
nametrue
organization_idfalse
readmetrue
source_example_idfalse
template_idtrue
updated_atfalse
| +| User
create, write, delete | |
FieldTracked
avatar_urlfalse
created_atfalse
deletedtrue
emailtrue
github_com_user_idfalse
hashed_one_time_passcodefalse
hashed_passwordtrue
idtrue
last_seen_atfalse
login_typetrue
nametrue
one_time_passcode_expires_attrue
quiet_hours_scheduletrue
rbac_rolestrue
statustrue
theme_preferencefalse
updated_atfalse
usernametrue
| +| WorkspaceBuild
start, stop | |
FieldTracked
build_numberfalse
created_atfalse
daily_costfalse
deadlinefalse
idfalse
initiator_by_avatar_urlfalse
initiator_by_usernamefalse
initiator_idfalse
job_idfalse
max_deadlinefalse
provisioner_statefalse
reasonfalse
template_version_idtrue
transitionfalse
updated_atfalse
workspace_idfalse
| +| WorkspaceProxy
| |
FieldTracked
created_attrue
deletedfalse
derp_enabledtrue
derp_onlytrue
display_nametrue
icontrue
idtrue
nametrue
region_idtrue
token_hashed_secrettrue
updated_atfalse
urltrue
versiontrue
wildcard_hostnametrue
| +| WorkspaceTable
| |
FieldTracked
automatic_updatestrue
autostart_scheduletrue
created_atfalse
deletedfalse
deleting_attrue
dormant_attrue
favoritetrue
idtrue
last_used_atfalse
nametrue
next_start_attrue
organization_idfalse
owner_idtrue
template_idtrue
ttltrue
updated_atfalse
| @@ -85,34 +85,34 @@ log entry: ```json { - "ts": "2023-06-13T03:45:37.294730279Z", - "level": "INFO", - "msg": "audit_log", - "caller": "/home/runner/work/coder/coder/enterprise/audit/backends/slog.go:36", - "func": "github.com/coder/coder/enterprise/audit/backends.slogBackend.Export", - "logger_names": ["coderd"], - "fields": { - "ID": "033a9ffa-b54d-4c10-8ec3-2aaf9e6d741a", - "Time": "2023-06-13T03:45:37.288506Z", - "UserID": "6c405053-27e3-484a-9ad7-bcb64e7bfde6", - "OrganizationID": "00000000-0000-0000-0000-000000000000", - "Ip": "{IPNet:{IP:\u003cnil\u003e Mask:\u003cnil\u003e} Valid:false}", - "UserAgent": "{String: Valid:false}", - "ResourceType": "workspace_build", - "ResourceID": "ca5647e0-ef50-4202-a246-717e04447380", - "ResourceTarget": "", - "Action": "start", - "Diff": {}, - "StatusCode": 200, - "AdditionalFields": { - "workspace_name": "linux-container", - "build_number": "9", - "build_reason": "initiator", - "workspace_owner": "" - }, - "RequestID": "bb791ac3-f6ee-4da8-8ec2-f54e87013e93", - "ResourceIcon": "" - } + "ts": "2023-06-13T03:45:37.294730279Z", + "level": "INFO", + "msg": "audit_log", + "caller": "/home/runner/work/coder/coder/enterprise/audit/backends/slog.go:36", + "func": "github.com/coder/coder/enterprise/audit/backends.slogBackend.Export", + "logger_names": ["coderd"], + "fields": { + "ID": "033a9ffa-b54d-4c10-8ec3-2aaf9e6d741a", + "Time": "2023-06-13T03:45:37.288506Z", + "UserID": "6c405053-27e3-484a-9ad7-bcb64e7bfde6", + "OrganizationID": "00000000-0000-0000-0000-000000000000", + "Ip": "{IPNet:{IP:\u003cnil\u003e Mask:\u003cnil\u003e} Valid:false}", + "UserAgent": "{String: Valid:false}", + "ResourceType": "workspace_build", + "ResourceID": "ca5647e0-ef50-4202-a246-717e04447380", + "ResourceTarget": "", + "Action": "start", + "Diff": {}, + "StatusCode": 200, + "AdditionalFields": { + "workspace_name": "linux-container", + "build_number": "9", + "build_reason": "initiator", + "workspace_owner": "" + }, + "RequestID": "bb791ac3-f6ee-4da8-8ec2-f54e87013e93", + "ResourceIcon": "" + } } ``` diff --git a/docs/admin/security/index.md b/docs/admin/security/index.md index ea560abcde503..cb83bf6b78271 100644 --- a/docs/admin/security/index.md +++ b/docs/admin/security/index.md @@ -23,5 +23,5 @@ vulnerability. --- | Description | Severity | Fix | Vulnerable Versions | -| --------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------------------------------------------------------------- | ------------------- | +|-----------------------------------------------------------------------------------------------------------------------------------------------|----------|----------------------------------------------------------------|---------------------| | [API tokens of deleted users not invalidated](https://github.com/coder/coder/blob/main/docs/admin/security/0001_user_apikeys_invalidation.md) | HIGH | [v0.23.0](https://github.com/coder/coder/releases/tag/v0.23.0) | v0.8.25 - v0.22.2 | diff --git a/docs/admin/security/secrets.md b/docs/admin/security/secrets.md index 00f69fdda7f43..4fcd188ed0583 100644 --- a/docs/admin/security/secrets.md +++ b/docs/admin/security/secrets.md @@ -9,7 +9,7 @@ This article explains how to use secrets in a workspace. To authenticate the workspace provisioner, see the provisioners documentation. -## Wait a minute... +## Before you begin Your first attempt to use secrets with Coder should be your local method. You can do everything you can locally and more with your Coder workspace, so diff --git a/docs/admin/setup/index.md b/docs/admin/setup/index.md index 9429db6cfebac..9af914125a75e 100644 --- a/docs/admin/setup/index.md +++ b/docs/admin/setup/index.md @@ -52,7 +52,7 @@ a wildcard subdomain that resolves to Coder (e.g. `*.coder.example.com`). If you are providing TLS certificates directly to the Coder server, either 1. Use a single certificate and key for both the root and wildcard domains. -2. Configure multiple certificates and keys via +1. Configure multiple certificates and keys via [`coder.tls.secretNames`](https://github.com/coder/coder/blob/main/helm/coder/values.yaml) in the Helm Chart, or [`--tls-cert-file`](../../reference/cli/server.md#--tls-cert-file) and @@ -78,29 +78,27 @@ working directory prior to step 1. 1. Create the TLS secret in your Kubernetes cluster -```shell -kubectl create secret tls coder-tls -n --key="tls.key" --cert="tls.crt" -``` + ```shell + kubectl create secret tls coder-tls -n --key="tls.key" --cert="tls.crt" + ``` -> You can use a single certificate for the both the access URL and wildcard -> access URL. The certificate CN must match the wildcard domain, such as -> `*.example.coder.com`. + You can use a single certificate for the both the access URL and wildcard access URL. The certificate CN must match the wildcard domain, such as `*.example.coder.com`. 1. Reference the TLS secret in your Coder Helm chart values -```yaml -coder: - tls: - secretName: - - coder-tls - - # Alternatively, if you use an Ingress controller to terminate TLS, - # set the following values: - ingress: - enable: true - secretName: coder-tls - wildcardSecretName: coder-tls -``` + ```yaml + coder: + tls: + secretName: + - coder-tls + + # Alternatively, if you use an Ingress controller to terminate TLS, + # set the following values: + ingress: + enable: true + secretName: coder-tls + wildcardSecretName: coder-tls + ``` ## PostgreSQL Database @@ -116,7 +114,7 @@ the PostgreSQL interactive terminal), output the connection URL with the following command: ```console -coder server postgres-builtin-url +$ coder server postgres-builtin-url psql "postgres://coder@localhost:49627/coder?sslmode=disable&password=feU...yI1" ``` @@ -126,13 +124,13 @@ To migrate from the built-in database to an external database, follow these steps: 1. Stop your Coder deployment. -2. Run `coder server postgres-builtin-serve` in a background terminal. -3. Run `coder server postgres-builtin-url` and copy its output command. -4. Run `pg_dump > coder.sql` to dump the internal +1. Run `coder server postgres-builtin-serve` in a background terminal. +1. Run `coder server postgres-builtin-url` and copy its output command. +1. Run `pg_dump > coder.sql` to dump the internal database to a file. -5. Restore that content to an external database with +1. Restore that content to an external database with `psql < coder.sql`. -6. Start your Coder deployment with +1. Start your Coder deployment with `CODER_PG_CONNECTION_URL=`. ## Configuring Coder behind a proxy @@ -144,7 +142,7 @@ To configure Coder behind a corporate proxy, set the environment variables ## External Authentication Coder supports external authentication via OAuth2.0. This allows enabling -integrations with git providers, such as GitHub, GitLab, and Bitbucket etc. +integrations with Git providers, such as GitHub, GitLab, and Bitbucket. External authentication can also be used to integrate with external services like JFrog Artifactory and others. @@ -154,5 +152,5 @@ more information. ## Up Next -- [Learn how to setup and manage templates](../templates/index.md) +- [Setup and manage templates](../templates/index.md) - [Setup external provisioners](../provisioners.md) diff --git a/docs/admin/templates/extending-templates/docker-in-workspaces.md b/docs/admin/templates/extending-templates/docker-in-workspaces.md index 45439830e3ef6..734e7545a9090 100644 --- a/docs/admin/templates/extending-templates/docker-in-workspaces.md +++ b/docs/admin/templates/extending-templates/docker-in-workspaces.md @@ -3,7 +3,7 @@ There are a few ways to run Docker within container-based Coder workspaces. | Method | Description | Limitations | -| ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Sysbox container runtime](#sysbox-container-runtime) | Install the Sysbox runtime on your Kubernetes nodes or Docker host(s) for secure docker-in-docker and systemd-in-docker. Works with GKE, EKS, AKS, Docker. | Requires [compatible nodes](https://github.com/nestybox/sysbox#host-requirements). [Limitations](https://github.com/nestybox/sysbox/blob/master/docs/user-guide/limitations.md) | | [Envbox](#envbox) | A container image with all the packages necessary to run an inner Sysbox container. Removes the need to setup sysbox-runc on your nodes. Works with GKE, EKS, AKS. | Requires running the outer container as privileged (the inner container that acts as the workspace is locked down). Requires compatible [nodes](https://github.com/nestybox/sysbox/blob/master/docs/distro-compat.md#sysbox-distro-compatibility). | | [Rootless Podman](#rootless-podman) | Run Podman inside Coder workspaces. Does not require a custom runtime or privileged containers. Works with GKE, EKS, AKS, RKE, OpenShift | Requires smarter-device-manager for FUSE mounts. [See all](https://github.com/containers/podman/blob/main/rootless.md#shortcomings-of-rootless-podman) | diff --git a/docs/admin/templates/extending-templates/external-auth.md b/docs/admin/templates/extending-templates/external-auth.md index de021d2783b64..ab27780b8b72d 100644 --- a/docs/admin/templates/extending-templates/external-auth.md +++ b/docs/admin/templates/extending-templates/external-auth.md @@ -52,7 +52,7 @@ coder external-auth access-token Note: Some IDE's override the `GIT_ASKPASS` environment variable and need to be configured. -**VSCode** +#### VSCode Use the [Coder](https://marketplace.visualstudio.com/items?itemName=coder.coder-remote) diff --git a/docs/admin/templates/extending-templates/parameters.md b/docs/admin/templates/extending-templates/parameters.md index 5ea82c0934b65..2c4801c08e82b 100644 --- a/docs/admin/templates/extending-templates/parameters.md +++ b/docs/admin/templates/extending-templates/parameters.md @@ -90,7 +90,7 @@ data "coder_parameter" "security_groups" { > For the above example, to override the default values of the `security_groups` > parameter, you will need to pass the following argument to `coder create`: > -> ``` +> ```shell > --parameter "\"security_groups=[\"\"DevOps Security Group\"\",\"\"Backend Security Group\"\"]\"" > ``` > diff --git a/docs/admin/templates/extending-templates/process-logging.md b/docs/admin/templates/extending-templates/process-logging.md index 989bdd8572ae5..8822d988402fc 100644 --- a/docs/admin/templates/extending-templates/process-logging.md +++ b/docs/admin/templates/extending-templates/process-logging.md @@ -254,28 +254,28 @@ The raw logs will look something like this: ```json { - "ts": "2022-02-28T20:29:38.038452202Z", - "level": "INFO", - "msg": "exec", - "fields": { - "labels": { - "user_email": "jessie@coder.com", - "user_id": "5e876e9a-121663f01ebd1522060d5270", - "username": "jessie", - "workspace_id": "621d2e52-a6987ef6c56210058ee2593c", - "workspace_name": "main" - }, - "cmdline": "uname -a", - "event": { - "filename": "/usr/bin/uname", - "argv": ["uname", "-a"], - "truncated": false, - "pid": 920684, - "uid": 101000, - "gid": 101000, - "comm": "bash" - } - } + "ts": "2022-02-28T20:29:38.038452202Z", + "level": "INFO", + "msg": "exec", + "fields": { + "labels": { + "user_email": "jessie@coder.com", + "user_id": "5e876e9a-121663f01ebd1522060d5270", + "username": "jessie", + "workspace_id": "621d2e52-a6987ef6c56210058ee2593c", + "workspace_name": "main" + }, + "cmdline": "uname -a", + "event": { + "filename": "/usr/bin/uname", + "argv": ["uname", "-a"], + "truncated": false, + "pid": 920684, + "uid": 101000, + "gid": 101000, + "comm": "bash" + } + } } ``` diff --git a/docs/admin/templates/extending-templates/variables.md b/docs/admin/templates/extending-templates/variables.md index acb064e15c3d9..3c1d02f0baf63 100644 --- a/docs/admin/templates/extending-templates/variables.md +++ b/docs/admin/templates/extending-templates/variables.md @@ -53,15 +53,15 @@ variables, you can employ a straightforward solution: 1. Create a `terraform.tfvars` file in in the template directory: -```tf -coder_image = newimage:tag -``` + ```tf + coder_image = newimage:tag + ``` -2. Push the new template revision using Coder CLI: +1. Push the new template revision using Coder CLI: -``` -coder templates push my-template -y # no need to use --var -``` + ```shell + coder templates push my-template -y # no need to use --var + ``` This file serves as a mechanism to override the template settings for variables. It can be stored in the repository for easy access and reference. Coder CLI diff --git a/docs/admin/templates/extending-templates/workspace-tags.md b/docs/admin/templates/extending-templates/workspace-tags.md index 83ea983ce72ba..e49957d9ba515 100644 --- a/docs/admin/templates/extending-templates/workspace-tags.md +++ b/docs/admin/templates/extending-templates/workspace-tags.md @@ -26,7 +26,7 @@ data "coder_workspace_tags" "custom_workspace_tags" { } ``` -**Legend** +### Legend - `zone` - static tag value set to `developers` - `runtime` - supported by the string-type `coder_parameter` to select @@ -55,7 +55,7 @@ raw values from the database and evaluates them using provided template variables and parameters. This is illustrated in the table below: | Value Type | Template Import | Workspace Creation | -| ---------- | -------------------------------------------------- | ----------------------- | +|------------|----------------------------------------------------|-------------------------| | Static | `{"region": "us"}` | `{"region": "us"}` | | Variable | `{"az": var.az}` | `{"region": "us-east"}` | | Parameter | `{"cluster": data.coder_parameter.cluster.value }` | `{"cluster": "dev"}` | @@ -98,7 +98,7 @@ as immutable and set only once, during workspace creation. You may only specify the following as inputs for `coder_workspace_tags`: | | Example | -| :----------------- | :-------------------------------------------- | +|:-------------------|:----------------------------------------------| | Static values | `"developers"` | | Template variables | `var.az` | | Coder parameters | `data.coder_parameter.runtime_selector.value` | @@ -115,7 +115,7 @@ raw queries on-the-fly without processing the entire Terraform template. This evaluation is simpler but also limited in terms of available functions, variables, and references to other resources. -**Supported syntax** +#### Supported syntax - Static string: `foobar_tag = "foobaz"` - Formatted string: `foobar_tag = "foobaz ${data.coder_parameter.foobaz.value}"` @@ -125,7 +125,7 @@ variables, and references to other resources. - Condition: `cache = data.coder_parameter.feature_cache_enabled.value == "true" ? "with-cache" : "no-cache"` -**Not supported** +#### Not supported - Function calls: `try(var.foo, "default")` - Resources: `compute_instance.dev.name` diff --git a/docs/admin/templates/managing-templates/devcontainers/add-devcontainer.md b/docs/admin/templates/managing-templates/devcontainers/add-devcontainer.md index 3d4a049b138e2..5d2ac0a07f9e2 100644 --- a/docs/admin/templates/managing-templates/devcontainers/add-devcontainer.md +++ b/docs/admin/templates/managing-templates/devcontainers/add-devcontainer.md @@ -121,7 +121,7 @@ their development environments: ## Example templates | Template | Description | -| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|---------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Docker dev containers](https://github.com/coder/coder/tree/main/examples/templates/docker-devcontainer) | Docker provisions a development container. | | [Kubernetes dev containers](https://github.com/coder/coder/tree/main/examples/templates/kubernetes-devcontainer) | Provisions a development container on the Kubernetes cluster. | | [Google Compute Engine dev container](https://github.com/coder/coder/tree/main/examples/templates/gcp-devcontainer) | Runs a development container inside a single GCP instance. It also mounts the Docker socket from the VM inside the container to enable Docker inside the workspace. | @@ -144,7 +144,3 @@ Lifecycle scripts are managed by project developers. ## Next steps - [Dev container security and caching](./devcontainer-security-caching.md) - -``` - -``` diff --git a/docs/admin/templates/managing-templates/devcontainers/devcontainer-security-caching.md b/docs/admin/templates/managing-templates/devcontainers/devcontainer-security-caching.md index bb56ff6a31e32..a0ae51624fc6d 100644 --- a/docs/admin/templates/managing-templates/devcontainers/devcontainer-security-caching.md +++ b/docs/admin/templates/managing-templates/devcontainers/devcontainer-security-caching.md @@ -3,7 +3,7 @@ Ensure Envbuilder can only pull pre-approved images and artifacts by configuring it with your existing HTTP proxies, firewalls, and artifact managers. -### Configure registry authentication +## Configure registry authentication You may need to authenticate to your container registry, such as Artifactory, or Git provider such as GitLab, to use Envbuilder. See the diff --git a/docs/admin/users/github-auth.md b/docs/admin/users/github-auth.md index cc1f5365bcdc2..97e700e262ff8 100644 --- a/docs/admin/users/github-auth.md +++ b/docs/admin/users/github-auth.md @@ -1,6 +1,6 @@ -## GitHub +# GitHub -### Step 1: Configure the OAuth application in GitHub +## Step 1: Configure the OAuth application in GitHub First, [register a GitHub OAuth app](https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/). @@ -22,7 +22,7 @@ values in the next step. Coder will need permission to access user email addresses. Find the "Account Permissions" settings for your app and select "read-only" for "Email addresses". -### Step 2: Configure Coder with the OAuth credentials +## Step 2: Configure Coder with the OAuth credentials Navigate to your Coder host and run the following command to start up the Coder server: diff --git a/docs/admin/users/groups-roles.md b/docs/admin/users/groups-roles.md index 91647db34c8f1..21dc22988b76b 100644 --- a/docs/admin/users/groups-roles.md +++ b/docs/admin/users/groups-roles.md @@ -17,16 +17,16 @@ which templates developers can use. For example: Roles determine which actions users can take within the platform. | | Auditor | User Admin | Template Admin | Owner | -| --------------------------------------------------------------- | ------- | ---------- | -------------- | ----- | -| Add and remove Users | | ✅ | | ✅ | -| Manage groups (enterprise) (premium) | | ✅ | | ✅ | -| Change User roles | | | | ✅ | -| Manage **ALL** Templates | | | ✅ | ✅ | -| View **ALL** Workspaces | | | ✅ | ✅ | -| Update and delete **ALL** Workspaces | | | | ✅ | -| Run [external provisioners](../provisioners.md) | | | ✅ | ✅ | -| Execute and use **ALL** Workspaces | | | | ✅ | -| View all user operation [Audit Logs](../security/audit-logs.md) | ✅ | | | ✅ | +|-----------------------------------------------------------------|---------|------------|----------------|-------| +| Add and remove Users | | ✅ | | ✅ | +| Manage groups (enterprise) (premium) | | ✅ | | ✅ | +| Change User roles | | | | ✅ | +| Manage **ALL** Templates | | | ✅ | ✅ | +| View **ALL** Workspaces | | | ✅ | ✅ | +| Update and delete **ALL** Workspaces | | | | ✅ | +| Run [external provisioners](../provisioners.md) | | | ✅ | ✅ | +| Execute and use **ALL** Workspaces | | | | ✅ | +| View all user operation [Audit Logs](../security/audit-logs.md) | ✅ | | | ✅ | A user may have one or more roles. All users have an implicit Member role that may use personal workspaces. diff --git a/docs/admin/users/idp-sync.md b/docs/admin/users/idp-sync.md index a28407c0ce788..8e9ea79a9a80b 100644 --- a/docs/admin/users/idp-sync.md +++ b/docs/admin/users/idp-sync.md @@ -1,3 +1,4 @@ + # IDP Sync
@@ -7,6 +8,8 @@ IDP sync is an Enterprise and Premium feature.
+## Group Sync + If your OpenID Connect provider supports group claims, you can configure Coder to synchronize groups in your auth provider to groups within Coder. To enable group sync, ensure that the `groups` claim is being sent by your OpenID @@ -141,10 +144,10 @@ will be able to configure this in the UI. For now, you must use CLI commands. ```json { - "field": "", - "mapping": null, - "regex_filter": null, - "auto_create_missing_groups": false + "field": "", + "mapping": null, + "regex_filter": null, + "auto_create_missing_groups": false } ``` @@ -153,10 +156,10 @@ Below is an example that uses the `groups` claim and maps all groups prefixed by ```json { - "field": "groups", - "mapping": null, - "regex_filter": "^coder-.*$", - "auto_create_missing_groups": true + "field": "groups", + "mapping": null, + "regex_filter": "^coder-.*$", + "auto_create_missing_groups": true } ``` @@ -174,16 +177,16 @@ group: ```json { - "field": "groups", - "mapping": { - "coder-admins": [ - "2ba2a4ff-ddfb-4493-b7cd-1aec2fa4c830", - "93371154-150f-4b12-b5f0-261bb1326bb4" - ], - "coder-users": ["2f4bde93-0179-4815-ba50-b757fb3d43dd"] - }, - "regex_filter": null, - "auto_create_missing_groups": false + "field": "groups", + "mapping": { + "coder-admins": [ + "2ba2a4ff-ddfb-4493-b7cd-1aec2fa4c830", + "93371154-150f-4b12-b5f0-261bb1326bb4" + ], + "coder-users": ["2f4bde93-0179-4815-ba50-b757fb3d43dd"] + }, + "regex_filter": null, + "auto_create_missing_groups": false } ``` @@ -209,7 +212,7 @@ Users who are not in a matching group will see the following error: Unauthorized group error -## Role sync +## Role Sync
@@ -307,8 +310,8 @@ will be able to configure this in the UI. For now, you must use CLI commands. ```json { - "field": "", - "mapping": null + "field": "", + "mapping": null } ``` @@ -318,11 +321,11 @@ role: ```json { - "field": "roles", - "mapping": { - "coder-admins": ["organization-admin"], - "infra-admins": ["provisioner-admin"] - } + "field": "roles", + "mapping": { + "coder-admins": ["organization-admin"], + "infra-admins": ["provisioner-admin"] + } } ``` @@ -372,7 +375,7 @@ dashboard:
-### Dashboard +## Dashboard 1. Confirm that your OIDC provider is sending claims. Log in with OIDC and visit the following URL with an `Owner` account: @@ -412,7 +415,7 @@ dashboard: ![IdP organization sync](../../images/admin/users/organizations/idp-org-sync.png) -### CLI +## CLI Use the Coder CLI to show and adjust the settings. @@ -455,7 +458,7 @@ settings, a user's memberships will update when they log out and log back in. Analyzing the JSON payload: | Field | Explanation | - | :-------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | + |:----------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | field | If this field is the empty string `""`, then org-sync is disabled.
Org memberships must be manually configured through the UI or API. | | mapping | Mapping takes a claim from the IdP, and associates it with 1 or more organizations by UUID.
No validation is done, so you can put UUID's of orgs that do not exist (a noop). The UI picker will allow selecting orgs from a drop down, and convert it to a UUID for you. | | organization_assign_default | This setting exists for maintaining backwards compatibility with single org deployments, either through their upgrade, or in perpetuity.
If this is set to 'true', all users will always be assigned to the default organization regardless of the mappings and their IdP claims. | diff --git a/docs/admin/users/quotas.md b/docs/admin/users/quotas.md index 4ac801148eb47..dd2c8a62bd51d 100644 --- a/docs/admin/users/quotas.md +++ b/docs/admin/users/quotas.md @@ -76,7 +76,7 @@ the sum of their allowances. For example: | Group Name | Quota Allowance | -| ---------- | --------------- | +|------------|-----------------| | Frontend | 10 | | Backend | 20 | | Data | 30 | @@ -84,7 +84,7 @@ For example:
| Username | Groups | Effective Budget | -| -------- | ----------------- | ---------------- | +|----------|-------------------|------------------| | jill | Frontend, Backend | 30 | | jack | Backend, Data | 50 | | sam | Data | 30 | diff --git a/docs/changelogs/index.md b/docs/changelogs/index.md index 3240a41bc0d50..885fceb9d4e1b 100644 --- a/docs/changelogs/index.md +++ b/docs/changelogs/index.md @@ -1,6 +1,6 @@ # Changelogs -These are the changelogs used by [generate_release_notes.sh]https://github.com/coder/coder/blob/main/scripts/release/generate_release_notes.sh) for a release. +These are the changelogs used by [generate_release_notes.sh](https://github.com/coder/coder/blob/main/scripts/release/generate_release_notes.sh) for a release. These changelogs are currently not kept in sync with GitHub releases. Use [GitHub releases](https://github.com/coder/coder/releases) for the latest information! diff --git a/docs/changelogs/v0.25.0.md b/docs/changelogs/v0.25.0.md index 9aa1f6526b25d..caf51f917e342 100644 --- a/docs/changelogs/v0.25.0.md +++ b/docs/changelogs/v0.25.0.md @@ -23,9 +23,11 @@ [--block-direct-connections](https://coder.com/docs/cli/server#--block-direct-connections) (#7936) - Search for workspaces based on last activity (#2658) + ```text last_seen_before:"2023-01-14T23:59:59Z" last_seen_after:"2023-01-08T00:00:00Z" ``` + - Queue position of pending workspace builds are shown in the dashboard (#8244) Queue position - Enable Terraform debug mode via deployment configuration (#8260) diff --git a/docs/changelogs/v0.27.0.md b/docs/changelogs/v0.27.0.md index dd7a259df49ad..361ef96e32ae5 100644 --- a/docs/changelogs/v0.27.0.md +++ b/docs/changelogs/v0.27.0.md @@ -50,81 +50,12 @@ Agent logs can be pushed after a workspace has started (#8528) ### Documentation -## Changelog - -### Breaking changes - -Agent logs can be pushed after a workspace has started (#8528) - -> ⚠️ **Warning:** You will need to -> [update](https://coder.com/docs/install) your local Coder CLI v0.27 -> to connect via `coder ssh`. - -### Features - -- [Empeheral parameters](https://registry.terraform.io/providers/coder/coder/latest/docs/data-sources/parameter#ephemeral) - allow users to specify a value for a single build (#8415) (#8524) - ![Ephemeral parameters](https://github.com/coder/coder/assets/22407953/89df0888-9abc-453a-ac54-f5d0e221b0b9) - > Upgrade to Coder Terraform Provider v0.11.1 to use ephemeral parameters in - > your templates -- Create template, if it doesn't exist with `templates push --create` (#8454) -- Workspaces now appear `unhealthy` in the dashboard and CLI if one or more - agents do not exist (#8541) (#8548) - ![Workspace health](https://github.com/coder/coder/assets/22407953/edbb1d70-61b5-4b45-bfe8-51abdab417cc) -- Reverse port-forward with `coder ssh -R` (#8515) -- Helm: custom command arguments in Helm chart (#8567) -- Template version messages (#8435) - 252772262-087f1338-f1e2-49fb-81f2-358070a46484 -- TTL and max TTL validation increased to 30 days (#8258) -- [Self-hosted docs](https://coder.com/docs/install/offline#offline-docs): - Host your own copy of Coder's documentation in your own environment (#8527) - (#8601) -- Add custom coder bin path for `config-ssh` (#8425) -- Admins can create workspaces for other users via the CLI (#8481) -- `coder_app` supports localhost apps running https (#8585) -- Base container image contains [jq](https://github.com/coder/coder/pull/8563) - for parsing mounted JSON secrets - -### Bug fixes - -- Check agent metadata every second instead of minute (#8614) -- `coder stat` fixes - - Read from alternate cgroup path (#8591) - - Improve detection of container environment (#8643) - - Unskip TestStatCPUCmd/JSON and explicitly set --host in test cmd invocation - (#8558) -- Avoid initial license reconfig if feature isn't enabled (#8586) -- Audit log records delete workspace action properly (#8494) -- Audit logs are properly paginated (#8513) -- Fix bottom border on build logs (#8554) -- Don't mark metadata with `interval: 0` as stale (#8627) -- Add some missing workspace updates (#7790) - -### Documentation - -- Custom API use cases (custom agent logs, CI/CD pipelines) (#8445) -- Docs on using remote Docker hosts (#8479) -- Added kubernetes option to workspace proxies (#8533) - -Compare: -[`v0.26.1...v0.26.2`](https://github.com/coder/coder/compare/v0.26.1...v0.27.0) - -## Container image - -- `docker pull ghcr.io/coder/coder:v0.26.2` - -## Install/upgrade - -Refer to our docs to [install](https://coder.com/docs/install) or -[upgrade](https://coder.com/docs/admin/upgrade) Coder, or use a -release asset below. - - Custom API use cases (custom agent logs, CI/CD pipelines) (#8445) - Docs on using remote Docker hosts (#8479) - Added kubernetes option to workspace proxies (#8533) Compare: -[`v0.26.1...v0.26.2`](https://github.com/coder/coder/compare/v0.26.1...v0.27.0) +[`v0.26.2...v0.27.0`](https://github.com/coder/coder/compare/v0.26.2...v0.27.0) ## Container image diff --git a/docs/changelogs/v2.0.0.md b/docs/changelogs/v2.0.0.md index a02fb765f768a..f74beaf14143c 100644 --- a/docs/changelogs/v2.0.0.md +++ b/docs/changelogs/v2.0.0.md @@ -18,7 +18,7 @@ While Coder v1 is being sunset, we still wanted to avoid versioning conflicts. What is not changing: -- Our feature roadmap: See what we have planned at https://coder.com/roadmap +- Our feature roadmap: See what we have planned at - Your upgrade path: You can safely upgrade from previous coder/coder releases to v2.x releases! - Our release cadence: We want features out as quickly as possible and feature @@ -33,7 +33,7 @@ What is changing: dashboard ] Questions? Feel free to ask in [our Discord](https://discord.gg/coder) or email -ben@coder.com! +! ## Changelog diff --git a/docs/changelogs/v2.1.1.md b/docs/changelogs/v2.1.1.md index e948046bcbf24..7a0d4d71bcfcc 100644 --- a/docs/changelogs/v2.1.1.md +++ b/docs/changelogs/v2.1.1.md @@ -7,7 +7,7 @@ ![Last used](https://user-images.githubusercontent.com/22407953/262407146-06cded4e-684e-4cff-86b7-4388270e7d03.png) > You can use `last_used_before` and `last_used_after` in the workspaces > search with [RFC3339Nano](https://www.rfc-editor.org/rfc/rfc3339) datetime -- Add `daily_cost`` to `coder ls` to show +- Add `daily_cost` to `coder ls` to show [quota](https://coder.com/docs/admin/quotas) consumption (#9200) (@ammario) - Added `coder_app` usage to template insights (#9138) (@mafredri) diff --git a/docs/changelogs/v2.1.5.md b/docs/changelogs/v2.1.5.md index f23eff4b67b25..1e440bd97e75a 100644 --- a/docs/changelogs/v2.1.5.md +++ b/docs/changelogs/v2.1.5.md @@ -17,11 +17,13 @@ [display apps](https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent#nested-schema-for-display_apps) in your template, such as VS Code (Insiders), web terminal, SSH, etc. (#9100) (@sreya) To add VS Code insiders into your template, you can set: + ```tf display_apps { vscode_insiders = true } ``` + ![Add insiders](https://user-images.githubusercontent.com/4856196/263852602-94a5cb56-b7c3-48cb-928a-3b5e0f4e964b.png) - Create a workspace from any template version (#9471) (@aslilac) - Add DataDog Go tracer (#9411) (@ammario) diff --git a/docs/changelogs/v2.5.0.md b/docs/changelogs/v2.5.0.md index a31731b7e7cc4..c0e81dec99acb 100644 --- a/docs/changelogs/v2.5.0.md +++ b/docs/changelogs/v2.5.0.md @@ -92,7 +92,7 @@ ### Documentation - Align CODER_HTTP_ADDRESS with document (#10779) (@JounQin) -- Migrate all deprecated `CODER_ADDRESS `to `CODER_HTTP_ADDRESS` (#10780) (@JounQin) +- Migrate all deprecated `CODER_ADDRESS` to `CODER_HTTP_ADDRESS` (#10780) (@JounQin) - Add documentation for template update policies (experimental) (#10804) (@sreya) - Fix typo in additional-clusters.md (#10868) (@bpmct) - Update FE guide (#10942) (@BrunoQuaresma) diff --git a/docs/contributing/CODE_OF_CONDUCT.md b/docs/contributing/CODE_OF_CONDUCT.md index 5e40eb816bc17..64fe6bfd8d4b6 100644 --- a/docs/contributing/CODE_OF_CONDUCT.md +++ b/docs/contributing/CODE_OF_CONDUCT.md @@ -55,7 +55,7 @@ further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at opensource@coder.com. All complaints +reported by contacting the project team at . All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further @@ -69,9 +69,9 @@ members of the project's leadership. This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at -https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + [homepage]: https://www.contributor-covenant.org For answers to common questions about this code of conduct, see -https://www.contributor-covenant.org/faq + diff --git a/docs/contributing/SECURITY.md b/docs/contributing/SECURITY.md index 35dc53efd6934..7344f126449fe 100644 --- a/docs/contributing/SECURITY.md +++ b/docs/contributing/SECURITY.md @@ -1,4 +1,4 @@ # Security Policy If you find a vulnerability, **DO NOT FILE AN ISSUE**. Instead, send an email to -security@coder.com. +. diff --git a/docs/contributing/documentation.md b/docs/contributing/documentation.md index 0f4ba55877b9a..b5b1a392c6923 100644 --- a/docs/contributing/documentation.md +++ b/docs/contributing/documentation.md @@ -25,7 +25,7 @@ If you have questions that aren't explicitly covered by this guide, consult the following third-party references: | **Type of guidance** | **Third-party reference** | -| -------------------- | -------------------------------------------------------------------------------------- | +|----------------------|----------------------------------------------------------------------------------------| | Spelling | [Merriam-Webster.com](https://www.merriam-webster.com/) | | Style - nontechnical | [The Chicago Manual of Style](https://www.chicagomanualofstyle.org/home.html) | | Style - technical | [Microsoft Writing Style Guide](https://docs.microsoft.com/en-us/style-guide/welcome/) | diff --git a/docs/contributing/feature-stages.md b/docs/contributing/feature-stages.md index 92d879de3ea90..97b8b020a4559 100644 --- a/docs/contributing/feature-stages.md +++ b/docs/contributing/feature-stages.md @@ -46,7 +46,7 @@ coder server --experiments=feature1,feature2 | Feature | Description | Available in | -| --------------- | ------------------------------------------------------------------- | ------------ | +|-----------------|---------------------------------------------------------------------|--------------| | `notifications` | Sends notifications via SMTP and webhooks following certain events. | stable | diff --git a/docs/contributing/frontend.md b/docs/contributing/frontend.md index c9d972711bce3..fd9d7ff0a64fe 100644 --- a/docs/contributing/frontend.md +++ b/docs/contributing/frontend.md @@ -23,14 +23,16 @@ You can run the UI and access the Coder dashboard in two ways: In both cases, you can access the dashboard on `http://localhost:8080`. If using `./scripts/develop.sh` you can log in with the default credentials. -> [!TIP] -> -> **Default Credentials:** `admin@coder.com` and `SomeSecurePassword!`. +
+ +**Default Credentials:** `admin@coder.com` and `SomeSecurePassword!`. + +
## Tech Stack Overview -All our dependencies are described in `site/package.json` but the following are -the most important: +All our dependencies are described in `site/package.json`, but the following are +the most important. - [React](https://reactjs.org/) for the UI framework - [Typescript](https://www.typescriptlang.org/) to keep our sanity @@ -129,17 +131,17 @@ within the component's story. ```tsx export const WithQuota: Story = { - parameters: { - queries: [ - { - key: getWorkspaceQuotaQueryKey(MockUser.username), - data: { - credits_consumed: 2, - budget: 40, - }, - }, - ], - }, + parameters: { + queries: [ + { + key: getWorkspaceQuotaQueryKey(MockUser.username), + data: { + credits_consumed: 2, + budget: 40, + }, + }, + ], + }, }; ``` @@ -156,12 +158,12 @@ execution. Here's an illustrative example:" ```ts export const getAgentListeningPorts = async ( - agentID: string, + agentID: string, ): Promise => { - const response = await axiosInstance.get( - `/api/v2/workspaceagents/${agentID}/listening-ports`, - ); - return response.data; + const response = await axiosInstance.get( + `/api/v2/workspaceagents/${agentID}/listening-ports`, + ); + return response.data; }; ``` @@ -170,10 +172,10 @@ as a single function. ```ts export const updateWorkspaceVersion = async ( - workspace: TypesGen.Workspace, + workspace: TypesGen.Workspace, ): Promise => { - const template = await getTemplate(workspace.template_id); - return startWorkspace(workspace.id, template.active_version_id); + const template = await getTemplate(workspace.template_id); + return startWorkspace(workspace.id, template.active_version_id); }; ``` @@ -224,10 +226,10 @@ inside the component itself using MUI's `visuallyHidden` utility function. import { visuallyHidden } from "@mui/utils"; ; ``` @@ -332,8 +334,8 @@ One thing we figured out that was slowing down our tests was the use of `ByRole` queries because of how it calculates the role attribute for every element on the `screen`. You can read more about it on the links below: -- https://stackoverflow.com/questions/69711888/react-testing-library-getbyrole-is-performing-extremely-slowly -- https://github.com/testing-library/dom-testing-library/issues/552#issuecomment-625172052 +- +- Even with `ByRole` having performance issues we still want to use it but for that, we have to scope the "querying" area by using the `within` command. So diff --git a/docs/install/cloud/azure-vm.md b/docs/install/cloud/azure-vm.md index 751d204b321b4..2ab41bc53a0b5 100644 --- a/docs/install/cloud/azure-vm.md +++ b/docs/install/cloud/azure-vm.md @@ -12,7 +12,7 @@ This guide assumes you have full administrator privileges on Azure. From the Azure Portal, navigate to the Virtual Machines Dashboard. Click Create, and select creating a new Azure Virtual machine . - +Azure VM creation page This will bring you to the `Create a virtual machine` page. Select the subscription group of your choice, or create one if necessary. @@ -22,14 +22,14 @@ of your choice. Change the region to something more appropriate for your current location. For this tutorial, we will use the base selection of the Ubuntu Gen2 Image and keep the rest of the base settings for this image the same. - +Azure VM instance details - +Azure VM size selection Up next, under `Inbound port rules` modify the Select `inbound ports` to also take in `HTTPS` and `HTTP`. - +Azure VM inbound port rules The set up for the image is complete at this stage. Click `Review and Create` - review the information and click `Create`. A popup will appear asking you to @@ -37,11 +37,11 @@ download the key pair for the server. Click `Download private key and create resource` and place it into a folder of your choice on your local system. - +Azure VM key pair generation Click `Return to create a virtual machine`. Your VM will start up! - +Azure VM deployment complete Click `Go to resource` in the virtual machine and copy the public IP address. You will need it to SSH into the virtual machine via your local machine. @@ -100,12 +100,12 @@ First, run `coder template init` to create your first template. You’ll be give a list of possible templates to use. This tutorial will show you how to set up your Coder instance to create a Linux based machine on Azure. - +Coder CLI template init Press `enter` to select `Develop in Linux on Azure` template. This will return the following: - +Coder CLI template init To get started using the Azure template, install the Azure CLI by following the instructions diff --git a/docs/install/offline.md b/docs/install/offline.md index 72db203d86dfb..6a41bd9437894 100644 --- a/docs/install/offline.md +++ b/docs/install/offline.md @@ -7,7 +7,7 @@ environments. However, some changes to your configuration are necessary. > offline with Kubernetes or Docker. | | Public deployments | Offline deployments | -| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|--------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | Terraform binary | By default, Coder downloads Terraform binary from [releases.hashicorp.com](https://releases.hashicorp.com) | Terraform binary must be included in `PATH` for the VM or container image. [Supported versions](https://github.com/coder/coder/blob/main/provisioner/terraform/install.go#L23-L24) | | Terraform registry | Coder templates will attempt to download providers from [registry.terraform.io](https://registry.terraform.io) or [custom source addresses](https://developer.hashicorp.com/terraform/language/providers/requirements#source-addresses) specified in each template | [Custom source addresses](https://developer.hashicorp.com/terraform/language/providers/requirements#source-addresses) can be specified in each Coder template, or a custom registry/mirror can be used. More details below | | STUN | By default, Coder uses Google's public STUN server for direct workspace connections | STUN can be safely [disabled](../reference/cli/server.md#--derp-server-stun-addresses) users can still connect via [relayed connections](../admin/networking/index.md#-geo-distribution). Alternatively, you can set a [custom DERP server](../reference/cli/server.md#--derp-server-stun-addresses) | diff --git a/docs/install/openshift.md b/docs/install/openshift.md index 88c117d5eef30..26bb99a7681e5 100644 --- a/docs/install/openshift.md +++ b/docs/install/openshift.md @@ -1,3 +1,5 @@ +# OpenShift + ## Requirements - OpenShift cluster running K8s 1.19+ (OpenShift 4.7+) @@ -46,13 +48,13 @@ coder: - For `runAsUser` / `runAsGroup`, you can retrieve the correct values for project UID and project GID with the following command: - ```console - oc get project coder -o json | jq -r '.metadata.annotations' - { + ```console + oc get project coder -o json | jq -r '.metadata.annotations' + { "openshift.io/sa.scc.supplemental-groups": "1000680000/10000", "openshift.io/sa.scc.uid-range": "1000680000/10000" - } - ``` + } + ``` Alternatively, you can set these values to `null` to allow OpenShift to automatically select the correct value for the project. diff --git a/docs/install/other/index.md b/docs/install/other/index.md index eabb6b2987fcc..3809d86812526 100644 --- a/docs/install/other/index.md +++ b/docs/install/other/index.md @@ -4,7 +4,7 @@ Coder has a number of alternate unofficial install methods. Contributions are welcome! | Platform Name | Status | Documentation | -| --------------------------------------------------------------------------------- | ---------- | -------------------------------------------------------------------------------------------- | +|-----------------------------------------------------------------------------------|------------|----------------------------------------------------------------------------------------------| | AWS EC2 | Official | [Guide: AWS](../cloud/ec2.md) | | Google Compute Engine | Official | [Guide: Google Compute Engine](../cloud/compute-engine.md) | | Azure AKS | Unofficial | [GitHub: coder-aks](https://github.com/ericpaulsen/coder-aks) | diff --git a/docs/install/releases.md b/docs/install/releases.md index f63e747654c80..b640704ea5ee3 100644 --- a/docs/install/releases.md +++ b/docs/install/releases.md @@ -7,6 +7,8 @@ We recommend enterprise customers test the compatibility of new releases with their infrastructure on a staging environment before upgrading a production deployment. +## Release channels + We support two release channels: [mainline](https://github.com/coder/coder/releases/tag/v2.16.0) for the bleeding edge version of Coder and @@ -53,7 +55,7 @@ pages. ## Release schedule | Release name | Release Date | Status | -| ------------ | ------------------ | ---------------- | +|--------------|--------------------|------------------| | 2.12.x | June 04, 2024 | Not Supported | | 2.13.x | July 02, 2024 | Not Supported | | 2.14.x | August 06, 2024 | Not Supported | @@ -61,7 +63,7 @@ pages. | 2.16.x | October 01, 2024 | Security Support | | 2.17.x | November 05, 2024 | Stable | | 2.18.x | December 03, 2024 | Mainline | -| 2.19.x | January 07, 2024 | Not Released | +| 2.19.x | February 04, 2024 | Not Released | > **Tip**: We publish a > [`preview`](https://github.com/coder/coder/pkgs/container/coder-preview) image diff --git a/docs/install/uninstall.md b/docs/install/uninstall.md index 9c0982d5cbe1a..3538af0494669 100644 --- a/docs/install/uninstall.md +++ b/docs/install/uninstall.md @@ -1,15 +1,10 @@ + # Uninstall This article walks you through how to uninstall your Coder server. To uninstall your Coder server, delete the following directories. -## Cached Coder releases - -```shell -rm -rf ~/.cache/coder -``` - ## The Coder server binary and CLI
@@ -71,7 +66,7 @@ winget uninstall Coder.Coder sudo rm /etc/coder.d/coder.env ``` -## Coder settings and the optional built-in PostgreSQL database +## Coder settings, cache, and the optional built-in PostgreSQL database > There is a `postgres` directory within the `coderv2` directory that has the > database engine and database. If you want to reuse the database, consider not @@ -89,6 +84,7 @@ rm -rf ~/Library/Application\ Support/coderv2 ```shell rm -rf ~/.config/coderv2 +rm -rf ~/.cache/coder ``` ## Windows diff --git a/docs/reference/agent-api/debug.md b/docs/reference/agent-api/debug.md index e9b2520f04701..ef1b3166f9b72 100644 --- a/docs/reference/agent-api/debug.md +++ b/docs/reference/agent-api/debug.md @@ -15,7 +15,7 @@ Get the first 10MiB of data from `$CODER_AGENT_LOG_DIR/coder-agent.log`. ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------ | +|--------|---------------------------------------------------------|-------------|--------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | | ## Get debug info for magicsock @@ -48,13 +48,13 @@ for more information. ### Parameters | Name | In | Type | Required | Description | -| ------- | ---- | ------- | -------- | ------------------- | +|---------|------|---------|----------|---------------------| | `state` | path | boolean | true | Debug logging state | ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------ | +|--------|---------------------------------------------------------|-------------|--------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | | ## Get debug manifest @@ -72,5 +72,5 @@ Get the manifest the agent fetched from `coderd` upon startup. ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [agentsdk.Manifest](./schemas.md#agentsdkmanifest) | diff --git a/docs/reference/agent-api/index.md b/docs/reference/agent-api/index.md index 21e7c5ec54f69..e6ca3b4626a48 100644 --- a/docs/reference/agent-api/index.md +++ b/docs/reference/agent-api/index.md @@ -1,4 +1,4 @@ -## Sections +# Sections This page is rendered on https://coder.com/docs/reference/agent-api. Refer to the other documents in the `agent-api/` directory. diff --git a/docs/reference/agent-api/schemas.md b/docs/reference/agent-api/schemas.md index 7aba4ebd5d230..a806529b098ac 100644 --- a/docs/reference/agent-api/schemas.md +++ b/docs/reference/agent-api/schemas.md @@ -4,86 +4,86 @@ ```json { - "agent_id": "151321db-0713-473c-ab42-2cc6ddeab1a4", - "agent_name": "string", - "owner_name": "string", - "workspace_id": "8ef13a0d-a5c9-4fb4-abf2-f8f65c3830fb", - "workspace_name": "string", - "git_auth_configs": 1, - "vscode_port_proxy_uri": "string", - "apps": [ - { - "id": "c488c933-688a-444e-a55d-f1e88ecc78f5", - "url": "string", - "external": false, - "slug": "string", - "display_name": "string", - "icon": "string", - "subdomain": false, - "sharing_level": "owner", - "healthcheck": { - "url": "string", - "interval": 5, - "threshold": 6 - }, - "health": "initializing" - } - ], - "derpmap": { - "HomeParams": {}, - "Regions": { - "1000": { - "EmbeddedRelay": false, - "RegionID": 1000, - "RegionCode": "string", - "RegionName": "string", - "Nodes": [ - { - "Name": "string", - "RegionID": 1000, - "HostName": "string", - "STUNPort": 19302, - "STUNOnly": true - } - ] - } - } - }, - "derp_force_websockets": false, - "environment_variables": { - "OIDC_TOKEN": "string" - }, - "directory": "string", - "motd_file": "string", - "disable_direct_connections": false, - "metadata": [ - { - "display_name": "string", - "key": "string", - "script": "string", - "interval": 10, - "timeout": 1 - } - ], - "scripts": [ - { - "log_source_id": "3e79c8da-08ae-48f4-b73e-11e194cdea06", - "log_path": "string", - "script": "string", - "cron": "string", - "run_on_start": true, - "run_on_stop": false, - "start_blocks_login": true, - "timeout": 0 - } - ] + "agent_id": "151321db-0713-473c-ab42-2cc6ddeab1a4", + "agent_name": "string", + "owner_name": "string", + "workspace_id": "8ef13a0d-a5c9-4fb4-abf2-f8f65c3830fb", + "workspace_name": "string", + "git_auth_configs": 1, + "vscode_port_proxy_uri": "string", + "apps": [ + { + "id": "c488c933-688a-444e-a55d-f1e88ecc78f5", + "url": "string", + "external": false, + "slug": "string", + "display_name": "string", + "icon": "string", + "subdomain": false, + "sharing_level": "owner", + "healthcheck": { + "url": "string", + "interval": 5, + "threshold": 6 + }, + "health": "initializing" + } + ], + "derpmap": { + "HomeParams": {}, + "Regions": { + "1000": { + "EmbeddedRelay": false, + "RegionID": 1000, + "RegionCode": "string", + "RegionName": "string", + "Nodes": [ + { + "Name": "string", + "RegionID": 1000, + "HostName": "string", + "STUNPort": 19302, + "STUNOnly": true + } + ] + } + } + }, + "derp_force_websockets": false, + "environment_variables": { + "OIDC_TOKEN": "string" + }, + "directory": "string", + "motd_file": "string", + "disable_direct_connections": false, + "metadata": [ + { + "display_name": "string", + "key": "string", + "script": "string", + "interval": 10, + "timeout": 1 + } + ], + "scripts": [ + { + "log_source_id": "3e79c8da-08ae-48f4-b73e-11e194cdea06", + "log_path": "string", + "script": "string", + "cron": "string", + "run_on_start": true, + "run_on_stop": false, + "start_blocks_login": true, + "timeout": 0 + } + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------------------------- | ------------------------------------------------------------------------------------------------- | -------- | ------------ | ----------- | +|------------------------------|---------------------------------------------------------------------------------------------------|----------|--------------|-------------| | `agent_id` | string | true | | | | `agent_name` | string | true | | | | `owner_name` | string | true | | | @@ -105,18 +105,18 @@ ```json { - "display_name": "string", - "key": "string", - "script": "string", - "interval": 10, - "timeout": 1 + "display_name": "string", + "key": "string", + "script": "string", + "interval": 10, + "timeout": 1 } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------- | ------- | -------- | ------------ | ----------- | +|----------------|---------|----------|--------------|-------------| | `display_name` | string | true | | | | `key` | string | true | | | | `script` | string | true | | | diff --git a/docs/reference/api/agents.md b/docs/reference/api/agents.md index 6ccffeb82305d..22ebe7f35530f 100644 --- a/docs/reference/api/agents.md +++ b/docs/reference/api/agents.md @@ -15,7 +15,7 @@ curl -X GET http://coder-server:8080/api/v2/derp-map \ ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------------------------ | ------------------- | ------ | +|--------|--------------------------------------------------------------------------|---------------------|--------| | 101 | [Switching Protocols](https://tools.ietf.org/html/rfc7231#section-6.2.2) | Switching Protocols | | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -35,7 +35,7 @@ curl -X GET http://coder-server:8080/api/v2/tailnet \ ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------------------------ | ------------------- | ------ | +|--------|--------------------------------------------------------------------------|---------------------|--------| | 101 | [Switching Protocols](https://tools.ietf.org/html/rfc7231#section-6.2.2) | Switching Protocols | | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -58,15 +58,15 @@ curl -X POST http://coder-server:8080/api/v2/workspaceagents/aws-instance-identi ```json { - "document": "string", - "signature": "string" + "document": "string", + "signature": "string" } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | -------------------------------------------------------------------------------- | -------- | ----------------------- | +|--------|------|----------------------------------------------------------------------------------|----------|-------------------------| | `body` | body | [agentsdk.AWSInstanceIdentityToken](schemas.md#agentsdkawsinstanceidentitytoken) | true | Instance identity token | ### Example responses @@ -75,14 +75,14 @@ curl -X POST http://coder-server:8080/api/v2/workspaceagents/aws-instance-identi ```json { - "session_token": "string" + "session_token": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [agentsdk.AuthenticateResponse](schemas.md#agentsdkauthenticateresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -105,15 +105,15 @@ curl -X POST http://coder-server:8080/api/v2/workspaceagents/azure-instance-iden ```json { - "encoding": "string", - "signature": "string" + "encoding": "string", + "signature": "string" } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | ------------------------------------------------------------------------------------ | -------- | ----------------------- | +|--------|------|--------------------------------------------------------------------------------------|----------|-------------------------| | `body` | body | [agentsdk.AzureInstanceIdentityToken](schemas.md#agentsdkazureinstanceidentitytoken) | true | Instance identity token | ### Example responses @@ -122,14 +122,14 @@ curl -X POST http://coder-server:8080/api/v2/workspaceagents/azure-instance-iden ```json { - "session_token": "string" + "session_token": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [agentsdk.AuthenticateResponse](schemas.md#agentsdkauthenticateresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -152,14 +152,14 @@ curl -X POST http://coder-server:8080/api/v2/workspaceagents/google-instance-ide ```json { - "json_web_token": "string" + "json_web_token": "string" } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | -------------------------------------------------------------------------------------- | -------- | ----------------------- | +|--------|------|----------------------------------------------------------------------------------------|----------|-------------------------| | `body` | body | [agentsdk.GoogleInstanceIdentityToken](schemas.md#agentsdkgoogleinstanceidentitytoken) | true | Instance identity token | ### Example responses @@ -168,14 +168,14 @@ curl -X POST http://coder-server:8080/api/v2/workspaceagents/google-instance-ide ```json { - "session_token": "string" + "session_token": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [agentsdk.AuthenticateResponse](schemas.md#agentsdkauthenticateresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -196,7 +196,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/me/external-auth?mat ### Parameters | Name | In | Type | Required | Description | -| -------- | ----- | ------- | -------- | --------------------------------- | +|----------|-------|---------|----------|-----------------------------------| | `match` | query | string | true | Match | | `id` | query | string | true | Provider ID | | `listen` | query | boolean | false | Wait for a new token to be issued | @@ -207,19 +207,19 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/me/external-auth?mat ```json { - "access_token": "string", - "password": "string", - "token_extra": {}, - "type": "string", - "url": "string", - "username": "string" + "access_token": "string", + "password": "string", + "token_extra": {}, + "type": "string", + "url": "string", + "username": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [agentsdk.ExternalAuthResponse](schemas.md#agentsdkexternalauthresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -240,7 +240,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/me/gitauth?match=str ### Parameters | Name | In | Type | Required | Description | -| -------- | ----- | ------- | -------- | --------------------------------- | +|----------|-------|---------|----------|-----------------------------------| | `match` | query | string | true | Match | | `id` | query | string | true | Provider ID | | `listen` | query | boolean | false | Wait for a new token to be issued | @@ -251,19 +251,19 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/me/gitauth?match=str ```json { - "access_token": "string", - "password": "string", - "token_extra": {}, - "type": "string", - "url": "string", - "username": "string" + "access_token": "string", + "password": "string", + "token_extra": {}, + "type": "string", + "url": "string", + "username": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [agentsdk.ExternalAuthResponse](schemas.md#agentsdkexternalauthresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -287,15 +287,15 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/me/gitsshkey \ ```json { - "private_key": "string", - "public_key": "string" + "private_key": "string", + "public_key": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [agentsdk.GitSSHKey](schemas.md#agentsdkgitsshkey) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -318,16 +318,16 @@ curl -X POST http://coder-server:8080/api/v2/workspaceagents/me/log-source \ ```json { - "display_name": "string", - "icon": "string", - "id": "string" + "display_name": "string", + "icon": "string", + "id": "string" } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | ------------------------------------------------------------------------ | -------- | ------------------ | +|--------|------|--------------------------------------------------------------------------|----------|--------------------| | `body` | body | [agentsdk.PostLogSourceRequest](schemas.md#agentsdkpostlogsourcerequest) | true | Log source request | ### Example responses @@ -336,18 +336,18 @@ curl -X POST http://coder-server:8080/api/v2/workspaceagents/me/log-source \ ```json { - "created_at": "2019-08-24T14:15:22Z", - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" + "created_at": "2019-08-24T14:15:22Z", + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.WorkspaceAgentLogSource](schemas.md#codersdkworkspaceagentlogsource) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -370,21 +370,21 @@ curl -X PATCH http://coder-server:8080/api/v2/workspaceagents/me/logs \ ```json { - "log_source_id": "string", - "logs": [ - { - "created_at": "string", - "level": "trace", - "output": "string" - } - ] + "log_source_id": "string", + "logs": [ + { + "created_at": "string", + "level": "trace", + "output": "string" + } + ] } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | -------------------------------------------------- | -------- | ----------- | +|--------|------|----------------------------------------------------|----------|-------------| | `body` | body | [agentsdk.PatchLogs](schemas.md#agentsdkpatchlogs) | true | logs | ### Example responses @@ -393,21 +393,21 @@ curl -X PATCH http://coder-server:8080/api/v2/workspaceagents/me/logs \ ```json { - "detail": "string", - "message": "string", - "validations": [ - { - "detail": "string", - "field": "string" - } - ] + "detail": "string", + "message": "string", + "validations": [ + { + "detail": "string", + "field": "string" + } + ] } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Response](schemas.md#codersdkresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -428,7 +428,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/{workspaceagent} \ ### Parameters | Name | In | Type | Required | Description | -| ---------------- | ---- | ------------ | -------- | ------------------ | +|------------------|------|--------------|----------|--------------------| | `workspaceagent` | path | string(uuid) | true | Workspace agent ID | ### Example responses @@ -437,101 +437,106 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/{workspaceagent} \ ```json { - "api_version": "string", - "apps": [ - { - "command": "string", - "display_name": "string", - "external": true, - "health": "disabled", - "healthcheck": { - "interval": 0, - "threshold": 0, - "url": "string" - }, - "hidden": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "sharing_level": "owner", - "slug": "string", - "subdomain": true, - "subdomain_name": "string", - "url": "string" - } - ], - "architecture": "string", - "connection_timeout_seconds": 0, - "created_at": "2019-08-24T14:15:22Z", - "directory": "string", - "disconnected_at": "2019-08-24T14:15:22Z", - "display_apps": ["vscode"], - "environment_variables": { - "property1": "string", - "property2": "string" - }, - "expanded_directory": "string", - "first_connected_at": "2019-08-24T14:15:22Z", - "health": { - "healthy": false, - "reason": "agent has lost connection" - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "instance_id": "string", - "last_connected_at": "2019-08-24T14:15:22Z", - "latency": { - "property1": { - "latency_ms": 0, - "preferred": true - }, - "property2": { - "latency_ms": 0, - "preferred": true - } - }, - "lifecycle_state": "created", - "log_sources": [ - { - "created_at": "2019-08-24T14:15:22Z", - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" - } - ], - "logs_length": 0, - "logs_overflowed": true, - "name": "string", - "operating_system": "string", - "ready_at": "2019-08-24T14:15:22Z", - "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", - "scripts": [ - { - "cron": "string", - "display_name": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "log_path": "string", - "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", - "run_on_start": true, - "run_on_stop": true, - "script": "string", - "start_blocks_login": true, - "timeout": 0 - } - ], - "started_at": "2019-08-24T14:15:22Z", - "startup_script_behavior": "blocking", - "status": "connecting", - "subsystems": ["envbox"], - "troubleshooting_url": "string", - "updated_at": "2019-08-24T14:15:22Z", - "version": "string" + "api_version": "string", + "apps": [ + { + "command": "string", + "display_name": "string", + "external": true, + "health": "disabled", + "healthcheck": { + "interval": 0, + "threshold": 0, + "url": "string" + }, + "hidden": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "open_in": "slim-window", + "sharing_level": "owner", + "slug": "string", + "subdomain": true, + "subdomain_name": "string", + "url": "string" + } + ], + "architecture": "string", + "connection_timeout_seconds": 0, + "created_at": "2019-08-24T14:15:22Z", + "directory": "string", + "disconnected_at": "2019-08-24T14:15:22Z", + "display_apps": [ + "vscode" + ], + "environment_variables": { + "property1": "string", + "property2": "string" + }, + "expanded_directory": "string", + "first_connected_at": "2019-08-24T14:15:22Z", + "health": { + "healthy": false, + "reason": "agent has lost connection" + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "instance_id": "string", + "last_connected_at": "2019-08-24T14:15:22Z", + "latency": { + "property1": { + "latency_ms": 0, + "preferred": true + }, + "property2": { + "latency_ms": 0, + "preferred": true + } + }, + "lifecycle_state": "created", + "log_sources": [ + { + "created_at": "2019-08-24T14:15:22Z", + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" + } + ], + "logs_length": 0, + "logs_overflowed": true, + "name": "string", + "operating_system": "string", + "ready_at": "2019-08-24T14:15:22Z", + "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", + "scripts": [ + { + "cron": "string", + "display_name": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "log_path": "string", + "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", + "run_on_start": true, + "run_on_stop": true, + "script": "string", + "start_blocks_login": true, + "timeout": 0 + } + ], + "started_at": "2019-08-24T14:15:22Z", + "startup_script_behavior": "blocking", + "status": "connecting", + "subsystems": [ + "envbox" + ], + "troubleshooting_url": "string", + "updated_at": "2019-08-24T14:15:22Z", + "version": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.WorkspaceAgent](schemas.md#codersdkworkspaceagent) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -552,7 +557,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/{workspaceagent}/con ### Parameters | Name | In | Type | Required | Description | -| ---------------- | ---- | ------------ | -------- | ------------------ | +|------------------|------|--------------|----------|--------------------| | `workspaceagent` | path | string(uuid) | true | Workspace agent ID | ### Example responses @@ -561,74 +566,74 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/{workspaceagent}/con ```json { - "derp_force_websockets": true, - "derp_map": { - "homeParams": { - "regionScore": { - "property1": 0, - "property2": 0 - } - }, - "omitDefaultRegions": true, - "regions": { - "property1": { - "avoid": true, - "embeddedRelay": true, - "nodes": [ - { - "canPort80": true, - "certName": "string", - "derpport": 0, - "forceHTTP": true, - "hostName": "string", - "insecureForTests": true, - "ipv4": "string", - "ipv6": "string", - "name": "string", - "regionID": 0, - "stunonly": true, - "stunport": 0, - "stuntestIP": "string" - } - ], - "regionCode": "string", - "regionID": 0, - "regionName": "string" - }, - "property2": { - "avoid": true, - "embeddedRelay": true, - "nodes": [ - { - "canPort80": true, - "certName": "string", - "derpport": 0, - "forceHTTP": true, - "hostName": "string", - "insecureForTests": true, - "ipv4": "string", - "ipv6": "string", - "name": "string", - "regionID": 0, - "stunonly": true, - "stunport": 0, - "stuntestIP": "string" - } - ], - "regionCode": "string", - "regionID": 0, - "regionName": "string" - } - } - }, - "disable_direct_connections": true + "derp_force_websockets": true, + "derp_map": { + "homeParams": { + "regionScore": { + "property1": 0, + "property2": 0 + } + }, + "omitDefaultRegions": true, + "regions": { + "property1": { + "avoid": true, + "embeddedRelay": true, + "nodes": [ + { + "canPort80": true, + "certName": "string", + "derpport": 0, + "forceHTTP": true, + "hostName": "string", + "insecureForTests": true, + "ipv4": "string", + "ipv6": "string", + "name": "string", + "regionID": 0, + "stunonly": true, + "stunport": 0, + "stuntestIP": "string" + } + ], + "regionCode": "string", + "regionID": 0, + "regionName": "string" + }, + "property2": { + "avoid": true, + "embeddedRelay": true, + "nodes": [ + { + "canPort80": true, + "certName": "string", + "derpport": 0, + "forceHTTP": true, + "hostName": "string", + "insecureForTests": true, + "ipv4": "string", + "ipv6": "string", + "name": "string", + "regionID": 0, + "stunonly": true, + "stunport": 0, + "stuntestIP": "string" + } + ], + "regionCode": "string", + "regionID": 0, + "regionName": "string" + } + } + }, + "disable_direct_connections": true } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [workspacesdk.AgentConnectionInfo](schemas.md#workspacesdkagentconnectioninfo) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -648,13 +653,13 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/{workspaceagent}/coo ### Parameters | Name | In | Type | Required | Description | -| ---------------- | ---- | ------------ | -------- | ------------------ | +|------------------|------|--------------|----------|--------------------| | `workspaceagent` | path | string(uuid) | true | Workspace agent ID | ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------------------------ | ------------------- | ------ | +|--------|--------------------------------------------------------------------------|---------------------|--------| | 101 | [Switching Protocols](https://tools.ietf.org/html/rfc7231#section-6.2.2) | Switching Protocols | | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -675,7 +680,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/{workspaceagent}/lis ### Parameters | Name | In | Type | Required | Description | -| ---------------- | ---- | ------------ | -------- | ------------------ | +|------------------|------|--------------|----------|--------------------| | `workspaceagent` | path | string(uuid) | true | Workspace agent ID | ### Example responses @@ -684,20 +689,20 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/{workspaceagent}/lis ```json { - "ports": [ - { - "network": "string", - "port": 0, - "process_name": "string" - } - ] + "ports": [ + { + "network": "string", + "port": 0, + "process_name": "string" + } + ] } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.WorkspaceAgentListeningPortsResponse](schemas.md#codersdkworkspaceagentlisteningportsresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -718,7 +723,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/{workspaceagent}/log ### Parameters | Name | In | Type | Required | Description | -| ---------------- | ----- | ------------ | -------- | -------------------------------------------- | +|------------------|-------|--------------|----------|----------------------------------------------| | `workspaceagent` | path | string(uuid) | true | Workspace agent ID | | `before` | query | integer | false | Before log id | | `after` | query | integer | false | After log id | @@ -731,20 +736,20 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/{workspaceagent}/log ```json [ - { - "created_at": "2019-08-24T14:15:22Z", - "id": 0, - "level": "trace", - "output": "string", - "source_id": "ae50a35c-df42-4eff-ba26-f8bc28d2af81" - } + { + "created_at": "2019-08-24T14:15:22Z", + "id": 0, + "level": "trace", + "output": "string", + "source_id": "ae50a35c-df42-4eff-ba26-f8bc28d2af81" + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-----------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.WorkspaceAgentLog](schemas.md#codersdkworkspaceagentlog) |

Response Schema

@@ -752,7 +757,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/{workspaceagent}/log Status Code **200** | Name | Type | Required | Restrictions | Description | -| -------------- | ------------------------------------------------ | -------- | ------------ | ----------- | +|----------------|--------------------------------------------------|----------|--------------|-------------| | `[array item]` | array | false | | | | `» created_at` | string(date-time) | false | | | | `» id` | integer | false | | | @@ -763,7 +768,7 @@ Status Code **200** #### Enumerated Values | Property | Value | -| -------- | ------- | +|----------|---------| | `level` | `trace` | | `level` | `debug` | | `level` | `info` | @@ -787,13 +792,13 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/{workspaceagent}/pty ### Parameters | Name | In | Type | Required | Description | -| ---------------- | ---- | ------------ | -------- | ------------------ | +|------------------|------|--------------|----------|--------------------| | `workspaceagent` | path | string(uuid) | true | Workspace agent ID | ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------------------------ | ------------------- | ------ | +|--------|--------------------------------------------------------------------------|---------------------|--------| | 101 | [Switching Protocols](https://tools.ietf.org/html/rfc7231#section-6.2.2) | Switching Protocols | | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -814,7 +819,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/{workspaceagent}/sta ### Parameters | Name | In | Type | Required | Description | -| ---------------- | ----- | ------------ | -------- | -------------------------------------------- | +|------------------|-------|--------------|----------|----------------------------------------------| | `workspaceagent` | path | string(uuid) | true | Workspace agent ID | | `before` | query | integer | false | Before log id | | `after` | query | integer | false | After log id | @@ -827,20 +832,20 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/{workspaceagent}/sta ```json [ - { - "created_at": "2019-08-24T14:15:22Z", - "id": 0, - "level": "trace", - "output": "string", - "source_id": "ae50a35c-df42-4eff-ba26-f8bc28d2af81" - } + { + "created_at": "2019-08-24T14:15:22Z", + "id": 0, + "level": "trace", + "output": "string", + "source_id": "ae50a35c-df42-4eff-ba26-f8bc28d2af81" + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-----------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.WorkspaceAgentLog](schemas.md#codersdkworkspaceagentlog) |

Response Schema

@@ -848,7 +853,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/{workspaceagent}/sta Status Code **200** | Name | Type | Required | Restrictions | Description | -| -------------- | ------------------------------------------------ | -------- | ------------ | ----------- | +|----------------|--------------------------------------------------|----------|--------------|-------------| | `[array item]` | array | false | | | | `» created_at` | string(date-time) | false | | | | `» id` | integer | false | | | @@ -859,7 +864,7 @@ Status Code **200** #### Enumerated Values | Property | Value | -| -------- | ------- | +|----------|---------| | `level` | `trace` | | `level` | `debug` | | `level` | `info` | diff --git a/docs/reference/api/applications.md b/docs/reference/api/applications.md index ce84a41438f87..77fe7095ee9db 100644 --- a/docs/reference/api/applications.md +++ b/docs/reference/api/applications.md @@ -15,13 +15,13 @@ curl -X GET http://coder-server:8080/api/v2/applications/auth-redirect \ ### Parameters | Name | In | Type | Required | Description | -| -------------- | ----- | ------ | -------- | -------------------- | +|----------------|-------|--------|----------|----------------------| | `redirect_uri` | query | string | false | Redirect destination | ### Responses | Status | Meaning | Description | Schema | -| ------ | ----------------------------------------------------------------------- | ------------------ | ------ | +|--------|-------------------------------------------------------------------------|--------------------|--------| | 307 | [Temporary Redirect](https://tools.ietf.org/html/rfc7231#section-6.4.7) | Temporary Redirect | | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -45,14 +45,14 @@ curl -X GET http://coder-server:8080/api/v2/applications/host \ ```json { - "host": "string" + "host": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.AppHostResponse](schemas.md#codersdkapphostresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). diff --git a/docs/reference/api/audit.md b/docs/reference/api/audit.md index 1cec64e9f8d68..3fc6e746f17c8 100644 --- a/docs/reference/api/audit.md +++ b/docs/reference/api/audit.md @@ -16,7 +16,7 @@ curl -X GET http://coder-server:8080/api/v2/audit?limit=0 \ ### Parameters | Name | In | Type | Required | Description | -| -------- | ----- | ------- | -------- | ------------ | +|----------|-------|---------|----------|--------------| | `q` | query | string | false | Search query | | `limit` | query | integer | true | Page limit | | `offset` | query | integer | false | Page offset | @@ -27,73 +27,77 @@ curl -X GET http://coder-server:8080/api/v2/audit?limit=0 \ ```json { - "audit_logs": [ - { - "action": "create", - "additional_fields": [0], - "description": "string", - "diff": { - "property1": { - "new": null, - "old": null, - "secret": true - }, - "property2": { - "new": null, - "old": null, - "secret": true - } - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "ip": "string", - "is_deleted": true, - "organization": { - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "name": "string" - }, - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "request_id": "266ea41d-adf5-480b-af50-15b940c2b846", - "resource_icon": "string", - "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", - "resource_link": "string", - "resource_target": "string", - "resource_type": "template", - "status_code": 0, - "time": "2019-08-24T14:15:22Z", - "user": { - "avatar_url": "http://example.com", - "created_at": "2019-08-24T14:15:22Z", - "email": "user@example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_seen_at": "2019-08-24T14:15:22Z", - "login_type": "", - "name": "string", - "organization_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "roles": [ - { - "display_name": "string", - "name": "string", - "organization_id": "string" - } - ], - "status": "active", - "theme_preference": "string", - "updated_at": "2019-08-24T14:15:22Z", - "username": "string" - }, - "user_agent": "string" - } - ], - "count": 0 + "audit_logs": [ + { + "action": "create", + "additional_fields": [ + 0 + ], + "description": "string", + "diff": { + "property1": { + "new": null, + "old": null, + "secret": true + }, + "property2": { + "new": null, + "old": null, + "secret": true + } + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "ip": "string", + "is_deleted": true, + "organization": { + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "name": "string" + }, + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "request_id": "266ea41d-adf5-480b-af50-15b940c2b846", + "resource_icon": "string", + "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", + "resource_link": "string", + "resource_target": "string", + "resource_type": "template", + "status_code": 0, + "time": "2019-08-24T14:15:22Z", + "user": { + "avatar_url": "http://example.com", + "created_at": "2019-08-24T14:15:22Z", + "email": "user@example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_seen_at": "2019-08-24T14:15:22Z", + "login_type": "", + "name": "string", + "organization_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "roles": [ + { + "display_name": "string", + "name": "string", + "organization_id": "string" + } + ], + "status": "active", + "theme_preference": "string", + "updated_at": "2019-08-24T14:15:22Z", + "username": "string" + }, + "user_agent": "string" + } + ], + "count": 0 } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.AuditLogResponse](schemas.md#codersdkauditlogresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). diff --git a/docs/reference/api/authorization.md b/docs/reference/api/authorization.md index 9dfbfb620870f..3565a8c922135 100644 --- a/docs/reference/api/authorization.md +++ b/docs/reference/api/authorization.md @@ -18,35 +18,35 @@ curl -X POST http://coder-server:8080/api/v2/authcheck \ ```json { - "checks": { - "property1": { - "action": "create", - "object": { - "any_org": true, - "organization_id": "string", - "owner_id": "string", - "resource_id": "string", - "resource_type": "*" - } - }, - "property2": { - "action": "create", - "object": { - "any_org": true, - "organization_id": "string", - "owner_id": "string", - "resource_id": "string", - "resource_type": "*" - } - } - } + "checks": { + "property1": { + "action": "create", + "object": { + "any_org": true, + "organization_id": "string", + "owner_id": "string", + "resource_id": "string", + "resource_type": "*" + } + }, + "property2": { + "action": "create", + "object": { + "any_org": true, + "organization_id": "string", + "owner_id": "string", + "resource_id": "string", + "resource_type": "*" + } + } + } } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | ------------------------------------------------------------------------ | -------- | --------------------- | +|--------|------|--------------------------------------------------------------------------|----------|-----------------------| | `body` | body | [codersdk.AuthorizationRequest](schemas.md#codersdkauthorizationrequest) | true | Authorization request | ### Example responses @@ -55,15 +55,15 @@ curl -X POST http://coder-server:8080/api/v2/authcheck \ ```json { - "property1": true, - "property2": true + "property1": true, + "property2": true } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.AuthorizationResponse](schemas.md#codersdkauthorizationresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -85,15 +85,15 @@ curl -X POST http://coder-server:8080/api/v2/users/login \ ```json { - "email": "user@example.com", - "password": "string" + "email": "user@example.com", + "password": "string" } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | -------------------------------------------------------------------------------- | -------- | ------------- | +|--------|------|----------------------------------------------------------------------------------|----------|---------------| | `body` | body | [codersdk.LoginWithPasswordRequest](schemas.md#codersdkloginwithpasswordrequest) | true | Login request | ### Example responses @@ -102,14 +102,14 @@ curl -X POST http://coder-server:8080/api/v2/users/login \ ```json { - "session_token": "string" + "session_token": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------------ | ----------- | ---------------------------------------------------------------------------------- | +|--------|--------------------------------------------------------------|-------------|------------------------------------------------------------------------------------| | 201 | [Created](https://tools.ietf.org/html/rfc7231#section-6.3.2) | Created | [codersdk.LoginWithPasswordResponse](schemas.md#codersdkloginwithpasswordresponse) | ## Change password with a one-time passcode @@ -128,22 +128,22 @@ curl -X POST http://coder-server:8080/api/v2/users/otp/change-password \ ```json { - "email": "user@example.com", - "one_time_passcode": "string", - "password": "string" + "email": "user@example.com", + "one_time_passcode": "string", + "password": "string" } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | ---------------------------------------------------------------------------------------------------------------- | -------- | ----------------------- | +|--------|------|------------------------------------------------------------------------------------------------------------------|----------|-------------------------| | `body` | body | [codersdk.ChangePasswordWithOneTimePasscodeRequest](schemas.md#codersdkchangepasswordwithonetimepasscoderequest) | true | Change password request | ### Responses | Status | Meaning | Description | Schema | -| ------ | --------------------------------------------------------------- | ----------- | ------ | +|--------|-----------------------------------------------------------------|-------------|--------| | 204 | [No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5) | No Content | | ## Request one-time passcode @@ -162,20 +162,20 @@ curl -X POST http://coder-server:8080/api/v2/users/otp/request \ ```json { - "email": "user@example.com" + "email": "user@example.com" } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | ------------------------------------------------------------------------------------------ | -------- | ------------------------- | +|--------|------|--------------------------------------------------------------------------------------------|----------|---------------------------| | `body` | body | [codersdk.RequestOneTimePasscodeRequest](schemas.md#codersdkrequestonetimepasscoderequest) | true | One-time passcode request | ### Responses | Status | Meaning | Description | Schema | -| ------ | --------------------------------------------------------------- | ----------- | ------ | +|--------|-----------------------------------------------------------------|-------------|--------| | 204 | [No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5) | No Content | | ## Validate user password @@ -196,14 +196,14 @@ curl -X POST http://coder-server:8080/api/v2/users/validate-password \ ```json { - "password": "string" + "password": "string" } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | -------------------------------------------------------------------------------------- | -------- | ------------------------------ | +|--------|------|----------------------------------------------------------------------------------------|----------|--------------------------------| | `body` | body | [codersdk.ValidateUserPasswordRequest](schemas.md#codersdkvalidateuserpasswordrequest) | true | Validate user password request | ### Example responses @@ -212,15 +212,15 @@ curl -X POST http://coder-server:8080/api/v2/users/validate-password \ ```json { - "details": "string", - "valid": true + "details": "string", + "valid": true } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|------------------------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.ValidateUserPasswordResponse](schemas.md#codersdkvalidateuserpasswordresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -243,15 +243,15 @@ curl -X POST http://coder-server:8080/api/v2/users/{user}/convert-login \ ```json { - "password": "string", - "to_type": "" + "password": "string", + "to_type": "" } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | ---------------------------------------------------------------------- | -------- | -------------------- | +|--------|------|------------------------------------------------------------------------|----------|----------------------| | `user` | path | string | true | User ID, name, or me | | `body` | body | [codersdk.ConvertLoginRequest](schemas.md#codersdkconvertloginrequest) | true | Convert request | @@ -261,17 +261,17 @@ curl -X POST http://coder-server:8080/api/v2/users/{user}/convert-login \ ```json { - "expires_at": "2019-08-24T14:15:22Z", - "state_string": "string", - "to_type": "", - "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5" + "expires_at": "2019-08-24T14:15:22Z", + "state_string": "string", + "to_type": "", + "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------------ | ----------- | ------------------------------------------------------------------------------ | +|--------|--------------------------------------------------------------|-------------|--------------------------------------------------------------------------------| | 201 | [Created](https://tools.ietf.org/html/rfc7231#section-6.3.2) | Created | [codersdk.OAuthConversionResponse](schemas.md#codersdkoauthconversionresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). diff --git a/docs/reference/api/builds.md b/docs/reference/api/builds.md index 1cbe384df8778..d9bea14e060c1 100644 --- a/docs/reference/api/builds.md +++ b/docs/reference/api/builds.md @@ -16,7 +16,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/workspace/{workspacenam ### Parameters | Name | In | Type | Required | Description | -| --------------- | ---- | -------------- | -------- | -------------------- | +|-----------------|------|----------------|----------|----------------------| | `user` | path | string | true | User ID, name, or me | | `workspacename` | path | string | true | Workspace name | | `buildnumber` | path | string(number) | true | Build number | @@ -27,167 +27,172 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/workspace/{workspacenam ```json { - "build_number": 0, - "created_at": "2019-08-24T14:15:22Z", - "daily_cost": 0, - "deadline": "2019-08-24T14:15:22Z", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "initiator_id": "06588898-9a84-4b35-ba8f-f9cbd64946f3", - "initiator_name": "string", - "job": { - "canceled_at": "2019-08-24T14:15:22Z", - "completed_at": "2019-08-24T14:15:22Z", - "created_at": "2019-08-24T14:15:22Z", - "error": "string", - "error_code": "REQUIRED_TEMPLATE_VARIABLES", - "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "queue_position": 0, - "queue_size": 0, - "started_at": "2019-08-24T14:15:22Z", - "status": "pending", - "tags": { - "property1": "string", - "property2": "string" - }, - "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" - }, - "matched_provisioners": { - "available": 0, - "count": 0, - "most_recently_seen": "2019-08-24T14:15:22Z" - }, - "max_deadline": "2019-08-24T14:15:22Z", - "reason": "initiator", - "resources": [ - { - "agents": [ - { - "api_version": "string", - "apps": [ - { - "command": "string", - "display_name": "string", - "external": true, - "health": "disabled", - "healthcheck": { - "interval": 0, - "threshold": 0, - "url": "string" - }, - "hidden": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "sharing_level": "owner", - "slug": "string", - "subdomain": true, - "subdomain_name": "string", - "url": "string" - } - ], - "architecture": "string", - "connection_timeout_seconds": 0, - "created_at": "2019-08-24T14:15:22Z", - "directory": "string", - "disconnected_at": "2019-08-24T14:15:22Z", - "display_apps": ["vscode"], - "environment_variables": { - "property1": "string", - "property2": "string" - }, - "expanded_directory": "string", - "first_connected_at": "2019-08-24T14:15:22Z", - "health": { - "healthy": false, - "reason": "agent has lost connection" - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "instance_id": "string", - "last_connected_at": "2019-08-24T14:15:22Z", - "latency": { - "property1": { - "latency_ms": 0, - "preferred": true - }, - "property2": { - "latency_ms": 0, - "preferred": true - } - }, - "lifecycle_state": "created", - "log_sources": [ - { - "created_at": "2019-08-24T14:15:22Z", - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" - } - ], - "logs_length": 0, - "logs_overflowed": true, - "name": "string", - "operating_system": "string", - "ready_at": "2019-08-24T14:15:22Z", - "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", - "scripts": [ - { - "cron": "string", - "display_name": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "log_path": "string", - "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", - "run_on_start": true, - "run_on_stop": true, - "script": "string", - "start_blocks_login": true, - "timeout": 0 - } - ], - "started_at": "2019-08-24T14:15:22Z", - "startup_script_behavior": "blocking", - "status": "connecting", - "subsystems": ["envbox"], - "troubleshooting_url": "string", - "updated_at": "2019-08-24T14:15:22Z", - "version": "string" - } - ], - "created_at": "2019-08-24T14:15:22Z", - "daily_cost": 0, - "hide": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", - "metadata": [ - { - "key": "string", - "sensitive": true, - "value": "string" - } - ], - "name": "string", - "type": "string", - "workspace_transition": "start" - } - ], - "status": "pending", - "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", - "template_version_name": "string", - "transition": "start", - "updated_at": "2019-08-24T14:15:22Z", - "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", - "workspace_name": "string", - "workspace_owner_avatar_url": "string", - "workspace_owner_id": "e7078695-5279-4c86-8774-3ac2367a2fc7", - "workspace_owner_name": "string" + "build_number": 0, + "created_at": "2019-08-24T14:15:22Z", + "daily_cost": 0, + "deadline": "2019-08-24T14:15:22Z", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "initiator_id": "06588898-9a84-4b35-ba8f-f9cbd64946f3", + "initiator_name": "string", + "job": { + "canceled_at": "2019-08-24T14:15:22Z", + "completed_at": "2019-08-24T14:15:22Z", + "created_at": "2019-08-24T14:15:22Z", + "error": "string", + "error_code": "REQUIRED_TEMPLATE_VARIABLES", + "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "queue_position": 0, + "queue_size": 0, + "started_at": "2019-08-24T14:15:22Z", + "status": "pending", + "tags": { + "property1": "string", + "property2": "string" + }, + "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" + }, + "matched_provisioners": { + "available": 0, + "count": 0, + "most_recently_seen": "2019-08-24T14:15:22Z" + }, + "max_deadline": "2019-08-24T14:15:22Z", + "reason": "initiator", + "resources": [ + { + "agents": [ + { + "api_version": "string", + "apps": [ + { + "command": "string", + "display_name": "string", + "external": true, + "health": "disabled", + "healthcheck": { + "interval": 0, + "threshold": 0, + "url": "string" + }, + "hidden": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "open_in": "slim-window", + "sharing_level": "owner", + "slug": "string", + "subdomain": true, + "subdomain_name": "string", + "url": "string" + } + ], + "architecture": "string", + "connection_timeout_seconds": 0, + "created_at": "2019-08-24T14:15:22Z", + "directory": "string", + "disconnected_at": "2019-08-24T14:15:22Z", + "display_apps": [ + "vscode" + ], + "environment_variables": { + "property1": "string", + "property2": "string" + }, + "expanded_directory": "string", + "first_connected_at": "2019-08-24T14:15:22Z", + "health": { + "healthy": false, + "reason": "agent has lost connection" + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "instance_id": "string", + "last_connected_at": "2019-08-24T14:15:22Z", + "latency": { + "property1": { + "latency_ms": 0, + "preferred": true + }, + "property2": { + "latency_ms": 0, + "preferred": true + } + }, + "lifecycle_state": "created", + "log_sources": [ + { + "created_at": "2019-08-24T14:15:22Z", + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" + } + ], + "logs_length": 0, + "logs_overflowed": true, + "name": "string", + "operating_system": "string", + "ready_at": "2019-08-24T14:15:22Z", + "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", + "scripts": [ + { + "cron": "string", + "display_name": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "log_path": "string", + "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", + "run_on_start": true, + "run_on_stop": true, + "script": "string", + "start_blocks_login": true, + "timeout": 0 + } + ], + "started_at": "2019-08-24T14:15:22Z", + "startup_script_behavior": "blocking", + "status": "connecting", + "subsystems": [ + "envbox" + ], + "troubleshooting_url": "string", + "updated_at": "2019-08-24T14:15:22Z", + "version": "string" + } + ], + "created_at": "2019-08-24T14:15:22Z", + "daily_cost": 0, + "hide": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", + "metadata": [ + { + "key": "string", + "sensitive": true, + "value": "string" + } + ], + "name": "string", + "type": "string", + "workspace_transition": "start" + } + ], + "status": "pending", + "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", + "template_version_name": "string", + "transition": "start", + "updated_at": "2019-08-24T14:15:22Z", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string", + "workspace_owner_avatar_url": "string", + "workspace_owner_id": "e7078695-5279-4c86-8774-3ac2367a2fc7", + "workspace_owner_name": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.WorkspaceBuild](schemas.md#codersdkworkspacebuild) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -208,7 +213,7 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild} \ ### Parameters | Name | In | Type | Required | Description | -| ---------------- | ---- | ------ | -------- | ------------------ | +|------------------|------|--------|----------|--------------------| | `workspacebuild` | path | string | true | Workspace build ID | ### Example responses @@ -217,167 +222,172 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild} \ ```json { - "build_number": 0, - "created_at": "2019-08-24T14:15:22Z", - "daily_cost": 0, - "deadline": "2019-08-24T14:15:22Z", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "initiator_id": "06588898-9a84-4b35-ba8f-f9cbd64946f3", - "initiator_name": "string", - "job": { - "canceled_at": "2019-08-24T14:15:22Z", - "completed_at": "2019-08-24T14:15:22Z", - "created_at": "2019-08-24T14:15:22Z", - "error": "string", - "error_code": "REQUIRED_TEMPLATE_VARIABLES", - "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "queue_position": 0, - "queue_size": 0, - "started_at": "2019-08-24T14:15:22Z", - "status": "pending", - "tags": { - "property1": "string", - "property2": "string" - }, - "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" - }, - "matched_provisioners": { - "available": 0, - "count": 0, - "most_recently_seen": "2019-08-24T14:15:22Z" - }, - "max_deadline": "2019-08-24T14:15:22Z", - "reason": "initiator", - "resources": [ - { - "agents": [ - { - "api_version": "string", - "apps": [ - { - "command": "string", - "display_name": "string", - "external": true, - "health": "disabled", - "healthcheck": { - "interval": 0, - "threshold": 0, - "url": "string" - }, - "hidden": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "sharing_level": "owner", - "slug": "string", - "subdomain": true, - "subdomain_name": "string", - "url": "string" - } - ], - "architecture": "string", - "connection_timeout_seconds": 0, - "created_at": "2019-08-24T14:15:22Z", - "directory": "string", - "disconnected_at": "2019-08-24T14:15:22Z", - "display_apps": ["vscode"], - "environment_variables": { - "property1": "string", - "property2": "string" - }, - "expanded_directory": "string", - "first_connected_at": "2019-08-24T14:15:22Z", - "health": { - "healthy": false, - "reason": "agent has lost connection" - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "instance_id": "string", - "last_connected_at": "2019-08-24T14:15:22Z", - "latency": { - "property1": { - "latency_ms": 0, - "preferred": true - }, - "property2": { - "latency_ms": 0, - "preferred": true - } - }, - "lifecycle_state": "created", - "log_sources": [ - { - "created_at": "2019-08-24T14:15:22Z", - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" - } - ], - "logs_length": 0, - "logs_overflowed": true, - "name": "string", - "operating_system": "string", - "ready_at": "2019-08-24T14:15:22Z", - "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", - "scripts": [ - { - "cron": "string", - "display_name": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "log_path": "string", - "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", - "run_on_start": true, - "run_on_stop": true, - "script": "string", - "start_blocks_login": true, - "timeout": 0 - } - ], - "started_at": "2019-08-24T14:15:22Z", - "startup_script_behavior": "blocking", - "status": "connecting", - "subsystems": ["envbox"], - "troubleshooting_url": "string", - "updated_at": "2019-08-24T14:15:22Z", - "version": "string" - } - ], - "created_at": "2019-08-24T14:15:22Z", - "daily_cost": 0, - "hide": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", - "metadata": [ - { - "key": "string", - "sensitive": true, - "value": "string" - } - ], - "name": "string", - "type": "string", - "workspace_transition": "start" - } - ], - "status": "pending", - "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", - "template_version_name": "string", - "transition": "start", - "updated_at": "2019-08-24T14:15:22Z", - "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", - "workspace_name": "string", - "workspace_owner_avatar_url": "string", - "workspace_owner_id": "e7078695-5279-4c86-8774-3ac2367a2fc7", - "workspace_owner_name": "string" + "build_number": 0, + "created_at": "2019-08-24T14:15:22Z", + "daily_cost": 0, + "deadline": "2019-08-24T14:15:22Z", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "initiator_id": "06588898-9a84-4b35-ba8f-f9cbd64946f3", + "initiator_name": "string", + "job": { + "canceled_at": "2019-08-24T14:15:22Z", + "completed_at": "2019-08-24T14:15:22Z", + "created_at": "2019-08-24T14:15:22Z", + "error": "string", + "error_code": "REQUIRED_TEMPLATE_VARIABLES", + "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "queue_position": 0, + "queue_size": 0, + "started_at": "2019-08-24T14:15:22Z", + "status": "pending", + "tags": { + "property1": "string", + "property2": "string" + }, + "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" + }, + "matched_provisioners": { + "available": 0, + "count": 0, + "most_recently_seen": "2019-08-24T14:15:22Z" + }, + "max_deadline": "2019-08-24T14:15:22Z", + "reason": "initiator", + "resources": [ + { + "agents": [ + { + "api_version": "string", + "apps": [ + { + "command": "string", + "display_name": "string", + "external": true, + "health": "disabled", + "healthcheck": { + "interval": 0, + "threshold": 0, + "url": "string" + }, + "hidden": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "open_in": "slim-window", + "sharing_level": "owner", + "slug": "string", + "subdomain": true, + "subdomain_name": "string", + "url": "string" + } + ], + "architecture": "string", + "connection_timeout_seconds": 0, + "created_at": "2019-08-24T14:15:22Z", + "directory": "string", + "disconnected_at": "2019-08-24T14:15:22Z", + "display_apps": [ + "vscode" + ], + "environment_variables": { + "property1": "string", + "property2": "string" + }, + "expanded_directory": "string", + "first_connected_at": "2019-08-24T14:15:22Z", + "health": { + "healthy": false, + "reason": "agent has lost connection" + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "instance_id": "string", + "last_connected_at": "2019-08-24T14:15:22Z", + "latency": { + "property1": { + "latency_ms": 0, + "preferred": true + }, + "property2": { + "latency_ms": 0, + "preferred": true + } + }, + "lifecycle_state": "created", + "log_sources": [ + { + "created_at": "2019-08-24T14:15:22Z", + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" + } + ], + "logs_length": 0, + "logs_overflowed": true, + "name": "string", + "operating_system": "string", + "ready_at": "2019-08-24T14:15:22Z", + "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", + "scripts": [ + { + "cron": "string", + "display_name": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "log_path": "string", + "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", + "run_on_start": true, + "run_on_stop": true, + "script": "string", + "start_blocks_login": true, + "timeout": 0 + } + ], + "started_at": "2019-08-24T14:15:22Z", + "startup_script_behavior": "blocking", + "status": "connecting", + "subsystems": [ + "envbox" + ], + "troubleshooting_url": "string", + "updated_at": "2019-08-24T14:15:22Z", + "version": "string" + } + ], + "created_at": "2019-08-24T14:15:22Z", + "daily_cost": 0, + "hide": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", + "metadata": [ + { + "key": "string", + "sensitive": true, + "value": "string" + } + ], + "name": "string", + "type": "string", + "workspace_transition": "start" + } + ], + "status": "pending", + "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", + "template_version_name": "string", + "transition": "start", + "updated_at": "2019-08-24T14:15:22Z", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string", + "workspace_owner_avatar_url": "string", + "workspace_owner_id": "e7078695-5279-4c86-8774-3ac2367a2fc7", + "workspace_owner_name": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.WorkspaceBuild](schemas.md#codersdkworkspacebuild) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -398,7 +408,7 @@ curl -X PATCH http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/c ### Parameters | Name | In | Type | Required | Description | -| ---------------- | ---- | ------ | -------- | ------------------ | +|------------------|------|--------|----------|--------------------| | `workspacebuild` | path | string | true | Workspace build ID | ### Example responses @@ -407,21 +417,21 @@ curl -X PATCH http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/c ```json { - "detail": "string", - "message": "string", - "validations": [ - { - "detail": "string", - "field": "string" - } - ] + "detail": "string", + "message": "string", + "validations": [ + { + "detail": "string", + "field": "string" + } + ] } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Response](schemas.md#codersdkresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -441,12 +451,12 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/log ### Parameters -| Name | In | Type | Required | Description | -| ---------------- | ----- | ------- | -------- | --------------------- | -| `workspacebuild` | path | string | true | Workspace build ID | -| `before` | query | integer | false | Before Unix timestamp | -| `after` | query | integer | false | After Unix timestamp | -| `follow` | query | boolean | false | Follow log stream | +| Name | In | Type | Required | Description | +|------------------|-------|---------|----------|--------------------| +| `workspacebuild` | path | string | true | Workspace build ID | +| `before` | query | integer | false | Before log id | +| `after` | query | integer | false | After log id | +| `follow` | query | boolean | false | Follow log stream | ### Example responses @@ -454,21 +464,21 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/log ```json [ - { - "created_at": "2019-08-24T14:15:22Z", - "id": 0, - "log_level": "trace", - "log_source": "provisioner_daemon", - "output": "string", - "stage": "string" - } + { + "created_at": "2019-08-24T14:15:22Z", + "id": 0, + "log_level": "trace", + "log_source": "provisioner_daemon", + "output": "string", + "stage": "string" + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-----------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.ProvisionerJobLog](schemas.md#codersdkprovisionerjoblog) |

Response Schema

@@ -476,7 +486,7 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/log Status Code **200** | Name | Type | Required | Restrictions | Description | -| -------------- | -------------------------------------------------- | -------- | ------------ | ----------- | +|----------------|----------------------------------------------------|----------|--------------|-------------| | `[array item]` | array | false | | | | `» created_at` | string(date-time) | false | | | | `» id` | integer | false | | | @@ -488,7 +498,7 @@ Status Code **200** #### Enumerated Values | Property | Value | -| ------------ | -------------------- | +|--------------|----------------------| | `log_level` | `trace` | | `log_level` | `debug` | | `log_level` | `info` | @@ -515,7 +525,7 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/par ### Parameters | Name | In | Type | Required | Description | -| ---------------- | ---- | ------ | -------- | ------------------ | +|------------------|------|--------|----------|--------------------| | `workspacebuild` | path | string | true | Workspace build ID | ### Example responses @@ -524,17 +534,17 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/par ```json [ - { - "name": "string", - "value": "string" - } + { + "name": "string", + "value": "string" + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-----------------------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.WorkspaceBuildParameter](schemas.md#codersdkworkspacebuildparameter) |

Response Schema

@@ -542,7 +552,7 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/par Status Code **200** | Name | Type | Required | Restrictions | Description | -| -------------- | ------ | -------- | ------------ | ----------- | +|----------------|--------|----------|--------------|-------------| | `[array item]` | array | false | | | | `» name` | string | false | | | | `» value` | string | false | | | @@ -565,7 +575,7 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/res ### Parameters | Name | In | Type | Required | Description | -| ---------------- | ---- | ------ | -------- | ------------------ | +|------------------|------|--------|----------|--------------------| | `workspacebuild` | path | string | true | Workspace build ID | ### Example responses @@ -574,123 +584,128 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/res ```json [ - { - "agents": [ - { - "api_version": "string", - "apps": [ - { - "command": "string", - "display_name": "string", - "external": true, - "health": "disabled", - "healthcheck": { - "interval": 0, - "threshold": 0, - "url": "string" - }, - "hidden": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "sharing_level": "owner", - "slug": "string", - "subdomain": true, - "subdomain_name": "string", - "url": "string" - } - ], - "architecture": "string", - "connection_timeout_seconds": 0, - "created_at": "2019-08-24T14:15:22Z", - "directory": "string", - "disconnected_at": "2019-08-24T14:15:22Z", - "display_apps": ["vscode"], - "environment_variables": { - "property1": "string", - "property2": "string" - }, - "expanded_directory": "string", - "first_connected_at": "2019-08-24T14:15:22Z", - "health": { - "healthy": false, - "reason": "agent has lost connection" - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "instance_id": "string", - "last_connected_at": "2019-08-24T14:15:22Z", - "latency": { - "property1": { - "latency_ms": 0, - "preferred": true - }, - "property2": { - "latency_ms": 0, - "preferred": true - } - }, - "lifecycle_state": "created", - "log_sources": [ - { - "created_at": "2019-08-24T14:15:22Z", - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" - } - ], - "logs_length": 0, - "logs_overflowed": true, - "name": "string", - "operating_system": "string", - "ready_at": "2019-08-24T14:15:22Z", - "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", - "scripts": [ - { - "cron": "string", - "display_name": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "log_path": "string", - "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", - "run_on_start": true, - "run_on_stop": true, - "script": "string", - "start_blocks_login": true, - "timeout": 0 - } - ], - "started_at": "2019-08-24T14:15:22Z", - "startup_script_behavior": "blocking", - "status": "connecting", - "subsystems": ["envbox"], - "troubleshooting_url": "string", - "updated_at": "2019-08-24T14:15:22Z", - "version": "string" - } - ], - "created_at": "2019-08-24T14:15:22Z", - "daily_cost": 0, - "hide": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", - "metadata": [ - { - "key": "string", - "sensitive": true, - "value": "string" - } - ], - "name": "string", - "type": "string", - "workspace_transition": "start" - } + { + "agents": [ + { + "api_version": "string", + "apps": [ + { + "command": "string", + "display_name": "string", + "external": true, + "health": "disabled", + "healthcheck": { + "interval": 0, + "threshold": 0, + "url": "string" + }, + "hidden": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "open_in": "slim-window", + "sharing_level": "owner", + "slug": "string", + "subdomain": true, + "subdomain_name": "string", + "url": "string" + } + ], + "architecture": "string", + "connection_timeout_seconds": 0, + "created_at": "2019-08-24T14:15:22Z", + "directory": "string", + "disconnected_at": "2019-08-24T14:15:22Z", + "display_apps": [ + "vscode" + ], + "environment_variables": { + "property1": "string", + "property2": "string" + }, + "expanded_directory": "string", + "first_connected_at": "2019-08-24T14:15:22Z", + "health": { + "healthy": false, + "reason": "agent has lost connection" + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "instance_id": "string", + "last_connected_at": "2019-08-24T14:15:22Z", + "latency": { + "property1": { + "latency_ms": 0, + "preferred": true + }, + "property2": { + "latency_ms": 0, + "preferred": true + } + }, + "lifecycle_state": "created", + "log_sources": [ + { + "created_at": "2019-08-24T14:15:22Z", + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" + } + ], + "logs_length": 0, + "logs_overflowed": true, + "name": "string", + "operating_system": "string", + "ready_at": "2019-08-24T14:15:22Z", + "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", + "scripts": [ + { + "cron": "string", + "display_name": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "log_path": "string", + "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", + "run_on_start": true, + "run_on_stop": true, + "script": "string", + "start_blocks_login": true, + "timeout": 0 + } + ], + "started_at": "2019-08-24T14:15:22Z", + "startup_script_behavior": "blocking", + "status": "connecting", + "subsystems": [ + "envbox" + ], + "troubleshooting_url": "string", + "updated_at": "2019-08-24T14:15:22Z", + "version": "string" + } + ], + "created_at": "2019-08-24T14:15:22Z", + "daily_cost": 0, + "hide": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", + "metadata": [ + { + "key": "string", + "sensitive": true, + "value": "string" + } + ], + "name": "string", + "type": "string", + "workspace_transition": "start" + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-----------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.WorkspaceResource](schemas.md#codersdkworkspaceresource) |

Response Schema

@@ -698,7 +713,7 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/res Status Code **200** | Name | Type | Required | Restrictions | Description | -| ------------------------------- | ------------------------------------------------------------------------------------------------------ | -------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|---------------------------------|--------------------------------------------------------------------------------------------------------|----------|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `[array item]` | array | false | | | | `» agents` | array | false | | | | `»» api_version` | string | false | | | @@ -714,6 +729,7 @@ Status Code **200** | `»»» hidden` | boolean | false | | | | `»»» icon` | string | false | | Icon is a relative path or external URL that specifies an icon to be displayed in the dashboard. | | `»»» id` | string(uuid) | false | | | +| `»»» open_in` | [codersdk.WorkspaceAppOpenIn](schemas.md#codersdkworkspaceappopenin) | false | | | | `»»» sharing_level` | [codersdk.WorkspaceAppSharingLevel](schemas.md#codersdkworkspaceappsharinglevel) | false | | | | `»»» slug` | string | false | | Slug is a unique identifier within the agent. | | `»»» subdomain` | boolean | false | | Subdomain denotes whether the app should be accessed via a path on the `coder server` or via a hostname-based dev URL. If this is set to true and there is no app wildcard configured on the server, the app will not be accessible in the UI. | @@ -787,11 +803,14 @@ Status Code **200** #### Enumerated Values | Property | Value | -| ------------------------- | ------------------ | +|---------------------------|--------------------| | `health` | `disabled` | | `health` | `initializing` | | `health` | `healthy` | | `health` | `unhealthy` | +| `open_in` | `slim-window` | +| `open_in` | `window` | +| `open_in` | `tab` | | `sharing_level` | `owner` | | `sharing_level` | `authenticated` | | `sharing_level` | `public` | @@ -832,7 +851,7 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/sta ### Parameters | Name | In | Type | Required | Description | -| ---------------- | ---- | ------ | -------- | ------------------ | +|------------------|------|--------|----------|--------------------| | `workspacebuild` | path | string | true | Workspace build ID | ### Example responses @@ -841,167 +860,172 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/sta ```json { - "build_number": 0, - "created_at": "2019-08-24T14:15:22Z", - "daily_cost": 0, - "deadline": "2019-08-24T14:15:22Z", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "initiator_id": "06588898-9a84-4b35-ba8f-f9cbd64946f3", - "initiator_name": "string", - "job": { - "canceled_at": "2019-08-24T14:15:22Z", - "completed_at": "2019-08-24T14:15:22Z", - "created_at": "2019-08-24T14:15:22Z", - "error": "string", - "error_code": "REQUIRED_TEMPLATE_VARIABLES", - "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "queue_position": 0, - "queue_size": 0, - "started_at": "2019-08-24T14:15:22Z", - "status": "pending", - "tags": { - "property1": "string", - "property2": "string" - }, - "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" - }, - "matched_provisioners": { - "available": 0, - "count": 0, - "most_recently_seen": "2019-08-24T14:15:22Z" - }, - "max_deadline": "2019-08-24T14:15:22Z", - "reason": "initiator", - "resources": [ - { - "agents": [ - { - "api_version": "string", - "apps": [ - { - "command": "string", - "display_name": "string", - "external": true, - "health": "disabled", - "healthcheck": { - "interval": 0, - "threshold": 0, - "url": "string" - }, - "hidden": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "sharing_level": "owner", - "slug": "string", - "subdomain": true, - "subdomain_name": "string", - "url": "string" - } - ], - "architecture": "string", - "connection_timeout_seconds": 0, - "created_at": "2019-08-24T14:15:22Z", - "directory": "string", - "disconnected_at": "2019-08-24T14:15:22Z", - "display_apps": ["vscode"], - "environment_variables": { - "property1": "string", - "property2": "string" - }, - "expanded_directory": "string", - "first_connected_at": "2019-08-24T14:15:22Z", - "health": { - "healthy": false, - "reason": "agent has lost connection" - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "instance_id": "string", - "last_connected_at": "2019-08-24T14:15:22Z", - "latency": { - "property1": { - "latency_ms": 0, - "preferred": true - }, - "property2": { - "latency_ms": 0, - "preferred": true - } - }, - "lifecycle_state": "created", - "log_sources": [ - { - "created_at": "2019-08-24T14:15:22Z", - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" - } - ], - "logs_length": 0, - "logs_overflowed": true, - "name": "string", - "operating_system": "string", - "ready_at": "2019-08-24T14:15:22Z", - "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", - "scripts": [ - { - "cron": "string", - "display_name": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "log_path": "string", - "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", - "run_on_start": true, - "run_on_stop": true, - "script": "string", - "start_blocks_login": true, - "timeout": 0 - } - ], - "started_at": "2019-08-24T14:15:22Z", - "startup_script_behavior": "blocking", - "status": "connecting", - "subsystems": ["envbox"], - "troubleshooting_url": "string", - "updated_at": "2019-08-24T14:15:22Z", - "version": "string" - } - ], - "created_at": "2019-08-24T14:15:22Z", - "daily_cost": 0, - "hide": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", - "metadata": [ - { - "key": "string", - "sensitive": true, - "value": "string" - } - ], - "name": "string", - "type": "string", - "workspace_transition": "start" - } - ], - "status": "pending", - "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", - "template_version_name": "string", - "transition": "start", - "updated_at": "2019-08-24T14:15:22Z", - "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", - "workspace_name": "string", - "workspace_owner_avatar_url": "string", - "workspace_owner_id": "e7078695-5279-4c86-8774-3ac2367a2fc7", - "workspace_owner_name": "string" + "build_number": 0, + "created_at": "2019-08-24T14:15:22Z", + "daily_cost": 0, + "deadline": "2019-08-24T14:15:22Z", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "initiator_id": "06588898-9a84-4b35-ba8f-f9cbd64946f3", + "initiator_name": "string", + "job": { + "canceled_at": "2019-08-24T14:15:22Z", + "completed_at": "2019-08-24T14:15:22Z", + "created_at": "2019-08-24T14:15:22Z", + "error": "string", + "error_code": "REQUIRED_TEMPLATE_VARIABLES", + "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "queue_position": 0, + "queue_size": 0, + "started_at": "2019-08-24T14:15:22Z", + "status": "pending", + "tags": { + "property1": "string", + "property2": "string" + }, + "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" + }, + "matched_provisioners": { + "available": 0, + "count": 0, + "most_recently_seen": "2019-08-24T14:15:22Z" + }, + "max_deadline": "2019-08-24T14:15:22Z", + "reason": "initiator", + "resources": [ + { + "agents": [ + { + "api_version": "string", + "apps": [ + { + "command": "string", + "display_name": "string", + "external": true, + "health": "disabled", + "healthcheck": { + "interval": 0, + "threshold": 0, + "url": "string" + }, + "hidden": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "open_in": "slim-window", + "sharing_level": "owner", + "slug": "string", + "subdomain": true, + "subdomain_name": "string", + "url": "string" + } + ], + "architecture": "string", + "connection_timeout_seconds": 0, + "created_at": "2019-08-24T14:15:22Z", + "directory": "string", + "disconnected_at": "2019-08-24T14:15:22Z", + "display_apps": [ + "vscode" + ], + "environment_variables": { + "property1": "string", + "property2": "string" + }, + "expanded_directory": "string", + "first_connected_at": "2019-08-24T14:15:22Z", + "health": { + "healthy": false, + "reason": "agent has lost connection" + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "instance_id": "string", + "last_connected_at": "2019-08-24T14:15:22Z", + "latency": { + "property1": { + "latency_ms": 0, + "preferred": true + }, + "property2": { + "latency_ms": 0, + "preferred": true + } + }, + "lifecycle_state": "created", + "log_sources": [ + { + "created_at": "2019-08-24T14:15:22Z", + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" + } + ], + "logs_length": 0, + "logs_overflowed": true, + "name": "string", + "operating_system": "string", + "ready_at": "2019-08-24T14:15:22Z", + "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", + "scripts": [ + { + "cron": "string", + "display_name": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "log_path": "string", + "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", + "run_on_start": true, + "run_on_stop": true, + "script": "string", + "start_blocks_login": true, + "timeout": 0 + } + ], + "started_at": "2019-08-24T14:15:22Z", + "startup_script_behavior": "blocking", + "status": "connecting", + "subsystems": [ + "envbox" + ], + "troubleshooting_url": "string", + "updated_at": "2019-08-24T14:15:22Z", + "version": "string" + } + ], + "created_at": "2019-08-24T14:15:22Z", + "daily_cost": 0, + "hide": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", + "metadata": [ + { + "key": "string", + "sensitive": true, + "value": "string" + } + ], + "name": "string", + "type": "string", + "workspace_transition": "start" + } + ], + "status": "pending", + "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", + "template_version_name": "string", + "transition": "start", + "updated_at": "2019-08-24T14:15:22Z", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string", + "workspace_owner_avatar_url": "string", + "workspace_owner_id": "e7078695-5279-4c86-8774-3ac2367a2fc7", + "workspace_owner_name": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.WorkspaceBuild](schemas.md#codersdkworkspacebuild) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1022,7 +1046,7 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/tim ### Parameters | Name | In | Type | Required | Description | -| ---------------- | ---- | ------------ | -------- | ------------------ | +|------------------|------|--------------|----------|--------------------| | `workspacebuild` | path | string(uuid) | true | Workspace build ID | ### Example responses @@ -1031,45 +1055,45 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/tim ```json { - "agent_connection_timings": [ - { - "ended_at": "2019-08-24T14:15:22Z", - "stage": "init", - "started_at": "2019-08-24T14:15:22Z", - "workspace_agent_id": "string", - "workspace_agent_name": "string" - } - ], - "agent_script_timings": [ - { - "display_name": "string", - "ended_at": "2019-08-24T14:15:22Z", - "exit_code": 0, - "stage": "init", - "started_at": "2019-08-24T14:15:22Z", - "status": "string", - "workspace_agent_id": "string", - "workspace_agent_name": "string" - } - ], - "provisioner_timings": [ - { - "action": "string", - "ended_at": "2019-08-24T14:15:22Z", - "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", - "resource": "string", - "source": "string", - "stage": "init", - "started_at": "2019-08-24T14:15:22Z" - } - ] + "agent_connection_timings": [ + { + "ended_at": "2019-08-24T14:15:22Z", + "stage": "init", + "started_at": "2019-08-24T14:15:22Z", + "workspace_agent_id": "string", + "workspace_agent_name": "string" + } + ], + "agent_script_timings": [ + { + "display_name": "string", + "ended_at": "2019-08-24T14:15:22Z", + "exit_code": 0, + "stage": "init", + "started_at": "2019-08-24T14:15:22Z", + "status": "string", + "workspace_agent_id": "string", + "workspace_agent_name": "string" + } + ], + "provisioner_timings": [ + { + "action": "string", + "ended_at": "2019-08-24T14:15:22Z", + "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", + "resource": "string", + "source": "string", + "stage": "init", + "started_at": "2019-08-24T14:15:22Z" + } + ] } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.WorkspaceBuildTimings](schemas.md#codersdkworkspacebuildtimings) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1090,7 +1114,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace}/builds \ ### Parameters | Name | In | Type | Required | Description | -| ----------- | ----- | ----------------- | -------- | --------------- | +|-------------|-------|-------------------|----------|-----------------| | `workspace` | path | string(uuid) | true | Workspace ID | | `after_id` | query | string(uuid) | false | After ID | | `limit` | query | integer | false | Page limit | @@ -1103,169 +1127,174 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace}/builds \ ```json [ - { - "build_number": 0, - "created_at": "2019-08-24T14:15:22Z", - "daily_cost": 0, - "deadline": "2019-08-24T14:15:22Z", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "initiator_id": "06588898-9a84-4b35-ba8f-f9cbd64946f3", - "initiator_name": "string", - "job": { - "canceled_at": "2019-08-24T14:15:22Z", - "completed_at": "2019-08-24T14:15:22Z", - "created_at": "2019-08-24T14:15:22Z", - "error": "string", - "error_code": "REQUIRED_TEMPLATE_VARIABLES", - "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "queue_position": 0, - "queue_size": 0, - "started_at": "2019-08-24T14:15:22Z", - "status": "pending", - "tags": { - "property1": "string", - "property2": "string" - }, - "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" - }, - "matched_provisioners": { - "available": 0, - "count": 0, - "most_recently_seen": "2019-08-24T14:15:22Z" - }, - "max_deadline": "2019-08-24T14:15:22Z", - "reason": "initiator", - "resources": [ - { - "agents": [ - { - "api_version": "string", - "apps": [ - { - "command": "string", - "display_name": "string", - "external": true, - "health": "disabled", - "healthcheck": { - "interval": 0, - "threshold": 0, - "url": "string" - }, - "hidden": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "sharing_level": "owner", - "slug": "string", - "subdomain": true, - "subdomain_name": "string", - "url": "string" - } - ], - "architecture": "string", - "connection_timeout_seconds": 0, - "created_at": "2019-08-24T14:15:22Z", - "directory": "string", - "disconnected_at": "2019-08-24T14:15:22Z", - "display_apps": ["vscode"], - "environment_variables": { - "property1": "string", - "property2": "string" - }, - "expanded_directory": "string", - "first_connected_at": "2019-08-24T14:15:22Z", - "health": { - "healthy": false, - "reason": "agent has lost connection" - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "instance_id": "string", - "last_connected_at": "2019-08-24T14:15:22Z", - "latency": { - "property1": { - "latency_ms": 0, - "preferred": true - }, - "property2": { - "latency_ms": 0, - "preferred": true - } - }, - "lifecycle_state": "created", - "log_sources": [ - { - "created_at": "2019-08-24T14:15:22Z", - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" - } - ], - "logs_length": 0, - "logs_overflowed": true, - "name": "string", - "operating_system": "string", - "ready_at": "2019-08-24T14:15:22Z", - "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", - "scripts": [ - { - "cron": "string", - "display_name": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "log_path": "string", - "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", - "run_on_start": true, - "run_on_stop": true, - "script": "string", - "start_blocks_login": true, - "timeout": 0 - } - ], - "started_at": "2019-08-24T14:15:22Z", - "startup_script_behavior": "blocking", - "status": "connecting", - "subsystems": ["envbox"], - "troubleshooting_url": "string", - "updated_at": "2019-08-24T14:15:22Z", - "version": "string" - } - ], - "created_at": "2019-08-24T14:15:22Z", - "daily_cost": 0, - "hide": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", - "metadata": [ - { - "key": "string", - "sensitive": true, - "value": "string" - } - ], - "name": "string", - "type": "string", - "workspace_transition": "start" - } - ], - "status": "pending", - "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", - "template_version_name": "string", - "transition": "start", - "updated_at": "2019-08-24T14:15:22Z", - "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", - "workspace_name": "string", - "workspace_owner_avatar_url": "string", - "workspace_owner_id": "e7078695-5279-4c86-8774-3ac2367a2fc7", - "workspace_owner_name": "string" - } + { + "build_number": 0, + "created_at": "2019-08-24T14:15:22Z", + "daily_cost": 0, + "deadline": "2019-08-24T14:15:22Z", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "initiator_id": "06588898-9a84-4b35-ba8f-f9cbd64946f3", + "initiator_name": "string", + "job": { + "canceled_at": "2019-08-24T14:15:22Z", + "completed_at": "2019-08-24T14:15:22Z", + "created_at": "2019-08-24T14:15:22Z", + "error": "string", + "error_code": "REQUIRED_TEMPLATE_VARIABLES", + "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "queue_position": 0, + "queue_size": 0, + "started_at": "2019-08-24T14:15:22Z", + "status": "pending", + "tags": { + "property1": "string", + "property2": "string" + }, + "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" + }, + "matched_provisioners": { + "available": 0, + "count": 0, + "most_recently_seen": "2019-08-24T14:15:22Z" + }, + "max_deadline": "2019-08-24T14:15:22Z", + "reason": "initiator", + "resources": [ + { + "agents": [ + { + "api_version": "string", + "apps": [ + { + "command": "string", + "display_name": "string", + "external": true, + "health": "disabled", + "healthcheck": { + "interval": 0, + "threshold": 0, + "url": "string" + }, + "hidden": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "open_in": "slim-window", + "sharing_level": "owner", + "slug": "string", + "subdomain": true, + "subdomain_name": "string", + "url": "string" + } + ], + "architecture": "string", + "connection_timeout_seconds": 0, + "created_at": "2019-08-24T14:15:22Z", + "directory": "string", + "disconnected_at": "2019-08-24T14:15:22Z", + "display_apps": [ + "vscode" + ], + "environment_variables": { + "property1": "string", + "property2": "string" + }, + "expanded_directory": "string", + "first_connected_at": "2019-08-24T14:15:22Z", + "health": { + "healthy": false, + "reason": "agent has lost connection" + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "instance_id": "string", + "last_connected_at": "2019-08-24T14:15:22Z", + "latency": { + "property1": { + "latency_ms": 0, + "preferred": true + }, + "property2": { + "latency_ms": 0, + "preferred": true + } + }, + "lifecycle_state": "created", + "log_sources": [ + { + "created_at": "2019-08-24T14:15:22Z", + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" + } + ], + "logs_length": 0, + "logs_overflowed": true, + "name": "string", + "operating_system": "string", + "ready_at": "2019-08-24T14:15:22Z", + "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", + "scripts": [ + { + "cron": "string", + "display_name": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "log_path": "string", + "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", + "run_on_start": true, + "run_on_stop": true, + "script": "string", + "start_blocks_login": true, + "timeout": 0 + } + ], + "started_at": "2019-08-24T14:15:22Z", + "startup_script_behavior": "blocking", + "status": "connecting", + "subsystems": [ + "envbox" + ], + "troubleshooting_url": "string", + "updated_at": "2019-08-24T14:15:22Z", + "version": "string" + } + ], + "created_at": "2019-08-24T14:15:22Z", + "daily_cost": 0, + "hide": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", + "metadata": [ + { + "key": "string", + "sensitive": true, + "value": "string" + } + ], + "name": "string", + "type": "string", + "workspace_transition": "start" + } + ], + "status": "pending", + "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", + "template_version_name": "string", + "transition": "start", + "updated_at": "2019-08-24T14:15:22Z", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string", + "workspace_owner_avatar_url": "string", + "workspace_owner_id": "e7078695-5279-4c86-8774-3ac2367a2fc7", + "workspace_owner_name": "string" + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-----------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.WorkspaceBuild](schemas.md#codersdkworkspacebuild) |

Response Schema

@@ -1273,7 +1302,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace}/builds \ Status Code **200** | Name | Type | Required | Restrictions | Description | -| -------------------------------- | ------------------------------------------------------------------------------------------------------ | -------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|----------------------------------|--------------------------------------------------------------------------------------------------------|----------|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `[array item]` | array | false | | | | `» build_number` | integer | false | | | | `» created_at` | string(date-time) | false | | | @@ -1318,6 +1347,7 @@ Status Code **200** | `»»»» hidden` | boolean | false | | | | `»»»» icon` | string | false | | Icon is a relative path or external URL that specifies an icon to be displayed in the dashboard. | | `»»»» id` | string(uuid) | false | | | +| `»»»» open_in` | [codersdk.WorkspaceAppOpenIn](schemas.md#codersdkworkspaceappopenin) | false | | | | `»»»» sharing_level` | [codersdk.WorkspaceAppSharingLevel](schemas.md#codersdkworkspaceappsharinglevel) | false | | | | `»»»» slug` | string | false | | Slug is a unique identifier within the agent. | | `»»»» subdomain` | boolean | false | | Subdomain denotes whether the app should be accessed via a path on the `coder server` or via a hostname-based dev URL. If this is set to true and there is no app wildcard configured on the server, the app will not be accessible in the UI. | @@ -1401,7 +1431,7 @@ Status Code **200** #### Enumerated Values | Property | Value | -| ------------------------- | ----------------------------- | +|---------------------------|-------------------------------| | `error_code` | `REQUIRED_TEMPLATE_VARIABLES` | | `status` | `pending` | | `status` | `running` | @@ -1416,6 +1446,9 @@ Status Code **200** | `health` | `initializing` | | `health` | `healthy` | | `health` | `unhealthy` | +| `open_in` | `slim-window` | +| `open_in` | `window` | +| `open_in` | `tab` | | `sharing_level` | `owner` | | `sharing_level` | `authenticated` | | `sharing_level` | `public` | @@ -1471,25 +1504,27 @@ curl -X POST http://coder-server:8080/api/v2/workspaces/{workspace}/builds \ ```json { - "dry_run": true, - "log_level": "debug", - "orphan": true, - "rich_parameter_values": [ - { - "name": "string", - "value": "string" - } - ], - "state": [0], - "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", - "transition": "start" + "dry_run": true, + "log_level": "debug", + "orphan": true, + "rich_parameter_values": [ + { + "name": "string", + "value": "string" + } + ], + "state": [ + 0 + ], + "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", + "transition": "start" } ``` ### Parameters | Name | In | Type | Required | Description | -| ----------- | ---- | -------------------------------------------------------------------------------------- | -------- | ------------------------------ | +|-------------|------|----------------------------------------------------------------------------------------|----------|--------------------------------| | `workspace` | path | string(uuid) | true | Workspace ID | | `body` | body | [codersdk.CreateWorkspaceBuildRequest](schemas.md#codersdkcreateworkspacebuildrequest) | true | Create workspace build request | @@ -1499,167 +1534,172 @@ curl -X POST http://coder-server:8080/api/v2/workspaces/{workspace}/builds \ ```json { - "build_number": 0, - "created_at": "2019-08-24T14:15:22Z", - "daily_cost": 0, - "deadline": "2019-08-24T14:15:22Z", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "initiator_id": "06588898-9a84-4b35-ba8f-f9cbd64946f3", - "initiator_name": "string", - "job": { - "canceled_at": "2019-08-24T14:15:22Z", - "completed_at": "2019-08-24T14:15:22Z", - "created_at": "2019-08-24T14:15:22Z", - "error": "string", - "error_code": "REQUIRED_TEMPLATE_VARIABLES", - "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "queue_position": 0, - "queue_size": 0, - "started_at": "2019-08-24T14:15:22Z", - "status": "pending", - "tags": { - "property1": "string", - "property2": "string" - }, - "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" - }, - "matched_provisioners": { - "available": 0, - "count": 0, - "most_recently_seen": "2019-08-24T14:15:22Z" - }, - "max_deadline": "2019-08-24T14:15:22Z", - "reason": "initiator", - "resources": [ - { - "agents": [ - { - "api_version": "string", - "apps": [ - { - "command": "string", - "display_name": "string", - "external": true, - "health": "disabled", - "healthcheck": { - "interval": 0, - "threshold": 0, - "url": "string" - }, - "hidden": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "sharing_level": "owner", - "slug": "string", - "subdomain": true, - "subdomain_name": "string", - "url": "string" - } - ], - "architecture": "string", - "connection_timeout_seconds": 0, - "created_at": "2019-08-24T14:15:22Z", - "directory": "string", - "disconnected_at": "2019-08-24T14:15:22Z", - "display_apps": ["vscode"], - "environment_variables": { - "property1": "string", - "property2": "string" - }, - "expanded_directory": "string", - "first_connected_at": "2019-08-24T14:15:22Z", - "health": { - "healthy": false, - "reason": "agent has lost connection" - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "instance_id": "string", - "last_connected_at": "2019-08-24T14:15:22Z", - "latency": { - "property1": { - "latency_ms": 0, - "preferred": true - }, - "property2": { - "latency_ms": 0, - "preferred": true - } - }, - "lifecycle_state": "created", - "log_sources": [ - { - "created_at": "2019-08-24T14:15:22Z", - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" - } - ], - "logs_length": 0, - "logs_overflowed": true, - "name": "string", - "operating_system": "string", - "ready_at": "2019-08-24T14:15:22Z", - "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", - "scripts": [ - { - "cron": "string", - "display_name": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "log_path": "string", - "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", - "run_on_start": true, - "run_on_stop": true, - "script": "string", - "start_blocks_login": true, - "timeout": 0 - } - ], - "started_at": "2019-08-24T14:15:22Z", - "startup_script_behavior": "blocking", - "status": "connecting", - "subsystems": ["envbox"], - "troubleshooting_url": "string", - "updated_at": "2019-08-24T14:15:22Z", - "version": "string" - } - ], - "created_at": "2019-08-24T14:15:22Z", - "daily_cost": 0, - "hide": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", - "metadata": [ - { - "key": "string", - "sensitive": true, - "value": "string" - } - ], - "name": "string", - "type": "string", - "workspace_transition": "start" - } - ], - "status": "pending", - "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", - "template_version_name": "string", - "transition": "start", - "updated_at": "2019-08-24T14:15:22Z", - "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", - "workspace_name": "string", - "workspace_owner_avatar_url": "string", - "workspace_owner_id": "e7078695-5279-4c86-8774-3ac2367a2fc7", - "workspace_owner_name": "string" + "build_number": 0, + "created_at": "2019-08-24T14:15:22Z", + "daily_cost": 0, + "deadline": "2019-08-24T14:15:22Z", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "initiator_id": "06588898-9a84-4b35-ba8f-f9cbd64946f3", + "initiator_name": "string", + "job": { + "canceled_at": "2019-08-24T14:15:22Z", + "completed_at": "2019-08-24T14:15:22Z", + "created_at": "2019-08-24T14:15:22Z", + "error": "string", + "error_code": "REQUIRED_TEMPLATE_VARIABLES", + "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "queue_position": 0, + "queue_size": 0, + "started_at": "2019-08-24T14:15:22Z", + "status": "pending", + "tags": { + "property1": "string", + "property2": "string" + }, + "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" + }, + "matched_provisioners": { + "available": 0, + "count": 0, + "most_recently_seen": "2019-08-24T14:15:22Z" + }, + "max_deadline": "2019-08-24T14:15:22Z", + "reason": "initiator", + "resources": [ + { + "agents": [ + { + "api_version": "string", + "apps": [ + { + "command": "string", + "display_name": "string", + "external": true, + "health": "disabled", + "healthcheck": { + "interval": 0, + "threshold": 0, + "url": "string" + }, + "hidden": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "open_in": "slim-window", + "sharing_level": "owner", + "slug": "string", + "subdomain": true, + "subdomain_name": "string", + "url": "string" + } + ], + "architecture": "string", + "connection_timeout_seconds": 0, + "created_at": "2019-08-24T14:15:22Z", + "directory": "string", + "disconnected_at": "2019-08-24T14:15:22Z", + "display_apps": [ + "vscode" + ], + "environment_variables": { + "property1": "string", + "property2": "string" + }, + "expanded_directory": "string", + "first_connected_at": "2019-08-24T14:15:22Z", + "health": { + "healthy": false, + "reason": "agent has lost connection" + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "instance_id": "string", + "last_connected_at": "2019-08-24T14:15:22Z", + "latency": { + "property1": { + "latency_ms": 0, + "preferred": true + }, + "property2": { + "latency_ms": 0, + "preferred": true + } + }, + "lifecycle_state": "created", + "log_sources": [ + { + "created_at": "2019-08-24T14:15:22Z", + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" + } + ], + "logs_length": 0, + "logs_overflowed": true, + "name": "string", + "operating_system": "string", + "ready_at": "2019-08-24T14:15:22Z", + "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", + "scripts": [ + { + "cron": "string", + "display_name": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "log_path": "string", + "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", + "run_on_start": true, + "run_on_stop": true, + "script": "string", + "start_blocks_login": true, + "timeout": 0 + } + ], + "started_at": "2019-08-24T14:15:22Z", + "startup_script_behavior": "blocking", + "status": "connecting", + "subsystems": [ + "envbox" + ], + "troubleshooting_url": "string", + "updated_at": "2019-08-24T14:15:22Z", + "version": "string" + } + ], + "created_at": "2019-08-24T14:15:22Z", + "daily_cost": 0, + "hide": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", + "metadata": [ + { + "key": "string", + "sensitive": true, + "value": "string" + } + ], + "name": "string", + "type": "string", + "workspace_transition": "start" + } + ], + "status": "pending", + "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", + "template_version_name": "string", + "transition": "start", + "updated_at": "2019-08-24T14:15:22Z", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string", + "workspace_owner_avatar_url": "string", + "workspace_owner_id": "e7078695-5279-4c86-8774-3ac2367a2fc7", + "workspace_owner_name": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.WorkspaceBuild](schemas.md#codersdkworkspacebuild) | To perform this operation, you must be authenticated. [Learn more](authentication.md). diff --git a/docs/reference/api/debug.md b/docs/reference/api/debug.md index 630e07510cc40..d92b7482fc374 100644 --- a/docs/reference/api/debug.md +++ b/docs/reference/api/debug.md @@ -15,7 +15,7 @@ curl -X GET http://coder-server:8080/api/v2/debug/coordinator \ ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------ | +|--------|---------------------------------------------------------|-------------|--------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -36,7 +36,7 @@ curl -X GET http://coder-server:8080/api/v2/debug/health \ ### Parameters | Name | In | Type | Required | Description | -| ------- | ----- | ------- | -------- | -------------------------- | +|---------|-------|---------|----------|----------------------------| | `force` | query | boolean | false | Force a healthcheck to run | ### Example responses @@ -45,340 +45,364 @@ curl -X GET http://coder-server:8080/api/v2/debug/health \ ```json { - "access_url": { - "access_url": "string", - "dismissed": true, - "error": "string", - "healthy": true, - "healthz_response": "string", - "reachable": true, - "severity": "ok", - "status_code": 0, - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ] - }, - "coder_version": "string", - "database": { - "dismissed": true, - "error": "string", - "healthy": true, - "latency": "string", - "latency_ms": 0, - "reachable": true, - "severity": "ok", - "threshold_ms": 0, - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ] - }, - "derp": { - "dismissed": true, - "error": "string", - "healthy": true, - "netcheck": { - "captivePortal": "string", - "globalV4": "string", - "globalV6": "string", - "hairPinning": "string", - "icmpv4": true, - "ipv4": true, - "ipv4CanSend": true, - "ipv6": true, - "ipv6CanSend": true, - "mappingVariesByDestIP": "string", - "oshasIPv6": true, - "pcp": "string", - "pmp": "string", - "preferredDERP": 0, - "regionLatency": { - "property1": 0, - "property2": 0 - }, - "regionV4Latency": { - "property1": 0, - "property2": 0 - }, - "regionV6Latency": { - "property1": 0, - "property2": 0 - }, - "udp": true, - "upnP": "string" - }, - "netcheck_err": "string", - "netcheck_logs": ["string"], - "regions": { - "property1": { - "error": "string", - "healthy": true, - "node_reports": [ - { - "can_exchange_messages": true, - "client_errs": [["string"]], - "client_logs": [["string"]], - "error": "string", - "healthy": true, - "node": { - "canPort80": true, - "certName": "string", - "derpport": 0, - "forceHTTP": true, - "hostName": "string", - "insecureForTests": true, - "ipv4": "string", - "ipv6": "string", - "name": "string", - "regionID": 0, - "stunonly": true, - "stunport": 0, - "stuntestIP": "string" - }, - "node_info": { - "tokenBucketBytesBurst": 0, - "tokenBucketBytesPerSecond": 0 - }, - "round_trip_ping": "string", - "round_trip_ping_ms": 0, - "severity": "ok", - "stun": { - "canSTUN": true, - "enabled": true, - "error": "string" - }, - "uses_websocket": true, - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ] - } - ], - "region": { - "avoid": true, - "embeddedRelay": true, - "nodes": [ - { - "canPort80": true, - "certName": "string", - "derpport": 0, - "forceHTTP": true, - "hostName": "string", - "insecureForTests": true, - "ipv4": "string", - "ipv6": "string", - "name": "string", - "regionID": 0, - "stunonly": true, - "stunport": 0, - "stuntestIP": "string" - } - ], - "regionCode": "string", - "regionID": 0, - "regionName": "string" - }, - "severity": "ok", - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ] - }, - "property2": { - "error": "string", - "healthy": true, - "node_reports": [ - { - "can_exchange_messages": true, - "client_errs": [["string"]], - "client_logs": [["string"]], - "error": "string", - "healthy": true, - "node": { - "canPort80": true, - "certName": "string", - "derpport": 0, - "forceHTTP": true, - "hostName": "string", - "insecureForTests": true, - "ipv4": "string", - "ipv6": "string", - "name": "string", - "regionID": 0, - "stunonly": true, - "stunport": 0, - "stuntestIP": "string" - }, - "node_info": { - "tokenBucketBytesBurst": 0, - "tokenBucketBytesPerSecond": 0 - }, - "round_trip_ping": "string", - "round_trip_ping_ms": 0, - "severity": "ok", - "stun": { - "canSTUN": true, - "enabled": true, - "error": "string" - }, - "uses_websocket": true, - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ] - } - ], - "region": { - "avoid": true, - "embeddedRelay": true, - "nodes": [ - { - "canPort80": true, - "certName": "string", - "derpport": 0, - "forceHTTP": true, - "hostName": "string", - "insecureForTests": true, - "ipv4": "string", - "ipv6": "string", - "name": "string", - "regionID": 0, - "stunonly": true, - "stunport": 0, - "stuntestIP": "string" - } - ], - "regionCode": "string", - "regionID": 0, - "regionName": "string" - }, - "severity": "ok", - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ] - } - }, - "severity": "ok", - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ] - }, - "healthy": true, - "provisioner_daemons": { - "dismissed": true, - "error": "string", - "items": [ - { - "provisioner_daemon": { - "api_version": "string", - "created_at": "2019-08-24T14:15:22Z", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "key_id": "1e779c8a-6786-4c89-b7c3-a6666f5fd6b5", - "last_seen_at": "2019-08-24T14:15:22Z", - "name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "provisioners": ["string"], - "tags": { - "property1": "string", - "property2": "string" - }, - "version": "string" - }, - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ] - } - ], - "severity": "ok", - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ] - }, - "severity": "ok", - "time": "2019-08-24T14:15:22Z", - "websocket": { - "body": "string", - "code": 0, - "dismissed": true, - "error": "string", - "healthy": true, - "severity": "ok", - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ] - }, - "workspace_proxy": { - "dismissed": true, - "error": "string", - "healthy": true, - "severity": "ok", - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ], - "workspace_proxies": { - "regions": [ - { - "created_at": "2019-08-24T14:15:22Z", - "deleted": true, - "derp_enabled": true, - "derp_only": true, - "display_name": "string", - "healthy": true, - "icon_url": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "name": "string", - "path_app_url": "string", - "status": { - "checked_at": "2019-08-24T14:15:22Z", - "report": { - "errors": ["string"], - "warnings": ["string"] - }, - "status": "ok" - }, - "updated_at": "2019-08-24T14:15:22Z", - "version": "string", - "wildcard_hostname": "string" - } - ] - } - } + "access_url": { + "access_url": "string", + "dismissed": true, + "error": "string", + "healthy": true, + "healthz_response": "string", + "reachable": true, + "severity": "ok", + "status_code": 0, + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ] + }, + "coder_version": "string", + "database": { + "dismissed": true, + "error": "string", + "healthy": true, + "latency": "string", + "latency_ms": 0, + "reachable": true, + "severity": "ok", + "threshold_ms": 0, + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ] + }, + "derp": { + "dismissed": true, + "error": "string", + "healthy": true, + "netcheck": { + "captivePortal": "string", + "globalV4": "string", + "globalV6": "string", + "hairPinning": "string", + "icmpv4": true, + "ipv4": true, + "ipv4CanSend": true, + "ipv6": true, + "ipv6CanSend": true, + "mappingVariesByDestIP": "string", + "oshasIPv6": true, + "pcp": "string", + "pmp": "string", + "preferredDERP": 0, + "regionLatency": { + "property1": 0, + "property2": 0 + }, + "regionV4Latency": { + "property1": 0, + "property2": 0 + }, + "regionV6Latency": { + "property1": 0, + "property2": 0 + }, + "udp": true, + "upnP": "string" + }, + "netcheck_err": "string", + "netcheck_logs": [ + "string" + ], + "regions": { + "property1": { + "error": "string", + "healthy": true, + "node_reports": [ + { + "can_exchange_messages": true, + "client_errs": [ + [ + "string" + ] + ], + "client_logs": [ + [ + "string" + ] + ], + "error": "string", + "healthy": true, + "node": { + "canPort80": true, + "certName": "string", + "derpport": 0, + "forceHTTP": true, + "hostName": "string", + "insecureForTests": true, + "ipv4": "string", + "ipv6": "string", + "name": "string", + "regionID": 0, + "stunonly": true, + "stunport": 0, + "stuntestIP": "string" + }, + "node_info": { + "tokenBucketBytesBurst": 0, + "tokenBucketBytesPerSecond": 0 + }, + "round_trip_ping": "string", + "round_trip_ping_ms": 0, + "severity": "ok", + "stun": { + "canSTUN": true, + "enabled": true, + "error": "string" + }, + "uses_websocket": true, + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ] + } + ], + "region": { + "avoid": true, + "embeddedRelay": true, + "nodes": [ + { + "canPort80": true, + "certName": "string", + "derpport": 0, + "forceHTTP": true, + "hostName": "string", + "insecureForTests": true, + "ipv4": "string", + "ipv6": "string", + "name": "string", + "regionID": 0, + "stunonly": true, + "stunport": 0, + "stuntestIP": "string" + } + ], + "regionCode": "string", + "regionID": 0, + "regionName": "string" + }, + "severity": "ok", + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ] + }, + "property2": { + "error": "string", + "healthy": true, + "node_reports": [ + { + "can_exchange_messages": true, + "client_errs": [ + [ + "string" + ] + ], + "client_logs": [ + [ + "string" + ] + ], + "error": "string", + "healthy": true, + "node": { + "canPort80": true, + "certName": "string", + "derpport": 0, + "forceHTTP": true, + "hostName": "string", + "insecureForTests": true, + "ipv4": "string", + "ipv6": "string", + "name": "string", + "regionID": 0, + "stunonly": true, + "stunport": 0, + "stuntestIP": "string" + }, + "node_info": { + "tokenBucketBytesBurst": 0, + "tokenBucketBytesPerSecond": 0 + }, + "round_trip_ping": "string", + "round_trip_ping_ms": 0, + "severity": "ok", + "stun": { + "canSTUN": true, + "enabled": true, + "error": "string" + }, + "uses_websocket": true, + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ] + } + ], + "region": { + "avoid": true, + "embeddedRelay": true, + "nodes": [ + { + "canPort80": true, + "certName": "string", + "derpport": 0, + "forceHTTP": true, + "hostName": "string", + "insecureForTests": true, + "ipv4": "string", + "ipv6": "string", + "name": "string", + "regionID": 0, + "stunonly": true, + "stunport": 0, + "stuntestIP": "string" + } + ], + "regionCode": "string", + "regionID": 0, + "regionName": "string" + }, + "severity": "ok", + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ] + } + }, + "severity": "ok", + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ] + }, + "healthy": true, + "provisioner_daemons": { + "dismissed": true, + "error": "string", + "items": [ + { + "provisioner_daemon": { + "api_version": "string", + "created_at": "2019-08-24T14:15:22Z", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "key_id": "1e779c8a-6786-4c89-b7c3-a6666f5fd6b5", + "last_seen_at": "2019-08-24T14:15:22Z", + "name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "provisioners": [ + "string" + ], + "tags": { + "property1": "string", + "property2": "string" + }, + "version": "string" + }, + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ] + } + ], + "severity": "ok", + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ] + }, + "severity": "ok", + "time": "2019-08-24T14:15:22Z", + "websocket": { + "body": "string", + "code": 0, + "dismissed": true, + "error": "string", + "healthy": true, + "severity": "ok", + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ] + }, + "workspace_proxy": { + "dismissed": true, + "error": "string", + "healthy": true, + "severity": "ok", + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ], + "workspace_proxies": { + "regions": [ + { + "created_at": "2019-08-24T14:15:22Z", + "deleted": true, + "derp_enabled": true, + "derp_only": true, + "display_name": "string", + "healthy": true, + "icon_url": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "name": "string", + "path_app_url": "string", + "status": { + "checked_at": "2019-08-24T14:15:22Z", + "report": { + "errors": [ + "string" + ], + "warnings": [ + "string" + ] + }, + "status": "ok" + }, + "updated_at": "2019-08-24T14:15:22Z", + "version": "string", + "wildcard_hostname": "string" + } + ] + } + } } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [healthsdk.HealthcheckReport](schemas.md#healthsdkhealthcheckreport) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -402,14 +426,16 @@ curl -X GET http://coder-server:8080/api/v2/debug/health/settings \ ```json { - "dismissed_healthchecks": ["DERP"] + "dismissed_healthchecks": [ + "DERP" + ] } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [healthsdk.HealthSettings](schemas.md#healthsdkhealthsettings) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -432,14 +458,16 @@ curl -X PUT http://coder-server:8080/api/v2/debug/health/settings \ ```json { - "dismissed_healthchecks": ["DERP"] + "dismissed_healthchecks": [ + "DERP" + ] } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | -------------------------------------------------------------------------- | -------- | ---------------------- | +|--------|------|----------------------------------------------------------------------------|----------|------------------------| | `body` | body | [healthsdk.UpdateHealthSettings](schemas.md#healthsdkupdatehealthsettings) | true | Update health settings | ### Example responses @@ -448,14 +476,16 @@ curl -X PUT http://coder-server:8080/api/v2/debug/health/settings \ ```json { - "dismissed_healthchecks": ["DERP"] + "dismissed_healthchecks": [ + "DERP" + ] } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [healthsdk.UpdateHealthSettings](schemas.md#healthsdkupdatehealthsettings) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -475,7 +505,7 @@ curl -X GET http://coder-server:8080/api/v2/debug/tailnet \ ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------ | +|--------|---------------------------------------------------------|-------------|--------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | | To perform this operation, you must be authenticated. [Learn more](authentication.md). diff --git a/docs/reference/api/enterprise.md b/docs/reference/api/enterprise.md index 8913e45257af5..80515f3ee7bef 100644 --- a/docs/reference/api/enterprise.md +++ b/docs/reference/api/enterprise.md @@ -19,35 +19,35 @@ curl -X GET http://coder-server:8080/api/v2/appearance \ ```json { - "announcement_banners": [ - { - "background_color": "string", - "enabled": true, - "message": "string" - } - ], - "application_name": "string", - "docs_url": "string", - "logo_url": "string", - "service_banner": { - "background_color": "string", - "enabled": true, - "message": "string" - }, - "support_links": [ - { - "icon": "bug", - "name": "string", - "target": "string" - } - ] + "announcement_banners": [ + { + "background_color": "string", + "enabled": true, + "message": "string" + } + ], + "application_name": "string", + "docs_url": "string", + "logo_url": "string", + "service_banner": { + "background_color": "string", + "enabled": true, + "message": "string" + }, + "support_links": [ + { + "icon": "bug", + "name": "string", + "target": "string" + } + ] } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.AppearanceConfig](schemas.md#codersdkappearanceconfig) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -70,27 +70,27 @@ curl -X PUT http://coder-server:8080/api/v2/appearance \ ```json { - "announcement_banners": [ - { - "background_color": "string", - "enabled": true, - "message": "string" - } - ], - "application_name": "string", - "logo_url": "string", - "service_banner": { - "background_color": "string", - "enabled": true, - "message": "string" - } + "announcement_banners": [ + { + "background_color": "string", + "enabled": true, + "message": "string" + } + ], + "application_name": "string", + "logo_url": "string", + "service_banner": { + "background_color": "string", + "enabled": true, + "message": "string" + } } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | ---------------------------------------------------------------------------- | -------- | ------------------------- | +|--------|------|------------------------------------------------------------------------------|----------|---------------------------| | `body` | body | [codersdk.UpdateAppearanceConfig](schemas.md#codersdkupdateappearanceconfig) | true | Update appearance request | ### Example responses @@ -99,27 +99,27 @@ curl -X PUT http://coder-server:8080/api/v2/appearance \ ```json { - "announcement_banners": [ - { - "background_color": "string", - "enabled": true, - "message": "string" - } - ], - "application_name": "string", - "logo_url": "string", - "service_banner": { - "background_color": "string", - "enabled": true, - "message": "string" - } + "announcement_banners": [ + { + "background_color": "string", + "enabled": true, + "message": "string" + } + ], + "application_name": "string", + "logo_url": "string", + "service_banner": { + "background_color": "string", + "enabled": true, + "message": "string" + } } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|------------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.UpdateAppearanceConfig](schemas.md#codersdkupdateappearanceconfig) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -143,33 +143,37 @@ curl -X GET http://coder-server:8080/api/v2/entitlements \ ```json { - "errors": ["string"], - "features": { - "property1": { - "actual": 0, - "enabled": true, - "entitlement": "entitled", - "limit": 0 - }, - "property2": { - "actual": 0, - "enabled": true, - "entitlement": "entitled", - "limit": 0 - } - }, - "has_license": true, - "refreshed_at": "2019-08-24T14:15:22Z", - "require_telemetry": true, - "trial": true, - "warnings": ["string"] + "errors": [ + "string" + ], + "features": { + "property1": { + "actual": 0, + "enabled": true, + "entitlement": "entitled", + "limit": 0 + }, + "property2": { + "actual": 0, + "enabled": true, + "entitlement": "entitled", + "limit": 0 + } + }, + "has_license": true, + "refreshed_at": "2019-08-24T14:15:22Z", + "require_telemetry": true, + "trial": true, + "warnings": [ + "string" + ] } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Entitlements](schemas.md#codersdkentitlements) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -190,7 +194,7 @@ curl -X GET http://coder-server:8080/api/v2/groups?organization=string&has_membe ### Parameters | Name | In | Type | Required | Description | -| -------------- | ----- | ------ | -------- | --------------------------------- | +|----------------|-------|--------|----------|-----------------------------------| | `organization` | query | string | true | Organization ID or name | | `has_member` | query | string | true | User ID or name | | `group_ids` | query | string | true | Comma separated list of group IDs | @@ -201,40 +205,40 @@ curl -X GET http://coder-server:8080/api/v2/groups?organization=string&has_membe ```json [ - { - "avatar_url": "string", - "display_name": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "members": [ - { - "avatar_url": "http://example.com", - "created_at": "2019-08-24T14:15:22Z", - "email": "user@example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_seen_at": "2019-08-24T14:15:22Z", - "login_type": "", - "name": "string", - "status": "active", - "theme_preference": "string", - "updated_at": "2019-08-24T14:15:22Z", - "username": "string" - } - ], - "name": "string", - "organization_display_name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "organization_name": "string", - "quota_allowance": 0, - "source": "user", - "total_member_count": 0 - } + { + "avatar_url": "string", + "display_name": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "members": [ + { + "avatar_url": "http://example.com", + "created_at": "2019-08-24T14:15:22Z", + "email": "user@example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_seen_at": "2019-08-24T14:15:22Z", + "login_type": "", + "name": "string", + "status": "active", + "theme_preference": "string", + "updated_at": "2019-08-24T14:15:22Z", + "username": "string" + } + ], + "name": "string", + "organization_display_name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "organization_name": "string", + "quota_allowance": 0, + "source": "user", + "total_member_count": 0 + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-----------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.Group](schemas.md#codersdkgroup) |

Response Schema

@@ -242,7 +246,7 @@ curl -X GET http://coder-server:8080/api/v2/groups?organization=string&has_membe Status Code **200** | Name | Type | Required | Restrictions | Description | -| ----------------------------- | ------------------------------------------------------ | -------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|-------------------------------|--------------------------------------------------------|----------|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `[array item]` | array | false | | | | `» avatar_url` | string | false | | | | `» display_name` | string | false | | | @@ -270,7 +274,7 @@ Status Code **200** #### Enumerated Values | Property | Value | -| ------------ | ----------- | +|--------------|-------------| | `login_type` | `` | | `login_type` | `password` | | `login_type` | `github` | @@ -300,7 +304,7 @@ curl -X GET http://coder-server:8080/api/v2/groups/{group} \ ### Parameters | Name | In | Type | Required | Description | -| ------- | ---- | ------ | -------- | ----------- | +|---------|------|--------|----------|-------------| | `group` | path | string | true | Group id | ### Example responses @@ -309,38 +313,38 @@ curl -X GET http://coder-server:8080/api/v2/groups/{group} \ ```json { - "avatar_url": "string", - "display_name": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "members": [ - { - "avatar_url": "http://example.com", - "created_at": "2019-08-24T14:15:22Z", - "email": "user@example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_seen_at": "2019-08-24T14:15:22Z", - "login_type": "", - "name": "string", - "status": "active", - "theme_preference": "string", - "updated_at": "2019-08-24T14:15:22Z", - "username": "string" - } - ], - "name": "string", - "organization_display_name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "organization_name": "string", - "quota_allowance": 0, - "source": "user", - "total_member_count": 0 + "avatar_url": "string", + "display_name": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "members": [ + { + "avatar_url": "http://example.com", + "created_at": "2019-08-24T14:15:22Z", + "email": "user@example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_seen_at": "2019-08-24T14:15:22Z", + "login_type": "", + "name": "string", + "status": "active", + "theme_preference": "string", + "updated_at": "2019-08-24T14:15:22Z", + "username": "string" + } + ], + "name": "string", + "organization_display_name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "organization_name": "string", + "quota_allowance": 0, + "source": "user", + "total_member_count": 0 } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Group](schemas.md#codersdkgroup) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -361,7 +365,7 @@ curl -X DELETE http://coder-server:8080/api/v2/groups/{group} \ ### Parameters | Name | In | Type | Required | Description | -| ------- | ---- | ------ | -------- | ----------- | +|---------|------|--------|----------|-------------| | `group` | path | string | true | Group name | ### Example responses @@ -370,38 +374,38 @@ curl -X DELETE http://coder-server:8080/api/v2/groups/{group} \ ```json { - "avatar_url": "string", - "display_name": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "members": [ - { - "avatar_url": "http://example.com", - "created_at": "2019-08-24T14:15:22Z", - "email": "user@example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_seen_at": "2019-08-24T14:15:22Z", - "login_type": "", - "name": "string", - "status": "active", - "theme_preference": "string", - "updated_at": "2019-08-24T14:15:22Z", - "username": "string" - } - ], - "name": "string", - "organization_display_name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "organization_name": "string", - "quota_allowance": 0, - "source": "user", - "total_member_count": 0 + "avatar_url": "string", + "display_name": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "members": [ + { + "avatar_url": "http://example.com", + "created_at": "2019-08-24T14:15:22Z", + "email": "user@example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_seen_at": "2019-08-24T14:15:22Z", + "login_type": "", + "name": "string", + "status": "active", + "theme_preference": "string", + "updated_at": "2019-08-24T14:15:22Z", + "username": "string" + } + ], + "name": "string", + "organization_display_name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "organization_name": "string", + "quota_allowance": 0, + "source": "user", + "total_member_count": 0 } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Group](schemas.md#codersdkgroup) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -424,19 +428,23 @@ curl -X PATCH http://coder-server:8080/api/v2/groups/{group} \ ```json { - "add_users": ["string"], - "avatar_url": "string", - "display_name": "string", - "name": "string", - "quota_allowance": 0, - "remove_users": ["string"] + "add_users": [ + "string" + ], + "avatar_url": "string", + "display_name": "string", + "name": "string", + "quota_allowance": 0, + "remove_users": [ + "string" + ] } ``` ### Parameters | Name | In | Type | Required | Description | -| ------- | ---- | ------------------------------------------------------------------ | -------- | ------------------- | +|---------|------|--------------------------------------------------------------------|----------|---------------------| | `group` | path | string | true | Group name | | `body` | body | [codersdk.PatchGroupRequest](schemas.md#codersdkpatchgrouprequest) | true | Patch group request | @@ -446,43 +454,43 @@ curl -X PATCH http://coder-server:8080/api/v2/groups/{group} \ ```json { - "avatar_url": "string", - "display_name": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "members": [ - { - "avatar_url": "http://example.com", - "created_at": "2019-08-24T14:15:22Z", - "email": "user@example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_seen_at": "2019-08-24T14:15:22Z", - "login_type": "", - "name": "string", - "status": "active", - "theme_preference": "string", - "updated_at": "2019-08-24T14:15:22Z", - "username": "string" - } - ], - "name": "string", - "organization_display_name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "organization_name": "string", - "quota_allowance": 0, - "source": "user", - "total_member_count": 0 + "avatar_url": "string", + "display_name": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "members": [ + { + "avatar_url": "http://example.com", + "created_at": "2019-08-24T14:15:22Z", + "email": "user@example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_seen_at": "2019-08-24T14:15:22Z", + "login_type": "", + "name": "string", + "status": "active", + "theme_preference": "string", + "updated_at": "2019-08-24T14:15:22Z", + "username": "string" + } + ], + "name": "string", + "organization_display_name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "organization_name": "string", + "quota_allowance": 0, + "source": "user", + "total_member_count": 0 } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Group](schemas.md#codersdkgroup) | To perform this operation, you must be authenticated. [Learn more](authentication.md). -## Get JFrog XRay scan by workspace agent ID. +## Get JFrog XRay scan by workspace agent ID ### Code samples @@ -498,7 +506,7 @@ curl -X GET http://coder-server:8080/api/v2/integrations/jfrog/xray-scan?workspa ### Parameters | Name | In | Type | Required | Description | -| -------------- | ----- | ------ | -------- | ------------ | +|----------------|-------|--------|----------|--------------| | `workspace_id` | query | string | true | Workspace ID | | `agent_id` | query | string | true | Agent ID | @@ -508,24 +516,24 @@ curl -X GET http://coder-server:8080/api/v2/integrations/jfrog/xray-scan?workspa ```json { - "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978", - "critical": 0, - "high": 0, - "medium": 0, - "results_url": "string", - "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9" + "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978", + "critical": 0, + "high": 0, + "medium": 0, + "results_url": "string", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.JFrogXrayScan](schemas.md#codersdkjfrogxrayscan) | To perform this operation, you must be authenticated. [Learn more](authentication.md). -## Post JFrog XRay scan by workspace agent ID. +## Post JFrog XRay scan by workspace agent ID ### Code samples @@ -543,19 +551,19 @@ curl -X POST http://coder-server:8080/api/v2/integrations/jfrog/xray-scan \ ```json { - "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978", - "critical": 0, - "high": 0, - "medium": 0, - "results_url": "string", - "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9" + "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978", + "critical": 0, + "high": 0, + "medium": 0, + "results_url": "string", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9" } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | ---------------------------------------------------------- | -------- | ---------------------------- | +|--------|------|------------------------------------------------------------|----------|------------------------------| | `body` | body | [codersdk.JFrogXrayScan](schemas.md#codersdkjfrogxrayscan) | true | Post JFrog XRay scan request | ### Example responses @@ -564,21 +572,21 @@ curl -X POST http://coder-server:8080/api/v2/integrations/jfrog/xray-scan \ ```json { - "detail": "string", - "message": "string", - "validations": [ - { - "detail": "string", - "field": "string" - } - ] + "detail": "string", + "message": "string", + "validations": [ + { + "detail": "string", + "field": "string" + } + ] } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Response](schemas.md#codersdkresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -602,32 +610,32 @@ curl -X GET http://coder-server:8080/api/v2/licenses \ ```json [ - { - "claims": {}, - "id": 0, - "uploaded_at": "2019-08-24T14:15:22Z", - "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f" - } + { + "claims": {}, + "id": 0, + "uploaded_at": "2019-08-24T14:15:22Z", + "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f" + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|---------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.License](schemas.md#codersdklicense) |

Response Schema

Status Code **200** -| Name | Type | Required | Restrictions | Description | -| --------------- | ----------------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `[array item]` | array | false | | | -| `» claims` | object | false | | Claims are the JWT claims asserted by the license. Here we use a generic string map to ensure that all data from the server is parsed verbatim, not just the fields this version of Coder understands. | -| `» id` | integer | false | | | -| `» uploaded_at` | string(date-time) | false | | | -| `» uuid` | string(uuid) | false | | | +| Name | Type | Required | Restrictions | Description | +|-----------------|-------------------|----------|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `[array item]` | array | false | | | +| `» claims` | object | false | | Claims are the JWT claims asserted by the license. Here we use a generic string map to ensure that all data from the server is parsed verbatim, not just the fields this version of Coder understands. | +| `» id` | integer | false | | | +| `» uploaded_at` | string(date-time) | false | | | +| `» uuid` | string(uuid) | false | | | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -646,13 +654,13 @@ curl -X DELETE http://coder-server:8080/api/v2/licenses/{id} \ ### Parameters | Name | In | Type | Required | Description | -| ---- | ---- | -------------- | -------- | ----------- | +|------|------|----------------|----------|-------------| | `id` | path | string(number) | true | License ID | ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------ | +|--------|---------------------------------------------------------|-------------|--------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -672,19 +680,19 @@ curl -X PUT http://coder-server:8080/api/v2/notifications/templates/{notificatio ### Parameters | Name | In | Type | Required | Description | -| ----------------------- | ---- | ------ | -------- | -------------------------- | +|-------------------------|------|--------|----------|----------------------------| | `notification_template` | path | string | true | Notification template UUID | ### Responses | Status | Meaning | Description | Schema | -| ------ | --------------------------------------------------------------- | ------------ | ------ | +|--------|-----------------------------------------------------------------|--------------|--------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | Success | | | 304 | [Not Modified](https://tools.ietf.org/html/rfc7232#section-4.1) | Not modified | | To perform this operation, you must be authenticated. [Learn more](authentication.md). -## Get OAuth2 applications. +## Get OAuth2 applications ### Code samples @@ -700,7 +708,7 @@ curl -X GET http://coder-server:8080/api/v2/oauth2-provider/apps \ ### Parameters | Name | In | Type | Required | Description | -| --------- | ----- | ------ | -------- | -------------------------------------------- | +|-----------|-------|--------|----------|----------------------------------------------| | `user_id` | query | string | false | Filter by applications authorized for a user | ### Example responses @@ -709,24 +717,24 @@ curl -X GET http://coder-server:8080/api/v2/oauth2-provider/apps \ ```json [ - { - "callback_url": "string", - "endpoints": { - "authorization": "string", - "device_authorization": "string", - "token": "string" - }, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "name": "string" - } + { + "callback_url": "string", + "endpoints": { + "authorization": "string", + "device_authorization": "string", + "token": "string" + }, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "name": "string" + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-----------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.OAuth2ProviderApp](schemas.md#codersdkoauth2providerapp) |

Response Schema

@@ -734,7 +742,7 @@ curl -X GET http://coder-server:8080/api/v2/oauth2-provider/apps \ Status Code **200** | Name | Type | Required | Restrictions | Description | -| ------------------------- | -------------------------------------------------------------------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|---------------------------|----------------------------------------------------------------------|----------|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `[array item]` | array | false | | | | `» callback_url` | string | false | | | | `» endpoints` | [codersdk.OAuth2AppEndpoints](schemas.md#codersdkoauth2appendpoints) | false | | Endpoints are included in the app response for easier discovery. The OAuth2 spec does not have a defined place to find these (for comparison, OIDC has a '/.well-known/openid-configuration' endpoint). | @@ -747,7 +755,7 @@ Status Code **200** To perform this operation, you must be authenticated. [Learn more](authentication.md). -## Create OAuth2 application. +## Create OAuth2 application ### Code samples @@ -765,16 +773,16 @@ curl -X POST http://coder-server:8080/api/v2/oauth2-provider/apps \ ```json { - "callback_url": "string", - "icon": "string", - "name": "string" + "callback_url": "string", + "icon": "string", + "name": "string" } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | ---------------------------------------------------------------------------------------- | -------- | --------------------------------- | +|--------|------|------------------------------------------------------------------------------------------|----------|-----------------------------------| | `body` | body | [codersdk.PostOAuth2ProviderAppRequest](schemas.md#codersdkpostoauth2providerapprequest) | true | The OAuth2 application to create. | ### Example responses @@ -783,27 +791,27 @@ curl -X POST http://coder-server:8080/api/v2/oauth2-provider/apps \ ```json { - "callback_url": "string", - "endpoints": { - "authorization": "string", - "device_authorization": "string", - "token": "string" - }, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "name": "string" + "callback_url": "string", + "endpoints": { + "authorization": "string", + "device_authorization": "string", + "token": "string" + }, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "name": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.OAuth2ProviderApp](schemas.md#codersdkoauth2providerapp) | To perform this operation, you must be authenticated. [Learn more](authentication.md). -## Get OAuth2 application. +## Get OAuth2 application ### Code samples @@ -819,7 +827,7 @@ curl -X GET http://coder-server:8080/api/v2/oauth2-provider/apps/{app} \ ### Parameters | Name | In | Type | Required | Description | -| ----- | ---- | ------ | -------- | ----------- | +|-------|------|--------|----------|-------------| | `app` | path | string | true | App ID | ### Example responses @@ -828,27 +836,27 @@ curl -X GET http://coder-server:8080/api/v2/oauth2-provider/apps/{app} \ ```json { - "callback_url": "string", - "endpoints": { - "authorization": "string", - "device_authorization": "string", - "token": "string" - }, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "name": "string" + "callback_url": "string", + "endpoints": { + "authorization": "string", + "device_authorization": "string", + "token": "string" + }, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "name": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.OAuth2ProviderApp](schemas.md#codersdkoauth2providerapp) | To perform this operation, you must be authenticated. [Learn more](authentication.md). -## Update OAuth2 application. +## Update OAuth2 application ### Code samples @@ -866,16 +874,16 @@ curl -X PUT http://coder-server:8080/api/v2/oauth2-provider/apps/{app} \ ```json { - "callback_url": "string", - "icon": "string", - "name": "string" + "callback_url": "string", + "icon": "string", + "name": "string" } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | -------------------------------------------------------------------------------------- | -------- | ----------------------------- | +|--------|------|----------------------------------------------------------------------------------------|----------|-------------------------------| | `app` | path | string | true | App ID | | `body` | body | [codersdk.PutOAuth2ProviderAppRequest](schemas.md#codersdkputoauth2providerapprequest) | true | Update an OAuth2 application. | @@ -885,27 +893,27 @@ curl -X PUT http://coder-server:8080/api/v2/oauth2-provider/apps/{app} \ ```json { - "callback_url": "string", - "endpoints": { - "authorization": "string", - "device_authorization": "string", - "token": "string" - }, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "name": "string" + "callback_url": "string", + "endpoints": { + "authorization": "string", + "device_authorization": "string", + "token": "string" + }, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "name": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.OAuth2ProviderApp](schemas.md#codersdkoauth2providerapp) | To perform this operation, you must be authenticated. [Learn more](authentication.md). -## Delete OAuth2 application. +## Delete OAuth2 application ### Code samples @@ -920,18 +928,18 @@ curl -X DELETE http://coder-server:8080/api/v2/oauth2-provider/apps/{app} \ ### Parameters | Name | In | Type | Required | Description | -| ----- | ---- | ------ | -------- | ----------- | +|-------|------|--------|----------|-------------| | `app` | path | string | true | App ID | ### Responses | Status | Meaning | Description | Schema | -| ------ | --------------------------------------------------------------- | ----------- | ------ | +|--------|-----------------------------------------------------------------|-------------|--------| | 204 | [No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5) | No Content | | To perform this operation, you must be authenticated. [Learn more](authentication.md). -## Get OAuth2 application secrets. +## Get OAuth2 application secrets ### Code samples @@ -947,7 +955,7 @@ curl -X GET http://coder-server:8080/api/v2/oauth2-provider/apps/{app}/secrets \ ### Parameters | Name | In | Type | Required | Description | -| ----- | ---- | ------ | -------- | ----------- | +|-------|------|--------|----------|-------------| | `app` | path | string | true | App ID | ### Example responses @@ -956,18 +964,18 @@ curl -X GET http://coder-server:8080/api/v2/oauth2-provider/apps/{app}/secrets \ ```json [ - { - "client_secret_truncated": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_used_at": "string" - } + { + "client_secret_truncated": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_used_at": "string" + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-----------------------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.OAuth2ProviderAppSecret](schemas.md#codersdkoauth2providerappsecret) |

Response Schema

@@ -975,7 +983,7 @@ curl -X GET http://coder-server:8080/api/v2/oauth2-provider/apps/{app}/secrets \ Status Code **200** | Name | Type | Required | Restrictions | Description | -| --------------------------- | ------------ | -------- | ------------ | ----------- | +|-----------------------------|--------------|----------|--------------|-------------| | `[array item]` | array | false | | | | `» client_secret_truncated` | string | false | | | | `» id` | string(uuid) | false | | | @@ -983,7 +991,7 @@ Status Code **200** To perform this operation, you must be authenticated. [Learn more](authentication.md). -## Create OAuth2 application secret. +## Create OAuth2 application secret ### Code samples @@ -999,7 +1007,7 @@ curl -X POST http://coder-server:8080/api/v2/oauth2-provider/apps/{app}/secrets ### Parameters | Name | In | Type | Required | Description | -| ----- | ---- | ------ | -------- | ----------- | +|-------|------|--------|----------|-------------| | `app` | path | string | true | App ID | ### Example responses @@ -1008,17 +1016,17 @@ curl -X POST http://coder-server:8080/api/v2/oauth2-provider/apps/{app}/secrets ```json [ - { - "client_secret_full": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08" - } + { + "client_secret_full": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08" + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ----------------------------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-------------------------------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.OAuth2ProviderAppSecretFull](schemas.md#codersdkoauth2providerappsecretfull) |

Response Schema

@@ -1026,14 +1034,14 @@ curl -X POST http://coder-server:8080/api/v2/oauth2-provider/apps/{app}/secrets Status Code **200** | Name | Type | Required | Restrictions | Description | -| ---------------------- | ------------ | -------- | ------------ | ----------- | +|------------------------|--------------|----------|--------------|-------------| | `[array item]` | array | false | | | | `» client_secret_full` | string | false | | | | `» id` | string(uuid) | false | | | To perform this operation, you must be authenticated. [Learn more](authentication.md). -## Delete OAuth2 application secret. +## Delete OAuth2 application secret ### Code samples @@ -1048,19 +1056,19 @@ curl -X DELETE http://coder-server:8080/api/v2/oauth2-provider/apps/{app}/secret ### Parameters | Name | In | Type | Required | Description | -| ---------- | ---- | ------ | -------- | ----------- | +|------------|------|--------|----------|-------------| | `app` | path | string | true | App ID | | `secretID` | path | string | true | Secret ID | ### Responses | Status | Meaning | Description | Schema | -| ------ | --------------------------------------------------------------- | ----------- | ------ | +|--------|-----------------------------------------------------------------|-------------|--------| | 204 | [No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5) | No Content | | To perform this operation, you must be authenticated. [Learn more](authentication.md). -## OAuth2 authorization request. +## OAuth2 authorization request ### Code samples @@ -1075,7 +1083,7 @@ curl -X POST http://coder-server:8080/api/v2/oauth2/authorize?client_id=string&s ### Parameters | Name | In | Type | Required | Description | -| --------------- | ----- | ------ | -------- | --------------------------------- | +|-----------------|-------|--------|----------|-----------------------------------| | `client_id` | query | string | true | Client ID | | `state` | query | string | true | A random unguessable string | | `response_type` | query | string | true | Response type | @@ -1085,18 +1093,18 @@ curl -X POST http://coder-server:8080/api/v2/oauth2/authorize?client_id=string&s #### Enumerated Values | Parameter | Value | -| --------------- | ------ | +|-----------------|--------| | `response_type` | `code` | ### Responses | Status | Meaning | Description | Schema | -| ------ | ---------------------------------------------------------- | ----------- | ------ | +|--------|------------------------------------------------------------|-------------|--------| | 302 | [Found](https://tools.ietf.org/html/rfc7231#section-6.4.3) | Found | | To perform this operation, you must be authenticated. [Learn more](authentication.md). -## OAuth2 token exchange. +## OAuth2 token exchange ### Code samples @@ -1116,12 +1124,13 @@ client_secret: string code: string refresh_token: string grant_type: authorization_code + ``` ### Parameters | Name | In | Type | Required | Description | -| ----------------- | ---- | ------ | -------- | ------------------------------------------------------------- | +|-------------------|------|--------|----------|---------------------------------------------------------------| | `body` | body | object | false | | | `» client_id` | body | string | false | Client ID, required if grant_type=authorization_code | | `» client_secret` | body | string | false | Client secret, required if grant_type=authorization_code | @@ -1132,7 +1141,7 @@ grant_type: authorization_code #### Enumerated Values | Parameter | Value | -| -------------- | -------------------- | +|----------------|----------------------| | `» grant_type` | `authorization_code` | | `» grant_type` | `refresh_token` | @@ -1142,21 +1151,21 @@ grant_type: authorization_code ```json { - "access_token": "string", - "expires_in": 0, - "expiry": "string", - "refresh_token": "string", - "token_type": "string" + "access_token": "string", + "expires_in": 0, + "expiry": "string", + "refresh_token": "string", + "token_type": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [oauth2.Token](schemas.md#oauth2token) | -## Delete OAuth2 application tokens. +## Delete OAuth2 application tokens ### Code samples @@ -1171,13 +1180,13 @@ curl -X DELETE http://coder-server:8080/api/v2/oauth2/tokens?client_id=string \ ### Parameters | Name | In | Type | Required | Description | -| ----------- | ----- | ------ | -------- | ----------- | +|-------------|-------|--------|----------|-------------| | `client_id` | query | string | true | Client ID | ### Responses | Status | Meaning | Description | Schema | -| ------ | --------------------------------------------------------------- | ----------- | ------ | +|--------|-----------------------------------------------------------------|-------------|--------| | 204 | [No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5) | No Content | | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1198,7 +1207,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/groups ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | ------------ | -------- | --------------- | +|----------------|------|--------------|----------|-----------------| | `organization` | path | string(uuid) | true | Organization ID | ### Example responses @@ -1207,40 +1216,40 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/groups ```json [ - { - "avatar_url": "string", - "display_name": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "members": [ - { - "avatar_url": "http://example.com", - "created_at": "2019-08-24T14:15:22Z", - "email": "user@example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_seen_at": "2019-08-24T14:15:22Z", - "login_type": "", - "name": "string", - "status": "active", - "theme_preference": "string", - "updated_at": "2019-08-24T14:15:22Z", - "username": "string" - } - ], - "name": "string", - "organization_display_name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "organization_name": "string", - "quota_allowance": 0, - "source": "user", - "total_member_count": 0 - } + { + "avatar_url": "string", + "display_name": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "members": [ + { + "avatar_url": "http://example.com", + "created_at": "2019-08-24T14:15:22Z", + "email": "user@example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_seen_at": "2019-08-24T14:15:22Z", + "login_type": "", + "name": "string", + "status": "active", + "theme_preference": "string", + "updated_at": "2019-08-24T14:15:22Z", + "username": "string" + } + ], + "name": "string", + "organization_display_name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "organization_name": "string", + "quota_allowance": 0, + "source": "user", + "total_member_count": 0 + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-----------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.Group](schemas.md#codersdkgroup) |

Response Schema

@@ -1248,7 +1257,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/groups Status Code **200** | Name | Type | Required | Restrictions | Description | -| ----------------------------- | ------------------------------------------------------ | -------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|-------------------------------|--------------------------------------------------------|----------|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `[array item]` | array | false | | | | `» avatar_url` | string | false | | | | `» display_name` | string | false | | | @@ -1276,7 +1285,7 @@ Status Code **200** #### Enumerated Values | Property | Value | -| ------------ | ----------- | +|--------------|-------------| | `login_type` | `` | | `login_type` | `password` | | `login_type` | `github` | @@ -1308,17 +1317,17 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/groups ```json { - "avatar_url": "string", - "display_name": "string", - "name": "string", - "quota_allowance": 0 + "avatar_url": "string", + "display_name": "string", + "name": "string", + "quota_allowance": 0 } ``` ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | -------------------------------------------------------------------- | -------- | -------------------- | +|----------------|------|----------------------------------------------------------------------|----------|----------------------| | `organization` | path | string | true | Organization ID | | `body` | body | [codersdk.CreateGroupRequest](schemas.md#codersdkcreategrouprequest) | true | Create group request | @@ -1328,38 +1337,38 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/groups ```json { - "avatar_url": "string", - "display_name": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "members": [ - { - "avatar_url": "http://example.com", - "created_at": "2019-08-24T14:15:22Z", - "email": "user@example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_seen_at": "2019-08-24T14:15:22Z", - "login_type": "", - "name": "string", - "status": "active", - "theme_preference": "string", - "updated_at": "2019-08-24T14:15:22Z", - "username": "string" - } - ], - "name": "string", - "organization_display_name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "organization_name": "string", - "quota_allowance": 0, - "source": "user", - "total_member_count": 0 + "avatar_url": "string", + "display_name": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "members": [ + { + "avatar_url": "http://example.com", + "created_at": "2019-08-24T14:15:22Z", + "email": "user@example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_seen_at": "2019-08-24T14:15:22Z", + "login_type": "", + "name": "string", + "status": "active", + "theme_preference": "string", + "updated_at": "2019-08-24T14:15:22Z", + "username": "string" + } + ], + "name": "string", + "organization_display_name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "organization_name": "string", + "quota_allowance": 0, + "source": "user", + "total_member_count": 0 } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------------ | ----------- | ------------------------------------------ | +|--------|--------------------------------------------------------------|-------------|--------------------------------------------| | 201 | [Created](https://tools.ietf.org/html/rfc7231#section-6.3.2) | Created | [codersdk.Group](schemas.md#codersdkgroup) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1380,7 +1389,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/groups/ ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | ------------ | -------- | --------------- | +|----------------|------|--------------|----------|-----------------| | `organization` | path | string(uuid) | true | Organization ID | | `groupName` | path | string | true | Group name | @@ -1390,38 +1399,38 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/groups/ ```json { - "avatar_url": "string", - "display_name": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "members": [ - { - "avatar_url": "http://example.com", - "created_at": "2019-08-24T14:15:22Z", - "email": "user@example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_seen_at": "2019-08-24T14:15:22Z", - "login_type": "", - "name": "string", - "status": "active", - "theme_preference": "string", - "updated_at": "2019-08-24T14:15:22Z", - "username": "string" - } - ], - "name": "string", - "organization_display_name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "organization_name": "string", - "quota_allowance": 0, - "source": "user", - "total_member_count": 0 + "avatar_url": "string", + "display_name": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "members": [ + { + "avatar_url": "http://example.com", + "created_at": "2019-08-24T14:15:22Z", + "email": "user@example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_seen_at": "2019-08-24T14:15:22Z", + "login_type": "", + "name": "string", + "status": "active", + "theme_preference": "string", + "updated_at": "2019-08-24T14:15:22Z", + "username": "string" + } + ], + "name": "string", + "organization_display_name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "organization_name": "string", + "quota_allowance": 0, + "source": "user", + "total_member_count": 0 } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Group](schemas.md#codersdkgroup) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1442,7 +1451,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/members ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | ------------ | -------- | -------------------- | +|----------------|------|--------------|----------|----------------------| | `user` | path | string | true | User ID, name, or me | | `organization` | path | string(uuid) | true | Organization ID | @@ -1452,15 +1461,15 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/members ```json { - "budget": 0, - "credits_consumed": 0 + "budget": 0, + "credits_consumed": 0 } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.WorkspaceQuota](schemas.md#codersdkworkspacequota) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1481,7 +1490,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/provisi ### Parameters | Name | In | Type | Required | Description | -| -------------- | ----- | ------------ | -------- | ---------------------------------------------------------------------------------- | +|----------------|-------|--------------|----------|------------------------------------------------------------------------------------| | `organization` | path | string(uuid) | true | Organization ID | | `tags` | query | object | false | Provisioner tags to filter by (JSON of the form {'tag1':'value1','tag2':'value2'}) | @@ -1491,28 +1500,30 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/provisi ```json [ - { - "api_version": "string", - "created_at": "2019-08-24T14:15:22Z", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "key_id": "1e779c8a-6786-4c89-b7c3-a6666f5fd6b5", - "last_seen_at": "2019-08-24T14:15:22Z", - "name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "provisioners": ["string"], - "tags": { - "property1": "string", - "property2": "string" - }, - "version": "string" - } + { + "api_version": "string", + "created_at": "2019-08-24T14:15:22Z", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "key_id": "1e779c8a-6786-4c89-b7c3-a6666f5fd6b5", + "last_seen_at": "2019-08-24T14:15:22Z", + "name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "provisioners": [ + "string" + ], + "tags": { + "property1": "string", + "property2": "string" + }, + "version": "string" + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-----------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.ProvisionerDaemon](schemas.md#codersdkprovisionerdaemon) |

Response Schema

@@ -1520,7 +1531,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/provisi Status Code **200** | Name | Type | Required | Restrictions | Description | -| ------------------- | ----------------- | -------- | ------------ | ----------- | +|---------------------|-------------------|----------|--------------|-------------| | `[array item]` | array | false | | | | `» api_version` | string | false | | | | `» created_at` | string(date-time) | false | | | @@ -1551,13 +1562,13 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/provisi ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | ------------ | -------- | --------------- | +|----------------|------|--------------|----------|-----------------| | `organization` | path | string(uuid) | true | Organization ID | ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------------------------ | ------------------- | ------ | +|--------|--------------------------------------------------------------------------|---------------------|--------| | 101 | [Switching Protocols](https://tools.ietf.org/html/rfc7231#section-6.2.2) | Switching Protocols | | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1578,7 +1589,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/provisi ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | ------ | -------- | --------------- | +|----------------|------|--------|----------|-----------------| | `organization` | path | string | true | Organization ID | ### Example responses @@ -1587,23 +1598,23 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/provisi ```json [ - { - "created_at": "2019-08-24T14:15:22Z", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "name": "string", - "organization": "452c1a86-a0af-475b-b03f-724878b0f387", - "tags": { - "property1": "string", - "property2": "string" - } - } + { + "created_at": "2019-08-24T14:15:22Z", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "name": "string", + "organization": "452c1a86-a0af-475b-b03f-724878b0f387", + "tags": { + "property1": "string", + "property2": "string" + } + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-----------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.ProvisionerKey](schemas.md#codersdkprovisionerkey) |

Response Schema

@@ -1611,7 +1622,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/provisi Status Code **200** | Name | Type | Required | Restrictions | Description | -| ------------------- | -------------------------------------------------------------------- | -------- | ------------ | ----------- | +|---------------------|----------------------------------------------------------------------|----------|--------------|-------------| | `[array item]` | array | false | | | | `» created_at` | string(date-time) | false | | | | `» id` | string(uuid) | false | | | @@ -1638,7 +1649,7 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/provis ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | ------ | -------- | --------------- | +|----------------|------|--------|----------|-----------------| | `organization` | path | string | true | Organization ID | ### Example responses @@ -1647,14 +1658,14 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/provis ```json { - "key": "string" + "key": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------------ | ----------- | ---------------------------------------------------------------------------------------- | +|--------|--------------------------------------------------------------|-------------|------------------------------------------------------------------------------------------| | 201 | [Created](https://tools.ietf.org/html/rfc7231#section-6.3.2) | Created | [codersdk.CreateProvisionerKeyResponse](schemas.md#codersdkcreateprovisionerkeyresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1675,7 +1686,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/provisi ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | ------ | -------- | --------------- | +|----------------|------|--------|----------|-----------------| | `organization` | path | string | true | Organization ID | ### Example responses @@ -1684,42 +1695,44 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/provisi ```json [ - { - "daemons": [ - { - "api_version": "string", - "created_at": "2019-08-24T14:15:22Z", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "key_id": "1e779c8a-6786-4c89-b7c3-a6666f5fd6b5", - "last_seen_at": "2019-08-24T14:15:22Z", - "name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "provisioners": ["string"], - "tags": { - "property1": "string", - "property2": "string" - }, - "version": "string" - } - ], - "key": { - "created_at": "2019-08-24T14:15:22Z", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "name": "string", - "organization": "452c1a86-a0af-475b-b03f-724878b0f387", - "tags": { - "property1": "string", - "property2": "string" - } - } - } + { + "daemons": [ + { + "api_version": "string", + "created_at": "2019-08-24T14:15:22Z", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "key_id": "1e779c8a-6786-4c89-b7c3-a6666f5fd6b5", + "last_seen_at": "2019-08-24T14:15:22Z", + "name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "provisioners": [ + "string" + ], + "tags": { + "property1": "string", + "property2": "string" + }, + "version": "string" + } + ], + "key": { + "created_at": "2019-08-24T14:15:22Z", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "name": "string", + "organization": "452c1a86-a0af-475b-b03f-724878b0f387", + "tags": { + "property1": "string", + "property2": "string" + } + } + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ----------------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-------------------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.ProvisionerKeyDaemons](schemas.md#codersdkprovisionerkeydaemons) |

Response Schema

@@ -1727,7 +1740,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/provisi Status Code **200** | Name | Type | Required | Restrictions | Description | -| -------------------- | -------------------------------------------------------------------- | -------- | ------------ | ----------- | +|----------------------|----------------------------------------------------------------------|----------|--------------|-------------| | `[array item]` | array | false | | | | `» daemons` | array | false | | | | `»» api_version` | string | false | | | @@ -1766,14 +1779,14 @@ curl -X DELETE http://coder-server:8080/api/v2/organizations/{organization}/prov ### Parameters | Name | In | Type | Required | Description | -| ---------------- | ---- | ------ | -------- | -------------------- | +|------------------|------|--------|----------|----------------------| | `organization` | path | string | true | Organization ID | | `provisionerkey` | path | string | true | Provisioner key name | ### Responses | Status | Meaning | Description | Schema | -| ------ | --------------------------------------------------------------- | ----------- | ------ | +|--------|-----------------------------------------------------------------|-------------|--------| | 204 | [No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5) | No Content | | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1794,7 +1807,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/setting ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | ------------ | -------- | --------------- | +|----------------|------|--------------|----------|-----------------| | `organization` | path | string(uuid) | true | Organization ID | ### Example responses @@ -1802,19 +1815,61 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/setting > 200 Response ```json -["string"] +[ + "string" +] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | --------------- | +|--------|---------------------------------------------------------|-------------|-----------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of string |

Response Schema

To perform this operation, you must be authenticated. [Learn more](authentication.md). +## Get the organization idp sync claim field values + +### Code samples + +```shell +# Example request using curl +curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/settings/idpsync/field-values?claimField=string \ + -H 'Accept: application/json' \ + -H 'Coder-Session-Token: API_KEY' +``` + +`GET /organizations/{organization}/settings/idpsync/field-values` + +### Parameters + +| Name | In | Type | Required | Description | +|----------------|-------|----------------|----------|-----------------| +| `organization` | path | string(uuid) | true | Organization ID | +| `claimField` | query | string(string) | true | Claim Field | + +### Example responses + +> 200 Response + +```json +[ + "string" +] +``` + +### Responses + +| Status | Meaning | Description | Schema | +|--------|---------------------------------------------------------|-------------|-----------------| +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of string | + +

Response Schema

+ +To perform this operation, you must be authenticated. [Learn more](authentication.md). + ## Get group IdP Sync settings by organization ### Code samples @@ -1831,7 +1886,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/setting ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | ------------ | -------- | --------------- | +|----------------|------|--------------|----------|-----------------| | `organization` | path | string(uuid) | true | Organization ID | ### Example responses @@ -1840,24 +1895,28 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/setting ```json { - "auto_create_missing_groups": true, - "field": "string", - "legacy_group_name_mapping": { - "property1": "string", - "property2": "string" - }, - "mapping": { - "property1": ["string"], - "property2": ["string"] - }, - "regex_filter": {} + "auto_create_missing_groups": true, + "field": "string", + "legacy_group_name_mapping": { + "property1": "string", + "property2": "string" + }, + "mapping": { + "property1": [ + "string" + ], + "property2": [ + "string" + ] + }, + "regex_filter": {} } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.GroupSyncSettings](schemas.md#codersdkgroupsyncsettings) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1880,24 +1939,28 @@ curl -X PATCH http://coder-server:8080/api/v2/organizations/{organization}/setti ```json { - "auto_create_missing_groups": true, - "field": "string", - "legacy_group_name_mapping": { - "property1": "string", - "property2": "string" - }, - "mapping": { - "property1": ["string"], - "property2": ["string"] - }, - "regex_filter": {} + "auto_create_missing_groups": true, + "field": "string", + "legacy_group_name_mapping": { + "property1": "string", + "property2": "string" + }, + "mapping": { + "property1": [ + "string" + ], + "property2": [ + "string" + ] + }, + "regex_filter": {} } ``` ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | ------------------------------------------------------------------ | -------- | --------------- | +|----------------|------|--------------------------------------------------------------------|----------|-----------------| | `organization` | path | string(uuid) | true | Organization ID | | `body` | body | [codersdk.GroupSyncSettings](schemas.md#codersdkgroupsyncsettings) | true | New settings | @@ -1907,24 +1970,28 @@ curl -X PATCH http://coder-server:8080/api/v2/organizations/{organization}/setti ```json { - "auto_create_missing_groups": true, - "field": "string", - "legacy_group_name_mapping": { - "property1": "string", - "property2": "string" - }, - "mapping": { - "property1": ["string"], - "property2": ["string"] - }, - "regex_filter": {} + "auto_create_missing_groups": true, + "field": "string", + "legacy_group_name_mapping": { + "property1": "string", + "property2": "string" + }, + "mapping": { + "property1": [ + "string" + ], + "property2": [ + "string" + ] + }, + "regex_filter": {} } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.GroupSyncSettings](schemas.md#codersdkgroupsyncsettings) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1945,7 +2012,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/setting ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | ------------ | -------- | --------------- | +|----------------|------|--------------|----------|-----------------| | `organization` | path | string(uuid) | true | Organization ID | ### Example responses @@ -1954,18 +2021,22 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/setting ```json { - "field": "string", - "mapping": { - "property1": ["string"], - "property2": ["string"] - } + "field": "string", + "mapping": { + "property1": [ + "string" + ], + "property2": [ + "string" + ] + } } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.RoleSyncSettings](schemas.md#codersdkrolesyncsettings) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1988,18 +2059,22 @@ curl -X PATCH http://coder-server:8080/api/v2/organizations/{organization}/setti ```json { - "field": "string", - "mapping": { - "property1": ["string"], - "property2": ["string"] - } + "field": "string", + "mapping": { + "property1": [ + "string" + ], + "property2": [ + "string" + ] + } } ``` ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | ---------------------------------------------------------------- | -------- | --------------- | +|----------------|------|------------------------------------------------------------------|----------|-----------------| | `organization` | path | string(uuid) | true | Organization ID | | `body` | body | [codersdk.RoleSyncSettings](schemas.md#codersdkrolesyncsettings) | true | New settings | @@ -2009,18 +2084,22 @@ curl -X PATCH http://coder-server:8080/api/v2/organizations/{organization}/setti ```json { - "field": "string", - "mapping": { - "property1": ["string"], - "property2": ["string"] - } + "field": "string", + "mapping": { + "property1": [ + "string" + ], + "property2": [ + "string" + ] + } } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.RoleSyncSettings](schemas.md#codersdkrolesyncsettings) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -2040,7 +2119,7 @@ curl -X GET http://coder-server:8080/api/v2/provisionerkeys/{provisionerkey} \ ### Parameters | Name | In | Type | Required | Description | -| ---------------- | ---- | ------ | -------- | --------------- | +|------------------|------|--------|----------|-----------------| | `provisionerkey` | path | string | true | Provisioner Key | ### Example responses @@ -2049,21 +2128,21 @@ curl -X GET http://coder-server:8080/api/v2/provisionerkeys/{provisionerkey} \ ```json { - "created_at": "2019-08-24T14:15:22Z", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "name": "string", - "organization": "452c1a86-a0af-475b-b03f-724878b0f387", - "tags": { - "property1": "string", - "property2": "string" - } + "created_at": "2019-08-24T14:15:22Z", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "name": "string", + "organization": "452c1a86-a0af-475b-b03f-724878b0f387", + "tags": { + "property1": "string", + "property2": "string" + } } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.ProvisionerKey](schemas.md#codersdkprovisionerkey) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -2087,22 +2166,22 @@ curl -X GET http://coder-server:8080/api/v2/replicas \ ```json [ - { - "created_at": "2019-08-24T14:15:22Z", - "database_latency": 0, - "error": "string", - "hostname": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "region_id": 0, - "relay_address": "string" - } + { + "created_at": "2019-08-24T14:15:22Z", + "database_latency": 0, + "error": "string", + "hostname": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "region_id": 0, + "relay_address": "string" + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|---------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.Replica](schemas.md#codersdkreplica) |

Response Schema

@@ -2110,7 +2189,7 @@ curl -X GET http://coder-server:8080/api/v2/replicas \ Status Code **200** | Name | Type | Required | Restrictions | Description | -| -------------------- | ----------------- | -------- | ------------ | ------------------------------------------------------------------ | +|----------------------|-------------------|----------|--------------|--------------------------------------------------------------------| | `[array item]` | array | false | | | | `» created_at` | string(date-time) | false | | Created at is the timestamp when the replica was first seen. | | `» database_latency` | integer | false | | Database latency is the latency in microseconds to the database. | @@ -2137,7 +2216,7 @@ curl -X GET http://coder-server:8080/api/v2/scim/v2/ServiceProviderConfig ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------ | +|--------|---------------------------------------------------------|-------------|--------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | | ## SCIM 2.0: Get users @@ -2155,7 +2234,7 @@ curl -X GET http://coder-server:8080/api/v2/scim/v2/Users \ ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------ | +|--------|---------------------------------------------------------|-------------|--------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -2178,33 +2257,37 @@ curl -X POST http://coder-server:8080/api/v2/scim/v2/Users \ ```json { - "active": true, - "emails": [ - { - "display": "string", - "primary": true, - "type": "string", - "value": "user@example.com" - } - ], - "groups": [null], - "id": "string", - "meta": { - "resourceType": "string" - }, - "name": { - "familyName": "string", - "givenName": "string" - }, - "schemas": ["string"], - "userName": "string" + "active": true, + "emails": [ + { + "display": "string", + "primary": true, + "type": "string", + "value": "user@example.com" + } + ], + "groups": [ + null + ], + "id": "string", + "meta": { + "resourceType": "string" + }, + "name": { + "familyName": "string", + "givenName": "string" + }, + "schemas": [ + "string" + ], + "userName": "string" } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | -------------------------------------------- | -------- | ----------- | +|--------|------|----------------------------------------------|----------|-------------| | `body` | body | [coderd.SCIMUser](schemas.md#coderdscimuser) | true | New user | ### Example responses @@ -2213,33 +2296,37 @@ curl -X POST http://coder-server:8080/api/v2/scim/v2/Users \ ```json { - "active": true, - "emails": [ - { - "display": "string", - "primary": true, - "type": "string", - "value": "user@example.com" - } - ], - "groups": [null], - "id": "string", - "meta": { - "resourceType": "string" - }, - "name": { - "familyName": "string", - "givenName": "string" - }, - "schemas": ["string"], - "userName": "string" + "active": true, + "emails": [ + { + "display": "string", + "primary": true, + "type": "string", + "value": "user@example.com" + } + ], + "groups": [ + null + ], + "id": "string", + "meta": { + "resourceType": "string" + }, + "name": { + "familyName": "string", + "givenName": "string" + }, + "schemas": [ + "string" + ], + "userName": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [coderd.SCIMUser](schemas.md#coderdscimuser) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -2259,13 +2346,13 @@ curl -X GET http://coder-server:8080/api/v2/scim/v2/Users/{id} \ ### Parameters | Name | In | Type | Required | Description | -| ---- | ---- | ------------ | -------- | ----------- | +|------|------|--------------|----------|-------------| | `id` | path | string(uuid) | true | User ID | ### Responses | Status | Meaning | Description | Schema | -| ------ | -------------------------------------------------------------- | ----------- | ------ | +|--------|----------------------------------------------------------------|-------------|--------| | 404 | [Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4) | Not Found | | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -2288,33 +2375,37 @@ curl -X PUT http://coder-server:8080/api/v2/scim/v2/Users/{id} \ ```json { - "active": true, - "emails": [ - { - "display": "string", - "primary": true, - "type": "string", - "value": "user@example.com" - } - ], - "groups": [null], - "id": "string", - "meta": { - "resourceType": "string" - }, - "name": { - "familyName": "string", - "givenName": "string" - }, - "schemas": ["string"], - "userName": "string" + "active": true, + "emails": [ + { + "display": "string", + "primary": true, + "type": "string", + "value": "user@example.com" + } + ], + "groups": [ + null + ], + "id": "string", + "meta": { + "resourceType": "string" + }, + "name": { + "familyName": "string", + "givenName": "string" + }, + "schemas": [ + "string" + ], + "userName": "string" } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | -------------------------------------------- | -------- | -------------------- | +|--------|------|----------------------------------------------|----------|----------------------| | `id` | path | string(uuid) | true | User ID | | `body` | body | [coderd.SCIMUser](schemas.md#coderdscimuser) | true | Replace user request | @@ -2324,32 +2415,34 @@ curl -X PUT http://coder-server:8080/api/v2/scim/v2/Users/{id} \ ```json { - "avatar_url": "http://example.com", - "created_at": "2019-08-24T14:15:22Z", - "email": "user@example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_seen_at": "2019-08-24T14:15:22Z", - "login_type": "", - "name": "string", - "organization_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "roles": [ - { - "display_name": "string", - "name": "string", - "organization_id": "string" - } - ], - "status": "active", - "theme_preference": "string", - "updated_at": "2019-08-24T14:15:22Z", - "username": "string" + "avatar_url": "http://example.com", + "created_at": "2019-08-24T14:15:22Z", + "email": "user@example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_seen_at": "2019-08-24T14:15:22Z", + "login_type": "", + "name": "string", + "organization_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "roles": [ + { + "display_name": "string", + "name": "string", + "organization_id": "string" + } + ], + "status": "active", + "theme_preference": "string", + "updated_at": "2019-08-24T14:15:22Z", + "username": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------- | +|--------|---------------------------------------------------------|-------------|------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.User](schemas.md#codersdkuser) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -2372,33 +2465,37 @@ curl -X PATCH http://coder-server:8080/api/v2/scim/v2/Users/{id} \ ```json { - "active": true, - "emails": [ - { - "display": "string", - "primary": true, - "type": "string", - "value": "user@example.com" - } - ], - "groups": [null], - "id": "string", - "meta": { - "resourceType": "string" - }, - "name": { - "familyName": "string", - "givenName": "string" - }, - "schemas": ["string"], - "userName": "string" + "active": true, + "emails": [ + { + "display": "string", + "primary": true, + "type": "string", + "value": "user@example.com" + } + ], + "groups": [ + null + ], + "id": "string", + "meta": { + "resourceType": "string" + }, + "name": { + "familyName": "string", + "givenName": "string" + }, + "schemas": [ + "string" + ], + "userName": "string" } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | -------------------------------------------- | -------- | ------------------- | +|--------|------|----------------------------------------------|----------|---------------------| | `id` | path | string(uuid) | true | User ID | | `body` | body | [coderd.SCIMUser](schemas.md#coderdscimuser) | true | Update user request | @@ -2408,32 +2505,34 @@ curl -X PATCH http://coder-server:8080/api/v2/scim/v2/Users/{id} \ ```json { - "avatar_url": "http://example.com", - "created_at": "2019-08-24T14:15:22Z", - "email": "user@example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_seen_at": "2019-08-24T14:15:22Z", - "login_type": "", - "name": "string", - "organization_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "roles": [ - { - "display_name": "string", - "name": "string", - "organization_id": "string" - } - ], - "status": "active", - "theme_preference": "string", - "updated_at": "2019-08-24T14:15:22Z", - "username": "string" + "avatar_url": "http://example.com", + "created_at": "2019-08-24T14:15:22Z", + "email": "user@example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_seen_at": "2019-08-24T14:15:22Z", + "login_type": "", + "name": "string", + "organization_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "roles": [ + { + "display_name": "string", + "name": "string", + "organization_id": "string" + } + ], + "status": "active", + "theme_preference": "string", + "updated_at": "2019-08-24T14:15:22Z", + "username": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------- | +|--------|---------------------------------------------------------|-------------|------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.User](schemas.md#codersdkuser) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -2454,7 +2553,7 @@ curl -X GET http://coder-server:8080/api/v2/settings/idpsync/available-fields \ ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | ------------ | -------- | --------------- | +|----------------|------|--------------|----------|-----------------| | `organization` | path | string(uuid) | true | Organization ID | ### Example responses @@ -2462,19 +2561,61 @@ curl -X GET http://coder-server:8080/api/v2/settings/idpsync/available-fields \ > 200 Response ```json -["string"] +[ + "string" +] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | --------------- | +|--------|---------------------------------------------------------|-------------|-----------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of string |

Response Schema

To perform this operation, you must be authenticated. [Learn more](authentication.md). +## Get the idp sync claim field values + +### Code samples + +```shell +# Example request using curl +curl -X GET http://coder-server:8080/api/v2/settings/idpsync/field-values?claimField=string \ + -H 'Accept: application/json' \ + -H 'Coder-Session-Token: API_KEY' +``` + +`GET /settings/idpsync/field-values` + +### Parameters + +| Name | In | Type | Required | Description | +|----------------|-------|----------------|----------|-----------------| +| `organization` | path | string(uuid) | true | Organization ID | +| `claimField` | query | string(string) | true | Claim Field | + +### Example responses + +> 200 Response + +```json +[ + "string" +] +``` + +### Responses + +| Status | Meaning | Description | Schema | +|--------|---------------------------------------------------------|-------------|-----------------| +| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of string | + +

Response Schema

+ +To perform this operation, you must be authenticated. [Learn more](authentication.md). + ## Get organization IdP Sync settings ### Code samples @@ -2494,19 +2635,23 @@ curl -X GET http://coder-server:8080/api/v2/settings/idpsync/organization \ ```json { - "field": "string", - "mapping": { - "property1": ["string"], - "property2": ["string"] - }, - "organization_assign_default": true + "field": "string", + "mapping": { + "property1": [ + "string" + ], + "property2": [ + "string" + ] + }, + "organization_assign_default": true } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.OrganizationSyncSettings](schemas.md#codersdkorganizationsyncsettings) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -2529,19 +2674,23 @@ curl -X PATCH http://coder-server:8080/api/v2/settings/idpsync/organization \ ```json { - "field": "string", - "mapping": { - "property1": ["string"], - "property2": ["string"] - }, - "organization_assign_default": true + "field": "string", + "mapping": { + "property1": [ + "string" + ], + "property2": [ + "string" + ] + }, + "organization_assign_default": true } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | -------------------------------------------------------------------------------- | -------- | ------------ | +|--------|------|----------------------------------------------------------------------------------|----------|--------------| | `body` | body | [codersdk.OrganizationSyncSettings](schemas.md#codersdkorganizationsyncsettings) | true | New settings | ### Example responses @@ -2550,19 +2699,23 @@ curl -X PATCH http://coder-server:8080/api/v2/settings/idpsync/organization \ ```json { - "field": "string", - "mapping": { - "property1": ["string"], - "property2": ["string"] - }, - "organization_assign_default": true + "field": "string", + "mapping": { + "property1": [ + "string" + ], + "property2": [ + "string" + ] + }, + "organization_assign_default": true } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.OrganizationSyncSettings](schemas.md#codersdkorganizationsyncsettings) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -2583,7 +2736,7 @@ curl -X GET http://coder-server:8080/api/v2/templates/{template}/acl \ ### Parameters | Name | In | Type | Required | Description | -| ---------- | ---- | ------------ | -------- | ----------- | +|------------|------|--------------|----------|-------------| | `template` | path | string(uuid) | true | Template ID | ### Example responses @@ -2592,35 +2745,37 @@ curl -X GET http://coder-server:8080/api/v2/templates/{template}/acl \ ```json [ - { - "avatar_url": "http://example.com", - "created_at": "2019-08-24T14:15:22Z", - "email": "user@example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_seen_at": "2019-08-24T14:15:22Z", - "login_type": "", - "name": "string", - "organization_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "role": "admin", - "roles": [ - { - "display_name": "string", - "name": "string", - "organization_id": "string" - } - ], - "status": "active", - "theme_preference": "string", - "updated_at": "2019-08-24T14:15:22Z", - "username": "string" - } + { + "avatar_url": "http://example.com", + "created_at": "2019-08-24T14:15:22Z", + "email": "user@example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_seen_at": "2019-08-24T14:15:22Z", + "login_type": "", + "name": "string", + "organization_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "role": "admin", + "roles": [ + { + "display_name": "string", + "name": "string", + "organization_id": "string" + } + ], + "status": "active", + "theme_preference": "string", + "updated_at": "2019-08-24T14:15:22Z", + "username": "string" + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ----------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.TemplateUser](schemas.md#codersdktemplateuser) |

Response Schema

@@ -2628,7 +2783,7 @@ curl -X GET http://coder-server:8080/api/v2/templates/{template}/acl \ Status Code **200** | Name | Type | Required | Restrictions | Description | -| -------------------- | -------------------------------------------------------- | -------- | ------------ | ----------- | +|----------------------|----------------------------------------------------------|----------|--------------|-------------| | `[array item]` | array | false | | | | `» avatar_url` | string(uri) | false | | | | `» created_at` | string(date-time) | true | | | @@ -2651,7 +2806,7 @@ Status Code **200** #### Enumerated Values | Property | Value | -| ------------ | ----------- | +|--------------|-------------| | `login_type` | `` | | `login_type` | `password` | | `login_type` | `github` | @@ -2683,21 +2838,21 @@ curl -X PATCH http://coder-server:8080/api/v2/templates/{template}/acl \ ```json { - "group_perms": { - "8bd26b20-f3e8-48be-a903-46bb920cf671": "use", - ">": "admin" - }, - "user_perms": { - "4df59e74-c027-470b-ab4d-cbba8963a5e9": "use", - "": "admin" - } + "group_perms": { + "8bd26b20-f3e8-48be-a903-46bb920cf671": "use", + ">": "admin" + }, + "user_perms": { + "4df59e74-c027-470b-ab4d-cbba8963a5e9": "use", + "": "admin" + } } ``` ### Parameters | Name | In | Type | Required | Description | -| ---------- | ---- | ------------------------------------------------------------------ | -------- | ----------------------- | +|------------|------|--------------------------------------------------------------------|----------|-------------------------| | `template` | path | string(uuid) | true | Template ID | | `body` | body | [codersdk.UpdateTemplateACL](schemas.md#codersdkupdatetemplateacl) | true | Update template request | @@ -2707,21 +2862,21 @@ curl -X PATCH http://coder-server:8080/api/v2/templates/{template}/acl \ ```json { - "detail": "string", - "message": "string", - "validations": [ - { - "detail": "string", - "field": "string" - } - ] + "detail": "string", + "message": "string", + "validations": [ + { + "detail": "string", + "field": "string" + } + ] } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Response](schemas.md#codersdkresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -2742,7 +2897,7 @@ curl -X GET http://coder-server:8080/api/v2/templates/{template}/acl/available \ ### Parameters | Name | In | Type | Required | Description | -| ---------- | ---- | ------------ | -------- | ----------- | +|------------|------|--------------|----------|-------------| | `template` | path | string(uuid) | true | Template ID | ### Example responses @@ -2751,59 +2906,59 @@ curl -X GET http://coder-server:8080/api/v2/templates/{template}/acl/available \ ```json [ - { - "groups": [ - { - "avatar_url": "string", - "display_name": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "members": [ - { - "avatar_url": "http://example.com", - "created_at": "2019-08-24T14:15:22Z", - "email": "user@example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_seen_at": "2019-08-24T14:15:22Z", - "login_type": "", - "name": "string", - "status": "active", - "theme_preference": "string", - "updated_at": "2019-08-24T14:15:22Z", - "username": "string" - } - ], - "name": "string", - "organization_display_name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "organization_name": "string", - "quota_allowance": 0, - "source": "user", - "total_member_count": 0 - } - ], - "users": [ - { - "avatar_url": "http://example.com", - "created_at": "2019-08-24T14:15:22Z", - "email": "user@example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_seen_at": "2019-08-24T14:15:22Z", - "login_type": "", - "name": "string", - "status": "active", - "theme_preference": "string", - "updated_at": "2019-08-24T14:15:22Z", - "username": "string" - } - ] - } + { + "groups": [ + { + "avatar_url": "string", + "display_name": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "members": [ + { + "avatar_url": "http://example.com", + "created_at": "2019-08-24T14:15:22Z", + "email": "user@example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_seen_at": "2019-08-24T14:15:22Z", + "login_type": "", + "name": "string", + "status": "active", + "theme_preference": "string", + "updated_at": "2019-08-24T14:15:22Z", + "username": "string" + } + ], + "name": "string", + "organization_display_name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "organization_name": "string", + "quota_allowance": 0, + "source": "user", + "total_member_count": 0 + } + ], + "users": [ + { + "avatar_url": "http://example.com", + "created_at": "2019-08-24T14:15:22Z", + "email": "user@example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_seen_at": "2019-08-24T14:15:22Z", + "login_type": "", + "name": "string", + "status": "active", + "theme_preference": "string", + "updated_at": "2019-08-24T14:15:22Z", + "username": "string" + } + ] + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ----------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.ACLAvailable](schemas.md#codersdkaclavailable) |

Response Schema

@@ -2811,7 +2966,7 @@ curl -X GET http://coder-server:8080/api/v2/templates/{template}/acl/available \ Status Code **200** | Name | Type | Required | Restrictions | Description | -| ------------------------------ | ------------------------------------------------------ | -------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|--------------------------------|--------------------------------------------------------|----------|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `[array item]` | array | false | | | | `» groups` | array | false | | | | `»» avatar_url` | string | false | | | @@ -2841,7 +2996,7 @@ Status Code **200** #### Enumerated Values | Property | Value | -| ------------ | ----------- | +|--------------|-------------| | `login_type` | `` | | `login_type` | `password` | | `login_type` | `github` | @@ -2871,7 +3026,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/quiet-hours \ ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | ------------ | -------- | ----------- | +|--------|------|--------------|----------|-------------| | `user` | path | string(uuid) | true | User ID | ### Example responses @@ -2880,21 +3035,21 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/quiet-hours \ ```json [ - { - "next": "2019-08-24T14:15:22Z", - "raw_schedule": "string", - "time": "string", - "timezone": "string", - "user_can_set": true, - "user_set": true - } + { + "next": "2019-08-24T14:15:22Z", + "raw_schedule": "string", + "time": "string", + "timezone": "string", + "user_can_set": true, + "user_set": true + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ----------------------------------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-------------------------------------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.UserQuietHoursScheduleResponse](schemas.md#codersdkuserquiethoursscheduleresponse) |

Response Schema

@@ -2902,7 +3057,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/quiet-hours \ Status Code **200** | Name | Type | Required | Restrictions | Description | -| ---------------- | ----------------- | -------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|------------------|-------------------|----------|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `[array item]` | array | false | | | | `» next` | string(date-time) | false | | Next is the next time that the quiet hours window will start. | | `» raw_schedule` | string | false | | | @@ -2931,14 +3086,14 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/quiet-hours \ ```json { - "schedule": "string" + "schedule": "string" } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | ------------------------------------------------------------------------------------------------------ | -------- | ----------------------- | +|--------|------|--------------------------------------------------------------------------------------------------------|----------|-------------------------| | `user` | path | string(uuid) | true | User ID | | `body` | body | [codersdk.UpdateUserQuietHoursScheduleRequest](schemas.md#codersdkupdateuserquiethoursschedulerequest) | true | Update schedule request | @@ -2948,21 +3103,21 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/quiet-hours \ ```json [ - { - "next": "2019-08-24T14:15:22Z", - "raw_schedule": "string", - "time": "string", - "timezone": "string", - "user_can_set": true, - "user_set": true - } + { + "next": "2019-08-24T14:15:22Z", + "raw_schedule": "string", + "time": "string", + "timezone": "string", + "user_can_set": true, + "user_set": true + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ----------------------------------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-------------------------------------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.UserQuietHoursScheduleResponse](schemas.md#codersdkuserquiethoursscheduleresponse) |

Response Schema

@@ -2970,7 +3125,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/quiet-hours \ Status Code **200** | Name | Type | Required | Restrictions | Description | -| ---------------- | ----------------- | -------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|------------------|-------------------|----------|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `[array item]` | array | false | | | | `» next` | string(date-time) | false | | Next is the next time that the quiet hours window will start. | | `» raw_schedule` | string | false | | | @@ -2997,7 +3152,7 @@ curl -X GET http://coder-server:8080/api/v2/workspace-quota/{user} \ ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | ------ | -------- | -------------------- | +|--------|------|--------|----------|----------------------| | `user` | path | string | true | User ID, name, or me | ### Example responses @@ -3006,15 +3161,15 @@ curl -X GET http://coder-server:8080/api/v2/workspace-quota/{user} \ ```json { - "budget": 0, - "credits_consumed": 0 + "budget": 0, + "credits_consumed": 0 } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.WorkspaceQuota](schemas.md#codersdkworkspacequota) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -3038,74 +3193,78 @@ curl -X GET http://coder-server:8080/api/v2/workspaceproxies \ ```json [ - { - "regions": [ - { - "created_at": "2019-08-24T14:15:22Z", - "deleted": true, - "derp_enabled": true, - "derp_only": true, - "display_name": "string", - "healthy": true, - "icon_url": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "name": "string", - "path_app_url": "string", - "status": { - "checked_at": "2019-08-24T14:15:22Z", - "report": { - "errors": ["string"], - "warnings": ["string"] - }, - "status": "ok" - }, - "updated_at": "2019-08-24T14:15:22Z", - "version": "string", - "wildcard_hostname": "string" - } - ] - } + { + "regions": [ + { + "created_at": "2019-08-24T14:15:22Z", + "deleted": true, + "derp_enabled": true, + "derp_only": true, + "display_name": "string", + "healthy": true, + "icon_url": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "name": "string", + "path_app_url": "string", + "status": { + "checked_at": "2019-08-24T14:15:22Z", + "report": { + "errors": [ + "string" + ], + "warnings": [ + "string" + ] + }, + "status": "ok" + }, + "updated_at": "2019-08-24T14:15:22Z", + "version": "string", + "wildcard_hostname": "string" + } + ] + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ----------------------------------------------------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-------------------------------------------------------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.RegionsResponse-codersdk_WorkspaceProxy](schemas.md#codersdkregionsresponse-codersdk_workspaceproxy) |

Response Schema

Status Code **200** -| Name | Type | Required | Restrictions | Description | -| ---------------------- | ------------------------------------------------------------------------ | -------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `[array item]` | array | false | | | -| `» regions` | array | false | | | -| `»» created_at` | string(date-time) | false | | | -| `»» deleted` | boolean | false | | | -| `»» derp_enabled` | boolean | false | | | -| `»» derp_only` | boolean | false | | | -| `»» display_name` | string | false | | | -| `»» healthy` | boolean | false | | | -| `»» icon_url` | string | false | | | -| `»» id` | string(uuid) | false | | | -| `»» name` | string | false | | | -| `»» path_app_url` | string | false | | Path app URL is the URL to the base path for path apps. Optional unless wildcard_hostname is set. E.g. https://us.example.com | -| `»» status` | [codersdk.WorkspaceProxyStatus](schemas.md#codersdkworkspaceproxystatus) | false | | Status is the latest status check of the proxy. This will be empty for deleted proxies. This value can be used to determine if a workspace proxy is healthy and ready to use. | -| `»»» checked_at` | string(date-time) | false | | | -| `»»» report` | [codersdk.ProxyHealthReport](schemas.md#codersdkproxyhealthreport) | false | | Report provides more information about the health of the workspace proxy. | -| `»»»» errors` | array | false | | Errors are problems that prevent the workspace proxy from being healthy | -| `»»»» warnings` | array | false | | Warnings do not prevent the workspace proxy from being healthy, but should be addressed. | -| `»»» status` | [codersdk.ProxyHealthStatus](schemas.md#codersdkproxyhealthstatus) | false | | | -| `»» updated_at` | string(date-time) | false | | | -| `»» version` | string | false | | | -| `»» wildcard_hostname` | string | false | | Wildcard hostname is the wildcard hostname for subdomain apps. E.g. _.us.example.com E.g. _--suffix.au.example.com Optional. Does not need to be on the same domain as PathAppURL. | +| Name | Type | Required | Restrictions | Description | +|------------------------|--------------------------------------------------------------------------|----------|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `[array item]` | array | false | | | +| `» regions` | array | false | | | +| `»» created_at` | string(date-time) | false | | | +| `»» deleted` | boolean | false | | | +| `»» derp_enabled` | boolean | false | | | +| `»» derp_only` | boolean | false | | | +| `»» display_name` | string | false | | | +| `»» healthy` | boolean | false | | | +| `»» icon_url` | string | false | | | +| `»» id` | string(uuid) | false | | | +| `»» name` | string | false | | | +| `»» path_app_url` | string | false | | Path app URL is the URL to the base path for path apps. Optional unless wildcard_hostname is set. E.g. https://us.example.com | +| `»» status` | [codersdk.WorkspaceProxyStatus](schemas.md#codersdkworkspaceproxystatus) | false | | Status is the latest status check of the proxy. This will be empty for deleted proxies. This value can be used to determine if a workspace proxy is healthy and ready to use. | +| `»»» checked_at` | string(date-time) | false | | | +| `»»» report` | [codersdk.ProxyHealthReport](schemas.md#codersdkproxyhealthreport) | false | | Report provides more information about the health of the workspace proxy. | +| `»»»» errors` | array | false | | Errors are problems that prevent the workspace proxy from being healthy | +| `»»»» warnings` | array | false | | Warnings do not prevent the workspace proxy from being healthy, but should be addressed. | +| `»»» status` | [codersdk.ProxyHealthStatus](schemas.md#codersdkproxyhealthstatus) | false | | | +| `»» updated_at` | string(date-time) | false | | | +| `»» version` | string | false | | | +| `»» wildcard_hostname` | string | false | | Wildcard hostname is the wildcard hostname for subdomain apps. E.g. *.us.example.com E.g.*--suffix.au.example.com Optional. Does not need to be on the same domain as PathAppURL. | #### Enumerated Values | Property | Value | -| -------- | -------------- | +|----------|----------------| | `status` | `ok` | | `status` | `unreachable` | | `status` | `unhealthy` | @@ -3131,16 +3290,16 @@ curl -X POST http://coder-server:8080/api/v2/workspaceproxies \ ```json { - "display_name": "string", - "icon": "string", - "name": "string" + "display_name": "string", + "icon": "string", + "name": "string" } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | -------------------------------------------------------------------------------------- | -------- | ------------------------------ | +|--------|------|----------------------------------------------------------------------------------------|----------|--------------------------------| | `body` | body | [codersdk.CreateWorkspaceProxyRequest](schemas.md#codersdkcreateworkspaceproxyrequest) | true | Create workspace proxy request | ### Example responses @@ -3149,34 +3308,38 @@ curl -X POST http://coder-server:8080/api/v2/workspaceproxies \ ```json { - "created_at": "2019-08-24T14:15:22Z", - "deleted": true, - "derp_enabled": true, - "derp_only": true, - "display_name": "string", - "healthy": true, - "icon_url": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "name": "string", - "path_app_url": "string", - "status": { - "checked_at": "2019-08-24T14:15:22Z", - "report": { - "errors": ["string"], - "warnings": ["string"] - }, - "status": "ok" - }, - "updated_at": "2019-08-24T14:15:22Z", - "version": "string", - "wildcard_hostname": "string" + "created_at": "2019-08-24T14:15:22Z", + "deleted": true, + "derp_enabled": true, + "derp_only": true, + "display_name": "string", + "healthy": true, + "icon_url": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "name": "string", + "path_app_url": "string", + "status": { + "checked_at": "2019-08-24T14:15:22Z", + "report": { + "errors": [ + "string" + ], + "warnings": [ + "string" + ] + }, + "status": "ok" + }, + "updated_at": "2019-08-24T14:15:22Z", + "version": "string", + "wildcard_hostname": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------------ | ----------- | ------------------------------------------------------------ | +|--------|--------------------------------------------------------------|-------------|--------------------------------------------------------------| | 201 | [Created](https://tools.ietf.org/html/rfc7231#section-6.3.2) | Created | [codersdk.WorkspaceProxy](schemas.md#codersdkworkspaceproxy) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -3197,7 +3360,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceproxies/{workspaceproxy} \ ### Parameters | Name | In | Type | Required | Description | -| ---------------- | ---- | ------------ | -------- | ---------------- | +|------------------|------|--------------|----------|------------------| | `workspaceproxy` | path | string(uuid) | true | Proxy ID or name | ### Example responses @@ -3206,34 +3369,38 @@ curl -X GET http://coder-server:8080/api/v2/workspaceproxies/{workspaceproxy} \ ```json { - "created_at": "2019-08-24T14:15:22Z", - "deleted": true, - "derp_enabled": true, - "derp_only": true, - "display_name": "string", - "healthy": true, - "icon_url": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "name": "string", - "path_app_url": "string", - "status": { - "checked_at": "2019-08-24T14:15:22Z", - "report": { - "errors": ["string"], - "warnings": ["string"] - }, - "status": "ok" - }, - "updated_at": "2019-08-24T14:15:22Z", - "version": "string", - "wildcard_hostname": "string" + "created_at": "2019-08-24T14:15:22Z", + "deleted": true, + "derp_enabled": true, + "derp_only": true, + "display_name": "string", + "healthy": true, + "icon_url": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "name": "string", + "path_app_url": "string", + "status": { + "checked_at": "2019-08-24T14:15:22Z", + "report": { + "errors": [ + "string" + ], + "warnings": [ + "string" + ] + }, + "status": "ok" + }, + "updated_at": "2019-08-24T14:15:22Z", + "version": "string", + "wildcard_hostname": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.WorkspaceProxy](schemas.md#codersdkworkspaceproxy) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -3254,7 +3421,7 @@ curl -X DELETE http://coder-server:8080/api/v2/workspaceproxies/{workspaceproxy} ### Parameters | Name | In | Type | Required | Description | -| ---------------- | ---- | ------------ | -------- | ---------------- | +|------------------|------|--------------|----------|------------------| | `workspaceproxy` | path | string(uuid) | true | Proxy ID or name | ### Example responses @@ -3263,21 +3430,21 @@ curl -X DELETE http://coder-server:8080/api/v2/workspaceproxies/{workspaceproxy} ```json { - "detail": "string", - "message": "string", - "validations": [ - { - "detail": "string", - "field": "string" - } - ] + "detail": "string", + "message": "string", + "validations": [ + { + "detail": "string", + "field": "string" + } + ] } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Response](schemas.md#codersdkresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -3300,18 +3467,18 @@ curl -X PATCH http://coder-server:8080/api/v2/workspaceproxies/{workspaceproxy} ```json { - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "name": "string", - "regenerate_token": true + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "name": "string", + "regenerate_token": true } ``` ### Parameters | Name | In | Type | Required | Description | -| ---------------- | ---- | ---------------------------------------------------------------------- | -------- | ------------------------------ | +|------------------|------|------------------------------------------------------------------------|----------|--------------------------------| | `workspaceproxy` | path | string(uuid) | true | Proxy ID or name | | `body` | body | [codersdk.PatchWorkspaceProxy](schemas.md#codersdkpatchworkspaceproxy) | true | Update workspace proxy request | @@ -3321,34 +3488,38 @@ curl -X PATCH http://coder-server:8080/api/v2/workspaceproxies/{workspaceproxy} ```json { - "created_at": "2019-08-24T14:15:22Z", - "deleted": true, - "derp_enabled": true, - "derp_only": true, - "display_name": "string", - "healthy": true, - "icon_url": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "name": "string", - "path_app_url": "string", - "status": { - "checked_at": "2019-08-24T14:15:22Z", - "report": { - "errors": ["string"], - "warnings": ["string"] - }, - "status": "ok" - }, - "updated_at": "2019-08-24T14:15:22Z", - "version": "string", - "wildcard_hostname": "string" + "created_at": "2019-08-24T14:15:22Z", + "deleted": true, + "derp_enabled": true, + "derp_only": true, + "display_name": "string", + "healthy": true, + "icon_url": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "name": "string", + "path_app_url": "string", + "status": { + "checked_at": "2019-08-24T14:15:22Z", + "report": { + "errors": [ + "string" + ], + "warnings": [ + "string" + ] + }, + "status": "ok" + }, + "updated_at": "2019-08-24T14:15:22Z", + "version": "string", + "wildcard_hostname": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.WorkspaceProxy](schemas.md#codersdkworkspaceproxy) | To perform this operation, you must be authenticated. [Learn more](authentication.md). diff --git a/docs/reference/api/files.md b/docs/reference/api/files.md index b0c6b6d7fd683..7b937876bbf3b 100644 --- a/docs/reference/api/files.md +++ b/docs/reference/api/files.md @@ -18,12 +18,13 @@ curl -X POST http://coder-server:8080/api/v2/files \ ```yaml file: string + ``` ### Parameters | Name | In | Type | Required | Description | -| -------------- | ------ | ------ | -------- | ---------------------------------------------------------------------------------------------- | +|----------------|--------|--------|----------|------------------------------------------------------------------------------------------------| | `Content-Type` | header | string | true | Content-Type must be `application/x-tar` or `application/zip` | | `body` | body | object | true | | | `» file` | body | binary | true | File to be uploaded. If using tar format, file must conform to ustar (pax may cause problems). | @@ -34,14 +35,14 @@ file: string ```json { - "hash": "19686d84-b10d-4f90-b18e-84fd3fa038fd" + "hash": "19686d84-b10d-4f90-b18e-84fd3fa038fd" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------------ | ----------- | ------------------------------------------------------------ | +|--------|--------------------------------------------------------------|-------------|--------------------------------------------------------------| | 201 | [Created](https://tools.ietf.org/html/rfc7231#section-6.3.2) | Created | [codersdk.UploadResponse](schemas.md#codersdkuploadresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -61,13 +62,13 @@ curl -X GET http://coder-server:8080/api/v2/files/{fileID} \ ### Parameters | Name | In | Type | Required | Description | -| -------- | ---- | ------------ | -------- | ----------- | +|----------|------|--------------|----------|-------------| | `fileID` | path | string(uuid) | true | File ID | ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------ | +|--------|---------------------------------------------------------|-------------|--------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | | To perform this operation, you must be authenticated. [Learn more](authentication.md). diff --git a/docs/reference/api/general.md b/docs/reference/api/general.md index 57e62d3ba7fed..c25e513431002 100644 --- a/docs/reference/api/general.md +++ b/docs/reference/api/general.md @@ -18,21 +18,21 @@ curl -X GET http://coder-server:8080/api/v2/ \ ```json { - "detail": "string", - "message": "string", - "validations": [ - { - "detail": "string", - "field": "string" - } - ] + "detail": "string", + "message": "string", + "validations": [ + { + "detail": "string", + "field": "string" + } + ] } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Response](schemas.md#codersdkresponse) | ## Build info @@ -53,22 +53,22 @@ curl -X GET http://coder-server:8080/api/v2/buildinfo \ ```json { - "agent_api_version": "string", - "dashboard_url": "string", - "deployment_id": "string", - "external_url": "string", - "provisioner_api_version": "string", - "telemetry": true, - "upgrade_message": "string", - "version": "string", - "workspace_proxy": true + "agent_api_version": "string", + "dashboard_url": "string", + "deployment_id": "string", + "external_url": "string", + "provisioner_api_version": "string", + "telemetry": true, + "upgrade_message": "string", + "version": "string", + "workspace_proxy": true } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.BuildInfoResponse](schemas.md#codersdkbuildinforesponse) | ## Report CSP violations @@ -88,20 +88,20 @@ curl -X POST http://coder-server:8080/api/v2/csp/reports \ ```json { - "csp-report": {} + "csp-report": {} } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | ---------------------------------------------------- | -------- | ---------------- | +|--------|------|------------------------------------------------------|----------|------------------| | `body` | body | [coderd.cspViolation](schemas.md#coderdcspviolation) | true | Violation report | ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------ | +|--------|---------------------------------------------------------|-------------|--------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -125,386 +125,430 @@ curl -X GET http://coder-server:8080/api/v2/deployment/config \ ```json { - "config": { - "access_url": { - "forceQuery": true, - "fragment": "string", - "host": "string", - "omitHost": true, - "opaque": "string", - "path": "string", - "rawFragment": "string", - "rawPath": "string", - "rawQuery": "string", - "scheme": "string", - "user": {} - }, - "additional_csp_policy": ["string"], - "address": { - "host": "string", - "port": "string" - }, - "agent_fallback_troubleshooting_url": { - "forceQuery": true, - "fragment": "string", - "host": "string", - "omitHost": true, - "opaque": "string", - "path": "string", - "rawFragment": "string", - "rawPath": "string", - "rawQuery": "string", - "scheme": "string", - "user": {} - }, - "agent_stat_refresh_interval": 0, - "allow_workspace_renames": true, - "autobuild_poll_interval": 0, - "browser_only": true, - "cache_directory": "string", - "cli_upgrade_message": "string", - "config": "string", - "config_ssh": { - "deploymentName": "string", - "sshconfigOptions": ["string"] - }, - "dangerous": { - "allow_all_cors": true, - "allow_path_app_sharing": true, - "allow_path_app_site_owner_access": true - }, - "derp": { - "config": { - "block_direct": true, - "force_websockets": true, - "path": "string", - "url": "string" - }, - "server": { - "enable": true, - "region_code": "string", - "region_id": 0, - "region_name": "string", - "relay_url": { - "forceQuery": true, - "fragment": "string", - "host": "string", - "omitHost": true, - "opaque": "string", - "path": "string", - "rawFragment": "string", - "rawPath": "string", - "rawQuery": "string", - "scheme": "string", - "user": {} - }, - "stun_addresses": ["string"] - } - }, - "disable_owner_workspace_exec": true, - "disable_password_auth": true, - "disable_path_apps": true, - "docs_url": { - "forceQuery": true, - "fragment": "string", - "host": "string", - "omitHost": true, - "opaque": "string", - "path": "string", - "rawFragment": "string", - "rawPath": "string", - "rawQuery": "string", - "scheme": "string", - "user": {} - }, - "enable_terraform_debug_mode": true, - "experiments": ["string"], - "external_auth": { - "value": [ - { - "app_install_url": "string", - "app_installations_url": "string", - "auth_url": "string", - "client_id": "string", - "device_code_url": "string", - "device_flow": true, - "display_icon": "string", - "display_name": "string", - "id": "string", - "no_refresh": true, - "regex": "string", - "scopes": ["string"], - "token_url": "string", - "type": "string", - "validate_url": "string" - } - ] - }, - "external_token_encryption_keys": ["string"], - "healthcheck": { - "refresh": 0, - "threshold_database": 0 - }, - "http_address": "string", - "in_memory_database": true, - "job_hang_detector_interval": 0, - "logging": { - "human": "string", - "json": "string", - "log_filter": ["string"], - "stackdriver": "string" - }, - "metrics_cache_refresh_interval": 0, - "notifications": { - "dispatch_timeout": 0, - "email": { - "auth": { - "identity": "string", - "password": "string", - "password_file": "string", - "username": "string" - }, - "force_tls": true, - "from": "string", - "hello": "string", - "smarthost": "string", - "tls": { - "ca_file": "string", - "cert_file": "string", - "insecure_skip_verify": true, - "key_file": "string", - "server_name": "string", - "start_tls": true - } - }, - "fetch_interval": 0, - "lease_count": 0, - "lease_period": 0, - "max_send_attempts": 0, - "method": "string", - "retry_interval": 0, - "sync_buffer_size": 0, - "sync_interval": 0, - "webhook": { - "endpoint": { - "forceQuery": true, - "fragment": "string", - "host": "string", - "omitHost": true, - "opaque": "string", - "path": "string", - "rawFragment": "string", - "rawPath": "string", - "rawQuery": "string", - "scheme": "string", - "user": {} - } - } - }, - "oauth2": { - "github": { - "allow_everyone": true, - "allow_signups": true, - "allowed_orgs": ["string"], - "allowed_teams": ["string"], - "client_id": "string", - "client_secret": "string", - "enterprise_base_url": "string" - } - }, - "oidc": { - "allow_signups": true, - "auth_url_params": {}, - "client_cert_file": "string", - "client_id": "string", - "client_key_file": "string", - "client_secret": "string", - "email_domain": ["string"], - "email_field": "string", - "group_allow_list": ["string"], - "group_auto_create": true, - "group_mapping": {}, - "group_regex_filter": {}, - "groups_field": "string", - "icon_url": { - "forceQuery": true, - "fragment": "string", - "host": "string", - "omitHost": true, - "opaque": "string", - "path": "string", - "rawFragment": "string", - "rawPath": "string", - "rawQuery": "string", - "scheme": "string", - "user": {} - }, - "ignore_email_verified": true, - "ignore_user_info": true, - "issuer_url": "string", - "name_field": "string", - "organization_assign_default": true, - "organization_field": "string", - "organization_mapping": {}, - "scopes": ["string"], - "sign_in_text": "string", - "signups_disabled_text": "string", - "skip_issuer_checks": true, - "user_role_field": "string", - "user_role_mapping": {}, - "user_roles_default": ["string"], - "username_field": "string" - }, - "pg_auth": "string", - "pg_connection_url": "string", - "pprof": { - "address": { - "host": "string", - "port": "string" - }, - "enable": true - }, - "prometheus": { - "address": { - "host": "string", - "port": "string" - }, - "aggregate_agent_stats_by": ["string"], - "collect_agent_stats": true, - "collect_db_metrics": true, - "enable": true - }, - "provisioner": { - "daemon_poll_interval": 0, - "daemon_poll_jitter": 0, - "daemon_psk": "string", - "daemon_types": ["string"], - "daemons": 0, - "force_cancel_interval": 0 - }, - "proxy_health_status_interval": 0, - "proxy_trusted_headers": ["string"], - "proxy_trusted_origins": ["string"], - "rate_limit": { - "api": 0, - "disable_all": true - }, - "redirect_to_access_url": true, - "scim_api_key": "string", - "secure_auth_cookie": true, - "session_lifetime": { - "default_duration": 0, - "default_token_lifetime": 0, - "disable_expiry_refresh": true, - "max_token_lifetime": 0 - }, - "ssh_keygen_algorithm": "string", - "strict_transport_security": 0, - "strict_transport_security_options": ["string"], - "support": { - "links": { - "value": [ - { - "icon": "bug", - "name": "string", - "target": "string" - } - ] - } - }, - "swagger": { - "enable": true - }, - "telemetry": { - "enable": true, - "trace": true, - "url": { - "forceQuery": true, - "fragment": "string", - "host": "string", - "omitHost": true, - "opaque": "string", - "path": "string", - "rawFragment": "string", - "rawPath": "string", - "rawQuery": "string", - "scheme": "string", - "user": {} - } - }, - "terms_of_service_url": "string", - "tls": { - "address": { - "host": "string", - "port": "string" - }, - "allow_insecure_ciphers": true, - "cert_file": ["string"], - "client_auth": "string", - "client_ca_file": "string", - "client_cert_file": "string", - "client_key_file": "string", - "enable": true, - "key_file": ["string"], - "min_version": "string", - "redirect_http": true, - "supported_ciphers": ["string"] - }, - "trace": { - "capture_logs": true, - "data_dog": true, - "enable": true, - "honeycomb_api_key": "string" - }, - "update_check": true, - "user_quiet_hours_schedule": { - "allow_user_custom": true, - "default_schedule": "string" - }, - "verbose": true, - "web_terminal_renderer": "string", - "wgtunnel_host": "string", - "wildcard_access_url": "string", - "write_config": true - }, - "options": [ - { - "annotations": { - "property1": "string", - "property2": "string" - }, - "default": "string", - "description": "string", - "env": "string", - "flag": "string", - "flag_shorthand": "string", - "group": { - "description": "string", - "name": "string", - "parent": { - "description": "string", - "name": "string", - "parent": {}, - "yaml": "string" - }, - "yaml": "string" - }, - "hidden": true, - "name": "string", - "required": true, - "use_instead": [{}], - "value": null, - "value_source": "", - "yaml": "string" - } - ] + "config": { + "access_url": { + "forceQuery": true, + "fragment": "string", + "host": "string", + "omitHost": true, + "opaque": "string", + "path": "string", + "rawFragment": "string", + "rawPath": "string", + "rawQuery": "string", + "scheme": "string", + "user": {} + }, + "additional_csp_policy": [ + "string" + ], + "address": { + "host": "string", + "port": "string" + }, + "agent_fallback_troubleshooting_url": { + "forceQuery": true, + "fragment": "string", + "host": "string", + "omitHost": true, + "opaque": "string", + "path": "string", + "rawFragment": "string", + "rawPath": "string", + "rawQuery": "string", + "scheme": "string", + "user": {} + }, + "agent_stat_refresh_interval": 0, + "allow_workspace_renames": true, + "autobuild_poll_interval": 0, + "browser_only": true, + "cache_directory": "string", + "cli_upgrade_message": "string", + "config": "string", + "config_ssh": { + "deploymentName": "string", + "sshconfigOptions": [ + "string" + ] + }, + "dangerous": { + "allow_all_cors": true, + "allow_path_app_sharing": true, + "allow_path_app_site_owner_access": true + }, + "derp": { + "config": { + "block_direct": true, + "force_websockets": true, + "path": "string", + "url": "string" + }, + "server": { + "enable": true, + "region_code": "string", + "region_id": 0, + "region_name": "string", + "relay_url": { + "forceQuery": true, + "fragment": "string", + "host": "string", + "omitHost": true, + "opaque": "string", + "path": "string", + "rawFragment": "string", + "rawPath": "string", + "rawQuery": "string", + "scheme": "string", + "user": {} + }, + "stun_addresses": [ + "string" + ] + } + }, + "disable_owner_workspace_exec": true, + "disable_password_auth": true, + "disable_path_apps": true, + "docs_url": { + "forceQuery": true, + "fragment": "string", + "host": "string", + "omitHost": true, + "opaque": "string", + "path": "string", + "rawFragment": "string", + "rawPath": "string", + "rawQuery": "string", + "scheme": "string", + "user": {} + }, + "enable_terraform_debug_mode": true, + "experiments": [ + "string" + ], + "external_auth": { + "value": [ + { + "app_install_url": "string", + "app_installations_url": "string", + "auth_url": "string", + "client_id": "string", + "device_code_url": "string", + "device_flow": true, + "display_icon": "string", + "display_name": "string", + "id": "string", + "no_refresh": true, + "regex": "string", + "scopes": [ + "string" + ], + "token_url": "string", + "type": "string", + "validate_url": "string" + } + ] + }, + "external_token_encryption_keys": [ + "string" + ], + "healthcheck": { + "refresh": 0, + "threshold_database": 0 + }, + "http_address": "string", + "in_memory_database": true, + "job_hang_detector_interval": 0, + "logging": { + "human": "string", + "json": "string", + "log_filter": [ + "string" + ], + "stackdriver": "string" + }, + "metrics_cache_refresh_interval": 0, + "notifications": { + "dispatch_timeout": 0, + "email": { + "auth": { + "identity": "string", + "password": "string", + "password_file": "string", + "username": "string" + }, + "force_tls": true, + "from": "string", + "hello": "string", + "smarthost": "string", + "tls": { + "ca_file": "string", + "cert_file": "string", + "insecure_skip_verify": true, + "key_file": "string", + "server_name": "string", + "start_tls": true + } + }, + "fetch_interval": 0, + "lease_count": 0, + "lease_period": 0, + "max_send_attempts": 0, + "method": "string", + "retry_interval": 0, + "sync_buffer_size": 0, + "sync_interval": 0, + "webhook": { + "endpoint": { + "forceQuery": true, + "fragment": "string", + "host": "string", + "omitHost": true, + "opaque": "string", + "path": "string", + "rawFragment": "string", + "rawPath": "string", + "rawQuery": "string", + "scheme": "string", + "user": {} + } + } + }, + "oauth2": { + "github": { + "allow_everyone": true, + "allow_signups": true, + "allowed_orgs": [ + "string" + ], + "allowed_teams": [ + "string" + ], + "client_id": "string", + "client_secret": "string", + "enterprise_base_url": "string" + } + }, + "oidc": { + "allow_signups": true, + "auth_url_params": {}, + "client_cert_file": "string", + "client_id": "string", + "client_key_file": "string", + "client_secret": "string", + "email_domain": [ + "string" + ], + "email_field": "string", + "group_allow_list": [ + "string" + ], + "group_auto_create": true, + "group_mapping": {}, + "group_regex_filter": {}, + "groups_field": "string", + "icon_url": { + "forceQuery": true, + "fragment": "string", + "host": "string", + "omitHost": true, + "opaque": "string", + "path": "string", + "rawFragment": "string", + "rawPath": "string", + "rawQuery": "string", + "scheme": "string", + "user": {} + }, + "ignore_email_verified": true, + "ignore_user_info": true, + "issuer_url": "string", + "name_field": "string", + "organization_assign_default": true, + "organization_field": "string", + "organization_mapping": {}, + "scopes": [ + "string" + ], + "sign_in_text": "string", + "signups_disabled_text": "string", + "skip_issuer_checks": true, + "user_role_field": "string", + "user_role_mapping": {}, + "user_roles_default": [ + "string" + ], + "username_field": "string" + }, + "pg_auth": "string", + "pg_connection_url": "string", + "pprof": { + "address": { + "host": "string", + "port": "string" + }, + "enable": true + }, + "prometheus": { + "address": { + "host": "string", + "port": "string" + }, + "aggregate_agent_stats_by": [ + "string" + ], + "collect_agent_stats": true, + "collect_db_metrics": true, + "enable": true + }, + "provisioner": { + "daemon_poll_interval": 0, + "daemon_poll_jitter": 0, + "daemon_psk": "string", + "daemon_types": [ + "string" + ], + "daemons": 0, + "force_cancel_interval": 0 + }, + "proxy_health_status_interval": 0, + "proxy_trusted_headers": [ + "string" + ], + "proxy_trusted_origins": [ + "string" + ], + "rate_limit": { + "api": 0, + "disable_all": true + }, + "redirect_to_access_url": true, + "scim_api_key": "string", + "secure_auth_cookie": true, + "session_lifetime": { + "default_duration": 0, + "default_token_lifetime": 0, + "disable_expiry_refresh": true, + "max_token_lifetime": 0 + }, + "ssh_keygen_algorithm": "string", + "strict_transport_security": 0, + "strict_transport_security_options": [ + "string" + ], + "support": { + "links": { + "value": [ + { + "icon": "bug", + "name": "string", + "target": "string" + } + ] + } + }, + "swagger": { + "enable": true + }, + "telemetry": { + "enable": true, + "trace": true, + "url": { + "forceQuery": true, + "fragment": "string", + "host": "string", + "omitHost": true, + "opaque": "string", + "path": "string", + "rawFragment": "string", + "rawPath": "string", + "rawQuery": "string", + "scheme": "string", + "user": {} + } + }, + "terms_of_service_url": "string", + "tls": { + "address": { + "host": "string", + "port": "string" + }, + "allow_insecure_ciphers": true, + "cert_file": [ + "string" + ], + "client_auth": "string", + "client_ca_file": "string", + "client_cert_file": "string", + "client_key_file": "string", + "enable": true, + "key_file": [ + "string" + ], + "min_version": "string", + "redirect_http": true, + "supported_ciphers": [ + "string" + ] + }, + "trace": { + "capture_logs": true, + "data_dog": true, + "enable": true, + "honeycomb_api_key": "string" + }, + "update_check": true, + "user_quiet_hours_schedule": { + "allow_user_custom": true, + "default_schedule": "string" + }, + "verbose": true, + "web_terminal_renderer": "string", + "wgtunnel_host": "string", + "wildcard_access_url": "string", + "write_config": true + }, + "options": [ + { + "annotations": { + "property1": "string", + "property2": "string" + }, + "default": "string", + "description": "string", + "env": "string", + "flag": "string", + "flag_shorthand": "string", + "group": { + "description": "string", + "name": "string", + "parent": { + "description": "string", + "name": "string", + "parent": {}, + "yaml": "string" + }, + "yaml": "string" + }, + "hidden": true, + "name": "string", + "required": true, + "use_instead": [ + {} + ], + "value": null, + "value_source": "", + "yaml": "string" + } + ] } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.DeploymentConfig](schemas.md#codersdkdeploymentconfig) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -528,18 +572,18 @@ curl -X GET http://coder-server:8080/api/v2/deployment/ssh \ ```json { - "hostname_prefix": "string", - "ssh_config_options": { - "property1": "string", - "property2": "string" - } + "hostname_prefix": "string", + "ssh_config_options": { + "property1": "string", + "property2": "string" + } } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.SSHConfigResponse](schemas.md#codersdksshconfigresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -563,35 +607,35 @@ curl -X GET http://coder-server:8080/api/v2/deployment/stats \ ```json { - "aggregated_from": "2019-08-24T14:15:22Z", - "collected_at": "2019-08-24T14:15:22Z", - "next_update_at": "2019-08-24T14:15:22Z", - "session_count": { - "jetbrains": 0, - "reconnecting_pty": 0, - "ssh": 0, - "vscode": 0 - }, - "workspaces": { - "building": 0, - "connection_latency_ms": { - "p50": 0, - "p95": 0 - }, - "failed": 0, - "pending": 0, - "running": 0, - "rx_bytes": 0, - "stopped": 0, - "tx_bytes": 0 - } + "aggregated_from": "2019-08-24T14:15:22Z", + "collected_at": "2019-08-24T14:15:22Z", + "next_update_at": "2019-08-24T14:15:22Z", + "session_count": { + "jetbrains": 0, + "reconnecting_pty": 0, + "ssh": 0, + "vscode": 0 + }, + "workspaces": { + "building": 0, + "connection_latency_ms": { + "p50": 0, + "p95": 0 + }, + "failed": 0, + "pending": 0, + "running": 0, + "rx_bytes": 0, + "stopped": 0, + "tx_bytes": 0 + } } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.DeploymentStats](schemas.md#codersdkdeploymentstats) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -614,13 +658,15 @@ curl -X GET http://coder-server:8080/api/v2/experiments \ > 200 Response ```json -["example"] +[ + "example" +] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|---------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.Experiment](schemas.md#codersdkexperiment) |

Response Schema

@@ -628,7 +674,7 @@ curl -X GET http://coder-server:8080/api/v2/experiments \ Status Code **200** | Name | Type | Required | Restrictions | Description | -| -------------- | ----- | -------- | ------------ | ----------- | +|----------------|-------|----------|--------------|-------------| | `[array item]` | array | false | | | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -651,13 +697,15 @@ curl -X GET http://coder-server:8080/api/v2/experiments/available \ > 200 Response ```json -["example"] +[ + "example" +] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|---------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.Experiment](schemas.md#codersdkexperiment) |

Response Schema

@@ -665,7 +713,7 @@ curl -X GET http://coder-server:8080/api/v2/experiments/available \ Status Code **200** | Name | Type | Required | Restrictions | Description | -| -------------- | ----- | -------- | ------------ | ----------- | +|----------------|-------|----------|--------------|-------------| | `[array item]` | array | false | | | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -688,16 +736,16 @@ curl -X GET http://coder-server:8080/api/v2/updatecheck \ ```json { - "current": true, - "url": "string", - "version": "string" + "current": true, + "url": "string", + "version": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.UpdateCheckResponse](schemas.md#codersdkupdatecheckresponse) | ## Get token config @@ -716,7 +764,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/keys/tokens/tokenconfig ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | ------ | -------- | -------------------- | +|--------|------|--------|----------|----------------------| | `user` | path | string | true | User ID, name, or me | ### Example responses @@ -725,14 +773,14 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/keys/tokens/tokenconfig ```json { - "max_token_lifetime": 0 + "max_token_lifetime": 0 } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.TokenConfig](schemas.md#codersdktokenconfig) | To perform this operation, you must be authenticated. [Learn more](authentication.md). diff --git a/docs/reference/api/git.md b/docs/reference/api/git.md index 0200421ec2db3..fc36f184a7c97 100644 --- a/docs/reference/api/git.md +++ b/docs/reference/api/git.md @@ -19,20 +19,20 @@ curl -X GET http://coder-server:8080/api/v2/external-auth \ ```json { - "authenticated": true, - "created_at": "2019-08-24T14:15:22Z", - "expires": "2019-08-24T14:15:22Z", - "has_refresh_token": true, - "provider_id": "string", - "updated_at": "2019-08-24T14:15:22Z", - "validate_error": "string" + "authenticated": true, + "created_at": "2019-08-24T14:15:22Z", + "expires": "2019-08-24T14:15:22Z", + "has_refresh_token": true, + "provider_id": "string", + "updated_at": "2019-08-24T14:15:22Z", + "validate_error": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.ExternalAuthLink](schemas.md#codersdkexternalauthlink) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -53,7 +53,7 @@ curl -X GET http://coder-server:8080/api/v2/external-auth/{externalauth} \ ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | -------------- | -------- | --------------- | +|----------------|------|----------------|----------|-----------------| | `externalauth` | path | string(string) | true | Git Provider ID | ### Example responses @@ -62,38 +62,38 @@ curl -X GET http://coder-server:8080/api/v2/external-auth/{externalauth} \ ```json { - "app_install_url": "string", - "app_installable": true, - "authenticated": true, - "device": true, - "display_name": "string", - "installations": [ - { - "account": { - "avatar_url": "string", - "id": 0, - "login": "string", - "name": "string", - "profile_url": "string" - }, - "configure_url": "string", - "id": 0 - } - ], - "user": { - "avatar_url": "string", - "id": 0, - "login": "string", - "name": "string", - "profile_url": "string" - } + "app_install_url": "string", + "app_installable": true, + "authenticated": true, + "device": true, + "display_name": "string", + "installations": [ + { + "account": { + "avatar_url": "string", + "id": 0, + "login": "string", + "name": "string", + "profile_url": "string" + }, + "configure_url": "string", + "id": 0 + } + ], + "user": { + "avatar_url": "string", + "id": 0, + "login": "string", + "name": "string", + "profile_url": "string" + } } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.ExternalAuth](schemas.md#codersdkexternalauth) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -113,18 +113,18 @@ curl -X DELETE http://coder-server:8080/api/v2/external-auth/{externalauth} \ ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | -------------- | -------- | --------------- | +|----------------|------|----------------|----------|-----------------| | `externalauth` | path | string(string) | true | Git Provider ID | ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------ | +|--------|---------------------------------------------------------|-------------|--------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | | To perform this operation, you must be authenticated. [Learn more](authentication.md). -## Get external auth device by ID. +## Get external auth device by ID ### Code samples @@ -140,7 +140,7 @@ curl -X GET http://coder-server:8080/api/v2/external-auth/{externalauth}/device ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | -------------- | -------- | --------------- | +|----------------|------|----------------|----------|-----------------| | `externalauth` | path | string(string) | true | Git Provider ID | ### Example responses @@ -149,18 +149,18 @@ curl -X GET http://coder-server:8080/api/v2/external-auth/{externalauth}/device ```json { - "device_code": "string", - "expires_in": 0, - "interval": 0, - "user_code": "string", - "verification_uri": "string" + "device_code": "string", + "expires_in": 0, + "interval": 0, + "user_code": "string", + "verification_uri": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.ExternalAuthDevice](schemas.md#codersdkexternalauthdevice) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -180,13 +180,13 @@ curl -X POST http://coder-server:8080/api/v2/external-auth/{externalauth}/device ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | -------------- | -------- | -------------------- | +|----------------|------|----------------|----------|----------------------| | `externalauth` | path | string(string) | true | External Provider ID | ### Responses | Status | Meaning | Description | Schema | -| ------ | --------------------------------------------------------------- | ----------- | ------ | +|--------|-----------------------------------------------------------------|-------------|--------| | 204 | [No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5) | No Content | | To perform this operation, you must be authenticated. [Learn more](authentication.md). diff --git a/docs/reference/api/index.md b/docs/reference/api/index.md index 8124da06e71da..a44b68e2c8cf3 100644 --- a/docs/reference/api/index.md +++ b/docs/reference/api/index.md @@ -1,20 +1,22 @@ +# API + Get started with the Coder API: ## Quickstart Generate a token on your Coder deployment by visiting: -```shell +````shell https://coder.example.com/settings/tokens -``` +```` List your workspaces -```shell +````shell # CLI curl https://coder.example.com/api/v2/workspaces?q=owner:me \ -H "Coder-Session-Token: " -``` +```` ## Use cases diff --git a/docs/reference/api/insights.md b/docs/reference/api/insights.md index d9bb2327a9517..e59d74ec6c7f8 100644 --- a/docs/reference/api/insights.md +++ b/docs/reference/api/insights.md @@ -16,7 +16,7 @@ curl -X GET http://coder-server:8080/api/v2/insights/daus?tz_offset=0 \ ### Parameters | Name | In | Type | Required | Description | -| ----------- | ----- | ------- | -------- | -------------------------- | +|-------------|-------|---------|----------|----------------------------| | `tz_offset` | query | integer | true | Time-zone offset (e.g. -2) | ### Example responses @@ -25,20 +25,20 @@ curl -X GET http://coder-server:8080/api/v2/insights/daus?tz_offset=0 \ ```json { - "entries": [ - { - "amount": 0, - "date": "string" - } - ], - "tz_hour_offset": 0 + "entries": [ + { + "amount": 0, + "date": "string" + } + ], + "tz_hour_offset": 0 } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.DAUsResponse](schemas.md#codersdkdausresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -59,7 +59,7 @@ curl -X GET http://coder-server:8080/api/v2/insights/templates?start_time=2019-0 ### Parameters | Name | In | Type | Required | Description | -| -------------- | ----- | ----------------- | -------- | ------------ | +|----------------|-------|-------------------|----------|--------------| | `start_time` | query | string(date-time) | true | Start time | | `end_time` | query | string(date-time) | true | End time | | `interval` | query | string | true | Interval | @@ -68,7 +68,7 @@ curl -X GET http://coder-server:8080/api/v2/insights/templates?start_time=2019-0 #### Enumerated Values | Parameter | Value | -| ---------- | ------ | +|------------|--------| | `interval` | `week` | | `interval` | `day` | @@ -78,62 +78,70 @@ curl -X GET http://coder-server:8080/api/v2/insights/templates?start_time=2019-0 ```json { - "interval_reports": [ - { - "active_users": 14, - "end_time": "2019-08-24T14:15:22Z", - "interval": "week", - "start_time": "2019-08-24T14:15:22Z", - "template_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"] - } - ], - "report": { - "active_users": 22, - "apps_usage": [ - { - "display_name": "Visual Studio Code", - "icon": "string", - "seconds": 80500, - "slug": "vscode", - "template_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "times_used": 2, - "type": "builtin" - } - ], - "end_time": "2019-08-24T14:15:22Z", - "parameters_usage": [ - { - "description": "string", - "display_name": "string", - "name": "string", - "options": [ - { - "description": "string", - "icon": "string", - "name": "string", - "value": "string" - } - ], - "template_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "type": "string", - "values": [ - { - "count": 0, - "value": "string" - } - ] - } - ], - "start_time": "2019-08-24T14:15:22Z", - "template_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"] - } + "interval_reports": [ + { + "active_users": 14, + "end_time": "2019-08-24T14:15:22Z", + "interval": "week", + "start_time": "2019-08-24T14:15:22Z", + "template_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ] + } + ], + "report": { + "active_users": 22, + "apps_usage": [ + { + "display_name": "Visual Studio Code", + "icon": "string", + "seconds": 80500, + "slug": "vscode", + "template_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "times_used": 2, + "type": "builtin" + } + ], + "end_time": "2019-08-24T14:15:22Z", + "parameters_usage": [ + { + "description": "string", + "display_name": "string", + "name": "string", + "options": [ + { + "description": "string", + "icon": "string", + "name": "string", + "value": "string" + } + ], + "template_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "type": "string", + "values": [ + { + "count": 0, + "value": "string" + } + ] + } + ], + "start_time": "2019-08-24T14:15:22Z", + "template_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ] + } } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.TemplateInsightsResponse](schemas.md#codersdktemplateinsightsresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -154,7 +162,7 @@ curl -X GET http://coder-server:8080/api/v2/insights/user-activity?start_time=20 ### Parameters | Name | In | Type | Required | Description | -| -------------- | ----- | ----------------- | -------- | ------------ | +|----------------|-------|-------------------|----------|--------------| | `start_time` | query | string(date-time) | true | Start time | | `end_time` | query | string(date-time) | true | End time | | `template_ids` | query | array[string] | false | Template IDs | @@ -165,27 +173,31 @@ curl -X GET http://coder-server:8080/api/v2/insights/user-activity?start_time=20 ```json { - "report": { - "end_time": "2019-08-24T14:15:22Z", - "start_time": "2019-08-24T14:15:22Z", - "template_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "users": [ - { - "avatar_url": "http://example.com", - "seconds": 80500, - "template_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5", - "username": "string" - } - ] - } + "report": { + "end_time": "2019-08-24T14:15:22Z", + "start_time": "2019-08-24T14:15:22Z", + "template_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "users": [ + { + "avatar_url": "http://example.com", + "seconds": 80500, + "template_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5", + "username": "string" + } + ] + } } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|------------------------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.UserActivityInsightsResponse](schemas.md#codersdkuseractivityinsightsresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -206,7 +218,7 @@ curl -X GET http://coder-server:8080/api/v2/insights/user-latency?start_time=201 ### Parameters | Name | In | Type | Required | Description | -| -------------- | ----- | ----------------- | -------- | ------------ | +|----------------|-------|-------------------|----------|--------------| | `start_time` | query | string(date-time) | true | Start time | | `end_time` | query | string(date-time) | true | End time | | `template_ids` | query | array[string] | false | Template IDs | @@ -217,30 +229,34 @@ curl -X GET http://coder-server:8080/api/v2/insights/user-latency?start_time=201 ```json { - "report": { - "end_time": "2019-08-24T14:15:22Z", - "start_time": "2019-08-24T14:15:22Z", - "template_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "users": [ - { - "avatar_url": "http://example.com", - "latency_ms": { - "p50": 31.312, - "p95": 119.832 - }, - "template_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5", - "username": "string" - } - ] - } + "report": { + "end_time": "2019-08-24T14:15:22Z", + "start_time": "2019-08-24T14:15:22Z", + "template_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "users": [ + { + "avatar_url": "http://example.com", + "latency_ms": { + "p50": 31.312, + "p95": 119.832 + }, + "template_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5", + "username": "string" + } + ] + } } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.UserLatencyInsightsResponse](schemas.md#codersdkuserlatencyinsightsresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). diff --git a/docs/reference/api/members.md b/docs/reference/api/members.md index 6ac07aa21fd5d..1d0c7a3c3450a 100644 --- a/docs/reference/api/members.md +++ b/docs/reference/api/members.md @@ -16,7 +16,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/members ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | ------ | -------- | --------------- | +|----------------|------|--------|----------|-----------------| | `organization` | path | string | true | Organization ID | ### Example responses @@ -25,37 +25,37 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/members ```json [ - { - "avatar_url": "string", - "created_at": "2019-08-24T14:15:22Z", - "email": "string", - "global_roles": [ - { - "display_name": "string", - "name": "string", - "organization_id": "string" - } - ], - "name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "roles": [ - { - "display_name": "string", - "name": "string", - "organization_id": "string" - } - ], - "updated_at": "2019-08-24T14:15:22Z", - "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5", - "username": "string" - } + { + "avatar_url": "string", + "created_at": "2019-08-24T14:15:22Z", + "email": "string", + "global_roles": [ + { + "display_name": "string", + "name": "string", + "organization_id": "string" + } + ], + "name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "roles": [ + { + "display_name": "string", + "name": "string", + "organization_id": "string" + } + ], + "updated_at": "2019-08-24T14:15:22Z", + "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5", + "username": "string" + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ----------------------------------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-------------------------------------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.OrganizationMemberWithUserData](schemas.md#codersdkorganizationmemberwithuserdata) |

Response Schema

@@ -63,7 +63,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/members Status Code **200** | Name | Type | Required | Restrictions | Description | -| -------------------- | ----------------- | -------- | ------------ | ----------- | +|----------------------|-------------------|----------|--------------|-------------| | `[array item]` | array | false | | | | `» avatar_url` | string | false | | | | `» created_at` | string(date-time) | false | | | @@ -97,7 +97,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/members ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | ------------ | -------- | --------------- | +|----------------|------|--------------|----------|-----------------| | `organization` | path | string(uuid) | true | Organization ID | ### Example responses @@ -106,41 +106,41 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/members ```json [ - { - "assignable": true, - "built_in": true, - "display_name": "string", - "name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "organization_permissions": [ - { - "action": "application_connect", - "negate": true, - "resource_type": "*" - } - ], - "site_permissions": [ - { - "action": "application_connect", - "negate": true, - "resource_type": "*" - } - ], - "user_permissions": [ - { - "action": "application_connect", - "negate": true, - "resource_type": "*" - } - ] - } + { + "assignable": true, + "built_in": true, + "display_name": "string", + "name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "organization_permissions": [ + { + "action": "application_connect", + "negate": true, + "resource_type": "*" + } + ], + "site_permissions": [ + { + "action": "application_connect", + "negate": true, + "resource_type": "*" + } + ], + "user_permissions": [ + { + "action": "application_connect", + "negate": true, + "resource_type": "*" + } + ] + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ----------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.AssignableRoles](schemas.md#codersdkassignableroles) |

Response Schema

@@ -148,7 +148,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/members Status Code **200** | Name | Type | Required | Restrictions | Description | -| ---------------------------- | -------------------------------------------------------- | -------- | ------------ | ----------------------------------------------------------------------------------------------- | +|------------------------------|----------------------------------------------------------|----------|--------------|-------------------------------------------------------------------------------------------------| | `[array item]` | array | false | | | | `» assignable` | boolean | false | | | | `» built_in` | boolean | false | | Built in roles are immutable | @@ -165,7 +165,7 @@ Status Code **200** #### Enumerated Values | Property | Value | -| --------------- | ------------------------- | +|-----------------|---------------------------| | `action` | `application_connect` | | `action` | `assign` | | `action` | `create` | @@ -232,36 +232,36 @@ curl -X PUT http://coder-server:8080/api/v2/organizations/{organization}/members ```json { - "display_name": "string", - "name": "string", - "organization_permissions": [ - { - "action": "application_connect", - "negate": true, - "resource_type": "*" - } - ], - "site_permissions": [ - { - "action": "application_connect", - "negate": true, - "resource_type": "*" - } - ], - "user_permissions": [ - { - "action": "application_connect", - "negate": true, - "resource_type": "*" - } - ] + "display_name": "string", + "name": "string", + "organization_permissions": [ + { + "action": "application_connect", + "negate": true, + "resource_type": "*" + } + ], + "site_permissions": [ + { + "action": "application_connect", + "negate": true, + "resource_type": "*" + } + ], + "user_permissions": [ + { + "action": "application_connect", + "negate": true, + "resource_type": "*" + } + ] } ``` ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | ------------------------------------------------------------------ | -------- | ------------------- | +|----------------|------|--------------------------------------------------------------------|----------|---------------------| | `organization` | path | string(uuid) | true | Organization ID | | `body` | body | [codersdk.CustomRoleRequest](schemas.md#codersdkcustomrolerequest) | true | Upsert role request | @@ -271,39 +271,39 @@ curl -X PUT http://coder-server:8080/api/v2/organizations/{organization}/members ```json [ - { - "display_name": "string", - "name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "organization_permissions": [ - { - "action": "application_connect", - "negate": true, - "resource_type": "*" - } - ], - "site_permissions": [ - { - "action": "application_connect", - "negate": true, - "resource_type": "*" - } - ], - "user_permissions": [ - { - "action": "application_connect", - "negate": true, - "resource_type": "*" - } - ] - } + { + "display_name": "string", + "name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "organization_permissions": [ + { + "action": "application_connect", + "negate": true, + "resource_type": "*" + } + ], + "site_permissions": [ + { + "action": "application_connect", + "negate": true, + "resource_type": "*" + } + ], + "user_permissions": [ + { + "action": "application_connect", + "negate": true, + "resource_type": "*" + } + ] + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|---------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.Role](schemas.md#codersdkrole) |

Response Schema

@@ -311,7 +311,7 @@ curl -X PUT http://coder-server:8080/api/v2/organizations/{organization}/members Status Code **200** | Name | Type | Required | Restrictions | Description | -| ---------------------------- | -------------------------------------------------------- | -------- | ------------ | ----------------------------------------------------------------------------------------------- | +|------------------------------|----------------------------------------------------------|----------|--------------|-------------------------------------------------------------------------------------------------| | `[array item]` | array | false | | | | `» display_name` | string | false | | | | `» name` | string | false | | | @@ -326,7 +326,7 @@ Status Code **200** #### Enumerated Values | Property | Value | -| --------------- | ------------------------- | +|-----------------|---------------------------| | `action` | `application_connect` | | `action` | `assign` | | `action` | `create` | @@ -393,36 +393,36 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/member ```json { - "display_name": "string", - "name": "string", - "organization_permissions": [ - { - "action": "application_connect", - "negate": true, - "resource_type": "*" - } - ], - "site_permissions": [ - { - "action": "application_connect", - "negate": true, - "resource_type": "*" - } - ], - "user_permissions": [ - { - "action": "application_connect", - "negate": true, - "resource_type": "*" - } - ] + "display_name": "string", + "name": "string", + "organization_permissions": [ + { + "action": "application_connect", + "negate": true, + "resource_type": "*" + } + ], + "site_permissions": [ + { + "action": "application_connect", + "negate": true, + "resource_type": "*" + } + ], + "user_permissions": [ + { + "action": "application_connect", + "negate": true, + "resource_type": "*" + } + ] } ``` ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | ------------------------------------------------------------------ | -------- | ------------------- | +|----------------|------|--------------------------------------------------------------------|----------|---------------------| | `organization` | path | string(uuid) | true | Organization ID | | `body` | body | [codersdk.CustomRoleRequest](schemas.md#codersdkcustomrolerequest) | true | Insert role request | @@ -432,39 +432,39 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/member ```json [ - { - "display_name": "string", - "name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "organization_permissions": [ - { - "action": "application_connect", - "negate": true, - "resource_type": "*" - } - ], - "site_permissions": [ - { - "action": "application_connect", - "negate": true, - "resource_type": "*" - } - ], - "user_permissions": [ - { - "action": "application_connect", - "negate": true, - "resource_type": "*" - } - ] - } + { + "display_name": "string", + "name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "organization_permissions": [ + { + "action": "application_connect", + "negate": true, + "resource_type": "*" + } + ], + "site_permissions": [ + { + "action": "application_connect", + "negate": true, + "resource_type": "*" + } + ], + "user_permissions": [ + { + "action": "application_connect", + "negate": true, + "resource_type": "*" + } + ] + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|---------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.Role](schemas.md#codersdkrole) |

Response Schema

@@ -472,7 +472,7 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/member Status Code **200** | Name | Type | Required | Restrictions | Description | -| ---------------------------- | -------------------------------------------------------- | -------- | ------------ | ----------------------------------------------------------------------------------------------- | +|------------------------------|----------------------------------------------------------|----------|--------------|-------------------------------------------------------------------------------------------------| | `[array item]` | array | false | | | | `» display_name` | string | false | | | | `» name` | string | false | | | @@ -487,7 +487,7 @@ Status Code **200** #### Enumerated Values | Property | Value | -| --------------- | ------------------------- | +|-----------------|---------------------------| | `action` | `application_connect` | | `action` | `assign` | | `action` | `create` | @@ -552,7 +552,7 @@ curl -X DELETE http://coder-server:8080/api/v2/organizations/{organization}/memb ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | ------------ | -------- | --------------- | +|----------------|------|--------------|----------|-----------------| | `organization` | path | string(uuid) | true | Organization ID | | `roleName` | path | string | true | Role name | @@ -562,39 +562,39 @@ curl -X DELETE http://coder-server:8080/api/v2/organizations/{organization}/memb ```json [ - { - "display_name": "string", - "name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "organization_permissions": [ - { - "action": "application_connect", - "negate": true, - "resource_type": "*" - } - ], - "site_permissions": [ - { - "action": "application_connect", - "negate": true, - "resource_type": "*" - } - ], - "user_permissions": [ - { - "action": "application_connect", - "negate": true, - "resource_type": "*" - } - ] - } + { + "display_name": "string", + "name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "organization_permissions": [ + { + "action": "application_connect", + "negate": true, + "resource_type": "*" + } + ], + "site_permissions": [ + { + "action": "application_connect", + "negate": true, + "resource_type": "*" + } + ], + "user_permissions": [ + { + "action": "application_connect", + "negate": true, + "resource_type": "*" + } + ] + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|---------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.Role](schemas.md#codersdkrole) |

Response Schema

@@ -602,7 +602,7 @@ curl -X DELETE http://coder-server:8080/api/v2/organizations/{organization}/memb Status Code **200** | Name | Type | Required | Restrictions | Description | -| ---------------------------- | -------------------------------------------------------- | -------- | ------------ | ----------------------------------------------------------------------------------------------- | +|------------------------------|----------------------------------------------------------|----------|--------------|-------------------------------------------------------------------------------------------------| | `[array item]` | array | false | | | | `» display_name` | string | false | | | | `» name` | string | false | | | @@ -617,7 +617,7 @@ Status Code **200** #### Enumerated Values | Property | Value | -| --------------- | ------------------------- | +|-----------------|---------------------------| | `action` | `application_connect` | | `action` | `assign` | | `action` | `create` | @@ -682,7 +682,7 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/member ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | ------ | -------- | -------------------- | +|----------------|------|--------|----------|----------------------| | `organization` | path | string | true | Organization ID | | `user` | path | string | true | User ID, name, or me | @@ -692,24 +692,24 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/member ```json { - "created_at": "2019-08-24T14:15:22Z", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "roles": [ - { - "display_name": "string", - "name": "string", - "organization_id": "string" - } - ], - "updated_at": "2019-08-24T14:15:22Z", - "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5" + "created_at": "2019-08-24T14:15:22Z", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "roles": [ + { + "display_name": "string", + "name": "string", + "organization_id": "string" + } + ], + "updated_at": "2019-08-24T14:15:22Z", + "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.OrganizationMember](schemas.md#codersdkorganizationmember) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -729,14 +729,14 @@ curl -X DELETE http://coder-server:8080/api/v2/organizations/{organization}/memb ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | ------ | -------- | -------------------- | +|----------------|------|--------|----------|----------------------| | `organization` | path | string | true | Organization ID | | `user` | path | string | true | User ID, name, or me | ### Responses | Status | Meaning | Description | Schema | -| ------ | --------------------------------------------------------------- | ----------- | ------ | +|--------|-----------------------------------------------------------------|-------------|--------| | 204 | [No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5) | No Content | | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -759,14 +759,16 @@ curl -X PUT http://coder-server:8080/api/v2/organizations/{organization}/members ```json { - "roles": ["string"] + "roles": [ + "string" + ] } ``` ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | ------------------------------------------------------ | -------- | -------------------- | +|----------------|------|--------------------------------------------------------|----------|----------------------| | `organization` | path | string | true | Organization ID | | `user` | path | string | true | User ID, name, or me | | `body` | body | [codersdk.UpdateRoles](schemas.md#codersdkupdateroles) | true | Update roles request | @@ -777,24 +779,24 @@ curl -X PUT http://coder-server:8080/api/v2/organizations/{organization}/members ```json { - "created_at": "2019-08-24T14:15:22Z", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "roles": [ - { - "display_name": "string", - "name": "string", - "organization_id": "string" - } - ], - "updated_at": "2019-08-24T14:15:22Z", - "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5" + "created_at": "2019-08-24T14:15:22Z", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "roles": [ + { + "display_name": "string", + "name": "string", + "organization_id": "string" + } + ], + "updated_at": "2019-08-24T14:15:22Z", + "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.OrganizationMember](schemas.md#codersdkorganizationmember) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -818,41 +820,41 @@ curl -X GET http://coder-server:8080/api/v2/users/roles \ ```json [ - { - "assignable": true, - "built_in": true, - "display_name": "string", - "name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "organization_permissions": [ - { - "action": "application_connect", - "negate": true, - "resource_type": "*" - } - ], - "site_permissions": [ - { - "action": "application_connect", - "negate": true, - "resource_type": "*" - } - ], - "user_permissions": [ - { - "action": "application_connect", - "negate": true, - "resource_type": "*" - } - ] - } + { + "assignable": true, + "built_in": true, + "display_name": "string", + "name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "organization_permissions": [ + { + "action": "application_connect", + "negate": true, + "resource_type": "*" + } + ], + "site_permissions": [ + { + "action": "application_connect", + "negate": true, + "resource_type": "*" + } + ], + "user_permissions": [ + { + "action": "application_connect", + "negate": true, + "resource_type": "*" + } + ] + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ----------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.AssignableRoles](schemas.md#codersdkassignableroles) |

Response Schema

@@ -860,7 +862,7 @@ curl -X GET http://coder-server:8080/api/v2/users/roles \ Status Code **200** | Name | Type | Required | Restrictions | Description | -| ---------------------------- | -------------------------------------------------------- | -------- | ------------ | ----------------------------------------------------------------------------------------------- | +|------------------------------|----------------------------------------------------------|----------|--------------|-------------------------------------------------------------------------------------------------| | `[array item]` | array | false | | | | `» assignable` | boolean | false | | | | `» built_in` | boolean | false | | Built in roles are immutable | @@ -877,7 +879,7 @@ Status Code **200** #### Enumerated Values | Property | Value | -| --------------- | ------------------------- | +|-----------------|---------------------------| | `action` | `application_connect` | | `action` | `assign` | | `action` | `create` | diff --git a/docs/reference/api/notifications.md b/docs/reference/api/notifications.md index 21cad113adaa2..21b91182d78fa 100644 --- a/docs/reference/api/notifications.md +++ b/docs/reference/api/notifications.md @@ -19,17 +19,19 @@ curl -X GET http://coder-server:8080/api/v2/notifications/dispatch-methods \ ```json [ - { - "available": ["string"], - "default": "string" - } + { + "available": [ + "string" + ], + "default": "string" + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ----------------------------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-------------------------------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.NotificationMethodsResponse](schemas.md#codersdknotificationmethodsresponse) |

Response Schema

@@ -37,7 +39,7 @@ curl -X GET http://coder-server:8080/api/v2/notifications/dispatch-methods \ Status Code **200** | Name | Type | Required | Restrictions | Description | -| -------------- | ------ | -------- | ------------ | ----------- | +|----------------|--------|----------|--------------|-------------| | `[array item]` | array | false | | | | `» available` | array | false | | | | `» default` | string | false | | | @@ -63,14 +65,14 @@ curl -X GET http://coder-server:8080/api/v2/notifications/settings \ ```json { - "notifier_paused": true + "notifier_paused": true } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.NotificationsSettings](schemas.md#codersdknotificationssettings) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -93,14 +95,14 @@ curl -X PUT http://coder-server:8080/api/v2/notifications/settings \ ```json { - "notifier_paused": true + "notifier_paused": true } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | -------------------------------------------------------------------------- | -------- | ------------------------------ | +|--------|------|----------------------------------------------------------------------------|----------|--------------------------------| | `body` | body | [codersdk.NotificationsSettings](schemas.md#codersdknotificationssettings) | true | Notifications settings request | ### Example responses @@ -109,14 +111,14 @@ curl -X PUT http://coder-server:8080/api/v2/notifications/settings \ ```json { - "notifier_paused": true + "notifier_paused": true } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | --------------------------------------------------------------- | ------------ | -------------------------------------------------------------------------- | +|--------|-----------------------------------------------------------------|--------------|----------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.NotificationsSettings](schemas.md#codersdknotificationssettings) | | 304 | [Not Modified](https://tools.ietf.org/html/rfc7232#section-4.1) | Not Modified | | @@ -141,23 +143,23 @@ curl -X GET http://coder-server:8080/api/v2/notifications/templates/system \ ```json [ - { - "actions": "string", - "body_template": "string", - "group": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "kind": "string", - "method": "string", - "name": "string", - "title_template": "string" - } + { + "actions": "string", + "body_template": "string", + "group": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "kind": "string", + "method": "string", + "name": "string", + "title_template": "string" + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-----------------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.NotificationTemplate](schemas.md#codersdknotificationtemplate) |

Response Schema

@@ -165,7 +167,7 @@ curl -X GET http://coder-server:8080/api/v2/notifications/templates/system \ Status Code **200** | Name | Type | Required | Restrictions | Description | -| ------------------ | ------------ | -------- | ------------ | ----------- | +|--------------------|--------------|----------|--------------|-------------| | `[array item]` | array | false | | | | `» actions` | string | false | | | | `» body_template` | string | false | | | @@ -194,7 +196,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/notifications/preferenc ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | ------ | -------- | -------------------- | +|--------|------|--------|----------|----------------------| | `user` | path | string | true | User ID, name, or me | ### Example responses @@ -203,18 +205,18 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/notifications/preferenc ```json [ - { - "disabled": true, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "updated_at": "2019-08-24T14:15:22Z" - } + { + "disabled": true, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "updated_at": "2019-08-24T14:15:22Z" + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|---------------------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.NotificationPreference](schemas.md#codersdknotificationpreference) |

Response Schema

@@ -222,7 +224,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/notifications/preferenc Status Code **200** | Name | Type | Required | Restrictions | Description | -| -------------- | ----------------- | -------- | ------------ | ----------- | +|----------------|-------------------|----------|--------------|-------------| | `[array item]` | array | false | | | | `» disabled` | boolean | false | | | | `» id` | string(uuid) | false | | | @@ -248,17 +250,17 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/notifications/preferenc ```json { - "template_disabled_map": { - "property1": true, - "property2": true - } + "template_disabled_map": { + "property1": true, + "property2": true + } } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | -------------------------------------------------------------------------------------------------- | -------- | -------------------- | +|--------|------|----------------------------------------------------------------------------------------------------|----------|----------------------| | `user` | path | string | true | User ID, name, or me | | `body` | body | [codersdk.UpdateUserNotificationPreferences](schemas.md#codersdkupdateusernotificationpreferences) | true | Preferences | @@ -268,18 +270,18 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/notifications/preferenc ```json [ - { - "disabled": true, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "updated_at": "2019-08-24T14:15:22Z" - } + { + "disabled": true, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "updated_at": "2019-08-24T14:15:22Z" + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|---------------------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.NotificationPreference](schemas.md#codersdknotificationpreference) |

Response Schema

@@ -287,7 +289,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/notifications/preferenc Status Code **200** | Name | Type | Required | Restrictions | Description | -| -------------- | ----------------- | -------- | ------------ | ----------- | +|----------------|-------------------|----------|--------------|-------------| | `[array item]` | array | false | | | | `» disabled` | boolean | false | | | | `» id` | string(uuid) | false | | | diff --git a/docs/reference/api/organizations.md b/docs/reference/api/organizations.md index e398d8e7c0105..1c1e79dbca7af 100644 --- a/docs/reference/api/organizations.md +++ b/docs/reference/api/organizations.md @@ -18,14 +18,14 @@ curl -X POST http://coder-server:8080/api/v2/licenses \ ```json { - "license": "string" + "license": "string" } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | ------------------------------------------------------------------ | -------- | ------------------- | +|--------|------|--------------------------------------------------------------------|----------|---------------------| | `body` | body | [codersdk.AddLicenseRequest](schemas.md#codersdkaddlicenserequest) | true | Add license request | ### Example responses @@ -34,17 +34,17 @@ curl -X POST http://coder-server:8080/api/v2/licenses \ ```json { - "claims": {}, - "id": 0, - "uploaded_at": "2019-08-24T14:15:22Z", - "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f" + "claims": {}, + "id": 0, + "uploaded_at": "2019-08-24T14:15:22Z", + "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------------ | ----------- | ---------------------------------------------- | +|--------|--------------------------------------------------------------|-------------|------------------------------------------------| | 201 | [Created](https://tools.ietf.org/html/rfc7231#section-6.3.2) | Created | [codersdk.License](schemas.md#codersdklicense) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -68,21 +68,21 @@ curl -X POST http://coder-server:8080/api/v2/licenses/refresh-entitlements \ ```json { - "detail": "string", - "message": "string", - "validations": [ - { - "detail": "string", - "field": "string" - } - ] + "detail": "string", + "message": "string", + "validations": [ + { + "detail": "string", + "field": "string" + } + ] } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------------ | ----------- | ------------------------------------------------ | +|--------|--------------------------------------------------------------|-------------|--------------------------------------------------| | 201 | [Created](https://tools.ietf.org/html/rfc7231#section-6.3.2) | Created | [codersdk.Response](schemas.md#codersdkresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -106,23 +106,23 @@ curl -X GET http://coder-server:8080/api/v2/organizations \ ```json [ - { - "created_at": "2019-08-24T14:15:22Z", - "description": "string", - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "is_default": true, - "name": "string", - "updated_at": "2019-08-24T14:15:22Z" - } + { + "created_at": "2019-08-24T14:15:22Z", + "description": "string", + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "is_default": true, + "name": "string", + "updated_at": "2019-08-24T14:15:22Z" + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ----------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.Organization](schemas.md#codersdkorganization) |

Response Schema

@@ -130,7 +130,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations \ Status Code **200** | Name | Type | Required | Restrictions | Description | -| ---------------- | ----------------- | -------- | ------------ | ----------- | +|------------------|-------------------|----------|--------------|-------------| | `[array item]` | array | false | | | | `» created_at` | string(date-time) | true | | | | `» description` | string | false | | | @@ -161,17 +161,17 @@ curl -X POST http://coder-server:8080/api/v2/organizations \ ```json { - "description": "string", - "display_name": "string", - "icon": "string", - "name": "string" + "description": "string", + "display_name": "string", + "icon": "string", + "name": "string" } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | ---------------------------------------------------------------------------------- | -------- | --------------------------- | +|--------|------|------------------------------------------------------------------------------------|----------|-----------------------------| | `body` | body | [codersdk.CreateOrganizationRequest](schemas.md#codersdkcreateorganizationrequest) | true | Create organization request | ### Example responses @@ -180,21 +180,21 @@ curl -X POST http://coder-server:8080/api/v2/organizations \ ```json { - "created_at": "2019-08-24T14:15:22Z", - "description": "string", - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "is_default": true, - "name": "string", - "updated_at": "2019-08-24T14:15:22Z" + "created_at": "2019-08-24T14:15:22Z", + "description": "string", + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "is_default": true, + "name": "string", + "updated_at": "2019-08-24T14:15:22Z" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------------ | ----------- | -------------------------------------------------------- | +|--------|--------------------------------------------------------------|-------------|----------------------------------------------------------| | 201 | [Created](https://tools.ietf.org/html/rfc7231#section-6.3.2) | Created | [codersdk.Organization](schemas.md#codersdkorganization) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -215,7 +215,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization} \ ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | ------------ | -------- | --------------- | +|----------------|------|--------------|----------|-----------------| | `organization` | path | string(uuid) | true | Organization ID | ### Example responses @@ -224,21 +224,21 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization} \ ```json { - "created_at": "2019-08-24T14:15:22Z", - "description": "string", - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "is_default": true, - "name": "string", - "updated_at": "2019-08-24T14:15:22Z" + "created_at": "2019-08-24T14:15:22Z", + "description": "string", + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "is_default": true, + "name": "string", + "updated_at": "2019-08-24T14:15:22Z" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Organization](schemas.md#codersdkorganization) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -259,7 +259,7 @@ curl -X DELETE http://coder-server:8080/api/v2/organizations/{organization} \ ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | ------ | -------- | ----------------------- | +|----------------|------|--------|----------|-------------------------| | `organization` | path | string | true | Organization ID or name | ### Example responses @@ -268,21 +268,21 @@ curl -X DELETE http://coder-server:8080/api/v2/organizations/{organization} \ ```json { - "detail": "string", - "message": "string", - "validations": [ - { - "detail": "string", - "field": "string" - } - ] + "detail": "string", + "message": "string", + "validations": [ + { + "detail": "string", + "field": "string" + } + ] } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Response](schemas.md#codersdkresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -305,17 +305,17 @@ curl -X PATCH http://coder-server:8080/api/v2/organizations/{organization} \ ```json { - "description": "string", - "display_name": "string", - "icon": "string", - "name": "string" + "description": "string", + "display_name": "string", + "icon": "string", + "name": "string" } ``` ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | ---------------------------------------------------------------------------------- | -------- | -------------------------- | +|----------------|------|------------------------------------------------------------------------------------|----------|----------------------------| | `organization` | path | string | true | Organization ID or name | | `body` | body | [codersdk.UpdateOrganizationRequest](schemas.md#codersdkupdateorganizationrequest) | true | Patch organization request | @@ -325,21 +325,21 @@ curl -X PATCH http://coder-server:8080/api/v2/organizations/{organization} \ ```json { - "created_at": "2019-08-24T14:15:22Z", - "description": "string", - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "is_default": true, - "name": "string", - "updated_at": "2019-08-24T14:15:22Z" + "created_at": "2019-08-24T14:15:22Z", + "description": "string", + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "is_default": true, + "name": "string", + "updated_at": "2019-08-24T14:15:22Z" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Organization](schemas.md#codersdkorganization) | To perform this operation, you must be authenticated. [Learn more](authentication.md). diff --git a/docs/reference/api/portsharing.md b/docs/reference/api/portsharing.md index dbd81cd9a2988..782d6012c9f12 100644 --- a/docs/reference/api/portsharing.md +++ b/docs/reference/api/portsharing.md @@ -17,22 +17,22 @@ curl -X DELETE http://coder-server:8080/api/v2/workspaces/{workspace}/port-share ```json { - "agent_name": "string", - "port": 0 + "agent_name": "string", + "port": 0 } ``` ### Parameters | Name | In | Type | Required | Description | -| ----------- | ---- | -------------------------------------------------------------------------------------------------------- | -------- | --------------------------------- | +|-------------|------|----------------------------------------------------------------------------------------------------------|----------|-----------------------------------| | `workspace` | path | string(uuid) | true | Workspace ID | | `body` | body | [codersdk.DeleteWorkspaceAgentPortShareRequest](schemas.md#codersdkdeleteworkspaceagentportsharerequest) | true | Delete port sharing level request | ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------ | +|--------|---------------------------------------------------------|-------------|--------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -55,17 +55,17 @@ curl -X POST http://coder-server:8080/api/v2/workspaces/{workspace}/port-share \ ```json { - "agent_name": "string", - "port": 0, - "protocol": "http", - "share_level": "owner" + "agent_name": "string", + "port": 0, + "protocol": "http", + "share_level": "owner" } ``` ### Parameters | Name | In | Type | Required | Description | -| ----------- | ---- | -------------------------------------------------------------------------------------------------------- | -------- | --------------------------------- | +|-------------|------|----------------------------------------------------------------------------------------------------------|----------|-----------------------------------| | `workspace` | path | string(uuid) | true | Workspace ID | | `body` | body | [codersdk.UpsertWorkspaceAgentPortShareRequest](schemas.md#codersdkupsertworkspaceagentportsharerequest) | true | Upsert port sharing level request | @@ -75,18 +75,18 @@ curl -X POST http://coder-server:8080/api/v2/workspaces/{workspace}/port-share \ ```json { - "agent_name": "string", - "port": 0, - "protocol": "http", - "share_level": "owner", - "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9" + "agent_name": "string", + "port": 0, + "protocol": "http", + "share_level": "owner", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.WorkspaceAgentPortShare](schemas.md#codersdkworkspaceagentportshare) | To perform this operation, you must be authenticated. [Learn more](authentication.md). diff --git a/docs/reference/api/schemas.md b/docs/reference/api/schemas.md index 6b91a64d02789..b6874bc5b1bc9 100644 --- a/docs/reference/api/schemas.md +++ b/docs/reference/api/schemas.md @@ -4,15 +4,15 @@ ```json { - "document": "string", - "signature": "string" + "document": "string", + "signature": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ----------- | ------ | -------- | ------------ | ----------- | +|-------------|--------|----------|--------------|-------------| | `document` | string | true | | | | `signature` | string | true | | | @@ -20,29 +20,29 @@ ```json { - "session_token": "string" + "session_token": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| --------------- | ------ | -------- | ------------ | ----------- | +|-----------------|--------|----------|--------------|-------------| | `session_token` | string | false | | | ## agentsdk.AzureInstanceIdentityToken ```json { - "encoding": "string", - "signature": "string" + "encoding": "string", + "signature": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ----------- | ------ | -------- | ------------ | ----------- | +|-------------|--------|----------|--------------|-------------| | `encoding` | string | true | | | | `signature` | string | true | | | @@ -50,19 +50,19 @@ ```json { - "access_token": "string", - "password": "string", - "token_extra": {}, - "type": "string", - "url": "string", - "username": "string" + "access_token": "string", + "password": "string", + "token_extra": {}, + "type": "string", + "url": "string", + "username": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------- | ------ | -------- | ------------ | ---------------------------------------------------------------------------------------- | +|----------------|--------|----------|--------------|------------------------------------------------------------------------------------------| | `access_token` | string | false | | | | `password` | string | false | | | | `token_extra` | object | false | | | @@ -74,15 +74,15 @@ ```json { - "private_key": "string", - "public_key": "string" + "private_key": "string", + "public_key": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------- | ------ | -------- | ------------ | ----------- | +|---------------|--------|----------|--------------|-------------| | `private_key` | string | false | | | | `public_key` | string | false | | | @@ -90,30 +90,30 @@ ```json { - "json_web_token": "string" + "json_web_token": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------------- | ------ | -------- | ------------ | ----------- | +|------------------|--------|----------|--------------|-------------| | `json_web_token` | string | true | | | ## agentsdk.Log ```json { - "created_at": "string", - "level": "trace", - "output": "string" + "created_at": "string", + "level": "trace", + "output": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------ | -------------------------------------- | -------- | ------------ | ----------- | +|--------------|----------------------------------------|----------|--------------|-------------| | `created_at` | string | false | | | | `level` | [codersdk.LogLevel](#codersdkloglevel) | false | | | | `output` | string | false | | | @@ -122,21 +122,21 @@ ```json { - "log_source_id": "string", - "logs": [ - { - "created_at": "string", - "level": "trace", - "output": "string" - } - ] + "log_source_id": "string", + "logs": [ + { + "created_at": "string", + "level": "trace", + "output": "string" + } + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| --------------- | ------------------------------------- | -------- | ------------ | ----------- | +|-----------------|---------------------------------------|----------|--------------|-------------| | `log_source_id` | string | false | | | | `logs` | array of [agentsdk.Log](#agentsdklog) | false | | | @@ -144,16 +144,16 @@ ```json { - "display_name": "string", - "icon": "string", - "id": "string" + "display_name": "string", + "icon": "string", + "id": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------- | ------ | -------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|----------------|--------|----------|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `display_name` | string | false | | | | `icon` | string | false | | | | `id` | string | false | | ID is a unique identifier for the log source. It is scoped to a workspace agent, and can be statically defined inside code to prevent duplicate sources from being created for the same agent. | @@ -162,33 +162,37 @@ ```json { - "active": true, - "emails": [ - { - "display": "string", - "primary": true, - "type": "string", - "value": "user@example.com" - } - ], - "groups": [null], - "id": "string", - "meta": { - "resourceType": "string" - }, - "name": { - "familyName": "string", - "givenName": "string" - }, - "schemas": ["string"], - "userName": "string" + "active": true, + "emails": [ + { + "display": "string", + "primary": true, + "type": "string", + "value": "user@example.com" + } + ], + "groups": [ + null + ], + "id": "string", + "meta": { + "resourceType": "string" + }, + "name": { + "familyName": "string", + "givenName": "string" + }, + "schemas": [ + "string" + ], + "userName": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------------- | ------------------ | -------- | ------------ | --------------------------------------------------------------------------- | +|------------------|--------------------|----------|--------------|-----------------------------------------------------------------------------| | `active` | boolean | false | | Active is a ptr to prevent the empty value from being interpreted as false. | | `emails` | array of object | false | | | | `» display` | string | false | | | @@ -209,71 +213,71 @@ ```json { - "csp-report": {} + "csp-report": {} } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------ | ------ | -------- | ------------ | ----------- | +|--------------|--------|----------|--------------|-------------| | `csp-report` | object | false | | | ## codersdk.ACLAvailable ```json { - "groups": [ - { - "avatar_url": "string", - "display_name": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "members": [ - { - "avatar_url": "http://example.com", - "created_at": "2019-08-24T14:15:22Z", - "email": "user@example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_seen_at": "2019-08-24T14:15:22Z", - "login_type": "", - "name": "string", - "status": "active", - "theme_preference": "string", - "updated_at": "2019-08-24T14:15:22Z", - "username": "string" - } - ], - "name": "string", - "organization_display_name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "organization_name": "string", - "quota_allowance": 0, - "source": "user", - "total_member_count": 0 - } - ], - "users": [ - { - "avatar_url": "http://example.com", - "created_at": "2019-08-24T14:15:22Z", - "email": "user@example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_seen_at": "2019-08-24T14:15:22Z", - "login_type": "", - "name": "string", - "status": "active", - "theme_preference": "string", - "updated_at": "2019-08-24T14:15:22Z", - "username": "string" - } - ] + "groups": [ + { + "avatar_url": "string", + "display_name": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "members": [ + { + "avatar_url": "http://example.com", + "created_at": "2019-08-24T14:15:22Z", + "email": "user@example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_seen_at": "2019-08-24T14:15:22Z", + "login_type": "", + "name": "string", + "status": "active", + "theme_preference": "string", + "updated_at": "2019-08-24T14:15:22Z", + "username": "string" + } + ], + "name": "string", + "organization_display_name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "organization_name": "string", + "quota_allowance": 0, + "source": "user", + "total_member_count": 0 + } + ], + "users": [ + { + "avatar_url": "http://example.com", + "created_at": "2019-08-24T14:15:22Z", + "email": "user@example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_seen_at": "2019-08-24T14:15:22Z", + "login_type": "", + "name": "string", + "status": "active", + "theme_preference": "string", + "updated_at": "2019-08-24T14:15:22Z", + "username": "string" + } + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------- | ----------------------------------------------------- | -------- | ------------ | ----------- | +|----------|-------------------------------------------------------|----------|--------------|-------------| | `groups` | array of [codersdk.Group](#codersdkgroup) | false | | | | `users` | array of [codersdk.ReducedUser](#codersdkreduceduser) | false | | | @@ -281,23 +285,23 @@ ```json { - "created_at": "2019-08-24T14:15:22Z", - "expires_at": "2019-08-24T14:15:22Z", - "id": "string", - "last_used": "2019-08-24T14:15:22Z", - "lifetime_seconds": 0, - "login_type": "password", - "scope": "all", - "token_name": "string", - "updated_at": "2019-08-24T14:15:22Z", - "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5" + "created_at": "2019-08-24T14:15:22Z", + "expires_at": "2019-08-24T14:15:22Z", + "id": "string", + "last_used": "2019-08-24T14:15:22Z", + "lifetime_seconds": 0, + "login_type": "password", + "scope": "all", + "token_name": "string", + "updated_at": "2019-08-24T14:15:22Z", + "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------ | -------------------------------------------- | -------- | ------------ | ----------- | +|--------------------|----------------------------------------------|----------|--------------|-------------| | `created_at` | string | true | | | | `expires_at` | string | true | | | | `id` | string | true | | | @@ -312,7 +316,7 @@ #### Enumerated Values | Property | Value | -| ------------ | --------------------- | +|--------------|-----------------------| | `login_type` | `password` | | `login_type` | `github` | | `login_type` | `oidc` | @@ -331,7 +335,7 @@ #### Enumerated Values | Value | -| --------------------- | +|-----------------------| | `all` | | `application_connect` | @@ -339,32 +343,32 @@ ```json { - "license": "string" + "license": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| --------- | ------ | -------- | ------------ | ----------- | +|-----------|--------|----------|--------------|-------------| | `license` | string | true | | | ## codersdk.AgentConnectionTiming ```json { - "ended_at": "2019-08-24T14:15:22Z", - "stage": "init", - "started_at": "2019-08-24T14:15:22Z", - "workspace_agent_id": "string", - "workspace_agent_name": "string" + "ended_at": "2019-08-24T14:15:22Z", + "stage": "init", + "started_at": "2019-08-24T14:15:22Z", + "workspace_agent_id": "string", + "workspace_agent_name": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------------------- | -------------------------------------------- | -------- | ------------ | ----------- | +|------------------------|----------------------------------------------|----------|--------------|-------------| | `ended_at` | string | false | | | | `stage` | [codersdk.TimingStage](#codersdktimingstage) | false | | | | `started_at` | string | false | | | @@ -375,21 +379,21 @@ ```json { - "display_name": "string", - "ended_at": "2019-08-24T14:15:22Z", - "exit_code": 0, - "stage": "init", - "started_at": "2019-08-24T14:15:22Z", - "status": "string", - "workspace_agent_id": "string", - "workspace_agent_name": "string" + "display_name": "string", + "ended_at": "2019-08-24T14:15:22Z", + "exit_code": 0, + "stage": "init", + "started_at": "2019-08-24T14:15:22Z", + "status": "string", + "workspace_agent_id": "string", + "workspace_agent_name": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------------------- | -------------------------------------------- | -------- | ------------ | ----------- | +|------------------------|----------------------------------------------|----------|--------------|-------------| | `display_name` | string | false | | | | `ended_at` | string | false | | | | `exit_code` | integer | false | | | @@ -410,7 +414,7 @@ #### Enumerated Values | Value | -| ------------ | +|--------------| | `envbox` | | `envbuilder` | | `exectrace` | @@ -419,49 +423,49 @@ ```json { - "host": "string" + "host": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------ | ------ | -------- | ------------ | ------------------------------------------------------------- | +|--------|--------|----------|--------------|---------------------------------------------------------------| | `host` | string | false | | Host is the externally accessible URL for the Coder instance. | ## codersdk.AppearanceConfig ```json { - "announcement_banners": [ - { - "background_color": "string", - "enabled": true, - "message": "string" - } - ], - "application_name": "string", - "docs_url": "string", - "logo_url": "string", - "service_banner": { - "background_color": "string", - "enabled": true, - "message": "string" - }, - "support_links": [ - { - "icon": "bug", - "name": "string", - "target": "string" - } - ] + "announcement_banners": [ + { + "background_color": "string", + "enabled": true, + "message": "string" + } + ], + "application_name": "string", + "docs_url": "string", + "logo_url": "string", + "service_banner": { + "background_color": "string", + "enabled": true, + "message": "string" + }, + "support_links": [ + { + "icon": "bug", + "name": "string", + "target": "string" + } + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------------------- | ------------------------------------------------------- | -------- | ------------ | ------------------------------------------------------------------- | +|------------------------|---------------------------------------------------------|----------|--------------|---------------------------------------------------------------------| | `announcement_banners` | array of [codersdk.BannerConfig](#codersdkbannerconfig) | false | | | | `application_name` | string | false | | | | `docs_url` | string | false | | | @@ -473,53 +477,53 @@ ```json { - "all": true + "all": true } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ----- | ------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------ | +|-------|---------|----------|--------------|--------------------------------------------------------------------------------------------------------------------------| | `all` | boolean | false | | By default, only failed versions are archived. Set this to true to archive all unused versions regardless of job status. | ## codersdk.AssignableRoles ```json { - "assignable": true, - "built_in": true, - "display_name": "string", - "name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "organization_permissions": [ - { - "action": "application_connect", - "negate": true, - "resource_type": "*" - } - ], - "site_permissions": [ - { - "action": "application_connect", - "negate": true, - "resource_type": "*" - } - ], - "user_permissions": [ - { - "action": "application_connect", - "negate": true, - "resource_type": "*" - } - ] + "assignable": true, + "built_in": true, + "display_name": "string", + "name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "organization_permissions": [ + { + "action": "application_connect", + "negate": true, + "resource_type": "*" + } + ], + "site_permissions": [ + { + "action": "application_connect", + "negate": true, + "resource_type": "*" + } + ], + "user_permissions": [ + { + "action": "application_connect", + "negate": true, + "resource_type": "*" + } + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------------------- | --------------------------------------------------- | -------- | ------------ | ----------------------------------------------------------------------------------------------- | +|----------------------------|-----------------------------------------------------|----------|--------------|-------------------------------------------------------------------------------------------------| | `assignable` | boolean | false | | | | `built_in` | boolean | false | | Built in roles are immutable | | `display_name` | string | false | | | @@ -540,7 +544,7 @@ #### Enumerated Values | Value | -| ------------------------ | +|--------------------------| | `create` | | `write` | | `delete` | @@ -555,39 +559,39 @@ ```json { - "property1": { - "new": null, - "old": null, - "secret": true - }, - "property2": { - "new": null, - "old": null, - "secret": true - } + "property1": { + "new": null, + "old": null, + "secret": true + }, + "property2": { + "new": null, + "old": null, + "secret": true + } } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------------- | -------------------------------------------------- | -------- | ------------ | ----------- | +|------------------|----------------------------------------------------|----------|--------------|-------------| | `[any property]` | [codersdk.AuditDiffField](#codersdkauditdifffield) | false | | | ## codersdk.AuditDiffField ```json { - "new": null, - "old": null, - "secret": true + "new": null, + "old": null, + "secret": true } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------- | ------- | -------- | ------------ | ----------- | +|----------|---------|----------|--------------|-------------| | `new` | any | false | | | | `old` | any | false | | | | `secret` | boolean | false | | | @@ -596,68 +600,72 @@ ```json { - "action": "create", - "additional_fields": [0], - "description": "string", - "diff": { - "property1": { - "new": null, - "old": null, - "secret": true - }, - "property2": { - "new": null, - "old": null, - "secret": true - } - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "ip": "string", - "is_deleted": true, - "organization": { - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "name": "string" - }, - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "request_id": "266ea41d-adf5-480b-af50-15b940c2b846", - "resource_icon": "string", - "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", - "resource_link": "string", - "resource_target": "string", - "resource_type": "template", - "status_code": 0, - "time": "2019-08-24T14:15:22Z", - "user": { - "avatar_url": "http://example.com", - "created_at": "2019-08-24T14:15:22Z", - "email": "user@example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_seen_at": "2019-08-24T14:15:22Z", - "login_type": "", - "name": "string", - "organization_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "roles": [ - { - "display_name": "string", - "name": "string", - "organization_id": "string" - } - ], - "status": "active", - "theme_preference": "string", - "updated_at": "2019-08-24T14:15:22Z", - "username": "string" - }, - "user_agent": "string" + "action": "create", + "additional_fields": [ + 0 + ], + "description": "string", + "diff": { + "property1": { + "new": null, + "old": null, + "secret": true + }, + "property2": { + "new": null, + "old": null, + "secret": true + } + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "ip": "string", + "is_deleted": true, + "organization": { + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "name": "string" + }, + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "request_id": "266ea41d-adf5-480b-af50-15b940c2b846", + "resource_icon": "string", + "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", + "resource_link": "string", + "resource_target": "string", + "resource_type": "template", + "status_code": 0, + "time": "2019-08-24T14:15:22Z", + "user": { + "avatar_url": "http://example.com", + "created_at": "2019-08-24T14:15:22Z", + "email": "user@example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_seen_at": "2019-08-24T14:15:22Z", + "login_type": "", + "name": "string", + "organization_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "roles": [ + { + "display_name": "string", + "name": "string", + "organization_id": "string" + } + ], + "status": "active", + "theme_preference": "string", + "updated_at": "2019-08-24T14:15:22Z", + "username": "string" + }, + "user_agent": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------- | ------------------------------------------------------------ | -------- | ------------ | -------------------------------------------- | +|---------------------|--------------------------------------------------------------|----------|--------------|----------------------------------------------| | `action` | [codersdk.AuditAction](#codersdkauditaction) | false | | | | `additional_fields` | array of integer | false | | | | `description` | string | false | | | @@ -682,73 +690,77 @@ ```json { - "audit_logs": [ - { - "action": "create", - "additional_fields": [0], - "description": "string", - "diff": { - "property1": { - "new": null, - "old": null, - "secret": true - }, - "property2": { - "new": null, - "old": null, - "secret": true - } - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "ip": "string", - "is_deleted": true, - "organization": { - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "name": "string" - }, - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "request_id": "266ea41d-adf5-480b-af50-15b940c2b846", - "resource_icon": "string", - "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", - "resource_link": "string", - "resource_target": "string", - "resource_type": "template", - "status_code": 0, - "time": "2019-08-24T14:15:22Z", - "user": { - "avatar_url": "http://example.com", - "created_at": "2019-08-24T14:15:22Z", - "email": "user@example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_seen_at": "2019-08-24T14:15:22Z", - "login_type": "", - "name": "string", - "organization_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "roles": [ - { - "display_name": "string", - "name": "string", - "organization_id": "string" - } - ], - "status": "active", - "theme_preference": "string", - "updated_at": "2019-08-24T14:15:22Z", - "username": "string" - }, - "user_agent": "string" - } - ], - "count": 0 + "audit_logs": [ + { + "action": "create", + "additional_fields": [ + 0 + ], + "description": "string", + "diff": { + "property1": { + "new": null, + "old": null, + "secret": true + }, + "property2": { + "new": null, + "old": null, + "secret": true + } + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "ip": "string", + "is_deleted": true, + "organization": { + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "name": "string" + }, + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "request_id": "266ea41d-adf5-480b-af50-15b940c2b846", + "resource_icon": "string", + "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", + "resource_link": "string", + "resource_target": "string", + "resource_type": "template", + "status_code": 0, + "time": "2019-08-24T14:15:22Z", + "user": { + "avatar_url": "http://example.com", + "created_at": "2019-08-24T14:15:22Z", + "email": "user@example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_seen_at": "2019-08-24T14:15:22Z", + "login_type": "", + "name": "string", + "organization_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "roles": [ + { + "display_name": "string", + "name": "string", + "organization_id": "string" + } + ], + "status": "active", + "theme_preference": "string", + "updated_at": "2019-08-24T14:15:22Z", + "username": "string" + }, + "user_agent": "string" + } + ], + "count": 0 } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------ | ----------------------------------------------- | -------- | ------------ | ----------- | +|--------------|-------------------------------------------------|----------|--------------|-------------| | `audit_logs` | array of [codersdk.AuditLog](#codersdkauditlog) | false | | | | `count` | integer | false | | | @@ -756,39 +768,39 @@ ```json { - "enabled": true + "enabled": true } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| --------- | ------- | -------- | ------------ | ----------- | +|-----------|---------|----------|--------------|-------------| | `enabled` | boolean | false | | | ## codersdk.AuthMethods ```json { - "github": { - "enabled": true - }, - "oidc": { - "enabled": true, - "iconUrl": "string", - "signInText": "string" - }, - "password": { - "enabled": true - }, - "terms_of_service_url": "string" + "github": { + "enabled": true + }, + "oidc": { + "enabled": true, + "iconUrl": "string", + "signInText": "string" + }, + "password": { + "enabled": true + }, + "terms_of_service_url": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------------------- | -------------------------------------------------- | -------- | ------------ | ----------- | +|------------------------|----------------------------------------------------|----------|--------------|-------------| | `github` | [codersdk.AuthMethod](#codersdkauthmethod) | false | | | | `oidc` | [codersdk.OIDCAuthMethod](#codersdkoidcauthmethod) | false | | | | `password` | [codersdk.AuthMethod](#codersdkauthmethod) | false | | | @@ -798,14 +810,14 @@ ```json { - "action": "create", - "object": { - "any_org": true, - "organization_id": "string", - "owner_id": "string", - "resource_id": "string", - "resource_type": "*" - } + "action": "create", + "object": { + "any_org": true, + "organization_id": "string", + "owner_id": "string", + "resource_id": "string", + "resource_type": "*" + } } ``` @@ -814,14 +826,14 @@ AuthorizationCheck is used to check if the currently authenticated user (or the ### Properties | Name | Type | Required | Restrictions | Description | -| -------- | ------------------------------------------------------------ | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|----------|--------------------------------------------------------------|----------|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `action` | [codersdk.RBACAction](#codersdkrbacaction) | false | | | | `object` | [codersdk.AuthorizationObject](#codersdkauthorizationobject) | false | | Object can represent a "set" of objects, such as: all workspaces in an organization, all workspaces owned by me, and all workspaces across the entire product. When defining an object, use the most specific language when possible to produce the smallest set. Meaning to set as many fields on 'Object' as you can. Example, if you want to check if you can update all workspaces owned by 'me', try to also add an 'OrganizationID' to the settings. Omitting the 'OrganizationID' could produce the incorrect value, as workspaces have both `user` and `organization` owners. | #### Enumerated Values | Property | Value | -| -------- | -------- | +|----------|----------| | `action` | `create` | | `action` | `read` | | `action` | `update` | @@ -831,11 +843,11 @@ AuthorizationCheck is used to check if the currently authenticated user (or the ```json { - "any_org": true, - "organization_id": "string", - "owner_id": "string", - "resource_id": "string", - "resource_type": "*" + "any_org": true, + "organization_id": "string", + "owner_id": "string", + "resource_id": "string", + "resource_type": "*" } ``` @@ -844,7 +856,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in ### Properties | Name | Type | Required | Restrictions | Description | -| ----------------- | ---------------------------------------------- | -------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|-------------------|------------------------------------------------|----------|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `any_org` | boolean | false | | Any org (optional) will disregard the org_owner when checking for permissions. This cannot be set to true if the OrganizationID is set. | | `organization_id` | string | false | | Organization ID (optional) adds the set constraint to all resources owned by a given organization. | | `owner_id` | string | false | | Owner ID (optional) adds the set constraint to all resources owned by a given user. | @@ -855,35 +867,35 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in ```json { - "checks": { - "property1": { - "action": "create", - "object": { - "any_org": true, - "organization_id": "string", - "owner_id": "string", - "resource_id": "string", - "resource_type": "*" - } - }, - "property2": { - "action": "create", - "object": { - "any_org": true, - "organization_id": "string", - "owner_id": "string", - "resource_id": "string", - "resource_type": "*" - } - } - } + "checks": { + "property1": { + "action": "create", + "object": { + "any_org": true, + "organization_id": "string", + "owner_id": "string", + "resource_id": "string", + "resource_type": "*" + } + }, + "property2": { + "action": "create", + "object": { + "any_org": true, + "organization_id": "string", + "owner_id": "string", + "resource_id": "string", + "resource_type": "*" + } + } + } } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------ | ---------------------------------------------------------- | -------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|--------------------|------------------------------------------------------------|----------|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `checks` | object | false | | Checks is a map keyed with an arbitrary string to a permission check. The key can be any string that is helpful to the caller, and allows multiple permission checks to be run in a single request. The key ensures that each permission check has the same key in the response. | | » `[any property]` | [codersdk.AuthorizationCheck](#codersdkauthorizationcheck) | false | | It is used to check if the currently authenticated user (or the specified user) can do a given action to a given set of objects. | @@ -891,15 +903,15 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in ```json { - "property1": true, - "property2": true + "property1": true, + "property2": true } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------------- | ------- | -------- | ------------ | ----------- | +|------------------|---------|----------|--------------|-------------| | `[any property]` | boolean | false | | | ## codersdk.AutomaticUpdates @@ -913,7 +925,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in #### Enumerated Values | Value | -| -------- | +|----------| | `always` | | `never` | @@ -921,16 +933,16 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in ```json { - "background_color": "string", - "enabled": true, - "message": "string" + "background_color": "string", + "enabled": true, + "message": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------ | ------- | -------- | ------------ | ----------- | +|--------------------|---------|----------|--------------|-------------| | `background_color` | string | false | | | | `enabled` | boolean | false | | | | `message` | string | false | | | @@ -939,22 +951,22 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in ```json { - "agent_api_version": "string", - "dashboard_url": "string", - "deployment_id": "string", - "external_url": "string", - "provisioner_api_version": "string", - "telemetry": true, - "upgrade_message": "string", - "version": "string", - "workspace_proxy": true + "agent_api_version": "string", + "dashboard_url": "string", + "deployment_id": "string", + "external_url": "string", + "provisioner_api_version": "string", + "telemetry": true, + "upgrade_message": "string", + "version": "string", + "workspace_proxy": true } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------------- | ------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|---------------------------|---------|----------|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `agent_api_version` | string | false | | Agent api version is the current version of the Agent API (back versions MAY still be supported). | | `dashboard_url` | string | false | | Dashboard URL is the URL to hit the deployment's dashboard. For external workspace proxies, this is the coderd they are connected to. | | `deployment_id` | string | false | | Deployment ID is the unique identifier for this deployment. | @@ -976,7 +988,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in #### Enumerated Values | Value | -| ----------- | +|-------------| | `initiator` | | `autostart` | | `autostop` | @@ -985,16 +997,16 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in ```json { - "email": "user@example.com", - "one_time_passcode": "string", - "password": "string" + "email": "user@example.com", + "one_time_passcode": "string", + "password": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------- | ------ | -------- | ------------ | ----------- | +|---------------------|--------|----------|--------------|-------------| | `email` | string | true | | | | `one_time_passcode` | string | true | | | | `password` | string | true | | | @@ -1003,15 +1015,15 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in ```json { - "p50": 31.312, - "p95": 119.832 + "p50": 31.312, + "p95": 119.832 } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ----- | ------ | -------- | ------------ | ----------- | +|-------|--------|----------|--------------|-------------| | `p50` | number | false | | | | `p95` | number | false | | | @@ -1019,15 +1031,15 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in ```json { - "password": "string", - "to_type": "" + "password": "string", + "to_type": "" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------- | ---------------------------------------- | -------- | ------------ | ---------------------------------------- | +|------------|------------------------------------------|----------|--------------|------------------------------------------| | `password` | string | true | | | | `to_type` | [codersdk.LoginType](#codersdklogintype) | true | | To type is the login type to convert to. | @@ -1035,27 +1047,27 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in ```json { - "email": "string", - "name": "string", - "password": "string", - "trial": true, - "trial_info": { - "company_name": "string", - "country": "string", - "developers": "string", - "first_name": "string", - "job_title": "string", - "last_name": "string", - "phone_number": "string" - }, - "username": "string" + "email": "string", + "name": "string", + "password": "string", + "trial": true, + "trial_info": { + "company_name": "string", + "country": "string", + "developers": "string", + "first_name": "string", + "job_title": "string", + "last_name": "string", + "phone_number": "string" + }, + "username": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------ | ---------------------------------------------------------------------- | -------- | ------------ | ----------- | +|--------------|------------------------------------------------------------------------|----------|--------------|-------------| | `email` | string | true | | | | `name` | string | false | | | | `password` | string | true | | | @@ -1067,15 +1079,15 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in ```json { - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5" + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ----------------- | ------ | -------- | ------------ | ----------- | +|-------------------|--------|----------|--------------|-------------| | `organization_id` | string | false | | | | `user_id` | string | false | | | @@ -1083,20 +1095,20 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in ```json { - "company_name": "string", - "country": "string", - "developers": "string", - "first_name": "string", - "job_title": "string", - "last_name": "string", - "phone_number": "string" + "company_name": "string", + "country": "string", + "developers": "string", + "first_name": "string", + "job_title": "string", + "last_name": "string", + "phone_number": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------- | ------ | -------- | ------------ | ----------- | +|----------------|--------|----------|--------------|-------------| | `company_name` | string | false | | | | `country` | string | false | | | | `developers` | string | false | | | @@ -1109,17 +1121,17 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in ```json { - "avatar_url": "string", - "display_name": "string", - "name": "string", - "quota_allowance": 0 + "avatar_url": "string", + "display_name": "string", + "name": "string", + "quota_allowance": 0 } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ----------------- | ------- | -------- | ------------ | ----------- | +|-------------------|---------|----------|--------------|-------------| | `avatar_url` | string | false | | | | `display_name` | string | false | | | | `name` | string | true | | | @@ -1129,17 +1141,17 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in ```json { - "description": "string", - "display_name": "string", - "icon": "string", - "name": "string" + "description": "string", + "display_name": "string", + "icon": "string", + "name": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------- | ------ | -------- | ------------ | ---------------------------------------------------------------------- | +|----------------|--------|----------|--------------|------------------------------------------------------------------------| | `description` | string | false | | | | `display_name` | string | false | | Display name will default to the same value as `Name` if not provided. | | `icon` | string | false | | | @@ -1149,94 +1161,98 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in ```json { - "key": "string" + "key": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ----- | ------ | -------- | ------------ | ----------- | +|-------|--------|----------|--------------|-------------| | `key` | string | false | | | ## codersdk.CreateTemplateRequest ```json { - "activity_bump_ms": 0, - "allow_user_autostart": true, - "allow_user_autostop": true, - "allow_user_cancel_workspace_jobs": true, - "autostart_requirement": { - "days_of_week": ["monday"] - }, - "autostop_requirement": { - "days_of_week": ["monday"], - "weeks": 0 - }, - "default_ttl_ms": 0, - "delete_ttl_ms": 0, - "description": "string", - "disable_everyone_group_access": true, - "display_name": "string", - "dormant_ttl_ms": 0, - "failure_ttl_ms": 0, - "icon": "string", - "max_port_share_level": "owner", - "name": "string", - "require_active_version": true, - "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1" -} -``` - -### Properties - -| Name | Type | Required | Restrictions | Description | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `activity_bump_ms` | integer | false | | Activity bump ms allows optionally specifying the activity bump duration for all workspaces created from this template. Defaults to 1h but can be set to 0 to disable activity bumping. | -| `allow_user_autostart` | boolean | false | | Allow user autostart allows users to set a schedule for autostarting their workspace. By default this is true. This can only be disabled when using an enterprise license. | -| `allow_user_autostop` | boolean | false | | Allow user autostop allows users to set a custom workspace TTL to use in place of the template's DefaultTTL field. By default this is true. If false, the DefaultTTL will always be used. This can only be disabled when using an enterprise license. | -| `allow_user_cancel_workspace_jobs` | boolean | false | | Allow users to cancel in-progress workspace jobs. \*bool as the default value is "true". | -| `autostart_requirement` | [codersdk.TemplateAutostartRequirement](#codersdktemplateautostartrequirement) | false | | Autostart requirement allows optionally specifying the autostart allowed days for workspaces created from this template. This is an enterprise feature. | -| `autostop_requirement` | [codersdk.TemplateAutostopRequirement](#codersdktemplateautostoprequirement) | false | | Autostop requirement allows optionally specifying the autostop requirement for workspaces created from this template. This is an enterprise feature. | -| `default_ttl_ms` | integer | false | | Default ttl ms allows optionally specifying the default TTL for all workspaces created from this template. | -| `delete_ttl_ms` | integer | false | | Delete ttl ms allows optionally specifying the max lifetime before Coder permanently deletes dormant workspaces created from this template. | -| `description` | string | false | | Description is a description of what the template contains. It must be less than 128 bytes. | -| `disable_everyone_group_access` | boolean | false | | Disable everyone group access allows optionally disabling the default behavior of granting the 'everyone' group access to use the template. If this is set to true, the template will not be available to all users, and must be explicitly granted to users or groups in the permissions settings of the template. | -| `display_name` | string | false | | Display name is the displayed name of the template. | -| `dormant_ttl_ms` | integer | false | | Dormant ttl ms allows optionally specifying the max lifetime before Coder locks inactive workspaces created from this template. | -| `failure_ttl_ms` | integer | false | | Failure ttl ms allows optionally specifying the max lifetime before Coder stops all resources for failed workspaces created from this template. | -| `icon` | string | false | | Icon is a relative path or external URL that specifies an icon to be displayed in the dashboard. | -| `max_port_share_level` | [codersdk.WorkspaceAgentPortShareLevel](#codersdkworkspaceagentportsharelevel) | false | | Max port share level allows optionally specifying the maximum port share level for workspaces created from the template. | -| `name` | string | true | | Name is the name of the template. | -| `require_active_version` | boolean | false | | Require active version mandates that workspaces are built with the active template version. | -| `template_version_id` | string | true | | Template version ID is an in-progress or completed job to use as an initial version of the template. | -| This is required on creation to enable a user-flow of validating a template works. There is no reason the data-model cannot support empty templates, but it doesn't make sense for users. | + "activity_bump_ms": 0, + "allow_user_autostart": true, + "allow_user_autostop": true, + "allow_user_cancel_workspace_jobs": true, + "autostart_requirement": { + "days_of_week": [ + "monday" + ] + }, + "autostop_requirement": { + "days_of_week": [ + "monday" + ], + "weeks": 0 + }, + "default_ttl_ms": 0, + "delete_ttl_ms": 0, + "description": "string", + "disable_everyone_group_access": true, + "display_name": "string", + "dormant_ttl_ms": 0, + "failure_ttl_ms": 0, + "icon": "string", + "max_port_share_level": "owner", + "name": "string", + "require_active_version": true, + "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1" +} +``` + +### Properties + +| Name | Type | Required | Restrictions | Description | +|------------------------------------|--------------------------------------------------------------------------------|----------|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `activity_bump_ms` | integer | false | | Activity bump ms allows optionally specifying the activity bump duration for all workspaces created from this template. Defaults to 1h but can be set to 0 to disable activity bumping. | +| `allow_user_autostart` | boolean | false | | Allow user autostart allows users to set a schedule for autostarting their workspace. By default this is true. This can only be disabled when using an enterprise license. | +| `allow_user_autostop` | boolean | false | | Allow user autostop allows users to set a custom workspace TTL to use in place of the template's DefaultTTL field. By default this is true. If false, the DefaultTTL will always be used. This can only be disabled when using an enterprise license. | +| `allow_user_cancel_workspace_jobs` | boolean | false | | Allow users to cancel in-progress workspace jobs. *bool as the default value is "true". | +| `autostart_requirement` | [codersdk.TemplateAutostartRequirement](#codersdktemplateautostartrequirement) | false | | Autostart requirement allows optionally specifying the autostart allowed days for workspaces created from this template. This is an enterprise feature. | +| `autostop_requirement` | [codersdk.TemplateAutostopRequirement](#codersdktemplateautostoprequirement) | false | | Autostop requirement allows optionally specifying the autostop requirement for workspaces created from this template. This is an enterprise feature. | +| `default_ttl_ms` | integer | false | | Default ttl ms allows optionally specifying the default TTL for all workspaces created from this template. | +| `delete_ttl_ms` | integer | false | | Delete ttl ms allows optionally specifying the max lifetime before Coder permanently deletes dormant workspaces created from this template. | +| `description` | string | false | | Description is a description of what the template contains. It must be less than 128 bytes. | +| `disable_everyone_group_access` | boolean | false | | Disable everyone group access allows optionally disabling the default behavior of granting the 'everyone' group access to use the template. If this is set to true, the template will not be available to all users, and must be explicitly granted to users or groups in the permissions settings of the template. | +| `display_name` | string | false | | Display name is the displayed name of the template. | +| `dormant_ttl_ms` | integer | false | | Dormant ttl ms allows optionally specifying the max lifetime before Coder locks inactive workspaces created from this template. | +| `failure_ttl_ms` | integer | false | | Failure ttl ms allows optionally specifying the max lifetime before Coder stops all resources for failed workspaces created from this template. | +| `icon` | string | false | | Icon is a relative path or external URL that specifies an icon to be displayed in the dashboard. | +| `max_port_share_level` | [codersdk.WorkspaceAgentPortShareLevel](#codersdkworkspaceagentportsharelevel) | false | | Max port share level allows optionally specifying the maximum port share level for workspaces created from the template. | +| `name` | string | true | | Name is the name of the template. | +| `require_active_version` | boolean | false | | Require active version mandates that workspaces are built with the active template version. | +|`template_version_id`|string|true||Template version ID is an in-progress or completed job to use as an initial version of the template. +This is required on creation to enable a user-flow of validating a template works. There is no reason the data-model cannot support empty templates, but it doesn't make sense for users.| ## codersdk.CreateTemplateVersionDryRunRequest ```json { - "rich_parameter_values": [ - { - "name": "string", - "value": "string" - } - ], - "user_variable_values": [ - { - "name": "string", - "value": "string" - } - ], - "workspace_name": "string" + "rich_parameter_values": [ + { + "name": "string", + "value": "string" + } + ], + "user_variable_values": [ + { + "name": "string", + "value": "string" + } + ], + "workspace_name": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ----------------------- | ----------------------------------------------------------------------------- | -------- | ------------ | ----------- | +|-------------------------|-------------------------------------------------------------------------------|----------|--------------|-------------| | `rich_parameter_values` | array of [codersdk.WorkspaceBuildParameter](#codersdkworkspacebuildparameter) | false | | | | `user_variable_values` | array of [codersdk.VariableValue](#codersdkvariablevalue) | false | | | | `workspace_name` | string | false | | | @@ -1245,30 +1261,30 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in ```json { - "example_id": "string", - "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", - "message": "string", - "name": "string", - "provisioner": "terraform", - "storage_method": "file", - "tags": { - "property1": "string", - "property2": "string" - }, - "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", - "user_variable_values": [ - { - "name": "string", - "value": "string" - } - ] + "example_id": "string", + "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", + "message": "string", + "name": "string", + "provisioner": "terraform", + "storage_method": "file", + "tags": { + "property1": "string", + "property2": "string" + }, + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "user_variable_values": [ + { + "name": "string", + "value": "string" + } + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------------------- | ---------------------------------------------------------------------- | -------- | ------------ | ------------------------------------------------------------ | +|------------------------|------------------------------------------------------------------------|----------|--------------|--------------------------------------------------------------| | `example_id` | string | false | | | | `file_id` | string | false | | | | `message` | string | false | | | @@ -1283,7 +1299,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in #### Enumerated Values | Property | Value | -| ---------------- | ----------- | +|------------------|-------------| | `provisioner` | `terraform` | | `provisioner` | `echo` | | `storage_method` | `file` | @@ -1292,20 +1308,22 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in ```json { - "action": "create", - "additional_fields": [0], - "build_reason": "autostart", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", - "resource_type": "template", - "time": "2019-08-24T14:15:22Z" + "action": "create", + "additional_fields": [ + 0 + ], + "build_reason": "autostart", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", + "resource_type": "template", + "time": "2019-08-24T14:15:22Z" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------- | ---------------------------------------------- | -------- | ------------ | ----------- | +|---------------------|------------------------------------------------|----------|--------------|-------------| | `action` | [codersdk.AuditAction](#codersdkauditaction) | false | | | | `additional_fields` | array of integer | false | | | | `build_reason` | [codersdk.BuildReason](#codersdkbuildreason) | false | | | @@ -1317,7 +1335,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in #### Enumerated Values | Property | Value | -| --------------- | ------------------ | +|-----------------|--------------------| | `action` | `create` | | `action` | `write` | | `action` | `delete` | @@ -1338,16 +1356,16 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in ```json { - "lifetime": 0, - "scope": "all", - "token_name": "string" + "lifetime": 0, + "scope": "all", + "token_name": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------ | -------------------------------------------- | -------- | ------------ | ----------- | +|--------------|----------------------------------------------|----------|--------------|-------------| | `lifetime` | integer | false | | | | `scope` | [codersdk.APIKeyScope](#codersdkapikeyscope) | false | | | | `token_name` | string | false | | | @@ -1355,7 +1373,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in #### Enumerated Values | Property | Value | -| -------- | --------------------- | +|----------|-----------------------| | `scope` | `all` | | `scope` | `application_connect` | @@ -1363,20 +1381,22 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in ```json { - "email": "user@example.com", - "login_type": "", - "name": "string", - "organization_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "password": "string", - "user_status": "active", - "username": "string" + "email": "user@example.com", + "login_type": "", + "name": "string", + "organization_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "password": "string", + "user_status": "active", + "username": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------ | ------------------------------------------ | -------- | ------------ | ----------------------------------------------------------------------------------- | +|--------------------|--------------------------------------------|----------|--------------|-------------------------------------------------------------------------------------| | `email` | string | true | | | | `login_type` | [codersdk.LoginType](#codersdklogintype) | false | | Login type defaults to LoginTypePassword. | | `name` | string | false | | | @@ -1389,25 +1409,27 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in ```json { - "dry_run": true, - "log_level": "debug", - "orphan": true, - "rich_parameter_values": [ - { - "name": "string", - "value": "string" - } - ], - "state": [0], - "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", - "transition": "start" + "dry_run": true, + "log_level": "debug", + "orphan": true, + "rich_parameter_values": [ + { + "name": "string", + "value": "string" + } + ], + "state": [ + 0 + ], + "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", + "transition": "start" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ----------------------- | ----------------------------------------------------------------------------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|-------------------------|-------------------------------------------------------------------------------|----------|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `dry_run` | boolean | false | | | | `log_level` | [codersdk.ProvisionerLogLevel](#codersdkprovisionerloglevel) | false | | Log level changes the default logging verbosity of a provider ("info" if empty). | | `orphan` | boolean | false | | Orphan may be set for the Destroy transition. | @@ -1419,7 +1441,7 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in #### Enumerated Values | Property | Value | -| ------------ | -------- | +|--------------|----------| | `log_level` | `debug` | | `transition` | `start` | | `transition` | `stop` | @@ -1429,16 +1451,16 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in ```json { - "display_name": "string", - "icon": "string", - "name": "string" + "display_name": "string", + "icon": "string", + "name": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------- | ------ | -------- | ------------ | ----------- | +|----------------|--------|----------|--------------|-------------| | `display_name` | string | false | | | | `icon` | string | false | | | | `name` | string | true | | | @@ -1447,18 +1469,18 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in ```json { - "automatic_updates": "always", - "autostart_schedule": "string", - "name": "string", - "rich_parameter_values": [ - { - "name": "string", - "value": "string" - } - ], - "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", - "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", - "ttl_ms": 0 + "automatic_updates": "always", + "autostart_schedule": "string", + "name": "string", + "rich_parameter_values": [ + { + "name": "string", + "value": "string" + } + ], + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", + "ttl_ms": 0 } ``` @@ -1467,7 +1489,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ### Properties | Name | Type | Required | Restrictions | Description | -| ----------------------- | ----------------------------------------------------------------------------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------- | +|-------------------------|-------------------------------------------------------------------------------|----------|--------------|---------------------------------------------------------------------------------------------------------| | `automatic_updates` | [codersdk.AutomaticUpdates](#codersdkautomaticupdates) | false | | | | `autostart_schedule` | string | false | | | | `name` | string | true | | | @@ -1480,18 +1502,18 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "deletes_at": "2019-08-24T14:15:22Z", - "feature": "workspace_apps_api_key", - "secret": "string", - "sequence": 0, - "starts_at": "2019-08-24T14:15:22Z" + "deletes_at": "2019-08-24T14:15:22Z", + "feature": "workspace_apps_api_key", + "secret": "string", + "sequence": 0, + "starts_at": "2019-08-24T14:15:22Z" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------ | ------------------------------------------------------ | -------- | ------------ | ----------- | +|--------------|--------------------------------------------------------|----------|--------------|-------------| | `deletes_at` | string | false | | | | `feature` | [codersdk.CryptoKeyFeature](#codersdkcryptokeyfeature) | false | | | | `secret` | string | false | | | @@ -1509,7 +1531,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o #### Enumerated Values | Value | -| ------------------------ | +|--------------------------| | `workspace_apps_api_key` | | `workspace_apps_token` | | `oidc_convert` | @@ -1519,36 +1541,36 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "display_name": "string", - "name": "string", - "organization_permissions": [ - { - "action": "application_connect", - "negate": true, - "resource_type": "*" - } - ], - "site_permissions": [ - { - "action": "application_connect", - "negate": true, - "resource_type": "*" - } - ], - "user_permissions": [ - { - "action": "application_connect", - "negate": true, - "resource_type": "*" - } - ] + "display_name": "string", + "name": "string", + "organization_permissions": [ + { + "action": "application_connect", + "negate": true, + "resource_type": "*" + } + ], + "site_permissions": [ + { + "action": "application_connect", + "negate": true, + "resource_type": "*" + } + ], + "user_permissions": [ + { + "action": "application_connect", + "negate": true, + "resource_type": "*" + } + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------------------- | --------------------------------------------------- | -------- | ------------ | ------------------------------------------------------------------------------ | +|----------------------------|-----------------------------------------------------|----------|--------------|--------------------------------------------------------------------------------| | `display_name` | string | false | | | | `name` | string | false | | | | `organization_permissions` | array of [codersdk.Permission](#codersdkpermission) | false | | Organization permissions are specific to the organization the role belongs to. | @@ -1559,15 +1581,15 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "amount": 0, - "date": "string" + "amount": 0, + "date": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------- | ------- | -------- | ------------ | ---------------------------------------------------------------------------------------- | +|----------|---------|----------|--------------|------------------------------------------------------------------------------------------| | `amount` | integer | false | | | | `date` | string | false | | Date is a string formatted as 2024-01-31. Timezone and time information is not included. | @@ -1575,20 +1597,20 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "entries": [ - { - "amount": 0, - "date": "string" - } - ], - "tz_hour_offset": 0 + "entries": [ + { + "amount": 0, + "date": "string" + } + ], + "tz_hour_offset": 0 } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------------- | ----------------------------------------------- | -------- | ------------ | ----------- | +|------------------|-------------------------------------------------|----------|--------------|-------------| | `entries` | array of [codersdk.DAUEntry](#codersdkdauentry) | false | | | | `tz_hour_offset` | integer | false | | | @@ -1596,39 +1618,41 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "config": { - "block_direct": true, - "force_websockets": true, - "path": "string", - "url": "string" - }, - "server": { - "enable": true, - "region_code": "string", - "region_id": 0, - "region_name": "string", - "relay_url": { - "forceQuery": true, - "fragment": "string", - "host": "string", - "omitHost": true, - "opaque": "string", - "path": "string", - "rawFragment": "string", - "rawPath": "string", - "rawQuery": "string", - "scheme": "string", - "user": {} - }, - "stun_addresses": ["string"] - } + "config": { + "block_direct": true, + "force_websockets": true, + "path": "string", + "url": "string" + }, + "server": { + "enable": true, + "region_code": "string", + "region_id": 0, + "region_name": "string", + "relay_url": { + "forceQuery": true, + "fragment": "string", + "host": "string", + "omitHost": true, + "opaque": "string", + "path": "string", + "rawFragment": "string", + "rawPath": "string", + "rawQuery": "string", + "scheme": "string", + "user": {} + }, + "stun_addresses": [ + "string" + ] + } } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------- | ------------------------------------------------------ | -------- | ------------ | ----------- | +|----------|--------------------------------------------------------|----------|--------------|-------------| | `config` | [codersdk.DERPConfig](#codersdkderpconfig) | false | | | | `server` | [codersdk.DERPServerConfig](#codersdkderpserverconfig) | false | | | @@ -1636,17 +1660,17 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "block_direct": true, - "force_websockets": true, - "path": "string", - "url": "string" + "block_direct": true, + "force_websockets": true, + "path": "string", + "url": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------ | ------- | -------- | ------------ | ----------- | +|--------------------|---------|----------|--------------|-------------| | `block_direct` | boolean | false | | | | `force_websockets` | boolean | false | | | | `path` | string | false | | | @@ -1656,15 +1680,15 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "latency_ms": 0, - "preferred": true + "latency_ms": 0, + "preferred": true } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------ | ------- | -------- | ------------ | ----------- | +|--------------|---------|----------|--------------|-------------| | `latency_ms` | number | false | | | | `preferred` | boolean | false | | | @@ -1672,31 +1696,33 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "enable": true, - "region_code": "string", - "region_id": 0, - "region_name": "string", - "relay_url": { - "forceQuery": true, - "fragment": "string", - "host": "string", - "omitHost": true, - "opaque": "string", - "path": "string", - "rawFragment": "string", - "rawPath": "string", - "rawQuery": "string", - "scheme": "string", - "user": {} - }, - "stun_addresses": ["string"] + "enable": true, + "region_code": "string", + "region_id": 0, + "region_name": "string", + "relay_url": { + "forceQuery": true, + "fragment": "string", + "host": "string", + "omitHost": true, + "opaque": "string", + "path": "string", + "rawFragment": "string", + "rawPath": "string", + "rawQuery": "string", + "scheme": "string", + "user": {} + }, + "stun_addresses": [ + "string" + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------------- | -------------------------- | -------- | ------------ | ----------- | +|------------------|----------------------------|----------|--------------|-------------| | `enable` | boolean | false | | | | `region_code` | string | false | | | | `region_id` | integer | false | | | @@ -1708,16 +1734,16 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "allow_all_cors": true, - "allow_path_app_sharing": true, - "allow_path_app_site_owner_access": true + "allow_all_cors": true, + "allow_path_app_sharing": true, + "allow_path_app_site_owner_access": true } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------------------------------- | ------- | -------- | ------------ | ----------- | +|------------------------------------|---------|----------|--------------|-------------| | `allow_all_cors` | boolean | false | | | | `allow_path_app_sharing` | boolean | false | | | | `allow_path_app_site_owner_access` | boolean | false | | | @@ -1726,15 +1752,15 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "agent_name": "string", - "port": 0 + "agent_name": "string", + "port": 0 } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------ | ------- | -------- | ------------ | ----------- | +|--------------|---------|----------|--------------|-------------| | `agent_name` | string | false | | | | `port` | integer | false | | | @@ -1742,386 +1768,430 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "config": { - "access_url": { - "forceQuery": true, - "fragment": "string", - "host": "string", - "omitHost": true, - "opaque": "string", - "path": "string", - "rawFragment": "string", - "rawPath": "string", - "rawQuery": "string", - "scheme": "string", - "user": {} - }, - "additional_csp_policy": ["string"], - "address": { - "host": "string", - "port": "string" - }, - "agent_fallback_troubleshooting_url": { - "forceQuery": true, - "fragment": "string", - "host": "string", - "omitHost": true, - "opaque": "string", - "path": "string", - "rawFragment": "string", - "rawPath": "string", - "rawQuery": "string", - "scheme": "string", - "user": {} - }, - "agent_stat_refresh_interval": 0, - "allow_workspace_renames": true, - "autobuild_poll_interval": 0, - "browser_only": true, - "cache_directory": "string", - "cli_upgrade_message": "string", - "config": "string", - "config_ssh": { - "deploymentName": "string", - "sshconfigOptions": ["string"] - }, - "dangerous": { - "allow_all_cors": true, - "allow_path_app_sharing": true, - "allow_path_app_site_owner_access": true - }, - "derp": { - "config": { - "block_direct": true, - "force_websockets": true, - "path": "string", - "url": "string" - }, - "server": { - "enable": true, - "region_code": "string", - "region_id": 0, - "region_name": "string", - "relay_url": { - "forceQuery": true, - "fragment": "string", - "host": "string", - "omitHost": true, - "opaque": "string", - "path": "string", - "rawFragment": "string", - "rawPath": "string", - "rawQuery": "string", - "scheme": "string", - "user": {} - }, - "stun_addresses": ["string"] - } - }, - "disable_owner_workspace_exec": true, - "disable_password_auth": true, - "disable_path_apps": true, - "docs_url": { - "forceQuery": true, - "fragment": "string", - "host": "string", - "omitHost": true, - "opaque": "string", - "path": "string", - "rawFragment": "string", - "rawPath": "string", - "rawQuery": "string", - "scheme": "string", - "user": {} - }, - "enable_terraform_debug_mode": true, - "experiments": ["string"], - "external_auth": { - "value": [ - { - "app_install_url": "string", - "app_installations_url": "string", - "auth_url": "string", - "client_id": "string", - "device_code_url": "string", - "device_flow": true, - "display_icon": "string", - "display_name": "string", - "id": "string", - "no_refresh": true, - "regex": "string", - "scopes": ["string"], - "token_url": "string", - "type": "string", - "validate_url": "string" - } - ] - }, - "external_token_encryption_keys": ["string"], - "healthcheck": { - "refresh": 0, - "threshold_database": 0 - }, - "http_address": "string", - "in_memory_database": true, - "job_hang_detector_interval": 0, - "logging": { - "human": "string", - "json": "string", - "log_filter": ["string"], - "stackdriver": "string" - }, - "metrics_cache_refresh_interval": 0, - "notifications": { - "dispatch_timeout": 0, - "email": { - "auth": { - "identity": "string", - "password": "string", - "password_file": "string", - "username": "string" - }, - "force_tls": true, - "from": "string", - "hello": "string", - "smarthost": "string", - "tls": { - "ca_file": "string", - "cert_file": "string", - "insecure_skip_verify": true, - "key_file": "string", - "server_name": "string", - "start_tls": true - } - }, - "fetch_interval": 0, - "lease_count": 0, - "lease_period": 0, - "max_send_attempts": 0, - "method": "string", - "retry_interval": 0, - "sync_buffer_size": 0, - "sync_interval": 0, - "webhook": { - "endpoint": { - "forceQuery": true, - "fragment": "string", - "host": "string", - "omitHost": true, - "opaque": "string", - "path": "string", - "rawFragment": "string", - "rawPath": "string", - "rawQuery": "string", - "scheme": "string", - "user": {} - } - } - }, - "oauth2": { - "github": { - "allow_everyone": true, - "allow_signups": true, - "allowed_orgs": ["string"], - "allowed_teams": ["string"], - "client_id": "string", - "client_secret": "string", - "enterprise_base_url": "string" - } - }, - "oidc": { - "allow_signups": true, - "auth_url_params": {}, - "client_cert_file": "string", - "client_id": "string", - "client_key_file": "string", - "client_secret": "string", - "email_domain": ["string"], - "email_field": "string", - "group_allow_list": ["string"], - "group_auto_create": true, - "group_mapping": {}, - "group_regex_filter": {}, - "groups_field": "string", - "icon_url": { - "forceQuery": true, - "fragment": "string", - "host": "string", - "omitHost": true, - "opaque": "string", - "path": "string", - "rawFragment": "string", - "rawPath": "string", - "rawQuery": "string", - "scheme": "string", - "user": {} - }, - "ignore_email_verified": true, - "ignore_user_info": true, - "issuer_url": "string", - "name_field": "string", - "organization_assign_default": true, - "organization_field": "string", - "organization_mapping": {}, - "scopes": ["string"], - "sign_in_text": "string", - "signups_disabled_text": "string", - "skip_issuer_checks": true, - "user_role_field": "string", - "user_role_mapping": {}, - "user_roles_default": ["string"], - "username_field": "string" - }, - "pg_auth": "string", - "pg_connection_url": "string", - "pprof": { - "address": { - "host": "string", - "port": "string" - }, - "enable": true - }, - "prometheus": { - "address": { - "host": "string", - "port": "string" - }, - "aggregate_agent_stats_by": ["string"], - "collect_agent_stats": true, - "collect_db_metrics": true, - "enable": true - }, - "provisioner": { - "daemon_poll_interval": 0, - "daemon_poll_jitter": 0, - "daemon_psk": "string", - "daemon_types": ["string"], - "daemons": 0, - "force_cancel_interval": 0 - }, - "proxy_health_status_interval": 0, - "proxy_trusted_headers": ["string"], - "proxy_trusted_origins": ["string"], - "rate_limit": { - "api": 0, - "disable_all": true - }, - "redirect_to_access_url": true, - "scim_api_key": "string", - "secure_auth_cookie": true, - "session_lifetime": { - "default_duration": 0, - "default_token_lifetime": 0, - "disable_expiry_refresh": true, - "max_token_lifetime": 0 - }, - "ssh_keygen_algorithm": "string", - "strict_transport_security": 0, - "strict_transport_security_options": ["string"], - "support": { - "links": { - "value": [ - { - "icon": "bug", - "name": "string", - "target": "string" - } - ] - } - }, - "swagger": { - "enable": true - }, - "telemetry": { - "enable": true, - "trace": true, - "url": { - "forceQuery": true, - "fragment": "string", - "host": "string", - "omitHost": true, - "opaque": "string", - "path": "string", - "rawFragment": "string", - "rawPath": "string", - "rawQuery": "string", - "scheme": "string", - "user": {} - } - }, - "terms_of_service_url": "string", - "tls": { - "address": { - "host": "string", - "port": "string" - }, - "allow_insecure_ciphers": true, - "cert_file": ["string"], - "client_auth": "string", - "client_ca_file": "string", - "client_cert_file": "string", - "client_key_file": "string", - "enable": true, - "key_file": ["string"], - "min_version": "string", - "redirect_http": true, - "supported_ciphers": ["string"] - }, - "trace": { - "capture_logs": true, - "data_dog": true, - "enable": true, - "honeycomb_api_key": "string" - }, - "update_check": true, - "user_quiet_hours_schedule": { - "allow_user_custom": true, - "default_schedule": "string" - }, - "verbose": true, - "web_terminal_renderer": "string", - "wgtunnel_host": "string", - "wildcard_access_url": "string", - "write_config": true - }, - "options": [ - { - "annotations": { - "property1": "string", - "property2": "string" - }, - "default": "string", - "description": "string", - "env": "string", - "flag": "string", - "flag_shorthand": "string", - "group": { - "description": "string", - "name": "string", - "parent": { - "description": "string", - "name": "string", - "parent": {}, - "yaml": "string" - }, - "yaml": "string" - }, - "hidden": true, - "name": "string", - "required": true, - "use_instead": [{}], - "value": null, - "value_source": "", - "yaml": "string" - } - ] + "config": { + "access_url": { + "forceQuery": true, + "fragment": "string", + "host": "string", + "omitHost": true, + "opaque": "string", + "path": "string", + "rawFragment": "string", + "rawPath": "string", + "rawQuery": "string", + "scheme": "string", + "user": {} + }, + "additional_csp_policy": [ + "string" + ], + "address": { + "host": "string", + "port": "string" + }, + "agent_fallback_troubleshooting_url": { + "forceQuery": true, + "fragment": "string", + "host": "string", + "omitHost": true, + "opaque": "string", + "path": "string", + "rawFragment": "string", + "rawPath": "string", + "rawQuery": "string", + "scheme": "string", + "user": {} + }, + "agent_stat_refresh_interval": 0, + "allow_workspace_renames": true, + "autobuild_poll_interval": 0, + "browser_only": true, + "cache_directory": "string", + "cli_upgrade_message": "string", + "config": "string", + "config_ssh": { + "deploymentName": "string", + "sshconfigOptions": [ + "string" + ] + }, + "dangerous": { + "allow_all_cors": true, + "allow_path_app_sharing": true, + "allow_path_app_site_owner_access": true + }, + "derp": { + "config": { + "block_direct": true, + "force_websockets": true, + "path": "string", + "url": "string" + }, + "server": { + "enable": true, + "region_code": "string", + "region_id": 0, + "region_name": "string", + "relay_url": { + "forceQuery": true, + "fragment": "string", + "host": "string", + "omitHost": true, + "opaque": "string", + "path": "string", + "rawFragment": "string", + "rawPath": "string", + "rawQuery": "string", + "scheme": "string", + "user": {} + }, + "stun_addresses": [ + "string" + ] + } + }, + "disable_owner_workspace_exec": true, + "disable_password_auth": true, + "disable_path_apps": true, + "docs_url": { + "forceQuery": true, + "fragment": "string", + "host": "string", + "omitHost": true, + "opaque": "string", + "path": "string", + "rawFragment": "string", + "rawPath": "string", + "rawQuery": "string", + "scheme": "string", + "user": {} + }, + "enable_terraform_debug_mode": true, + "experiments": [ + "string" + ], + "external_auth": { + "value": [ + { + "app_install_url": "string", + "app_installations_url": "string", + "auth_url": "string", + "client_id": "string", + "device_code_url": "string", + "device_flow": true, + "display_icon": "string", + "display_name": "string", + "id": "string", + "no_refresh": true, + "regex": "string", + "scopes": [ + "string" + ], + "token_url": "string", + "type": "string", + "validate_url": "string" + } + ] + }, + "external_token_encryption_keys": [ + "string" + ], + "healthcheck": { + "refresh": 0, + "threshold_database": 0 + }, + "http_address": "string", + "in_memory_database": true, + "job_hang_detector_interval": 0, + "logging": { + "human": "string", + "json": "string", + "log_filter": [ + "string" + ], + "stackdriver": "string" + }, + "metrics_cache_refresh_interval": 0, + "notifications": { + "dispatch_timeout": 0, + "email": { + "auth": { + "identity": "string", + "password": "string", + "password_file": "string", + "username": "string" + }, + "force_tls": true, + "from": "string", + "hello": "string", + "smarthost": "string", + "tls": { + "ca_file": "string", + "cert_file": "string", + "insecure_skip_verify": true, + "key_file": "string", + "server_name": "string", + "start_tls": true + } + }, + "fetch_interval": 0, + "lease_count": 0, + "lease_period": 0, + "max_send_attempts": 0, + "method": "string", + "retry_interval": 0, + "sync_buffer_size": 0, + "sync_interval": 0, + "webhook": { + "endpoint": { + "forceQuery": true, + "fragment": "string", + "host": "string", + "omitHost": true, + "opaque": "string", + "path": "string", + "rawFragment": "string", + "rawPath": "string", + "rawQuery": "string", + "scheme": "string", + "user": {} + } + } + }, + "oauth2": { + "github": { + "allow_everyone": true, + "allow_signups": true, + "allowed_orgs": [ + "string" + ], + "allowed_teams": [ + "string" + ], + "client_id": "string", + "client_secret": "string", + "enterprise_base_url": "string" + } + }, + "oidc": { + "allow_signups": true, + "auth_url_params": {}, + "client_cert_file": "string", + "client_id": "string", + "client_key_file": "string", + "client_secret": "string", + "email_domain": [ + "string" + ], + "email_field": "string", + "group_allow_list": [ + "string" + ], + "group_auto_create": true, + "group_mapping": {}, + "group_regex_filter": {}, + "groups_field": "string", + "icon_url": { + "forceQuery": true, + "fragment": "string", + "host": "string", + "omitHost": true, + "opaque": "string", + "path": "string", + "rawFragment": "string", + "rawPath": "string", + "rawQuery": "string", + "scheme": "string", + "user": {} + }, + "ignore_email_verified": true, + "ignore_user_info": true, + "issuer_url": "string", + "name_field": "string", + "organization_assign_default": true, + "organization_field": "string", + "organization_mapping": {}, + "scopes": [ + "string" + ], + "sign_in_text": "string", + "signups_disabled_text": "string", + "skip_issuer_checks": true, + "user_role_field": "string", + "user_role_mapping": {}, + "user_roles_default": [ + "string" + ], + "username_field": "string" + }, + "pg_auth": "string", + "pg_connection_url": "string", + "pprof": { + "address": { + "host": "string", + "port": "string" + }, + "enable": true + }, + "prometheus": { + "address": { + "host": "string", + "port": "string" + }, + "aggregate_agent_stats_by": [ + "string" + ], + "collect_agent_stats": true, + "collect_db_metrics": true, + "enable": true + }, + "provisioner": { + "daemon_poll_interval": 0, + "daemon_poll_jitter": 0, + "daemon_psk": "string", + "daemon_types": [ + "string" + ], + "daemons": 0, + "force_cancel_interval": 0 + }, + "proxy_health_status_interval": 0, + "proxy_trusted_headers": [ + "string" + ], + "proxy_trusted_origins": [ + "string" + ], + "rate_limit": { + "api": 0, + "disable_all": true + }, + "redirect_to_access_url": true, + "scim_api_key": "string", + "secure_auth_cookie": true, + "session_lifetime": { + "default_duration": 0, + "default_token_lifetime": 0, + "disable_expiry_refresh": true, + "max_token_lifetime": 0 + }, + "ssh_keygen_algorithm": "string", + "strict_transport_security": 0, + "strict_transport_security_options": [ + "string" + ], + "support": { + "links": { + "value": [ + { + "icon": "bug", + "name": "string", + "target": "string" + } + ] + } + }, + "swagger": { + "enable": true + }, + "telemetry": { + "enable": true, + "trace": true, + "url": { + "forceQuery": true, + "fragment": "string", + "host": "string", + "omitHost": true, + "opaque": "string", + "path": "string", + "rawFragment": "string", + "rawPath": "string", + "rawQuery": "string", + "scheme": "string", + "user": {} + } + }, + "terms_of_service_url": "string", + "tls": { + "address": { + "host": "string", + "port": "string" + }, + "allow_insecure_ciphers": true, + "cert_file": [ + "string" + ], + "client_auth": "string", + "client_ca_file": "string", + "client_cert_file": "string", + "client_key_file": "string", + "enable": true, + "key_file": [ + "string" + ], + "min_version": "string", + "redirect_http": true, + "supported_ciphers": [ + "string" + ] + }, + "trace": { + "capture_logs": true, + "data_dog": true, + "enable": true, + "honeycomb_api_key": "string" + }, + "update_check": true, + "user_quiet_hours_schedule": { + "allow_user_custom": true, + "default_schedule": "string" + }, + "verbose": true, + "web_terminal_renderer": "string", + "wgtunnel_host": "string", + "wildcard_access_url": "string", + "write_config": true + }, + "options": [ + { + "annotations": { + "property1": "string", + "property2": "string" + }, + "default": "string", + "description": "string", + "env": "string", + "flag": "string", + "flag_shorthand": "string", + "group": { + "description": "string", + "name": "string", + "parent": { + "description": "string", + "name": "string", + "parent": {}, + "yaml": "string" + }, + "yaml": "string" + }, + "hidden": true, + "name": "string", + "required": true, + "use_instead": [ + {} + ], + "value": null, + "value_source": "", + "yaml": "string" + } + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| --------- | ------------------------------------------------------ | -------- | ------------ | ----------- | +|-----------|--------------------------------------------------------|----------|--------------|-------------| | `config` | [codersdk.DeploymentValues](#codersdkdeploymentvalues) | false | | | | `options` | array of [serpent.Option](#serpentoption) | false | | | @@ -2129,35 +2199,35 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "aggregated_from": "2019-08-24T14:15:22Z", - "collected_at": "2019-08-24T14:15:22Z", - "next_update_at": "2019-08-24T14:15:22Z", - "session_count": { - "jetbrains": 0, - "reconnecting_pty": 0, - "ssh": 0, - "vscode": 0 - }, - "workspaces": { - "building": 0, - "connection_latency_ms": { - "p50": 0, - "p95": 0 - }, - "failed": 0, - "pending": 0, - "running": 0, - "rx_bytes": 0, - "stopped": 0, - "tx_bytes": 0 - } + "aggregated_from": "2019-08-24T14:15:22Z", + "collected_at": "2019-08-24T14:15:22Z", + "next_update_at": "2019-08-24T14:15:22Z", + "session_count": { + "jetbrains": 0, + "reconnecting_pty": 0, + "ssh": 0, + "vscode": 0 + }, + "workspaces": { + "building": 0, + "connection_latency_ms": { + "p50": 0, + "p95": 0 + }, + "failed": 0, + "pending": 0, + "running": 0, + "rx_bytes": 0, + "stopped": 0, + "tx_bytes": 0 + } } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ----------------- | ---------------------------------------------------------------------------- | -------- | ------------ | --------------------------------------------------------------------------------------------------------------------------- | +|-------------------|------------------------------------------------------------------------------|----------|--------------|-----------------------------------------------------------------------------------------------------------------------------| | `aggregated_from` | string | false | | Aggregated from is the time in which stats are aggregated from. This might be back in time a specific duration or interval. | | `collected_at` | string | false | | Collected at is the time in which stats are collected at. | | `next_update_at` | string | false | | Next update at is the time when the next batch of stats will be updated. | @@ -2168,353 +2238,395 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "access_url": { - "forceQuery": true, - "fragment": "string", - "host": "string", - "omitHost": true, - "opaque": "string", - "path": "string", - "rawFragment": "string", - "rawPath": "string", - "rawQuery": "string", - "scheme": "string", - "user": {} - }, - "additional_csp_policy": ["string"], - "address": { - "host": "string", - "port": "string" - }, - "agent_fallback_troubleshooting_url": { - "forceQuery": true, - "fragment": "string", - "host": "string", - "omitHost": true, - "opaque": "string", - "path": "string", - "rawFragment": "string", - "rawPath": "string", - "rawQuery": "string", - "scheme": "string", - "user": {} - }, - "agent_stat_refresh_interval": 0, - "allow_workspace_renames": true, - "autobuild_poll_interval": 0, - "browser_only": true, - "cache_directory": "string", - "cli_upgrade_message": "string", - "config": "string", - "config_ssh": { - "deploymentName": "string", - "sshconfigOptions": ["string"] - }, - "dangerous": { - "allow_all_cors": true, - "allow_path_app_sharing": true, - "allow_path_app_site_owner_access": true - }, - "derp": { - "config": { - "block_direct": true, - "force_websockets": true, - "path": "string", - "url": "string" - }, - "server": { - "enable": true, - "region_code": "string", - "region_id": 0, - "region_name": "string", - "relay_url": { - "forceQuery": true, - "fragment": "string", - "host": "string", - "omitHost": true, - "opaque": "string", - "path": "string", - "rawFragment": "string", - "rawPath": "string", - "rawQuery": "string", - "scheme": "string", - "user": {} - }, - "stun_addresses": ["string"] - } - }, - "disable_owner_workspace_exec": true, - "disable_password_auth": true, - "disable_path_apps": true, - "docs_url": { - "forceQuery": true, - "fragment": "string", - "host": "string", - "omitHost": true, - "opaque": "string", - "path": "string", - "rawFragment": "string", - "rawPath": "string", - "rawQuery": "string", - "scheme": "string", - "user": {} - }, - "enable_terraform_debug_mode": true, - "experiments": ["string"], - "external_auth": { - "value": [ - { - "app_install_url": "string", - "app_installations_url": "string", - "auth_url": "string", - "client_id": "string", - "device_code_url": "string", - "device_flow": true, - "display_icon": "string", - "display_name": "string", - "id": "string", - "no_refresh": true, - "regex": "string", - "scopes": ["string"], - "token_url": "string", - "type": "string", - "validate_url": "string" - } - ] - }, - "external_token_encryption_keys": ["string"], - "healthcheck": { - "refresh": 0, - "threshold_database": 0 - }, - "http_address": "string", - "in_memory_database": true, - "job_hang_detector_interval": 0, - "logging": { - "human": "string", - "json": "string", - "log_filter": ["string"], - "stackdriver": "string" - }, - "metrics_cache_refresh_interval": 0, - "notifications": { - "dispatch_timeout": 0, - "email": { - "auth": { - "identity": "string", - "password": "string", - "password_file": "string", - "username": "string" - }, - "force_tls": true, - "from": "string", - "hello": "string", - "smarthost": "string", - "tls": { - "ca_file": "string", - "cert_file": "string", - "insecure_skip_verify": true, - "key_file": "string", - "server_name": "string", - "start_tls": true - } - }, - "fetch_interval": 0, - "lease_count": 0, - "lease_period": 0, - "max_send_attempts": 0, - "method": "string", - "retry_interval": 0, - "sync_buffer_size": 0, - "sync_interval": 0, - "webhook": { - "endpoint": { - "forceQuery": true, - "fragment": "string", - "host": "string", - "omitHost": true, - "opaque": "string", - "path": "string", - "rawFragment": "string", - "rawPath": "string", - "rawQuery": "string", - "scheme": "string", - "user": {} - } - } - }, - "oauth2": { - "github": { - "allow_everyone": true, - "allow_signups": true, - "allowed_orgs": ["string"], - "allowed_teams": ["string"], - "client_id": "string", - "client_secret": "string", - "enterprise_base_url": "string" - } - }, - "oidc": { - "allow_signups": true, - "auth_url_params": {}, - "client_cert_file": "string", - "client_id": "string", - "client_key_file": "string", - "client_secret": "string", - "email_domain": ["string"], - "email_field": "string", - "group_allow_list": ["string"], - "group_auto_create": true, - "group_mapping": {}, - "group_regex_filter": {}, - "groups_field": "string", - "icon_url": { - "forceQuery": true, - "fragment": "string", - "host": "string", - "omitHost": true, - "opaque": "string", - "path": "string", - "rawFragment": "string", - "rawPath": "string", - "rawQuery": "string", - "scheme": "string", - "user": {} - }, - "ignore_email_verified": true, - "ignore_user_info": true, - "issuer_url": "string", - "name_field": "string", - "organization_assign_default": true, - "organization_field": "string", - "organization_mapping": {}, - "scopes": ["string"], - "sign_in_text": "string", - "signups_disabled_text": "string", - "skip_issuer_checks": true, - "user_role_field": "string", - "user_role_mapping": {}, - "user_roles_default": ["string"], - "username_field": "string" - }, - "pg_auth": "string", - "pg_connection_url": "string", - "pprof": { - "address": { - "host": "string", - "port": "string" - }, - "enable": true - }, - "prometheus": { - "address": { - "host": "string", - "port": "string" - }, - "aggregate_agent_stats_by": ["string"], - "collect_agent_stats": true, - "collect_db_metrics": true, - "enable": true - }, - "provisioner": { - "daemon_poll_interval": 0, - "daemon_poll_jitter": 0, - "daemon_psk": "string", - "daemon_types": ["string"], - "daemons": 0, - "force_cancel_interval": 0 - }, - "proxy_health_status_interval": 0, - "proxy_trusted_headers": ["string"], - "proxy_trusted_origins": ["string"], - "rate_limit": { - "api": 0, - "disable_all": true - }, - "redirect_to_access_url": true, - "scim_api_key": "string", - "secure_auth_cookie": true, - "session_lifetime": { - "default_duration": 0, - "default_token_lifetime": 0, - "disable_expiry_refresh": true, - "max_token_lifetime": 0 - }, - "ssh_keygen_algorithm": "string", - "strict_transport_security": 0, - "strict_transport_security_options": ["string"], - "support": { - "links": { - "value": [ - { - "icon": "bug", - "name": "string", - "target": "string" - } - ] - } - }, - "swagger": { - "enable": true - }, - "telemetry": { - "enable": true, - "trace": true, - "url": { - "forceQuery": true, - "fragment": "string", - "host": "string", - "omitHost": true, - "opaque": "string", - "path": "string", - "rawFragment": "string", - "rawPath": "string", - "rawQuery": "string", - "scheme": "string", - "user": {} - } - }, - "terms_of_service_url": "string", - "tls": { - "address": { - "host": "string", - "port": "string" - }, - "allow_insecure_ciphers": true, - "cert_file": ["string"], - "client_auth": "string", - "client_ca_file": "string", - "client_cert_file": "string", - "client_key_file": "string", - "enable": true, - "key_file": ["string"], - "min_version": "string", - "redirect_http": true, - "supported_ciphers": ["string"] - }, - "trace": { - "capture_logs": true, - "data_dog": true, - "enable": true, - "honeycomb_api_key": "string" - }, - "update_check": true, - "user_quiet_hours_schedule": { - "allow_user_custom": true, - "default_schedule": "string" - }, - "verbose": true, - "web_terminal_renderer": "string", - "wgtunnel_host": "string", - "wildcard_access_url": "string", - "write_config": true + "access_url": { + "forceQuery": true, + "fragment": "string", + "host": "string", + "omitHost": true, + "opaque": "string", + "path": "string", + "rawFragment": "string", + "rawPath": "string", + "rawQuery": "string", + "scheme": "string", + "user": {} + }, + "additional_csp_policy": [ + "string" + ], + "address": { + "host": "string", + "port": "string" + }, + "agent_fallback_troubleshooting_url": { + "forceQuery": true, + "fragment": "string", + "host": "string", + "omitHost": true, + "opaque": "string", + "path": "string", + "rawFragment": "string", + "rawPath": "string", + "rawQuery": "string", + "scheme": "string", + "user": {} + }, + "agent_stat_refresh_interval": 0, + "allow_workspace_renames": true, + "autobuild_poll_interval": 0, + "browser_only": true, + "cache_directory": "string", + "cli_upgrade_message": "string", + "config": "string", + "config_ssh": { + "deploymentName": "string", + "sshconfigOptions": [ + "string" + ] + }, + "dangerous": { + "allow_all_cors": true, + "allow_path_app_sharing": true, + "allow_path_app_site_owner_access": true + }, + "derp": { + "config": { + "block_direct": true, + "force_websockets": true, + "path": "string", + "url": "string" + }, + "server": { + "enable": true, + "region_code": "string", + "region_id": 0, + "region_name": "string", + "relay_url": { + "forceQuery": true, + "fragment": "string", + "host": "string", + "omitHost": true, + "opaque": "string", + "path": "string", + "rawFragment": "string", + "rawPath": "string", + "rawQuery": "string", + "scheme": "string", + "user": {} + }, + "stun_addresses": [ + "string" + ] + } + }, + "disable_owner_workspace_exec": true, + "disable_password_auth": true, + "disable_path_apps": true, + "docs_url": { + "forceQuery": true, + "fragment": "string", + "host": "string", + "omitHost": true, + "opaque": "string", + "path": "string", + "rawFragment": "string", + "rawPath": "string", + "rawQuery": "string", + "scheme": "string", + "user": {} + }, + "enable_terraform_debug_mode": true, + "experiments": [ + "string" + ], + "external_auth": { + "value": [ + { + "app_install_url": "string", + "app_installations_url": "string", + "auth_url": "string", + "client_id": "string", + "device_code_url": "string", + "device_flow": true, + "display_icon": "string", + "display_name": "string", + "id": "string", + "no_refresh": true, + "regex": "string", + "scopes": [ + "string" + ], + "token_url": "string", + "type": "string", + "validate_url": "string" + } + ] + }, + "external_token_encryption_keys": [ + "string" + ], + "healthcheck": { + "refresh": 0, + "threshold_database": 0 + }, + "http_address": "string", + "in_memory_database": true, + "job_hang_detector_interval": 0, + "logging": { + "human": "string", + "json": "string", + "log_filter": [ + "string" + ], + "stackdriver": "string" + }, + "metrics_cache_refresh_interval": 0, + "notifications": { + "dispatch_timeout": 0, + "email": { + "auth": { + "identity": "string", + "password": "string", + "password_file": "string", + "username": "string" + }, + "force_tls": true, + "from": "string", + "hello": "string", + "smarthost": "string", + "tls": { + "ca_file": "string", + "cert_file": "string", + "insecure_skip_verify": true, + "key_file": "string", + "server_name": "string", + "start_tls": true + } + }, + "fetch_interval": 0, + "lease_count": 0, + "lease_period": 0, + "max_send_attempts": 0, + "method": "string", + "retry_interval": 0, + "sync_buffer_size": 0, + "sync_interval": 0, + "webhook": { + "endpoint": { + "forceQuery": true, + "fragment": "string", + "host": "string", + "omitHost": true, + "opaque": "string", + "path": "string", + "rawFragment": "string", + "rawPath": "string", + "rawQuery": "string", + "scheme": "string", + "user": {} + } + } + }, + "oauth2": { + "github": { + "allow_everyone": true, + "allow_signups": true, + "allowed_orgs": [ + "string" + ], + "allowed_teams": [ + "string" + ], + "client_id": "string", + "client_secret": "string", + "enterprise_base_url": "string" + } + }, + "oidc": { + "allow_signups": true, + "auth_url_params": {}, + "client_cert_file": "string", + "client_id": "string", + "client_key_file": "string", + "client_secret": "string", + "email_domain": [ + "string" + ], + "email_field": "string", + "group_allow_list": [ + "string" + ], + "group_auto_create": true, + "group_mapping": {}, + "group_regex_filter": {}, + "groups_field": "string", + "icon_url": { + "forceQuery": true, + "fragment": "string", + "host": "string", + "omitHost": true, + "opaque": "string", + "path": "string", + "rawFragment": "string", + "rawPath": "string", + "rawQuery": "string", + "scheme": "string", + "user": {} + }, + "ignore_email_verified": true, + "ignore_user_info": true, + "issuer_url": "string", + "name_field": "string", + "organization_assign_default": true, + "organization_field": "string", + "organization_mapping": {}, + "scopes": [ + "string" + ], + "sign_in_text": "string", + "signups_disabled_text": "string", + "skip_issuer_checks": true, + "user_role_field": "string", + "user_role_mapping": {}, + "user_roles_default": [ + "string" + ], + "username_field": "string" + }, + "pg_auth": "string", + "pg_connection_url": "string", + "pprof": { + "address": { + "host": "string", + "port": "string" + }, + "enable": true + }, + "prometheus": { + "address": { + "host": "string", + "port": "string" + }, + "aggregate_agent_stats_by": [ + "string" + ], + "collect_agent_stats": true, + "collect_db_metrics": true, + "enable": true + }, + "provisioner": { + "daemon_poll_interval": 0, + "daemon_poll_jitter": 0, + "daemon_psk": "string", + "daemon_types": [ + "string" + ], + "daemons": 0, + "force_cancel_interval": 0 + }, + "proxy_health_status_interval": 0, + "proxy_trusted_headers": [ + "string" + ], + "proxy_trusted_origins": [ + "string" + ], + "rate_limit": { + "api": 0, + "disable_all": true + }, + "redirect_to_access_url": true, + "scim_api_key": "string", + "secure_auth_cookie": true, + "session_lifetime": { + "default_duration": 0, + "default_token_lifetime": 0, + "disable_expiry_refresh": true, + "max_token_lifetime": 0 + }, + "ssh_keygen_algorithm": "string", + "strict_transport_security": 0, + "strict_transport_security_options": [ + "string" + ], + "support": { + "links": { + "value": [ + { + "icon": "bug", + "name": "string", + "target": "string" + } + ] + } + }, + "swagger": { + "enable": true + }, + "telemetry": { + "enable": true, + "trace": true, + "url": { + "forceQuery": true, + "fragment": "string", + "host": "string", + "omitHost": true, + "opaque": "string", + "path": "string", + "rawFragment": "string", + "rawPath": "string", + "rawQuery": "string", + "scheme": "string", + "user": {} + } + }, + "terms_of_service_url": "string", + "tls": { + "address": { + "host": "string", + "port": "string" + }, + "allow_insecure_ciphers": true, + "cert_file": [ + "string" + ], + "client_auth": "string", + "client_ca_file": "string", + "client_cert_file": "string", + "client_key_file": "string", + "enable": true, + "key_file": [ + "string" + ], + "min_version": "string", + "redirect_http": true, + "supported_ciphers": [ + "string" + ] + }, + "trace": { + "capture_logs": true, + "data_dog": true, + "enable": true, + "honeycomb_api_key": "string" + }, + "update_check": true, + "user_quiet_hours_schedule": { + "allow_user_custom": true, + "default_schedule": "string" + }, + "verbose": true, + "web_terminal_renderer": "string", + "wgtunnel_host": "string", + "wildcard_access_url": "string", + "write_config": true } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------------------------ | ---------------------------------------------------------------------------------------------------- | -------- | ------------ | ------------------------------------------------------------------ | +|--------------------------------------|------------------------------------------------------------------------------------------------------|----------|--------------|--------------------------------------------------------------------| | `access_url` | [serpent.URL](#serpenturl) | false | | | | `additional_csp_policy` | array of string | false | | | | `address` | [serpent.HostPort](#serpenthostport) | false | | Address Use HTTPAddress or TLS.Address instead. | @@ -2587,7 +2699,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o #### Enumerated Values | Value | -| ------------------------ | +|--------------------------| | `vscode` | | `vscode_insiders` | | `web_terminal` | @@ -2605,7 +2717,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o #### Enumerated Values | Value | -| -------------- | +|----------------| | `entitled` | | `grace_period` | | `not_entitled` | @@ -2614,33 +2726,37 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "errors": ["string"], - "features": { - "property1": { - "actual": 0, - "enabled": true, - "entitlement": "entitled", - "limit": 0 - }, - "property2": { - "actual": 0, - "enabled": true, - "entitlement": "entitled", - "limit": 0 - } - }, - "has_license": true, - "refreshed_at": "2019-08-24T14:15:22Z", - "require_telemetry": true, - "trial": true, - "warnings": ["string"] + "errors": [ + "string" + ], + "features": { + "property1": { + "actual": 0, + "enabled": true, + "entitlement": "entitled", + "limit": 0 + }, + "property2": { + "actual": 0, + "enabled": true, + "entitlement": "entitled", + "limit": 0 + } + }, + "has_license": true, + "refreshed_at": "2019-08-24T14:15:22Z", + "require_telemetry": true, + "trial": true, + "warnings": [ + "string" + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------- | ------------------------------------ | -------- | ------------ | ----------- | +|---------------------|--------------------------------------|----------|--------------|-------------| | `errors` | array of string | false | | | | `features` | object | false | | | | » `[any property]` | [codersdk.Feature](#codersdkfeature) | false | | | @@ -2661,7 +2777,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o #### Enumerated Values | Value | -| ---------------------- | +|------------------------| | `example` | | `auto-fill-parameters` | | `notifications` | @@ -2671,38 +2787,38 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "app_install_url": "string", - "app_installable": true, - "authenticated": true, - "device": true, - "display_name": "string", - "installations": [ - { - "account": { - "avatar_url": "string", - "id": 0, - "login": "string", - "name": "string", - "profile_url": "string" - }, - "configure_url": "string", - "id": 0 - } - ], - "user": { - "avatar_url": "string", - "id": 0, - "login": "string", - "name": "string", - "profile_url": "string" - } + "app_install_url": "string", + "app_installable": true, + "authenticated": true, + "device": true, + "display_name": "string", + "installations": [ + { + "account": { + "avatar_url": "string", + "id": 0, + "login": "string", + "name": "string", + "profile_url": "string" + }, + "configure_url": "string", + "id": 0 + } + ], + "user": { + "avatar_url": "string", + "id": 0, + "login": "string", + "name": "string", + "profile_url": "string" + } } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ----------------- | ------------------------------------------------------------------------------------- | -------- | ------------ | ----------------------------------------------------------------------- | +|-------------------|---------------------------------------------------------------------------------------|----------|--------------|-------------------------------------------------------------------------| | `app_install_url` | string | false | | App install URL is the URL to install the app. | | `app_installable` | boolean | false | | App installable is true if the request for app installs was successful. | | `authenticated` | boolean | false | | | @@ -2715,22 +2831,22 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "account": { - "avatar_url": "string", - "id": 0, - "login": "string", - "name": "string", - "profile_url": "string" - }, - "configure_url": "string", - "id": 0 + "account": { + "avatar_url": "string", + "id": 0, + "login": "string", + "name": "string", + "profile_url": "string" + }, + "configure_url": "string", + "id": 0 } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| --------------- | ------------------------------------------------------ | -------- | ------------ | ----------- | +|-----------------|--------------------------------------------------------|----------|--------------|-------------| | `account` | [codersdk.ExternalAuthUser](#codersdkexternalauthuser) | false | | | | `configure_url` | string | false | | | | `id` | integer | false | | | @@ -2739,61 +2855,63 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "app_install_url": "string", - "app_installations_url": "string", - "auth_url": "string", - "client_id": "string", - "device_code_url": "string", - "device_flow": true, - "display_icon": "string", - "display_name": "string", - "id": "string", - "no_refresh": true, - "regex": "string", - "scopes": ["string"], - "token_url": "string", - "type": "string", - "validate_url": "string" -} -``` - -### Properties - -| Name | Type | Required | Restrictions | Description | -| -------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------- | -------- | ------------ | --------------------------------------------------------------------------------------------------------- | -| `app_install_url` | string | false | | | -| `app_installations_url` | string | false | | | -| `auth_url` | string | false | | | -| `client_id` | string | false | | | -| `device_code_url` | string | false | | | -| `device_flow` | boolean | false | | | -| `display_icon` | string | false | | Display icon is a URL to an icon to display in the UI. | -| `display_name` | string | false | | Display name is shown in the UI to identify the auth config. | -| `id` | string | false | | ID is a unique identifier for the auth config. It defaults to `type` when not provided. | -| `no_refresh` | boolean | false | | | -| `regex` | string | false | | Regex allows API requesters to match an auth config by a string (e.g. coder.com) instead of by it's type. | -| Git clone makes use of this by parsing the URL from: 'Username for "https://github.com":' And sending it to the Coder server to match against the Regex. | -| `scopes` | array of string | false | | | -| `token_url` | string | false | | | -| `type` | string | false | | Type is the type of external auth config. | -| `validate_url` | string | false | | | + "app_install_url": "string", + "app_installations_url": "string", + "auth_url": "string", + "client_id": "string", + "device_code_url": "string", + "device_flow": true, + "display_icon": "string", + "display_name": "string", + "id": "string", + "no_refresh": true, + "regex": "string", + "scopes": [ + "string" + ], + "token_url": "string", + "type": "string", + "validate_url": "string" +} +``` + +### Properties + +| Name | Type | Required | Restrictions | Description | +|-------------------------|---------|----------|--------------|-----------------------------------------------------------------------------------------| +| `app_install_url` | string | false | | | +| `app_installations_url` | string | false | | | +| `auth_url` | string | false | | | +| `client_id` | string | false | | | +| `device_code_url` | string | false | | | +| `device_flow` | boolean | false | | | +| `display_icon` | string | false | | Display icon is a URL to an icon to display in the UI. | +| `display_name` | string | false | | Display name is shown in the UI to identify the auth config. | +| `id` | string | false | | ID is a unique identifier for the auth config. It defaults to `type` when not provided. | +| `no_refresh` | boolean | false | | | +|`regex`|string|false||Regex allows API requesters to match an auth config by a string (e.g. coder.com) instead of by it's type. +Git clone makes use of this by parsing the URL from: 'Username for "https://github.com":' And sending it to the Coder server to match against the Regex.| +|`scopes`|array of string|false||| +|`token_url`|string|false||| +|`type`|string|false||Type is the type of external auth config.| +|`validate_url`|string|false||| ## codersdk.ExternalAuthDevice ```json { - "device_code": "string", - "expires_in": 0, - "interval": 0, - "user_code": "string", - "verification_uri": "string" + "device_code": "string", + "expires_in": 0, + "interval": 0, + "user_code": "string", + "verification_uri": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------ | ------- | -------- | ------------ | ----------- | +|--------------------|---------|----------|--------------|-------------| | `device_code` | string | false | | | | `expires_in` | integer | false | | | | `interval` | integer | false | | | @@ -2804,20 +2922,20 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "authenticated": true, - "created_at": "2019-08-24T14:15:22Z", - "expires": "2019-08-24T14:15:22Z", - "has_refresh_token": true, - "provider_id": "string", - "updated_at": "2019-08-24T14:15:22Z", - "validate_error": "string" + "authenticated": true, + "created_at": "2019-08-24T14:15:22Z", + "expires": "2019-08-24T14:15:22Z", + "has_refresh_token": true, + "provider_id": "string", + "updated_at": "2019-08-24T14:15:22Z", + "validate_error": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------- | ------- | -------- | ------------ | ----------- | +|---------------------|---------|----------|--------------|-------------| | `authenticated` | boolean | false | | | | `created_at` | string | false | | | | `expires` | string | false | | | @@ -2830,18 +2948,18 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "avatar_url": "string", - "id": 0, - "login": "string", - "name": "string", - "profile_url": "string" + "avatar_url": "string", + "id": 0, + "login": "string", + "name": "string", + "profile_url": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------- | ------- | -------- | ------------ | ----------- | +|---------------|---------|----------|--------------|-------------| | `avatar_url` | string | false | | | | `id` | integer | false | | | | `login` | string | false | | | @@ -2852,17 +2970,17 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "actual": 0, - "enabled": true, - "entitlement": "entitled", - "limit": 0 + "actual": 0, + "enabled": true, + "entitlement": "entitled", + "limit": 0 } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------- | -------------------------------------------- | -------- | ------------ | ----------- | +|---------------|----------------------------------------------|----------|--------------|-------------| | `actual` | integer | false | | | | `enabled` | boolean | false | | | | `entitlement` | [codersdk.Entitlement](#codersdkentitlement) | false | | | @@ -2872,51 +2990,53 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "key": "string" + "key": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ----- | ------ | -------- | ------------ | ----------- | +|-------|--------|----------|--------------|-------------| | `key` | string | false | | | ## codersdk.GetUsersResponse ```json { - "count": 0, - "users": [ - { - "avatar_url": "http://example.com", - "created_at": "2019-08-24T14:15:22Z", - "email": "user@example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_seen_at": "2019-08-24T14:15:22Z", - "login_type": "", - "name": "string", - "organization_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "roles": [ - { - "display_name": "string", - "name": "string", - "organization_id": "string" - } - ], - "status": "active", - "theme_preference": "string", - "updated_at": "2019-08-24T14:15:22Z", - "username": "string" - } - ] + "count": 0, + "users": [ + { + "avatar_url": "http://example.com", + "created_at": "2019-08-24T14:15:22Z", + "email": "user@example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_seen_at": "2019-08-24T14:15:22Z", + "login_type": "", + "name": "string", + "organization_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "roles": [ + { + "display_name": "string", + "name": "string", + "organization_id": "string" + } + ], + "status": "active", + "theme_preference": "string", + "updated_at": "2019-08-24T14:15:22Z", + "username": "string" + } + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------- | --------------------------------------- | -------- | ------------ | ----------- | +|---------|-----------------------------------------|----------|--------------|-------------| | `count` | integer | false | | | | `users` | array of [codersdk.User](#codersdkuser) | false | | | @@ -2924,17 +3044,17 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "created_at": "2019-08-24T14:15:22Z", - "public_key": "string", - "updated_at": "2019-08-24T14:15:22Z", - "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5" + "created_at": "2019-08-24T14:15:22Z", + "public_key": "string", + "updated_at": "2019-08-24T14:15:22Z", + "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------ | ------ | -------- | ------------ | ----------- | +|--------------|--------|----------|--------------|-------------| | `created_at` | string | false | | | | `public_key` | string | false | | | | `updated_at` | string | false | | | @@ -2944,38 +3064,38 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "avatar_url": "string", - "display_name": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "members": [ - { - "avatar_url": "http://example.com", - "created_at": "2019-08-24T14:15:22Z", - "email": "user@example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_seen_at": "2019-08-24T14:15:22Z", - "login_type": "", - "name": "string", - "status": "active", - "theme_preference": "string", - "updated_at": "2019-08-24T14:15:22Z", - "username": "string" - } - ], - "name": "string", - "organization_display_name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "organization_name": "string", - "quota_allowance": 0, - "source": "user", - "total_member_count": 0 + "avatar_url": "string", + "display_name": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "members": [ + { + "avatar_url": "http://example.com", + "created_at": "2019-08-24T14:15:22Z", + "email": "user@example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_seen_at": "2019-08-24T14:15:22Z", + "login_type": "", + "name": "string", + "status": "active", + "theme_preference": "string", + "updated_at": "2019-08-24T14:15:22Z", + "username": "string" + } + ], + "name": "string", + "organization_display_name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "organization_name": "string", + "quota_allowance": 0, + "source": "user", + "total_member_count": 0 } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| --------------------------- | ----------------------------------------------------- | -------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|-----------------------------|-------------------------------------------------------|----------|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `avatar_url` | string | false | | | | `display_name` | string | false | | | | `id` | string | false | | | @@ -2999,7 +3119,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o #### Enumerated Values | Value | -| ------ | +|--------| | `user` | | `oidc` | @@ -3007,24 +3127,28 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "auto_create_missing_groups": true, - "field": "string", - "legacy_group_name_mapping": { - "property1": "string", - "property2": "string" - }, - "mapping": { - "property1": ["string"], - "property2": ["string"] - }, - "regex_filter": {} + "auto_create_missing_groups": true, + "field": "string", + "legacy_group_name_mapping": { + "property1": "string", + "property2": "string" + }, + "mapping": { + "property1": [ + "string" + ], + "property2": [ + "string" + ] + }, + "regex_filter": {} } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------------------------- | ------------------------------ | -------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|------------------------------|--------------------------------|----------|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `auto_create_missing_groups` | boolean | false | | Auto create missing groups controls whether groups returned by the OIDC provider are automatically created in Coder if they are missing. | | `field` | string | false | | Field is the name of the claim field that specifies what groups a user should be in. If empty, no groups will be synced. | | `legacy_group_name_mapping` | object | false | | Legacy group name mapping is deprecated. It remaps an IDP group name to a Coder group name. Since configuration is now done at runtime, group IDs are used to account for group renames. For legacy configurations, this config option has to remain. Deprecated: Use Mapping instead. | @@ -3037,16 +3161,16 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "interval": 0, - "threshold": 0, - "url": "string" + "interval": 0, + "threshold": 0, + "url": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ----------- | ------- | -------- | ------------ | ------------------------------------------------------------------------------------------------ | +|-------------|---------|----------|--------------|--------------------------------------------------------------------------------------------------| | `interval` | integer | false | | Interval specifies the seconds between each health check. | | `threshold` | integer | false | | Threshold specifies the number of consecutive failed health checks before returning "unhealthy". | | `url` | string | false | | URL specifies the endpoint to check for the app health. | @@ -3055,15 +3179,15 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "refresh": 0, - "threshold_database": 0 + "refresh": 0, + "threshold_database": 0 } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------------- | ------- | -------- | ------------ | ----------- | +|----------------------|---------|----------|--------------|-------------| | `refresh` | integer | false | | | | `threshold_database` | integer | false | | | @@ -3078,7 +3202,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o #### Enumerated Values | Value | -| ------ | +|--------| | `day` | | `week` | @@ -3086,15 +3210,15 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "agentID": "bc282582-04f9-45ce-b904-3e3bfab66958", - "url": "string" + "agentID": "bc282582-04f9-45ce-b904-3e3bfab66958", + "url": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| --------- | ------ | -------- | ------------ | ---------------------------------------------------------------------- | +|-----------|--------|----------|--------------|------------------------------------------------------------------------| | `agentID` | string | true | | | | `url` | string | true | | URL is the URL of the reconnecting-pty endpoint you are connecting to. | @@ -3102,33 +3226,33 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "signed_token": "string" + "signed_token": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------- | ------ | -------- | ------------ | ----------- | +|----------------|--------|----------|--------------|-------------| | `signed_token` | string | false | | | ## codersdk.JFrogXrayScan ```json { - "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978", - "critical": 0, - "high": 0, - "medium": 0, - "results_url": "string", - "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9" + "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978", + "critical": 0, + "high": 0, + "medium": 0, + "results_url": "string", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------- | ------- | -------- | ------------ | ----------- | +|----------------|---------|----------|--------------|-------------| | `agent_id` | string | false | | | | `critical` | integer | false | | | | `high` | integer | false | | | @@ -3147,43 +3271,43 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o #### Enumerated Values | Value | -| ----------------------------- | +|-------------------------------| | `REQUIRED_TEMPLATE_VARIABLES` | ## codersdk.License ```json { - "claims": {}, - "id": 0, - "uploaded_at": "2019-08-24T14:15:22Z", - "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f" + "claims": {}, + "id": 0, + "uploaded_at": "2019-08-24T14:15:22Z", + "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f" } ``` ### Properties -| Name | Type | Required | Restrictions | Description | -| ------------- | ------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `claims` | object | false | | Claims are the JWT claims asserted by the license. Here we use a generic string map to ensure that all data from the server is parsed verbatim, not just the fields this version of Coder understands. | -| `id` | integer | false | | | -| `uploaded_at` | string | false | | | -| `uuid` | string | false | | | +| Name | Type | Required | Restrictions | Description | +|---------------|---------|----------|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `claims` | object | false | | Claims are the JWT claims asserted by the license. Here we use a generic string map to ensure that all data from the server is parsed verbatim, not just the fields this version of Coder understands. | +| `id` | integer | false | | | +| `uploaded_at` | string | false | | | +| `uuid` | string | false | | | ## codersdk.LinkConfig ```json { - "icon": "bug", - "name": "string", - "target": "string" + "icon": "bug", + "name": "string", + "target": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------- | ------ | -------- | ------------ | ----------- | +|----------|--------|----------|--------------|-------------| | `icon` | string | false | | | | `name` | string | false | | | | `target` | string | false | | | @@ -3191,7 +3315,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o #### Enumerated Values | Property | Value | -| -------- | ------ | +|----------|--------| | `icon` | `bug` | | `icon` | `chat` | | `icon` | `docs` | @@ -3207,7 +3331,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o #### Enumerated Values | Value | -| ------- | +|---------| | `trace` | | `debug` | | `info` | @@ -3225,7 +3349,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o #### Enumerated Values | Value | -| -------------------- | +|----------------------| | `provisioner_daemon` | | `provisioner` | @@ -3233,17 +3357,19 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "human": "string", - "json": "string", - "log_filter": ["string"], - "stackdriver": "string" + "human": "string", + "json": "string", + "log_filter": [ + "string" + ], + "stackdriver": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------- | --------------- | -------- | ------------ | ----------- | +|---------------|-----------------|----------|--------------|-------------| | `human` | string | false | | | | `json` | string | false | | | | `log_filter` | array of string | false | | | @@ -3260,7 +3386,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o #### Enumerated Values | Value | -| ---------- | +|------------| | `` | | `password` | | `github` | @@ -3272,15 +3398,15 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "email": "user@example.com", - "password": "string" + "email": "user@example.com", + "password": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------- | ------ | -------- | ------------ | ----------- | +|------------|--------|----------|--------------|-------------| | `email` | string | true | | | | `password` | string | true | | | @@ -3288,30 +3414,30 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "session_token": "string" + "session_token": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| --------------- | ------ | -------- | ------------ | ----------- | +|-----------------|--------|----------|--------------|-------------| | `session_token` | string | true | | | ## codersdk.MatchedProvisioners ```json { - "available": 0, - "count": 0, - "most_recently_seen": "2019-08-24T14:15:22Z" + "available": 0, + "count": 0, + "most_recently_seen": "2019-08-24T14:15:22Z" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------------- | ------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|----------------------|---------|----------|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `available` | integer | false | | Available is the number of provisioner daemons that are available to take jobs. This may be less than the count if some provisioners are busy or have been stopped. | | `count` | integer | false | | Count is the number of provisioner daemons that matched the given tags. If the count is 0, it means no provisioner daemons matched the requested tags. | | `most_recently_seen` | string | false | | Most recently seen is the most recently seen time of the set of matched provisioners. If no provisioners matched, this field will be null. | @@ -3320,17 +3446,17 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "name": "string" + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "name": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------- | ------ | -------- | ------------ | ----------- | +|----------------|--------|----------|--------------|-------------| | `display_name` | string | false | | | | `icon` | string | false | | | | `id` | string | true | | | @@ -3340,16 +3466,16 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "avatar_url": "http://example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "username": "string" + "avatar_url": "http://example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "username": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------ | ------ | -------- | ------------ | ----------- | +|--------------|--------|----------|--------------|-------------| | `avatar_url` | string | false | | | | `id` | string | true | | | | `username` | string | true | | | @@ -3358,15 +3484,17 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "available": ["string"], - "default": "string" + "available": [ + "string" + ], + "default": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ----------- | --------------- | -------- | ------------ | ----------- | +|-------------|-----------------|----------|--------------|-------------| | `available` | array of string | false | | | | `default` | string | false | | | @@ -3374,16 +3502,16 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "disabled": true, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "updated_at": "2019-08-24T14:15:22Z" + "disabled": true, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "updated_at": "2019-08-24T14:15:22Z" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------ | ------- | -------- | ------------ | ----------- | +|--------------|---------|----------|--------------|-------------| | `disabled` | boolean | false | | | | `id` | string | false | | | | `updated_at` | string | false | | | @@ -3392,21 +3520,21 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "actions": "string", - "body_template": "string", - "group": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "kind": "string", - "method": "string", - "name": "string", - "title_template": "string" + "actions": "string", + "body_template": "string", + "group": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "kind": "string", + "method": "string", + "name": "string", + "title_template": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------------- | ------ | -------- | ------------ | ----------- | +|------------------|--------|----------|--------------|-------------| | `actions` | string | false | | | | `body_template` | string | false | | | | `group` | string | false | | | @@ -3420,57 +3548,57 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "dispatch_timeout": 0, - "email": { - "auth": { - "identity": "string", - "password": "string", - "password_file": "string", - "username": "string" - }, - "force_tls": true, - "from": "string", - "hello": "string", - "smarthost": "string", - "tls": { - "ca_file": "string", - "cert_file": "string", - "insecure_skip_verify": true, - "key_file": "string", - "server_name": "string", - "start_tls": true - } - }, - "fetch_interval": 0, - "lease_count": 0, - "lease_period": 0, - "max_send_attempts": 0, - "method": "string", - "retry_interval": 0, - "sync_buffer_size": 0, - "sync_interval": 0, - "webhook": { - "endpoint": { - "forceQuery": true, - "fragment": "string", - "host": "string", - "omitHost": true, - "opaque": "string", - "path": "string", - "rawFragment": "string", - "rawPath": "string", - "rawQuery": "string", - "scheme": "string", - "user": {} - } - } + "dispatch_timeout": 0, + "email": { + "auth": { + "identity": "string", + "password": "string", + "password_file": "string", + "username": "string" + }, + "force_tls": true, + "from": "string", + "hello": "string", + "smarthost": "string", + "tls": { + "ca_file": "string", + "cert_file": "string", + "insecure_skip_verify": true, + "key_file": "string", + "server_name": "string", + "start_tls": true + } + }, + "fetch_interval": 0, + "lease_count": 0, + "lease_period": 0, + "max_send_attempts": 0, + "method": "string", + "retry_interval": 0, + "sync_buffer_size": 0, + "sync_interval": 0, + "webhook": { + "endpoint": { + "forceQuery": true, + "fragment": "string", + "host": "string", + "omitHost": true, + "opaque": "string", + "path": "string", + "rawFragment": "string", + "rawPath": "string", + "rawQuery": "string", + "scheme": "string", + "user": {} + } + } } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------- | -------------------------------------------------------------------------- | -------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|---------------------|----------------------------------------------------------------------------|----------|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `dispatch_timeout` | integer | false | | How long to wait while a notification is being sent before giving up. | | `email` | [codersdk.NotificationsEmailConfig](#codersdknotificationsemailconfig) | false | | Email settings. | | `fetch_interval` | integer | false | | How often to query the database for queued notifications. | @@ -3487,17 +3615,17 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "identity": "string", - "password": "string", - "password_file": "string", - "username": "string" + "identity": "string", + "password": "string", + "password_file": "string", + "username": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| --------------- | ------ | -------- | ------------ | ---------------------------------------------------------- | +|-----------------|--------|----------|--------------|------------------------------------------------------------| | `identity` | string | false | | Identity for PLAIN auth. | | `password` | string | false | | Password for LOGIN/PLAIN auth. | | `password_file` | string | false | | File from which to load the password for LOGIN/PLAIN auth. | @@ -3507,31 +3635,31 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "auth": { - "identity": "string", - "password": "string", - "password_file": "string", - "username": "string" - }, - "force_tls": true, - "from": "string", - "hello": "string", - "smarthost": "string", - "tls": { - "ca_file": "string", - "cert_file": "string", - "insecure_skip_verify": true, - "key_file": "string", - "server_name": "string", - "start_tls": true - } + "auth": { + "identity": "string", + "password": "string", + "password_file": "string", + "username": "string" + }, + "force_tls": true, + "from": "string", + "hello": "string", + "smarthost": "string", + "tls": { + "ca_file": "string", + "cert_file": "string", + "insecure_skip_verify": true, + "key_file": "string", + "server_name": "string", + "start_tls": true + } } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ----------- | ------------------------------------------------------------------------------ | -------- | ------------ | --------------------------------------------------------------------- | +|-------------|--------------------------------------------------------------------------------|----------|--------------|-----------------------------------------------------------------------| | `auth` | [codersdk.NotificationsEmailAuthConfig](#codersdknotificationsemailauthconfig) | false | | Authentication details. | | `force_tls` | boolean | false | | Force tls causes a TLS connection to be attempted. | | `from` | string | false | | The sender's address. | @@ -3543,19 +3671,19 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "ca_file": "string", - "cert_file": "string", - "insecure_skip_verify": true, - "key_file": "string", - "server_name": "string", - "start_tls": true + "ca_file": "string", + "cert_file": "string", + "insecure_skip_verify": true, + "key_file": "string", + "server_name": "string", + "start_tls": true } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------------------- | ------- | -------- | ------------ | ------------------------------------------------------------ | +|------------------------|---------|----------|--------------|--------------------------------------------------------------| | `ca_file` | string | false | | Ca file specifies the location of the CA certificate to use. | | `cert_file` | string | false | | Cert file specifies the location of the certificate to use. | | `insecure_skip_verify` | boolean | false | | Insecure skip verify skips target certificate validation. | @@ -3567,56 +3695,56 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "notifier_paused": true + "notifier_paused": true } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ----------------- | ------- | -------- | ------------ | ----------- | +|-------------------|---------|----------|--------------|-------------| | `notifier_paused` | boolean | false | | | ## codersdk.NotificationsWebhookConfig ```json { - "endpoint": { - "forceQuery": true, - "fragment": "string", - "host": "string", - "omitHost": true, - "opaque": "string", - "path": "string", - "rawFragment": "string", - "rawPath": "string", - "rawQuery": "string", - "scheme": "string", - "user": {} - } + "endpoint": { + "forceQuery": true, + "fragment": "string", + "host": "string", + "omitHost": true, + "opaque": "string", + "path": "string", + "rawFragment": "string", + "rawPath": "string", + "rawQuery": "string", + "scheme": "string", + "user": {} + } } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------- | -------------------------- | -------- | ------------ | -------------------------------------------------------------------- | +|------------|----------------------------|----------|--------------|----------------------------------------------------------------------| | `endpoint` | [serpent.URL](#serpenturl) | false | | The URL to which the payload will be sent with an HTTP POST request. | ## codersdk.OAuth2AppEndpoints ```json { - "authorization": "string", - "device_authorization": "string", - "token": "string" + "authorization": "string", + "device_authorization": "string", + "token": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------------------- | ------ | -------- | ------------ | --------------------------------- | +|------------------------|--------|----------|--------------|-----------------------------------| | `authorization` | string | false | | | | `device_authorization` | string | false | | Device authorization is optional. | | `token` | string | false | | | @@ -3625,42 +3753,50 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "github": { - "allow_everyone": true, - "allow_signups": true, - "allowed_orgs": ["string"], - "allowed_teams": ["string"], - "client_id": "string", - "client_secret": "string", - "enterprise_base_url": "string" - } + "github": { + "allow_everyone": true, + "allow_signups": true, + "allowed_orgs": [ + "string" + ], + "allowed_teams": [ + "string" + ], + "client_id": "string", + "client_secret": "string", + "enterprise_base_url": "string" + } } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------- | ---------------------------------------------------------- | -------- | ------------ | ----------- | +|----------|------------------------------------------------------------|----------|--------------|-------------| | `github` | [codersdk.OAuth2GithubConfig](#codersdkoauth2githubconfig) | false | | | ## codersdk.OAuth2GithubConfig ```json { - "allow_everyone": true, - "allow_signups": true, - "allowed_orgs": ["string"], - "allowed_teams": ["string"], - "client_id": "string", - "client_secret": "string", - "enterprise_base_url": "string" + "allow_everyone": true, + "allow_signups": true, + "allowed_orgs": [ + "string" + ], + "allowed_teams": [ + "string" + ], + "client_id": "string", + "client_secret": "string", + "enterprise_base_url": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| --------------------- | --------------- | -------- | ------------ | ----------- | +|-----------------------|-----------------|----------|--------------|-------------| | `allow_everyone` | boolean | false | | | | `allow_signups` | boolean | false | | | | `allowed_orgs` | array of string | false | | | @@ -3673,22 +3809,22 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "callback_url": "string", - "endpoints": { - "authorization": "string", - "device_authorization": "string", - "token": "string" - }, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "name": "string" + "callback_url": "string", + "endpoints": { + "authorization": "string", + "device_authorization": "string", + "token": "string" + }, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "name": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------- | ---------------------------------------------------------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|----------------|------------------------------------------------------------|----------|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `callback_url` | string | false | | | | `endpoints` | [codersdk.OAuth2AppEndpoints](#codersdkoauth2appendpoints) | false | | Endpoints are included in the app response for easier discovery. The OAuth2 spec does not have a defined place to find these (for comparison, OIDC has a '/.well-known/openid-configuration' endpoint). | | `icon` | string | false | | | @@ -3699,16 +3835,16 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "client_secret_truncated": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_used_at": "string" + "client_secret_truncated": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_used_at": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------------- | ------ | -------- | ------------ | ----------- | +|---------------------------|--------|----------|--------------|-------------| | `client_secret_truncated` | string | false | | | | `id` | string | false | | | | `last_used_at` | string | false | | | @@ -3717,15 +3853,15 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "client_secret_full": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08" + "client_secret_full": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------------- | ------ | -------- | ------------ | ----------- | +|----------------------|--------|----------|--------------|-------------| | `client_secret_full` | string | false | | | | `id` | string | false | | | @@ -3733,17 +3869,17 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "expires_at": "2019-08-24T14:15:22Z", - "state_string": "string", - "to_type": "", - "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5" + "expires_at": "2019-08-24T14:15:22Z", + "state_string": "string", + "to_type": "", + "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------- | ---------------------------------------- | -------- | ------------ | ----------- | +|----------------|------------------------------------------|----------|--------------|-------------| | `expires_at` | string | false | | | | `state_string` | string | false | | | | `to_type` | [codersdk.LoginType](#codersdklogintype) | false | | | @@ -3753,16 +3889,16 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "enabled": true, - "iconUrl": "string", - "signInText": "string" + "enabled": true, + "iconUrl": "string", + "signInText": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------ | ------- | -------- | ------------ | ----------- | +|--------------|---------|----------|--------------|-------------| | `enabled` | boolean | false | | | | `iconUrl` | string | false | | | | `signInText` | string | false | | | @@ -3771,54 +3907,62 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "allow_signups": true, - "auth_url_params": {}, - "client_cert_file": "string", - "client_id": "string", - "client_key_file": "string", - "client_secret": "string", - "email_domain": ["string"], - "email_field": "string", - "group_allow_list": ["string"], - "group_auto_create": true, - "group_mapping": {}, - "group_regex_filter": {}, - "groups_field": "string", - "icon_url": { - "forceQuery": true, - "fragment": "string", - "host": "string", - "omitHost": true, - "opaque": "string", - "path": "string", - "rawFragment": "string", - "rawPath": "string", - "rawQuery": "string", - "scheme": "string", - "user": {} - }, - "ignore_email_verified": true, - "ignore_user_info": true, - "issuer_url": "string", - "name_field": "string", - "organization_assign_default": true, - "organization_field": "string", - "organization_mapping": {}, - "scopes": ["string"], - "sign_in_text": "string", - "signups_disabled_text": "string", - "skip_issuer_checks": true, - "user_role_field": "string", - "user_role_mapping": {}, - "user_roles_default": ["string"], - "username_field": "string" + "allow_signups": true, + "auth_url_params": {}, + "client_cert_file": "string", + "client_id": "string", + "client_key_file": "string", + "client_secret": "string", + "email_domain": [ + "string" + ], + "email_field": "string", + "group_allow_list": [ + "string" + ], + "group_auto_create": true, + "group_mapping": {}, + "group_regex_filter": {}, + "groups_field": "string", + "icon_url": { + "forceQuery": true, + "fragment": "string", + "host": "string", + "omitHost": true, + "opaque": "string", + "path": "string", + "rawFragment": "string", + "rawPath": "string", + "rawQuery": "string", + "scheme": "string", + "user": {} + }, + "ignore_email_verified": true, + "ignore_user_info": true, + "issuer_url": "string", + "name_field": "string", + "organization_assign_default": true, + "organization_field": "string", + "organization_mapping": {}, + "scopes": [ + "string" + ], + "sign_in_text": "string", + "signups_disabled_text": "string", + "skip_issuer_checks": true, + "user_role_field": "string", + "user_role_mapping": {}, + "user_roles_default": [ + "string" + ], + "username_field": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ----------------------------- | -------------------------------- | -------- | ------------ | -------------------------------------------------------------------------------- | +|-------------------------------|----------------------------------|----------|--------------|----------------------------------------------------------------------------------| | `allow_signups` | boolean | false | | | | `auth_url_params` | object | false | | | | `client_cert_file` | string | false | | | @@ -3853,21 +3997,21 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "created_at": "2019-08-24T14:15:22Z", - "description": "string", - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "is_default": true, - "name": "string", - "updated_at": "2019-08-24T14:15:22Z" + "created_at": "2019-08-24T14:15:22Z", + "description": "string", + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "is_default": true, + "name": "string", + "updated_at": "2019-08-24T14:15:22Z" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------- | ------- | -------- | ------------ | ----------- | +|----------------|---------|----------|--------------|-------------| | `created_at` | string | true | | | | `description` | string | false | | | | `display_name` | string | false | | | @@ -3881,24 +4025,24 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "created_at": "2019-08-24T14:15:22Z", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "roles": [ - { - "display_name": "string", - "name": "string", - "organization_id": "string" - } - ], - "updated_at": "2019-08-24T14:15:22Z", - "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5" + "created_at": "2019-08-24T14:15:22Z", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "roles": [ + { + "display_name": "string", + "name": "string", + "organization_id": "string" + } + ], + "updated_at": "2019-08-24T14:15:22Z", + "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ----------------- | ----------------------------------------------- | -------- | ------------ | ----------- | +|-------------------|-------------------------------------------------|----------|--------------|-------------| | `created_at` | string | false | | | | `organization_id` | string | false | | | | `roles` | array of [codersdk.SlimRole](#codersdkslimrole) | false | | | @@ -3909,35 +4053,35 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "avatar_url": "string", - "created_at": "2019-08-24T14:15:22Z", - "email": "string", - "global_roles": [ - { - "display_name": "string", - "name": "string", - "organization_id": "string" - } - ], - "name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "roles": [ - { - "display_name": "string", - "name": "string", - "organization_id": "string" - } - ], - "updated_at": "2019-08-24T14:15:22Z", - "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5", - "username": "string" + "avatar_url": "string", + "created_at": "2019-08-24T14:15:22Z", + "email": "string", + "global_roles": [ + { + "display_name": "string", + "name": "string", + "organization_id": "string" + } + ], + "name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "roles": [ + { + "display_name": "string", + "name": "string", + "organization_id": "string" + } + ], + "updated_at": "2019-08-24T14:15:22Z", + "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5", + "username": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ----------------- | ----------------------------------------------- | -------- | ------------ | ----------- | +|-------------------|-------------------------------------------------|----------|--------------|-------------| | `avatar_url` | string | false | | | | `created_at` | string | false | | | | `email` | string | false | | | @@ -3953,19 +4097,23 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "field": "string", - "mapping": { - "property1": ["string"], - "property2": ["string"] - }, - "organization_assign_default": true + "field": "string", + "mapping": { + "property1": [ + "string" + ], + "property2": [ + "string" + ] + }, + "organization_assign_default": true } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ----------------------------- | --------------- | -------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|-------------------------------|-----------------|----------|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `field` | string | false | | Field selects the claim field to be used as the created user's organizations. If the field is the empty string, then no organization updates will ever come from the OIDC provider. | | `mapping` | object | false | | Mapping maps from an OIDC claim --> Coder organization uuid | | » `[any property]` | array of string | false | | | @@ -3975,19 +4123,23 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "add_users": ["string"], - "avatar_url": "string", - "display_name": "string", - "name": "string", - "quota_allowance": 0, - "remove_users": ["string"] + "add_users": [ + "string" + ], + "avatar_url": "string", + "display_name": "string", + "name": "string", + "quota_allowance": 0, + "remove_users": [ + "string" + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ----------------- | --------------- | -------- | ------------ | ----------- | +|-------------------|-----------------|----------|--------------|-------------| | `add_users` | array of string | false | | | | `avatar_url` | string | false | | | | `display_name` | string | false | | | @@ -3999,15 +4151,15 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "message": "string", - "name": "string" + "message": "string", + "name": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| --------- | ------ | -------- | ------------ | ----------- | +|-----------|--------|----------|--------------|-------------| | `message` | string | false | | | | `name` | string | false | | | @@ -4015,18 +4167,18 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "name": "string", - "regenerate_token": true + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "name": "string", + "regenerate_token": true } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------ | ------- | -------- | ------------ | ----------- | +|--------------------|---------|----------|--------------|-------------| | `display_name` | string | true | | | | `icon` | string | true | | | | `id` | string | true | | | @@ -4037,16 +4189,16 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "action": "application_connect", - "negate": true, - "resource_type": "*" + "action": "application_connect", + "negate": true, + "resource_type": "*" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| --------------- | ---------------------------------------------- | -------- | ------------ | --------------------------------------- | +|-----------------|------------------------------------------------|----------|--------------|-----------------------------------------| | `action` | [codersdk.RBACAction](#codersdkrbacaction) | false | | | | `negate` | boolean | false | | Negate makes this a negative permission | | `resource_type` | [codersdk.RBACResource](#codersdkrbacresource) | false | | | @@ -4055,16 +4207,16 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "callback_url": "string", - "icon": "string", - "name": "string" + "callback_url": "string", + "icon": "string", + "name": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------- | ------ | -------- | ------------ | ----------- | +|----------------|--------|----------|--------------|-------------| | `callback_url` | string | true | | | | `icon` | string | false | | | | `name` | string | true | | | @@ -4073,15 +4225,15 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978", - "app_name": "vscode" + "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978", + "app_name": "vscode" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------- | ---------------------------------------------- | -------- | ------------ | ----------- | +|------------|------------------------------------------------|----------|--------------|-------------| | `agent_id` | string | false | | | | `app_name` | [codersdk.UsageAppName](#codersdkusageappname) | false | | | @@ -4089,18 +4241,18 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "address": { - "host": "string", - "port": "string" - }, - "enable": true + "address": { + "host": "string", + "port": "string" + }, + "enable": true } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| --------- | ------------------------------------ | -------- | ------------ | ----------- | +|-----------|--------------------------------------|----------|--------------|-------------| | `address` | [serpent.HostPort](#serpenthostport) | false | | | | `enable` | boolean | false | | | @@ -4108,21 +4260,23 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "address": { - "host": "string", - "port": "string" - }, - "aggregate_agent_stats_by": ["string"], - "collect_agent_stats": true, - "collect_db_metrics": true, - "enable": true + "address": { + "host": "string", + "port": "string" + }, + "aggregate_agent_stats_by": [ + "string" + ], + "collect_agent_stats": true, + "collect_db_metrics": true, + "enable": true } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------------------- | ------------------------------------ | -------- | ------------ | ----------- | +|----------------------------|--------------------------------------|----------|--------------|-------------| | `address` | [serpent.HostPort](#serpenthostport) | false | | | | `aggregate_agent_stats_by` | array of string | false | | | | `collect_agent_stats` | boolean | false | | | @@ -4133,19 +4287,21 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "daemon_poll_interval": 0, - "daemon_poll_jitter": 0, - "daemon_psk": "string", - "daemon_types": ["string"], - "daemons": 0, - "force_cancel_interval": 0 + "daemon_poll_interval": 0, + "daemon_poll_jitter": 0, + "daemon_psk": "string", + "daemon_types": [ + "string" + ], + "daemons": 0, + "force_cancel_interval": 0 } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ----------------------- | --------------- | -------- | ------------ | --------------------------------------------------------- | +|-------------------------|-----------------|----------|--------------|-----------------------------------------------------------| | `daemon_poll_interval` | integer | false | | | | `daemon_poll_jitter` | integer | false | | | | `daemon_psk` | string | false | | | @@ -4157,26 +4313,28 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "api_version": "string", - "created_at": "2019-08-24T14:15:22Z", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "key_id": "1e779c8a-6786-4c89-b7c3-a6666f5fd6b5", - "last_seen_at": "2019-08-24T14:15:22Z", - "name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "provisioners": ["string"], - "tags": { - "property1": "string", - "property2": "string" - }, - "version": "string" + "api_version": "string", + "created_at": "2019-08-24T14:15:22Z", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "key_id": "1e779c8a-6786-4c89-b7c3-a6666f5fd6b5", + "last_seen_at": "2019-08-24T14:15:22Z", + "name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "provisioners": [ + "string" + ], + "tags": { + "property1": "string", + "property2": "string" + }, + "version": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------ | --------------- | -------- | ------------ | ----------- | +|--------------------|-----------------|----------|--------------|-------------| | `api_version` | string | false | | | | `created_at` | string | false | | | | `id` | string | false | | | @@ -4193,29 +4351,29 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "canceled_at": "2019-08-24T14:15:22Z", - "completed_at": "2019-08-24T14:15:22Z", - "created_at": "2019-08-24T14:15:22Z", - "error": "string", - "error_code": "REQUIRED_TEMPLATE_VARIABLES", - "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "queue_position": 0, - "queue_size": 0, - "started_at": "2019-08-24T14:15:22Z", - "status": "pending", - "tags": { - "property1": "string", - "property2": "string" - }, - "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" + "canceled_at": "2019-08-24T14:15:22Z", + "completed_at": "2019-08-24T14:15:22Z", + "created_at": "2019-08-24T14:15:22Z", + "error": "string", + "error_code": "REQUIRED_TEMPLATE_VARIABLES", + "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "queue_position": 0, + "queue_size": 0, + "started_at": "2019-08-24T14:15:22Z", + "status": "pending", + "tags": { + "property1": "string", + "property2": "string" + }, + "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------ | -------------------------------------------------------------- | -------- | ------------ | ----------- | +|--------------------|----------------------------------------------------------------|----------|--------------|-------------| | `canceled_at` | string | false | | | | `completed_at` | string | false | | | | `created_at` | string | false | | | @@ -4234,7 +4392,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o #### Enumerated Values | Property | Value | -| ------------ | ----------------------------- | +|--------------|-------------------------------| | `error_code` | `REQUIRED_TEMPLATE_VARIABLES` | | `status` | `pending` | | `status` | `running` | @@ -4247,19 +4405,19 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "created_at": "2019-08-24T14:15:22Z", - "id": 0, - "log_level": "trace", - "log_source": "provisioner_daemon", - "output": "string", - "stage": "string" + "created_at": "2019-08-24T14:15:22Z", + "id": 0, + "log_level": "trace", + "log_source": "provisioner_daemon", + "output": "string", + "stage": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------ | ---------------------------------------- | -------- | ------------ | ----------- | +|--------------|------------------------------------------|----------|--------------|-------------| | `created_at` | string | false | | | | `id` | integer | false | | | | `log_level` | [codersdk.LogLevel](#codersdkloglevel) | false | | | @@ -4270,7 +4428,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o #### Enumerated Values | Property | Value | -| ----------- | ------- | +|-------------|---------| | `log_level` | `trace` | | `log_level` | `debug` | | `log_level` | `info` | @@ -4288,7 +4446,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o #### Enumerated Values | Value | -| ----------- | +|-------------| | `pending` | | `running` | | `succeeded` | @@ -4301,21 +4459,21 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "created_at": "2019-08-24T14:15:22Z", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "name": "string", - "organization": "452c1a86-a0af-475b-b03f-724878b0f387", - "tags": { - "property1": "string", - "property2": "string" - } + "created_at": "2019-08-24T14:15:22Z", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "name": "string", + "organization": "452c1a86-a0af-475b-b03f-724878b0f387", + "tags": { + "property1": "string", + "property2": "string" + } } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------- | ---------------------------------------------------------- | -------- | ------------ | ----------- | +|----------------|------------------------------------------------------------|----------|--------------|-------------| | `created_at` | string | false | | | | `id` | string | false | | | | `name` | string | false | | | @@ -4326,40 +4484,42 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "daemons": [ - { - "api_version": "string", - "created_at": "2019-08-24T14:15:22Z", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "key_id": "1e779c8a-6786-4c89-b7c3-a6666f5fd6b5", - "last_seen_at": "2019-08-24T14:15:22Z", - "name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "provisioners": ["string"], - "tags": { - "property1": "string", - "property2": "string" - }, - "version": "string" - } - ], - "key": { - "created_at": "2019-08-24T14:15:22Z", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "name": "string", - "organization": "452c1a86-a0af-475b-b03f-724878b0f387", - "tags": { - "property1": "string", - "property2": "string" - } - } + "daemons": [ + { + "api_version": "string", + "created_at": "2019-08-24T14:15:22Z", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "key_id": "1e779c8a-6786-4c89-b7c3-a6666f5fd6b5", + "last_seen_at": "2019-08-24T14:15:22Z", + "name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "provisioners": [ + "string" + ], + "tags": { + "property1": "string", + "property2": "string" + }, + "version": "string" + } + ], + "key": { + "created_at": "2019-08-24T14:15:22Z", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "name": "string", + "organization": "452c1a86-a0af-475b-b03f-724878b0f387", + "tags": { + "property1": "string", + "property2": "string" + } + } } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| --------- | ----------------------------------------------------------------- | -------- | ------------ | ----------- | +|-----------|-------------------------------------------------------------------|----------|--------------|-------------| | `daemons` | array of [codersdk.ProvisionerDaemon](#codersdkprovisionerdaemon) | false | | | | `key` | [codersdk.ProvisionerKey](#codersdkprovisionerkey) | false | | | @@ -4367,15 +4527,15 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "property1": "string", - "property2": "string" + "property1": "string", + "property2": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------------- | ------ | -------- | ------------ | ----------- | +|------------------|--------|----------|--------------|-------------| | `[any property]` | string | false | | | ## codersdk.ProvisionerLogLevel @@ -4389,7 +4549,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o #### Enumerated Values | Value | -| ------- | +|---------| | `debug` | ## codersdk.ProvisionerStorageMethod @@ -4403,27 +4563,27 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o #### Enumerated Values | Value | -| ------ | +|--------| | `file` | ## codersdk.ProvisionerTiming ```json { - "action": "string", - "ended_at": "2019-08-24T14:15:22Z", - "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", - "resource": "string", - "source": "string", - "stage": "init", - "started_at": "2019-08-24T14:15:22Z" + "action": "string", + "ended_at": "2019-08-24T14:15:22Z", + "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", + "resource": "string", + "source": "string", + "stage": "init", + "started_at": "2019-08-24T14:15:22Z" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------ | -------------------------------------------- | -------- | ------------ | ----------- | +|--------------|----------------------------------------------|----------|--------------|-------------| | `action` | string | false | | | | `ended_at` | string | false | | | | `job_id` | string | false | | | @@ -4436,15 +4596,19 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "errors": ["string"], - "warnings": ["string"] + "errors": [ + "string" + ], + "warnings": [ + "string" + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------- | --------------- | -------- | ------------ | ---------------------------------------------------------------------------------------- | +|------------|-----------------|----------|--------------|------------------------------------------------------------------------------------------| | `errors` | array of string | false | | Errors are problems that prevent the workspace proxy from being healthy | | `warnings` | array of string | false | | Warnings do not prevent the workspace proxy from being healthy, but should be addressed. | @@ -4459,7 +4623,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o #### Enumerated Values | Value | -| -------------- | +|----------------| | `ok` | | `unreachable` | | `unhealthy` | @@ -4469,30 +4633,30 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "deadline": "2019-08-24T14:15:22Z" + "deadline": "2019-08-24T14:15:22Z" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------- | ------ | -------- | ------------ | ----------- | +|------------|--------|----------|--------------|-------------| | `deadline` | string | true | | | ## codersdk.PutOAuth2ProviderAppRequest ```json { - "callback_url": "string", - "icon": "string", - "name": "string" + "callback_url": "string", + "icon": "string", + "name": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------- | ------ | -------- | ------------ | ----------- | +|----------------|--------|----------|--------------|-------------| | `callback_url` | string | true | | | | `icon` | string | false | | | | `name` | string | true | | | @@ -4508,7 +4672,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o #### Enumerated Values | Value | -| --------------------- | +|-----------------------| | `application_connect` | | `assign` | | `create` | @@ -4534,7 +4698,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o #### Enumerated Values | Value | -| ------------------------- | +|---------------------------| | `*` | | `api_key` | | `assign_org_role` | @@ -4572,15 +4736,15 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "api": 0, - "disable_all": true + "api": 0, + "disable_all": true } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------- | ------- | -------- | ------------ | ----------- | +|---------------|---------|----------|--------------|-------------| | `api` | integer | false | | | | `disable_all` | boolean | false | | | @@ -4588,24 +4752,24 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "avatar_url": "http://example.com", - "created_at": "2019-08-24T14:15:22Z", - "email": "user@example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_seen_at": "2019-08-24T14:15:22Z", - "login_type": "", - "name": "string", - "status": "active", - "theme_preference": "string", - "updated_at": "2019-08-24T14:15:22Z", - "username": "string" + "avatar_url": "http://example.com", + "created_at": "2019-08-24T14:15:22Z", + "email": "user@example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_seen_at": "2019-08-24T14:15:22Z", + "login_type": "", + "name": "string", + "status": "active", + "theme_preference": "string", + "updated_at": "2019-08-24T14:15:22Z", + "username": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------ | ------------------------------------------ | -------- | ------------ | ----------- | +|--------------------|--------------------------------------------|----------|--------------|-------------| | `avatar_url` | string | false | | | | `created_at` | string | true | | | | `email` | string | true | | | @@ -4621,7 +4785,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o #### Enumerated Values | Property | Value | -| -------- | ----------- | +|----------|-------------| | `status` | `active` | | `status` | `suspended` | @@ -4629,108 +4793,112 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "display_name": "string", - "healthy": true, - "icon_url": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "name": "string", - "path_app_url": "string", - "wildcard_hostname": "string" + "display_name": "string", + "healthy": true, + "icon_url": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "name": "string", + "path_app_url": "string", + "wildcard_hostname": "string" } ``` ### Properties -| Name | Type | Required | Restrictions | Description | -| ------------------- | ------- | -------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `display_name` | string | false | | | -| `healthy` | boolean | false | | | -| `icon_url` | string | false | | | -| `id` | string | false | | | -| `name` | string | false | | | -| `path_app_url` | string | false | | Path app URL is the URL to the base path for path apps. Optional unless wildcard_hostname is set. E.g. https://us.example.com | -| `wildcard_hostname` | string | false | | Wildcard hostname is the wildcard hostname for subdomain apps. E.g. _.us.example.com E.g. _--suffix.au.example.com Optional. Does not need to be on the same domain as PathAppURL. | +| Name | Type | Required | Restrictions | Description | +|---------------------|---------|----------|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `display_name` | string | false | | | +| `healthy` | boolean | false | | | +| `icon_url` | string | false | | | +| `id` | string | false | | | +| `name` | string | false | | | +| `path_app_url` | string | false | | Path app URL is the URL to the base path for path apps. Optional unless wildcard_hostname is set. E.g. https://us.example.com | +| `wildcard_hostname` | string | false | | Wildcard hostname is the wildcard hostname for subdomain apps. E.g. *.us.example.com E.g.*--suffix.au.example.com Optional. Does not need to be on the same domain as PathAppURL. | ## codersdk.RegionsResponse-codersdk_Region ```json { - "regions": [ - { - "display_name": "string", - "healthy": true, - "icon_url": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "name": "string", - "path_app_url": "string", - "wildcard_hostname": "string" - } - ] + "regions": [ + { + "display_name": "string", + "healthy": true, + "icon_url": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "name": "string", + "path_app_url": "string", + "wildcard_hostname": "string" + } + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| --------- | ------------------------------------------- | -------- | ------------ | ----------- | +|-----------|---------------------------------------------|----------|--------------|-------------| | `regions` | array of [codersdk.Region](#codersdkregion) | false | | | ## codersdk.RegionsResponse-codersdk_WorkspaceProxy ```json { - "regions": [ - { - "created_at": "2019-08-24T14:15:22Z", - "deleted": true, - "derp_enabled": true, - "derp_only": true, - "display_name": "string", - "healthy": true, - "icon_url": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "name": "string", - "path_app_url": "string", - "status": { - "checked_at": "2019-08-24T14:15:22Z", - "report": { - "errors": ["string"], - "warnings": ["string"] - }, - "status": "ok" - }, - "updated_at": "2019-08-24T14:15:22Z", - "version": "string", - "wildcard_hostname": "string" - } - ] + "regions": [ + { + "created_at": "2019-08-24T14:15:22Z", + "deleted": true, + "derp_enabled": true, + "derp_only": true, + "display_name": "string", + "healthy": true, + "icon_url": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "name": "string", + "path_app_url": "string", + "status": { + "checked_at": "2019-08-24T14:15:22Z", + "report": { + "errors": [ + "string" + ], + "warnings": [ + "string" + ] + }, + "status": "ok" + }, + "updated_at": "2019-08-24T14:15:22Z", + "version": "string", + "wildcard_hostname": "string" + } + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| --------- | ----------------------------------------------------------- | -------- | ------------ | ----------- | +|-----------|-------------------------------------------------------------|----------|--------------|-------------| | `regions` | array of [codersdk.WorkspaceProxy](#codersdkworkspaceproxy) | false | | | ## codersdk.Replica ```json { - "created_at": "2019-08-24T14:15:22Z", - "database_latency": 0, - "error": "string", - "hostname": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "region_id": 0, - "relay_address": "string" + "created_at": "2019-08-24T14:15:22Z", + "database_latency": 0, + "error": "string", + "hostname": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "region_id": 0, + "relay_address": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------ | ------- | -------- | ------------ | ------------------------------------------------------------------ | +|--------------------|---------|----------|--------------|--------------------------------------------------------------------| | `created_at` | string | false | | Created at is the timestamp when the replica was first seen. | | `database_latency` | integer | false | | Database latency is the latency in microseconds to the database. | | `error` | string | false | | Error is the replica error. | @@ -4743,28 +4911,28 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "email": "user@example.com" + "email": "user@example.com" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------- | ------ | -------- | ------------ | ----------- | +|---------|--------|----------|--------------|-------------| | `email` | string | true | | | ## codersdk.ResolveAutostartResponse ```json { - "parameter_mismatch": true + "parameter_mismatch": true } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------------- | ------- | -------- | ------------ | ----------- | +|----------------------|---------|----------|--------------|-------------| | `parameter_mismatch` | boolean | false | | | ## codersdk.ResourceType @@ -4778,7 +4946,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o #### Enumerated Values | Value | -| -------------------------------- | +|----------------------------------| | `template` | | `template_version` | | `user` | @@ -4806,21 +4974,21 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "detail": "string", - "message": "string", - "validations": [ - { - "detail": "string", - "field": "string" - } - ] + "detail": "string", + "message": "string", + "validations": [ + { + "detail": "string", + "field": "string" + } + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------- | ------------------------------------------------------------- | -------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|---------------|---------------------------------------------------------------|----------|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `detail` | string | false | | Detail is a debug message that provides further insight into why the action failed. This information can be technical and a regular golang err.Error() text. - "database: too many open connections" - "stat: too many open files" | | `message` | string | false | | Message is an actionable message that depicts actions the request took. These messages should be fully formed sentences with proper punctuation. Examples: - "A user has been created." - "Failed to create a user." | | `validations` | array of [codersdk.ValidationError](#codersdkvalidationerror) | false | | Validations are form field-specific friendly error messages. They will be shown on a form field in the UI. These can also be used to add additional context if there is a set of errors in the primary 'Message'. | @@ -4829,37 +4997,37 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "display_name": "string", - "name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "organization_permissions": [ - { - "action": "application_connect", - "negate": true, - "resource_type": "*" - } - ], - "site_permissions": [ - { - "action": "application_connect", - "negate": true, - "resource_type": "*" - } - ], - "user_permissions": [ - { - "action": "application_connect", - "negate": true, - "resource_type": "*" - } - ] + "display_name": "string", + "name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "organization_permissions": [ + { + "action": "application_connect", + "negate": true, + "resource_type": "*" + } + ], + "site_permissions": [ + { + "action": "application_connect", + "negate": true, + "resource_type": "*" + } + ], + "user_permissions": [ + { + "action": "application_connect", + "negate": true, + "resource_type": "*" + } + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------------------- | --------------------------------------------------- | -------- | ------------ | ----------------------------------------------------------------------------------------------- | +|----------------------------|-----------------------------------------------------|----------|--------------|-------------------------------------------------------------------------------------------------| | `display_name` | string | false | | | | `name` | string | false | | | | `organization_id` | string | false | | | @@ -4871,18 +5039,22 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "field": "string", - "mapping": { - "property1": ["string"], - "property2": ["string"] - } + "field": "string", + "mapping": { + "property1": [ + "string" + ], + "property2": [ + "string" + ] + } } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------ | --------------- | -------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------- | +|--------------------|-----------------|----------|--------------|----------------------------------------------------------------------------------------------------------------------------------------| | `field` | string | false | | Field is the name of the claim field that specifies what organization roles a user should be given. If empty, no roles will be synced. | | `mapping` | object | false | | Mapping is a map from OIDC groups to Coder organization roles. | | » `[any property]` | array of string | false | | | @@ -4891,15 +5063,17 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "deploymentName": "string", - "sshconfigOptions": ["string"] + "deploymentName": "string", + "sshconfigOptions": [ + "string" + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------ | --------------- | -------- | ------------ | --------------------------------------------------------------------------------------------------- | +|--------------------|-----------------|----------|--------------|-----------------------------------------------------------------------------------------------------| | `deploymentName` | string | false | | Deploymentname is the config-ssh Hostname prefix | | `sshconfigOptions` | array of string | false | | Sshconfigoptions are additional options to add to the ssh config file. This will override defaults. | @@ -4907,18 +5081,18 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "hostname_prefix": "string", - "ssh_config_options": { - "property1": "string", - "property2": "string" - } + "hostname_prefix": "string", + "ssh_config_options": { + "property1": "string", + "property2": "string" + } } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------------- | ------ | -------- | ------------ | ----------- | +|----------------------|--------|----------|--------------|-------------| | `hostname_prefix` | string | false | | | | `ssh_config_options` | object | false | | | | » `[any property]` | string | false | | | @@ -4927,17 +5101,17 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "jetbrains": 0, - "reconnecting_pty": 0, - "ssh": 0, - "vscode": 0 + "jetbrains": 0, + "reconnecting_pty": 0, + "ssh": 0, + "vscode": 0 } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------ | ------- | -------- | ------------ | ----------- | +|--------------------|---------|----------|--------------|-------------| | `jetbrains` | integer | false | | | | `reconnecting_pty` | integer | false | | | | `ssh` | integer | false | | | @@ -4947,17 +5121,17 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "default_duration": 0, - "default_token_lifetime": 0, - "disable_expiry_refresh": true, - "max_token_lifetime": 0 + "default_duration": 0, + "default_token_lifetime": 0, + "disable_expiry_refresh": true, + "max_token_lifetime": 0 } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------------ | ------- | -------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|--------------------------|---------|----------|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `default_duration` | integer | false | | Default duration is only for browser, workspace app and oauth sessions. | | `default_token_lifetime` | integer | false | | | | `disable_expiry_refresh` | boolean | false | | Disable expiry refresh will disable automatically refreshing api keys when they are used from the api. This means the api key lifetime at creation is the lifetime of the api key. | @@ -4967,16 +5141,16 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "display_name": "string", - "name": "string", - "organization_id": "string" + "display_name": "string", + "name": "string", + "organization_id": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ----------------- | ------ | -------- | ------------ | ----------- | +|-------------------|--------|----------|--------------|-------------| | `display_name` | string | false | | | | `name` | string | false | | | | `organization_id` | string | false | | | @@ -4985,64 +5159,70 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "links": { - "value": [ - { - "icon": "bug", - "name": "string", - "target": "string" - } - ] - } + "links": { + "value": [ + { + "icon": "bug", + "name": "string", + "target": "string" + } + ] + } } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------- | ------------------------------------------------------------------------------------ | -------- | ------------ | ----------- | +|---------|--------------------------------------------------------------------------------------|----------|--------------|-------------| | `links` | [serpent.Struct-array_codersdk_LinkConfig](#serpentstruct-array_codersdk_linkconfig) | false | | | ## codersdk.SwaggerConfig ```json { - "enable": true + "enable": true } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------- | ------- | -------- | ------------ | ----------- | +|----------|---------|----------|--------------|-------------| | `enable` | boolean | false | | | ## codersdk.TLSConfig ```json { - "address": { - "host": "string", - "port": "string" - }, - "allow_insecure_ciphers": true, - "cert_file": ["string"], - "client_auth": "string", - "client_ca_file": "string", - "client_cert_file": "string", - "client_key_file": "string", - "enable": true, - "key_file": ["string"], - "min_version": "string", - "redirect_http": true, - "supported_ciphers": ["string"] + "address": { + "host": "string", + "port": "string" + }, + "allow_insecure_ciphers": true, + "cert_file": [ + "string" + ], + "client_auth": "string", + "client_ca_file": "string", + "client_cert_file": "string", + "client_key_file": "string", + "enable": true, + "key_file": [ + "string" + ], + "min_version": "string", + "redirect_http": true, + "supported_ciphers": [ + "string" + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------------ | ------------------------------------ | -------- | ------------ | ----------- | +|--------------------------|--------------------------------------|----------|--------------|-------------| | `address` | [serpent.HostPort](#serpenthostport) | false | | | | `allow_insecure_ciphers` | boolean | false | | | | `cert_file` | array of string | false | | | @@ -5060,28 +5240,28 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "enable": true, - "trace": true, - "url": { - "forceQuery": true, - "fragment": "string", - "host": "string", - "omitHost": true, - "opaque": "string", - "path": "string", - "rawFragment": "string", - "rawPath": "string", - "rawQuery": "string", - "scheme": "string", - "user": {} - } + "enable": true, + "trace": true, + "url": { + "forceQuery": true, + "fragment": "string", + "host": "string", + "omitHost": true, + "opaque": "string", + "path": "string", + "rawFragment": "string", + "rawPath": "string", + "rawQuery": "string", + "scheme": "string", + "user": {} + } } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------- | -------------------------- | -------- | ------------ | ----------- | +|----------|----------------------------|----------|--------------|-------------| | `enable` | boolean | false | | | | `trace` | boolean | false | | | | `url` | [serpent.URL](#serpenturl) | false | | | @@ -5090,58 +5270,62 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "active_user_count": 0, - "active_version_id": "eae64611-bd53-4a80-bb77-df1e432c0fbc", - "activity_bump_ms": 0, - "allow_user_autostart": true, - "allow_user_autostop": true, - "allow_user_cancel_workspace_jobs": true, - "autostart_requirement": { - "days_of_week": ["monday"] - }, - "autostop_requirement": { - "days_of_week": ["monday"], - "weeks": 0 - }, - "build_time_stats": { - "property1": { - "p50": 123, - "p95": 146 - }, - "property2": { - "p50": 123, - "p95": 146 - } - }, - "created_at": "2019-08-24T14:15:22Z", - "created_by_id": "9377d689-01fb-4abf-8450-3368d2c1924f", - "created_by_name": "string", - "default_ttl_ms": 0, - "deprecated": true, - "deprecation_message": "string", - "description": "string", - "display_name": "string", - "failure_ttl_ms": 0, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "max_port_share_level": "owner", - "name": "string", - "organization_display_name": "string", - "organization_icon": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "organization_name": "string", - "provisioner": "terraform", - "require_active_version": true, - "time_til_dormant_autodelete_ms": 0, - "time_til_dormant_ms": 0, - "updated_at": "2019-08-24T14:15:22Z" + "active_user_count": 0, + "active_version_id": "eae64611-bd53-4a80-bb77-df1e432c0fbc", + "activity_bump_ms": 0, + "allow_user_autostart": true, + "allow_user_autostop": true, + "allow_user_cancel_workspace_jobs": true, + "autostart_requirement": { + "days_of_week": [ + "monday" + ] + }, + "autostop_requirement": { + "days_of_week": [ + "monday" + ], + "weeks": 0 + }, + "build_time_stats": { + "property1": { + "p50": 123, + "p95": 146 + }, + "property2": { + "p50": 123, + "p95": 146 + } + }, + "created_at": "2019-08-24T14:15:22Z", + "created_by_id": "9377d689-01fb-4abf-8450-3368d2c1924f", + "created_by_name": "string", + "default_ttl_ms": 0, + "deprecated": true, + "deprecation_message": "string", + "description": "string", + "display_name": "string", + "failure_ttl_ms": 0, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "max_port_share_level": "owner", + "name": "string", + "organization_display_name": "string", + "organization_icon": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "organization_name": "string", + "provisioner": "terraform", + "require_active_version": true, + "time_til_dormant_autodelete_ms": 0, + "time_til_dormant_ms": 0, + "updated_at": "2019-08-24T14:15:22Z" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------------------------------- | ------------------------------------------------------------------------------ | -------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|------------------------------------|--------------------------------------------------------------------------------|----------|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `active_user_count` | integer | false | | Active user count is set to -1 when loading. | | `active_version_id` | string | false | | | | `activity_bump_ms` | integer | false | | | @@ -5177,27 +5361,29 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o #### Enumerated Values | Property | Value | -| ------------- | ----------- | +|---------------|-------------| | `provisioner` | `terraform` | ## codersdk.TemplateAppUsage ```json { - "display_name": "Visual Studio Code", - "icon": "string", - "seconds": 80500, - "slug": "vscode", - "template_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "times_used": 2, - "type": "builtin" + "display_name": "Visual Studio Code", + "icon": "string", + "seconds": 80500, + "slug": "vscode", + "template_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "times_used": 2, + "type": "builtin" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------- | ------------------------------------------------------ | -------- | ------------ | ----------- | +|----------------|--------------------------------------------------------|----------|--------------|-------------| | `display_name` | string | false | | | | `icon` | string | false | | | | `seconds` | integer | false | | | @@ -5217,7 +5403,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o #### Enumerated Values | Value | -| --------- | +|-----------| | `builtin` | | `app` | @@ -5225,72 +5411,78 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "days_of_week": ["monday"] + "days_of_week": [ + "monday" + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------- | --------------- | -------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------- | +|----------------|-----------------|----------|--------------|-----------------------------------------------------------------------------------------------------------------------------------------| | `days_of_week` | array of string | false | | Days of week is a list of days of the week in which autostart is allowed to happen. If no days are specified, autostart is not allowed. | ## codersdk.TemplateAutostopRequirement ```json { - "days_of_week": ["monday"], - "weeks": 0 + "days_of_week": [ + "monday" + ], + "weeks": 0 } ``` ### Properties -| Name | Type | Required | Restrictions | Description | -| ------------------------------------------------------------------------------------- | --------------- | -------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `days_of_week` | array of string | false | | Days of week is a list of days of the week on which restarts are required. Restarts happen within the user's quiet hours (in their configured timezone). If no days are specified, restarts are not required. Weekdays cannot be specified twice. | -| Restarts will only happen on weekdays in this list on weeks which line up with Weeks. | -| `weeks` | integer | false | | Weeks is the number of weeks between required restarts. Weeks are synced across all workspaces (and Coder deployments) using modulo math on a hardcoded epoch week of January 2nd, 2023 (the first Monday of 2023). Values of 0 or 1 indicate weekly restarts. Values of 2 indicate fortnightly restarts, etc. | +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|`days_of_week`|array of string|false||Days of week is a list of days of the week on which restarts are required. Restarts happen within the user's quiet hours (in their configured timezone). If no days are specified, restarts are not required. Weekdays cannot be specified twice. +Restarts will only happen on weekdays in this list on weeks which line up with Weeks.| +|`weeks`|integer|false||Weeks is the number of weeks between required restarts. Weeks are synced across all workspaces (and Coder deployments) using modulo math on a hardcoded epoch week of January 2nd, 2023 (the first Monday of 2023). Values of 0 or 1 indicate weekly restarts. Values of 2 indicate fortnightly restarts, etc.| ## codersdk.TemplateBuildTimeStats ```json { - "property1": { - "p50": 123, - "p95": 146 - }, - "property2": { - "p50": 123, - "p95": 146 - } + "property1": { + "p50": 123, + "p95": 146 + }, + "property2": { + "p50": 123, + "p95": 146 + } } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------------- | ---------------------------------------------------- | -------- | ------------ | ----------- | +|------------------|------------------------------------------------------|----------|--------------|-------------| | `[any property]` | [codersdk.TransitionStats](#codersdktransitionstats) | false | | | ## codersdk.TemplateExample ```json { - "description": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "markdown": "string", - "name": "string", - "tags": ["string"], - "url": "string" + "description": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "markdown": "string", + "name": "string", + "tags": [ + "string" + ], + "url": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------- | --------------- | -------- | ------------ | ----------- | +|---------------|-----------------|----------|--------------|-------------| | `description` | string | false | | | | `icon` | string | false | | | | `id` | string | false | | | @@ -5303,18 +5495,20 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "active_users": 14, - "end_time": "2019-08-24T14:15:22Z", - "interval": "week", - "start_time": "2019-08-24T14:15:22Z", - "template_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"] + "active_users": 14, + "end_time": "2019-08-24T14:15:22Z", + "interval": "week", + "start_time": "2019-08-24T14:15:22Z", + "template_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------- | ------------------------------------------------------------------ | -------- | ------------ | ----------- | +|----------------|--------------------------------------------------------------------|----------|--------------|-------------| | `active_users` | integer | false | | | | `end_time` | string | false | | | | `interval` | [codersdk.InsightsReportInterval](#codersdkinsightsreportinterval) | false | | | @@ -5325,51 +5519,57 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "active_users": 22, - "apps_usage": [ - { - "display_name": "Visual Studio Code", - "icon": "string", - "seconds": 80500, - "slug": "vscode", - "template_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "times_used": 2, - "type": "builtin" - } - ], - "end_time": "2019-08-24T14:15:22Z", - "parameters_usage": [ - { - "description": "string", - "display_name": "string", - "name": "string", - "options": [ - { - "description": "string", - "icon": "string", - "name": "string", - "value": "string" - } - ], - "template_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "type": "string", - "values": [ - { - "count": 0, - "value": "string" - } - ] - } - ], - "start_time": "2019-08-24T14:15:22Z", - "template_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"] + "active_users": 22, + "apps_usage": [ + { + "display_name": "Visual Studio Code", + "icon": "string", + "seconds": 80500, + "slug": "vscode", + "template_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "times_used": 2, + "type": "builtin" + } + ], + "end_time": "2019-08-24T14:15:22Z", + "parameters_usage": [ + { + "description": "string", + "display_name": "string", + "name": "string", + "options": [ + { + "description": "string", + "icon": "string", + "name": "string", + "value": "string" + } + ], + "template_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "type": "string", + "values": [ + { + "count": 0, + "value": "string" + } + ] + } + ], + "start_time": "2019-08-24T14:15:22Z", + "template_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------ | --------------------------------------------------------------------------- | -------- | ------------ | ----------- | +|--------------------|-----------------------------------------------------------------------------|----------|--------------|-------------| | `active_users` | integer | false | | | | `apps_usage` | array of [codersdk.TemplateAppUsage](#codersdktemplateappusage) | false | | | | `end_time` | string | false | | | @@ -5381,62 +5581,70 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "interval_reports": [ - { - "active_users": 14, - "end_time": "2019-08-24T14:15:22Z", - "interval": "week", - "start_time": "2019-08-24T14:15:22Z", - "template_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"] - } - ], - "report": { - "active_users": 22, - "apps_usage": [ - { - "display_name": "Visual Studio Code", - "icon": "string", - "seconds": 80500, - "slug": "vscode", - "template_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "times_used": 2, - "type": "builtin" - } - ], - "end_time": "2019-08-24T14:15:22Z", - "parameters_usage": [ - { - "description": "string", - "display_name": "string", - "name": "string", - "options": [ - { - "description": "string", - "icon": "string", - "name": "string", - "value": "string" - } - ], - "template_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "type": "string", - "values": [ - { - "count": 0, - "value": "string" - } - ] - } - ], - "start_time": "2019-08-24T14:15:22Z", - "template_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"] - } + "interval_reports": [ + { + "active_users": 14, + "end_time": "2019-08-24T14:15:22Z", + "interval": "week", + "start_time": "2019-08-24T14:15:22Z", + "template_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ] + } + ], + "report": { + "active_users": 22, + "apps_usage": [ + { + "display_name": "Visual Studio Code", + "icon": "string", + "seconds": 80500, + "slug": "vscode", + "template_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "times_used": 2, + "type": "builtin" + } + ], + "end_time": "2019-08-24T14:15:22Z", + "parameters_usage": [ + { + "description": "string", + "display_name": "string", + "name": "string", + "options": [ + { + "description": "string", + "icon": "string", + "name": "string", + "value": "string" + } + ], + "template_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "type": "string", + "values": [ + { + "count": 0, + "value": "string" + } + ] + } + ], + "start_time": "2019-08-24T14:15:22Z", + "template_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ] + } } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------ | ------------------------------------------------------------------------------------------- | -------- | ------------ | ----------- | +|--------------------|---------------------------------------------------------------------------------------------|----------|--------------|-------------| | `interval_reports` | array of [codersdk.TemplateInsightsIntervalReport](#codersdktemplateinsightsintervalreport) | false | | | | `report` | [codersdk.TemplateInsightsReport](#codersdktemplateinsightsreport) | false | | | @@ -5444,32 +5652,34 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "description": "string", - "display_name": "string", - "name": "string", - "options": [ - { - "description": "string", - "icon": "string", - "name": "string", - "value": "string" - } - ], - "template_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "type": "string", - "values": [ - { - "count": 0, - "value": "string" - } - ] + "description": "string", + "display_name": "string", + "name": "string", + "options": [ + { + "description": "string", + "icon": "string", + "name": "string", + "value": "string" + } + ], + "template_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "type": "string", + "values": [ + { + "count": 0, + "value": "string" + } + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------- | ------------------------------------------------------------------------------------------- | -------- | ------------ | ----------- | +|----------------|---------------------------------------------------------------------------------------------|----------|--------------|-------------| | `description` | string | false | | | | `display_name` | string | false | | | | `name` | string | false | | | @@ -5482,15 +5692,15 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "count": 0, - "value": "string" + "count": 0, + "value": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------- | ------- | -------- | ------------ | ----------- | +|---------|---------|----------|--------------|-------------| | `count` | integer | false | | | | `value` | string | false | | | @@ -5505,7 +5715,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o #### Enumerated Values | Value | -| ------- | +|---------| | `admin` | | `use` | | `` | @@ -5514,33 +5724,35 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "avatar_url": "http://example.com", - "created_at": "2019-08-24T14:15:22Z", - "email": "user@example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_seen_at": "2019-08-24T14:15:22Z", - "login_type": "", - "name": "string", - "organization_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "role": "admin", - "roles": [ - { - "display_name": "string", - "name": "string", - "organization_id": "string" - } - ], - "status": "active", - "theme_preference": "string", - "updated_at": "2019-08-24T14:15:22Z", - "username": "string" + "avatar_url": "http://example.com", + "created_at": "2019-08-24T14:15:22Z", + "email": "user@example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_seen_at": "2019-08-24T14:15:22Z", + "login_type": "", + "name": "string", + "organization_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "role": "admin", + "roles": [ + { + "display_name": "string", + "name": "string", + "organization_id": "string" + } + ], + "status": "active", + "theme_preference": "string", + "updated_at": "2019-08-24T14:15:22Z", + "username": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------ | ----------------------------------------------- | -------- | ------------ | ----------- | +|--------------------|-------------------------------------------------|----------|--------------|-------------| | `avatar_url` | string | false | | | | `created_at` | string | true | | | | `email` | string | true | | | @@ -5559,7 +5771,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o #### Enumerated Values | Property | Value | -| -------- | ----------- | +|----------|-------------| | `role` | `admin` | | `role` | `use` | | `status` | `active` | @@ -5569,51 +5781,53 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "archived": true, - "created_at": "2019-08-24T14:15:22Z", - "created_by": { - "avatar_url": "http://example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "username": "string" - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "job": { - "canceled_at": "2019-08-24T14:15:22Z", - "completed_at": "2019-08-24T14:15:22Z", - "created_at": "2019-08-24T14:15:22Z", - "error": "string", - "error_code": "REQUIRED_TEMPLATE_VARIABLES", - "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "queue_position": 0, - "queue_size": 0, - "started_at": "2019-08-24T14:15:22Z", - "status": "pending", - "tags": { - "property1": "string", - "property2": "string" - }, - "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" - }, - "matched_provisioners": { - "available": 0, - "count": 0, - "most_recently_seen": "2019-08-24T14:15:22Z" - }, - "message": "string", - "name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "readme": "string", - "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", - "updated_at": "2019-08-24T14:15:22Z", - "warnings": ["UNSUPPORTED_WORKSPACES"] + "archived": true, + "created_at": "2019-08-24T14:15:22Z", + "created_by": { + "avatar_url": "http://example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "username": "string" + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "job": { + "canceled_at": "2019-08-24T14:15:22Z", + "completed_at": "2019-08-24T14:15:22Z", + "created_at": "2019-08-24T14:15:22Z", + "error": "string", + "error_code": "REQUIRED_TEMPLATE_VARIABLES", + "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "queue_position": 0, + "queue_size": 0, + "started_at": "2019-08-24T14:15:22Z", + "status": "pending", + "tags": { + "property1": "string", + "property2": "string" + }, + "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" + }, + "matched_provisioners": { + "available": 0, + "count": 0, + "most_recently_seen": "2019-08-24T14:15:22Z" + }, + "message": "string", + "name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "readme": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "updated_at": "2019-08-24T14:15:22Z", + "warnings": [ + "UNSUPPORTED_WORKSPACES" + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------------------- | --------------------------------------------------------------------------- | -------- | ------------ | ----------- | +|------------------------|-----------------------------------------------------------------------------|----------|--------------|-------------| | `archived` | boolean | false | | | | `created_at` | string | false | | | | `created_by` | [codersdk.MinimalUser](#codersdkminimaluser) | false | | | @@ -5632,20 +5846,20 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "authenticate_url": "string", - "authenticated": true, - "display_icon": "string", - "display_name": "string", - "id": "string", - "optional": true, - "type": "string" + "authenticate_url": "string", + "authenticated": true, + "display_icon": "string", + "display_name": "string", + "id": "string", + "optional": true, + "type": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------ | ------- | -------- | ------------ | ----------- | +|--------------------|---------|----------|--------------|-------------| | `authenticate_url` | string | false | | | | `authenticated` | boolean | false | | | | `display_icon` | string | false | | | @@ -5658,36 +5872,36 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "default_value": "string", - "description": "string", - "description_plaintext": "string", - "display_name": "string", - "ephemeral": true, - "icon": "string", - "mutable": true, - "name": "string", - "options": [ - { - "description": "string", - "icon": "string", - "name": "string", - "value": "string" - } - ], - "required": true, - "type": "string", - "validation_error": "string", - "validation_max": 0, - "validation_min": 0, - "validation_monotonic": "increasing", - "validation_regex": "string" + "default_value": "string", + "description": "string", + "description_plaintext": "string", + "display_name": "string", + "ephemeral": true, + "icon": "string", + "mutable": true, + "name": "string", + "options": [ + { + "description": "string", + "icon": "string", + "name": "string", + "value": "string" + } + ], + "required": true, + "type": "string", + "validation_error": "string", + "validation_max": 0, + "validation_min": 0, + "validation_monotonic": "increasing", + "validation_regex": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ----------------------- | ------------------------------------------------------------------------------------------- | -------- | ------------ | ----------- | +|-------------------------|---------------------------------------------------------------------------------------------|----------|--------------|-------------| | `default_value` | string | false | | | | `description` | string | false | | | | `description_plaintext` | string | false | | | @@ -5708,7 +5922,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o #### Enumerated Values | Property | Value | -| ---------------------- | -------------- | +|------------------------|----------------| | `type` | `string` | | `type` | `number` | | `type` | `bool` | @@ -5720,17 +5934,17 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "description": "string", - "icon": "string", - "name": "string", - "value": "string" + "description": "string", + "icon": "string", + "name": "string", + "value": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------- | ------ | -------- | ------------ | ----------- | +|---------------|--------|----------|--------------|-------------| | `description` | string | false | | | | `icon` | string | false | | | | `name` | string | false | | | @@ -5740,20 +5954,20 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "default_value": "string", - "description": "string", - "name": "string", - "required": true, - "sensitive": true, - "type": "string", - "value": "string" + "default_value": "string", + "description": "string", + "name": "string", + "required": true, + "sensitive": true, + "type": "string", + "value": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| --------------- | ------- | -------- | ------------ | ----------- | +|-----------------|---------|----------|--------------|-------------| | `default_value` | string | false | | | | `description` | string | false | | | | `name` | string | false | | | @@ -5765,7 +5979,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o #### Enumerated Values | Property | Value | -| -------- | -------- | +|----------|----------| | `type` | `string` | | `type` | `number` | | `type` | `bool` | @@ -5781,7 +5995,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o #### Enumerated Values | Value | -| ------------------------ | +|--------------------------| | `UNSUPPORTED_WORKSPACES` | ## codersdk.TimingStage @@ -5795,7 +6009,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o #### Enumerated Values | Value | -| --------- | +|-----------| | `init` | | `plan` | | `graph` | @@ -5809,31 +6023,31 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "max_token_lifetime": 0 + "max_token_lifetime": 0 } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------------- | ------- | -------- | ------------ | ----------- | +|----------------------|---------|----------|--------------|-------------| | `max_token_lifetime` | integer | false | | | ## codersdk.TraceConfig ```json { - "capture_logs": true, - "data_dog": true, - "enable": true, - "honeycomb_api_key": "string" + "capture_logs": true, + "data_dog": true, + "enable": true, + "honeycomb_api_key": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------- | ------- | -------- | ------------ | ----------- | +|---------------------|---------|----------|--------------|-------------| | `capture_logs` | boolean | false | | | | `data_dog` | boolean | false | | | | `enable` | boolean | false | | | @@ -5843,15 +6057,15 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "p50": 123, - "p95": 146 + "p50": 123, + "p95": 146 } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ----- | ------- | -------- | ------------ | ----------- | +|-------|---------|----------|--------------|-------------| | `p50` | integer | false | | | | `p95` | integer | false | | | @@ -5859,41 +6073,41 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08" + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---- | ------ | -------- | ------------ | ----------- | +|------|--------|----------|--------------|-------------| | `id` | string | true | | | ## codersdk.UpdateAppearanceConfig ```json { - "announcement_banners": [ - { - "background_color": "string", - "enabled": true, - "message": "string" - } - ], - "application_name": "string", - "logo_url": "string", - "service_banner": { - "background_color": "string", - "enabled": true, - "message": "string" - } + "announcement_banners": [ + { + "background_color": "string", + "enabled": true, + "message": "string" + } + ], + "application_name": "string", + "logo_url": "string", + "service_banner": { + "background_color": "string", + "enabled": true, + "message": "string" + } } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------------------- | ------------------------------------------------------- | -------- | ------------ | ------------------------------------------------------------------- | +|------------------------|---------------------------------------------------------|----------|--------------|---------------------------------------------------------------------| | `announcement_banners` | array of [codersdk.BannerConfig](#codersdkbannerconfig) | false | | | | `application_name` | string | false | | | | `logo_url` | string | false | | | @@ -5903,16 +6117,16 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "current": true, - "url": "string", - "version": "string" + "current": true, + "url": "string", + "version": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| --------- | ------- | -------- | ------------ | ----------------------------------------------------------------------- | +|-----------|---------|----------|--------------|-------------------------------------------------------------------------| | `current` | boolean | false | | Current indicates whether the server version is the same as the latest. | | `url` | string | false | | URL to download the latest release of Coder. | | `version` | string | false | | Version is the semantic version for the latest release of Coder. | @@ -5921,17 +6135,17 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "description": "string", - "display_name": "string", - "icon": "string", - "name": "string" + "description": "string", + "display_name": "string", + "icon": "string", + "name": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------- | ------ | -------- | ------------ | ----------- | +|----------------|--------|----------|--------------|-------------| | `description` | string | false | | | | `display_name` | string | false | | | | `icon` | string | false | | | @@ -5941,35 +6155,37 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "roles": ["string"] + "roles": [ + "string" + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------- | --------------- | -------- | ------------ | ----------- | +|---------|-----------------|----------|--------------|-------------| | `roles` | array of string | false | | | ## codersdk.UpdateTemplateACL ```json { - "group_perms": { - "8bd26b20-f3e8-48be-a903-46bb920cf671": "use", - ">": "admin" - }, - "user_perms": { - "4df59e74-c027-470b-ab4d-cbba8963a5e9": "use", - "": "admin" - } + "group_perms": { + "8bd26b20-f3e8-48be-a903-46bb920cf671": "use", + ">": "admin" + }, + "user_perms": { + "4df59e74-c027-470b-ab4d-cbba8963a5e9": "use", + "": "admin" + } } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------ | ---------------------------------------------- | -------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------- | +|--------------------|------------------------------------------------|----------|--------------|-------------------------------------------------------------------------------------------------------------------------------| | `group_perms` | object | false | | Group perms should be a mapping of group ID to role. | | » `[any property]` | [codersdk.TemplateRole](#codersdktemplaterole) | false | | | | `user_perms` | object | false | | User perms should be a mapping of user ID to role. The user ID must be the uuid of the user, not a username or email address. | @@ -5979,31 +6195,31 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "theme_preference": "string" + "theme_preference": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------ | ------ | -------- | ------------ | ----------- | +|--------------------|--------|----------|--------------|-------------| | `theme_preference` | string | true | | | ## codersdk.UpdateUserNotificationPreferences ```json { - "template_disabled_map": { - "property1": true, - "property2": true - } + "template_disabled_map": { + "property1": true, + "property2": true + } } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ----------------------- | ------- | -------- | ------------ | ----------- | +|-------------------------|---------|----------|--------------|-------------| | `template_disabled_map` | object | false | | | | » `[any property]` | boolean | false | | | @@ -6011,15 +6227,15 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "old_password": "string", - "password": "string" + "old_password": "string", + "password": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------- | ------ | -------- | ------------ | ----------- | +|----------------|--------|----------|--------------|-------------| | `old_password` | string | false | | | | `password` | string | true | | | @@ -6027,15 +6243,15 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "name": "string", - "username": "string" + "name": "string", + "username": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------- | ------ | -------- | ------------ | ----------- | +|------------|--------|----------|--------------|-------------| | `name` | string | false | | | | `username` | string | true | | | @@ -6043,16 +6259,15 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o ```json { - "schedule": "string" + "schedule": "string" } ``` ### Properties -| Name | Type | Required | Restrictions | Description | -| ---------- | ------ | -------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `schedule` | string | true | | Schedule is a cron expression that defines when the user's quiet hours window is. Schedule must not be empty. For new users, the schedule is set to 2am in their browser or computer's timezone. The schedule denotes the beginning of a 4 hour window where the workspace is allowed to automatically stop or restart due to maintenance or template schedule. | - +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|`schedule`|string|true||Schedule is a cron expression that defines when the user's quiet hours window is. Schedule must not be empty. For new users, the schedule is set to 2am in their browser or computer's timezone. The schedule denotes the beginning of a 4 hour window where the workspace is allowed to automatically stop or restart due to maintenance or template schedule. The schedule must be daily with a single time, and should have a timezone specified via a CRON_TZ prefix (otherwise UTC will be used). If the schedule is empty, the user will be updated to use the default schedule.| @@ -6060,101 +6275,101 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "automatic_updates": "always" + "automatic_updates": "always" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------- | ------------------------------------------------------ | -------- | ------------ | ----------- | +|---------------------|--------------------------------------------------------|----------|--------------|-------------| | `automatic_updates` | [codersdk.AutomaticUpdates](#codersdkautomaticupdates) | false | | | ## codersdk.UpdateWorkspaceAutostartRequest ```json { - "schedule": "string" + "schedule": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------- | ------ | -------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|------------|--------|----------|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `schedule` | string | false | | Schedule is expected to be of the form `CRON_TZ= * * ` Example: `CRON_TZ=US/Central 30 9 * * 1-5` represents 0930 in the timezone US/Central on weekdays (Mon-Fri). `CRON_TZ` defaults to UTC if not present. | ## codersdk.UpdateWorkspaceDormancy ```json { - "dormant": true + "dormant": true } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| --------- | ------- | -------- | ------------ | ----------- | +|-----------|---------|----------|--------------|-------------| | `dormant` | boolean | false | | | ## codersdk.UpdateWorkspaceRequest ```json { - "name": "string" + "name": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------ | ------ | -------- | ------------ | ----------- | +|--------|--------|----------|--------------|-------------| | `name` | string | false | | | ## codersdk.UpdateWorkspaceTTLRequest ```json { - "ttl_ms": 0 + "ttl_ms": 0 } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------- | ------- | -------- | ------------ | ----------- | +|----------|---------|----------|--------------|-------------| | `ttl_ms` | integer | false | | | ## codersdk.UploadResponse ```json { - "hash": "19686d84-b10d-4f90-b18e-84fd3fa038fd" + "hash": "19686d84-b10d-4f90-b18e-84fd3fa038fd" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------ | ------ | -------- | ------------ | ----------- | +|--------|--------|----------|--------------|-------------| | `hash` | string | false | | | ## codersdk.UpsertWorkspaceAgentPortShareRequest ```json { - "agent_name": "string", - "port": 0, - "protocol": "http", - "share_level": "owner" + "agent_name": "string", + "port": 0, + "protocol": "http", + "share_level": "owner" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------- | ------------------------------------------------------------------------------------ | -------- | ------------ | ----------- | +|---------------|--------------------------------------------------------------------------------------|----------|--------------|-------------| | `agent_name` | string | false | | | | `port` | integer | false | | | | `protocol` | [codersdk.WorkspaceAgentPortShareProtocol](#codersdkworkspaceagentportshareprotocol) | false | | | @@ -6163,7 +6378,7 @@ If the schedule is empty, the user will be updated to use the default schedule.| #### Enumerated Values | Property | Value | -| ------------- | --------------- | +|---------------|-----------------| | `protocol` | `http` | | `protocol` | `https` | | `share_level` | `owner` | @@ -6181,7 +6396,7 @@ If the schedule is empty, the user will be updated to use the default schedule.| #### Enumerated Values | Value | -| ------------------ | +|--------------------| | `vscode` | | `jetbrains` | | `reconnecting-pty` | @@ -6191,32 +6406,34 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "avatar_url": "http://example.com", - "created_at": "2019-08-24T14:15:22Z", - "email": "user@example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_seen_at": "2019-08-24T14:15:22Z", - "login_type": "", - "name": "string", - "organization_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "roles": [ - { - "display_name": "string", - "name": "string", - "organization_id": "string" - } - ], - "status": "active", - "theme_preference": "string", - "updated_at": "2019-08-24T14:15:22Z", - "username": "string" + "avatar_url": "http://example.com", + "created_at": "2019-08-24T14:15:22Z", + "email": "user@example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_seen_at": "2019-08-24T14:15:22Z", + "login_type": "", + "name": "string", + "organization_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "roles": [ + { + "display_name": "string", + "name": "string", + "organization_id": "string" + } + ], + "status": "active", + "theme_preference": "string", + "updated_at": "2019-08-24T14:15:22Z", + "username": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------ | ----------------------------------------------- | -------- | ------------ | ----------- | +|--------------------|-------------------------------------------------|----------|--------------|-------------| | `avatar_url` | string | false | | | | `created_at` | string | true | | | | `email` | string | true | | | @@ -6234,7 +6451,7 @@ If the schedule is empty, the user will be updated to use the default schedule.| #### Enumerated Values | Property | Value | -| -------- | ----------- | +|----------|-------------| | `status` | `active` | | `status` | `suspended` | @@ -6242,18 +6459,20 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "avatar_url": "http://example.com", - "seconds": 80500, - "template_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5", - "username": "string" + "avatar_url": "http://example.com", + "seconds": 80500, + "template_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5", + "username": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------- | --------------- | -------- | ------------ | ----------- | +|----------------|-----------------|----------|--------------|-------------| | `avatar_url` | string | false | | | | `seconds` | integer | false | | | | `template_ids` | array of string | false | | | @@ -6264,25 +6483,29 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "end_time": "2019-08-24T14:15:22Z", - "start_time": "2019-08-24T14:15:22Z", - "template_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "users": [ - { - "avatar_url": "http://example.com", - "seconds": 80500, - "template_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5", - "username": "string" - } - ] + "end_time": "2019-08-24T14:15:22Z", + "start_time": "2019-08-24T14:15:22Z", + "template_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "users": [ + { + "avatar_url": "http://example.com", + "seconds": 80500, + "template_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5", + "username": "string" + } + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------- | ------------------------------------------------------- | -------- | ------------ | ----------- | +|----------------|---------------------------------------------------------|----------|--------------|-------------| | `end_time` | string | false | | | | `start_time` | string | false | | | | `template_ids` | array of string | false | | | @@ -6292,48 +6515,54 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "report": { - "end_time": "2019-08-24T14:15:22Z", - "start_time": "2019-08-24T14:15:22Z", - "template_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "users": [ - { - "avatar_url": "http://example.com", - "seconds": 80500, - "template_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5", - "username": "string" - } - ] - } + "report": { + "end_time": "2019-08-24T14:15:22Z", + "start_time": "2019-08-24T14:15:22Z", + "template_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "users": [ + { + "avatar_url": "http://example.com", + "seconds": 80500, + "template_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5", + "username": "string" + } + ] + } } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------- | -------------------------------------------------------------------------- | -------- | ------------ | ----------- | +|----------|----------------------------------------------------------------------------|----------|--------------|-------------| | `report` | [codersdk.UserActivityInsightsReport](#codersdkuseractivityinsightsreport) | false | | | ## codersdk.UserLatency ```json { - "avatar_url": "http://example.com", - "latency_ms": { - "p50": 31.312, - "p95": 119.832 - }, - "template_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5", - "username": "string" + "avatar_url": "http://example.com", + "latency_ms": { + "p50": 31.312, + "p95": 119.832 + }, + "template_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5", + "username": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------- | -------------------------------------------------------- | -------- | ------------ | ----------- | +|----------------|----------------------------------------------------------|----------|--------------|-------------| | `avatar_url` | string | false | | | | `latency_ms` | [codersdk.ConnectionLatency](#codersdkconnectionlatency) | false | | | | `template_ids` | array of string | false | | | @@ -6344,28 +6573,32 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "end_time": "2019-08-24T14:15:22Z", - "start_time": "2019-08-24T14:15:22Z", - "template_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "users": [ - { - "avatar_url": "http://example.com", - "latency_ms": { - "p50": 31.312, - "p95": 119.832 - }, - "template_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5", - "username": "string" - } - ] + "end_time": "2019-08-24T14:15:22Z", + "start_time": "2019-08-24T14:15:22Z", + "template_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "users": [ + { + "avatar_url": "http://example.com", + "latency_ms": { + "p50": 31.312, + "p95": 119.832 + }, + "template_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5", + "username": "string" + } + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------- | ----------------------------------------------------- | -------- | ------------ | ----------- | +|----------------|-------------------------------------------------------|----------|--------------|-------------| | `end_time` | string | false | | | | `start_time` | string | false | | | | `template_ids` | array of string | false | | | @@ -6375,59 +6608,63 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "report": { - "end_time": "2019-08-24T14:15:22Z", - "start_time": "2019-08-24T14:15:22Z", - "template_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "users": [ - { - "avatar_url": "http://example.com", - "latency_ms": { - "p50": 31.312, - "p95": 119.832 - }, - "template_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5", - "username": "string" - } - ] - } + "report": { + "end_time": "2019-08-24T14:15:22Z", + "start_time": "2019-08-24T14:15:22Z", + "template_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "users": [ + { + "avatar_url": "http://example.com", + "latency_ms": { + "p50": 31.312, + "p95": 119.832 + }, + "template_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5", + "username": "string" + } + ] + } } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------- | ------------------------------------------------------------------------ | -------- | ------------ | ----------- | +|----------|--------------------------------------------------------------------------|----------|--------------|-------------| | `report` | [codersdk.UserLatencyInsightsReport](#codersdkuserlatencyinsightsreport) | false | | | ## codersdk.UserLoginType ```json { - "login_type": "" + "login_type": "" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------ | ---------------------------------------- | -------- | ------------ | ----------- | +|--------------|------------------------------------------|----------|--------------|-------------| | `login_type` | [codersdk.LoginType](#codersdklogintype) | false | | | ## codersdk.UserParameter ```json { - "name": "string", - "value": "string" + "name": "string", + "value": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------- | ------ | -------- | ------------ | ----------- | +|---------|--------|----------|--------------|-------------| | `name` | string | false | | | | `value` | string | false | | | @@ -6435,15 +6672,15 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "allow_user_custom": true, - "default_schedule": "string" + "allow_user_custom": true, + "default_schedule": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------- | ------- | -------- | ------------ | ----------- | +|---------------------|---------|----------|--------------|-------------| | `allow_user_custom` | boolean | false | | | | `default_schedule` | string | false | | | @@ -6451,19 +6688,19 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "next": "2019-08-24T14:15:22Z", - "raw_schedule": "string", - "time": "string", - "timezone": "string", - "user_can_set": true, - "user_set": true + "next": "2019-08-24T14:15:22Z", + "raw_schedule": "string", + "time": "string", + "timezone": "string", + "user_can_set": true, + "user_set": true } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------- | ------- | -------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|----------------|---------|----------|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `next` | string | false | | Next is the next time that the quiet hours window will start. | | `raw_schedule` | string | false | | | | `time` | string | false | | Time is the time of day that the quiet hours window starts in the given Timezone each day. | @@ -6482,7 +6719,7 @@ If the schedule is empty, the user will be updated to use the default schedule.| #### Enumerated Values | Value | -| ----------- | +|-------------| | `active` | | `dormant` | | `suspended` | @@ -6491,29 +6728,29 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "password": "string" + "password": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------- | ------ | -------- | ------------ | ----------- | +|------------|--------|----------|--------------|-------------| | `password` | string | true | | | ## codersdk.ValidateUserPasswordResponse ```json { - "details": "string", - "valid": true + "details": "string", + "valid": true } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| --------- | ------- | -------- | ------------ | ----------- | +|-----------|---------|----------|--------------|-------------| | `details` | string | false | | | | `valid` | boolean | false | | | @@ -6521,15 +6758,15 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "detail": "string", - "field": "string" + "detail": "string", + "field": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------- | ------ | -------- | ------------ | ----------- | +|----------|--------|----------|--------------|-------------| | `detail` | string | true | | | | `field` | string | true | | | @@ -6544,7 +6781,7 @@ If the schedule is empty, the user will be updated to use the default schedule.| #### Enumerated Values | Value | -| ------------ | +|--------------| | `increasing` | | `decreasing` | @@ -6552,15 +6789,15 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "name": "string", - "value": "string" + "name": "string", + "value": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------- | ------ | -------- | ------------ | ----------- | +|---------|--------|----------|--------------|-------------| | `name` | string | false | | | | `value` | string | false | | | @@ -6568,205 +6805,212 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "allow_renames": true, - "automatic_updates": "always", - "autostart_schedule": "string", - "created_at": "2019-08-24T14:15:22Z", - "deleting_at": "2019-08-24T14:15:22Z", - "dormant_at": "2019-08-24T14:15:22Z", - "favorite": true, - "health": { - "failing_agents": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "healthy": false - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_used_at": "2019-08-24T14:15:22Z", - "latest_build": { - "build_number": 0, - "created_at": "2019-08-24T14:15:22Z", - "daily_cost": 0, - "deadline": "2019-08-24T14:15:22Z", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "initiator_id": "06588898-9a84-4b35-ba8f-f9cbd64946f3", - "initiator_name": "string", - "job": { - "canceled_at": "2019-08-24T14:15:22Z", - "completed_at": "2019-08-24T14:15:22Z", - "created_at": "2019-08-24T14:15:22Z", - "error": "string", - "error_code": "REQUIRED_TEMPLATE_VARIABLES", - "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "queue_position": 0, - "queue_size": 0, - "started_at": "2019-08-24T14:15:22Z", - "status": "pending", - "tags": { - "property1": "string", - "property2": "string" - }, - "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" - }, - "matched_provisioners": { - "available": 0, - "count": 0, - "most_recently_seen": "2019-08-24T14:15:22Z" - }, - "max_deadline": "2019-08-24T14:15:22Z", - "reason": "initiator", - "resources": [ - { - "agents": [ - { - "api_version": "string", - "apps": [ - { - "command": "string", - "display_name": "string", - "external": true, - "health": "disabled", - "healthcheck": { - "interval": 0, - "threshold": 0, - "url": "string" - }, - "hidden": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "sharing_level": "owner", - "slug": "string", - "subdomain": true, - "subdomain_name": "string", - "url": "string" - } - ], - "architecture": "string", - "connection_timeout_seconds": 0, - "created_at": "2019-08-24T14:15:22Z", - "directory": "string", - "disconnected_at": "2019-08-24T14:15:22Z", - "display_apps": ["vscode"], - "environment_variables": { - "property1": "string", - "property2": "string" - }, - "expanded_directory": "string", - "first_connected_at": "2019-08-24T14:15:22Z", - "health": { - "healthy": false, - "reason": "agent has lost connection" - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "instance_id": "string", - "last_connected_at": "2019-08-24T14:15:22Z", - "latency": { - "property1": { - "latency_ms": 0, - "preferred": true - }, - "property2": { - "latency_ms": 0, - "preferred": true - } - }, - "lifecycle_state": "created", - "log_sources": [ - { - "created_at": "2019-08-24T14:15:22Z", - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" - } - ], - "logs_length": 0, - "logs_overflowed": true, - "name": "string", - "operating_system": "string", - "ready_at": "2019-08-24T14:15:22Z", - "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", - "scripts": [ - { - "cron": "string", - "display_name": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "log_path": "string", - "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", - "run_on_start": true, - "run_on_stop": true, - "script": "string", - "start_blocks_login": true, - "timeout": 0 - } - ], - "started_at": "2019-08-24T14:15:22Z", - "startup_script_behavior": "blocking", - "status": "connecting", - "subsystems": ["envbox"], - "troubleshooting_url": "string", - "updated_at": "2019-08-24T14:15:22Z", - "version": "string" - } - ], - "created_at": "2019-08-24T14:15:22Z", - "daily_cost": 0, - "hide": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", - "metadata": [ - { - "key": "string", - "sensitive": true, - "value": "string" - } - ], - "name": "string", - "type": "string", - "workspace_transition": "start" - } - ], - "status": "pending", - "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", - "template_version_name": "string", - "transition": "start", - "updated_at": "2019-08-24T14:15:22Z", - "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", - "workspace_name": "string", - "workspace_owner_avatar_url": "string", - "workspace_owner_id": "e7078695-5279-4c86-8774-3ac2367a2fc7", - "workspace_owner_name": "string" - }, - "name": "string", - "next_start_at": "2019-08-24T14:15:22Z", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "organization_name": "string", - "outdated": true, - "owner_avatar_url": "string", - "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05", - "owner_name": "string", - "template_active_version_id": "b0da9c29-67d8-4c87-888c-bafe356f7f3c", - "template_allow_user_cancel_workspace_jobs": true, - "template_display_name": "string", - "template_icon": "string", - "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", - "template_name": "string", - "template_require_active_version": true, - "ttl_ms": 0, - "updated_at": "2019-08-24T14:15:22Z" + "allow_renames": true, + "automatic_updates": "always", + "autostart_schedule": "string", + "created_at": "2019-08-24T14:15:22Z", + "deleting_at": "2019-08-24T14:15:22Z", + "dormant_at": "2019-08-24T14:15:22Z", + "favorite": true, + "health": { + "failing_agents": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "healthy": false + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_used_at": "2019-08-24T14:15:22Z", + "latest_build": { + "build_number": 0, + "created_at": "2019-08-24T14:15:22Z", + "daily_cost": 0, + "deadline": "2019-08-24T14:15:22Z", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "initiator_id": "06588898-9a84-4b35-ba8f-f9cbd64946f3", + "initiator_name": "string", + "job": { + "canceled_at": "2019-08-24T14:15:22Z", + "completed_at": "2019-08-24T14:15:22Z", + "created_at": "2019-08-24T14:15:22Z", + "error": "string", + "error_code": "REQUIRED_TEMPLATE_VARIABLES", + "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "queue_position": 0, + "queue_size": 0, + "started_at": "2019-08-24T14:15:22Z", + "status": "pending", + "tags": { + "property1": "string", + "property2": "string" + }, + "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" + }, + "matched_provisioners": { + "available": 0, + "count": 0, + "most_recently_seen": "2019-08-24T14:15:22Z" + }, + "max_deadline": "2019-08-24T14:15:22Z", + "reason": "initiator", + "resources": [ + { + "agents": [ + { + "api_version": "string", + "apps": [ + { + "command": "string", + "display_name": "string", + "external": true, + "health": "disabled", + "healthcheck": { + "interval": 0, + "threshold": 0, + "url": "string" + }, + "hidden": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "open_in": "slim-window", + "sharing_level": "owner", + "slug": "string", + "subdomain": true, + "subdomain_name": "string", + "url": "string" + } + ], + "architecture": "string", + "connection_timeout_seconds": 0, + "created_at": "2019-08-24T14:15:22Z", + "directory": "string", + "disconnected_at": "2019-08-24T14:15:22Z", + "display_apps": [ + "vscode" + ], + "environment_variables": { + "property1": "string", + "property2": "string" + }, + "expanded_directory": "string", + "first_connected_at": "2019-08-24T14:15:22Z", + "health": { + "healthy": false, + "reason": "agent has lost connection" + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "instance_id": "string", + "last_connected_at": "2019-08-24T14:15:22Z", + "latency": { + "property1": { + "latency_ms": 0, + "preferred": true + }, + "property2": { + "latency_ms": 0, + "preferred": true + } + }, + "lifecycle_state": "created", + "log_sources": [ + { + "created_at": "2019-08-24T14:15:22Z", + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" + } + ], + "logs_length": 0, + "logs_overflowed": true, + "name": "string", + "operating_system": "string", + "ready_at": "2019-08-24T14:15:22Z", + "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", + "scripts": [ + { + "cron": "string", + "display_name": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "log_path": "string", + "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", + "run_on_start": true, + "run_on_stop": true, + "script": "string", + "start_blocks_login": true, + "timeout": 0 + } + ], + "started_at": "2019-08-24T14:15:22Z", + "startup_script_behavior": "blocking", + "status": "connecting", + "subsystems": [ + "envbox" + ], + "troubleshooting_url": "string", + "updated_at": "2019-08-24T14:15:22Z", + "version": "string" + } + ], + "created_at": "2019-08-24T14:15:22Z", + "daily_cost": 0, + "hide": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", + "metadata": [ + { + "key": "string", + "sensitive": true, + "value": "string" + } + ], + "name": "string", + "type": "string", + "workspace_transition": "start" + } + ], + "status": "pending", + "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", + "template_version_name": "string", + "transition": "start", + "updated_at": "2019-08-24T14:15:22Z", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string", + "workspace_owner_avatar_url": "string", + "workspace_owner_id": "e7078695-5279-4c86-8774-3ac2367a2fc7", + "workspace_owner_name": "string" + }, + "name": "string", + "next_start_at": "2019-08-24T14:15:22Z", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "organization_name": "string", + "outdated": true, + "owner_avatar_url": "string", + "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05", + "owner_name": "string", + "template_active_version_id": "b0da9c29-67d8-4c87-888c-bafe356f7f3c", + "template_allow_user_cancel_workspace_jobs": true, + "template_display_name": "string", + "template_icon": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_require_active_version": true, + "ttl_ms": 0, + "updated_at": "2019-08-24T14:15:22Z" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------------------------------- | ------------------------------------------------------ | -------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|---------------------------------------------|--------------------------------------------------------|----------|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `allow_renames` | boolean | false | | | | `automatic_updates` | [codersdk.AutomaticUpdates](#codersdkautomaticupdates) | false | | | | `autostart_schedule` | string | false | | | | `created_at` | string | false | | | | `deleting_at` | string | false | | Deleting at indicates the time at which the workspace will be permanently deleted. A workspace is eligible for deletion if it is dormant (a non-nil dormant_at value) and a value has been specified for time_til_dormant_autodelete on its template. | -| `dormant_at` | string | false | | Dormant at being non-nil indicates a workspace that is dormant. A dormant workspace is no longer accessible must be activated. It is subject to deletion if it breaches the duration of the time*til* field on its template. | +| `dormant_at` | string | false | | Dormant at being non-nil indicates a workspace that is dormant. A dormant workspace is no longer accessible must be activated. It is subject to deletion if it breaches the duration of the time_til_ field on its template. | | `favorite` | boolean | false | | | | `health` | [codersdk.WorkspaceHealth](#codersdkworkspacehealth) | false | | Health shows the health of the workspace and information about what is causing an unhealthy status. | | `id` | string | false | | | @@ -6793,7 +7037,7 @@ If the schedule is empty, the user will be updated to use the default schedule.| #### Enumerated Values | Property | Value | -| ------------------- | -------- | +|---------------------|----------| | `automatic_updates` | `always` | | `automatic_updates` | `never` | @@ -6801,101 +7045,106 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "api_version": "string", - "apps": [ - { - "command": "string", - "display_name": "string", - "external": true, - "health": "disabled", - "healthcheck": { - "interval": 0, - "threshold": 0, - "url": "string" - }, - "hidden": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "sharing_level": "owner", - "slug": "string", - "subdomain": true, - "subdomain_name": "string", - "url": "string" - } - ], - "architecture": "string", - "connection_timeout_seconds": 0, - "created_at": "2019-08-24T14:15:22Z", - "directory": "string", - "disconnected_at": "2019-08-24T14:15:22Z", - "display_apps": ["vscode"], - "environment_variables": { - "property1": "string", - "property2": "string" - }, - "expanded_directory": "string", - "first_connected_at": "2019-08-24T14:15:22Z", - "health": { - "healthy": false, - "reason": "agent has lost connection" - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "instance_id": "string", - "last_connected_at": "2019-08-24T14:15:22Z", - "latency": { - "property1": { - "latency_ms": 0, - "preferred": true - }, - "property2": { - "latency_ms": 0, - "preferred": true - } - }, - "lifecycle_state": "created", - "log_sources": [ - { - "created_at": "2019-08-24T14:15:22Z", - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" - } - ], - "logs_length": 0, - "logs_overflowed": true, - "name": "string", - "operating_system": "string", - "ready_at": "2019-08-24T14:15:22Z", - "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", - "scripts": [ - { - "cron": "string", - "display_name": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "log_path": "string", - "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", - "run_on_start": true, - "run_on_stop": true, - "script": "string", - "start_blocks_login": true, - "timeout": 0 - } - ], - "started_at": "2019-08-24T14:15:22Z", - "startup_script_behavior": "blocking", - "status": "connecting", - "subsystems": ["envbox"], - "troubleshooting_url": "string", - "updated_at": "2019-08-24T14:15:22Z", - "version": "string" + "api_version": "string", + "apps": [ + { + "command": "string", + "display_name": "string", + "external": true, + "health": "disabled", + "healthcheck": { + "interval": 0, + "threshold": 0, + "url": "string" + }, + "hidden": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "open_in": "slim-window", + "sharing_level": "owner", + "slug": "string", + "subdomain": true, + "subdomain_name": "string", + "url": "string" + } + ], + "architecture": "string", + "connection_timeout_seconds": 0, + "created_at": "2019-08-24T14:15:22Z", + "directory": "string", + "disconnected_at": "2019-08-24T14:15:22Z", + "display_apps": [ + "vscode" + ], + "environment_variables": { + "property1": "string", + "property2": "string" + }, + "expanded_directory": "string", + "first_connected_at": "2019-08-24T14:15:22Z", + "health": { + "healthy": false, + "reason": "agent has lost connection" + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "instance_id": "string", + "last_connected_at": "2019-08-24T14:15:22Z", + "latency": { + "property1": { + "latency_ms": 0, + "preferred": true + }, + "property2": { + "latency_ms": 0, + "preferred": true + } + }, + "lifecycle_state": "created", + "log_sources": [ + { + "created_at": "2019-08-24T14:15:22Z", + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" + } + ], + "logs_length": 0, + "logs_overflowed": true, + "name": "string", + "operating_system": "string", + "ready_at": "2019-08-24T14:15:22Z", + "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", + "scripts": [ + { + "cron": "string", + "display_name": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "log_path": "string", + "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", + "run_on_start": true, + "run_on_stop": true, + "script": "string", + "start_blocks_login": true, + "timeout": 0 + } + ], + "started_at": "2019-08-24T14:15:22Z", + "startup_script_behavior": "blocking", + "status": "connecting", + "subsystems": [ + "envbox" + ], + "troubleshooting_url": "string", + "updated_at": "2019-08-24T14:15:22Z", + "version": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------------------------- | -------------------------------------------------------------------------------------------- | -------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|------------------------------|----------------------------------------------------------------------------------------------|----------|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `api_version` | string | false | | | | `apps` | array of [codersdk.WorkspaceApp](#codersdkworkspaceapp) | false | | | | `architecture` | string | false | | | @@ -6935,15 +7184,15 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "healthy": false, - "reason": "agent has lost connection" + "healthy": false, + "reason": "agent has lost connection" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| --------- | ------- | -------- | ------------ | --------------------------------------------------------------------------------------------- | +|-----------|---------|----------|--------------|-----------------------------------------------------------------------------------------------| | `healthy` | boolean | false | | Healthy is true if the agent is healthy. | | `reason` | string | false | | Reason is a human-readable explanation of the agent's health. It is empty if Healthy is true. | @@ -6958,7 +7207,7 @@ If the schedule is empty, the user will be updated to use the default schedule.| #### Enumerated Values | Value | -| ------------------ | +|--------------------| | `created` | | `starting` | | `start_timeout` | @@ -6973,16 +7222,16 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "network": "string", - "port": 0, - "process_name": "string" + "network": "string", + "port": 0, + "process_name": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------- | ------- | -------- | ------------ | ------------------------ | +|----------------|---------|----------|--------------|--------------------------| | `network` | string | false | | only "tcp" at the moment | | `port` | integer | false | | | | `process_name` | string | false | | may be empty | @@ -6991,38 +7240,38 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "ports": [ - { - "network": "string", - "port": 0, - "process_name": "string" - } - ] + "ports": [ + { + "network": "string", + "port": 0, + "process_name": "string" + } + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------- | ------------------------------------------------------------------------------------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +|---------|---------------------------------------------------------------------------------------|----------|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `ports` | array of [codersdk.WorkspaceAgentListeningPort](#codersdkworkspaceagentlisteningport) | false | | If there are no ports in the list, nothing should be displayed in the UI. There must not be a "no ports available" message or anything similar, as there will always be no ports displayed on platforms where our port detection logic is unsupported. | ## codersdk.WorkspaceAgentLog ```json { - "created_at": "2019-08-24T14:15:22Z", - "id": 0, - "level": "trace", - "output": "string", - "source_id": "ae50a35c-df42-4eff-ba26-f8bc28d2af81" + "created_at": "2019-08-24T14:15:22Z", + "id": 0, + "level": "trace", + "output": "string", + "source_id": "ae50a35c-df42-4eff-ba26-f8bc28d2af81" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------ | -------------------------------------- | -------- | ------------ | ----------- | +|--------------|----------------------------------------|----------|--------------|-------------| | `created_at` | string | false | | | | `id` | integer | false | | | | `level` | [codersdk.LogLevel](#codersdkloglevel) | false | | | @@ -7033,18 +7282,18 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "created_at": "2019-08-24T14:15:22Z", - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" + "created_at": "2019-08-24T14:15:22Z", + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------------- | ------ | -------- | ------------ | ----------- | +|----------------------|--------|----------|--------------|-------------| | `created_at` | string | false | | | | `display_name` | string | false | | | | `icon` | string | false | | | @@ -7055,18 +7304,18 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "agent_name": "string", - "port": 0, - "protocol": "http", - "share_level": "owner", - "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9" + "agent_name": "string", + "port": 0, + "protocol": "http", + "share_level": "owner", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------- | ------------------------------------------------------------------------------------ | -------- | ------------ | ----------- | +|----------------|--------------------------------------------------------------------------------------|----------|--------------|-------------| | `agent_name` | string | false | | | | `port` | integer | false | | | | `protocol` | [codersdk.WorkspaceAgentPortShareProtocol](#codersdkworkspaceagentportshareprotocol) | false | | | @@ -7076,7 +7325,7 @@ If the schedule is empty, the user will be updated to use the default schedule.| #### Enumerated Values | Property | Value | -| ------------- | --------------- | +|---------------|-----------------| | `protocol` | `http` | | `protocol` | `https` | | `share_level` | `owner` | @@ -7094,7 +7343,7 @@ If the schedule is empty, the user will be updated to use the default schedule.| #### Enumerated Values | Value | -| --------------- | +|-----------------| | `owner` | | `authenticated` | | `public` | @@ -7110,7 +7359,7 @@ If the schedule is empty, the user will be updated to use the default schedule.| #### Enumerated Values | Value | -| ------- | +|---------| | `http` | | `https` | @@ -7118,45 +7367,45 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "shares": [ - { - "agent_name": "string", - "port": 0, - "protocol": "http", - "share_level": "owner", - "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9" - } - ] + "shares": [ + { + "agent_name": "string", + "port": 0, + "protocol": "http", + "share_level": "owner", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9" + } + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------- | ----------------------------------------------------------------------------- | -------- | ------------ | ----------- | +|----------|-------------------------------------------------------------------------------|----------|--------------|-------------| | `shares` | array of [codersdk.WorkspaceAgentPortShare](#codersdkworkspaceagentportshare) | false | | | ## codersdk.WorkspaceAgentScript ```json { - "cron": "string", - "display_name": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "log_path": "string", - "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", - "run_on_start": true, - "run_on_stop": true, - "script": "string", - "start_blocks_login": true, - "timeout": 0 + "cron": "string", + "display_name": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "log_path": "string", + "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", + "run_on_start": true, + "run_on_stop": true, + "script": "string", + "start_blocks_login": true, + "timeout": 0 } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------------- | ------- | -------- | ------------ | ----------- | +|----------------------|---------|----------|--------------|-------------| | `cron` | string | false | | | | `display_name` | string | false | | | | `id` | string | false | | | @@ -7179,7 +7428,7 @@ If the schedule is empty, the user will be updated to use the default schedule.| #### Enumerated Values | Value | -| -------------- | +|----------------| | `blocking` | | `non-blocking` | @@ -7194,7 +7443,7 @@ If the schedule is empty, the user will be updated to use the default schedule.| #### Enumerated Values | Value | -| -------------- | +|----------------| | `connecting` | | `connected` | | `disconnected` | @@ -7204,30 +7453,31 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "command": "string", - "display_name": "string", - "external": true, - "health": "disabled", - "healthcheck": { - "interval": 0, - "threshold": 0, - "url": "string" - }, - "hidden": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "sharing_level": "owner", - "slug": "string", - "subdomain": true, - "subdomain_name": "string", - "url": "string" + "command": "string", + "display_name": "string", + "external": true, + "health": "disabled", + "healthcheck": { + "interval": 0, + "threshold": 0, + "url": "string" + }, + "hidden": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "open_in": "slim-window", + "sharing_level": "owner", + "slug": "string", + "subdomain": true, + "subdomain_name": "string", + "url": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------------- | ---------------------------------------------------------------------- | -------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|------------------|------------------------------------------------------------------------|----------|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `command` | string | false | | | | `display_name` | string | false | | Display name is a friendly name for the app. | | `external` | boolean | false | | External specifies whether the URL should be opened externally on the client or not. | @@ -7236,6 +7486,7 @@ If the schedule is empty, the user will be updated to use the default schedule.| | `hidden` | boolean | false | | | | `icon` | string | false | | Icon is a relative path or external URL that specifies an icon to be displayed in the dashboard. | | `id` | string | false | | | +| `open_in` | [codersdk.WorkspaceAppOpenIn](#codersdkworkspaceappopenin) | false | | | | `sharing_level` | [codersdk.WorkspaceAppSharingLevel](#codersdkworkspaceappsharinglevel) | false | | | | `slug` | string | false | | Slug is a unique identifier within the agent. | | `subdomain` | boolean | false | | Subdomain denotes whether the app should be accessed via a path on the `coder server` or via a hostname-based dev URL. If this is set to true and there is no app wildcard configured on the server, the app will not be accessible in the UI. | @@ -7245,7 +7496,7 @@ If the schedule is empty, the user will be updated to use the default schedule.| #### Enumerated Values | Property | Value | -| --------------- | --------------- | +|-----------------|-----------------| | `sharing_level` | `owner` | | `sharing_level` | `authenticated` | | `sharing_level` | `public` | @@ -7261,12 +7512,28 @@ If the schedule is empty, the user will be updated to use the default schedule.| #### Enumerated Values | Value | -| -------------- | +|----------------| | `disabled` | | `initializing` | | `healthy` | | `unhealthy` | +## codersdk.WorkspaceAppOpenIn + +```json +"slim-window" +``` + +### Properties + +#### Enumerated Values + +| Value | +|---------------| +| `slim-window` | +| `window` | +| `tab` | + ## codersdk.WorkspaceAppSharingLevel ```json @@ -7278,7 +7545,7 @@ If the schedule is empty, the user will be updated to use the default schedule.| #### Enumerated Values | Value | -| --------------- | +|-----------------| | `owner` | | `authenticated` | | `public` | @@ -7287,167 +7554,172 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "build_number": 0, - "created_at": "2019-08-24T14:15:22Z", - "daily_cost": 0, - "deadline": "2019-08-24T14:15:22Z", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "initiator_id": "06588898-9a84-4b35-ba8f-f9cbd64946f3", - "initiator_name": "string", - "job": { - "canceled_at": "2019-08-24T14:15:22Z", - "completed_at": "2019-08-24T14:15:22Z", - "created_at": "2019-08-24T14:15:22Z", - "error": "string", - "error_code": "REQUIRED_TEMPLATE_VARIABLES", - "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "queue_position": 0, - "queue_size": 0, - "started_at": "2019-08-24T14:15:22Z", - "status": "pending", - "tags": { - "property1": "string", - "property2": "string" - }, - "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" - }, - "matched_provisioners": { - "available": 0, - "count": 0, - "most_recently_seen": "2019-08-24T14:15:22Z" - }, - "max_deadline": "2019-08-24T14:15:22Z", - "reason": "initiator", - "resources": [ - { - "agents": [ - { - "api_version": "string", - "apps": [ - { - "command": "string", - "display_name": "string", - "external": true, - "health": "disabled", - "healthcheck": { - "interval": 0, - "threshold": 0, - "url": "string" - }, - "hidden": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "sharing_level": "owner", - "slug": "string", - "subdomain": true, - "subdomain_name": "string", - "url": "string" - } - ], - "architecture": "string", - "connection_timeout_seconds": 0, - "created_at": "2019-08-24T14:15:22Z", - "directory": "string", - "disconnected_at": "2019-08-24T14:15:22Z", - "display_apps": ["vscode"], - "environment_variables": { - "property1": "string", - "property2": "string" - }, - "expanded_directory": "string", - "first_connected_at": "2019-08-24T14:15:22Z", - "health": { - "healthy": false, - "reason": "agent has lost connection" - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "instance_id": "string", - "last_connected_at": "2019-08-24T14:15:22Z", - "latency": { - "property1": { - "latency_ms": 0, - "preferred": true - }, - "property2": { - "latency_ms": 0, - "preferred": true - } - }, - "lifecycle_state": "created", - "log_sources": [ - { - "created_at": "2019-08-24T14:15:22Z", - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" - } - ], - "logs_length": 0, - "logs_overflowed": true, - "name": "string", - "operating_system": "string", - "ready_at": "2019-08-24T14:15:22Z", - "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", - "scripts": [ - { - "cron": "string", - "display_name": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "log_path": "string", - "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", - "run_on_start": true, - "run_on_stop": true, - "script": "string", - "start_blocks_login": true, - "timeout": 0 - } - ], - "started_at": "2019-08-24T14:15:22Z", - "startup_script_behavior": "blocking", - "status": "connecting", - "subsystems": ["envbox"], - "troubleshooting_url": "string", - "updated_at": "2019-08-24T14:15:22Z", - "version": "string" - } - ], - "created_at": "2019-08-24T14:15:22Z", - "daily_cost": 0, - "hide": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", - "metadata": [ - { - "key": "string", - "sensitive": true, - "value": "string" - } - ], - "name": "string", - "type": "string", - "workspace_transition": "start" - } - ], - "status": "pending", - "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", - "template_version_name": "string", - "transition": "start", - "updated_at": "2019-08-24T14:15:22Z", - "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", - "workspace_name": "string", - "workspace_owner_avatar_url": "string", - "workspace_owner_id": "e7078695-5279-4c86-8774-3ac2367a2fc7", - "workspace_owner_name": "string" + "build_number": 0, + "created_at": "2019-08-24T14:15:22Z", + "daily_cost": 0, + "deadline": "2019-08-24T14:15:22Z", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "initiator_id": "06588898-9a84-4b35-ba8f-f9cbd64946f3", + "initiator_name": "string", + "job": { + "canceled_at": "2019-08-24T14:15:22Z", + "completed_at": "2019-08-24T14:15:22Z", + "created_at": "2019-08-24T14:15:22Z", + "error": "string", + "error_code": "REQUIRED_TEMPLATE_VARIABLES", + "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "queue_position": 0, + "queue_size": 0, + "started_at": "2019-08-24T14:15:22Z", + "status": "pending", + "tags": { + "property1": "string", + "property2": "string" + }, + "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" + }, + "matched_provisioners": { + "available": 0, + "count": 0, + "most_recently_seen": "2019-08-24T14:15:22Z" + }, + "max_deadline": "2019-08-24T14:15:22Z", + "reason": "initiator", + "resources": [ + { + "agents": [ + { + "api_version": "string", + "apps": [ + { + "command": "string", + "display_name": "string", + "external": true, + "health": "disabled", + "healthcheck": { + "interval": 0, + "threshold": 0, + "url": "string" + }, + "hidden": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "open_in": "slim-window", + "sharing_level": "owner", + "slug": "string", + "subdomain": true, + "subdomain_name": "string", + "url": "string" + } + ], + "architecture": "string", + "connection_timeout_seconds": 0, + "created_at": "2019-08-24T14:15:22Z", + "directory": "string", + "disconnected_at": "2019-08-24T14:15:22Z", + "display_apps": [ + "vscode" + ], + "environment_variables": { + "property1": "string", + "property2": "string" + }, + "expanded_directory": "string", + "first_connected_at": "2019-08-24T14:15:22Z", + "health": { + "healthy": false, + "reason": "agent has lost connection" + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "instance_id": "string", + "last_connected_at": "2019-08-24T14:15:22Z", + "latency": { + "property1": { + "latency_ms": 0, + "preferred": true + }, + "property2": { + "latency_ms": 0, + "preferred": true + } + }, + "lifecycle_state": "created", + "log_sources": [ + { + "created_at": "2019-08-24T14:15:22Z", + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" + } + ], + "logs_length": 0, + "logs_overflowed": true, + "name": "string", + "operating_system": "string", + "ready_at": "2019-08-24T14:15:22Z", + "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", + "scripts": [ + { + "cron": "string", + "display_name": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "log_path": "string", + "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", + "run_on_start": true, + "run_on_stop": true, + "script": "string", + "start_blocks_login": true, + "timeout": 0 + } + ], + "started_at": "2019-08-24T14:15:22Z", + "startup_script_behavior": "blocking", + "status": "connecting", + "subsystems": [ + "envbox" + ], + "troubleshooting_url": "string", + "updated_at": "2019-08-24T14:15:22Z", + "version": "string" + } + ], + "created_at": "2019-08-24T14:15:22Z", + "daily_cost": 0, + "hide": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", + "metadata": [ + { + "key": "string", + "sensitive": true, + "value": "string" + } + ], + "name": "string", + "type": "string", + "workspace_transition": "start" + } + ], + "status": "pending", + "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", + "template_version_name": "string", + "transition": "start", + "updated_at": "2019-08-24T14:15:22Z", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string", + "workspace_owner_avatar_url": "string", + "workspace_owner_id": "e7078695-5279-4c86-8774-3ac2367a2fc7", + "workspace_owner_name": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------------------------- | ----------------------------------------------------------------- | -------- | ------------ | ----------- | +|------------------------------|-------------------------------------------------------------------|----------|--------------|-------------| | `build_number` | integer | false | | | | `created_at` | string | false | | | | `daily_cost` | integer | false | | | @@ -7474,7 +7746,7 @@ If the schedule is empty, the user will be updated to use the default schedule.| #### Enumerated Values | Property | Value | -| ------------ | ----------- | +|--------------|-------------| | `reason` | `initiator` | | `reason` | `autostart` | | `reason` | `autostop` | @@ -7496,15 +7768,15 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "name": "string", - "value": "string" + "name": "string", + "value": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------- | ------ | -------- | ------------ | ----------- | +|---------|--------|----------|--------------|-------------| | `name` | string | false | | | | `value` | string | false | | | @@ -7512,45 +7784,45 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "agent_connection_timings": [ - { - "ended_at": "2019-08-24T14:15:22Z", - "stage": "init", - "started_at": "2019-08-24T14:15:22Z", - "workspace_agent_id": "string", - "workspace_agent_name": "string" - } - ], - "agent_script_timings": [ - { - "display_name": "string", - "ended_at": "2019-08-24T14:15:22Z", - "exit_code": 0, - "stage": "init", - "started_at": "2019-08-24T14:15:22Z", - "status": "string", - "workspace_agent_id": "string", - "workspace_agent_name": "string" - } - ], - "provisioner_timings": [ - { - "action": "string", - "ended_at": "2019-08-24T14:15:22Z", - "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", - "resource": "string", - "source": "string", - "stage": "init", - "started_at": "2019-08-24T14:15:22Z" - } - ] + "agent_connection_timings": [ + { + "ended_at": "2019-08-24T14:15:22Z", + "stage": "init", + "started_at": "2019-08-24T14:15:22Z", + "workspace_agent_id": "string", + "workspace_agent_name": "string" + } + ], + "agent_script_timings": [ + { + "display_name": "string", + "ended_at": "2019-08-24T14:15:22Z", + "exit_code": 0, + "stage": "init", + "started_at": "2019-08-24T14:15:22Z", + "status": "string", + "workspace_agent_id": "string", + "workspace_agent_name": "string" + } + ], + "provisioner_timings": [ + { + "action": "string", + "ended_at": "2019-08-24T14:15:22Z", + "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", + "resource": "string", + "source": "string", + "stage": "init", + "started_at": "2019-08-24T14:15:22Z" + } + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------------------- | ------------------------------------------------------------------------- | -------- | ------------ | ---------------------------------------------------------------------------------------------------------------- | +|----------------------------|---------------------------------------------------------------------------|----------|--------------|------------------------------------------------------------------------------------------------------------------| | `agent_connection_timings` | array of [codersdk.AgentConnectionTiming](#codersdkagentconnectiontiming) | false | | | | `agent_script_timings` | array of [codersdk.AgentScriptTiming](#codersdkagentscripttiming) | false | | Agent script timings Consolidate agent-related timing metrics into a single struct when updating the API version | | `provisioner_timings` | array of [codersdk.ProvisionerTiming](#codersdkprovisionertiming) | false | | | @@ -7559,15 +7831,15 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "p50": 0, - "p95": 0 + "p50": 0, + "p95": 0 } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ----- | ------ | -------- | ------------ | ----------- | +|-------|--------|----------|--------------|-------------| | `p50` | number | false | | | | `p95` | number | false | | | @@ -7575,24 +7847,24 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "building": 0, - "connection_latency_ms": { - "p50": 0, - "p95": 0 - }, - "failed": 0, - "pending": 0, - "running": 0, - "rx_bytes": 0, - "stopped": 0, - "tx_bytes": 0 + "building": 0, + "connection_latency_ms": { + "p50": 0, + "p95": 0 + }, + "failed": 0, + "pending": 0, + "running": 0, + "rx_bytes": 0, + "stopped": 0, + "tx_bytes": 0 } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ----------------------- | ------------------------------------------------------------------------------ | -------- | ------------ | ----------- | +|-------------------------|--------------------------------------------------------------------------------|----------|--------------|-------------| | `building` | integer | false | | | | `connection_latency_ms` | [codersdk.WorkspaceConnectionLatencyMS](#codersdkworkspaceconnectionlatencyms) | false | | | | `failed` | integer | false | | | @@ -7606,15 +7878,17 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "failing_agents": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "healthy": false + "failing_agents": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "healthy": false } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------------- | --------------- | -------- | ------------ | -------------------------------------------------------------------- | +|------------------|-----------------|----------|--------------|----------------------------------------------------------------------| | `failing_agents` | array of string | false | | Failing agents lists the IDs of the agents that are failing, if any. | | `healthy` | boolean | false | | Healthy is true if the workspace is healthy. | @@ -7622,66 +7896,74 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "created_at": "2019-08-24T14:15:22Z", - "deleted": true, - "derp_enabled": true, - "derp_only": true, - "display_name": "string", - "healthy": true, - "icon_url": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "name": "string", - "path_app_url": "string", - "status": { - "checked_at": "2019-08-24T14:15:22Z", - "report": { - "errors": ["string"], - "warnings": ["string"] - }, - "status": "ok" - }, - "updated_at": "2019-08-24T14:15:22Z", - "version": "string", - "wildcard_hostname": "string" -} -``` - -### Properties - -| Name | Type | Required | Restrictions | Description | -| ------------------- | -------------------------------------------------------------- | -------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `created_at` | string | false | | | -| `deleted` | boolean | false | | | -| `derp_enabled` | boolean | false | | | -| `derp_only` | boolean | false | | | -| `display_name` | string | false | | | -| `healthy` | boolean | false | | | -| `icon_url` | string | false | | | -| `id` | string | false | | | -| `name` | string | false | | | -| `path_app_url` | string | false | | Path app URL is the URL to the base path for path apps. Optional unless wildcard_hostname is set. E.g. https://us.example.com | -| `status` | [codersdk.WorkspaceProxyStatus](#codersdkworkspaceproxystatus) | false | | Status is the latest status check of the proxy. This will be empty for deleted proxies. This value can be used to determine if a workspace proxy is healthy and ready to use. | -| `updated_at` | string | false | | | -| `version` | string | false | | | -| `wildcard_hostname` | string | false | | Wildcard hostname is the wildcard hostname for subdomain apps. E.g. _.us.example.com E.g. _--suffix.au.example.com Optional. Does not need to be on the same domain as PathAppURL. | + "created_at": "2019-08-24T14:15:22Z", + "deleted": true, + "derp_enabled": true, + "derp_only": true, + "display_name": "string", + "healthy": true, + "icon_url": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "name": "string", + "path_app_url": "string", + "status": { + "checked_at": "2019-08-24T14:15:22Z", + "report": { + "errors": [ + "string" + ], + "warnings": [ + "string" + ] + }, + "status": "ok" + }, + "updated_at": "2019-08-24T14:15:22Z", + "version": "string", + "wildcard_hostname": "string" +} +``` + +### Properties + +| Name | Type | Required | Restrictions | Description | +|---------------------|----------------------------------------------------------------|----------|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `created_at` | string | false | | | +| `deleted` | boolean | false | | | +| `derp_enabled` | boolean | false | | | +| `derp_only` | boolean | false | | | +| `display_name` | string | false | | | +| `healthy` | boolean | false | | | +| `icon_url` | string | false | | | +| `id` | string | false | | | +| `name` | string | false | | | +| `path_app_url` | string | false | | Path app URL is the URL to the base path for path apps. Optional unless wildcard_hostname is set. E.g. https://us.example.com | +| `status` | [codersdk.WorkspaceProxyStatus](#codersdkworkspaceproxystatus) | false | | Status is the latest status check of the proxy. This will be empty for deleted proxies. This value can be used to determine if a workspace proxy is healthy and ready to use. | +| `updated_at` | string | false | | | +| `version` | string | false | | | +| `wildcard_hostname` | string | false | | Wildcard hostname is the wildcard hostname for subdomain apps. E.g. *.us.example.com E.g.*--suffix.au.example.com Optional. Does not need to be on the same domain as PathAppURL. | ## codersdk.WorkspaceProxyStatus ```json { - "checked_at": "2019-08-24T14:15:22Z", - "report": { - "errors": ["string"], - "warnings": ["string"] - }, - "status": "ok" + "checked_at": "2019-08-24T14:15:22Z", + "report": { + "errors": [ + "string" + ], + "warnings": [ + "string" + ] + }, + "status": "ok" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------ | -------------------------------------------------------- | -------- | ------------ | ------------------------------------------------------------------------- | +|--------------|----------------------------------------------------------|----------|--------------|---------------------------------------------------------------------------| | `checked_at` | string | false | | | | `report` | [codersdk.ProxyHealthReport](#codersdkproxyhealthreport) | false | | Report provides more information about the health of the workspace proxy. | | `status` | [codersdk.ProxyHealthStatus](#codersdkproxyhealthstatus) | false | | | @@ -7690,15 +7972,15 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "budget": 0, - "credits_consumed": 0 + "budget": 0, + "credits_consumed": 0 } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------ | ------- | -------- | ------------ | ----------- | +|--------------------|---------|----------|--------------|-------------| | `budget` | integer | false | | | | `credits_consumed` | integer | false | | | @@ -7706,121 +7988,126 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "agents": [ - { - "api_version": "string", - "apps": [ - { - "command": "string", - "display_name": "string", - "external": true, - "health": "disabled", - "healthcheck": { - "interval": 0, - "threshold": 0, - "url": "string" - }, - "hidden": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "sharing_level": "owner", - "slug": "string", - "subdomain": true, - "subdomain_name": "string", - "url": "string" - } - ], - "architecture": "string", - "connection_timeout_seconds": 0, - "created_at": "2019-08-24T14:15:22Z", - "directory": "string", - "disconnected_at": "2019-08-24T14:15:22Z", - "display_apps": ["vscode"], - "environment_variables": { - "property1": "string", - "property2": "string" - }, - "expanded_directory": "string", - "first_connected_at": "2019-08-24T14:15:22Z", - "health": { - "healthy": false, - "reason": "agent has lost connection" - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "instance_id": "string", - "last_connected_at": "2019-08-24T14:15:22Z", - "latency": { - "property1": { - "latency_ms": 0, - "preferred": true - }, - "property2": { - "latency_ms": 0, - "preferred": true - } - }, - "lifecycle_state": "created", - "log_sources": [ - { - "created_at": "2019-08-24T14:15:22Z", - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" - } - ], - "logs_length": 0, - "logs_overflowed": true, - "name": "string", - "operating_system": "string", - "ready_at": "2019-08-24T14:15:22Z", - "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", - "scripts": [ - { - "cron": "string", - "display_name": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "log_path": "string", - "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", - "run_on_start": true, - "run_on_stop": true, - "script": "string", - "start_blocks_login": true, - "timeout": 0 - } - ], - "started_at": "2019-08-24T14:15:22Z", - "startup_script_behavior": "blocking", - "status": "connecting", - "subsystems": ["envbox"], - "troubleshooting_url": "string", - "updated_at": "2019-08-24T14:15:22Z", - "version": "string" - } - ], - "created_at": "2019-08-24T14:15:22Z", - "daily_cost": 0, - "hide": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", - "metadata": [ - { - "key": "string", - "sensitive": true, - "value": "string" - } - ], - "name": "string", - "type": "string", - "workspace_transition": "start" + "agents": [ + { + "api_version": "string", + "apps": [ + { + "command": "string", + "display_name": "string", + "external": true, + "health": "disabled", + "healthcheck": { + "interval": 0, + "threshold": 0, + "url": "string" + }, + "hidden": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "open_in": "slim-window", + "sharing_level": "owner", + "slug": "string", + "subdomain": true, + "subdomain_name": "string", + "url": "string" + } + ], + "architecture": "string", + "connection_timeout_seconds": 0, + "created_at": "2019-08-24T14:15:22Z", + "directory": "string", + "disconnected_at": "2019-08-24T14:15:22Z", + "display_apps": [ + "vscode" + ], + "environment_variables": { + "property1": "string", + "property2": "string" + }, + "expanded_directory": "string", + "first_connected_at": "2019-08-24T14:15:22Z", + "health": { + "healthy": false, + "reason": "agent has lost connection" + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "instance_id": "string", + "last_connected_at": "2019-08-24T14:15:22Z", + "latency": { + "property1": { + "latency_ms": 0, + "preferred": true + }, + "property2": { + "latency_ms": 0, + "preferred": true + } + }, + "lifecycle_state": "created", + "log_sources": [ + { + "created_at": "2019-08-24T14:15:22Z", + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" + } + ], + "logs_length": 0, + "logs_overflowed": true, + "name": "string", + "operating_system": "string", + "ready_at": "2019-08-24T14:15:22Z", + "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", + "scripts": [ + { + "cron": "string", + "display_name": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "log_path": "string", + "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", + "run_on_start": true, + "run_on_stop": true, + "script": "string", + "start_blocks_login": true, + "timeout": 0 + } + ], + "started_at": "2019-08-24T14:15:22Z", + "startup_script_behavior": "blocking", + "status": "connecting", + "subsystems": [ + "envbox" + ], + "troubleshooting_url": "string", + "updated_at": "2019-08-24T14:15:22Z", + "version": "string" + } + ], + "created_at": "2019-08-24T14:15:22Z", + "daily_cost": 0, + "hide": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", + "metadata": [ + { + "key": "string", + "sensitive": true, + "value": "string" + } + ], + "name": "string", + "type": "string", + "workspace_transition": "start" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------------------- | --------------------------------------------------------------------------------- | -------- | ------------ | ----------- | +|------------------------|-----------------------------------------------------------------------------------|----------|--------------|-------------| | `agents` | array of [codersdk.WorkspaceAgent](#codersdkworkspaceagent) | false | | | | `created_at` | string | false | | | | `daily_cost` | integer | false | | | @@ -7836,7 +8123,7 @@ If the schedule is empty, the user will be updated to use the default schedule.| #### Enumerated Values | Property | Value | -| ---------------------- | -------- | +|------------------------|----------| | `workspace_transition` | `start` | | `workspace_transition` | `stop` | | `workspace_transition` | `delete` | @@ -7845,16 +8132,16 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "key": "string", - "sensitive": true, - "value": "string" + "key": "string", + "sensitive": true, + "value": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ----------- | ------- | -------- | ------------ | ----------- | +|-------------|---------|----------|--------------|-------------| | `key` | string | false | | | | `sensitive` | boolean | false | | | | `value` | string | false | | | @@ -7870,7 +8157,7 @@ If the schedule is empty, the user will be updated to use the default schedule.| #### Enumerated Values | Value | -| ----------- | +|-------------| | `pending` | | `starting` | | `running` | @@ -7893,7 +8180,7 @@ If the schedule is empty, the user will be updated to use the default schedule.| #### Enumerated Values | Value | -| -------- | +|----------| | `start` | | `stop` | | `delete` | @@ -7902,200 +8189,207 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "count": 0, - "workspaces": [ - { - "allow_renames": true, - "automatic_updates": "always", - "autostart_schedule": "string", - "created_at": "2019-08-24T14:15:22Z", - "deleting_at": "2019-08-24T14:15:22Z", - "dormant_at": "2019-08-24T14:15:22Z", - "favorite": true, - "health": { - "failing_agents": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "healthy": false - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_used_at": "2019-08-24T14:15:22Z", - "latest_build": { - "build_number": 0, - "created_at": "2019-08-24T14:15:22Z", - "daily_cost": 0, - "deadline": "2019-08-24T14:15:22Z", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "initiator_id": "06588898-9a84-4b35-ba8f-f9cbd64946f3", - "initiator_name": "string", - "job": { - "canceled_at": "2019-08-24T14:15:22Z", - "completed_at": "2019-08-24T14:15:22Z", - "created_at": "2019-08-24T14:15:22Z", - "error": "string", - "error_code": "REQUIRED_TEMPLATE_VARIABLES", - "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "queue_position": 0, - "queue_size": 0, - "started_at": "2019-08-24T14:15:22Z", - "status": "pending", - "tags": { - "property1": "string", - "property2": "string" - }, - "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" - }, - "matched_provisioners": { - "available": 0, - "count": 0, - "most_recently_seen": "2019-08-24T14:15:22Z" - }, - "max_deadline": "2019-08-24T14:15:22Z", - "reason": "initiator", - "resources": [ - { - "agents": [ - { - "api_version": "string", - "apps": [ - { - "command": "string", - "display_name": "string", - "external": true, - "health": "disabled", - "healthcheck": {}, - "hidden": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "sharing_level": "owner", - "slug": "string", - "subdomain": true, - "subdomain_name": "string", - "url": "string" - } - ], - "architecture": "string", - "connection_timeout_seconds": 0, - "created_at": "2019-08-24T14:15:22Z", - "directory": "string", - "disconnected_at": "2019-08-24T14:15:22Z", - "display_apps": ["vscode"], - "environment_variables": { - "property1": "string", - "property2": "string" - }, - "expanded_directory": "string", - "first_connected_at": "2019-08-24T14:15:22Z", - "health": { - "healthy": false, - "reason": "agent has lost connection" - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "instance_id": "string", - "last_connected_at": "2019-08-24T14:15:22Z", - "latency": { - "property1": { - "latency_ms": 0, - "preferred": true - }, - "property2": { - "latency_ms": 0, - "preferred": true - } - }, - "lifecycle_state": "created", - "log_sources": [ - { - "created_at": "2019-08-24T14:15:22Z", - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" - } - ], - "logs_length": 0, - "logs_overflowed": true, - "name": "string", - "operating_system": "string", - "ready_at": "2019-08-24T14:15:22Z", - "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", - "scripts": [ - { - "cron": "string", - "display_name": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "log_path": "string", - "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", - "run_on_start": true, - "run_on_stop": true, - "script": "string", - "start_blocks_login": true, - "timeout": 0 - } - ], - "started_at": "2019-08-24T14:15:22Z", - "startup_script_behavior": "blocking", - "status": "connecting", - "subsystems": ["envbox"], - "troubleshooting_url": "string", - "updated_at": "2019-08-24T14:15:22Z", - "version": "string" - } - ], - "created_at": "2019-08-24T14:15:22Z", - "daily_cost": 0, - "hide": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", - "metadata": [ - { - "key": "string", - "sensitive": true, - "value": "string" - } - ], - "name": "string", - "type": "string", - "workspace_transition": "start" - } - ], - "status": "pending", - "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", - "template_version_name": "string", - "transition": "start", - "updated_at": "2019-08-24T14:15:22Z", - "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", - "workspace_name": "string", - "workspace_owner_avatar_url": "string", - "workspace_owner_id": "e7078695-5279-4c86-8774-3ac2367a2fc7", - "workspace_owner_name": "string" - }, - "name": "string", - "next_start_at": "2019-08-24T14:15:22Z", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "organization_name": "string", - "outdated": true, - "owner_avatar_url": "string", - "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05", - "owner_name": "string", - "template_active_version_id": "b0da9c29-67d8-4c87-888c-bafe356f7f3c", - "template_allow_user_cancel_workspace_jobs": true, - "template_display_name": "string", - "template_icon": "string", - "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", - "template_name": "string", - "template_require_active_version": true, - "ttl_ms": 0, - "updated_at": "2019-08-24T14:15:22Z" - } - ] + "count": 0, + "workspaces": [ + { + "allow_renames": true, + "automatic_updates": "always", + "autostart_schedule": "string", + "created_at": "2019-08-24T14:15:22Z", + "deleting_at": "2019-08-24T14:15:22Z", + "dormant_at": "2019-08-24T14:15:22Z", + "favorite": true, + "health": { + "failing_agents": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "healthy": false + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_used_at": "2019-08-24T14:15:22Z", + "latest_build": { + "build_number": 0, + "created_at": "2019-08-24T14:15:22Z", + "daily_cost": 0, + "deadline": "2019-08-24T14:15:22Z", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "initiator_id": "06588898-9a84-4b35-ba8f-f9cbd64946f3", + "initiator_name": "string", + "job": { + "canceled_at": "2019-08-24T14:15:22Z", + "completed_at": "2019-08-24T14:15:22Z", + "created_at": "2019-08-24T14:15:22Z", + "error": "string", + "error_code": "REQUIRED_TEMPLATE_VARIABLES", + "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "queue_position": 0, + "queue_size": 0, + "started_at": "2019-08-24T14:15:22Z", + "status": "pending", + "tags": { + "property1": "string", + "property2": "string" + }, + "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" + }, + "matched_provisioners": { + "available": 0, + "count": 0, + "most_recently_seen": "2019-08-24T14:15:22Z" + }, + "max_deadline": "2019-08-24T14:15:22Z", + "reason": "initiator", + "resources": [ + { + "agents": [ + { + "api_version": "string", + "apps": [ + { + "command": "string", + "display_name": "string", + "external": true, + "health": "disabled", + "healthcheck": {}, + "hidden": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "open_in": "slim-window", + "sharing_level": "owner", + "slug": "string", + "subdomain": true, + "subdomain_name": "string", + "url": "string" + } + ], + "architecture": "string", + "connection_timeout_seconds": 0, + "created_at": "2019-08-24T14:15:22Z", + "directory": "string", + "disconnected_at": "2019-08-24T14:15:22Z", + "display_apps": [ + "vscode" + ], + "environment_variables": { + "property1": "string", + "property2": "string" + }, + "expanded_directory": "string", + "first_connected_at": "2019-08-24T14:15:22Z", + "health": { + "healthy": false, + "reason": "agent has lost connection" + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "instance_id": "string", + "last_connected_at": "2019-08-24T14:15:22Z", + "latency": { + "property1": { + "latency_ms": 0, + "preferred": true + }, + "property2": { + "latency_ms": 0, + "preferred": true + } + }, + "lifecycle_state": "created", + "log_sources": [ + { + "created_at": "2019-08-24T14:15:22Z", + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" + } + ], + "logs_length": 0, + "logs_overflowed": true, + "name": "string", + "operating_system": "string", + "ready_at": "2019-08-24T14:15:22Z", + "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", + "scripts": [ + { + "cron": "string", + "display_name": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "log_path": "string", + "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", + "run_on_start": true, + "run_on_stop": true, + "script": "string", + "start_blocks_login": true, + "timeout": 0 + } + ], + "started_at": "2019-08-24T14:15:22Z", + "startup_script_behavior": "blocking", + "status": "connecting", + "subsystems": [ + "envbox" + ], + "troubleshooting_url": "string", + "updated_at": "2019-08-24T14:15:22Z", + "version": "string" + } + ], + "created_at": "2019-08-24T14:15:22Z", + "daily_cost": 0, + "hide": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", + "metadata": [ + { + "key": "string", + "sensitive": true, + "value": "string" + } + ], + "name": "string", + "type": "string", + "workspace_transition": "start" + } + ], + "status": "pending", + "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", + "template_version_name": "string", + "transition": "start", + "updated_at": "2019-08-24T14:15:22Z", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string", + "workspace_owner_avatar_url": "string", + "workspace_owner_id": "e7078695-5279-4c86-8774-3ac2367a2fc7", + "workspace_owner_name": "string" + }, + "name": "string", + "next_start_at": "2019-08-24T14:15:22Z", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "organization_name": "string", + "outdated": true, + "owner_avatar_url": "string", + "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05", + "owner_name": "string", + "template_active_version_id": "b0da9c29-67d8-4c87-888c-bafe356f7f3c", + "template_allow_user_cancel_workspace_jobs": true, + "template_display_name": "string", + "template_icon": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_require_active_version": true, + "ttl_ms": 0, + "updated_at": "2019-08-24T14:15:22Z" + } + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------ | ------------------------------------------------- | -------- | ------------ | ----------- | +|--------------|---------------------------------------------------|----------|--------------|-------------| | `count` | integer | false | | | | `workspaces` | array of [codersdk.Workspace](#codersdkworkspace) | false | | | @@ -8103,16 +8397,16 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "key": {}, - "recv": 0, - "sent": 0 + "key": {}, + "recv": 0, + "sent": 0 } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------ | -------------------------------- | -------- | ------------ | -------------------------------------------------------------------- | +|--------|----------------------------------|----------|--------------|----------------------------------------------------------------------| | `key` | [key.NodePublic](#keynodepublic) | false | | Key is the public key of the client which sent/received these bytes. | | `recv` | integer | false | | | | `sent` | integer | false | | | @@ -8121,19 +8415,19 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "tokenBucketBytesBurst": 0, - "tokenBucketBytesPerSecond": 0 + "tokenBucketBytesBurst": 0, + "tokenBucketBytesPerSecond": 0 } ``` ### Properties -| Name | Type | Required | Restrictions | Description | -| ------------------------------------------------------------------------------------------ | ------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------ | -| `tokenBucketBytesBurst` | integer | false | | Tokenbucketbytesburst is how many bytes the server will allow to burst, temporarily violating TokenBucketBytesPerSecond. | -| Zero means unspecified. There might be a limit, but the client need not try to respect it. | -| `tokenBucketBytesPerSecond` | integer | false | | Tokenbucketbytespersecond is how many bytes per second the server says it will accept, including all framing bytes. | -| Zero means unspecified. There might be a limit, but the client need not try to respect it. | +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|`tokenBucketBytesBurst`|integer|false||Tokenbucketbytesburst is how many bytes the server will allow to burst, temporarily violating TokenBucketBytesPerSecond. +Zero means unspecified. There might be a limit, but the client need not try to respect it.| +|`tokenBucketBytesPerSecond`|integer|false||Tokenbucketbytespersecond is how many bytes per second the server says it will accept, including all framing bytes. +Zero means unspecified. There might be a limit, but the client need not try to respect it.| ## health.Code @@ -8146,7 +8440,7 @@ If the schedule is empty, the user will be updated to use the default schedule.| #### Enumerated Values | Value | -| ---------- | +|------------| | `EUNKNOWN` | | `EWP01` | | `EWP02` | @@ -8170,15 +8464,15 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "code": "EUNKNOWN", - "message": "string" + "code": "EUNKNOWN", + "message": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| --------- | -------------------------- | -------- | ------------ | ----------- | +|-----------|----------------------------|----------|--------------|-------------| | `code` | [health.Code](#healthcode) | false | | | | `message` | string | false | | | @@ -8193,7 +8487,7 @@ If the schedule is empty, the user will be updated to use the default schedule.| #### Enumerated Values | Value | -| --------- | +|-----------| | `ok` | | `warning` | | `error` | @@ -8202,27 +8496,27 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "access_url": "string", - "dismissed": true, - "error": "string", - "healthy": true, - "healthz_response": "string", - "reachable": true, - "severity": "ok", - "status_code": 0, - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ] + "access_url": "string", + "dismissed": true, + "error": "string", + "healthy": true, + "healthz_response": "string", + "reachable": true, + "severity": "ok", + "status_code": 0, + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------ | ----------------------------------------- | -------- | ------------ | ------------------------------------------------------------------------------------------- | +|--------------------|-------------------------------------------|----------|--------------|---------------------------------------------------------------------------------------------| | `access_url` | string | false | | | | `dismissed` | boolean | false | | | | `error` | string | false | | | @@ -8236,7 +8530,7 @@ If the schedule is empty, the user will be updated to use the default schedule.| #### Enumerated Values | Property | Value | -| ---------- | --------- | +|------------|-----------| | `severity` | `ok` | | `severity` | `warning` | | `severity` | `error` | @@ -8245,213 +8539,231 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "dismissed": true, - "error": "string", - "healthy": true, - "netcheck": { - "captivePortal": "string", - "globalV4": "string", - "globalV6": "string", - "hairPinning": "string", - "icmpv4": true, - "ipv4": true, - "ipv4CanSend": true, - "ipv6": true, - "ipv6CanSend": true, - "mappingVariesByDestIP": "string", - "oshasIPv6": true, - "pcp": "string", - "pmp": "string", - "preferredDERP": 0, - "regionLatency": { - "property1": 0, - "property2": 0 - }, - "regionV4Latency": { - "property1": 0, - "property2": 0 - }, - "regionV6Latency": { - "property1": 0, - "property2": 0 - }, - "udp": true, - "upnP": "string" - }, - "netcheck_err": "string", - "netcheck_logs": ["string"], - "regions": { - "property1": { - "error": "string", - "healthy": true, - "node_reports": [ - { - "can_exchange_messages": true, - "client_errs": [["string"]], - "client_logs": [["string"]], - "error": "string", - "healthy": true, - "node": { - "canPort80": true, - "certName": "string", - "derpport": 0, - "forceHTTP": true, - "hostName": "string", - "insecureForTests": true, - "ipv4": "string", - "ipv6": "string", - "name": "string", - "regionID": 0, - "stunonly": true, - "stunport": 0, - "stuntestIP": "string" - }, - "node_info": { - "tokenBucketBytesBurst": 0, - "tokenBucketBytesPerSecond": 0 - }, - "round_trip_ping": "string", - "round_trip_ping_ms": 0, - "severity": "ok", - "stun": { - "canSTUN": true, - "enabled": true, - "error": "string" - }, - "uses_websocket": true, - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ] - } - ], - "region": { - "avoid": true, - "embeddedRelay": true, - "nodes": [ - { - "canPort80": true, - "certName": "string", - "derpport": 0, - "forceHTTP": true, - "hostName": "string", - "insecureForTests": true, - "ipv4": "string", - "ipv6": "string", - "name": "string", - "regionID": 0, - "stunonly": true, - "stunport": 0, - "stuntestIP": "string" - } - ], - "regionCode": "string", - "regionID": 0, - "regionName": "string" - }, - "severity": "ok", - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ] - }, - "property2": { - "error": "string", - "healthy": true, - "node_reports": [ - { - "can_exchange_messages": true, - "client_errs": [["string"]], - "client_logs": [["string"]], - "error": "string", - "healthy": true, - "node": { - "canPort80": true, - "certName": "string", - "derpport": 0, - "forceHTTP": true, - "hostName": "string", - "insecureForTests": true, - "ipv4": "string", - "ipv6": "string", - "name": "string", - "regionID": 0, - "stunonly": true, - "stunport": 0, - "stuntestIP": "string" - }, - "node_info": { - "tokenBucketBytesBurst": 0, - "tokenBucketBytesPerSecond": 0 - }, - "round_trip_ping": "string", - "round_trip_ping_ms": 0, - "severity": "ok", - "stun": { - "canSTUN": true, - "enabled": true, - "error": "string" - }, - "uses_websocket": true, - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ] - } - ], - "region": { - "avoid": true, - "embeddedRelay": true, - "nodes": [ - { - "canPort80": true, - "certName": "string", - "derpport": 0, - "forceHTTP": true, - "hostName": "string", - "insecureForTests": true, - "ipv4": "string", - "ipv6": "string", - "name": "string", - "regionID": 0, - "stunonly": true, - "stunport": 0, - "stuntestIP": "string" - } - ], - "regionCode": "string", - "regionID": 0, - "regionName": "string" - }, - "severity": "ok", - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ] - } - }, - "severity": "ok", - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ] + "dismissed": true, + "error": "string", + "healthy": true, + "netcheck": { + "captivePortal": "string", + "globalV4": "string", + "globalV6": "string", + "hairPinning": "string", + "icmpv4": true, + "ipv4": true, + "ipv4CanSend": true, + "ipv6": true, + "ipv6CanSend": true, + "mappingVariesByDestIP": "string", + "oshasIPv6": true, + "pcp": "string", + "pmp": "string", + "preferredDERP": 0, + "regionLatency": { + "property1": 0, + "property2": 0 + }, + "regionV4Latency": { + "property1": 0, + "property2": 0 + }, + "regionV6Latency": { + "property1": 0, + "property2": 0 + }, + "udp": true, + "upnP": "string" + }, + "netcheck_err": "string", + "netcheck_logs": [ + "string" + ], + "regions": { + "property1": { + "error": "string", + "healthy": true, + "node_reports": [ + { + "can_exchange_messages": true, + "client_errs": [ + [ + "string" + ] + ], + "client_logs": [ + [ + "string" + ] + ], + "error": "string", + "healthy": true, + "node": { + "canPort80": true, + "certName": "string", + "derpport": 0, + "forceHTTP": true, + "hostName": "string", + "insecureForTests": true, + "ipv4": "string", + "ipv6": "string", + "name": "string", + "regionID": 0, + "stunonly": true, + "stunport": 0, + "stuntestIP": "string" + }, + "node_info": { + "tokenBucketBytesBurst": 0, + "tokenBucketBytesPerSecond": 0 + }, + "round_trip_ping": "string", + "round_trip_ping_ms": 0, + "severity": "ok", + "stun": { + "canSTUN": true, + "enabled": true, + "error": "string" + }, + "uses_websocket": true, + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ] + } + ], + "region": { + "avoid": true, + "embeddedRelay": true, + "nodes": [ + { + "canPort80": true, + "certName": "string", + "derpport": 0, + "forceHTTP": true, + "hostName": "string", + "insecureForTests": true, + "ipv4": "string", + "ipv6": "string", + "name": "string", + "regionID": 0, + "stunonly": true, + "stunport": 0, + "stuntestIP": "string" + } + ], + "regionCode": "string", + "regionID": 0, + "regionName": "string" + }, + "severity": "ok", + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ] + }, + "property2": { + "error": "string", + "healthy": true, + "node_reports": [ + { + "can_exchange_messages": true, + "client_errs": [ + [ + "string" + ] + ], + "client_logs": [ + [ + "string" + ] + ], + "error": "string", + "healthy": true, + "node": { + "canPort80": true, + "certName": "string", + "derpport": 0, + "forceHTTP": true, + "hostName": "string", + "insecureForTests": true, + "ipv4": "string", + "ipv6": "string", + "name": "string", + "regionID": 0, + "stunonly": true, + "stunport": 0, + "stuntestIP": "string" + }, + "node_info": { + "tokenBucketBytesBurst": 0, + "tokenBucketBytesPerSecond": 0 + }, + "round_trip_ping": "string", + "round_trip_ping_ms": 0, + "severity": "ok", + "stun": { + "canSTUN": true, + "enabled": true, + "error": "string" + }, + "uses_websocket": true, + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ] + } + ], + "region": { + "avoid": true, + "embeddedRelay": true, + "nodes": [ + { + "canPort80": true, + "certName": "string", + "derpport": 0, + "forceHTTP": true, + "hostName": "string", + "insecureForTests": true, + "ipv4": "string", + "ipv6": "string", + "name": "string", + "regionID": 0, + "stunonly": true, + "stunport": 0, + "stuntestIP": "string" + } + ], + "regionCode": "string", + "regionID": 0, + "regionName": "string" + }, + "severity": "ok", + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ] + } + }, + "severity": "ok", + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------ | -------------------------------------------------------- | -------- | ------------ | ------------------------------------------------------------------------------------------- | +|--------------------|----------------------------------------------------------|----------|--------------|---------------------------------------------------------------------------------------------| | `dismissed` | boolean | false | | | | `error` | string | false | | | | `healthy` | boolean | false | | Healthy is deprecated and left for backward compatibility purposes, use `Severity` instead. | @@ -8466,7 +8778,7 @@ If the schedule is empty, the user will be updated to use the default schedule.| #### Enumerated Values | Property | Value | -| ---------- | --------- | +|------------|-----------| | `severity` | `ok` | | `severity` | `warning` | | `severity` | `error` | @@ -8475,52 +8787,60 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "can_exchange_messages": true, - "client_errs": [["string"]], - "client_logs": [["string"]], - "error": "string", - "healthy": true, - "node": { - "canPort80": true, - "certName": "string", - "derpport": 0, - "forceHTTP": true, - "hostName": "string", - "insecureForTests": true, - "ipv4": "string", - "ipv6": "string", - "name": "string", - "regionID": 0, - "stunonly": true, - "stunport": 0, - "stuntestIP": "string" - }, - "node_info": { - "tokenBucketBytesBurst": 0, - "tokenBucketBytesPerSecond": 0 - }, - "round_trip_ping": "string", - "round_trip_ping_ms": 0, - "severity": "ok", - "stun": { - "canSTUN": true, - "enabled": true, - "error": "string" - }, - "uses_websocket": true, - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ] + "can_exchange_messages": true, + "client_errs": [ + [ + "string" + ] + ], + "client_logs": [ + [ + "string" + ] + ], + "error": "string", + "healthy": true, + "node": { + "canPort80": true, + "certName": "string", + "derpport": 0, + "forceHTTP": true, + "hostName": "string", + "insecureForTests": true, + "ipv4": "string", + "ipv6": "string", + "name": "string", + "regionID": 0, + "stunonly": true, + "stunport": 0, + "stuntestIP": "string" + }, + "node_info": { + "tokenBucketBytesBurst": 0, + "tokenBucketBytesPerSecond": 0 + }, + "round_trip_ping": "string", + "round_trip_ping_ms": 0, + "severity": "ok", + "stun": { + "canSTUN": true, + "enabled": true, + "error": "string" + }, + "uses_websocket": true, + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ----------------------- | ------------------------------------------------ | -------- | ------------ | ------------------------------------------------------------------------------------------- | +|-------------------------|--------------------------------------------------|----------|--------------|---------------------------------------------------------------------------------------------| | `can_exchange_messages` | boolean | false | | | | `client_errs` | array of array | false | | | | `client_logs` | array of array | false | | | @@ -8538,7 +8858,7 @@ If the schedule is empty, the user will be updated to use the default schedule.| #### Enumerated Values | Property | Value | -| ---------- | --------- | +|------------|-----------| | `severity` | `ok` | | `severity` | `warning` | | `severity` | `error` | @@ -8547,89 +8867,97 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "error": "string", - "healthy": true, - "node_reports": [ - { - "can_exchange_messages": true, - "client_errs": [["string"]], - "client_logs": [["string"]], - "error": "string", - "healthy": true, - "node": { - "canPort80": true, - "certName": "string", - "derpport": 0, - "forceHTTP": true, - "hostName": "string", - "insecureForTests": true, - "ipv4": "string", - "ipv6": "string", - "name": "string", - "regionID": 0, - "stunonly": true, - "stunport": 0, - "stuntestIP": "string" - }, - "node_info": { - "tokenBucketBytesBurst": 0, - "tokenBucketBytesPerSecond": 0 - }, - "round_trip_ping": "string", - "round_trip_ping_ms": 0, - "severity": "ok", - "stun": { - "canSTUN": true, - "enabled": true, - "error": "string" - }, - "uses_websocket": true, - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ] - } - ], - "region": { - "avoid": true, - "embeddedRelay": true, - "nodes": [ - { - "canPort80": true, - "certName": "string", - "derpport": 0, - "forceHTTP": true, - "hostName": "string", - "insecureForTests": true, - "ipv4": "string", - "ipv6": "string", - "name": "string", - "regionID": 0, - "stunonly": true, - "stunport": 0, - "stuntestIP": "string" - } - ], - "regionCode": "string", - "regionID": 0, - "regionName": "string" - }, - "severity": "ok", - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ] + "error": "string", + "healthy": true, + "node_reports": [ + { + "can_exchange_messages": true, + "client_errs": [ + [ + "string" + ] + ], + "client_logs": [ + [ + "string" + ] + ], + "error": "string", + "healthy": true, + "node": { + "canPort80": true, + "certName": "string", + "derpport": 0, + "forceHTTP": true, + "hostName": "string", + "insecureForTests": true, + "ipv4": "string", + "ipv6": "string", + "name": "string", + "regionID": 0, + "stunonly": true, + "stunport": 0, + "stuntestIP": "string" + }, + "node_info": { + "tokenBucketBytesBurst": 0, + "tokenBucketBytesPerSecond": 0 + }, + "round_trip_ping": "string", + "round_trip_ping_ms": 0, + "severity": "ok", + "stun": { + "canSTUN": true, + "enabled": true, + "error": "string" + }, + "uses_websocket": true, + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ] + } + ], + "region": { + "avoid": true, + "embeddedRelay": true, + "nodes": [ + { + "canPort80": true, + "certName": "string", + "derpport": 0, + "forceHTTP": true, + "hostName": "string", + "insecureForTests": true, + "ipv4": "string", + "ipv6": "string", + "name": "string", + "regionID": 0, + "stunonly": true, + "stunport": 0, + "stuntestIP": "string" + } + ], + "regionCode": "string", + "regionID": 0, + "regionName": "string" + }, + "severity": "ok", + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------- | ------------------------------------------------------------- | -------- | ------------ | ------------------------------------------------------------------------------------------- | +|----------------|---------------------------------------------------------------|----------|--------------|---------------------------------------------------------------------------------------------| | `error` | string | false | | | | `healthy` | boolean | false | | Healthy is deprecated and left for backward compatibility purposes, use `Severity` instead. | | `node_reports` | array of [healthsdk.DERPNodeReport](#healthsdkderpnodereport) | false | | | @@ -8640,7 +8968,7 @@ If the schedule is empty, the user will be updated to use the default schedule.| #### Enumerated Values | Property | Value | -| ---------- | --------- | +|------------|-----------| | `severity` | `ok` | | `severity` | `warning` | | `severity` | `error` | @@ -8649,27 +8977,27 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "dismissed": true, - "error": "string", - "healthy": true, - "latency": "string", - "latency_ms": 0, - "reachable": true, - "severity": "ok", - "threshold_ms": 0, - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ] + "dismissed": true, + "error": "string", + "healthy": true, + "latency": "string", + "latency_ms": 0, + "reachable": true, + "severity": "ok", + "threshold_ms": 0, + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------- | ----------------------------------------- | -------- | ------------ | ------------------------------------------------------------------------------------------- | +|----------------|-------------------------------------------|----------|--------------|---------------------------------------------------------------------------------------------| | `dismissed` | boolean | false | | | | `error` | string | false | | | | `healthy` | boolean | false | | Healthy is deprecated and left for backward compatibility purposes, use `Severity` instead. | @@ -8683,7 +9011,7 @@ If the schedule is empty, the user will be updated to use the default schedule.| #### Enumerated Values | Property | Value | -| ---------- | --------- | +|------------|-----------| | `severity` | `ok` | | `severity` | `warning` | | `severity` | `error` | @@ -8699,7 +9027,7 @@ If the schedule is empty, the user will be updated to use the default schedule.| #### Enumerated Values | Value | -| -------------------- | +|----------------------| | `DERP` | | `AccessURL` | | `Websocket` | @@ -8711,354 +9039,380 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "dismissed_healthchecks": ["DERP"] + "dismissed_healthchecks": [ + "DERP" + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------------ | ----------------------------------------------------------- | -------- | ------------ | ----------- | +|--------------------------|-------------------------------------------------------------|----------|--------------|-------------| | `dismissed_healthchecks` | array of [healthsdk.HealthSection](#healthsdkhealthsection) | false | | | ## healthsdk.HealthcheckReport ```json { - "access_url": { - "access_url": "string", - "dismissed": true, - "error": "string", - "healthy": true, - "healthz_response": "string", - "reachable": true, - "severity": "ok", - "status_code": 0, - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ] - }, - "coder_version": "string", - "database": { - "dismissed": true, - "error": "string", - "healthy": true, - "latency": "string", - "latency_ms": 0, - "reachable": true, - "severity": "ok", - "threshold_ms": 0, - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ] - }, - "derp": { - "dismissed": true, - "error": "string", - "healthy": true, - "netcheck": { - "captivePortal": "string", - "globalV4": "string", - "globalV6": "string", - "hairPinning": "string", - "icmpv4": true, - "ipv4": true, - "ipv4CanSend": true, - "ipv6": true, - "ipv6CanSend": true, - "mappingVariesByDestIP": "string", - "oshasIPv6": true, - "pcp": "string", - "pmp": "string", - "preferredDERP": 0, - "regionLatency": { - "property1": 0, - "property2": 0 - }, - "regionV4Latency": { - "property1": 0, - "property2": 0 - }, - "regionV6Latency": { - "property1": 0, - "property2": 0 - }, - "udp": true, - "upnP": "string" - }, - "netcheck_err": "string", - "netcheck_logs": ["string"], - "regions": { - "property1": { - "error": "string", - "healthy": true, - "node_reports": [ - { - "can_exchange_messages": true, - "client_errs": [["string"]], - "client_logs": [["string"]], - "error": "string", - "healthy": true, - "node": { - "canPort80": true, - "certName": "string", - "derpport": 0, - "forceHTTP": true, - "hostName": "string", - "insecureForTests": true, - "ipv4": "string", - "ipv6": "string", - "name": "string", - "regionID": 0, - "stunonly": true, - "stunport": 0, - "stuntestIP": "string" - }, - "node_info": { - "tokenBucketBytesBurst": 0, - "tokenBucketBytesPerSecond": 0 - }, - "round_trip_ping": "string", - "round_trip_ping_ms": 0, - "severity": "ok", - "stun": { - "canSTUN": true, - "enabled": true, - "error": "string" - }, - "uses_websocket": true, - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ] - } - ], - "region": { - "avoid": true, - "embeddedRelay": true, - "nodes": [ - { - "canPort80": true, - "certName": "string", - "derpport": 0, - "forceHTTP": true, - "hostName": "string", - "insecureForTests": true, - "ipv4": "string", - "ipv6": "string", - "name": "string", - "regionID": 0, - "stunonly": true, - "stunport": 0, - "stuntestIP": "string" - } - ], - "regionCode": "string", - "regionID": 0, - "regionName": "string" - }, - "severity": "ok", - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ] - }, - "property2": { - "error": "string", - "healthy": true, - "node_reports": [ - { - "can_exchange_messages": true, - "client_errs": [["string"]], - "client_logs": [["string"]], - "error": "string", - "healthy": true, - "node": { - "canPort80": true, - "certName": "string", - "derpport": 0, - "forceHTTP": true, - "hostName": "string", - "insecureForTests": true, - "ipv4": "string", - "ipv6": "string", - "name": "string", - "regionID": 0, - "stunonly": true, - "stunport": 0, - "stuntestIP": "string" - }, - "node_info": { - "tokenBucketBytesBurst": 0, - "tokenBucketBytesPerSecond": 0 - }, - "round_trip_ping": "string", - "round_trip_ping_ms": 0, - "severity": "ok", - "stun": { - "canSTUN": true, - "enabled": true, - "error": "string" - }, - "uses_websocket": true, - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ] - } - ], - "region": { - "avoid": true, - "embeddedRelay": true, - "nodes": [ - { - "canPort80": true, - "certName": "string", - "derpport": 0, - "forceHTTP": true, - "hostName": "string", - "insecureForTests": true, - "ipv4": "string", - "ipv6": "string", - "name": "string", - "regionID": 0, - "stunonly": true, - "stunport": 0, - "stuntestIP": "string" - } - ], - "regionCode": "string", - "regionID": 0, - "regionName": "string" - }, - "severity": "ok", - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ] - } - }, - "severity": "ok", - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ] - }, - "healthy": true, - "provisioner_daemons": { - "dismissed": true, - "error": "string", - "items": [ - { - "provisioner_daemon": { - "api_version": "string", - "created_at": "2019-08-24T14:15:22Z", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "key_id": "1e779c8a-6786-4c89-b7c3-a6666f5fd6b5", - "last_seen_at": "2019-08-24T14:15:22Z", - "name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "provisioners": ["string"], - "tags": { - "property1": "string", - "property2": "string" - }, - "version": "string" - }, - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ] - } - ], - "severity": "ok", - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ] - }, - "severity": "ok", - "time": "2019-08-24T14:15:22Z", - "websocket": { - "body": "string", - "code": 0, - "dismissed": true, - "error": "string", - "healthy": true, - "severity": "ok", - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ] - }, - "workspace_proxy": { - "dismissed": true, - "error": "string", - "healthy": true, - "severity": "ok", - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ], - "workspace_proxies": { - "regions": [ - { - "created_at": "2019-08-24T14:15:22Z", - "deleted": true, - "derp_enabled": true, - "derp_only": true, - "display_name": "string", - "healthy": true, - "icon_url": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "name": "string", - "path_app_url": "string", - "status": { - "checked_at": "2019-08-24T14:15:22Z", - "report": { - "errors": ["string"], - "warnings": ["string"] - }, - "status": "ok" - }, - "updated_at": "2019-08-24T14:15:22Z", - "version": "string", - "wildcard_hostname": "string" - } - ] - } - } + "access_url": { + "access_url": "string", + "dismissed": true, + "error": "string", + "healthy": true, + "healthz_response": "string", + "reachable": true, + "severity": "ok", + "status_code": 0, + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ] + }, + "coder_version": "string", + "database": { + "dismissed": true, + "error": "string", + "healthy": true, + "latency": "string", + "latency_ms": 0, + "reachable": true, + "severity": "ok", + "threshold_ms": 0, + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ] + }, + "derp": { + "dismissed": true, + "error": "string", + "healthy": true, + "netcheck": { + "captivePortal": "string", + "globalV4": "string", + "globalV6": "string", + "hairPinning": "string", + "icmpv4": true, + "ipv4": true, + "ipv4CanSend": true, + "ipv6": true, + "ipv6CanSend": true, + "mappingVariesByDestIP": "string", + "oshasIPv6": true, + "pcp": "string", + "pmp": "string", + "preferredDERP": 0, + "regionLatency": { + "property1": 0, + "property2": 0 + }, + "regionV4Latency": { + "property1": 0, + "property2": 0 + }, + "regionV6Latency": { + "property1": 0, + "property2": 0 + }, + "udp": true, + "upnP": "string" + }, + "netcheck_err": "string", + "netcheck_logs": [ + "string" + ], + "regions": { + "property1": { + "error": "string", + "healthy": true, + "node_reports": [ + { + "can_exchange_messages": true, + "client_errs": [ + [ + "string" + ] + ], + "client_logs": [ + [ + "string" + ] + ], + "error": "string", + "healthy": true, + "node": { + "canPort80": true, + "certName": "string", + "derpport": 0, + "forceHTTP": true, + "hostName": "string", + "insecureForTests": true, + "ipv4": "string", + "ipv6": "string", + "name": "string", + "regionID": 0, + "stunonly": true, + "stunport": 0, + "stuntestIP": "string" + }, + "node_info": { + "tokenBucketBytesBurst": 0, + "tokenBucketBytesPerSecond": 0 + }, + "round_trip_ping": "string", + "round_trip_ping_ms": 0, + "severity": "ok", + "stun": { + "canSTUN": true, + "enabled": true, + "error": "string" + }, + "uses_websocket": true, + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ] + } + ], + "region": { + "avoid": true, + "embeddedRelay": true, + "nodes": [ + { + "canPort80": true, + "certName": "string", + "derpport": 0, + "forceHTTP": true, + "hostName": "string", + "insecureForTests": true, + "ipv4": "string", + "ipv6": "string", + "name": "string", + "regionID": 0, + "stunonly": true, + "stunport": 0, + "stuntestIP": "string" + } + ], + "regionCode": "string", + "regionID": 0, + "regionName": "string" + }, + "severity": "ok", + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ] + }, + "property2": { + "error": "string", + "healthy": true, + "node_reports": [ + { + "can_exchange_messages": true, + "client_errs": [ + [ + "string" + ] + ], + "client_logs": [ + [ + "string" + ] + ], + "error": "string", + "healthy": true, + "node": { + "canPort80": true, + "certName": "string", + "derpport": 0, + "forceHTTP": true, + "hostName": "string", + "insecureForTests": true, + "ipv4": "string", + "ipv6": "string", + "name": "string", + "regionID": 0, + "stunonly": true, + "stunport": 0, + "stuntestIP": "string" + }, + "node_info": { + "tokenBucketBytesBurst": 0, + "tokenBucketBytesPerSecond": 0 + }, + "round_trip_ping": "string", + "round_trip_ping_ms": 0, + "severity": "ok", + "stun": { + "canSTUN": true, + "enabled": true, + "error": "string" + }, + "uses_websocket": true, + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ] + } + ], + "region": { + "avoid": true, + "embeddedRelay": true, + "nodes": [ + { + "canPort80": true, + "certName": "string", + "derpport": 0, + "forceHTTP": true, + "hostName": "string", + "insecureForTests": true, + "ipv4": "string", + "ipv6": "string", + "name": "string", + "regionID": 0, + "stunonly": true, + "stunport": 0, + "stuntestIP": "string" + } + ], + "regionCode": "string", + "regionID": 0, + "regionName": "string" + }, + "severity": "ok", + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ] + } + }, + "severity": "ok", + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ] + }, + "healthy": true, + "provisioner_daemons": { + "dismissed": true, + "error": "string", + "items": [ + { + "provisioner_daemon": { + "api_version": "string", + "created_at": "2019-08-24T14:15:22Z", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "key_id": "1e779c8a-6786-4c89-b7c3-a6666f5fd6b5", + "last_seen_at": "2019-08-24T14:15:22Z", + "name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "provisioners": [ + "string" + ], + "tags": { + "property1": "string", + "property2": "string" + }, + "version": "string" + }, + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ] + } + ], + "severity": "ok", + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ] + }, + "severity": "ok", + "time": "2019-08-24T14:15:22Z", + "websocket": { + "body": "string", + "code": 0, + "dismissed": true, + "error": "string", + "healthy": true, + "severity": "ok", + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ] + }, + "workspace_proxy": { + "dismissed": true, + "error": "string", + "healthy": true, + "severity": "ok", + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ], + "workspace_proxies": { + "regions": [ + { + "created_at": "2019-08-24T14:15:22Z", + "deleted": true, + "derp_enabled": true, + "derp_only": true, + "display_name": "string", + "healthy": true, + "icon_url": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "name": "string", + "path_app_url": "string", + "status": { + "checked_at": "2019-08-24T14:15:22Z", + "report": { + "errors": [ + "string" + ], + "warnings": [ + "string" + ] + }, + "status": "ok" + }, + "updated_at": "2019-08-24T14:15:22Z", + "version": "string", + "wildcard_hostname": "string" + } + ] + } + } } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| --------------------- | ------------------------------------------------------------------------ | -------- | ------------ | ----------------------------------------------------------------------------------- | +|-----------------------|--------------------------------------------------------------------------|----------|--------------|-------------------------------------------------------------------------------------| | `access_url` | [healthsdk.AccessURLReport](#healthsdkaccessurlreport) | false | | | | `coder_version` | string | false | | The Coder version of the server that the report was generated on. | | `database` | [healthsdk.DatabaseReport](#healthsdkdatabasereport) | false | | | @@ -9073,7 +9427,7 @@ If the schedule is empty, the user will be updated to use the default schedule.| #### Enumerated Values | Property | Value | -| ---------- | --------- | +|------------|-----------| | `severity` | `ok` | | `severity` | `warning` | | `severity` | `error` | @@ -9082,47 +9436,49 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "dismissed": true, - "error": "string", - "items": [ - { - "provisioner_daemon": { - "api_version": "string", - "created_at": "2019-08-24T14:15:22Z", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "key_id": "1e779c8a-6786-4c89-b7c3-a6666f5fd6b5", - "last_seen_at": "2019-08-24T14:15:22Z", - "name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "provisioners": ["string"], - "tags": { - "property1": "string", - "property2": "string" - }, - "version": "string" - }, - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ] - } - ], - "severity": "ok", - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ] + "dismissed": true, + "error": "string", + "items": [ + { + "provisioner_daemon": { + "api_version": "string", + "created_at": "2019-08-24T14:15:22Z", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "key_id": "1e779c8a-6786-4c89-b7c3-a6666f5fd6b5", + "last_seen_at": "2019-08-24T14:15:22Z", + "name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "provisioners": [ + "string" + ], + "tags": { + "property1": "string", + "property2": "string" + }, + "version": "string" + }, + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ] + } + ], + "severity": "ok", + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ----------- | ----------------------------------------------------------------------------------------- | -------- | ------------ | ----------- | +|-------------|-------------------------------------------------------------------------------------------|----------|--------------|-------------| | `dismissed` | boolean | false | | | | `error` | string | false | | | | `items` | array of [healthsdk.ProvisionerDaemonsReportItem](#healthsdkprovisionerdaemonsreportitem) | false | | | @@ -9132,7 +9488,7 @@ If the schedule is empty, the user will be updated to use the default schedule.| #### Enumerated Values | Property | Value | -| ---------- | --------- | +|------------|-----------| | `severity` | `ok` | | `severity` | `warning` | | `severity` | `error` | @@ -9141,34 +9497,36 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "provisioner_daemon": { - "api_version": "string", - "created_at": "2019-08-24T14:15:22Z", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "key_id": "1e779c8a-6786-4c89-b7c3-a6666f5fd6b5", - "last_seen_at": "2019-08-24T14:15:22Z", - "name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "provisioners": ["string"], - "tags": { - "property1": "string", - "property2": "string" - }, - "version": "string" - }, - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ] + "provisioner_daemon": { + "api_version": "string", + "created_at": "2019-08-24T14:15:22Z", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "key_id": "1e779c8a-6786-4c89-b7c3-a6666f5fd6b5", + "last_seen_at": "2019-08-24T14:15:22Z", + "name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "provisioners": [ + "string" + ], + "tags": { + "property1": "string", + "property2": "string" + }, + "version": "string" + }, + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------------- | -------------------------------------------------------- | -------- | ------------ | ----------- | +|----------------------|----------------------------------------------------------|----------|--------------|-------------| | `provisioner_daemon` | [codersdk.ProvisionerDaemon](#codersdkprovisionerdaemon) | false | | | | `warnings` | array of [health.Message](#healthmessage) | false | | | @@ -9176,16 +9534,16 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "canSTUN": true, - "enabled": true, - "error": "string" + "canSTUN": true, + "enabled": true, + "error": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| --------- | ------- | -------- | ------------ | ----------- | +|-----------|---------|----------|--------------|-------------| | `canSTUN` | boolean | false | | | | `enabled` | boolean | false | | | | `error` | string | false | | | @@ -9194,39 +9552,41 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "dismissed_healthchecks": ["DERP"] + "dismissed_healthchecks": [ + "DERP" + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------------ | ----------------------------------------------------------- | -------- | ------------ | ----------- | +|--------------------------|-------------------------------------------------------------|----------|--------------|-------------| | `dismissed_healthchecks` | array of [healthsdk.HealthSection](#healthsdkhealthsection) | false | | | ## healthsdk.WebsocketReport ```json { - "body": "string", - "code": 0, - "dismissed": true, - "error": "string", - "healthy": true, - "severity": "ok", - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ] + "body": "string", + "code": 0, + "dismissed": true, + "error": "string", + "healthy": true, + "severity": "ok", + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ----------- | ----------------------------------------- | -------- | ------------ | ------------------------------------------------------------------------------------------- | +|-------------|-------------------------------------------|----------|--------------|---------------------------------------------------------------------------------------------| | `body` | string | false | | | | `code` | integer | false | | | | `dismissed` | boolean | false | | | @@ -9238,7 +9598,7 @@ If the schedule is empty, the user will be updated to use the default schedule.| #### Enumerated Values | Property | Value | -| ---------- | --------- | +|------------|-----------| | `severity` | `ok` | | `severity` | `warning` | | `severity` | `error` | @@ -9247,50 +9607,54 @@ If the schedule is empty, the user will be updated to use the default schedule.| ```json { - "dismissed": true, - "error": "string", - "healthy": true, - "severity": "ok", - "warnings": [ - { - "code": "EUNKNOWN", - "message": "string" - } - ], - "workspace_proxies": { - "regions": [ - { - "created_at": "2019-08-24T14:15:22Z", - "deleted": true, - "derp_enabled": true, - "derp_only": true, - "display_name": "string", - "healthy": true, - "icon_url": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "name": "string", - "path_app_url": "string", - "status": { - "checked_at": "2019-08-24T14:15:22Z", - "report": { - "errors": ["string"], - "warnings": ["string"] - }, - "status": "ok" - }, - "updated_at": "2019-08-24T14:15:22Z", - "version": "string", - "wildcard_hostname": "string" - } - ] - } + "dismissed": true, + "error": "string", + "healthy": true, + "severity": "ok", + "warnings": [ + { + "code": "EUNKNOWN", + "message": "string" + } + ], + "workspace_proxies": { + "regions": [ + { + "created_at": "2019-08-24T14:15:22Z", + "deleted": true, + "derp_enabled": true, + "derp_only": true, + "display_name": "string", + "healthy": true, + "icon_url": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "name": "string", + "path_app_url": "string", + "status": { + "checked_at": "2019-08-24T14:15:22Z", + "report": { + "errors": [ + "string" + ], + "warnings": [ + "string" + ] + }, + "status": "ok" + }, + "updated_at": "2019-08-24T14:15:22Z", + "version": "string", + "wildcard_hostname": "string" + } + ] + } } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------- | ---------------------------------------------------------------------------------------------------- | -------- | ------------ | ------------------------------------------------------------------------------------------- | +|---------------------|------------------------------------------------------------------------------------------------------|----------|--------------|---------------------------------------------------------------------------------------------| | `dismissed` | boolean | false | | | | `error` | string | false | | | | `healthy` | boolean | false | | Healthy is deprecated and left for backward compatibility purposes, use `Severity` instead. | @@ -9301,7 +9665,7 @@ If the schedule is empty, the user will be updated to use the default schedule.| #### Enumerated Values | Property | Value | -| ---------- | --------- | +|------------|-----------| | `severity` | `ok` | | `severity` | `warning` | | `severity` | `error` | @@ -9314,47 +9678,47 @@ If the schedule is empty, the user will be updated to use the default schedule.| ### Properties -_None_ +None ## netcheck.Report ```json { - "captivePortal": "string", - "globalV4": "string", - "globalV6": "string", - "hairPinning": "string", - "icmpv4": true, - "ipv4": true, - "ipv4CanSend": true, - "ipv6": true, - "ipv6CanSend": true, - "mappingVariesByDestIP": "string", - "oshasIPv6": true, - "pcp": "string", - "pmp": "string", - "preferredDERP": 0, - "regionLatency": { - "property1": 0, - "property2": 0 - }, - "regionV4Latency": { - "property1": 0, - "property2": 0 - }, - "regionV6Latency": { - "property1": 0, - "property2": 0 - }, - "udp": true, - "upnP": "string" + "captivePortal": "string", + "globalV4": "string", + "globalV6": "string", + "hairPinning": "string", + "icmpv4": true, + "ipv4": true, + "ipv4CanSend": true, + "ipv6": true, + "ipv6CanSend": true, + "mappingVariesByDestIP": "string", + "oshasIPv6": true, + "pcp": "string", + "pmp": "string", + "preferredDERP": 0, + "regionLatency": { + "property1": 0, + "property2": 0 + }, + "regionV4Latency": { + "property1": 0, + "property2": 0 + }, + "regionV6Latency": { + "property1": 0, + "property2": 0 + }, + "udp": true, + "upnP": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ----------------------- | ------- | -------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------- | +|-------------------------|---------|----------|--------------|------------------------------------------------------------------------------------------------------------------------------------| | `captivePortal` | string | false | | Captiveportal is set when we think there's a captive portal that is intercepting HTTP traffic. | | `globalV4` | string | false | | ip:port of global IPv4 | | `globalV6` | string | false | | [ip]:port of global IPv6 | @@ -9382,24 +9746,24 @@ _None_ ```json { - "access_token": "string", - "expires_in": 0, - "expiry": "string", - "refresh_token": "string", - "token_type": "string" + "access_token": "string", + "expires_in": 0, + "expiry": "string", + "refresh_token": "string", + "token_type": "string" } ``` ### Properties -| Name | Type | Required | Restrictions | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | -------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `access_token` | string | false | | Access token is the token that authorizes and authenticates the requests. | -| `expires_in` | integer | false | | Expires in is the OAuth2 wire format "expires_in" field, which specifies how many seconds later the token expires, relative to an unknown time base approximately around "now". It is the application's responsibility to populate `Expiry` from `ExpiresIn` when required. | -| `expiry` | string | false | | Expiry is the optional expiration time of the access token. | -| If zero, TokenSource implementations will reuse the same token forever and RefreshToken or equivalent mechanisms for that TokenSource will not be used. | -| `refresh_token` | string | false | | Refresh token is a token that's used by the application (as opposed to the user) to refresh the access token if it expires. | -| `token_type` | string | false | | Token type is the type of token. The Type method returns either this or "Bearer", the default. | +| Name | Type | Required | Restrictions | Description | +|----------------|---------|----------|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `access_token` | string | false | | Access token is the token that authorizes and authenticates the requests. | +| `expires_in` | integer | false | | Expires in is the OAuth2 wire format "expires_in" field, which specifies how many seconds later the token expires, relative to an unknown time base approximately around "now". It is the application's responsibility to populate `Expiry` from `ExpiresIn` when required. | +|`expiry`|string|false||Expiry is the optional expiration time of the access token. +If zero, TokenSource implementations will reuse the same token forever and RefreshToken or equivalent mechanisms for that TokenSource will not be used.| +|`refresh_token`|string|false||Refresh token is a token that's used by the application (as opposed to the user) to refresh the access token if it expires.| +|`token_type`|string|false||Token type is the type of token. The Type method returns either this or "Bearer", the default.| ## regexp.Regexp @@ -9409,43 +9773,43 @@ _None_ ### Properties -_None_ +None ## serpent.Annotations ```json { - "property1": "string", - "property2": "string" + "property1": "string", + "property2": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------------- | ------ | -------- | ------------ | ----------- | +|------------------|--------|----------|--------------|-------------| | `[any property]` | string | false | | | ## serpent.Group ```json { - "description": "string", - "name": "string", - "parent": { - "description": "string", - "name": "string", - "parent": {}, - "yaml": "string" - }, - "yaml": "string" + "description": "string", + "name": "string", + "parent": { + "description": "string", + "name": "string", + "parent": {}, + "yaml": "string" + }, + "yaml": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------- | ------------------------------ | -------- | ------------ | ----------- | +|---------------|--------------------------------|----------|--------------|-------------| | `description` | string | false | | | | `name` | string | false | | | | `parent` | [serpent.Group](#serpentgroup) | false | | | @@ -9455,15 +9819,15 @@ _None_ ```json { - "host": "string", - "port": "string" + "host": "string", + "port": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------ | ------ | -------- | ------------ | ----------- | +|--------|--------|----------|--------------|-------------| | `host` | string | false | | | | `port` | string | false | | | @@ -9471,70 +9835,70 @@ _None_ ```json { - "annotations": { - "property1": "string", - "property2": "string" - }, - "default": "string", - "description": "string", - "env": "string", - "flag": "string", - "flag_shorthand": "string", - "group": { - "description": "string", - "name": "string", - "parent": { - "description": "string", - "name": "string", - "parent": {}, - "yaml": "string" - }, - "yaml": "string" - }, - "hidden": true, - "name": "string", - "required": true, - "use_instead": [ - { - "annotations": { - "property1": "string", - "property2": "string" - }, - "default": "string", - "description": "string", - "env": "string", - "flag": "string", - "flag_shorthand": "string", - "group": { - "description": "string", - "name": "string", - "parent": { - "description": "string", - "name": "string", - "parent": {}, - "yaml": "string" - }, - "yaml": "string" - }, - "hidden": true, - "name": "string", - "required": true, - "use_instead": [], - "value": null, - "value_source": "", - "yaml": "string" - } - ], - "value": null, - "value_source": "", - "yaml": "string" + "annotations": { + "property1": "string", + "property2": "string" + }, + "default": "string", + "description": "string", + "env": "string", + "flag": "string", + "flag_shorthand": "string", + "group": { + "description": "string", + "name": "string", + "parent": { + "description": "string", + "name": "string", + "parent": {}, + "yaml": "string" + }, + "yaml": "string" + }, + "hidden": true, + "name": "string", + "required": true, + "use_instead": [ + { + "annotations": { + "property1": "string", + "property2": "string" + }, + "default": "string", + "description": "string", + "env": "string", + "flag": "string", + "flag_shorthand": "string", + "group": { + "description": "string", + "name": "string", + "parent": { + "description": "string", + "name": "string", + "parent": {}, + "yaml": "string" + }, + "yaml": "string" + }, + "hidden": true, + "name": "string", + "required": true, + "use_instead": [], + "value": null, + "value_source": "", + "yaml": "string" + } + ], + "value": null, + "value_source": "", + "yaml": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------------- | ------------------------------------------ | -------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------- | +|------------------|--------------------------------------------|----------|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------| | `annotations` | [serpent.Annotations](#serpentannotations) | false | | Annotations enable extensions to serpent higher up in the stack. It's useful for help formatting and documentation generation. | | `default` | string | false | | Default is parsed into Value if set. | | `description` | string | false | | | @@ -9558,82 +9922,84 @@ _None_ ### Properties -_None_ +None ## serpent.Struct-array_codersdk_ExternalAuthConfig ```json { - "value": [ - { - "app_install_url": "string", - "app_installations_url": "string", - "auth_url": "string", - "client_id": "string", - "device_code_url": "string", - "device_flow": true, - "display_icon": "string", - "display_name": "string", - "id": "string", - "no_refresh": true, - "regex": "string", - "scopes": ["string"], - "token_url": "string", - "type": "string", - "validate_url": "string" - } - ] + "value": [ + { + "app_install_url": "string", + "app_installations_url": "string", + "auth_url": "string", + "client_id": "string", + "device_code_url": "string", + "device_flow": true, + "display_icon": "string", + "display_name": "string", + "id": "string", + "no_refresh": true, + "regex": "string", + "scopes": [ + "string" + ], + "token_url": "string", + "type": "string", + "validate_url": "string" + } + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------- | ------------------------------------------------------------------- | -------- | ------------ | ----------- | +|---------|---------------------------------------------------------------------|----------|--------------|-------------| | `value` | array of [codersdk.ExternalAuthConfig](#codersdkexternalauthconfig) | false | | | ## serpent.Struct-array_codersdk_LinkConfig ```json { - "value": [ - { - "icon": "bug", - "name": "string", - "target": "string" - } - ] + "value": [ + { + "icon": "bug", + "name": "string", + "target": "string" + } + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------- | --------------------------------------------------- | -------- | ------------ | ----------- | +|---------|-----------------------------------------------------|----------|--------------|-------------| | `value` | array of [codersdk.LinkConfig](#codersdklinkconfig) | false | | | ## serpent.URL ```json { - "forceQuery": true, - "fragment": "string", - "host": "string", - "omitHost": true, - "opaque": "string", - "path": "string", - "rawFragment": "string", - "rawPath": "string", - "rawQuery": "string", - "scheme": "string", - "user": {} + "forceQuery": true, + "fragment": "string", + "host": "string", + "omitHost": true, + "opaque": "string", + "path": "string", + "rawFragment": "string", + "rawPath": "string", + "rawQuery": "string", + "scheme": "string", + "user": {} } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------- | ---------------------------- | -------- | ------------ | -------------------------------------------------- | +|---------------|------------------------------|----------|--------------|----------------------------------------------------| | `forceQuery` | boolean | false | | append a query ('?') even if RawQuery is empty | | `fragment` | string | false | | fragment for references, without '#' | | `host` | string | false | | host or host:port (see Hostname and Port methods) | @@ -9657,7 +10023,7 @@ _None_ #### Enumerated Values | Value | -| --------- | +|-----------| | `` | | `flag` | | `env` | @@ -9668,19 +10034,18 @@ _None_ ```json { - "regionScore": { - "property1": 0, - "property2": 0 - } + "regionScore": { + "property1": 0, + "property2": 0 + } } ``` ### Properties -| Name | Type | Required | Restrictions | Description | -| ------------- | ------ | -------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `regionScore` | object | false | | Regionscore scales latencies of DERP regions by a given scaling factor when determining which region to use as the home ("preferred") DERP. Scores in the range (0, 1) will cause this region to be proportionally more preferred, and scores in the range (1, ∞) will penalize a region. | - +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|`regionScore`|object|false||Regionscore scales latencies of DERP regions by a given scaling factor when determining which region to use as the home ("preferred") DERP. Scores in the range (0, 1) will cause this region to be proportionally more preferred, and scores in the range (1, ∞) will penalize a region. If a region is not present in this map, it is treated as having a score of 1.0. Scores should not be 0 or negative; such scores will be ignored. A nil map means no change from the previous value (if any); an empty non-nil map can be sent to reset all scores back to 1.0.| @@ -9690,76 +10055,75 @@ A nil map means no change from the previous value (if any); an empty non-nil map ```json { - "homeParams": { - "regionScore": { - "property1": 0, - "property2": 0 - } - }, - "omitDefaultRegions": true, - "regions": { - "property1": { - "avoid": true, - "embeddedRelay": true, - "nodes": [ - { - "canPort80": true, - "certName": "string", - "derpport": 0, - "forceHTTP": true, - "hostName": "string", - "insecureForTests": true, - "ipv4": "string", - "ipv6": "string", - "name": "string", - "regionID": 0, - "stunonly": true, - "stunport": 0, - "stuntestIP": "string" - } - ], - "regionCode": "string", - "regionID": 0, - "regionName": "string" - }, - "property2": { - "avoid": true, - "embeddedRelay": true, - "nodes": [ - { - "canPort80": true, - "certName": "string", - "derpport": 0, - "forceHTTP": true, - "hostName": "string", - "insecureForTests": true, - "ipv4": "string", - "ipv6": "string", - "name": "string", - "regionID": 0, - "stunonly": true, - "stunport": 0, - "stuntestIP": "string" - } - ], - "regionCode": "string", - "regionID": 0, - "regionName": "string" - } - } -} -``` - -### Properties - -| Name | Type | Required | Restrictions | Description | -| ---------------------------------------------------------------------------------- | ------------------------------------------------ | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `homeParams` | [tailcfg.DERPHomeParams](#tailcfgderphomeparams) | false | | Homeparams if non-nil, is a change in home parameters. | -| The rest of the DEPRMap fields, if zero, means unchanged. | -| `omitDefaultRegions` | boolean | false | | Omitdefaultregions specifies to not use Tailscale's DERP servers, and only use those specified in this DERPMap. If there are none set outside of the defaults, this is a noop. | -| This field is only meaningful if the Regions map is non-nil (indicating a change). | -| `regions` | object | false | | Regions is the set of geographic regions running DERP node(s). | - + "homeParams": { + "regionScore": { + "property1": 0, + "property2": 0 + } + }, + "omitDefaultRegions": true, + "regions": { + "property1": { + "avoid": true, + "embeddedRelay": true, + "nodes": [ + { + "canPort80": true, + "certName": "string", + "derpport": 0, + "forceHTTP": true, + "hostName": "string", + "insecureForTests": true, + "ipv4": "string", + "ipv6": "string", + "name": "string", + "regionID": 0, + "stunonly": true, + "stunport": 0, + "stuntestIP": "string" + } + ], + "regionCode": "string", + "regionID": 0, + "regionName": "string" + }, + "property2": { + "avoid": true, + "embeddedRelay": true, + "nodes": [ + { + "canPort80": true, + "certName": "string", + "derpport": 0, + "forceHTTP": true, + "hostName": "string", + "insecureForTests": true, + "ipv4": "string", + "ipv6": "string", + "name": "string", + "regionID": 0, + "stunonly": true, + "stunport": 0, + "stuntestIP": "string" + } + ], + "regionCode": "string", + "regionID": 0, + "regionName": "string" + } + } +} +``` + +### Properties + +|Name|Type|Required|Restrictions|Description| +|---|---|---|---|---| +|`homeParams`|[tailcfg.DERPHomeParams](#tailcfgderphomeparams)|false||Homeparams if non-nil, is a change in home parameters. +The rest of the DEPRMap fields, if zero, means unchanged.| +|`omitDefaultRegions`|boolean|false||Omitdefaultregions specifies to not use Tailscale's DERP servers, and only use those specified in this DERPMap. If there are none set outside of the defaults, this is a noop. +This field is only meaningful if the Regions map is non-nil (indicating a change).| +|`regions`|object|false||Regions is the set of geographic regions running DERP node(s). It's keyed by the DERPRegion.RegionID. The numbers are not necessarily contiguous.| |» `[any property]`|[tailcfg.DERPRegion](#tailcfgderpregion)|false||| @@ -9768,82 +10132,81 @@ The numbers are not necessarily contiguous.| ```json { - "canPort80": true, - "certName": "string", - "derpport": 0, - "forceHTTP": true, - "hostName": "string", - "insecureForTests": true, - "ipv4": "string", - "ipv6": "string", - "name": "string", - "regionID": 0, - "stunonly": true, - "stunport": 0, - "stuntestIP": "string" + "canPort80": true, + "certName": "string", + "derpport": 0, + "forceHTTP": true, + "hostName": "string", + "insecureForTests": true, + "ipv4": "string", + "ipv6": "string", + "name": "string", + "regionID": 0, + "stunonly": true, + "stunport": 0, + "stuntestIP": "string" } ``` ### Properties -| Name | Type | Required | Restrictions | Description | -| --------------------------------------------------------------------------------------------------------------------- | ------- | -------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `canPort80` | boolean | false | | Canport80 specifies whether this DERP node is accessible over HTTP on port 80 specifically. This is used for captive portal checks. | -| `certName` | string | false | | Certname optionally specifies the expected TLS cert common name. If empty, HostName is used. If CertName is non-empty, HostName is only used for the TCP dial (if IPv4/IPv6 are not present) + TLS ClientHello. | -| `derpport` | integer | false | | Derpport optionally provides an alternate TLS port number for the DERP HTTPS server. | -| If zero, 443 is used. | -| `forceHTTP` | boolean | false | | Forcehttp is used by unit tests to force HTTP. It should not be set by users. | -| `hostName` | string | false | | Hostname is the DERP node's hostname. | -| It is required but need not be unique; multiple nodes may have the same HostName but vary in configuration otherwise. | -| `insecureForTests` | boolean | false | | Insecurefortests is used by unit tests to disable TLS verification. It should not be set by users. | -| `ipv4` | string | false | | Ipv4 optionally forces an IPv4 address to use, instead of using DNS. If empty, A record(s) from DNS lookups of HostName are used. If the string is not an IPv4 address, IPv4 is not used; the conventional string to disable IPv4 (and not use DNS) is "none". | -| `ipv6` | string | false | | Ipv6 optionally forces an IPv6 address to use, instead of using DNS. If empty, AAAA record(s) from DNS lookups of HostName are used. If the string is not an IPv6 address, IPv6 is not used; the conventional string to disable IPv6 (and not use DNS) is "none". | -| `name` | string | false | | Name is a unique node name (across all regions). It is not a host name. It's typically of the form "1b", "2a", "3b", etc. (region ID + suffix within that region) | -| `regionID` | integer | false | | Regionid is the RegionID of the DERPRegion that this node is running in. | -| `stunonly` | boolean | false | | Stunonly marks a node as only a STUN server and not a DERP server. | -| `stunport` | integer | false | | Port optionally specifies a STUN port to use. Zero means 3478. To disable STUN on this node, use -1. | -| `stuntestIP` | string | false | | Stuntestip is used in tests to override the STUN server's IP. If empty, it's assumed to be the same as the DERP server. | +| Name | Type | Required | Restrictions | Description | +|-------------|---------|----------|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `canPort80` | boolean | false | | Canport80 specifies whether this DERP node is accessible over HTTP on port 80 specifically. This is used for captive portal checks. | +| `certName` | string | false | | Certname optionally specifies the expected TLS cert common name. If empty, HostName is used. If CertName is non-empty, HostName is only used for the TCP dial (if IPv4/IPv6 are not present) + TLS ClientHello. | +|`derpport`|integer|false||Derpport optionally provides an alternate TLS port number for the DERP HTTPS server. +If zero, 443 is used.| +|`forceHTTP`|boolean|false||Forcehttp is used by unit tests to force HTTP. It should not be set by users.| +|`hostName`|string|false||Hostname is the DERP node's hostname. +It is required but need not be unique; multiple nodes may have the same HostName but vary in configuration otherwise.| +|`insecureForTests`|boolean|false||Insecurefortests is used by unit tests to disable TLS verification. It should not be set by users.| +|`ipv4`|string|false||Ipv4 optionally forces an IPv4 address to use, instead of using DNS. If empty, A record(s) from DNS lookups of HostName are used. If the string is not an IPv4 address, IPv4 is not used; the conventional string to disable IPv4 (and not use DNS) is "none".| +|`ipv6`|string|false||Ipv6 optionally forces an IPv6 address to use, instead of using DNS. If empty, AAAA record(s) from DNS lookups of HostName are used. If the string is not an IPv6 address, IPv6 is not used; the conventional string to disable IPv6 (and not use DNS) is "none".| +|`name`|string|false||Name is a unique node name (across all regions). It is not a host name. It's typically of the form "1b", "2a", "3b", etc. (region ID + suffix within that region)| +|`regionID`|integer|false||Regionid is the RegionID of the DERPRegion that this node is running in.| +|`stunonly`|boolean|false||Stunonly marks a node as only a STUN server and not a DERP server.| +|`stunport`|integer|false||Port optionally specifies a STUN port to use. Zero means 3478. To disable STUN on this node, use -1.| +|`stuntestIP`|string|false||Stuntestip is used in tests to override the STUN server's IP. If empty, it's assumed to be the same as the DERP server.| ## tailcfg.DERPRegion ```json { - "avoid": true, - "embeddedRelay": true, - "nodes": [ - { - "canPort80": true, - "certName": "string", - "derpport": 0, - "forceHTTP": true, - "hostName": "string", - "insecureForTests": true, - "ipv4": "string", - "ipv6": "string", - "name": "string", - "regionID": 0, - "stunonly": true, - "stunport": 0, - "stuntestIP": "string" - } - ], - "regionCode": "string", - "regionID": 0, - "regionName": "string" -} -``` - -### Properties - -| Name | Type | Required | Restrictions | Description | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- | -------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `avoid` | boolean | false | | Avoid is whether the client should avoid picking this as its home region. The region should only be used if a peer is there. Clients already using this region as their home should migrate away to a new region without Avoid set. | -| `embeddedRelay` | boolean | false | | Embeddedrelay is true when the region is bundled with the Coder control plane. | -| `nodes` | array of [tailcfg.DERPNode](#tailcfgderpnode) | false | | Nodes are the DERP nodes running in this region, in priority order for the current client. Client TLS connections should ideally only go to the first entry (falling back to the second if necessary). STUN packets should go to the first 1 or 2. | -| If nodes within a region route packets amongst themselves, but not to other regions. That said, each user/domain should get a the same preferred node order, so if all nodes for a user/network pick the first one (as they should, when things are healthy), the inter-cluster routing is minimal to zero. | -| `regionCode` | string | false | | Regioncode is a short name for the region. It's usually a popular city or airport code in the region: "nyc", "sf", "sin", "fra", etc. | -| `regionID` | integer | false | | Regionid is a unique integer for a geographic region. | - + "avoid": true, + "embeddedRelay": true, + "nodes": [ + { + "canPort80": true, + "certName": "string", + "derpport": 0, + "forceHTTP": true, + "hostName": "string", + "insecureForTests": true, + "ipv4": "string", + "ipv6": "string", + "name": "string", + "regionID": 0, + "stunonly": true, + "stunport": 0, + "stuntestIP": "string" + } + ], + "regionCode": "string", + "regionID": 0, + "regionName": "string" +} +``` + +### Properties + +| Name | Type | Required | Restrictions | Description | +|-----------------|---------|----------|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `avoid` | boolean | false | | Avoid is whether the client should avoid picking this as its home region. The region should only be used if a peer is there. Clients already using this region as their home should migrate away to a new region without Avoid set. | +| `embeddedRelay` | boolean | false | | Embeddedrelay is true when the region is bundled with the Coder control plane. | +|`nodes`|array of [tailcfg.DERPNode](#tailcfgderpnode)|false||Nodes are the DERP nodes running in this region, in priority order for the current client. Client TLS connections should ideally only go to the first entry (falling back to the second if necessary). STUN packets should go to the first 1 or 2. +If nodes within a region route packets amongst themselves, but not to other regions. That said, each user/domain should get a the same preferred node order, so if all nodes for a user/network pick the first one (as they should, when things are healthy), the inter-cluster routing is minimal to zero.| +|`regionCode`|string|false||Regioncode is a short name for the region. It's usually a popular city or airport code in the region: "nyc", "sf", "sin", "fra", etc.| +|`regionID`|integer|false||Regionid is a unique integer for a geographic region. It corresponds to the legacy derpN.tailscale.com hostnames used by older clients. (Older clients will continue to resolve derpN.tailscale.com when contacting peers, rather than use the server-provided DERPMap) RegionIDs must be non-zero, positive, and guaranteed to fit in a JavaScript number. RegionIDs in range 900-999 are reserved for end users to run their own DERP nodes.| @@ -9857,7 +10220,7 @@ RegionIDs in range 900-999 are reserved for end users to run their own DERP node ### Properties -_None_ +None ## workspaceapps.AccessMethod @@ -9870,7 +10233,7 @@ _None_ #### Enumerated Values | Value | -| ----------- | +|-------------| | `path` | | `subdomain` | | `terminal` | @@ -9879,27 +10242,27 @@ _None_ ```json { - "app_hostname": "string", - "app_path": "string", - "app_query": "string", - "app_request": { - "access_method": "path", - "agent_name_or_id": "string", - "app_prefix": "string", - "app_slug_or_port": "string", - "base_path": "string", - "username_or_id": "string", - "workspace_name_or_id": "string" - }, - "path_app_base_url": "string", - "session_token": "string" + "app_hostname": "string", + "app_path": "string", + "app_query": "string", + "app_request": { + "access_method": "path", + "agent_name_or_id": "string", + "app_prefix": "string", + "app_slug_or_port": "string", + "base_path": "string", + "username_or_id": "string", + "workspace_name_or_id": "string" + }, + "path_app_base_url": "string", + "session_token": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------- | ---------------------------------------------- | -------- | ------------ | --------------------------------------------------------------------------------------------------------------- | +|---------------------|------------------------------------------------|----------|--------------|-----------------------------------------------------------------------------------------------------------------| | `app_hostname` | string | false | | App hostname is the optional hostname for subdomain apps on the external proxy. It must start with an asterisk. | | `app_path` | string | false | | App path is the path of the user underneath the app base path. | | `app_query` | string | false | | App query is the query parameters the user provided in the app request. | @@ -9911,20 +10274,20 @@ _None_ ```json { - "access_method": "path", - "agent_name_or_id": "string", - "app_prefix": "string", - "app_slug_or_port": "string", - "base_path": "string", - "username_or_id": "string", - "workspace_name_or_id": "string" + "access_method": "path", + "agent_name_or_id": "string", + "app_prefix": "string", + "app_slug_or_port": "string", + "base_path": "string", + "username_or_id": "string", + "workspace_name_or_id": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------------------- | -------------------------------------------------------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|------------------------|----------------------------------------------------------|----------|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `access_method` | [workspaceapps.AccessMethod](#workspaceappsaccessmethod) | false | | | | `agent_name_or_id` | string | false | | Agent name or ID is not required if the workspace has only one agent. | | `app_prefix` | string | false | | Prefix is the prefix of the subdomain app URL. Prefix should have a trailing "---" if set. | @@ -9937,22 +10300,22 @@ _None_ ```json { - "access_method": "path", - "agent_id": "string", - "requests": 0, - "session_ended_at": "string", - "session_id": "string", - "session_started_at": "string", - "slug_or_port": "string", - "user_id": "string", - "workspace_id": "string" + "access_method": "path", + "agent_id": "string", + "requests": 0, + "session_ended_at": "string", + "session_id": "string", + "session_started_at": "string", + "slug_or_port": "string", + "user_id": "string", + "workspace_id": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| -------------------- | -------------------------------------------------------- | -------- | ------------ | --------------------------------------------------------------------------------------- | +|----------------------|----------------------------------------------------------|----------|--------------|-----------------------------------------------------------------------------------------| | `access_method` | [workspaceapps.AccessMethod](#workspaceappsaccessmethod) | false | | | | `agent_id` | string | false | | | | `requests` | integer | false | | | @@ -9967,74 +10330,74 @@ _None_ ```json { - "derp_force_websockets": true, - "derp_map": { - "homeParams": { - "regionScore": { - "property1": 0, - "property2": 0 - } - }, - "omitDefaultRegions": true, - "regions": { - "property1": { - "avoid": true, - "embeddedRelay": true, - "nodes": [ - { - "canPort80": true, - "certName": "string", - "derpport": 0, - "forceHTTP": true, - "hostName": "string", - "insecureForTests": true, - "ipv4": "string", - "ipv6": "string", - "name": "string", - "regionID": 0, - "stunonly": true, - "stunport": 0, - "stuntestIP": "string" - } - ], - "regionCode": "string", - "regionID": 0, - "regionName": "string" - }, - "property2": { - "avoid": true, - "embeddedRelay": true, - "nodes": [ - { - "canPort80": true, - "certName": "string", - "derpport": 0, - "forceHTTP": true, - "hostName": "string", - "insecureForTests": true, - "ipv4": "string", - "ipv6": "string", - "name": "string", - "regionID": 0, - "stunonly": true, - "stunport": 0, - "stuntestIP": "string" - } - ], - "regionCode": "string", - "regionID": 0, - "regionName": "string" - } - } - }, - "disable_direct_connections": true + "derp_force_websockets": true, + "derp_map": { + "homeParams": { + "regionScore": { + "property1": 0, + "property2": 0 + } + }, + "omitDefaultRegions": true, + "regions": { + "property1": { + "avoid": true, + "embeddedRelay": true, + "nodes": [ + { + "canPort80": true, + "certName": "string", + "derpport": 0, + "forceHTTP": true, + "hostName": "string", + "insecureForTests": true, + "ipv4": "string", + "ipv6": "string", + "name": "string", + "regionID": 0, + "stunonly": true, + "stunport": 0, + "stuntestIP": "string" + } + ], + "regionCode": "string", + "regionID": 0, + "regionName": "string" + }, + "property2": { + "avoid": true, + "embeddedRelay": true, + "nodes": [ + { + "canPort80": true, + "certName": "string", + "derpport": 0, + "forceHTTP": true, + "hostName": "string", + "insecureForTests": true, + "ipv4": "string", + "ipv6": "string", + "name": "string", + "regionID": 0, + "stunonly": true, + "stunport": 0, + "stuntestIP": "string" + } + ], + "regionCode": "string", + "regionID": 0, + "regionName": "string" + } + } + }, + "disable_direct_connections": true } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ---------------------------- | ---------------------------------- | -------- | ------------ | ----------- | +|------------------------------|------------------------------------|----------|--------------|-------------| | `derp_force_websockets` | boolean | false | | | | `derp_map` | [tailcfg.DERPMap](#tailcfgderpmap) | false | | | | `disable_direct_connections` | boolean | false | | | @@ -10043,167 +10406,167 @@ _None_ ```json { - "crypto_keys": [ - { - "deletes_at": "2019-08-24T14:15:22Z", - "feature": "workspace_apps_api_key", - "secret": "string", - "sequence": 0, - "starts_at": "2019-08-24T14:15:22Z" - } - ] + "crypto_keys": [ + { + "deletes_at": "2019-08-24T14:15:22Z", + "feature": "workspace_apps_api_key", + "secret": "string", + "sequence": 0, + "starts_at": "2019-08-24T14:15:22Z" + } + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------- | ------------------------------------------------- | -------- | ------------ | ----------- | +|---------------|---------------------------------------------------|----------|--------------|-------------| | `crypto_keys` | array of [codersdk.CryptoKey](#codersdkcryptokey) | false | | | ## wsproxysdk.DeregisterWorkspaceProxyRequest ```json { - "replica_id": "string" + "replica_id": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------ | ------ | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|--------------|--------|----------|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `replica_id` | string | false | | Replica ID is a unique identifier for the replica of the proxy that is deregistering. It should be generated by the client on startup and should've already been passed to the register endpoint. | ## wsproxysdk.IssueSignedAppTokenResponse ```json { - "signed_token_str": "string" + "signed_token_str": "string" } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------------------ | ------ | -------- | ------------ | ----------------------------------------------------------- | +|--------------------|--------|----------|--------------|-------------------------------------------------------------| | `signed_token_str` | string | false | | Signed token str should be set as a cookie on the response. | ## wsproxysdk.RegisterWorkspaceProxyRequest ```json { - "access_url": "string", - "derp_enabled": true, - "derp_only": true, - "hostname": "string", - "replica_error": "string", - "replica_id": "string", - "replica_relay_address": "string", - "version": "string", - "wildcard_hostname": "string" + "access_url": "string", + "derp_enabled": true, + "derp_only": true, + "hostname": "string", + "replica_error": "string", + "replica_id": "string", + "replica_relay_address": "string", + "version": "string", + "wildcard_hostname": "string" } ``` ### Properties -| Name | Type | Required | Restrictions | Description | -| ------------------------------------------------------------------------------------------------- | ------- | -------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `access_url` | string | false | | Access URL that hits the workspace proxy api. | -| `derp_enabled` | boolean | false | | Derp enabled indicates whether the proxy should be included in the DERP map or not. | -| `derp_only` | boolean | false | | Derp only indicates whether the proxy should only be included in the DERP map and should not be used for serving apps. | -| `hostname` | string | false | | Hostname is the OS hostname of the machine that the proxy is running on. This is only used for tracking purposes in the replicas table. | -| `replica_error` | string | false | | Replica error is the error that the replica encountered when trying to dial it's peers. This is stored in the replicas table for debugging purposes but does not affect the proxy's ability to register. | -| This value is only stored on subsequent requests to the register endpoint, not the first request. | -| `replica_id` | string | false | | Replica ID is a unique identifier for the replica of the proxy that is registering. It should be generated by the client on startup and persisted (in memory only) until the process is restarted. | -| `replica_relay_address` | string | false | | Replica relay address is the DERP address of the replica that other replicas may use to connect internally for DERP meshing. | -| `version` | string | false | | Version is the Coder version of the proxy. | -| `wildcard_hostname` | string | false | | Wildcard hostname that the workspace proxy api is serving for subdomain apps. | +| Name | Type | Required | Restrictions | Description | +|----------------|---------|----------|--------------|------------------------------------------------------------------------------------------------------------------------------------------| +| `access_url` | string | false | | Access URL that hits the workspace proxy api. | +| `derp_enabled` | boolean | false | | Derp enabled indicates whether the proxy should be included in the DERP map or not. | +| `derp_only` | boolean | false | | Derp only indicates whether the proxy should only be included in the DERP map and should not be used for serving apps. | +| `hostname` | string | false | | Hostname is the OS hostname of the machine that the proxy is running on. This is only used for tracking purposes in the replicas table. | +|`replica_error`|string|false||Replica error is the error that the replica encountered when trying to dial it's peers. This is stored in the replicas table for debugging purposes but does not affect the proxy's ability to register. +This value is only stored on subsequent requests to the register endpoint, not the first request.| +|`replica_id`|string|false||Replica ID is a unique identifier for the replica of the proxy that is registering. It should be generated by the client on startup and persisted (in memory only) until the process is restarted.| +|`replica_relay_address`|string|false||Replica relay address is the DERP address of the replica that other replicas may use to connect internally for DERP meshing.| +|`version`|string|false||Version is the Coder version of the proxy.| +|`wildcard_hostname`|string|false||Wildcard hostname that the workspace proxy api is serving for subdomain apps.| ## wsproxysdk.RegisterWorkspaceProxyResponse ```json { - "derp_force_websockets": true, - "derp_map": { - "homeParams": { - "regionScore": { - "property1": 0, - "property2": 0 - } - }, - "omitDefaultRegions": true, - "regions": { - "property1": { - "avoid": true, - "embeddedRelay": true, - "nodes": [ - { - "canPort80": true, - "certName": "string", - "derpport": 0, - "forceHTTP": true, - "hostName": "string", - "insecureForTests": true, - "ipv4": "string", - "ipv6": "string", - "name": "string", - "regionID": 0, - "stunonly": true, - "stunport": 0, - "stuntestIP": "string" - } - ], - "regionCode": "string", - "regionID": 0, - "regionName": "string" - }, - "property2": { - "avoid": true, - "embeddedRelay": true, - "nodes": [ - { - "canPort80": true, - "certName": "string", - "derpport": 0, - "forceHTTP": true, - "hostName": "string", - "insecureForTests": true, - "ipv4": "string", - "ipv6": "string", - "name": "string", - "regionID": 0, - "stunonly": true, - "stunport": 0, - "stuntestIP": "string" - } - ], - "regionCode": "string", - "regionID": 0, - "regionName": "string" - } - } - }, - "derp_mesh_key": "string", - "derp_region_id": 0, - "sibling_replicas": [ - { - "created_at": "2019-08-24T14:15:22Z", - "database_latency": 0, - "error": "string", - "hostname": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "region_id": 0, - "relay_address": "string" - } - ] + "derp_force_websockets": true, + "derp_map": { + "homeParams": { + "regionScore": { + "property1": 0, + "property2": 0 + } + }, + "omitDefaultRegions": true, + "regions": { + "property1": { + "avoid": true, + "embeddedRelay": true, + "nodes": [ + { + "canPort80": true, + "certName": "string", + "derpport": 0, + "forceHTTP": true, + "hostName": "string", + "insecureForTests": true, + "ipv4": "string", + "ipv6": "string", + "name": "string", + "regionID": 0, + "stunonly": true, + "stunport": 0, + "stuntestIP": "string" + } + ], + "regionCode": "string", + "regionID": 0, + "regionName": "string" + }, + "property2": { + "avoid": true, + "embeddedRelay": true, + "nodes": [ + { + "canPort80": true, + "certName": "string", + "derpport": 0, + "forceHTTP": true, + "hostName": "string", + "insecureForTests": true, + "ipv4": "string", + "ipv6": "string", + "name": "string", + "regionID": 0, + "stunonly": true, + "stunport": 0, + "stuntestIP": "string" + } + ], + "regionCode": "string", + "regionID": 0, + "regionName": "string" + } + } + }, + "derp_mesh_key": "string", + "derp_region_id": 0, + "sibling_replicas": [ + { + "created_at": "2019-08-24T14:15:22Z", + "database_latency": 0, + "error": "string", + "hostname": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "region_id": 0, + "relay_address": "string" + } + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ----------------------- | --------------------------------------------- | -------- | ------------ | -------------------------------------------------------------------------------------- | +|-------------------------|-----------------------------------------------|----------|--------------|----------------------------------------------------------------------------------------| | `derp_force_websockets` | boolean | false | | | | `derp_map` | [tailcfg.DERPMap](#tailcfgderpmap) | false | | | | `derp_mesh_key` | string | false | | | @@ -10214,24 +10577,24 @@ _None_ ```json { - "stats": [ - { - "access_method": "path", - "agent_id": "string", - "requests": 0, - "session_ended_at": "string", - "session_id": "string", - "session_started_at": "string", - "slug_or_port": "string", - "user_id": "string", - "workspace_id": "string" - } - ] + "stats": [ + { + "access_method": "path", + "agent_id": "string", + "requests": 0, + "session_ended_at": "string", + "session_id": "string", + "session_started_at": "string", + "slug_or_port": "string", + "user_id": "string", + "workspace_id": "string" + } + ] } ``` ### Properties | Name | Type | Required | Restrictions | Description | -| ------- | --------------------------------------------------------------- | -------- | ------------ | ----------- | +|---------|-----------------------------------------------------------------|----------|--------------|-------------| | `stats` | array of [workspaceapps.StatsReport](#workspaceappsstatsreport) | false | | | diff --git a/docs/reference/api/templates.md b/docs/reference/api/templates.md index b4f642625dcde..5af9726b83b35 100644 --- a/docs/reference/api/templates.md +++ b/docs/reference/api/templates.md @@ -16,7 +16,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/templat ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | ------------ | -------- | --------------- | +|----------------|------|--------------|----------|-----------------| | `organization` | path | string(uuid) | true | Organization ID | ### Example responses @@ -25,112 +25,116 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/templat ```json [ - { - "active_user_count": 0, - "active_version_id": "eae64611-bd53-4a80-bb77-df1e432c0fbc", - "activity_bump_ms": 0, - "allow_user_autostart": true, - "allow_user_autostop": true, - "allow_user_cancel_workspace_jobs": true, - "autostart_requirement": { - "days_of_week": ["monday"] - }, - "autostop_requirement": { - "days_of_week": ["monday"], - "weeks": 0 - }, - "build_time_stats": { - "property1": { - "p50": 123, - "p95": 146 - }, - "property2": { - "p50": 123, - "p95": 146 - } - }, - "created_at": "2019-08-24T14:15:22Z", - "created_by_id": "9377d689-01fb-4abf-8450-3368d2c1924f", - "created_by_name": "string", - "default_ttl_ms": 0, - "deprecated": true, - "deprecation_message": "string", - "description": "string", - "display_name": "string", - "failure_ttl_ms": 0, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "max_port_share_level": "owner", - "name": "string", - "organization_display_name": "string", - "organization_icon": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "organization_name": "string", - "provisioner": "terraform", - "require_active_version": true, - "time_til_dormant_autodelete_ms": 0, - "time_til_dormant_ms": 0, - "updated_at": "2019-08-24T14:15:22Z" - } + { + "active_user_count": 0, + "active_version_id": "eae64611-bd53-4a80-bb77-df1e432c0fbc", + "activity_bump_ms": 0, + "allow_user_autostart": true, + "allow_user_autostop": true, + "allow_user_cancel_workspace_jobs": true, + "autostart_requirement": { + "days_of_week": [ + "monday" + ] + }, + "autostop_requirement": { + "days_of_week": [ + "monday" + ], + "weeks": 0 + }, + "build_time_stats": { + "property1": { + "p50": 123, + "p95": 146 + }, + "property2": { + "p50": 123, + "p95": 146 + } + }, + "created_at": "2019-08-24T14:15:22Z", + "created_by_id": "9377d689-01fb-4abf-8450-3368d2c1924f", + "created_by_name": "string", + "default_ttl_ms": 0, + "deprecated": true, + "deprecation_message": "string", + "description": "string", + "display_name": "string", + "failure_ttl_ms": 0, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "max_port_share_level": "owner", + "name": "string", + "organization_display_name": "string", + "organization_icon": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "organization_name": "string", + "provisioner": "terraform", + "require_active_version": true, + "time_til_dormant_autodelete_ms": 0, + "time_til_dormant_ms": 0, + "updated_at": "2019-08-24T14:15:22Z" + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-----------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.Template](schemas.md#codersdktemplate) |

Response Schema

Status Code **200** -| Name | Type | Required | Restrictions | Description | -| ------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `[array item]` | array | false | | | -| `» active_user_count` | integer | false | | Active user count is set to -1 when loading. | -| `» active_version_id` | string(uuid) | false | | | -| `» activity_bump_ms` | integer | false | | | -| `» allow_user_autostart` | boolean | false | | Allow user autostart and AllowUserAutostop are enterprise-only. Their values are only used if your license is entitled to use the advanced template scheduling feature. | -| `» allow_user_autostop` | boolean | false | | | -| `» allow_user_cancel_workspace_jobs` | boolean | false | | | -| `» autostart_requirement` | [codersdk.TemplateAutostartRequirement](schemas.md#codersdktemplateautostartrequirement) | false | | | -| `»» days_of_week` | array | false | | Days of week is a list of days of the week in which autostart is allowed to happen. If no days are specified, autostart is not allowed. | -| `» autostop_requirement` | [codersdk.TemplateAutostopRequirement](schemas.md#codersdktemplateautostoprequirement) | false | | Autostop requirement and AutostartRequirement are enterprise features. Its value is only used if your license is entitled to use the advanced template scheduling feature. | -| `»» days_of_week` | array | false | | Days of week is a list of days of the week on which restarts are required. Restarts happen within the user's quiet hours (in their configured timezone). If no days are specified, restarts are not required. Weekdays cannot be specified twice. | -| Restarts will only happen on weekdays in this list on weeks which line up with Weeks. | -| `»» weeks` | integer | false | | Weeks is the number of weeks between required restarts. Weeks are synced across all workspaces (and Coder deployments) using modulo math on a hardcoded epoch week of January 2nd, 2023 (the first Monday of 2023). Values of 0 or 1 indicate weekly restarts. Values of 2 indicate fortnightly restarts, etc. | -| `» build_time_stats` | [codersdk.TemplateBuildTimeStats](schemas.md#codersdktemplatebuildtimestats) | false | | | -| `»» [any property]` | [codersdk.TransitionStats](schemas.md#codersdktransitionstats) | false | | | -| `»»» p50` | integer | false | | | -| `»»» p95` | integer | false | | | -| `» created_at` | string(date-time) | false | | | -| `» created_by_id` | string(uuid) | false | | | -| `» created_by_name` | string | false | | | -| `» default_ttl_ms` | integer | false | | | -| `» deprecated` | boolean | false | | | -| `» deprecation_message` | string | false | | | -| `» description` | string | false | | | -| `» display_name` | string | false | | | -| `» failure_ttl_ms` | integer | false | | Failure ttl ms TimeTilDormantMillis, and TimeTilDormantAutoDeleteMillis are enterprise-only. Their values are used if your license is entitled to use the advanced template scheduling feature. | -| `» icon` | string | false | | | -| `» id` | string(uuid) | false | | | -| `» max_port_share_level` | [codersdk.WorkspaceAgentPortShareLevel](schemas.md#codersdkworkspaceagentportsharelevel) | false | | | -| `» name` | string | false | | | -| `» organization_display_name` | string | false | | | -| `» organization_icon` | string | false | | | -| `» organization_id` | string(uuid) | false | | | -| `» organization_name` | string(url) | false | | | -| `» provisioner` | string | false | | | -| `» require_active_version` | boolean | false | | Require active version mandates that workspaces are built with the active template version. | -| `» time_til_dormant_autodelete_ms` | integer | false | | | -| `» time_til_dormant_ms` | integer | false | | | -| `» updated_at` | string(date-time) | false | | | +| Name | Type | Required | Restrictions | Description | +|--------------------------------------|------------------------------------------------------------------------------------------|----------|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `[array item]` | array | false | | | +| `» active_user_count` | integer | false | | Active user count is set to -1 when loading. | +| `» active_version_id` | string(uuid) | false | | | +| `» activity_bump_ms` | integer | false | | | +| `» allow_user_autostart` | boolean | false | | Allow user autostart and AllowUserAutostop are enterprise-only. Their values are only used if your license is entitled to use the advanced template scheduling feature. | +| `» allow_user_autostop` | boolean | false | | | +| `» allow_user_cancel_workspace_jobs` | boolean | false | | | +| `» autostart_requirement` | [codersdk.TemplateAutostartRequirement](schemas.md#codersdktemplateautostartrequirement) | false | | | +| `»» days_of_week` | array | false | | Days of week is a list of days of the week in which autostart is allowed to happen. If no days are specified, autostart is not allowed. | +| `» autostop_requirement` | [codersdk.TemplateAutostopRequirement](schemas.md#codersdktemplateautostoprequirement) | false | | Autostop requirement and AutostartRequirement are enterprise features. Its value is only used if your license is entitled to use the advanced template scheduling feature. | +|`»» days_of_week`|array|false||Days of week is a list of days of the week on which restarts are required. Restarts happen within the user's quiet hours (in their configured timezone). If no days are specified, restarts are not required. Weekdays cannot be specified twice. +Restarts will only happen on weekdays in this list on weeks which line up with Weeks.| +|`»» weeks`|integer|false||Weeks is the number of weeks between required restarts. Weeks are synced across all workspaces (and Coder deployments) using modulo math on a hardcoded epoch week of January 2nd, 2023 (the first Monday of 2023). Values of 0 or 1 indicate weekly restarts. Values of 2 indicate fortnightly restarts, etc.| +|`» build_time_stats`|[codersdk.TemplateBuildTimeStats](schemas.md#codersdktemplatebuildtimestats)|false||| +|`»» [any property]`|[codersdk.TransitionStats](schemas.md#codersdktransitionstats)|false||| +|`»»» p50`|integer|false||| +|`»»» p95`|integer|false||| +|`» created_at`|string(date-time)|false||| +|`» created_by_id`|string(uuid)|false||| +|`» created_by_name`|string|false||| +|`» default_ttl_ms`|integer|false||| +|`» deprecated`|boolean|false||| +|`» deprecation_message`|string|false||| +|`» description`|string|false||| +|`» display_name`|string|false||| +|`» failure_ttl_ms`|integer|false||Failure ttl ms TimeTilDormantMillis, and TimeTilDormantAutoDeleteMillis are enterprise-only. Their values are used if your license is entitled to use the advanced template scheduling feature.| +|`» icon`|string|false||| +|`» id`|string(uuid)|false||| +|`» max_port_share_level`|[codersdk.WorkspaceAgentPortShareLevel](schemas.md#codersdkworkspaceagentportsharelevel)|false||| +|`» name`|string|false||| +|`» organization_display_name`|string|false||| +|`» organization_icon`|string|false||| +|`» organization_id`|string(uuid)|false||| +|`» organization_name`|string(url)|false||| +|`» provisioner`|string|false||| +|`» require_active_version`|boolean|false||Require active version mandates that workspaces are built with the active template version.| +|`» time_til_dormant_autodelete_ms`|integer|false||| +|`» time_til_dormant_ms`|integer|false||| +|`» updated_at`|string(date-time)|false||| #### Enumerated Values | Property | Value | -| ---------------------- | --------------- | +|------------------------|-----------------| | `max_port_share_level` | `owner` | | `max_port_share_level` | `authenticated` | | `max_port_share_level` | `public` | @@ -156,36 +160,40 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/templa ```json { - "activity_bump_ms": 0, - "allow_user_autostart": true, - "allow_user_autostop": true, - "allow_user_cancel_workspace_jobs": true, - "autostart_requirement": { - "days_of_week": ["monday"] - }, - "autostop_requirement": { - "days_of_week": ["monday"], - "weeks": 0 - }, - "default_ttl_ms": 0, - "delete_ttl_ms": 0, - "description": "string", - "disable_everyone_group_access": true, - "display_name": "string", - "dormant_ttl_ms": 0, - "failure_ttl_ms": 0, - "icon": "string", - "max_port_share_level": "owner", - "name": "string", - "require_active_version": true, - "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1" + "activity_bump_ms": 0, + "allow_user_autostart": true, + "allow_user_autostop": true, + "allow_user_cancel_workspace_jobs": true, + "autostart_requirement": { + "days_of_week": [ + "monday" + ] + }, + "autostop_requirement": { + "days_of_week": [ + "monday" + ], + "weeks": 0 + }, + "default_ttl_ms": 0, + "delete_ttl_ms": 0, + "description": "string", + "disable_everyone_group_access": true, + "display_name": "string", + "dormant_ttl_ms": 0, + "failure_ttl_ms": 0, + "icon": "string", + "max_port_share_level": "owner", + "name": "string", + "require_active_version": true, + "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1" } ``` ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | -------------------------------------------------------------------------- | -------- | --------------- | +|----------------|------|----------------------------------------------------------------------------|----------|-----------------| | `organization` | path | string | true | Organization ID | | `body` | body | [codersdk.CreateTemplateRequest](schemas.md#codersdkcreatetemplaterequest) | true | Request body | @@ -195,58 +203,62 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/templa ```json { - "active_user_count": 0, - "active_version_id": "eae64611-bd53-4a80-bb77-df1e432c0fbc", - "activity_bump_ms": 0, - "allow_user_autostart": true, - "allow_user_autostop": true, - "allow_user_cancel_workspace_jobs": true, - "autostart_requirement": { - "days_of_week": ["monday"] - }, - "autostop_requirement": { - "days_of_week": ["monday"], - "weeks": 0 - }, - "build_time_stats": { - "property1": { - "p50": 123, - "p95": 146 - }, - "property2": { - "p50": 123, - "p95": 146 - } - }, - "created_at": "2019-08-24T14:15:22Z", - "created_by_id": "9377d689-01fb-4abf-8450-3368d2c1924f", - "created_by_name": "string", - "default_ttl_ms": 0, - "deprecated": true, - "deprecation_message": "string", - "description": "string", - "display_name": "string", - "failure_ttl_ms": 0, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "max_port_share_level": "owner", - "name": "string", - "organization_display_name": "string", - "organization_icon": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "organization_name": "string", - "provisioner": "terraform", - "require_active_version": true, - "time_til_dormant_autodelete_ms": 0, - "time_til_dormant_ms": 0, - "updated_at": "2019-08-24T14:15:22Z" + "active_user_count": 0, + "active_version_id": "eae64611-bd53-4a80-bb77-df1e432c0fbc", + "activity_bump_ms": 0, + "allow_user_autostart": true, + "allow_user_autostop": true, + "allow_user_cancel_workspace_jobs": true, + "autostart_requirement": { + "days_of_week": [ + "monday" + ] + }, + "autostop_requirement": { + "days_of_week": [ + "monday" + ], + "weeks": 0 + }, + "build_time_stats": { + "property1": { + "p50": 123, + "p95": 146 + }, + "property2": { + "p50": 123, + "p95": 146 + } + }, + "created_at": "2019-08-24T14:15:22Z", + "created_by_id": "9377d689-01fb-4abf-8450-3368d2c1924f", + "created_by_name": "string", + "default_ttl_ms": 0, + "deprecated": true, + "deprecation_message": "string", + "description": "string", + "display_name": "string", + "failure_ttl_ms": 0, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "max_port_share_level": "owner", + "name": "string", + "organization_display_name": "string", + "organization_icon": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "organization_name": "string", + "provisioner": "terraform", + "require_active_version": true, + "time_til_dormant_autodelete_ms": 0, + "time_til_dormant_ms": 0, + "updated_at": "2019-08-24T14:15:22Z" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Template](schemas.md#codersdktemplate) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -267,7 +279,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/templat ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | ------------ | -------- | --------------- | +|----------------|------|--------------|----------|-----------------| | `organization` | path | string(uuid) | true | Organization ID | ### Example responses @@ -276,22 +288,24 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/templat ```json [ - { - "description": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "markdown": "string", - "name": "string", - "tags": ["string"], - "url": "string" - } + { + "description": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "markdown": "string", + "name": "string", + "tags": [ + "string" + ], + "url": "string" + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ----------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.TemplateExample](schemas.md#codersdktemplateexample) |

Response Schema

@@ -299,7 +313,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/templat Status Code **200** | Name | Type | Required | Restrictions | Description | -| --------------- | ------------ | -------- | ------------ | ----------- | +|-----------------|--------------|----------|--------------|-------------| | `[array item]` | array | false | | | | `» description` | string | false | | | | `» icon` | string | false | | | @@ -327,7 +341,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/templat ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | ------------ | -------- | --------------- | +|----------------|------|--------------|----------|-----------------| | `organization` | path | string(uuid) | true | Organization ID | | `templatename` | path | string | true | Template name | @@ -337,58 +351,62 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/templat ```json { - "active_user_count": 0, - "active_version_id": "eae64611-bd53-4a80-bb77-df1e432c0fbc", - "activity_bump_ms": 0, - "allow_user_autostart": true, - "allow_user_autostop": true, - "allow_user_cancel_workspace_jobs": true, - "autostart_requirement": { - "days_of_week": ["monday"] - }, - "autostop_requirement": { - "days_of_week": ["monday"], - "weeks": 0 - }, - "build_time_stats": { - "property1": { - "p50": 123, - "p95": 146 - }, - "property2": { - "p50": 123, - "p95": 146 - } - }, - "created_at": "2019-08-24T14:15:22Z", - "created_by_id": "9377d689-01fb-4abf-8450-3368d2c1924f", - "created_by_name": "string", - "default_ttl_ms": 0, - "deprecated": true, - "deprecation_message": "string", - "description": "string", - "display_name": "string", - "failure_ttl_ms": 0, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "max_port_share_level": "owner", - "name": "string", - "organization_display_name": "string", - "organization_icon": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "organization_name": "string", - "provisioner": "terraform", - "require_active_version": true, - "time_til_dormant_autodelete_ms": 0, - "time_til_dormant_ms": 0, - "updated_at": "2019-08-24T14:15:22Z" + "active_user_count": 0, + "active_version_id": "eae64611-bd53-4a80-bb77-df1e432c0fbc", + "activity_bump_ms": 0, + "allow_user_autostart": true, + "allow_user_autostop": true, + "allow_user_cancel_workspace_jobs": true, + "autostart_requirement": { + "days_of_week": [ + "monday" + ] + }, + "autostop_requirement": { + "days_of_week": [ + "monday" + ], + "weeks": 0 + }, + "build_time_stats": { + "property1": { + "p50": 123, + "p95": 146 + }, + "property2": { + "p50": 123, + "p95": 146 + } + }, + "created_at": "2019-08-24T14:15:22Z", + "created_by_id": "9377d689-01fb-4abf-8450-3368d2c1924f", + "created_by_name": "string", + "default_ttl_ms": 0, + "deprecated": true, + "deprecation_message": "string", + "description": "string", + "display_name": "string", + "failure_ttl_ms": 0, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "max_port_share_level": "owner", + "name": "string", + "organization_display_name": "string", + "organization_icon": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "organization_name": "string", + "provisioner": "terraform", + "require_active_version": true, + "time_til_dormant_autodelete_ms": 0, + "time_til_dormant_ms": 0, + "updated_at": "2019-08-24T14:15:22Z" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Template](schemas.md#codersdktemplate) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -409,7 +427,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/templat ### Parameters | Name | In | Type | Required | Description | -| --------------------- | ---- | ------------ | -------- | --------------------- | +|-----------------------|------|--------------|----------|-----------------------| | `organization` | path | string(uuid) | true | Organization ID | | `templatename` | path | string | true | Template name | | `templateversionname` | path | string | true | Template version name | @@ -420,51 +438,53 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/templat ```json { - "archived": true, - "created_at": "2019-08-24T14:15:22Z", - "created_by": { - "avatar_url": "http://example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "username": "string" - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "job": { - "canceled_at": "2019-08-24T14:15:22Z", - "completed_at": "2019-08-24T14:15:22Z", - "created_at": "2019-08-24T14:15:22Z", - "error": "string", - "error_code": "REQUIRED_TEMPLATE_VARIABLES", - "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "queue_position": 0, - "queue_size": 0, - "started_at": "2019-08-24T14:15:22Z", - "status": "pending", - "tags": { - "property1": "string", - "property2": "string" - }, - "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" - }, - "matched_provisioners": { - "available": 0, - "count": 0, - "most_recently_seen": "2019-08-24T14:15:22Z" - }, - "message": "string", - "name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "readme": "string", - "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", - "updated_at": "2019-08-24T14:15:22Z", - "warnings": ["UNSUPPORTED_WORKSPACES"] + "archived": true, + "created_at": "2019-08-24T14:15:22Z", + "created_by": { + "avatar_url": "http://example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "username": "string" + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "job": { + "canceled_at": "2019-08-24T14:15:22Z", + "completed_at": "2019-08-24T14:15:22Z", + "created_at": "2019-08-24T14:15:22Z", + "error": "string", + "error_code": "REQUIRED_TEMPLATE_VARIABLES", + "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "queue_position": 0, + "queue_size": 0, + "started_at": "2019-08-24T14:15:22Z", + "status": "pending", + "tags": { + "property1": "string", + "property2": "string" + }, + "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" + }, + "matched_provisioners": { + "available": 0, + "count": 0, + "most_recently_seen": "2019-08-24T14:15:22Z" + }, + "message": "string", + "name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "readme": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "updated_at": "2019-08-24T14:15:22Z", + "warnings": [ + "UNSUPPORTED_WORKSPACES" + ] } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.TemplateVersion](schemas.md#codersdktemplateversion) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -485,7 +505,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/templat ### Parameters | Name | In | Type | Required | Description | -| --------------------- | ---- | ------------ | -------- | --------------------- | +|-----------------------|------|--------------|----------|-----------------------| | `organization` | path | string(uuid) | true | Organization ID | | `templatename` | path | string | true | Template name | | `templateversionname` | path | string | true | Template version name | @@ -496,51 +516,53 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/templat ```json { - "archived": true, - "created_at": "2019-08-24T14:15:22Z", - "created_by": { - "avatar_url": "http://example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "username": "string" - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "job": { - "canceled_at": "2019-08-24T14:15:22Z", - "completed_at": "2019-08-24T14:15:22Z", - "created_at": "2019-08-24T14:15:22Z", - "error": "string", - "error_code": "REQUIRED_TEMPLATE_VARIABLES", - "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "queue_position": 0, - "queue_size": 0, - "started_at": "2019-08-24T14:15:22Z", - "status": "pending", - "tags": { - "property1": "string", - "property2": "string" - }, - "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" - }, - "matched_provisioners": { - "available": 0, - "count": 0, - "most_recently_seen": "2019-08-24T14:15:22Z" - }, - "message": "string", - "name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "readme": "string", - "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", - "updated_at": "2019-08-24T14:15:22Z", - "warnings": ["UNSUPPORTED_WORKSPACES"] + "archived": true, + "created_at": "2019-08-24T14:15:22Z", + "created_by": { + "avatar_url": "http://example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "username": "string" + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "job": { + "canceled_at": "2019-08-24T14:15:22Z", + "completed_at": "2019-08-24T14:15:22Z", + "created_at": "2019-08-24T14:15:22Z", + "error": "string", + "error_code": "REQUIRED_TEMPLATE_VARIABLES", + "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "queue_position": 0, + "queue_size": 0, + "started_at": "2019-08-24T14:15:22Z", + "status": "pending", + "tags": { + "property1": "string", + "property2": "string" + }, + "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" + }, + "matched_provisioners": { + "available": 0, + "count": 0, + "most_recently_seen": "2019-08-24T14:15:22Z" + }, + "message": "string", + "name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "readme": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "updated_at": "2019-08-24T14:15:22Z", + "warnings": [ + "UNSUPPORTED_WORKSPACES" + ] } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.TemplateVersion](schemas.md#codersdktemplateversion) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -563,30 +585,30 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/templa ```json { - "example_id": "string", - "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", - "message": "string", - "name": "string", - "provisioner": "terraform", - "storage_method": "file", - "tags": { - "property1": "string", - "property2": "string" - }, - "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", - "user_variable_values": [ - { - "name": "string", - "value": "string" - } - ] + "example_id": "string", + "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", + "message": "string", + "name": "string", + "provisioner": "terraform", + "storage_method": "file", + "tags": { + "property1": "string", + "property2": "string" + }, + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "user_variable_values": [ + { + "name": "string", + "value": "string" + } + ] } ``` ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | ---------------------------------------------------------------------------------------- | -------- | ------------------------------- | +|----------------|------|------------------------------------------------------------------------------------------|----------|---------------------------------| | `organization` | path | string(uuid) | true | Organization ID | | `body` | body | [codersdk.CreateTemplateVersionRequest](schemas.md#codersdkcreatetemplateversionrequest) | true | Create template version request | @@ -596,51 +618,53 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/templa ```json { - "archived": true, - "created_at": "2019-08-24T14:15:22Z", - "created_by": { - "avatar_url": "http://example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "username": "string" - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "job": { - "canceled_at": "2019-08-24T14:15:22Z", - "completed_at": "2019-08-24T14:15:22Z", - "created_at": "2019-08-24T14:15:22Z", - "error": "string", - "error_code": "REQUIRED_TEMPLATE_VARIABLES", - "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "queue_position": 0, - "queue_size": 0, - "started_at": "2019-08-24T14:15:22Z", - "status": "pending", - "tags": { - "property1": "string", - "property2": "string" - }, - "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" - }, - "matched_provisioners": { - "available": 0, - "count": 0, - "most_recently_seen": "2019-08-24T14:15:22Z" - }, - "message": "string", - "name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "readme": "string", - "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", - "updated_at": "2019-08-24T14:15:22Z", - "warnings": ["UNSUPPORTED_WORKSPACES"] + "archived": true, + "created_at": "2019-08-24T14:15:22Z", + "created_by": { + "avatar_url": "http://example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "username": "string" + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "job": { + "canceled_at": "2019-08-24T14:15:22Z", + "completed_at": "2019-08-24T14:15:22Z", + "created_at": "2019-08-24T14:15:22Z", + "error": "string", + "error_code": "REQUIRED_TEMPLATE_VARIABLES", + "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "queue_position": 0, + "queue_size": 0, + "started_at": "2019-08-24T14:15:22Z", + "status": "pending", + "tags": { + "property1": "string", + "property2": "string" + }, + "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" + }, + "matched_provisioners": { + "available": 0, + "count": 0, + "most_recently_seen": "2019-08-24T14:15:22Z" + }, + "message": "string", + "name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "readme": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "updated_at": "2019-08-24T14:15:22Z", + "warnings": [ + "UNSUPPORTED_WORKSPACES" + ] } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------------ | ----------- | -------------------------------------------------------------- | +|--------|--------------------------------------------------------------|-------------|----------------------------------------------------------------| | 201 | [Created](https://tools.ietf.org/html/rfc7231#section-6.3.2) | Created | [codersdk.TemplateVersion](schemas.md#codersdktemplateversion) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -664,112 +688,116 @@ curl -X GET http://coder-server:8080/api/v2/templates \ ```json [ - { - "active_user_count": 0, - "active_version_id": "eae64611-bd53-4a80-bb77-df1e432c0fbc", - "activity_bump_ms": 0, - "allow_user_autostart": true, - "allow_user_autostop": true, - "allow_user_cancel_workspace_jobs": true, - "autostart_requirement": { - "days_of_week": ["monday"] - }, - "autostop_requirement": { - "days_of_week": ["monday"], - "weeks": 0 - }, - "build_time_stats": { - "property1": { - "p50": 123, - "p95": 146 - }, - "property2": { - "p50": 123, - "p95": 146 - } - }, - "created_at": "2019-08-24T14:15:22Z", - "created_by_id": "9377d689-01fb-4abf-8450-3368d2c1924f", - "created_by_name": "string", - "default_ttl_ms": 0, - "deprecated": true, - "deprecation_message": "string", - "description": "string", - "display_name": "string", - "failure_ttl_ms": 0, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "max_port_share_level": "owner", - "name": "string", - "organization_display_name": "string", - "organization_icon": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "organization_name": "string", - "provisioner": "terraform", - "require_active_version": true, - "time_til_dormant_autodelete_ms": 0, - "time_til_dormant_ms": 0, - "updated_at": "2019-08-24T14:15:22Z" - } + { + "active_user_count": 0, + "active_version_id": "eae64611-bd53-4a80-bb77-df1e432c0fbc", + "activity_bump_ms": 0, + "allow_user_autostart": true, + "allow_user_autostop": true, + "allow_user_cancel_workspace_jobs": true, + "autostart_requirement": { + "days_of_week": [ + "monday" + ] + }, + "autostop_requirement": { + "days_of_week": [ + "monday" + ], + "weeks": 0 + }, + "build_time_stats": { + "property1": { + "p50": 123, + "p95": 146 + }, + "property2": { + "p50": 123, + "p95": 146 + } + }, + "created_at": "2019-08-24T14:15:22Z", + "created_by_id": "9377d689-01fb-4abf-8450-3368d2c1924f", + "created_by_name": "string", + "default_ttl_ms": 0, + "deprecated": true, + "deprecation_message": "string", + "description": "string", + "display_name": "string", + "failure_ttl_ms": 0, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "max_port_share_level": "owner", + "name": "string", + "organization_display_name": "string", + "organization_icon": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "organization_name": "string", + "provisioner": "terraform", + "require_active_version": true, + "time_til_dormant_autodelete_ms": 0, + "time_til_dormant_ms": 0, + "updated_at": "2019-08-24T14:15:22Z" + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-----------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.Template](schemas.md#codersdktemplate) |

Response Schema

Status Code **200** -| Name | Type | Required | Restrictions | Description | -| ------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `[array item]` | array | false | | | -| `» active_user_count` | integer | false | | Active user count is set to -1 when loading. | -| `» active_version_id` | string(uuid) | false | | | -| `» activity_bump_ms` | integer | false | | | -| `» allow_user_autostart` | boolean | false | | Allow user autostart and AllowUserAutostop are enterprise-only. Their values are only used if your license is entitled to use the advanced template scheduling feature. | -| `» allow_user_autostop` | boolean | false | | | -| `» allow_user_cancel_workspace_jobs` | boolean | false | | | -| `» autostart_requirement` | [codersdk.TemplateAutostartRequirement](schemas.md#codersdktemplateautostartrequirement) | false | | | -| `»» days_of_week` | array | false | | Days of week is a list of days of the week in which autostart is allowed to happen. If no days are specified, autostart is not allowed. | -| `» autostop_requirement` | [codersdk.TemplateAutostopRequirement](schemas.md#codersdktemplateautostoprequirement) | false | | Autostop requirement and AutostartRequirement are enterprise features. Its value is only used if your license is entitled to use the advanced template scheduling feature. | -| `»» days_of_week` | array | false | | Days of week is a list of days of the week on which restarts are required. Restarts happen within the user's quiet hours (in their configured timezone). If no days are specified, restarts are not required. Weekdays cannot be specified twice. | -| Restarts will only happen on weekdays in this list on weeks which line up with Weeks. | -| `»» weeks` | integer | false | | Weeks is the number of weeks between required restarts. Weeks are synced across all workspaces (and Coder deployments) using modulo math on a hardcoded epoch week of January 2nd, 2023 (the first Monday of 2023). Values of 0 or 1 indicate weekly restarts. Values of 2 indicate fortnightly restarts, etc. | -| `» build_time_stats` | [codersdk.TemplateBuildTimeStats](schemas.md#codersdktemplatebuildtimestats) | false | | | -| `»» [any property]` | [codersdk.TransitionStats](schemas.md#codersdktransitionstats) | false | | | -| `»»» p50` | integer | false | | | -| `»»» p95` | integer | false | | | -| `» created_at` | string(date-time) | false | | | -| `» created_by_id` | string(uuid) | false | | | -| `» created_by_name` | string | false | | | -| `» default_ttl_ms` | integer | false | | | -| `» deprecated` | boolean | false | | | -| `» deprecation_message` | string | false | | | -| `» description` | string | false | | | -| `» display_name` | string | false | | | -| `» failure_ttl_ms` | integer | false | | Failure ttl ms TimeTilDormantMillis, and TimeTilDormantAutoDeleteMillis are enterprise-only. Their values are used if your license is entitled to use the advanced template scheduling feature. | -| `» icon` | string | false | | | -| `» id` | string(uuid) | false | | | -| `» max_port_share_level` | [codersdk.WorkspaceAgentPortShareLevel](schemas.md#codersdkworkspaceagentportsharelevel) | false | | | -| `» name` | string | false | | | -| `» organization_display_name` | string | false | | | -| `» organization_icon` | string | false | | | -| `» organization_id` | string(uuid) | false | | | -| `» organization_name` | string(url) | false | | | -| `» provisioner` | string | false | | | -| `» require_active_version` | boolean | false | | Require active version mandates that workspaces are built with the active template version. | -| `» time_til_dormant_autodelete_ms` | integer | false | | | -| `» time_til_dormant_ms` | integer | false | | | -| `» updated_at` | string(date-time) | false | | | +| Name | Type | Required | Restrictions | Description | +|--------------------------------------|------------------------------------------------------------------------------------------|----------|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `[array item]` | array | false | | | +| `» active_user_count` | integer | false | | Active user count is set to -1 when loading. | +| `» active_version_id` | string(uuid) | false | | | +| `» activity_bump_ms` | integer | false | | | +| `» allow_user_autostart` | boolean | false | | Allow user autostart and AllowUserAutostop are enterprise-only. Their values are only used if your license is entitled to use the advanced template scheduling feature. | +| `» allow_user_autostop` | boolean | false | | | +| `» allow_user_cancel_workspace_jobs` | boolean | false | | | +| `» autostart_requirement` | [codersdk.TemplateAutostartRequirement](schemas.md#codersdktemplateautostartrequirement) | false | | | +| `»» days_of_week` | array | false | | Days of week is a list of days of the week in which autostart is allowed to happen. If no days are specified, autostart is not allowed. | +| `» autostop_requirement` | [codersdk.TemplateAutostopRequirement](schemas.md#codersdktemplateautostoprequirement) | false | | Autostop requirement and AutostartRequirement are enterprise features. Its value is only used if your license is entitled to use the advanced template scheduling feature. | +|`»» days_of_week`|array|false||Days of week is a list of days of the week on which restarts are required. Restarts happen within the user's quiet hours (in their configured timezone). If no days are specified, restarts are not required. Weekdays cannot be specified twice. +Restarts will only happen on weekdays in this list on weeks which line up with Weeks.| +|`»» weeks`|integer|false||Weeks is the number of weeks between required restarts. Weeks are synced across all workspaces (and Coder deployments) using modulo math on a hardcoded epoch week of January 2nd, 2023 (the first Monday of 2023). Values of 0 or 1 indicate weekly restarts. Values of 2 indicate fortnightly restarts, etc.| +|`» build_time_stats`|[codersdk.TemplateBuildTimeStats](schemas.md#codersdktemplatebuildtimestats)|false||| +|`»» [any property]`|[codersdk.TransitionStats](schemas.md#codersdktransitionstats)|false||| +|`»»» p50`|integer|false||| +|`»»» p95`|integer|false||| +|`» created_at`|string(date-time)|false||| +|`» created_by_id`|string(uuid)|false||| +|`» created_by_name`|string|false||| +|`» default_ttl_ms`|integer|false||| +|`» deprecated`|boolean|false||| +|`» deprecation_message`|string|false||| +|`» description`|string|false||| +|`» display_name`|string|false||| +|`» failure_ttl_ms`|integer|false||Failure ttl ms TimeTilDormantMillis, and TimeTilDormantAutoDeleteMillis are enterprise-only. Their values are used if your license is entitled to use the advanced template scheduling feature.| +|`» icon`|string|false||| +|`» id`|string(uuid)|false||| +|`» max_port_share_level`|[codersdk.WorkspaceAgentPortShareLevel](schemas.md#codersdkworkspaceagentportsharelevel)|false||| +|`» name`|string|false||| +|`» organization_display_name`|string|false||| +|`» organization_icon`|string|false||| +|`» organization_id`|string(uuid)|false||| +|`» organization_name`|string(url)|false||| +|`» provisioner`|string|false||| +|`» require_active_version`|boolean|false||Require active version mandates that workspaces are built with the active template version.| +|`» time_til_dormant_autodelete_ms`|integer|false||| +|`» time_til_dormant_ms`|integer|false||| +|`» updated_at`|string(date-time)|false||| #### Enumerated Values | Property | Value | -| ---------------------- | --------------- | +|------------------------|-----------------| | `max_port_share_level` | `owner` | | `max_port_share_level` | `authenticated` | | `max_port_share_level` | `public` | @@ -796,22 +824,24 @@ curl -X GET http://coder-server:8080/api/v2/templates/examples \ ```json [ - { - "description": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "markdown": "string", - "name": "string", - "tags": ["string"], - "url": "string" - } + { + "description": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "markdown": "string", + "name": "string", + "tags": [ + "string" + ], + "url": "string" + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ----------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.TemplateExample](schemas.md#codersdktemplateexample) |

Response Schema

@@ -819,7 +849,7 @@ curl -X GET http://coder-server:8080/api/v2/templates/examples \ Status Code **200** | Name | Type | Required | Restrictions | Description | -| --------------- | ------------ | -------- | ------------ | ----------- | +|-----------------|--------------|----------|--------------|-------------| | `[array item]` | array | false | | | | `» description` | string | false | | | | `» icon` | string | false | | | @@ -847,7 +877,7 @@ curl -X GET http://coder-server:8080/api/v2/templates/{template} \ ### Parameters | Name | In | Type | Required | Description | -| ---------- | ---- | ------------ | -------- | ----------- | +|------------|------|--------------|----------|-------------| | `template` | path | string(uuid) | true | Template ID | ### Example responses @@ -856,58 +886,62 @@ curl -X GET http://coder-server:8080/api/v2/templates/{template} \ ```json { - "active_user_count": 0, - "active_version_id": "eae64611-bd53-4a80-bb77-df1e432c0fbc", - "activity_bump_ms": 0, - "allow_user_autostart": true, - "allow_user_autostop": true, - "allow_user_cancel_workspace_jobs": true, - "autostart_requirement": { - "days_of_week": ["monday"] - }, - "autostop_requirement": { - "days_of_week": ["monday"], - "weeks": 0 - }, - "build_time_stats": { - "property1": { - "p50": 123, - "p95": 146 - }, - "property2": { - "p50": 123, - "p95": 146 - } - }, - "created_at": "2019-08-24T14:15:22Z", - "created_by_id": "9377d689-01fb-4abf-8450-3368d2c1924f", - "created_by_name": "string", - "default_ttl_ms": 0, - "deprecated": true, - "deprecation_message": "string", - "description": "string", - "display_name": "string", - "failure_ttl_ms": 0, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "max_port_share_level": "owner", - "name": "string", - "organization_display_name": "string", - "organization_icon": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "organization_name": "string", - "provisioner": "terraform", - "require_active_version": true, - "time_til_dormant_autodelete_ms": 0, - "time_til_dormant_ms": 0, - "updated_at": "2019-08-24T14:15:22Z" + "active_user_count": 0, + "active_version_id": "eae64611-bd53-4a80-bb77-df1e432c0fbc", + "activity_bump_ms": 0, + "allow_user_autostart": true, + "allow_user_autostop": true, + "allow_user_cancel_workspace_jobs": true, + "autostart_requirement": { + "days_of_week": [ + "monday" + ] + }, + "autostop_requirement": { + "days_of_week": [ + "monday" + ], + "weeks": 0 + }, + "build_time_stats": { + "property1": { + "p50": 123, + "p95": 146 + }, + "property2": { + "p50": 123, + "p95": 146 + } + }, + "created_at": "2019-08-24T14:15:22Z", + "created_by_id": "9377d689-01fb-4abf-8450-3368d2c1924f", + "created_by_name": "string", + "default_ttl_ms": 0, + "deprecated": true, + "deprecation_message": "string", + "description": "string", + "display_name": "string", + "failure_ttl_ms": 0, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "max_port_share_level": "owner", + "name": "string", + "organization_display_name": "string", + "organization_icon": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "organization_name": "string", + "provisioner": "terraform", + "require_active_version": true, + "time_til_dormant_autodelete_ms": 0, + "time_til_dormant_ms": 0, + "updated_at": "2019-08-24T14:15:22Z" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Template](schemas.md#codersdktemplate) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -928,7 +962,7 @@ curl -X DELETE http://coder-server:8080/api/v2/templates/{template} \ ### Parameters | Name | In | Type | Required | Description | -| ---------- | ---- | ------------ | -------- | ----------- | +|------------|------|--------------|----------|-------------| | `template` | path | string(uuid) | true | Template ID | ### Example responses @@ -937,21 +971,21 @@ curl -X DELETE http://coder-server:8080/api/v2/templates/{template} \ ```json { - "detail": "string", - "message": "string", - "validations": [ - { - "detail": "string", - "field": "string" - } - ] + "detail": "string", + "message": "string", + "validations": [ + { + "detail": "string", + "field": "string" + } + ] } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Response](schemas.md#codersdkresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -972,7 +1006,7 @@ curl -X PATCH http://coder-server:8080/api/v2/templates/{template} \ ### Parameters | Name | In | Type | Required | Description | -| ---------- | ---- | ------------ | -------- | ----------- | +|------------|------|--------------|----------|-------------| | `template` | path | string(uuid) | true | Template ID | ### Example responses @@ -981,58 +1015,62 @@ curl -X PATCH http://coder-server:8080/api/v2/templates/{template} \ ```json { - "active_user_count": 0, - "active_version_id": "eae64611-bd53-4a80-bb77-df1e432c0fbc", - "activity_bump_ms": 0, - "allow_user_autostart": true, - "allow_user_autostop": true, - "allow_user_cancel_workspace_jobs": true, - "autostart_requirement": { - "days_of_week": ["monday"] - }, - "autostop_requirement": { - "days_of_week": ["monday"], - "weeks": 0 - }, - "build_time_stats": { - "property1": { - "p50": 123, - "p95": 146 - }, - "property2": { - "p50": 123, - "p95": 146 - } - }, - "created_at": "2019-08-24T14:15:22Z", - "created_by_id": "9377d689-01fb-4abf-8450-3368d2c1924f", - "created_by_name": "string", - "default_ttl_ms": 0, - "deprecated": true, - "deprecation_message": "string", - "description": "string", - "display_name": "string", - "failure_ttl_ms": 0, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "max_port_share_level": "owner", - "name": "string", - "organization_display_name": "string", - "organization_icon": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "organization_name": "string", - "provisioner": "terraform", - "require_active_version": true, - "time_til_dormant_autodelete_ms": 0, - "time_til_dormant_ms": 0, - "updated_at": "2019-08-24T14:15:22Z" + "active_user_count": 0, + "active_version_id": "eae64611-bd53-4a80-bb77-df1e432c0fbc", + "activity_bump_ms": 0, + "allow_user_autostart": true, + "allow_user_autostop": true, + "allow_user_cancel_workspace_jobs": true, + "autostart_requirement": { + "days_of_week": [ + "monday" + ] + }, + "autostop_requirement": { + "days_of_week": [ + "monday" + ], + "weeks": 0 + }, + "build_time_stats": { + "property1": { + "p50": 123, + "p95": 146 + }, + "property2": { + "p50": 123, + "p95": 146 + } + }, + "created_at": "2019-08-24T14:15:22Z", + "created_by_id": "9377d689-01fb-4abf-8450-3368d2c1924f", + "created_by_name": "string", + "default_ttl_ms": 0, + "deprecated": true, + "deprecation_message": "string", + "description": "string", + "display_name": "string", + "failure_ttl_ms": 0, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "max_port_share_level": "owner", + "name": "string", + "organization_display_name": "string", + "organization_icon": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "organization_name": "string", + "provisioner": "terraform", + "require_active_version": true, + "time_til_dormant_autodelete_ms": 0, + "time_til_dormant_ms": 0, + "updated_at": "2019-08-24T14:15:22Z" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Template](schemas.md#codersdktemplate) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1053,7 +1091,7 @@ curl -X GET http://coder-server:8080/api/v2/templates/{template}/daus \ ### Parameters | Name | In | Type | Required | Description | -| ---------- | ---- | ------------ | -------- | ----------- | +|------------|------|--------------|----------|-------------| | `template` | path | string(uuid) | true | Template ID | ### Example responses @@ -1062,20 +1100,20 @@ curl -X GET http://coder-server:8080/api/v2/templates/{template}/daus \ ```json { - "entries": [ - { - "amount": 0, - "date": "string" - } - ], - "tz_hour_offset": 0 + "entries": [ + { + "amount": 0, + "date": "string" + } + ], + "tz_hour_offset": 0 } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.DAUsResponse](schemas.md#codersdkdausresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1096,7 +1134,7 @@ curl -X GET http://coder-server:8080/api/v2/templates/{template}/versions \ ### Parameters | Name | In | Type | Required | Description | -| ------------------ | ----- | ------------ | -------- | ------------------------------------- | +|--------------------|-------|--------------|----------|---------------------------------------| | `template` | path | string(uuid) | true | Template ID | | `after_id` | query | string(uuid) | false | After ID | | `include_archived` | query | boolean | false | Include archived versions in the list | @@ -1109,53 +1147,55 @@ curl -X GET http://coder-server:8080/api/v2/templates/{template}/versions \ ```json [ - { - "archived": true, - "created_at": "2019-08-24T14:15:22Z", - "created_by": { - "avatar_url": "http://example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "username": "string" - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "job": { - "canceled_at": "2019-08-24T14:15:22Z", - "completed_at": "2019-08-24T14:15:22Z", - "created_at": "2019-08-24T14:15:22Z", - "error": "string", - "error_code": "REQUIRED_TEMPLATE_VARIABLES", - "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "queue_position": 0, - "queue_size": 0, - "started_at": "2019-08-24T14:15:22Z", - "status": "pending", - "tags": { - "property1": "string", - "property2": "string" - }, - "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" - }, - "matched_provisioners": { - "available": 0, - "count": 0, - "most_recently_seen": "2019-08-24T14:15:22Z" - }, - "message": "string", - "name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "readme": "string", - "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", - "updated_at": "2019-08-24T14:15:22Z", - "warnings": ["UNSUPPORTED_WORKSPACES"] - } + { + "archived": true, + "created_at": "2019-08-24T14:15:22Z", + "created_by": { + "avatar_url": "http://example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "username": "string" + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "job": { + "canceled_at": "2019-08-24T14:15:22Z", + "completed_at": "2019-08-24T14:15:22Z", + "created_at": "2019-08-24T14:15:22Z", + "error": "string", + "error_code": "REQUIRED_TEMPLATE_VARIABLES", + "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "queue_position": 0, + "queue_size": 0, + "started_at": "2019-08-24T14:15:22Z", + "status": "pending", + "tags": { + "property1": "string", + "property2": "string" + }, + "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" + }, + "matched_provisioners": { + "available": 0, + "count": 0, + "most_recently_seen": "2019-08-24T14:15:22Z" + }, + "message": "string", + "name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "readme": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "updated_at": "2019-08-24T14:15:22Z", + "warnings": [ + "UNSUPPORTED_WORKSPACES" + ] + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ----------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.TemplateVersion](schemas.md#codersdktemplateversion) |

Response Schema

@@ -1163,7 +1203,7 @@ curl -X GET http://coder-server:8080/api/v2/templates/{template}/versions \ Status Code **200** | Name | Type | Required | Restrictions | Description | -| ------------------------ | ------------------------------------------------------------------------ | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|--------------------------|--------------------------------------------------------------------------|----------|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `[array item]` | array | false | | | | `» archived` | boolean | false | | | | `» created_at` | string(date-time) | false | | | @@ -1202,7 +1242,7 @@ Status Code **200** #### Enumerated Values | Property | Value | -| ------------ | ----------------------------- | +|--------------|-------------------------------| | `error_code` | `REQUIRED_TEMPLATE_VARIABLES` | | `status` | `pending` | | `status` | `running` | @@ -1231,14 +1271,14 @@ curl -X PATCH http://coder-server:8080/api/v2/templates/{template}/versions \ ```json { - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08" + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08" } ``` ### Parameters | Name | In | Type | Required | Description | -| ---------- | ---- | -------------------------------------------------------------------------------------- | -------- | ------------------------- | +|------------|------|----------------------------------------------------------------------------------------|----------|---------------------------| | `template` | path | string(uuid) | true | Template ID | | `body` | body | [codersdk.UpdateActiveTemplateVersion](schemas.md#codersdkupdateactivetemplateversion) | true | Modified template version | @@ -1248,21 +1288,21 @@ curl -X PATCH http://coder-server:8080/api/v2/templates/{template}/versions \ ```json { - "detail": "string", - "message": "string", - "validations": [ - { - "detail": "string", - "field": "string" - } - ] + "detail": "string", + "message": "string", + "validations": [ + { + "detail": "string", + "field": "string" + } + ] } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Response](schemas.md#codersdkresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1285,14 +1325,14 @@ curl -X POST http://coder-server:8080/api/v2/templates/{template}/versions/archi ```json { - "all": true + "all": true } ``` ### Parameters | Name | In | Type | Required | Description | -| ---------- | ---- | -------------------------------------------------------------------------------------------- | -------- | --------------- | +|------------|------|----------------------------------------------------------------------------------------------|----------|-----------------| | `template` | path | string(uuid) | true | Template ID | | `body` | body | [codersdk.ArchiveTemplateVersionsRequest](schemas.md#codersdkarchivetemplateversionsrequest) | true | Archive request | @@ -1302,21 +1342,21 @@ curl -X POST http://coder-server:8080/api/v2/templates/{template}/versions/archi ```json { - "detail": "string", - "message": "string", - "validations": [ - { - "detail": "string", - "field": "string" - } - ] + "detail": "string", + "message": "string", + "validations": [ + { + "detail": "string", + "field": "string" + } + ] } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Response](schemas.md#codersdkresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1337,7 +1377,7 @@ curl -X GET http://coder-server:8080/api/v2/templates/{template}/versions/{templ ### Parameters | Name | In | Type | Required | Description | -| --------------------- | ---- | ------------ | -------- | --------------------- | +|-----------------------|------|--------------|----------|-----------------------| | `template` | path | string(uuid) | true | Template ID | | `templateversionname` | path | string | true | Template version name | @@ -1347,53 +1387,55 @@ curl -X GET http://coder-server:8080/api/v2/templates/{template}/versions/{templ ```json [ - { - "archived": true, - "created_at": "2019-08-24T14:15:22Z", - "created_by": { - "avatar_url": "http://example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "username": "string" - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "job": { - "canceled_at": "2019-08-24T14:15:22Z", - "completed_at": "2019-08-24T14:15:22Z", - "created_at": "2019-08-24T14:15:22Z", - "error": "string", - "error_code": "REQUIRED_TEMPLATE_VARIABLES", - "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "queue_position": 0, - "queue_size": 0, - "started_at": "2019-08-24T14:15:22Z", - "status": "pending", - "tags": { - "property1": "string", - "property2": "string" - }, - "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" - }, - "matched_provisioners": { - "available": 0, - "count": 0, - "most_recently_seen": "2019-08-24T14:15:22Z" - }, - "message": "string", - "name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "readme": "string", - "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", - "updated_at": "2019-08-24T14:15:22Z", - "warnings": ["UNSUPPORTED_WORKSPACES"] - } + { + "archived": true, + "created_at": "2019-08-24T14:15:22Z", + "created_by": { + "avatar_url": "http://example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "username": "string" + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "job": { + "canceled_at": "2019-08-24T14:15:22Z", + "completed_at": "2019-08-24T14:15:22Z", + "created_at": "2019-08-24T14:15:22Z", + "error": "string", + "error_code": "REQUIRED_TEMPLATE_VARIABLES", + "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "queue_position": 0, + "queue_size": 0, + "started_at": "2019-08-24T14:15:22Z", + "status": "pending", + "tags": { + "property1": "string", + "property2": "string" + }, + "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" + }, + "matched_provisioners": { + "available": 0, + "count": 0, + "most_recently_seen": "2019-08-24T14:15:22Z" + }, + "message": "string", + "name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "readme": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "updated_at": "2019-08-24T14:15:22Z", + "warnings": [ + "UNSUPPORTED_WORKSPACES" + ] + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ----------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.TemplateVersion](schemas.md#codersdktemplateversion) |

Response Schema

@@ -1401,7 +1443,7 @@ curl -X GET http://coder-server:8080/api/v2/templates/{template}/versions/{templ Status Code **200** | Name | Type | Required | Restrictions | Description | -| ------------------------ | ------------------------------------------------------------------------ | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|--------------------------|--------------------------------------------------------------------------|----------|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `[array item]` | array | false | | | | `» archived` | boolean | false | | | | `» created_at` | string(date-time) | false | | | @@ -1440,7 +1482,7 @@ Status Code **200** #### Enumerated Values | Property | Value | -| ------------ | ----------------------------- | +|--------------|-------------------------------| | `error_code` | `REQUIRED_TEMPLATE_VARIABLES` | | `status` | `pending` | | `status` | `running` | @@ -1467,7 +1509,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion} \ ### Parameters | Name | In | Type | Required | Description | -| ----------------- | ---- | ------------ | -------- | ------------------- | +|-------------------|------|--------------|----------|---------------------| | `templateversion` | path | string(uuid) | true | Template version ID | ### Example responses @@ -1476,51 +1518,53 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion} \ ```json { - "archived": true, - "created_at": "2019-08-24T14:15:22Z", - "created_by": { - "avatar_url": "http://example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "username": "string" - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "job": { - "canceled_at": "2019-08-24T14:15:22Z", - "completed_at": "2019-08-24T14:15:22Z", - "created_at": "2019-08-24T14:15:22Z", - "error": "string", - "error_code": "REQUIRED_TEMPLATE_VARIABLES", - "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "queue_position": 0, - "queue_size": 0, - "started_at": "2019-08-24T14:15:22Z", - "status": "pending", - "tags": { - "property1": "string", - "property2": "string" - }, - "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" - }, - "matched_provisioners": { - "available": 0, - "count": 0, - "most_recently_seen": "2019-08-24T14:15:22Z" - }, - "message": "string", - "name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "readme": "string", - "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", - "updated_at": "2019-08-24T14:15:22Z", - "warnings": ["UNSUPPORTED_WORKSPACES"] + "archived": true, + "created_at": "2019-08-24T14:15:22Z", + "created_by": { + "avatar_url": "http://example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "username": "string" + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "job": { + "canceled_at": "2019-08-24T14:15:22Z", + "completed_at": "2019-08-24T14:15:22Z", + "created_at": "2019-08-24T14:15:22Z", + "error": "string", + "error_code": "REQUIRED_TEMPLATE_VARIABLES", + "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "queue_position": 0, + "queue_size": 0, + "started_at": "2019-08-24T14:15:22Z", + "status": "pending", + "tags": { + "property1": "string", + "property2": "string" + }, + "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" + }, + "matched_provisioners": { + "available": 0, + "count": 0, + "most_recently_seen": "2019-08-24T14:15:22Z" + }, + "message": "string", + "name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "readme": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "updated_at": "2019-08-24T14:15:22Z", + "warnings": [ + "UNSUPPORTED_WORKSPACES" + ] } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.TemplateVersion](schemas.md#codersdktemplateversion) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1543,15 +1587,15 @@ curl -X PATCH http://coder-server:8080/api/v2/templateversions/{templateversion} ```json { - "message": "string", - "name": "string" + "message": "string", + "name": "string" } ``` ### Parameters | Name | In | Type | Required | Description | -| ----------------- | ---- | -------------------------------------------------------------------------------------- | -------- | ------------------------------ | +|-------------------|------|----------------------------------------------------------------------------------------|----------|--------------------------------| | `templateversion` | path | string(uuid) | true | Template version ID | | `body` | body | [codersdk.PatchTemplateVersionRequest](schemas.md#codersdkpatchtemplateversionrequest) | true | Patch template version request | @@ -1561,51 +1605,53 @@ curl -X PATCH http://coder-server:8080/api/v2/templateversions/{templateversion} ```json { - "archived": true, - "created_at": "2019-08-24T14:15:22Z", - "created_by": { - "avatar_url": "http://example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "username": "string" - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "job": { - "canceled_at": "2019-08-24T14:15:22Z", - "completed_at": "2019-08-24T14:15:22Z", - "created_at": "2019-08-24T14:15:22Z", - "error": "string", - "error_code": "REQUIRED_TEMPLATE_VARIABLES", - "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "queue_position": 0, - "queue_size": 0, - "started_at": "2019-08-24T14:15:22Z", - "status": "pending", - "tags": { - "property1": "string", - "property2": "string" - }, - "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" - }, - "matched_provisioners": { - "available": 0, - "count": 0, - "most_recently_seen": "2019-08-24T14:15:22Z" - }, - "message": "string", - "name": "string", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "readme": "string", - "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", - "updated_at": "2019-08-24T14:15:22Z", - "warnings": ["UNSUPPORTED_WORKSPACES"] + "archived": true, + "created_at": "2019-08-24T14:15:22Z", + "created_by": { + "avatar_url": "http://example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "username": "string" + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "job": { + "canceled_at": "2019-08-24T14:15:22Z", + "completed_at": "2019-08-24T14:15:22Z", + "created_at": "2019-08-24T14:15:22Z", + "error": "string", + "error_code": "REQUIRED_TEMPLATE_VARIABLES", + "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "queue_position": 0, + "queue_size": 0, + "started_at": "2019-08-24T14:15:22Z", + "status": "pending", + "tags": { + "property1": "string", + "property2": "string" + }, + "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" + }, + "matched_provisioners": { + "available": 0, + "count": 0, + "most_recently_seen": "2019-08-24T14:15:22Z" + }, + "message": "string", + "name": "string", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "readme": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "updated_at": "2019-08-24T14:15:22Z", + "warnings": [ + "UNSUPPORTED_WORKSPACES" + ] } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.TemplateVersion](schemas.md#codersdktemplateversion) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1626,7 +1672,7 @@ curl -X POST http://coder-server:8080/api/v2/templateversions/{templateversion}/ ### Parameters | Name | In | Type | Required | Description | -| ----------------- | ---- | ------------ | -------- | ------------------- | +|-------------------|------|--------------|----------|---------------------| | `templateversion` | path | string(uuid) | true | Template version ID | ### Example responses @@ -1635,21 +1681,21 @@ curl -X POST http://coder-server:8080/api/v2/templateversions/{templateversion}/ ```json { - "detail": "string", - "message": "string", - "validations": [ - { - "detail": "string", - "field": "string" - } - ] + "detail": "string", + "message": "string", + "validations": [ + { + "detail": "string", + "field": "string" + } + ] } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Response](schemas.md#codersdkresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1670,7 +1716,7 @@ curl -X PATCH http://coder-server:8080/api/v2/templateversions/{templateversion} ### Parameters | Name | In | Type | Required | Description | -| ----------------- | ---- | ------------ | -------- | ------------------- | +|-------------------|------|--------------|----------|---------------------| | `templateversion` | path | string(uuid) | true | Template version ID | ### Example responses @@ -1679,21 +1725,21 @@ curl -X PATCH http://coder-server:8080/api/v2/templateversions/{templateversion} ```json { - "detail": "string", - "message": "string", - "validations": [ - { - "detail": "string", - "field": "string" - } - ] + "detail": "string", + "message": "string", + "validations": [ + { + "detail": "string", + "field": "string" + } + ] } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Response](schemas.md#codersdkresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1716,26 +1762,26 @@ curl -X POST http://coder-server:8080/api/v2/templateversions/{templateversion}/ ```json { - "rich_parameter_values": [ - { - "name": "string", - "value": "string" - } - ], - "user_variable_values": [ - { - "name": "string", - "value": "string" - } - ], - "workspace_name": "string" + "rich_parameter_values": [ + { + "name": "string", + "value": "string" + } + ], + "user_variable_values": [ + { + "name": "string", + "value": "string" + } + ], + "workspace_name": "string" } ``` ### Parameters | Name | In | Type | Required | Description | -| ----------------- | ---- | ---------------------------------------------------------------------------------------------------- | -------- | ------------------- | +|-------------------|------|------------------------------------------------------------------------------------------------------|----------|---------------------| | `templateversion` | path | string(uuid) | true | Template version ID | | `body` | body | [codersdk.CreateTemplateVersionDryRunRequest](schemas.md#codersdkcreatetemplateversiondryrunrequest) | true | Dry-run request | @@ -1745,29 +1791,29 @@ curl -X POST http://coder-server:8080/api/v2/templateversions/{templateversion}/ ```json { - "canceled_at": "2019-08-24T14:15:22Z", - "completed_at": "2019-08-24T14:15:22Z", - "created_at": "2019-08-24T14:15:22Z", - "error": "string", - "error_code": "REQUIRED_TEMPLATE_VARIABLES", - "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "queue_position": 0, - "queue_size": 0, - "started_at": "2019-08-24T14:15:22Z", - "status": "pending", - "tags": { - "property1": "string", - "property2": "string" - }, - "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" + "canceled_at": "2019-08-24T14:15:22Z", + "completed_at": "2019-08-24T14:15:22Z", + "created_at": "2019-08-24T14:15:22Z", + "error": "string", + "error_code": "REQUIRED_TEMPLATE_VARIABLES", + "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "queue_position": 0, + "queue_size": 0, + "started_at": "2019-08-24T14:15:22Z", + "status": "pending", + "tags": { + "property1": "string", + "property2": "string" + }, + "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------------ | ----------- | ------------------------------------------------------------ | +|--------|--------------------------------------------------------------|-------------|--------------------------------------------------------------| | 201 | [Created](https://tools.ietf.org/html/rfc7231#section-6.3.2) | Created | [codersdk.ProvisionerJob](schemas.md#codersdkprovisionerjob) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1788,7 +1834,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/d ### Parameters | Name | In | Type | Required | Description | -| ----------------- | ---- | ------------ | -------- | ------------------- | +|-------------------|------|--------------|----------|---------------------| | `templateversion` | path | string(uuid) | true | Template version ID | | `jobID` | path | string(uuid) | true | Job ID | @@ -1798,29 +1844,29 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/d ```json { - "canceled_at": "2019-08-24T14:15:22Z", - "completed_at": "2019-08-24T14:15:22Z", - "created_at": "2019-08-24T14:15:22Z", - "error": "string", - "error_code": "REQUIRED_TEMPLATE_VARIABLES", - "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "queue_position": 0, - "queue_size": 0, - "started_at": "2019-08-24T14:15:22Z", - "status": "pending", - "tags": { - "property1": "string", - "property2": "string" - }, - "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" + "canceled_at": "2019-08-24T14:15:22Z", + "completed_at": "2019-08-24T14:15:22Z", + "created_at": "2019-08-24T14:15:22Z", + "error": "string", + "error_code": "REQUIRED_TEMPLATE_VARIABLES", + "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "queue_position": 0, + "queue_size": 0, + "started_at": "2019-08-24T14:15:22Z", + "status": "pending", + "tags": { + "property1": "string", + "property2": "string" + }, + "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.ProvisionerJob](schemas.md#codersdkprovisionerjob) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1841,7 +1887,7 @@ curl -X PATCH http://coder-server:8080/api/v2/templateversions/{templateversion} ### Parameters | Name | In | Type | Required | Description | -| ----------------- | ---- | ------------ | -------- | ------------------- | +|-------------------|------|--------------|----------|---------------------| | `jobID` | path | string(uuid) | true | Job ID | | `templateversion` | path | string(uuid) | true | Template version ID | @@ -1851,21 +1897,21 @@ curl -X PATCH http://coder-server:8080/api/v2/templateversions/{templateversion} ```json { - "detail": "string", - "message": "string", - "validations": [ - { - "detail": "string", - "field": "string" - } - ] + "detail": "string", + "message": "string", + "validations": [ + { + "detail": "string", + "field": "string" + } + ] } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Response](schemas.md#codersdkresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1886,7 +1932,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/d ### Parameters | Name | In | Type | Required | Description | -| ----------------- | ----- | ------------ | -------- | --------------------- | +|-------------------|-------|--------------|----------|-----------------------| | `templateversion` | path | string(uuid) | true | Template version ID | | `jobID` | path | string(uuid) | true | Job ID | | `before` | query | integer | false | Before Unix timestamp | @@ -1899,21 +1945,21 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/d ```json [ - { - "created_at": "2019-08-24T14:15:22Z", - "id": 0, - "log_level": "trace", - "log_source": "provisioner_daemon", - "output": "string", - "stage": "string" - } + { + "created_at": "2019-08-24T14:15:22Z", + "id": 0, + "log_level": "trace", + "log_source": "provisioner_daemon", + "output": "string", + "stage": "string" + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-----------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.ProvisionerJobLog](schemas.md#codersdkprovisionerjoblog) |

Response Schema

@@ -1921,7 +1967,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/d Status Code **200** | Name | Type | Required | Restrictions | Description | -| -------------- | -------------------------------------------------- | -------- | ------------ | ----------- | +|----------------|----------------------------------------------------|----------|--------------|-------------| | `[array item]` | array | false | | | | `» created_at` | string(date-time) | false | | | | `» id` | integer | false | | | @@ -1933,7 +1979,7 @@ Status Code **200** #### Enumerated Values | Property | Value | -| ------------ | -------------------- | +|--------------|----------------------| | `log_level` | `trace` | | `log_level` | `debug` | | `log_level` | `info` | @@ -1960,7 +2006,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/d ### Parameters | Name | In | Type | Required | Description | -| ----------------- | ---- | ------------ | -------- | ------------------- | +|-------------------|------|--------------|----------|---------------------| | `templateversion` | path | string(uuid) | true | Template version ID | | `jobID` | path | string(uuid) | true | Job ID | @@ -1970,16 +2016,16 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/d ```json { - "available": 0, - "count": 0, - "most_recently_seen": "2019-08-24T14:15:22Z" + "available": 0, + "count": 0, + "most_recently_seen": "2019-08-24T14:15:22Z" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.MatchedProvisioners](schemas.md#codersdkmatchedprovisioners) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -2000,7 +2046,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/d ### Parameters | Name | In | Type | Required | Description | -| ----------------- | ---- | ------------ | -------- | ------------------- | +|-------------------|------|--------------|----------|---------------------| | `templateversion` | path | string(uuid) | true | Template version ID | | `jobID` | path | string(uuid) | true | Job ID | @@ -2010,123 +2056,128 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/d ```json [ - { - "agents": [ - { - "api_version": "string", - "apps": [ - { - "command": "string", - "display_name": "string", - "external": true, - "health": "disabled", - "healthcheck": { - "interval": 0, - "threshold": 0, - "url": "string" - }, - "hidden": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "sharing_level": "owner", - "slug": "string", - "subdomain": true, - "subdomain_name": "string", - "url": "string" - } - ], - "architecture": "string", - "connection_timeout_seconds": 0, - "created_at": "2019-08-24T14:15:22Z", - "directory": "string", - "disconnected_at": "2019-08-24T14:15:22Z", - "display_apps": ["vscode"], - "environment_variables": { - "property1": "string", - "property2": "string" - }, - "expanded_directory": "string", - "first_connected_at": "2019-08-24T14:15:22Z", - "health": { - "healthy": false, - "reason": "agent has lost connection" - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "instance_id": "string", - "last_connected_at": "2019-08-24T14:15:22Z", - "latency": { - "property1": { - "latency_ms": 0, - "preferred": true - }, - "property2": { - "latency_ms": 0, - "preferred": true - } - }, - "lifecycle_state": "created", - "log_sources": [ - { - "created_at": "2019-08-24T14:15:22Z", - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" - } - ], - "logs_length": 0, - "logs_overflowed": true, - "name": "string", - "operating_system": "string", - "ready_at": "2019-08-24T14:15:22Z", - "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", - "scripts": [ - { - "cron": "string", - "display_name": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "log_path": "string", - "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", - "run_on_start": true, - "run_on_stop": true, - "script": "string", - "start_blocks_login": true, - "timeout": 0 - } - ], - "started_at": "2019-08-24T14:15:22Z", - "startup_script_behavior": "blocking", - "status": "connecting", - "subsystems": ["envbox"], - "troubleshooting_url": "string", - "updated_at": "2019-08-24T14:15:22Z", - "version": "string" - } - ], - "created_at": "2019-08-24T14:15:22Z", - "daily_cost": 0, - "hide": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", - "metadata": [ - { - "key": "string", - "sensitive": true, - "value": "string" - } - ], - "name": "string", - "type": "string", - "workspace_transition": "start" - } + { + "agents": [ + { + "api_version": "string", + "apps": [ + { + "command": "string", + "display_name": "string", + "external": true, + "health": "disabled", + "healthcheck": { + "interval": 0, + "threshold": 0, + "url": "string" + }, + "hidden": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "open_in": "slim-window", + "sharing_level": "owner", + "slug": "string", + "subdomain": true, + "subdomain_name": "string", + "url": "string" + } + ], + "architecture": "string", + "connection_timeout_seconds": 0, + "created_at": "2019-08-24T14:15:22Z", + "directory": "string", + "disconnected_at": "2019-08-24T14:15:22Z", + "display_apps": [ + "vscode" + ], + "environment_variables": { + "property1": "string", + "property2": "string" + }, + "expanded_directory": "string", + "first_connected_at": "2019-08-24T14:15:22Z", + "health": { + "healthy": false, + "reason": "agent has lost connection" + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "instance_id": "string", + "last_connected_at": "2019-08-24T14:15:22Z", + "latency": { + "property1": { + "latency_ms": 0, + "preferred": true + }, + "property2": { + "latency_ms": 0, + "preferred": true + } + }, + "lifecycle_state": "created", + "log_sources": [ + { + "created_at": "2019-08-24T14:15:22Z", + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" + } + ], + "logs_length": 0, + "logs_overflowed": true, + "name": "string", + "operating_system": "string", + "ready_at": "2019-08-24T14:15:22Z", + "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", + "scripts": [ + { + "cron": "string", + "display_name": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "log_path": "string", + "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", + "run_on_start": true, + "run_on_stop": true, + "script": "string", + "start_blocks_login": true, + "timeout": 0 + } + ], + "started_at": "2019-08-24T14:15:22Z", + "startup_script_behavior": "blocking", + "status": "connecting", + "subsystems": [ + "envbox" + ], + "troubleshooting_url": "string", + "updated_at": "2019-08-24T14:15:22Z", + "version": "string" + } + ], + "created_at": "2019-08-24T14:15:22Z", + "daily_cost": 0, + "hide": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", + "metadata": [ + { + "key": "string", + "sensitive": true, + "value": "string" + } + ], + "name": "string", + "type": "string", + "workspace_transition": "start" + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-----------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.WorkspaceResource](schemas.md#codersdkworkspaceresource) |

Response Schema

@@ -2134,7 +2185,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/d Status Code **200** | Name | Type | Required | Restrictions | Description | -| ------------------------------- | ------------------------------------------------------------------------------------------------------ | -------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|---------------------------------|--------------------------------------------------------------------------------------------------------|----------|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `[array item]` | array | false | | | | `» agents` | array | false | | | | `»» api_version` | string | false | | | @@ -2150,6 +2201,7 @@ Status Code **200** | `»»» hidden` | boolean | false | | | | `»»» icon` | string | false | | Icon is a relative path or external URL that specifies an icon to be displayed in the dashboard. | | `»»» id` | string(uuid) | false | | | +| `»»» open_in` | [codersdk.WorkspaceAppOpenIn](schemas.md#codersdkworkspaceappopenin) | false | | | | `»»» sharing_level` | [codersdk.WorkspaceAppSharingLevel](schemas.md#codersdkworkspaceappsharinglevel) | false | | | | `»»» slug` | string | false | | Slug is a unique identifier within the agent. | | `»»» subdomain` | boolean | false | | Subdomain denotes whether the app should be accessed via a path on the `coder server` or via a hostname-based dev URL. If this is set to true and there is no app wildcard configured on the server, the app will not be accessible in the UI. | @@ -2223,11 +2275,14 @@ Status Code **200** #### Enumerated Values | Property | Value | -| ------------------------- | ------------------ | +|---------------------------|--------------------| | `health` | `disabled` | | `health` | `initializing` | | `health` | `healthy` | | `health` | `unhealthy` | +| `open_in` | `slim-window` | +| `open_in` | `window` | +| `open_in` | `tab` | | `sharing_level` | `owner` | | `sharing_level` | `authenticated` | | `sharing_level` | `public` | @@ -2268,7 +2323,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/e ### Parameters | Name | In | Type | Required | Description | -| ----------------- | ---- | ------------ | -------- | ------------------- | +|-------------------|------|--------------|----------|---------------------| | `templateversion` | path | string(uuid) | true | Template version ID | ### Example responses @@ -2277,22 +2332,22 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/e ```json [ - { - "authenticate_url": "string", - "authenticated": true, - "display_icon": "string", - "display_name": "string", - "id": "string", - "optional": true, - "type": "string" - } + { + "authenticate_url": "string", + "authenticated": true, + "display_icon": "string", + "display_name": "string", + "id": "string", + "optional": true, + "type": "string" + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ----------------------------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-------------------------------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.TemplateVersionExternalAuth](schemas.md#codersdktemplateversionexternalauth) |

Response Schema

@@ -2300,7 +2355,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/e Status Code **200** | Name | Type | Required | Restrictions | Description | -| -------------------- | ------- | -------- | ------------ | ----------- | +|----------------------|---------|----------|--------------|-------------| | `[array item]` | array | false | | | | `» authenticate_url` | string | false | | | | `» authenticated` | boolean | false | | | @@ -2328,7 +2383,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/l ### Parameters | Name | In | Type | Required | Description | -| ----------------- | ----- | ------------ | -------- | ------------------- | +|-------------------|-------|--------------|----------|---------------------| | `templateversion` | path | string(uuid) | true | Template version ID | | `before` | query | integer | false | Before log id | | `after` | query | integer | false | After log id | @@ -2340,21 +2395,21 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/l ```json [ - { - "created_at": "2019-08-24T14:15:22Z", - "id": 0, - "log_level": "trace", - "log_source": "provisioner_daemon", - "output": "string", - "stage": "string" - } + { + "created_at": "2019-08-24T14:15:22Z", + "id": 0, + "log_level": "trace", + "log_source": "provisioner_daemon", + "output": "string", + "stage": "string" + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-----------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.ProvisionerJobLog](schemas.md#codersdkprovisionerjoblog) |

Response Schema

@@ -2362,7 +2417,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/l Status Code **200** | Name | Type | Required | Restrictions | Description | -| -------------- | -------------------------------------------------- | -------- | ------------ | ----------- | +|----------------|----------------------------------------------------|----------|--------------|-------------| | `[array item]` | array | false | | | | `» created_at` | string(date-time) | false | | | | `» id` | integer | false | | | @@ -2374,7 +2429,7 @@ Status Code **200** #### Enumerated Values | Property | Value | -| ------------ | -------------------- | +|--------------|----------------------| | `log_level` | `trace` | | `log_level` | `debug` | | `log_level` | `info` | @@ -2400,13 +2455,13 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/p ### Parameters | Name | In | Type | Required | Description | -| ----------------- | ---- | ------------ | -------- | ------------------- | +|-------------------|------|--------------|----------|---------------------| | `templateversion` | path | string(uuid) | true | Template version ID | ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------ | +|--------|---------------------------------------------------------|-------------|--------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -2427,7 +2482,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/r ### Parameters | Name | In | Type | Required | Description | -| ----------------- | ---- | ------------ | -------- | ------------------- | +|-------------------|------|--------------|----------|---------------------| | `templateversion` | path | string(uuid) | true | Template version ID | ### Example responses @@ -2436,123 +2491,128 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/r ```json [ - { - "agents": [ - { - "api_version": "string", - "apps": [ - { - "command": "string", - "display_name": "string", - "external": true, - "health": "disabled", - "healthcheck": { - "interval": 0, - "threshold": 0, - "url": "string" - }, - "hidden": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "sharing_level": "owner", - "slug": "string", - "subdomain": true, - "subdomain_name": "string", - "url": "string" - } - ], - "architecture": "string", - "connection_timeout_seconds": 0, - "created_at": "2019-08-24T14:15:22Z", - "directory": "string", - "disconnected_at": "2019-08-24T14:15:22Z", - "display_apps": ["vscode"], - "environment_variables": { - "property1": "string", - "property2": "string" - }, - "expanded_directory": "string", - "first_connected_at": "2019-08-24T14:15:22Z", - "health": { - "healthy": false, - "reason": "agent has lost connection" - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "instance_id": "string", - "last_connected_at": "2019-08-24T14:15:22Z", - "latency": { - "property1": { - "latency_ms": 0, - "preferred": true - }, - "property2": { - "latency_ms": 0, - "preferred": true - } - }, - "lifecycle_state": "created", - "log_sources": [ - { - "created_at": "2019-08-24T14:15:22Z", - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" - } - ], - "logs_length": 0, - "logs_overflowed": true, - "name": "string", - "operating_system": "string", - "ready_at": "2019-08-24T14:15:22Z", - "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", - "scripts": [ - { - "cron": "string", - "display_name": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "log_path": "string", - "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", - "run_on_start": true, - "run_on_stop": true, - "script": "string", - "start_blocks_login": true, - "timeout": 0 - } - ], - "started_at": "2019-08-24T14:15:22Z", - "startup_script_behavior": "blocking", - "status": "connecting", - "subsystems": ["envbox"], - "troubleshooting_url": "string", - "updated_at": "2019-08-24T14:15:22Z", - "version": "string" - } - ], - "created_at": "2019-08-24T14:15:22Z", - "daily_cost": 0, - "hide": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", - "metadata": [ - { - "key": "string", - "sensitive": true, - "value": "string" - } - ], - "name": "string", - "type": "string", - "workspace_transition": "start" - } + { + "agents": [ + { + "api_version": "string", + "apps": [ + { + "command": "string", + "display_name": "string", + "external": true, + "health": "disabled", + "healthcheck": { + "interval": 0, + "threshold": 0, + "url": "string" + }, + "hidden": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "open_in": "slim-window", + "sharing_level": "owner", + "slug": "string", + "subdomain": true, + "subdomain_name": "string", + "url": "string" + } + ], + "architecture": "string", + "connection_timeout_seconds": 0, + "created_at": "2019-08-24T14:15:22Z", + "directory": "string", + "disconnected_at": "2019-08-24T14:15:22Z", + "display_apps": [ + "vscode" + ], + "environment_variables": { + "property1": "string", + "property2": "string" + }, + "expanded_directory": "string", + "first_connected_at": "2019-08-24T14:15:22Z", + "health": { + "healthy": false, + "reason": "agent has lost connection" + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "instance_id": "string", + "last_connected_at": "2019-08-24T14:15:22Z", + "latency": { + "property1": { + "latency_ms": 0, + "preferred": true + }, + "property2": { + "latency_ms": 0, + "preferred": true + } + }, + "lifecycle_state": "created", + "log_sources": [ + { + "created_at": "2019-08-24T14:15:22Z", + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" + } + ], + "logs_length": 0, + "logs_overflowed": true, + "name": "string", + "operating_system": "string", + "ready_at": "2019-08-24T14:15:22Z", + "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", + "scripts": [ + { + "cron": "string", + "display_name": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "log_path": "string", + "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", + "run_on_start": true, + "run_on_stop": true, + "script": "string", + "start_blocks_login": true, + "timeout": 0 + } + ], + "started_at": "2019-08-24T14:15:22Z", + "startup_script_behavior": "blocking", + "status": "connecting", + "subsystems": [ + "envbox" + ], + "troubleshooting_url": "string", + "updated_at": "2019-08-24T14:15:22Z", + "version": "string" + } + ], + "created_at": "2019-08-24T14:15:22Z", + "daily_cost": 0, + "hide": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", + "metadata": [ + { + "key": "string", + "sensitive": true, + "value": "string" + } + ], + "name": "string", + "type": "string", + "workspace_transition": "start" + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-----------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.WorkspaceResource](schemas.md#codersdkworkspaceresource) |

Response Schema

@@ -2560,7 +2620,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/r Status Code **200** | Name | Type | Required | Restrictions | Description | -| ------------------------------- | ------------------------------------------------------------------------------------------------------ | -------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|---------------------------------|--------------------------------------------------------------------------------------------------------|----------|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `[array item]` | array | false | | | | `» agents` | array | false | | | | `»» api_version` | string | false | | | @@ -2576,6 +2636,7 @@ Status Code **200** | `»»» hidden` | boolean | false | | | | `»»» icon` | string | false | | Icon is a relative path or external URL that specifies an icon to be displayed in the dashboard. | | `»»» id` | string(uuid) | false | | | +| `»»» open_in` | [codersdk.WorkspaceAppOpenIn](schemas.md#codersdkworkspaceappopenin) | false | | | | `»»» sharing_level` | [codersdk.WorkspaceAppSharingLevel](schemas.md#codersdkworkspaceappsharinglevel) | false | | | | `»»» slug` | string | false | | Slug is a unique identifier within the agent. | | `»»» subdomain` | boolean | false | | Subdomain denotes whether the app should be accessed via a path on the `coder server` or via a hostname-based dev URL. If this is set to true and there is no app wildcard configured on the server, the app will not be accessible in the UI. | @@ -2649,11 +2710,14 @@ Status Code **200** #### Enumerated Values | Property | Value | -| ------------------------- | ------------------ | +|---------------------------|--------------------| | `health` | `disabled` | | `health` | `initializing` | | `health` | `healthy` | | `health` | `unhealthy` | +| `open_in` | `slim-window` | +| `open_in` | `window` | +| `open_in` | `tab` | | `sharing_level` | `owner` | | `sharing_level` | `authenticated` | | `sharing_level` | `public` | @@ -2694,7 +2758,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/r ### Parameters | Name | In | Type | Required | Description | -| ----------------- | ---- | ------------ | -------- | ------------------- | +|-------------------|------|--------------|----------|---------------------| | `templateversion` | path | string(uuid) | true | Template version ID | ### Example responses @@ -2703,38 +2767,38 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/r ```json [ - { - "default_value": "string", - "description": "string", - "description_plaintext": "string", - "display_name": "string", - "ephemeral": true, - "icon": "string", - "mutable": true, - "name": "string", - "options": [ - { - "description": "string", - "icon": "string", - "name": "string", - "value": "string" - } - ], - "required": true, - "type": "string", - "validation_error": "string", - "validation_max": 0, - "validation_min": 0, - "validation_monotonic": "increasing", - "validation_regex": "string" - } + { + "default_value": "string", + "description": "string", + "description_plaintext": "string", + "display_name": "string", + "ephemeral": true, + "icon": "string", + "mutable": true, + "name": "string", + "options": [ + { + "description": "string", + "icon": "string", + "name": "string", + "value": "string" + } + ], + "required": true, + "type": "string", + "validation_error": "string", + "validation_max": 0, + "validation_min": 0, + "validation_monotonic": "increasing", + "validation_regex": "string" + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ----------------------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-------------------------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.TemplateVersionParameter](schemas.md#codersdktemplateversionparameter) |

Response Schema

@@ -2742,7 +2806,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/r Status Code **200** | Name | Type | Required | Restrictions | Description | -| ------------------------- | -------------------------------------------------------------------------------- | -------- | ------------ | ----------- | +|---------------------------|----------------------------------------------------------------------------------|----------|--------------|-------------| | `[array item]` | array | false | | | | `» default_value` | string | false | | | | `» description` | string | false | | | @@ -2768,7 +2832,7 @@ Status Code **200** #### Enumerated Values | Property | Value | -| ---------------------- | -------------- | +|------------------------|----------------| | `type` | `string` | | `type` | `number` | | `type` | `bool` | @@ -2793,13 +2857,13 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/s ### Parameters | Name | In | Type | Required | Description | -| ----------------- | ---- | ------------ | -------- | ------------------- | +|-------------------|------|--------------|----------|---------------------| | `templateversion` | path | string(uuid) | true | Template version ID | ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------ | +|--------|---------------------------------------------------------|-------------|--------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -2820,7 +2884,7 @@ curl -X POST http://coder-server:8080/api/v2/templateversions/{templateversion}/ ### Parameters | Name | In | Type | Required | Description | -| ----------------- | ---- | ------------ | -------- | ------------------- | +|-------------------|------|--------------|----------|---------------------| | `templateversion` | path | string(uuid) | true | Template version ID | ### Example responses @@ -2829,21 +2893,21 @@ curl -X POST http://coder-server:8080/api/v2/templateversions/{templateversion}/ ```json { - "detail": "string", - "message": "string", - "validations": [ - { - "detail": "string", - "field": "string" - } - ] + "detail": "string", + "message": "string", + "validations": [ + { + "detail": "string", + "field": "string" + } + ] } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Response](schemas.md#codersdkresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -2864,7 +2928,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/v ### Parameters | Name | In | Type | Required | Description | -| ----------------- | ---- | ------------ | -------- | ------------------- | +|-------------------|------|--------------|----------|---------------------| | `templateversion` | path | string(uuid) | true | Template version ID | ### Example responses @@ -2873,22 +2937,22 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/v ```json [ - { - "default_value": "string", - "description": "string", - "name": "string", - "required": true, - "sensitive": true, - "type": "string", - "value": "string" - } + { + "default_value": "string", + "description": "string", + "name": "string", + "required": true, + "sensitive": true, + "type": "string", + "value": "string" + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | --------------------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-----------------------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.TemplateVersionVariable](schemas.md#codersdktemplateversionvariable) |

Response Schema

@@ -2896,7 +2960,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/v Status Code **200** | Name | Type | Required | Restrictions | Description | -| ----------------- | ------- | -------- | ------------ | ----------- | +|-------------------|---------|----------|--------------|-------------| | `[array item]` | array | false | | | | `» default_value` | string | false | | | | `» description` | string | false | | | @@ -2909,7 +2973,7 @@ Status Code **200** #### Enumerated Values | Property | Value | -| -------- | -------- | +|----------|----------| | `type` | `string` | | `type` | `number` | | `type` | `bool` | diff --git a/docs/reference/api/users.md b/docs/reference/api/users.md index 5e0ae3c239c04..d8aac77cfa83b 100644 --- a/docs/reference/api/users.md +++ b/docs/reference/api/users.md @@ -16,7 +16,7 @@ curl -X GET http://coder-server:8080/api/v2/users \ ### Parameters | Name | In | Type | Required | Description | -| ---------- | ----- | ------------ | -------- | ------------ | +|------------|-------|--------------|----------|--------------| | `q` | query | string | false | Search query | | `after_id` | query | string(uuid) | false | After ID | | `limit` | query | integer | false | Page limit | @@ -28,37 +28,39 @@ curl -X GET http://coder-server:8080/api/v2/users \ ```json { - "count": 0, - "users": [ - { - "avatar_url": "http://example.com", - "created_at": "2019-08-24T14:15:22Z", - "email": "user@example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_seen_at": "2019-08-24T14:15:22Z", - "login_type": "", - "name": "string", - "organization_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "roles": [ - { - "display_name": "string", - "name": "string", - "organization_id": "string" - } - ], - "status": "active", - "theme_preference": "string", - "updated_at": "2019-08-24T14:15:22Z", - "username": "string" - } - ] + "count": 0, + "users": [ + { + "avatar_url": "http://example.com", + "created_at": "2019-08-24T14:15:22Z", + "email": "user@example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_seen_at": "2019-08-24T14:15:22Z", + "login_type": "", + "name": "string", + "organization_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "roles": [ + { + "display_name": "string", + "name": "string", + "organization_id": "string" + } + ], + "status": "active", + "theme_preference": "string", + "updated_at": "2019-08-24T14:15:22Z", + "username": "string" + } + ] } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.GetUsersResponse](schemas.md#codersdkgetusersresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -81,20 +83,22 @@ curl -X POST http://coder-server:8080/api/v2/users \ ```json { - "email": "user@example.com", - "login_type": "", - "name": "string", - "organization_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "password": "string", - "user_status": "active", - "username": "string" + "email": "user@example.com", + "login_type": "", + "name": "string", + "organization_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "password": "string", + "user_status": "active", + "username": "string" } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | ---------------------------------------------------------------------------------- | -------- | ------------------- | +|--------|------|------------------------------------------------------------------------------------|----------|---------------------| | `body` | body | [codersdk.CreateUserRequestWithOrgs](schemas.md#codersdkcreateuserrequestwithorgs) | true | Create user request | ### Example responses @@ -103,32 +107,34 @@ curl -X POST http://coder-server:8080/api/v2/users \ ```json { - "avatar_url": "http://example.com", - "created_at": "2019-08-24T14:15:22Z", - "email": "user@example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_seen_at": "2019-08-24T14:15:22Z", - "login_type": "", - "name": "string", - "organization_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "roles": [ - { - "display_name": "string", - "name": "string", - "organization_id": "string" - } - ], - "status": "active", - "theme_preference": "string", - "updated_at": "2019-08-24T14:15:22Z", - "username": "string" + "avatar_url": "http://example.com", + "created_at": "2019-08-24T14:15:22Z", + "email": "user@example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_seen_at": "2019-08-24T14:15:22Z", + "login_type": "", + "name": "string", + "organization_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "roles": [ + { + "display_name": "string", + "name": "string", + "organization_id": "string" + } + ], + "status": "active", + "theme_preference": "string", + "updated_at": "2019-08-24T14:15:22Z", + "username": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------------ | ----------- | ---------------------------------------- | +|--------|--------------------------------------------------------------|-------------|------------------------------------------| | 201 | [Created](https://tools.ietf.org/html/rfc7231#section-6.3.2) | Created | [codersdk.User](schemas.md#codersdkuser) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -152,25 +158,25 @@ curl -X GET http://coder-server:8080/api/v2/users/authmethods \ ```json { - "github": { - "enabled": true - }, - "oidc": { - "enabled": true, - "iconUrl": "string", - "signInText": "string" - }, - "password": { - "enabled": true - }, - "terms_of_service_url": "string" + "github": { + "enabled": true + }, + "oidc": { + "enabled": true, + "iconUrl": "string", + "signInText": "string" + }, + "password": { + "enabled": true + }, + "terms_of_service_url": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.AuthMethods](schemas.md#codersdkauthmethods) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -194,21 +200,21 @@ curl -X GET http://coder-server:8080/api/v2/users/first \ ```json { - "detail": "string", - "message": "string", - "validations": [ - { - "detail": "string", - "field": "string" - } - ] + "detail": "string", + "message": "string", + "validations": [ + { + "detail": "string", + "field": "string" + } + ] } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Response](schemas.md#codersdkresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -231,27 +237,27 @@ curl -X POST http://coder-server:8080/api/v2/users/first \ ```json { - "email": "string", - "name": "string", - "password": "string", - "trial": true, - "trial_info": { - "company_name": "string", - "country": "string", - "developers": "string", - "first_name": "string", - "job_title": "string", - "last_name": "string", - "phone_number": "string" - }, - "username": "string" + "email": "string", + "name": "string", + "password": "string", + "trial": true, + "trial_info": { + "company_name": "string", + "country": "string", + "developers": "string", + "first_name": "string", + "job_title": "string", + "last_name": "string", + "phone_number": "string" + }, + "username": "string" } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | ---------------------------------------------------------------------------- | -------- | ------------------ | +|--------|------|------------------------------------------------------------------------------|----------|--------------------| | `body` | body | [codersdk.CreateFirstUserRequest](schemas.md#codersdkcreatefirstuserrequest) | true | First user request | ### Example responses @@ -260,15 +266,15 @@ curl -X POST http://coder-server:8080/api/v2/users/first \ ```json { - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5" + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------------ | ----------- | ------------------------------------------------------------------------------ | +|--------|--------------------------------------------------------------|-------------|--------------------------------------------------------------------------------| | 201 | [Created](https://tools.ietf.org/html/rfc7231#section-6.3.2) | Created | [codersdk.CreateFirstUserResponse](schemas.md#codersdkcreatefirstuserresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -292,21 +298,21 @@ curl -X POST http://coder-server:8080/api/v2/users/logout \ ```json { - "detail": "string", - "message": "string", - "validations": [ - { - "detail": "string", - "field": "string" - } - ] + "detail": "string", + "message": "string", + "validations": [ + { + "detail": "string", + "field": "string" + } + ] } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Response](schemas.md#codersdkresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -326,7 +332,7 @@ curl -X GET http://coder-server:8080/api/v2/users/oauth2/github/callback \ ### Responses | Status | Meaning | Description | Schema | -| ------ | ----------------------------------------------------------------------- | ------------------ | ------ | +|--------|-------------------------------------------------------------------------|--------------------|--------| | 307 | [Temporary Redirect](https://tools.ietf.org/html/rfc7231#section-6.4.7) | Temporary Redirect | | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -346,7 +352,7 @@ curl -X GET http://coder-server:8080/api/v2/users/oidc/callback \ ### Responses | Status | Meaning | Description | Schema | -| ------ | ----------------------------------------------------------------------- | ------------------ | ------ | +|--------|-------------------------------------------------------------------------|--------------------|--------| | 307 | [Temporary Redirect](https://tools.ietf.org/html/rfc7231#section-6.4.7) | Temporary Redirect | | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -367,7 +373,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user} \ ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | ------ | -------- | ------------------------ | +|--------|------|--------|----------|--------------------------| | `user` | path | string | true | User ID, username, or me | ### Example responses @@ -376,32 +382,34 @@ curl -X GET http://coder-server:8080/api/v2/users/{user} \ ```json { - "avatar_url": "http://example.com", - "created_at": "2019-08-24T14:15:22Z", - "email": "user@example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_seen_at": "2019-08-24T14:15:22Z", - "login_type": "", - "name": "string", - "organization_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "roles": [ - { - "display_name": "string", - "name": "string", - "organization_id": "string" - } - ], - "status": "active", - "theme_preference": "string", - "updated_at": "2019-08-24T14:15:22Z", - "username": "string" + "avatar_url": "http://example.com", + "created_at": "2019-08-24T14:15:22Z", + "email": "user@example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_seen_at": "2019-08-24T14:15:22Z", + "login_type": "", + "name": "string", + "organization_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "roles": [ + { + "display_name": "string", + "name": "string", + "organization_id": "string" + } + ], + "status": "active", + "theme_preference": "string", + "updated_at": "2019-08-24T14:15:22Z", + "username": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------- | +|--------|---------------------------------------------------------|-------------|------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.User](schemas.md#codersdkuser) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -421,13 +429,13 @@ curl -X DELETE http://coder-server:8080/api/v2/users/{user} \ ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | ------ | -------- | -------------------- | +|--------|------|--------|----------|----------------------| | `user` | path | string | true | User ID, name, or me | ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------ | +|--------|---------------------------------------------------------|-------------|--------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -450,14 +458,14 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/appearance \ ```json { - "theme_preference": "string" + "theme_preference": "string" } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | ------------------------------------------------------------------------------------------------------ | -------- | ----------------------- | +|--------|------|--------------------------------------------------------------------------------------------------------|----------|-------------------------| | `user` | path | string | true | User ID, name, or me | | `body` | body | [codersdk.UpdateUserAppearanceSettingsRequest](schemas.md#codersdkupdateuserappearancesettingsrequest) | true | New appearance settings | @@ -467,32 +475,34 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/appearance \ ```json { - "avatar_url": "http://example.com", - "created_at": "2019-08-24T14:15:22Z", - "email": "user@example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_seen_at": "2019-08-24T14:15:22Z", - "login_type": "", - "name": "string", - "organization_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "roles": [ - { - "display_name": "string", - "name": "string", - "organization_id": "string" - } - ], - "status": "active", - "theme_preference": "string", - "updated_at": "2019-08-24T14:15:22Z", - "username": "string" + "avatar_url": "http://example.com", + "created_at": "2019-08-24T14:15:22Z", + "email": "user@example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_seen_at": "2019-08-24T14:15:22Z", + "login_type": "", + "name": "string", + "organization_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "roles": [ + { + "display_name": "string", + "name": "string", + "organization_id": "string" + } + ], + "status": "active", + "theme_preference": "string", + "updated_at": "2019-08-24T14:15:22Z", + "username": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------- | +|--------|---------------------------------------------------------|-------------|------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.User](schemas.md#codersdkuser) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -513,7 +523,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/autofill-parameters?tem ### Parameters | Name | In | Type | Required | Description | -| ------------- | ----- | ------ | -------- | ------------------------ | +|---------------|-------|--------|----------|--------------------------| | `user` | path | string | true | User ID, username, or me | | `template_id` | query | string | true | Template ID | @@ -523,17 +533,17 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/autofill-parameters?tem ```json [ - { - "name": "string", - "value": "string" - } + { + "name": "string", + "value": "string" + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|---------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.UserParameter](schemas.md#codersdkuserparameter) |

Response Schema

@@ -541,7 +551,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/autofill-parameters?tem Status Code **200** | Name | Type | Required | Restrictions | Description | -| -------------- | ------ | -------- | ------------ | ----------- | +|----------------|--------|----------|--------------|-------------| | `[array item]` | array | false | | | | `» name` | string | false | | | | `» value` | string | false | | | @@ -564,7 +574,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/gitsshkey \ ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | ------ | -------- | -------------------- | +|--------|------|--------|----------|----------------------| | `user` | path | string | true | User ID, name, or me | ### Example responses @@ -573,17 +583,17 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/gitsshkey \ ```json { - "created_at": "2019-08-24T14:15:22Z", - "public_key": "string", - "updated_at": "2019-08-24T14:15:22Z", - "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5" + "created_at": "2019-08-24T14:15:22Z", + "public_key": "string", + "updated_at": "2019-08-24T14:15:22Z", + "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.GitSSHKey](schemas.md#codersdkgitsshkey) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -604,7 +614,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/gitsshkey \ ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | ------ | -------- | -------------------- | +|--------|------|--------|----------|----------------------| | `user` | path | string | true | User ID, name, or me | ### Example responses @@ -613,17 +623,17 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/gitsshkey \ ```json { - "created_at": "2019-08-24T14:15:22Z", - "public_key": "string", - "updated_at": "2019-08-24T14:15:22Z", - "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5" + "created_at": "2019-08-24T14:15:22Z", + "public_key": "string", + "updated_at": "2019-08-24T14:15:22Z", + "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.GitSSHKey](schemas.md#codersdkgitsshkey) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -644,7 +654,7 @@ curl -X POST http://coder-server:8080/api/v2/users/{user}/keys \ ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | ------ | -------- | -------------------- | +|--------|------|--------|----------|----------------------| | `user` | path | string | true | User ID, name, or me | ### Example responses @@ -653,14 +663,14 @@ curl -X POST http://coder-server:8080/api/v2/users/{user}/keys \ ```json { - "key": "string" + "key": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------------ | ----------- | ---------------------------------------------------------------------------- | +|--------|--------------------------------------------------------------|-------------|------------------------------------------------------------------------------| | 201 | [Created](https://tools.ietf.org/html/rfc7231#section-6.3.2) | Created | [codersdk.GenerateAPIKeyResponse](schemas.md#codersdkgenerateapikeyresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -681,7 +691,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/keys/tokens \ ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | ------ | -------- | -------------------- | +|--------|------|--------|----------|----------------------| | `user` | path | string | true | User ID, name, or me | ### Example responses @@ -690,25 +700,25 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/keys/tokens \ ```json [ - { - "created_at": "2019-08-24T14:15:22Z", - "expires_at": "2019-08-24T14:15:22Z", - "id": "string", - "last_used": "2019-08-24T14:15:22Z", - "lifetime_seconds": 0, - "login_type": "password", - "scope": "all", - "token_name": "string", - "updated_at": "2019-08-24T14:15:22Z", - "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5" - } + { + "created_at": "2019-08-24T14:15:22Z", + "expires_at": "2019-08-24T14:15:22Z", + "id": "string", + "last_used": "2019-08-24T14:15:22Z", + "lifetime_seconds": 0, + "login_type": "password", + "scope": "all", + "token_name": "string", + "updated_at": "2019-08-24T14:15:22Z", + "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5" + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ----------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.APIKey](schemas.md#codersdkapikey) |

Response Schema

@@ -716,7 +726,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/keys/tokens \ Status Code **200** | Name | Type | Required | Restrictions | Description | -| -------------------- | ------------------------------------------------------ | -------- | ------------ | ----------- | +|----------------------|--------------------------------------------------------|----------|--------------|-------------| | `[array item]` | array | false | | | | `» created_at` | string(date-time) | true | | | | `» expires_at` | string(date-time) | true | | | @@ -732,7 +742,7 @@ Status Code **200** #### Enumerated Values | Property | Value | -| ------------ | --------------------- | +|--------------|-----------------------| | `login_type` | `password` | | `login_type` | `github` | | `login_type` | `oidc` | @@ -760,16 +770,16 @@ curl -X POST http://coder-server:8080/api/v2/users/{user}/keys/tokens \ ```json { - "lifetime": 0, - "scope": "all", - "token_name": "string" + "lifetime": 0, + "scope": "all", + "token_name": "string" } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | -------------------------------------------------------------------- | -------- | -------------------- | +|--------|------|----------------------------------------------------------------------|----------|----------------------| | `user` | path | string | true | User ID, name, or me | | `body` | body | [codersdk.CreateTokenRequest](schemas.md#codersdkcreatetokenrequest) | true | Create token request | @@ -779,14 +789,14 @@ curl -X POST http://coder-server:8080/api/v2/users/{user}/keys/tokens \ ```json { - "key": "string" + "key": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------------ | ----------- | ---------------------------------------------------------------------------- | +|--------|--------------------------------------------------------------|-------------|------------------------------------------------------------------------------| | 201 | [Created](https://tools.ietf.org/html/rfc7231#section-6.3.2) | Created | [codersdk.GenerateAPIKeyResponse](schemas.md#codersdkgenerateapikeyresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -807,7 +817,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/keys/tokens/{keyname} \ ### Parameters | Name | In | Type | Required | Description | -| --------- | ---- | -------------- | -------- | -------------------- | +|-----------|------|----------------|----------|----------------------| | `user` | path | string | true | User ID, name, or me | | `keyname` | path | string(string) | true | Key Name | @@ -817,23 +827,23 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/keys/tokens/{keyname} \ ```json { - "created_at": "2019-08-24T14:15:22Z", - "expires_at": "2019-08-24T14:15:22Z", - "id": "string", - "last_used": "2019-08-24T14:15:22Z", - "lifetime_seconds": 0, - "login_type": "password", - "scope": "all", - "token_name": "string", - "updated_at": "2019-08-24T14:15:22Z", - "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5" + "created_at": "2019-08-24T14:15:22Z", + "expires_at": "2019-08-24T14:15:22Z", + "id": "string", + "last_used": "2019-08-24T14:15:22Z", + "lifetime_seconds": 0, + "login_type": "password", + "scope": "all", + "token_name": "string", + "updated_at": "2019-08-24T14:15:22Z", + "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.APIKey](schemas.md#codersdkapikey) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -854,7 +864,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/keys/{keyid} \ ### Parameters | Name | In | Type | Required | Description | -| ------- | ---- | ------------ | -------- | -------------------- | +|---------|------|--------------|----------|----------------------| | `user` | path | string | true | User ID, name, or me | | `keyid` | path | string(uuid) | true | Key ID | @@ -864,23 +874,23 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/keys/{keyid} \ ```json { - "created_at": "2019-08-24T14:15:22Z", - "expires_at": "2019-08-24T14:15:22Z", - "id": "string", - "last_used": "2019-08-24T14:15:22Z", - "lifetime_seconds": 0, - "login_type": "password", - "scope": "all", - "token_name": "string", - "updated_at": "2019-08-24T14:15:22Z", - "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5" + "created_at": "2019-08-24T14:15:22Z", + "expires_at": "2019-08-24T14:15:22Z", + "id": "string", + "last_used": "2019-08-24T14:15:22Z", + "lifetime_seconds": 0, + "login_type": "password", + "scope": "all", + "token_name": "string", + "updated_at": "2019-08-24T14:15:22Z", + "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.APIKey](schemas.md#codersdkapikey) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -900,14 +910,14 @@ curl -X DELETE http://coder-server:8080/api/v2/users/{user}/keys/{keyid} \ ### Parameters | Name | In | Type | Required | Description | -| ------- | ---- | ------------ | -------- | -------------------- | +|---------|------|--------------|----------|----------------------| | `user` | path | string | true | User ID, name, or me | | `keyid` | path | string(uuid) | true | Key ID | ### Responses | Status | Meaning | Description | Schema | -| ------ | --------------------------------------------------------------- | ----------- | ------ | +|--------|-----------------------------------------------------------------|-------------|--------| | 204 | [No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5) | No Content | | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -928,7 +938,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/login-type \ ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | ------ | -------- | -------------------- | +|--------|------|--------|----------|----------------------| | `user` | path | string | true | User ID, name, or me | ### Example responses @@ -937,14 +947,14 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/login-type \ ```json { - "login_type": "" + "login_type": "" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.UserLoginType](schemas.md#codersdkuserlogintype) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -965,7 +975,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/organizations \ ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | ------ | -------- | -------------------- | +|--------|------|--------|----------|----------------------| | `user` | path | string | true | User ID, name, or me | ### Example responses @@ -974,23 +984,23 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/organizations \ ```json [ - { - "created_at": "2019-08-24T14:15:22Z", - "description": "string", - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "is_default": true, - "name": "string", - "updated_at": "2019-08-24T14:15:22Z" - } + { + "created_at": "2019-08-24T14:15:22Z", + "description": "string", + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "is_default": true, + "name": "string", + "updated_at": "2019-08-24T14:15:22Z" + } ] ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ----------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|-------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.Organization](schemas.md#codersdkorganization) |

Response Schema

@@ -998,7 +1008,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/organizations \ Status Code **200** | Name | Type | Required | Restrictions | Description | -| ---------------- | ----------------- | -------- | ------------ | ----------- | +|------------------|-------------------|----------|--------------|-------------| | `[array item]` | array | false | | | | `» created_at` | string(date-time) | true | | | | `» description` | string | false | | | @@ -1027,7 +1037,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/organizations/{organiza ### Parameters | Name | In | Type | Required | Description | -| ------------------ | ---- | ------ | -------- | -------------------- | +|--------------------|------|--------|----------|----------------------| | `user` | path | string | true | User ID, name, or me | | `organizationname` | path | string | true | Organization name | @@ -1037,21 +1047,21 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/organizations/{organiza ```json { - "created_at": "2019-08-24T14:15:22Z", - "description": "string", - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "is_default": true, - "name": "string", - "updated_at": "2019-08-24T14:15:22Z" + "created_at": "2019-08-24T14:15:22Z", + "description": "string", + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "is_default": true, + "name": "string", + "updated_at": "2019-08-24T14:15:22Z" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Organization](schemas.md#codersdkorganization) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1073,22 +1083,22 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/password \ ```json { - "old_password": "string", - "password": "string" + "old_password": "string", + "password": "string" } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | ---------------------------------------------------------------------------------- | -------- | ----------------------- | +|--------|------|------------------------------------------------------------------------------------|----------|-------------------------| | `user` | path | string | true | User ID, name, or me | | `body` | body | [codersdk.UpdateUserPasswordRequest](schemas.md#codersdkupdateuserpasswordrequest) | true | Update password request | ### Responses | Status | Meaning | Description | Schema | -| ------ | --------------------------------------------------------------- | ----------- | ------ | +|--------|-----------------------------------------------------------------|-------------|--------| | 204 | [No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5) | No Content | | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1111,15 +1121,15 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/profile \ ```json { - "name": "string", - "username": "string" + "name": "string", + "username": "string" } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | -------------------------------------------------------------------------------- | -------- | -------------------- | +|--------|------|----------------------------------------------------------------------------------|----------|----------------------| | `user` | path | string | true | User ID, name, or me | | `body` | body | [codersdk.UpdateUserProfileRequest](schemas.md#codersdkupdateuserprofilerequest) | true | Updated profile | @@ -1129,32 +1139,34 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/profile \ ```json { - "avatar_url": "http://example.com", - "created_at": "2019-08-24T14:15:22Z", - "email": "user@example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_seen_at": "2019-08-24T14:15:22Z", - "login_type": "", - "name": "string", - "organization_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "roles": [ - { - "display_name": "string", - "name": "string", - "organization_id": "string" - } - ], - "status": "active", - "theme_preference": "string", - "updated_at": "2019-08-24T14:15:22Z", - "username": "string" + "avatar_url": "http://example.com", + "created_at": "2019-08-24T14:15:22Z", + "email": "user@example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_seen_at": "2019-08-24T14:15:22Z", + "login_type": "", + "name": "string", + "organization_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "roles": [ + { + "display_name": "string", + "name": "string", + "organization_id": "string" + } + ], + "status": "active", + "theme_preference": "string", + "updated_at": "2019-08-24T14:15:22Z", + "username": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------- | +|--------|---------------------------------------------------------|-------------|------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.User](schemas.md#codersdkuser) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1175,7 +1187,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/roles \ ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | ------ | -------- | -------------------- | +|--------|------|--------|----------|----------------------| | `user` | path | string | true | User ID, name, or me | ### Example responses @@ -1184,32 +1196,34 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/roles \ ```json { - "avatar_url": "http://example.com", - "created_at": "2019-08-24T14:15:22Z", - "email": "user@example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_seen_at": "2019-08-24T14:15:22Z", - "login_type": "", - "name": "string", - "organization_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "roles": [ - { - "display_name": "string", - "name": "string", - "organization_id": "string" - } - ], - "status": "active", - "theme_preference": "string", - "updated_at": "2019-08-24T14:15:22Z", - "username": "string" + "avatar_url": "http://example.com", + "created_at": "2019-08-24T14:15:22Z", + "email": "user@example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_seen_at": "2019-08-24T14:15:22Z", + "login_type": "", + "name": "string", + "organization_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "roles": [ + { + "display_name": "string", + "name": "string", + "organization_id": "string" + } + ], + "status": "active", + "theme_preference": "string", + "updated_at": "2019-08-24T14:15:22Z", + "username": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------- | +|--------|---------------------------------------------------------|-------------|------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.User](schemas.md#codersdkuser) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1232,14 +1246,16 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/roles \ ```json { - "roles": ["string"] + "roles": [ + "string" + ] } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | ------------------------------------------------------ | -------- | -------------------- | +|--------|------|--------------------------------------------------------|----------|----------------------| | `user` | path | string | true | User ID, name, or me | | `body` | body | [codersdk.UpdateRoles](schemas.md#codersdkupdateroles) | true | Update roles request | @@ -1249,32 +1265,34 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/roles \ ```json { - "avatar_url": "http://example.com", - "created_at": "2019-08-24T14:15:22Z", - "email": "user@example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_seen_at": "2019-08-24T14:15:22Z", - "login_type": "", - "name": "string", - "organization_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "roles": [ - { - "display_name": "string", - "name": "string", - "organization_id": "string" - } - ], - "status": "active", - "theme_preference": "string", - "updated_at": "2019-08-24T14:15:22Z", - "username": "string" + "avatar_url": "http://example.com", + "created_at": "2019-08-24T14:15:22Z", + "email": "user@example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_seen_at": "2019-08-24T14:15:22Z", + "login_type": "", + "name": "string", + "organization_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "roles": [ + { + "display_name": "string", + "name": "string", + "organization_id": "string" + } + ], + "status": "active", + "theme_preference": "string", + "updated_at": "2019-08-24T14:15:22Z", + "username": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------- | +|--------|---------------------------------------------------------|-------------|------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.User](schemas.md#codersdkuser) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1295,7 +1313,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/status/activate \ ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | ------ | -------- | -------------------- | +|--------|------|--------|----------|----------------------| | `user` | path | string | true | User ID, name, or me | ### Example responses @@ -1304,32 +1322,34 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/status/activate \ ```json { - "avatar_url": "http://example.com", - "created_at": "2019-08-24T14:15:22Z", - "email": "user@example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_seen_at": "2019-08-24T14:15:22Z", - "login_type": "", - "name": "string", - "organization_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "roles": [ - { - "display_name": "string", - "name": "string", - "organization_id": "string" - } - ], - "status": "active", - "theme_preference": "string", - "updated_at": "2019-08-24T14:15:22Z", - "username": "string" + "avatar_url": "http://example.com", + "created_at": "2019-08-24T14:15:22Z", + "email": "user@example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_seen_at": "2019-08-24T14:15:22Z", + "login_type": "", + "name": "string", + "organization_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "roles": [ + { + "display_name": "string", + "name": "string", + "organization_id": "string" + } + ], + "status": "active", + "theme_preference": "string", + "updated_at": "2019-08-24T14:15:22Z", + "username": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------- | +|--------|---------------------------------------------------------|-------------|------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.User](schemas.md#codersdkuser) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1350,7 +1370,7 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/status/suspend \ ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | ------ | -------- | -------------------- | +|--------|------|--------|----------|----------------------| | `user` | path | string | true | User ID, name, or me | ### Example responses @@ -1359,32 +1379,34 @@ curl -X PUT http://coder-server:8080/api/v2/users/{user}/status/suspend \ ```json { - "avatar_url": "http://example.com", - "created_at": "2019-08-24T14:15:22Z", - "email": "user@example.com", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_seen_at": "2019-08-24T14:15:22Z", - "login_type": "", - "name": "string", - "organization_ids": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "roles": [ - { - "display_name": "string", - "name": "string", - "organization_id": "string" - } - ], - "status": "active", - "theme_preference": "string", - "updated_at": "2019-08-24T14:15:22Z", - "username": "string" + "avatar_url": "http://example.com", + "created_at": "2019-08-24T14:15:22Z", + "email": "user@example.com", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_seen_at": "2019-08-24T14:15:22Z", + "login_type": "", + "name": "string", + "organization_ids": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "roles": [ + { + "display_name": "string", + "name": "string", + "organization_id": "string" + } + ], + "status": "active", + "theme_preference": "string", + "updated_at": "2019-08-24T14:15:22Z", + "username": "string" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------- | +|--------|---------------------------------------------------------|-------------|------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.User](schemas.md#codersdkuser) | To perform this operation, you must be authenticated. [Learn more](authentication.md). diff --git a/docs/reference/api/workspaceproxies.md b/docs/reference/api/workspaceproxies.md index 35e9e6d84ed0b..72527b7e305e4 100644 --- a/docs/reference/api/workspaceproxies.md +++ b/docs/reference/api/workspaceproxies.md @@ -19,24 +19,24 @@ curl -X GET http://coder-server:8080/api/v2/regions \ ```json { - "regions": [ - { - "display_name": "string", - "healthy": true, - "icon_url": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "name": "string", - "path_app_url": "string", - "wildcard_hostname": "string" - } - ] + "regions": [ + { + "display_name": "string", + "healthy": true, + "icon_url": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "name": "string", + "path_app_url": "string", + "wildcard_hostname": "string" + } + ] } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|------------------------------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.RegionsResponse-codersdk_Region](schemas.md#codersdkregionsresponse-codersdk_region) | To perform this operation, you must be authenticated. [Learn more](authentication.md). diff --git a/docs/reference/api/workspaces.md b/docs/reference/api/workspaces.md index b855615336c45..2413bb294a5f6 100644 --- a/docs/reference/api/workspaces.md +++ b/docs/reference/api/workspaces.md @@ -23,25 +23,25 @@ of the template will be used. ```json { - "automatic_updates": "always", - "autostart_schedule": "string", - "name": "string", - "rich_parameter_values": [ - { - "name": "string", - "value": "string" - } - ], - "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", - "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", - "ttl_ms": 0 + "automatic_updates": "always", + "autostart_schedule": "string", + "name": "string", + "rich_parameter_values": [ + { + "name": "string", + "value": "string" + } + ], + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", + "ttl_ms": 0 } ``` ### Parameters | Name | In | Type | Required | Description | -| -------------- | ---- | ---------------------------------------------------------------------------- | -------- | ------------------------ | +|----------------|------|------------------------------------------------------------------------------|----------|--------------------------| | `organization` | path | string(uuid) | true | Organization ID | | `user` | path | string | true | Username, UUID, or me | | `body` | body | [codersdk.CreateWorkspaceRequest](schemas.md#codersdkcreateworkspacerequest) | true | Create workspace request | @@ -52,199 +52,206 @@ of the template will be used. ```json { - "allow_renames": true, - "automatic_updates": "always", - "autostart_schedule": "string", - "created_at": "2019-08-24T14:15:22Z", - "deleting_at": "2019-08-24T14:15:22Z", - "dormant_at": "2019-08-24T14:15:22Z", - "favorite": true, - "health": { - "failing_agents": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "healthy": false - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_used_at": "2019-08-24T14:15:22Z", - "latest_build": { - "build_number": 0, - "created_at": "2019-08-24T14:15:22Z", - "daily_cost": 0, - "deadline": "2019-08-24T14:15:22Z", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "initiator_id": "06588898-9a84-4b35-ba8f-f9cbd64946f3", - "initiator_name": "string", - "job": { - "canceled_at": "2019-08-24T14:15:22Z", - "completed_at": "2019-08-24T14:15:22Z", - "created_at": "2019-08-24T14:15:22Z", - "error": "string", - "error_code": "REQUIRED_TEMPLATE_VARIABLES", - "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "queue_position": 0, - "queue_size": 0, - "started_at": "2019-08-24T14:15:22Z", - "status": "pending", - "tags": { - "property1": "string", - "property2": "string" - }, - "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" - }, - "matched_provisioners": { - "available": 0, - "count": 0, - "most_recently_seen": "2019-08-24T14:15:22Z" - }, - "max_deadline": "2019-08-24T14:15:22Z", - "reason": "initiator", - "resources": [ - { - "agents": [ - { - "api_version": "string", - "apps": [ - { - "command": "string", - "display_name": "string", - "external": true, - "health": "disabled", - "healthcheck": { - "interval": 0, - "threshold": 0, - "url": "string" - }, - "hidden": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "sharing_level": "owner", - "slug": "string", - "subdomain": true, - "subdomain_name": "string", - "url": "string" - } - ], - "architecture": "string", - "connection_timeout_seconds": 0, - "created_at": "2019-08-24T14:15:22Z", - "directory": "string", - "disconnected_at": "2019-08-24T14:15:22Z", - "display_apps": ["vscode"], - "environment_variables": { - "property1": "string", - "property2": "string" - }, - "expanded_directory": "string", - "first_connected_at": "2019-08-24T14:15:22Z", - "health": { - "healthy": false, - "reason": "agent has lost connection" - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "instance_id": "string", - "last_connected_at": "2019-08-24T14:15:22Z", - "latency": { - "property1": { - "latency_ms": 0, - "preferred": true - }, - "property2": { - "latency_ms": 0, - "preferred": true - } - }, - "lifecycle_state": "created", - "log_sources": [ - { - "created_at": "2019-08-24T14:15:22Z", - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" - } - ], - "logs_length": 0, - "logs_overflowed": true, - "name": "string", - "operating_system": "string", - "ready_at": "2019-08-24T14:15:22Z", - "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", - "scripts": [ - { - "cron": "string", - "display_name": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "log_path": "string", - "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", - "run_on_start": true, - "run_on_stop": true, - "script": "string", - "start_blocks_login": true, - "timeout": 0 - } - ], - "started_at": "2019-08-24T14:15:22Z", - "startup_script_behavior": "blocking", - "status": "connecting", - "subsystems": ["envbox"], - "troubleshooting_url": "string", - "updated_at": "2019-08-24T14:15:22Z", - "version": "string" - } - ], - "created_at": "2019-08-24T14:15:22Z", - "daily_cost": 0, - "hide": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", - "metadata": [ - { - "key": "string", - "sensitive": true, - "value": "string" - } - ], - "name": "string", - "type": "string", - "workspace_transition": "start" - } - ], - "status": "pending", - "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", - "template_version_name": "string", - "transition": "start", - "updated_at": "2019-08-24T14:15:22Z", - "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", - "workspace_name": "string", - "workspace_owner_avatar_url": "string", - "workspace_owner_id": "e7078695-5279-4c86-8774-3ac2367a2fc7", - "workspace_owner_name": "string" - }, - "name": "string", - "next_start_at": "2019-08-24T14:15:22Z", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "organization_name": "string", - "outdated": true, - "owner_avatar_url": "string", - "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05", - "owner_name": "string", - "template_active_version_id": "b0da9c29-67d8-4c87-888c-bafe356f7f3c", - "template_allow_user_cancel_workspace_jobs": true, - "template_display_name": "string", - "template_icon": "string", - "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", - "template_name": "string", - "template_require_active_version": true, - "ttl_ms": 0, - "updated_at": "2019-08-24T14:15:22Z" + "allow_renames": true, + "automatic_updates": "always", + "autostart_schedule": "string", + "created_at": "2019-08-24T14:15:22Z", + "deleting_at": "2019-08-24T14:15:22Z", + "dormant_at": "2019-08-24T14:15:22Z", + "favorite": true, + "health": { + "failing_agents": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "healthy": false + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_used_at": "2019-08-24T14:15:22Z", + "latest_build": { + "build_number": 0, + "created_at": "2019-08-24T14:15:22Z", + "daily_cost": 0, + "deadline": "2019-08-24T14:15:22Z", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "initiator_id": "06588898-9a84-4b35-ba8f-f9cbd64946f3", + "initiator_name": "string", + "job": { + "canceled_at": "2019-08-24T14:15:22Z", + "completed_at": "2019-08-24T14:15:22Z", + "created_at": "2019-08-24T14:15:22Z", + "error": "string", + "error_code": "REQUIRED_TEMPLATE_VARIABLES", + "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "queue_position": 0, + "queue_size": 0, + "started_at": "2019-08-24T14:15:22Z", + "status": "pending", + "tags": { + "property1": "string", + "property2": "string" + }, + "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" + }, + "matched_provisioners": { + "available": 0, + "count": 0, + "most_recently_seen": "2019-08-24T14:15:22Z" + }, + "max_deadline": "2019-08-24T14:15:22Z", + "reason": "initiator", + "resources": [ + { + "agents": [ + { + "api_version": "string", + "apps": [ + { + "command": "string", + "display_name": "string", + "external": true, + "health": "disabled", + "healthcheck": { + "interval": 0, + "threshold": 0, + "url": "string" + }, + "hidden": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "open_in": "slim-window", + "sharing_level": "owner", + "slug": "string", + "subdomain": true, + "subdomain_name": "string", + "url": "string" + } + ], + "architecture": "string", + "connection_timeout_seconds": 0, + "created_at": "2019-08-24T14:15:22Z", + "directory": "string", + "disconnected_at": "2019-08-24T14:15:22Z", + "display_apps": [ + "vscode" + ], + "environment_variables": { + "property1": "string", + "property2": "string" + }, + "expanded_directory": "string", + "first_connected_at": "2019-08-24T14:15:22Z", + "health": { + "healthy": false, + "reason": "agent has lost connection" + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "instance_id": "string", + "last_connected_at": "2019-08-24T14:15:22Z", + "latency": { + "property1": { + "latency_ms": 0, + "preferred": true + }, + "property2": { + "latency_ms": 0, + "preferred": true + } + }, + "lifecycle_state": "created", + "log_sources": [ + { + "created_at": "2019-08-24T14:15:22Z", + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" + } + ], + "logs_length": 0, + "logs_overflowed": true, + "name": "string", + "operating_system": "string", + "ready_at": "2019-08-24T14:15:22Z", + "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", + "scripts": [ + { + "cron": "string", + "display_name": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "log_path": "string", + "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", + "run_on_start": true, + "run_on_stop": true, + "script": "string", + "start_blocks_login": true, + "timeout": 0 + } + ], + "started_at": "2019-08-24T14:15:22Z", + "startup_script_behavior": "blocking", + "status": "connecting", + "subsystems": [ + "envbox" + ], + "troubleshooting_url": "string", + "updated_at": "2019-08-24T14:15:22Z", + "version": "string" + } + ], + "created_at": "2019-08-24T14:15:22Z", + "daily_cost": 0, + "hide": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", + "metadata": [ + { + "key": "string", + "sensitive": true, + "value": "string" + } + ], + "name": "string", + "type": "string", + "workspace_transition": "start" + } + ], + "status": "pending", + "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", + "template_version_name": "string", + "transition": "start", + "updated_at": "2019-08-24T14:15:22Z", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string", + "workspace_owner_avatar_url": "string", + "workspace_owner_id": "e7078695-5279-4c86-8774-3ac2367a2fc7", + "workspace_owner_name": "string" + }, + "name": "string", + "next_start_at": "2019-08-24T14:15:22Z", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "organization_name": "string", + "outdated": true, + "owner_avatar_url": "string", + "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05", + "owner_name": "string", + "template_active_version_id": "b0da9c29-67d8-4c87-888c-bafe356f7f3c", + "template_allow_user_cancel_workspace_jobs": true, + "template_display_name": "string", + "template_icon": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_require_active_version": true, + "ttl_ms": 0, + "updated_at": "2019-08-24T14:15:22Z" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Workspace](schemas.md#codersdkworkspace) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -265,7 +272,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/workspace/{workspacenam ### Parameters | Name | In | Type | Required | Description | -| ----------------- | ----- | ------- | -------- | ----------------------------------------------------------- | +|-------------------|-------|---------|----------|-------------------------------------------------------------| | `user` | path | string | true | User ID, name, or me | | `workspacename` | path | string | true | Workspace name | | `include_deleted` | query | boolean | false | Return data instead of HTTP 404 if the workspace is deleted | @@ -276,199 +283,206 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/workspace/{workspacenam ```json { - "allow_renames": true, - "automatic_updates": "always", - "autostart_schedule": "string", - "created_at": "2019-08-24T14:15:22Z", - "deleting_at": "2019-08-24T14:15:22Z", - "dormant_at": "2019-08-24T14:15:22Z", - "favorite": true, - "health": { - "failing_agents": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "healthy": false - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_used_at": "2019-08-24T14:15:22Z", - "latest_build": { - "build_number": 0, - "created_at": "2019-08-24T14:15:22Z", - "daily_cost": 0, - "deadline": "2019-08-24T14:15:22Z", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "initiator_id": "06588898-9a84-4b35-ba8f-f9cbd64946f3", - "initiator_name": "string", - "job": { - "canceled_at": "2019-08-24T14:15:22Z", - "completed_at": "2019-08-24T14:15:22Z", - "created_at": "2019-08-24T14:15:22Z", - "error": "string", - "error_code": "REQUIRED_TEMPLATE_VARIABLES", - "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "queue_position": 0, - "queue_size": 0, - "started_at": "2019-08-24T14:15:22Z", - "status": "pending", - "tags": { - "property1": "string", - "property2": "string" - }, - "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" - }, - "matched_provisioners": { - "available": 0, - "count": 0, - "most_recently_seen": "2019-08-24T14:15:22Z" - }, - "max_deadline": "2019-08-24T14:15:22Z", - "reason": "initiator", - "resources": [ - { - "agents": [ - { - "api_version": "string", - "apps": [ - { - "command": "string", - "display_name": "string", - "external": true, - "health": "disabled", - "healthcheck": { - "interval": 0, - "threshold": 0, - "url": "string" - }, - "hidden": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "sharing_level": "owner", - "slug": "string", - "subdomain": true, - "subdomain_name": "string", - "url": "string" - } - ], - "architecture": "string", - "connection_timeout_seconds": 0, - "created_at": "2019-08-24T14:15:22Z", - "directory": "string", - "disconnected_at": "2019-08-24T14:15:22Z", - "display_apps": ["vscode"], - "environment_variables": { - "property1": "string", - "property2": "string" - }, - "expanded_directory": "string", - "first_connected_at": "2019-08-24T14:15:22Z", - "health": { - "healthy": false, - "reason": "agent has lost connection" - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "instance_id": "string", - "last_connected_at": "2019-08-24T14:15:22Z", - "latency": { - "property1": { - "latency_ms": 0, - "preferred": true - }, - "property2": { - "latency_ms": 0, - "preferred": true - } - }, - "lifecycle_state": "created", - "log_sources": [ - { - "created_at": "2019-08-24T14:15:22Z", - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" - } - ], - "logs_length": 0, - "logs_overflowed": true, - "name": "string", - "operating_system": "string", - "ready_at": "2019-08-24T14:15:22Z", - "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", - "scripts": [ - { - "cron": "string", - "display_name": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "log_path": "string", - "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", - "run_on_start": true, - "run_on_stop": true, - "script": "string", - "start_blocks_login": true, - "timeout": 0 - } - ], - "started_at": "2019-08-24T14:15:22Z", - "startup_script_behavior": "blocking", - "status": "connecting", - "subsystems": ["envbox"], - "troubleshooting_url": "string", - "updated_at": "2019-08-24T14:15:22Z", - "version": "string" - } - ], - "created_at": "2019-08-24T14:15:22Z", - "daily_cost": 0, - "hide": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", - "metadata": [ - { - "key": "string", - "sensitive": true, - "value": "string" - } - ], - "name": "string", - "type": "string", - "workspace_transition": "start" - } - ], - "status": "pending", - "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", - "template_version_name": "string", - "transition": "start", - "updated_at": "2019-08-24T14:15:22Z", - "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", - "workspace_name": "string", - "workspace_owner_avatar_url": "string", - "workspace_owner_id": "e7078695-5279-4c86-8774-3ac2367a2fc7", - "workspace_owner_name": "string" - }, - "name": "string", - "next_start_at": "2019-08-24T14:15:22Z", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "organization_name": "string", - "outdated": true, - "owner_avatar_url": "string", - "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05", - "owner_name": "string", - "template_active_version_id": "b0da9c29-67d8-4c87-888c-bafe356f7f3c", - "template_allow_user_cancel_workspace_jobs": true, - "template_display_name": "string", - "template_icon": "string", - "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", - "template_name": "string", - "template_require_active_version": true, - "ttl_ms": 0, - "updated_at": "2019-08-24T14:15:22Z" + "allow_renames": true, + "automatic_updates": "always", + "autostart_schedule": "string", + "created_at": "2019-08-24T14:15:22Z", + "deleting_at": "2019-08-24T14:15:22Z", + "dormant_at": "2019-08-24T14:15:22Z", + "favorite": true, + "health": { + "failing_agents": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "healthy": false + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_used_at": "2019-08-24T14:15:22Z", + "latest_build": { + "build_number": 0, + "created_at": "2019-08-24T14:15:22Z", + "daily_cost": 0, + "deadline": "2019-08-24T14:15:22Z", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "initiator_id": "06588898-9a84-4b35-ba8f-f9cbd64946f3", + "initiator_name": "string", + "job": { + "canceled_at": "2019-08-24T14:15:22Z", + "completed_at": "2019-08-24T14:15:22Z", + "created_at": "2019-08-24T14:15:22Z", + "error": "string", + "error_code": "REQUIRED_TEMPLATE_VARIABLES", + "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "queue_position": 0, + "queue_size": 0, + "started_at": "2019-08-24T14:15:22Z", + "status": "pending", + "tags": { + "property1": "string", + "property2": "string" + }, + "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" + }, + "matched_provisioners": { + "available": 0, + "count": 0, + "most_recently_seen": "2019-08-24T14:15:22Z" + }, + "max_deadline": "2019-08-24T14:15:22Z", + "reason": "initiator", + "resources": [ + { + "agents": [ + { + "api_version": "string", + "apps": [ + { + "command": "string", + "display_name": "string", + "external": true, + "health": "disabled", + "healthcheck": { + "interval": 0, + "threshold": 0, + "url": "string" + }, + "hidden": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "open_in": "slim-window", + "sharing_level": "owner", + "slug": "string", + "subdomain": true, + "subdomain_name": "string", + "url": "string" + } + ], + "architecture": "string", + "connection_timeout_seconds": 0, + "created_at": "2019-08-24T14:15:22Z", + "directory": "string", + "disconnected_at": "2019-08-24T14:15:22Z", + "display_apps": [ + "vscode" + ], + "environment_variables": { + "property1": "string", + "property2": "string" + }, + "expanded_directory": "string", + "first_connected_at": "2019-08-24T14:15:22Z", + "health": { + "healthy": false, + "reason": "agent has lost connection" + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "instance_id": "string", + "last_connected_at": "2019-08-24T14:15:22Z", + "latency": { + "property1": { + "latency_ms": 0, + "preferred": true + }, + "property2": { + "latency_ms": 0, + "preferred": true + } + }, + "lifecycle_state": "created", + "log_sources": [ + { + "created_at": "2019-08-24T14:15:22Z", + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" + } + ], + "logs_length": 0, + "logs_overflowed": true, + "name": "string", + "operating_system": "string", + "ready_at": "2019-08-24T14:15:22Z", + "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", + "scripts": [ + { + "cron": "string", + "display_name": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "log_path": "string", + "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", + "run_on_start": true, + "run_on_stop": true, + "script": "string", + "start_blocks_login": true, + "timeout": 0 + } + ], + "started_at": "2019-08-24T14:15:22Z", + "startup_script_behavior": "blocking", + "status": "connecting", + "subsystems": [ + "envbox" + ], + "troubleshooting_url": "string", + "updated_at": "2019-08-24T14:15:22Z", + "version": "string" + } + ], + "created_at": "2019-08-24T14:15:22Z", + "daily_cost": 0, + "hide": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", + "metadata": [ + { + "key": "string", + "sensitive": true, + "value": "string" + } + ], + "name": "string", + "type": "string", + "workspace_transition": "start" + } + ], + "status": "pending", + "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", + "template_version_name": "string", + "transition": "start", + "updated_at": "2019-08-24T14:15:22Z", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string", + "workspace_owner_avatar_url": "string", + "workspace_owner_id": "e7078695-5279-4c86-8774-3ac2367a2fc7", + "workspace_owner_name": "string" + }, + "name": "string", + "next_start_at": "2019-08-24T14:15:22Z", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "organization_name": "string", + "outdated": true, + "owner_avatar_url": "string", + "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05", + "owner_name": "string", + "template_active_version_id": "b0da9c29-67d8-4c87-888c-bafe356f7f3c", + "template_allow_user_cancel_workspace_jobs": true, + "template_display_name": "string", + "template_icon": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_require_active_version": true, + "ttl_ms": 0, + "updated_at": "2019-08-24T14:15:22Z" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Workspace](schemas.md#codersdkworkspace) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -496,25 +510,25 @@ of the template will be used. ```json { - "automatic_updates": "always", - "autostart_schedule": "string", - "name": "string", - "rich_parameter_values": [ - { - "name": "string", - "value": "string" - } - ], - "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", - "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", - "ttl_ms": 0 + "automatic_updates": "always", + "autostart_schedule": "string", + "name": "string", + "rich_parameter_values": [ + { + "name": "string", + "value": "string" + } + ], + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", + "ttl_ms": 0 } ``` ### Parameters | Name | In | Type | Required | Description | -| ------ | ---- | ---------------------------------------------------------------------------- | -------- | ------------------------ | +|--------|------|------------------------------------------------------------------------------|----------|--------------------------| | `user` | path | string | true | Username, UUID, or me | | `body` | body | [codersdk.CreateWorkspaceRequest](schemas.md#codersdkcreateworkspacerequest) | true | Create workspace request | @@ -524,199 +538,206 @@ of the template will be used. ```json { - "allow_renames": true, - "automatic_updates": "always", - "autostart_schedule": "string", - "created_at": "2019-08-24T14:15:22Z", - "deleting_at": "2019-08-24T14:15:22Z", - "dormant_at": "2019-08-24T14:15:22Z", - "favorite": true, - "health": { - "failing_agents": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "healthy": false - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_used_at": "2019-08-24T14:15:22Z", - "latest_build": { - "build_number": 0, - "created_at": "2019-08-24T14:15:22Z", - "daily_cost": 0, - "deadline": "2019-08-24T14:15:22Z", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "initiator_id": "06588898-9a84-4b35-ba8f-f9cbd64946f3", - "initiator_name": "string", - "job": { - "canceled_at": "2019-08-24T14:15:22Z", - "completed_at": "2019-08-24T14:15:22Z", - "created_at": "2019-08-24T14:15:22Z", - "error": "string", - "error_code": "REQUIRED_TEMPLATE_VARIABLES", - "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "queue_position": 0, - "queue_size": 0, - "started_at": "2019-08-24T14:15:22Z", - "status": "pending", - "tags": { - "property1": "string", - "property2": "string" - }, - "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" - }, - "matched_provisioners": { - "available": 0, - "count": 0, - "most_recently_seen": "2019-08-24T14:15:22Z" - }, - "max_deadline": "2019-08-24T14:15:22Z", - "reason": "initiator", - "resources": [ - { - "agents": [ - { - "api_version": "string", - "apps": [ - { - "command": "string", - "display_name": "string", - "external": true, - "health": "disabled", - "healthcheck": { - "interval": 0, - "threshold": 0, - "url": "string" - }, - "hidden": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "sharing_level": "owner", - "slug": "string", - "subdomain": true, - "subdomain_name": "string", - "url": "string" - } - ], - "architecture": "string", - "connection_timeout_seconds": 0, - "created_at": "2019-08-24T14:15:22Z", - "directory": "string", - "disconnected_at": "2019-08-24T14:15:22Z", - "display_apps": ["vscode"], - "environment_variables": { - "property1": "string", - "property2": "string" - }, - "expanded_directory": "string", - "first_connected_at": "2019-08-24T14:15:22Z", - "health": { - "healthy": false, - "reason": "agent has lost connection" - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "instance_id": "string", - "last_connected_at": "2019-08-24T14:15:22Z", - "latency": { - "property1": { - "latency_ms": 0, - "preferred": true - }, - "property2": { - "latency_ms": 0, - "preferred": true - } - }, - "lifecycle_state": "created", - "log_sources": [ - { - "created_at": "2019-08-24T14:15:22Z", - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" - } - ], - "logs_length": 0, - "logs_overflowed": true, - "name": "string", - "operating_system": "string", - "ready_at": "2019-08-24T14:15:22Z", - "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", - "scripts": [ - { - "cron": "string", - "display_name": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "log_path": "string", - "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", - "run_on_start": true, - "run_on_stop": true, - "script": "string", - "start_blocks_login": true, - "timeout": 0 - } - ], - "started_at": "2019-08-24T14:15:22Z", - "startup_script_behavior": "blocking", - "status": "connecting", - "subsystems": ["envbox"], - "troubleshooting_url": "string", - "updated_at": "2019-08-24T14:15:22Z", - "version": "string" - } - ], - "created_at": "2019-08-24T14:15:22Z", - "daily_cost": 0, - "hide": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", - "metadata": [ - { - "key": "string", - "sensitive": true, - "value": "string" - } - ], - "name": "string", - "type": "string", - "workspace_transition": "start" - } - ], - "status": "pending", - "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", - "template_version_name": "string", - "transition": "start", - "updated_at": "2019-08-24T14:15:22Z", - "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", - "workspace_name": "string", - "workspace_owner_avatar_url": "string", - "workspace_owner_id": "e7078695-5279-4c86-8774-3ac2367a2fc7", - "workspace_owner_name": "string" - }, - "name": "string", - "next_start_at": "2019-08-24T14:15:22Z", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "organization_name": "string", - "outdated": true, - "owner_avatar_url": "string", - "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05", - "owner_name": "string", - "template_active_version_id": "b0da9c29-67d8-4c87-888c-bafe356f7f3c", - "template_allow_user_cancel_workspace_jobs": true, - "template_display_name": "string", - "template_icon": "string", - "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", - "template_name": "string", - "template_require_active_version": true, - "ttl_ms": 0, - "updated_at": "2019-08-24T14:15:22Z" + "allow_renames": true, + "automatic_updates": "always", + "autostart_schedule": "string", + "created_at": "2019-08-24T14:15:22Z", + "deleting_at": "2019-08-24T14:15:22Z", + "dormant_at": "2019-08-24T14:15:22Z", + "favorite": true, + "health": { + "failing_agents": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "healthy": false + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_used_at": "2019-08-24T14:15:22Z", + "latest_build": { + "build_number": 0, + "created_at": "2019-08-24T14:15:22Z", + "daily_cost": 0, + "deadline": "2019-08-24T14:15:22Z", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "initiator_id": "06588898-9a84-4b35-ba8f-f9cbd64946f3", + "initiator_name": "string", + "job": { + "canceled_at": "2019-08-24T14:15:22Z", + "completed_at": "2019-08-24T14:15:22Z", + "created_at": "2019-08-24T14:15:22Z", + "error": "string", + "error_code": "REQUIRED_TEMPLATE_VARIABLES", + "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "queue_position": 0, + "queue_size": 0, + "started_at": "2019-08-24T14:15:22Z", + "status": "pending", + "tags": { + "property1": "string", + "property2": "string" + }, + "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" + }, + "matched_provisioners": { + "available": 0, + "count": 0, + "most_recently_seen": "2019-08-24T14:15:22Z" + }, + "max_deadline": "2019-08-24T14:15:22Z", + "reason": "initiator", + "resources": [ + { + "agents": [ + { + "api_version": "string", + "apps": [ + { + "command": "string", + "display_name": "string", + "external": true, + "health": "disabled", + "healthcheck": { + "interval": 0, + "threshold": 0, + "url": "string" + }, + "hidden": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "open_in": "slim-window", + "sharing_level": "owner", + "slug": "string", + "subdomain": true, + "subdomain_name": "string", + "url": "string" + } + ], + "architecture": "string", + "connection_timeout_seconds": 0, + "created_at": "2019-08-24T14:15:22Z", + "directory": "string", + "disconnected_at": "2019-08-24T14:15:22Z", + "display_apps": [ + "vscode" + ], + "environment_variables": { + "property1": "string", + "property2": "string" + }, + "expanded_directory": "string", + "first_connected_at": "2019-08-24T14:15:22Z", + "health": { + "healthy": false, + "reason": "agent has lost connection" + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "instance_id": "string", + "last_connected_at": "2019-08-24T14:15:22Z", + "latency": { + "property1": { + "latency_ms": 0, + "preferred": true + }, + "property2": { + "latency_ms": 0, + "preferred": true + } + }, + "lifecycle_state": "created", + "log_sources": [ + { + "created_at": "2019-08-24T14:15:22Z", + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" + } + ], + "logs_length": 0, + "logs_overflowed": true, + "name": "string", + "operating_system": "string", + "ready_at": "2019-08-24T14:15:22Z", + "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", + "scripts": [ + { + "cron": "string", + "display_name": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "log_path": "string", + "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", + "run_on_start": true, + "run_on_stop": true, + "script": "string", + "start_blocks_login": true, + "timeout": 0 + } + ], + "started_at": "2019-08-24T14:15:22Z", + "startup_script_behavior": "blocking", + "status": "connecting", + "subsystems": [ + "envbox" + ], + "troubleshooting_url": "string", + "updated_at": "2019-08-24T14:15:22Z", + "version": "string" + } + ], + "created_at": "2019-08-24T14:15:22Z", + "daily_cost": 0, + "hide": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", + "metadata": [ + { + "key": "string", + "sensitive": true, + "value": "string" + } + ], + "name": "string", + "type": "string", + "workspace_transition": "start" + } + ], + "status": "pending", + "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", + "template_version_name": "string", + "transition": "start", + "updated_at": "2019-08-24T14:15:22Z", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string", + "workspace_owner_avatar_url": "string", + "workspace_owner_id": "e7078695-5279-4c86-8774-3ac2367a2fc7", + "workspace_owner_name": "string" + }, + "name": "string", + "next_start_at": "2019-08-24T14:15:22Z", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "organization_name": "string", + "outdated": true, + "owner_avatar_url": "string", + "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05", + "owner_name": "string", + "template_active_version_id": "b0da9c29-67d8-4c87-888c-bafe356f7f3c", + "template_allow_user_cancel_workspace_jobs": true, + "template_display_name": "string", + "template_icon": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_require_active_version": true, + "ttl_ms": 0, + "updated_at": "2019-08-24T14:15:22Z" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Workspace](schemas.md#codersdkworkspace) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -737,7 +758,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaces \ ### Parameters | Name | In | Type | Required | Description | -| -------- | ----- | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +|----------|-------|---------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------| | `q` | query | string | false | Search query in the format `key:value`. Available keys are: owner, template, name, status, has-agent, dormant, last_used_after, last_used_before. | | `limit` | query | integer | false | Page limit | | `offset` | query | integer | false | Page offset | @@ -748,200 +769,207 @@ curl -X GET http://coder-server:8080/api/v2/workspaces \ ```json { - "count": 0, - "workspaces": [ - { - "allow_renames": true, - "automatic_updates": "always", - "autostart_schedule": "string", - "created_at": "2019-08-24T14:15:22Z", - "deleting_at": "2019-08-24T14:15:22Z", - "dormant_at": "2019-08-24T14:15:22Z", - "favorite": true, - "health": { - "failing_agents": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "healthy": false - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_used_at": "2019-08-24T14:15:22Z", - "latest_build": { - "build_number": 0, - "created_at": "2019-08-24T14:15:22Z", - "daily_cost": 0, - "deadline": "2019-08-24T14:15:22Z", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "initiator_id": "06588898-9a84-4b35-ba8f-f9cbd64946f3", - "initiator_name": "string", - "job": { - "canceled_at": "2019-08-24T14:15:22Z", - "completed_at": "2019-08-24T14:15:22Z", - "created_at": "2019-08-24T14:15:22Z", - "error": "string", - "error_code": "REQUIRED_TEMPLATE_VARIABLES", - "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "queue_position": 0, - "queue_size": 0, - "started_at": "2019-08-24T14:15:22Z", - "status": "pending", - "tags": { - "property1": "string", - "property2": "string" - }, - "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" - }, - "matched_provisioners": { - "available": 0, - "count": 0, - "most_recently_seen": "2019-08-24T14:15:22Z" - }, - "max_deadline": "2019-08-24T14:15:22Z", - "reason": "initiator", - "resources": [ - { - "agents": [ - { - "api_version": "string", - "apps": [ - { - "command": "string", - "display_name": "string", - "external": true, - "health": "disabled", - "healthcheck": {}, - "hidden": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "sharing_level": "owner", - "slug": "string", - "subdomain": true, - "subdomain_name": "string", - "url": "string" - } - ], - "architecture": "string", - "connection_timeout_seconds": 0, - "created_at": "2019-08-24T14:15:22Z", - "directory": "string", - "disconnected_at": "2019-08-24T14:15:22Z", - "display_apps": ["vscode"], - "environment_variables": { - "property1": "string", - "property2": "string" - }, - "expanded_directory": "string", - "first_connected_at": "2019-08-24T14:15:22Z", - "health": { - "healthy": false, - "reason": "agent has lost connection" - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "instance_id": "string", - "last_connected_at": "2019-08-24T14:15:22Z", - "latency": { - "property1": { - "latency_ms": 0, - "preferred": true - }, - "property2": { - "latency_ms": 0, - "preferred": true - } - }, - "lifecycle_state": "created", - "log_sources": [ - { - "created_at": "2019-08-24T14:15:22Z", - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" - } - ], - "logs_length": 0, - "logs_overflowed": true, - "name": "string", - "operating_system": "string", - "ready_at": "2019-08-24T14:15:22Z", - "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", - "scripts": [ - { - "cron": "string", - "display_name": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "log_path": "string", - "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", - "run_on_start": true, - "run_on_stop": true, - "script": "string", - "start_blocks_login": true, - "timeout": 0 - } - ], - "started_at": "2019-08-24T14:15:22Z", - "startup_script_behavior": "blocking", - "status": "connecting", - "subsystems": ["envbox"], - "troubleshooting_url": "string", - "updated_at": "2019-08-24T14:15:22Z", - "version": "string" - } - ], - "created_at": "2019-08-24T14:15:22Z", - "daily_cost": 0, - "hide": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", - "metadata": [ - { - "key": "string", - "sensitive": true, - "value": "string" - } - ], - "name": "string", - "type": "string", - "workspace_transition": "start" - } - ], - "status": "pending", - "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", - "template_version_name": "string", - "transition": "start", - "updated_at": "2019-08-24T14:15:22Z", - "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", - "workspace_name": "string", - "workspace_owner_avatar_url": "string", - "workspace_owner_id": "e7078695-5279-4c86-8774-3ac2367a2fc7", - "workspace_owner_name": "string" - }, - "name": "string", - "next_start_at": "2019-08-24T14:15:22Z", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "organization_name": "string", - "outdated": true, - "owner_avatar_url": "string", - "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05", - "owner_name": "string", - "template_active_version_id": "b0da9c29-67d8-4c87-888c-bafe356f7f3c", - "template_allow_user_cancel_workspace_jobs": true, - "template_display_name": "string", - "template_icon": "string", - "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", - "template_name": "string", - "template_require_active_version": true, - "ttl_ms": 0, - "updated_at": "2019-08-24T14:15:22Z" - } - ] + "count": 0, + "workspaces": [ + { + "allow_renames": true, + "automatic_updates": "always", + "autostart_schedule": "string", + "created_at": "2019-08-24T14:15:22Z", + "deleting_at": "2019-08-24T14:15:22Z", + "dormant_at": "2019-08-24T14:15:22Z", + "favorite": true, + "health": { + "failing_agents": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "healthy": false + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_used_at": "2019-08-24T14:15:22Z", + "latest_build": { + "build_number": 0, + "created_at": "2019-08-24T14:15:22Z", + "daily_cost": 0, + "deadline": "2019-08-24T14:15:22Z", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "initiator_id": "06588898-9a84-4b35-ba8f-f9cbd64946f3", + "initiator_name": "string", + "job": { + "canceled_at": "2019-08-24T14:15:22Z", + "completed_at": "2019-08-24T14:15:22Z", + "created_at": "2019-08-24T14:15:22Z", + "error": "string", + "error_code": "REQUIRED_TEMPLATE_VARIABLES", + "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "queue_position": 0, + "queue_size": 0, + "started_at": "2019-08-24T14:15:22Z", + "status": "pending", + "tags": { + "property1": "string", + "property2": "string" + }, + "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" + }, + "matched_provisioners": { + "available": 0, + "count": 0, + "most_recently_seen": "2019-08-24T14:15:22Z" + }, + "max_deadline": "2019-08-24T14:15:22Z", + "reason": "initiator", + "resources": [ + { + "agents": [ + { + "api_version": "string", + "apps": [ + { + "command": "string", + "display_name": "string", + "external": true, + "health": "disabled", + "healthcheck": {}, + "hidden": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "open_in": "slim-window", + "sharing_level": "owner", + "slug": "string", + "subdomain": true, + "subdomain_name": "string", + "url": "string" + } + ], + "architecture": "string", + "connection_timeout_seconds": 0, + "created_at": "2019-08-24T14:15:22Z", + "directory": "string", + "disconnected_at": "2019-08-24T14:15:22Z", + "display_apps": [ + "vscode" + ], + "environment_variables": { + "property1": "string", + "property2": "string" + }, + "expanded_directory": "string", + "first_connected_at": "2019-08-24T14:15:22Z", + "health": { + "healthy": false, + "reason": "agent has lost connection" + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "instance_id": "string", + "last_connected_at": "2019-08-24T14:15:22Z", + "latency": { + "property1": { + "latency_ms": 0, + "preferred": true + }, + "property2": { + "latency_ms": 0, + "preferred": true + } + }, + "lifecycle_state": "created", + "log_sources": [ + { + "created_at": "2019-08-24T14:15:22Z", + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" + } + ], + "logs_length": 0, + "logs_overflowed": true, + "name": "string", + "operating_system": "string", + "ready_at": "2019-08-24T14:15:22Z", + "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", + "scripts": [ + { + "cron": "string", + "display_name": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "log_path": "string", + "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", + "run_on_start": true, + "run_on_stop": true, + "script": "string", + "start_blocks_login": true, + "timeout": 0 + } + ], + "started_at": "2019-08-24T14:15:22Z", + "startup_script_behavior": "blocking", + "status": "connecting", + "subsystems": [ + "envbox" + ], + "troubleshooting_url": "string", + "updated_at": "2019-08-24T14:15:22Z", + "version": "string" + } + ], + "created_at": "2019-08-24T14:15:22Z", + "daily_cost": 0, + "hide": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", + "metadata": [ + { + "key": "string", + "sensitive": true, + "value": "string" + } + ], + "name": "string", + "type": "string", + "workspace_transition": "start" + } + ], + "status": "pending", + "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", + "template_version_name": "string", + "transition": "start", + "updated_at": "2019-08-24T14:15:22Z", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string", + "workspace_owner_avatar_url": "string", + "workspace_owner_id": "e7078695-5279-4c86-8774-3ac2367a2fc7", + "workspace_owner_name": "string" + }, + "name": "string", + "next_start_at": "2019-08-24T14:15:22Z", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "organization_name": "string", + "outdated": true, + "owner_avatar_url": "string", + "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05", + "owner_name": "string", + "template_active_version_id": "b0da9c29-67d8-4c87-888c-bafe356f7f3c", + "template_allow_user_cancel_workspace_jobs": true, + "template_display_name": "string", + "template_icon": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_require_active_version": true, + "ttl_ms": 0, + "updated_at": "2019-08-24T14:15:22Z" + } + ] } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.WorkspacesResponse](schemas.md#codersdkworkspacesresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -962,7 +990,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace} \ ### Parameters | Name | In | Type | Required | Description | -| ----------------- | ----- | ------------ | -------- | ----------------------------------------------------------- | +|-------------------|-------|--------------|----------|-------------------------------------------------------------| | `workspace` | path | string(uuid) | true | Workspace ID | | `include_deleted` | query | boolean | false | Return data instead of HTTP 404 if the workspace is deleted | @@ -972,199 +1000,206 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace} \ ```json { - "allow_renames": true, - "automatic_updates": "always", - "autostart_schedule": "string", - "created_at": "2019-08-24T14:15:22Z", - "deleting_at": "2019-08-24T14:15:22Z", - "dormant_at": "2019-08-24T14:15:22Z", - "favorite": true, - "health": { - "failing_agents": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "healthy": false - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_used_at": "2019-08-24T14:15:22Z", - "latest_build": { - "build_number": 0, - "created_at": "2019-08-24T14:15:22Z", - "daily_cost": 0, - "deadline": "2019-08-24T14:15:22Z", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "initiator_id": "06588898-9a84-4b35-ba8f-f9cbd64946f3", - "initiator_name": "string", - "job": { - "canceled_at": "2019-08-24T14:15:22Z", - "completed_at": "2019-08-24T14:15:22Z", - "created_at": "2019-08-24T14:15:22Z", - "error": "string", - "error_code": "REQUIRED_TEMPLATE_VARIABLES", - "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "queue_position": 0, - "queue_size": 0, - "started_at": "2019-08-24T14:15:22Z", - "status": "pending", - "tags": { - "property1": "string", - "property2": "string" - }, - "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" - }, - "matched_provisioners": { - "available": 0, - "count": 0, - "most_recently_seen": "2019-08-24T14:15:22Z" - }, - "max_deadline": "2019-08-24T14:15:22Z", - "reason": "initiator", - "resources": [ - { - "agents": [ - { - "api_version": "string", - "apps": [ - { - "command": "string", - "display_name": "string", - "external": true, - "health": "disabled", - "healthcheck": { - "interval": 0, - "threshold": 0, - "url": "string" - }, - "hidden": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "sharing_level": "owner", - "slug": "string", - "subdomain": true, - "subdomain_name": "string", - "url": "string" - } - ], - "architecture": "string", - "connection_timeout_seconds": 0, - "created_at": "2019-08-24T14:15:22Z", - "directory": "string", - "disconnected_at": "2019-08-24T14:15:22Z", - "display_apps": ["vscode"], - "environment_variables": { - "property1": "string", - "property2": "string" - }, - "expanded_directory": "string", - "first_connected_at": "2019-08-24T14:15:22Z", - "health": { - "healthy": false, - "reason": "agent has lost connection" - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "instance_id": "string", - "last_connected_at": "2019-08-24T14:15:22Z", - "latency": { - "property1": { - "latency_ms": 0, - "preferred": true - }, - "property2": { - "latency_ms": 0, - "preferred": true - } - }, - "lifecycle_state": "created", - "log_sources": [ - { - "created_at": "2019-08-24T14:15:22Z", - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" - } - ], - "logs_length": 0, - "logs_overflowed": true, - "name": "string", - "operating_system": "string", - "ready_at": "2019-08-24T14:15:22Z", - "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", - "scripts": [ - { - "cron": "string", - "display_name": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "log_path": "string", - "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", - "run_on_start": true, - "run_on_stop": true, - "script": "string", - "start_blocks_login": true, - "timeout": 0 - } - ], - "started_at": "2019-08-24T14:15:22Z", - "startup_script_behavior": "blocking", - "status": "connecting", - "subsystems": ["envbox"], - "troubleshooting_url": "string", - "updated_at": "2019-08-24T14:15:22Z", - "version": "string" - } - ], - "created_at": "2019-08-24T14:15:22Z", - "daily_cost": 0, - "hide": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", - "metadata": [ - { - "key": "string", - "sensitive": true, - "value": "string" - } - ], - "name": "string", - "type": "string", - "workspace_transition": "start" - } - ], - "status": "pending", - "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", - "template_version_name": "string", - "transition": "start", - "updated_at": "2019-08-24T14:15:22Z", - "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", - "workspace_name": "string", - "workspace_owner_avatar_url": "string", - "workspace_owner_id": "e7078695-5279-4c86-8774-3ac2367a2fc7", - "workspace_owner_name": "string" - }, - "name": "string", - "next_start_at": "2019-08-24T14:15:22Z", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "organization_name": "string", - "outdated": true, - "owner_avatar_url": "string", - "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05", - "owner_name": "string", - "template_active_version_id": "b0da9c29-67d8-4c87-888c-bafe356f7f3c", - "template_allow_user_cancel_workspace_jobs": true, - "template_display_name": "string", - "template_icon": "string", - "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", - "template_name": "string", - "template_require_active_version": true, - "ttl_ms": 0, - "updated_at": "2019-08-24T14:15:22Z" + "allow_renames": true, + "automatic_updates": "always", + "autostart_schedule": "string", + "created_at": "2019-08-24T14:15:22Z", + "deleting_at": "2019-08-24T14:15:22Z", + "dormant_at": "2019-08-24T14:15:22Z", + "favorite": true, + "health": { + "failing_agents": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "healthy": false + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_used_at": "2019-08-24T14:15:22Z", + "latest_build": { + "build_number": 0, + "created_at": "2019-08-24T14:15:22Z", + "daily_cost": 0, + "deadline": "2019-08-24T14:15:22Z", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "initiator_id": "06588898-9a84-4b35-ba8f-f9cbd64946f3", + "initiator_name": "string", + "job": { + "canceled_at": "2019-08-24T14:15:22Z", + "completed_at": "2019-08-24T14:15:22Z", + "created_at": "2019-08-24T14:15:22Z", + "error": "string", + "error_code": "REQUIRED_TEMPLATE_VARIABLES", + "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "queue_position": 0, + "queue_size": 0, + "started_at": "2019-08-24T14:15:22Z", + "status": "pending", + "tags": { + "property1": "string", + "property2": "string" + }, + "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" + }, + "matched_provisioners": { + "available": 0, + "count": 0, + "most_recently_seen": "2019-08-24T14:15:22Z" + }, + "max_deadline": "2019-08-24T14:15:22Z", + "reason": "initiator", + "resources": [ + { + "agents": [ + { + "api_version": "string", + "apps": [ + { + "command": "string", + "display_name": "string", + "external": true, + "health": "disabled", + "healthcheck": { + "interval": 0, + "threshold": 0, + "url": "string" + }, + "hidden": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "open_in": "slim-window", + "sharing_level": "owner", + "slug": "string", + "subdomain": true, + "subdomain_name": "string", + "url": "string" + } + ], + "architecture": "string", + "connection_timeout_seconds": 0, + "created_at": "2019-08-24T14:15:22Z", + "directory": "string", + "disconnected_at": "2019-08-24T14:15:22Z", + "display_apps": [ + "vscode" + ], + "environment_variables": { + "property1": "string", + "property2": "string" + }, + "expanded_directory": "string", + "first_connected_at": "2019-08-24T14:15:22Z", + "health": { + "healthy": false, + "reason": "agent has lost connection" + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "instance_id": "string", + "last_connected_at": "2019-08-24T14:15:22Z", + "latency": { + "property1": { + "latency_ms": 0, + "preferred": true + }, + "property2": { + "latency_ms": 0, + "preferred": true + } + }, + "lifecycle_state": "created", + "log_sources": [ + { + "created_at": "2019-08-24T14:15:22Z", + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" + } + ], + "logs_length": 0, + "logs_overflowed": true, + "name": "string", + "operating_system": "string", + "ready_at": "2019-08-24T14:15:22Z", + "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", + "scripts": [ + { + "cron": "string", + "display_name": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "log_path": "string", + "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", + "run_on_start": true, + "run_on_stop": true, + "script": "string", + "start_blocks_login": true, + "timeout": 0 + } + ], + "started_at": "2019-08-24T14:15:22Z", + "startup_script_behavior": "blocking", + "status": "connecting", + "subsystems": [ + "envbox" + ], + "troubleshooting_url": "string", + "updated_at": "2019-08-24T14:15:22Z", + "version": "string" + } + ], + "created_at": "2019-08-24T14:15:22Z", + "daily_cost": 0, + "hide": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", + "metadata": [ + { + "key": "string", + "sensitive": true, + "value": "string" + } + ], + "name": "string", + "type": "string", + "workspace_transition": "start" + } + ], + "status": "pending", + "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", + "template_version_name": "string", + "transition": "start", + "updated_at": "2019-08-24T14:15:22Z", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string", + "workspace_owner_avatar_url": "string", + "workspace_owner_id": "e7078695-5279-4c86-8774-3ac2367a2fc7", + "workspace_owner_name": "string" + }, + "name": "string", + "next_start_at": "2019-08-24T14:15:22Z", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "organization_name": "string", + "outdated": true, + "owner_avatar_url": "string", + "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05", + "owner_name": "string", + "template_active_version_id": "b0da9c29-67d8-4c87-888c-bafe356f7f3c", + "template_allow_user_cancel_workspace_jobs": true, + "template_display_name": "string", + "template_icon": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_require_active_version": true, + "ttl_ms": 0, + "updated_at": "2019-08-24T14:15:22Z" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Workspace](schemas.md#codersdkworkspace) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1186,21 +1221,21 @@ curl -X PATCH http://coder-server:8080/api/v2/workspaces/{workspace} \ ```json { - "name": "string" + "name": "string" } ``` ### Parameters | Name | In | Type | Required | Description | -| ----------- | ---- | ---------------------------------------------------------------------------- | -------- | ----------------------- | +|-------------|------|------------------------------------------------------------------------------|----------|-------------------------| | `workspace` | path | string(uuid) | true | Workspace ID | | `body` | body | [codersdk.UpdateWorkspaceRequest](schemas.md#codersdkupdateworkspacerequest) | true | Metadata update request | ### Responses | Status | Meaning | Description | Schema | -| ------ | --------------------------------------------------------------- | ----------- | ------ | +|--------|-----------------------------------------------------------------|-------------|--------| | 204 | [No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5) | No Content | | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1222,21 +1257,21 @@ curl -X PUT http://coder-server:8080/api/v2/workspaces/{workspace}/autostart \ ```json { - "schedule": "string" + "schedule": "string" } ``` ### Parameters | Name | In | Type | Required | Description | -| ----------- | ---- | ---------------------------------------------------------------------------------------------- | -------- | ----------------------- | +|-------------|------|------------------------------------------------------------------------------------------------|----------|-------------------------| | `workspace` | path | string(uuid) | true | Workspace ID | | `body` | body | [codersdk.UpdateWorkspaceAutostartRequest](schemas.md#codersdkupdateworkspaceautostartrequest) | true | Schedule update request | ### Responses | Status | Meaning | Description | Schema | -| ------ | --------------------------------------------------------------- | ----------- | ------ | +|--------|-----------------------------------------------------------------|-------------|--------| | 204 | [No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5) | No Content | | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1258,26 +1293,26 @@ curl -X PUT http://coder-server:8080/api/v2/workspaces/{workspace}/autoupdates \ ```json { - "automatic_updates": "always" + "automatic_updates": "always" } ``` ### Parameters | Name | In | Type | Required | Description | -| ----------- | ---- | ------------------------------------------------------------------------------------------------------------ | -------- | ------------------------- | +|-------------|------|--------------------------------------------------------------------------------------------------------------|----------|---------------------------| | `workspace` | path | string(uuid) | true | Workspace ID | | `body` | body | [codersdk.UpdateWorkspaceAutomaticUpdatesRequest](schemas.md#codersdkupdateworkspaceautomaticupdatesrequest) | true | Automatic updates request | ### Responses | Status | Meaning | Description | Schema | -| ------ | --------------------------------------------------------------- | ----------- | ------ | +|--------|-----------------------------------------------------------------|-------------|--------| | 204 | [No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5) | No Content | | To perform this operation, you must be authenticated. [Learn more](authentication.md). -## Update workspace dormancy status by id. +## Update workspace dormancy status by id ### Code samples @@ -1295,14 +1330,14 @@ curl -X PUT http://coder-server:8080/api/v2/workspaces/{workspace}/dormant \ ```json { - "dormant": true + "dormant": true } ``` ### Parameters | Name | In | Type | Required | Description | -| ----------- | ---- | ------------------------------------------------------------------------------ | -------- | ---------------------------------- | +|-------------|------|--------------------------------------------------------------------------------|----------|------------------------------------| | `workspace` | path | string(uuid) | true | Workspace ID | | `body` | body | [codersdk.UpdateWorkspaceDormancy](schemas.md#codersdkupdateworkspacedormancy) | true | Make a workspace dormant or active | @@ -1312,199 +1347,206 @@ curl -X PUT http://coder-server:8080/api/v2/workspaces/{workspace}/dormant \ ```json { - "allow_renames": true, - "automatic_updates": "always", - "autostart_schedule": "string", - "created_at": "2019-08-24T14:15:22Z", - "deleting_at": "2019-08-24T14:15:22Z", - "dormant_at": "2019-08-24T14:15:22Z", - "favorite": true, - "health": { - "failing_agents": ["497f6eca-6276-4993-bfeb-53cbbbba6f08"], - "healthy": false - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "last_used_at": "2019-08-24T14:15:22Z", - "latest_build": { - "build_number": 0, - "created_at": "2019-08-24T14:15:22Z", - "daily_cost": 0, - "deadline": "2019-08-24T14:15:22Z", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "initiator_id": "06588898-9a84-4b35-ba8f-f9cbd64946f3", - "initiator_name": "string", - "job": { - "canceled_at": "2019-08-24T14:15:22Z", - "completed_at": "2019-08-24T14:15:22Z", - "created_at": "2019-08-24T14:15:22Z", - "error": "string", - "error_code": "REQUIRED_TEMPLATE_VARIABLES", - "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "queue_position": 0, - "queue_size": 0, - "started_at": "2019-08-24T14:15:22Z", - "status": "pending", - "tags": { - "property1": "string", - "property2": "string" - }, - "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" - }, - "matched_provisioners": { - "available": 0, - "count": 0, - "most_recently_seen": "2019-08-24T14:15:22Z" - }, - "max_deadline": "2019-08-24T14:15:22Z", - "reason": "initiator", - "resources": [ - { - "agents": [ - { - "api_version": "string", - "apps": [ - { - "command": "string", - "display_name": "string", - "external": true, - "health": "disabled", - "healthcheck": { - "interval": 0, - "threshold": 0, - "url": "string" - }, - "hidden": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "sharing_level": "owner", - "slug": "string", - "subdomain": true, - "subdomain_name": "string", - "url": "string" - } - ], - "architecture": "string", - "connection_timeout_seconds": 0, - "created_at": "2019-08-24T14:15:22Z", - "directory": "string", - "disconnected_at": "2019-08-24T14:15:22Z", - "display_apps": ["vscode"], - "environment_variables": { - "property1": "string", - "property2": "string" - }, - "expanded_directory": "string", - "first_connected_at": "2019-08-24T14:15:22Z", - "health": { - "healthy": false, - "reason": "agent has lost connection" - }, - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "instance_id": "string", - "last_connected_at": "2019-08-24T14:15:22Z", - "latency": { - "property1": { - "latency_ms": 0, - "preferred": true - }, - "property2": { - "latency_ms": 0, - "preferred": true - } - }, - "lifecycle_state": "created", - "log_sources": [ - { - "created_at": "2019-08-24T14:15:22Z", - "display_name": "string", - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" - } - ], - "logs_length": 0, - "logs_overflowed": true, - "name": "string", - "operating_system": "string", - "ready_at": "2019-08-24T14:15:22Z", - "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", - "scripts": [ - { - "cron": "string", - "display_name": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "log_path": "string", - "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", - "run_on_start": true, - "run_on_stop": true, - "script": "string", - "start_blocks_login": true, - "timeout": 0 - } - ], - "started_at": "2019-08-24T14:15:22Z", - "startup_script_behavior": "blocking", - "status": "connecting", - "subsystems": ["envbox"], - "troubleshooting_url": "string", - "updated_at": "2019-08-24T14:15:22Z", - "version": "string" - } - ], - "created_at": "2019-08-24T14:15:22Z", - "daily_cost": 0, - "hide": true, - "icon": "string", - "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", - "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", - "metadata": [ - { - "key": "string", - "sensitive": true, - "value": "string" - } - ], - "name": "string", - "type": "string", - "workspace_transition": "start" - } - ], - "status": "pending", - "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", - "template_version_name": "string", - "transition": "start", - "updated_at": "2019-08-24T14:15:22Z", - "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", - "workspace_name": "string", - "workspace_owner_avatar_url": "string", - "workspace_owner_id": "e7078695-5279-4c86-8774-3ac2367a2fc7", - "workspace_owner_name": "string" - }, - "name": "string", - "next_start_at": "2019-08-24T14:15:22Z", - "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "organization_name": "string", - "outdated": true, - "owner_avatar_url": "string", - "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05", - "owner_name": "string", - "template_active_version_id": "b0da9c29-67d8-4c87-888c-bafe356f7f3c", - "template_allow_user_cancel_workspace_jobs": true, - "template_display_name": "string", - "template_icon": "string", - "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", - "template_name": "string", - "template_require_active_version": true, - "ttl_ms": 0, - "updated_at": "2019-08-24T14:15:22Z" + "allow_renames": true, + "automatic_updates": "always", + "autostart_schedule": "string", + "created_at": "2019-08-24T14:15:22Z", + "deleting_at": "2019-08-24T14:15:22Z", + "dormant_at": "2019-08-24T14:15:22Z", + "favorite": true, + "health": { + "failing_agents": [ + "497f6eca-6276-4993-bfeb-53cbbbba6f08" + ], + "healthy": false + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "last_used_at": "2019-08-24T14:15:22Z", + "latest_build": { + "build_number": 0, + "created_at": "2019-08-24T14:15:22Z", + "daily_cost": 0, + "deadline": "2019-08-24T14:15:22Z", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "initiator_id": "06588898-9a84-4b35-ba8f-f9cbd64946f3", + "initiator_name": "string", + "job": { + "canceled_at": "2019-08-24T14:15:22Z", + "completed_at": "2019-08-24T14:15:22Z", + "created_at": "2019-08-24T14:15:22Z", + "error": "string", + "error_code": "REQUIRED_TEMPLATE_VARIABLES", + "file_id": "8a0cfb4f-ddc9-436d-91bb-75133c583767", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "queue_position": 0, + "queue_size": 0, + "started_at": "2019-08-24T14:15:22Z", + "status": "pending", + "tags": { + "property1": "string", + "property2": "string" + }, + "worker_id": "ae5fa6f7-c55b-40c1-b40a-b36ac467652b" + }, + "matched_provisioners": { + "available": 0, + "count": 0, + "most_recently_seen": "2019-08-24T14:15:22Z" + }, + "max_deadline": "2019-08-24T14:15:22Z", + "reason": "initiator", + "resources": [ + { + "agents": [ + { + "api_version": "string", + "apps": [ + { + "command": "string", + "display_name": "string", + "external": true, + "health": "disabled", + "healthcheck": { + "interval": 0, + "threshold": 0, + "url": "string" + }, + "hidden": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "open_in": "slim-window", + "sharing_level": "owner", + "slug": "string", + "subdomain": true, + "subdomain_name": "string", + "url": "string" + } + ], + "architecture": "string", + "connection_timeout_seconds": 0, + "created_at": "2019-08-24T14:15:22Z", + "directory": "string", + "disconnected_at": "2019-08-24T14:15:22Z", + "display_apps": [ + "vscode" + ], + "environment_variables": { + "property1": "string", + "property2": "string" + }, + "expanded_directory": "string", + "first_connected_at": "2019-08-24T14:15:22Z", + "health": { + "healthy": false, + "reason": "agent has lost connection" + }, + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "instance_id": "string", + "last_connected_at": "2019-08-24T14:15:22Z", + "latency": { + "property1": { + "latency_ms": 0, + "preferred": true + }, + "property2": { + "latency_ms": 0, + "preferred": true + } + }, + "lifecycle_state": "created", + "log_sources": [ + { + "created_at": "2019-08-24T14:15:22Z", + "display_name": "string", + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "workspace_agent_id": "7ad2e618-fea7-4c1a-b70a-f501566a72f1" + } + ], + "logs_length": 0, + "logs_overflowed": true, + "name": "string", + "operating_system": "string", + "ready_at": "2019-08-24T14:15:22Z", + "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f", + "scripts": [ + { + "cron": "string", + "display_name": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "log_path": "string", + "log_source_id": "4197ab25-95cf-4b91-9c78-f7f2af5d353a", + "run_on_start": true, + "run_on_stop": true, + "script": "string", + "start_blocks_login": true, + "timeout": 0 + } + ], + "started_at": "2019-08-24T14:15:22Z", + "startup_script_behavior": "blocking", + "status": "connecting", + "subsystems": [ + "envbox" + ], + "troubleshooting_url": "string", + "updated_at": "2019-08-24T14:15:22Z", + "version": "string" + } + ], + "created_at": "2019-08-24T14:15:22Z", + "daily_cost": 0, + "hide": true, + "icon": "string", + "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", + "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", + "metadata": [ + { + "key": "string", + "sensitive": true, + "value": "string" + } + ], + "name": "string", + "type": "string", + "workspace_transition": "start" + } + ], + "status": "pending", + "template_version_id": "0ba39c92-1f1b-4c32-aa3e-9925d7713eb1", + "template_version_name": "string", + "transition": "start", + "updated_at": "2019-08-24T14:15:22Z", + "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9", + "workspace_name": "string", + "workspace_owner_avatar_url": "string", + "workspace_owner_id": "e7078695-5279-4c86-8774-3ac2367a2fc7", + "workspace_owner_name": "string" + }, + "name": "string", + "next_start_at": "2019-08-24T14:15:22Z", + "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", + "organization_name": "string", + "outdated": true, + "owner_avatar_url": "string", + "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05", + "owner_name": "string", + "template_active_version_id": "b0da9c29-67d8-4c87-888c-bafe356f7f3c", + "template_allow_user_cancel_workspace_jobs": true, + "template_display_name": "string", + "template_icon": "string", + "template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc", + "template_name": "string", + "template_require_active_version": true, + "ttl_ms": 0, + "updated_at": "2019-08-24T14:15:22Z" } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Workspace](schemas.md#codersdkworkspace) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1527,14 +1569,14 @@ curl -X PUT http://coder-server:8080/api/v2/workspaces/{workspace}/extend \ ```json { - "deadline": "2019-08-24T14:15:22Z" + "deadline": "2019-08-24T14:15:22Z" } ``` ### Parameters | Name | In | Type | Required | Description | -| ----------- | ---- | ---------------------------------------------------------------------------------- | -------- | ------------------------------ | +|-------------|------|------------------------------------------------------------------------------------|----------|--------------------------------| | `workspace` | path | string(uuid) | true | Workspace ID | | `body` | body | [codersdk.PutExtendWorkspaceRequest](schemas.md#codersdkputextendworkspacerequest) | true | Extend deadline update request | @@ -1544,26 +1586,26 @@ curl -X PUT http://coder-server:8080/api/v2/workspaces/{workspace}/extend \ ```json { - "detail": "string", - "message": "string", - "validations": [ - { - "detail": "string", - "field": "string" - } - ] + "detail": "string", + "message": "string", + "validations": [ + { + "detail": "string", + "field": "string" + } + ] } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Response](schemas.md#codersdkresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). -## Favorite workspace by ID. +## Favorite workspace by ID ### Code samples @@ -1578,18 +1620,18 @@ curl -X PUT http://coder-server:8080/api/v2/workspaces/{workspace}/favorite \ ### Parameters | Name | In | Type | Required | Description | -| ----------- | ---- | ------------ | -------- | ------------ | +|-------------|------|--------------|----------|--------------| | `workspace` | path | string(uuid) | true | Workspace ID | ### Responses | Status | Meaning | Description | Schema | -| ------ | --------------------------------------------------------------- | ----------- | ------ | +|--------|-----------------------------------------------------------------|-------------|--------| | 204 | [No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5) | No Content | | To perform this operation, you must be authenticated. [Learn more](authentication.md). -## Unfavorite workspace by ID. +## Unfavorite workspace by ID ### Code samples @@ -1604,18 +1646,18 @@ curl -X DELETE http://coder-server:8080/api/v2/workspaces/{workspace}/favorite \ ### Parameters | Name | In | Type | Required | Description | -| ----------- | ---- | ------------ | -------- | ------------ | +|-------------|------|--------------|----------|--------------| | `workspace` | path | string(uuid) | true | Workspace ID | ### Responses | Status | Meaning | Description | Schema | -| ------ | --------------------------------------------------------------- | ----------- | ------ | +|--------|-----------------------------------------------------------------|-------------|--------| | 204 | [No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5) | No Content | | To perform this operation, you must be authenticated. [Learn more](authentication.md). -## Resolve workspace autostart by id. +## Resolve workspace autostart by id ### Code samples @@ -1631,7 +1673,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace}/resolve-autos ### Parameters | Name | In | Type | Required | Description | -| ----------- | ---- | ------------ | -------- | ------------ | +|-------------|------|--------------|----------|--------------| | `workspace` | path | string(uuid) | true | Workspace ID | ### Example responses @@ -1640,14 +1682,14 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace}/resolve-autos ```json { - "parameter_mismatch": true + "parameter_mismatch": true } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.ResolveAutostartResponse](schemas.md#codersdkresolveautostartresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1668,7 +1710,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace}/timings \ ### Parameters | Name | In | Type | Required | Description | -| ----------- | ---- | ------------ | -------- | ------------ | +|-------------|------|--------------|----------|--------------| | `workspace` | path | string(uuid) | true | Workspace ID | ### Example responses @@ -1677,45 +1719,45 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace}/timings \ ```json { - "agent_connection_timings": [ - { - "ended_at": "2019-08-24T14:15:22Z", - "stage": "init", - "started_at": "2019-08-24T14:15:22Z", - "workspace_agent_id": "string", - "workspace_agent_name": "string" - } - ], - "agent_script_timings": [ - { - "display_name": "string", - "ended_at": "2019-08-24T14:15:22Z", - "exit_code": 0, - "stage": "init", - "started_at": "2019-08-24T14:15:22Z", - "status": "string", - "workspace_agent_id": "string", - "workspace_agent_name": "string" - } - ], - "provisioner_timings": [ - { - "action": "string", - "ended_at": "2019-08-24T14:15:22Z", - "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", - "resource": "string", - "source": "string", - "stage": "init", - "started_at": "2019-08-24T14:15:22Z" - } - ] + "agent_connection_timings": [ + { + "ended_at": "2019-08-24T14:15:22Z", + "stage": "init", + "started_at": "2019-08-24T14:15:22Z", + "workspace_agent_id": "string", + "workspace_agent_name": "string" + } + ], + "agent_script_timings": [ + { + "display_name": "string", + "ended_at": "2019-08-24T14:15:22Z", + "exit_code": 0, + "stage": "init", + "started_at": "2019-08-24T14:15:22Z", + "status": "string", + "workspace_agent_id": "string", + "workspace_agent_name": "string" + } + ], + "provisioner_timings": [ + { + "action": "string", + "ended_at": "2019-08-24T14:15:22Z", + "job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f", + "resource": "string", + "source": "string", + "stage": "init", + "started_at": "2019-08-24T14:15:22Z" + } + ] } ``` ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------------------- | +|--------|---------------------------------------------------------|-------------|----------------------------------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.WorkspaceBuildTimings](schemas.md#codersdkworkspacebuildtimings) | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1737,21 +1779,21 @@ curl -X PUT http://coder-server:8080/api/v2/workspaces/{workspace}/ttl \ ```json { - "ttl_ms": 0 + "ttl_ms": 0 } ``` ### Parameters | Name | In | Type | Required | Description | -| ----------- | ---- | ---------------------------------------------------------------------------------- | -------- | ---------------------------- | +|-------------|------|------------------------------------------------------------------------------------|----------|------------------------------| | `workspace` | path | string(uuid) | true | Workspace ID | | `body` | body | [codersdk.UpdateWorkspaceTTLRequest](schemas.md#codersdkupdateworkspacettlrequest) | true | Workspace TTL update request | ### Responses | Status | Meaning | Description | Schema | -| ------ | --------------------------------------------------------------- | ----------- | ------ | +|--------|-----------------------------------------------------------------|-------------|--------| | 204 | [No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5) | No Content | | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1773,22 +1815,22 @@ curl -X POST http://coder-server:8080/api/v2/workspaces/{workspace}/usage \ ```json { - "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978", - "app_name": "vscode" + "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978", + "app_name": "vscode" } ``` ### Parameters | Name | In | Type | Required | Description | -| ----------- | ---- | ---------------------------------------------------------------------------------- | -------- | ---------------------------- | +|-------------|------|------------------------------------------------------------------------------------|----------|------------------------------| | `workspace` | path | string(uuid) | true | Workspace ID | | `body` | body | [codersdk.PostWorkspaceUsageRequest](schemas.md#codersdkpostworkspaceusagerequest) | false | Post workspace usage request | ### Responses | Status | Meaning | Description | Schema | -| ------ | --------------------------------------------------------------- | ----------- | ------ | +|--------|-----------------------------------------------------------------|-------------|--------| | 204 | [No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5) | No Content | | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -1809,7 +1851,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace}/watch \ ### Parameters | Name | In | Type | Required | Description | -| ----------- | ---- | ------------ | -------- | ------------ | +|-------------|------|--------------|----------|--------------| | `workspace` | path | string(uuid) | true | Workspace ID | ### Example responses @@ -1819,7 +1861,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace}/watch \ ### Responses | Status | Meaning | Description | Schema | -| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------ | +|--------|---------------------------------------------------------|-------------|--------------------------------------------------| | 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.Response](schemas.md#codersdkresponse) | To perform this operation, you must be authenticated. [Learn more](authentication.md). diff --git a/docs/reference/cli/autoupdate.md b/docs/reference/cli/autoupdate.md index 12751dfd291a5..a025616e76031 100644 --- a/docs/reference/cli/autoupdate.md +++ b/docs/reference/cli/autoupdate.md @@ -1,5 +1,4 @@ - # autoupdate Toggle auto-update policy for a workspace @@ -15,7 +14,7 @@ coder autoupdate [flags] ### -y, --yes | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Bypass prompts. diff --git a/docs/reference/cli/completion.md b/docs/reference/cli/completion.md index 45e8ab77b741d..1d14fc2aa2467 100644 --- a/docs/reference/cli/completion.md +++ b/docs/reference/cli/completion.md @@ -1,5 +1,4 @@ - # completion Install or update shell completion scripts for the detected or chosen shell. @@ -15,7 +14,7 @@ coder completion [flags] ### -s, --shell | | | -| ---- | ---------------------------------------- | +|------|------------------------------------------| | Type | bash\|fish\|zsh\|powershell | The shell to install completion for. @@ -23,7 +22,7 @@ The shell to install completion for. ### -p, --print | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Print the completion script instead of installing it. diff --git a/docs/reference/cli/config-ssh.md b/docs/reference/cli/config-ssh.md index ef1c75e56ec61..937bcd061bd05 100644 --- a/docs/reference/cli/config-ssh.md +++ b/docs/reference/cli/config-ssh.md @@ -1,5 +1,4 @@ - # config-ssh Add an SSH Host entry for your workspaces "ssh coder.workspace" @@ -28,7 +27,7 @@ workspaces: ### --ssh-config-file | | | -| ----------- | ----------------------------------- | +|-------------|-------------------------------------| | Type | string | | Environment | $CODER_SSH_CONFIG_FILE | | Default | ~/.ssh/config | @@ -38,7 +37,7 @@ Specifies the path to an SSH config. ### --coder-binary-path | | | -| ----------- | ------------------------------------------ | +|-------------|--------------------------------------------| | Type | string | | Environment | $CODER_SSH_CONFIG_BINARY_PATH | @@ -47,7 +46,7 @@ Optionally specify the absolute path to the coder binary used in ProxyCommand. B ### -o, --ssh-option | | | -| ----------- | ----------------------------------- | +|-------------|-------------------------------------| | Type | string-array | | Environment | $CODER_SSH_CONFIG_OPTS | @@ -56,7 +55,7 @@ Specifies additional SSH options to embed in each host stanza. ### -n, --dry-run | | | -| ----------- | ------------------------------- | +|-------------|---------------------------------| | Type | bool | | Environment | $CODER_SSH_DRY_RUN | @@ -65,7 +64,7 @@ Perform a trial run with no changes made, showing a diff at the end. ### --use-previous-options | | | -| ----------- | -------------------------------------------- | +|-------------|----------------------------------------------| | Type | bool | | Environment | $CODER_SSH_USE_PREVIOUS_OPTIONS | @@ -74,7 +73,7 @@ Specifies whether or not to keep options from previous run of config-ssh. ### --ssh-host-prefix | | | -| ----------- | --------------------------------------------- | +|-------------|-----------------------------------------------| | Type | string | | Environment | $CODER_CONFIGSSH_SSH_HOST_PREFIX | @@ -83,7 +82,7 @@ Override the default host prefix. ### --wait | | | -| ----------- | ---------------------------------- | +|-------------|------------------------------------| | Type | yes\|no\|auto | | Environment | $CODER_CONFIGSSH_WAIT | | Default | auto | @@ -93,7 +92,7 @@ Specifies whether or not to wait for the startup script to finish executing. Aut ### --disable-autostart | | | -| ----------- | ----------------------------------------------- | +|-------------|-------------------------------------------------| | Type | bool | | Environment | $CODER_CONFIGSSH_DISABLE_AUTOSTART | | Default | false | @@ -103,7 +102,7 @@ Disable starting the workspace automatically when connecting via SSH. ### -y, --yes | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Bypass prompts. diff --git a/docs/reference/cli/create.md b/docs/reference/cli/create.md index 377dda14189e4..58c0fad4a14e8 100644 --- a/docs/reference/cli/create.md +++ b/docs/reference/cli/create.md @@ -1,5 +1,4 @@ - # create Create a workspace @@ -23,7 +22,7 @@ coder create [flags] [workspace] ### -t, --template | | | -| ----------- | --------------------------------- | +|-------------|-----------------------------------| | Type | string | | Environment | $CODER_TEMPLATE_NAME | @@ -32,7 +31,7 @@ Specify a template name. ### --template-version | | | -| ----------- | ------------------------------------ | +|-------------|--------------------------------------| | Type | string | | Environment | $CODER_TEMPLATE_VERSION | @@ -41,7 +40,7 @@ Specify a template version name. ### --start-at | | | -| ----------- | -------------------------------------- | +|-------------|----------------------------------------| | Type | string | | Environment | $CODER_WORKSPACE_START_AT | @@ -50,7 +49,7 @@ Specify the workspace autostart schedule. Check coder schedule start --help for ### --stop-after | | | -| ----------- | ---------------------------------------- | +|-------------|------------------------------------------| | Type | duration | | Environment | $CODER_WORKSPACE_STOP_AFTER | @@ -59,7 +58,7 @@ Specify a duration after which the workspace should shut down (e.g. 8h). ### --automatic-updates | | | -| ----------- | ----------------------------------------------- | +|-------------|-------------------------------------------------| | Type | string | | Environment | $CODER_WORKSPACE_AUTOMATIC_UPDATES | | Default | never | @@ -69,7 +68,7 @@ Specify automatic updates setting for the workspace (accepts 'always' or 'never' ### --copy-parameters-from | | | -| ----------- | -------------------------------------------------- | +|-------------|----------------------------------------------------| | Type | string | | Environment | $CODER_WORKSPACE_COPY_PARAMETERS_FROM | @@ -78,7 +77,7 @@ Specify the source workspace name to copy parameters from. ### -y, --yes | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Bypass prompts. @@ -86,7 +85,7 @@ Bypass prompts. ### --parameter | | | -| ----------- | ---------------------------------- | +|-------------|------------------------------------| | Type | string-array | | Environment | $CODER_RICH_PARAMETER | @@ -95,7 +94,7 @@ Rich parameter value in the format "name=value". ### --rich-parameter-file | | | -| ----------- | --------------------------------------- | +|-------------|-----------------------------------------| | Type | string | | Environment | $CODER_RICH_PARAMETER_FILE | @@ -104,7 +103,7 @@ Specify a file path with values for rich parameters defined in the template. The ### --parameter-default | | | -| ----------- | ------------------------------------------ | +|-------------|--------------------------------------------| | Type | string-array | | Environment | $CODER_RICH_PARAMETER_DEFAULT | @@ -113,7 +112,7 @@ Rich parameter default values in the format "name=value". ### -O, --org | | | -| ----------- | -------------------------------- | +|-------------|----------------------------------| | Type | string | | Environment | $CODER_ORGANIZATION | diff --git a/docs/reference/cli/delete.md b/docs/reference/cli/delete.md index b5093efa63f0a..9dc2ea6fa9a19 100644 --- a/docs/reference/cli/delete.md +++ b/docs/reference/cli/delete.md @@ -1,12 +1,11 @@ - # delete Delete a workspace Aliases: -- rm +* rm ## Usage @@ -27,7 +26,7 @@ coder delete [flags] ### --orphan | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Delete a workspace without deleting its resources. This can delete a workspace in a broken state, but may also lead to unaccounted cloud resources. @@ -35,7 +34,7 @@ Delete a workspace without deleting its resources. This can delete a workspace i ### -y, --yes | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Bypass prompts. diff --git a/docs/reference/cli/dotfiles.md b/docs/reference/cli/dotfiles.md index 709aab6dd70b0..57074497fee5f 100644 --- a/docs/reference/cli/dotfiles.md +++ b/docs/reference/cli/dotfiles.md @@ -1,5 +1,4 @@ - # dotfiles Personalize your workspace by applying a canonical dotfiles repository @@ -23,7 +22,7 @@ coder dotfiles [flags] ### --symlink-dir | | | -| ----------- | ------------------------------- | +|-------------|---------------------------------| | Type | string | | Environment | $CODER_SYMLINK_DIR | @@ -32,7 +31,7 @@ Specifies the directory for the dotfiles symlink destinations. If empty, will us ### -b, --branch | | | -| ---- | ------------------- | +|------|---------------------| | Type | string | Specifies which branch to clone. If empty, will default to cloning the default branch or using the existing branch in the cloned repo on disk. @@ -40,7 +39,7 @@ Specifies which branch to clone. If empty, will default to cloning the default b ### --repo-dir | | | -| ----------- | ------------------------------------- | +|-------------|---------------------------------------| | Type | string | | Environment | $CODER_DOTFILES_REPO_DIR | | Default | dotfiles | @@ -50,7 +49,7 @@ Specifies the directory for the dotfiles repository, relative to global config d ### -y, --yes | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Bypass prompts. diff --git a/docs/reference/cli/external-auth.md b/docs/reference/cli/external-auth.md index ebe16435feb62..5347bfd34e1ac 100644 --- a/docs/reference/cli/external-auth.md +++ b/docs/reference/cli/external-auth.md @@ -1,5 +1,4 @@ - # external-auth Manage external authentication @@ -19,5 +18,5 @@ Authenticate with external services inside of a workspace. ## Subcommands | Name | Purpose | -| ------------------------------------------------------------ | ----------------------------------- | +|--------------------------------------------------------------|-------------------------------------| | [access-token](./external-auth_access-token.md) | Print auth for an external provider | diff --git a/docs/reference/cli/external-auth_access-token.md b/docs/reference/cli/external-auth_access-token.md index ead28af54be31..2303e8f076da8 100644 --- a/docs/reference/cli/external-auth_access-token.md +++ b/docs/reference/cli/external-auth_access-token.md @@ -1,5 +1,4 @@ - # external-auth access-token Print auth for an external provider @@ -37,7 +36,7 @@ fi ### --extra | | | -| ---- | ------------------- | +|------|---------------------| | Type | string | Extract a field from the "extra" properties of the OAuth token. diff --git a/docs/reference/cli/favorite.md b/docs/reference/cli/favorite.md index 93b5027367020..97ff6fde44032 100644 --- a/docs/reference/cli/favorite.md +++ b/docs/reference/cli/favorite.md @@ -1,13 +1,12 @@ - # favorite Add a workspace to your favorites Aliases: -- fav -- favourite +* fav +* favourite ## Usage diff --git a/docs/reference/cli/features.md b/docs/reference/cli/features.md index d367623f049a0..1ba187f964c8e 100644 --- a/docs/reference/cli/features.md +++ b/docs/reference/cli/features.md @@ -1,12 +1,11 @@ - # features List Enterprise features Aliases: -- feature +* feature ## Usage @@ -17,5 +16,5 @@ coder features ## Subcommands | Name | Purpose | -| --------------------------------------- | ------- | +|-----------------------------------------|---------| | [list](./features_list.md) | | diff --git a/docs/reference/cli/features_list.md b/docs/reference/cli/features_list.md index 43795aea2874b..a1aab1d165ae6 100644 --- a/docs/reference/cli/features_list.md +++ b/docs/reference/cli/features_list.md @@ -1,10 +1,9 @@ - # features list Aliases: -- ls +* ls ## Usage @@ -17,7 +16,7 @@ coder features list [flags] ### -c, --column | | | -| ------- | -------------------------------------------------------- | +|---------|----------------------------------------------------------| | Type | [name\|entitlement\|enabled\|limit\|actual] | | Default | name,entitlement,enabled,limit,actual | @@ -26,7 +25,7 @@ Specify columns to filter in the table. ### -o, --output | | | -| ------- | ------------------------ | +|---------|--------------------------| | Type | table\|json | | Default | table | diff --git a/docs/reference/cli/groups.md b/docs/reference/cli/groups.md index 6d5c936e7f0c5..a036d646ab263 100644 --- a/docs/reference/cli/groups.md +++ b/docs/reference/cli/groups.md @@ -1,12 +1,11 @@ - # groups Manage groups Aliases: -- group +* group ## Usage @@ -17,7 +16,7 @@ coder groups ## Subcommands | Name | Purpose | -| ----------------------------------------- | ------------------- | +|-------------------------------------------|---------------------| | [create](./groups_create.md) | Create a user group | | [list](./groups_list.md) | List user groups | | [edit](./groups_edit.md) | Edit a user group | diff --git a/docs/reference/cli/groups_create.md b/docs/reference/cli/groups_create.md index e758b422ea387..4274a681a5873 100644 --- a/docs/reference/cli/groups_create.md +++ b/docs/reference/cli/groups_create.md @@ -1,5 +1,4 @@ - # groups create Create a user group @@ -15,7 +14,7 @@ coder groups create [flags] ### -u, --avatar-url | | | -| ----------- | ------------------------------ | +|-------------|--------------------------------| | Type | string | | Environment | $CODER_AVATAR_URL | @@ -24,7 +23,7 @@ Set an avatar for a group. ### --display-name | | | -| ----------- | -------------------------------- | +|-------------|----------------------------------| | Type | string | | Environment | $CODER_DISPLAY_NAME | @@ -33,7 +32,7 @@ Optional human friendly name for the group. ### -O, --org | | | -| ----------- | -------------------------------- | +|-------------|----------------------------------| | Type | string | | Environment | $CODER_ORGANIZATION | diff --git a/docs/reference/cli/groups_delete.md b/docs/reference/cli/groups_delete.md index 7bbf215ae2f29..2135fb635cb8a 100644 --- a/docs/reference/cli/groups_delete.md +++ b/docs/reference/cli/groups_delete.md @@ -1,12 +1,11 @@ - # groups delete Delete a user group Aliases: -- rm +* rm ## Usage @@ -19,7 +18,7 @@ coder groups delete [flags] ### -O, --org | | | -| ----------- | -------------------------------- | +|-------------|----------------------------------| | Type | string | | Environment | $CODER_ORGANIZATION | diff --git a/docs/reference/cli/groups_edit.md b/docs/reference/cli/groups_edit.md index f7c39c58e1d24..356a7eea4e7a9 100644 --- a/docs/reference/cli/groups_edit.md +++ b/docs/reference/cli/groups_edit.md @@ -1,5 +1,4 @@ - # groups edit Edit a user group @@ -15,7 +14,7 @@ coder groups edit [flags] ### -n, --name | | | -| ---- | ------------------- | +|------|---------------------| | Type | string | Update the group name. @@ -23,7 +22,7 @@ Update the group name. ### -u, --avatar-url | | | -| ---- | ------------------- | +|------|---------------------| | Type | string | Update the group avatar. @@ -31,7 +30,7 @@ Update the group avatar. ### --display-name | | | -| ----------- | -------------------------------- | +|-------------|----------------------------------| | Type | string | | Environment | $CODER_DISPLAY_NAME | @@ -40,7 +39,7 @@ Optional human friendly name for the group. ### -a, --add-users | | | -| ---- | ------------------------- | +|------|---------------------------| | Type | string-array | Add users to the group. Accepts emails or IDs. @@ -48,7 +47,7 @@ Add users to the group. Accepts emails or IDs. ### -r, --rm-users | | | -| ---- | ------------------------- | +|------|---------------------------| | Type | string-array | Remove users to the group. Accepts emails or IDs. @@ -56,7 +55,7 @@ Remove users to the group. Accepts emails or IDs. ### -O, --org | | | -| ----------- | -------------------------------- | +|-------------|----------------------------------| | Type | string | | Environment | $CODER_ORGANIZATION | diff --git a/docs/reference/cli/groups_list.md b/docs/reference/cli/groups_list.md index f3ab2f5e0956e..c76e8b382ec44 100644 --- a/docs/reference/cli/groups_list.md +++ b/docs/reference/cli/groups_list.md @@ -1,5 +1,4 @@ - # groups list List user groups @@ -15,7 +14,7 @@ coder groups list [flags] ### -c, --column | | | -| ------- | ----------------------------------------------------------------------- | +|---------|-------------------------------------------------------------------------| | Type | [name\|display name\|organization id\|members\|avatar url] | | Default | name,display name,organization id,members,avatar url | @@ -24,7 +23,7 @@ Columns to display in table output. ### -o, --output | | | -| ------- | ------------------------ | +|---------|--------------------------| | Type | table\|json | | Default | table | @@ -33,7 +32,7 @@ Output format. ### -O, --org | | | -| ----------- | -------------------------------- | +|-------------|----------------------------------| | Type | string | | Environment | $CODER_ORGANIZATION | diff --git a/docs/reference/cli/index.md b/docs/reference/cli/index.md index 525cb8ac7d183..71a1a2b4e2c68 100644 --- a/docs/reference/cli/index.md +++ b/docs/reference/cli/index.md @@ -1,5 +1,4 @@ - # coder ## Usage @@ -24,7 +23,7 @@ Coder — A tool for provisioning self-hosted development environments with Terr ## Subcommands | Name | Purpose | -| -------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +|----------------------------------------------------|-------------------------------------------------------------------------------------------------------| | [completion](./completion.md) | Install or update shell completion scripts for the detected or chosen shell. | | [dotfiles](./dotfiles.md) | Personalize your workspace by applying a canonical dotfiles repository | | [external-auth](./external-auth.md) | Manage external authentication | @@ -73,7 +72,7 @@ Coder — A tool for provisioning self-hosted development environments with Terr ### --url | | | -| ----------- | ----------------------- | +|-------------|-------------------------| | Type | url | | Environment | $CODER_URL | @@ -82,7 +81,7 @@ URL to a deployment. ### --debug-options | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Print all options, how they're set, then exit. @@ -90,7 +89,7 @@ Print all options, how they're set, then exit. ### --token | | | -| ----------- | --------------------------------- | +|-------------|-----------------------------------| | Type | string | | Environment | $CODER_SESSION_TOKEN | @@ -99,7 +98,7 @@ Specify an authentication token. For security reasons setting CODER_SESSION_TOKE ### --no-version-warning | | | -| ----------- | -------------------------------------- | +|-------------|----------------------------------------| | Type | bool | | Environment | $CODER_NO_VERSION_WARNING | @@ -108,7 +107,7 @@ Suppress warning when client and server versions do not match. ### --no-feature-warning | | | -| ----------- | -------------------------------------- | +|-------------|----------------------------------------| | Type | bool | | Environment | $CODER_NO_FEATURE_WARNING | @@ -117,7 +116,7 @@ Suppress warnings about unlicensed features. ### --header | | | -| ----------- | -------------------------- | +|-------------|----------------------------| | Type | string-array | | Environment | $CODER_HEADER | @@ -126,7 +125,7 @@ Additional HTTP headers added to all requests. Provide as key=value. Can be spec ### --header-command | | | -| ----------- | ---------------------------------- | +|-------------|------------------------------------| | Type | string | | Environment | $CODER_HEADER_COMMAND | @@ -135,7 +134,7 @@ An external command that outputs additional HTTP headers added to all requests. ### -v, --verbose | | | -| ----------- | --------------------------- | +|-------------|-----------------------------| | Type | bool | | Environment | $CODER_VERBOSE | @@ -144,7 +143,7 @@ Enable verbose output. ### --disable-direct-connections | | | -| ----------- | ---------------------------------------------- | +|-------------|------------------------------------------------| | Type | bool | | Environment | $CODER_DISABLE_DIRECT_CONNECTIONS | @@ -153,7 +152,7 @@ Disable direct (P2P) connections to workspaces. ### --disable-network-telemetry | | | -| ----------- | --------------------------------------------- | +|-------------|-----------------------------------------------| | Type | bool | | Environment | $CODER_DISABLE_NETWORK_TELEMETRY | @@ -162,7 +161,7 @@ Disable network telemetry. Network telemetry is collected when connecting to wor ### --global-config | | | -| ----------- | ------------------------------ | +|-------------|--------------------------------| | Type | string | | Environment | $CODER_CONFIG_DIR | | Default | ~/.config/coderv2 | diff --git a/docs/reference/cli/licenses.md b/docs/reference/cli/licenses.md index 63e337afb259d..8e71f01aba8c6 100644 --- a/docs/reference/cli/licenses.md +++ b/docs/reference/cli/licenses.md @@ -1,12 +1,11 @@ - # licenses Add, delete, and list licenses Aliases: -- license +* license ## Usage @@ -17,7 +16,7 @@ coder licenses ## Subcommands | Name | Purpose | -| ------------------------------------------- | --------------------------------- | +|---------------------------------------------|-----------------------------------| | [add](./licenses_add.md) | Add license to Coder deployment | | [list](./licenses_list.md) | List licenses (including expired) | | [delete](./licenses_delete.md) | Delete license by ID | diff --git a/docs/reference/cli/licenses_add.md b/docs/reference/cli/licenses_add.md index f3d9f201ed099..5562f5f49b365 100644 --- a/docs/reference/cli/licenses_add.md +++ b/docs/reference/cli/licenses_add.md @@ -1,5 +1,4 @@ - # licenses add Add license to Coder deployment @@ -15,7 +14,7 @@ coder licenses add [flags] [-f file | -l license] ### -f, --file | | | -| ---- | ------------------- | +|------|---------------------| | Type | string | Load license from file. @@ -23,7 +22,7 @@ Load license from file. ### -l, --license | | | -| ---- | ------------------- | +|------|---------------------| | Type | string | License string. @@ -31,7 +30,7 @@ License string. ### --debug | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Output license claims for debugging. diff --git a/docs/reference/cli/licenses_delete.md b/docs/reference/cli/licenses_delete.md index 8cf95894d5815..9a24e520e6584 100644 --- a/docs/reference/cli/licenses_delete.md +++ b/docs/reference/cli/licenses_delete.md @@ -1,13 +1,12 @@ - # licenses delete Delete license by ID Aliases: -- del -- rm +* del +* rm ## Usage diff --git a/docs/reference/cli/licenses_list.md b/docs/reference/cli/licenses_list.md index a888c44331546..17311df2d6da2 100644 --- a/docs/reference/cli/licenses_list.md +++ b/docs/reference/cli/licenses_list.md @@ -1,12 +1,11 @@ - # licenses list List licenses (including expired) Aliases: -- ls +* ls ## Usage @@ -19,7 +18,7 @@ coder licenses list [flags] ### -c, --column | | | -| ------- | ----------------------------------------------------------------- | +|---------|-------------------------------------------------------------------| | Type | [id\|uuid\|uploaded at\|features\|expires at\|trial] | | Default | ID,UUID,Expires At,Uploaded At,Features | @@ -28,7 +27,7 @@ Columns to display in table output. ### -o, --output | | | -| ------- | ------------------------ | +|---------|--------------------------| | Type | table\|json | | Default | table | diff --git a/docs/reference/cli/list.md b/docs/reference/cli/list.md index e9e82988c0af8..5911785b87fc1 100644 --- a/docs/reference/cli/list.md +++ b/docs/reference/cli/list.md @@ -1,12 +1,11 @@ - # list List workspaces Aliases: -- ls +* ls ## Usage @@ -19,7 +18,7 @@ coder list [flags] ### -a, --all | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Specifies whether all workspaces will be listed or not. @@ -27,7 +26,7 @@ Specifies whether all workspaces will be listed or not. ### --search | | | -| ------- | --------------------- | +|---------|-----------------------| | Type | string | | Default | owner:me | @@ -36,7 +35,7 @@ Search for a workspace with a query. ### -c, --column | | | -| ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | Type | [favorite\|workspace\|organization id\|organization name\|template\|status\|healthy\|last built\|current version\|outdated\|starts at\|starts next\|stops after\|stops next\|daily cost] | | Default | workspace,template,status,healthy,last built,current version,outdated,starts at,stops after | @@ -45,7 +44,7 @@ Columns to display in table output. ### -o, --output | | | -| ------- | ------------------------ | +|---------|--------------------------| | Type | table\|json | | Default | table | diff --git a/docs/reference/cli/login.md b/docs/reference/cli/login.md index 9a27e4a6357c8..a35038fedef8c 100644 --- a/docs/reference/cli/login.md +++ b/docs/reference/cli/login.md @@ -1,5 +1,4 @@ - # login Authenticate with Coder deployment @@ -15,7 +14,7 @@ coder login [flags] [] ### --first-user-email | | | -| ----------- | ------------------------------------ | +|-------------|--------------------------------------| | Type | string | | Environment | $CODER_FIRST_USER_EMAIL | @@ -24,7 +23,7 @@ Specifies an email address to use if creating the first user for the deployment. ### --first-user-username | | | -| ----------- | --------------------------------------- | +|-------------|-----------------------------------------| | Type | string | | Environment | $CODER_FIRST_USER_USERNAME | @@ -33,7 +32,7 @@ Specifies a username to use if creating the first user for the deployment. ### --first-user-full-name | | | -| ----------- | ---------------------------------------- | +|-------------|------------------------------------------| | Type | string | | Environment | $CODER_FIRST_USER_FULL_NAME | @@ -42,7 +41,7 @@ Specifies a human-readable name for the first user of the deployment. ### --first-user-password | | | -| ----------- | --------------------------------------- | +|-------------|-----------------------------------------| | Type | string | | Environment | $CODER_FIRST_USER_PASSWORD | @@ -51,7 +50,7 @@ Specifies a password to use if creating the first user for the deployment. ### --first-user-trial | | | -| ----------- | ------------------------------------ | +|-------------|--------------------------------------| | Type | bool | | Environment | $CODER_FIRST_USER_TRIAL | @@ -60,7 +59,7 @@ Specifies whether a trial license should be provisioned for the Coder deployment ### --use-token-as-session | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | By default, the CLI will generate a new session token when logging in. This flag will instead use the provided token as the session token. diff --git a/docs/reference/cli/logout.md b/docs/reference/cli/logout.md index 255c474054243..b35369ee36448 100644 --- a/docs/reference/cli/logout.md +++ b/docs/reference/cli/logout.md @@ -1,5 +1,4 @@ - # logout Unauthenticate your local session @@ -15,7 +14,7 @@ coder logout [flags] ### -y, --yes | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Bypass prompts. diff --git a/docs/reference/cli/netcheck.md b/docs/reference/cli/netcheck.md index 0d70bc3a76642..219f6fa16b762 100644 --- a/docs/reference/cli/netcheck.md +++ b/docs/reference/cli/netcheck.md @@ -1,5 +1,4 @@ - # netcheck Print network debug information for DERP and STUN diff --git a/docs/reference/cli/notifications.md b/docs/reference/cli/notifications.md index 59e74b4324357..169776876e315 100644 --- a/docs/reference/cli/notifications.md +++ b/docs/reference/cli/notifications.md @@ -1,12 +1,11 @@ - # notifications Manage Coder notifications Aliases: -- notification +* notification ## Usage @@ -32,6 +31,6 @@ server or Webhook not responding).: ## Subcommands | Name | Purpose | -| ------------------------------------------------ | -------------------- | +|--------------------------------------------------|----------------------| | [pause](./notifications_pause.md) | Pause notifications | | [resume](./notifications_resume.md) | Resume notifications | diff --git a/docs/reference/cli/notifications_pause.md b/docs/reference/cli/notifications_pause.md index 0cb2b101d474c..5bac0c2f9e05b 100644 --- a/docs/reference/cli/notifications_pause.md +++ b/docs/reference/cli/notifications_pause.md @@ -1,5 +1,4 @@ - # notifications pause Pause notifications diff --git a/docs/reference/cli/notifications_resume.md b/docs/reference/cli/notifications_resume.md index a8dc17453a383..79ec60ba543ff 100644 --- a/docs/reference/cli/notifications_resume.md +++ b/docs/reference/cli/notifications_resume.md @@ -1,5 +1,4 @@ - # notifications resume Resume notifications diff --git a/docs/reference/cli/open.md b/docs/reference/cli/open.md index 8b5f5beef4c03..e19bdaeba884d 100644 --- a/docs/reference/cli/open.md +++ b/docs/reference/cli/open.md @@ -1,5 +1,4 @@ - # open Open a workspace @@ -13,5 +12,5 @@ coder open ## Subcommands | Name | Purpose | -| --------------------------------------- | ----------------------------------- | +|-----------------------------------------|-------------------------------------| | [vscode](./open_vscode.md) | Open a workspace in VS Code Desktop | diff --git a/docs/reference/cli/open_vscode.md b/docs/reference/cli/open_vscode.md index 23e4d85d604b6..2b1e80dfbe5b7 100644 --- a/docs/reference/cli/open_vscode.md +++ b/docs/reference/cli/open_vscode.md @@ -1,5 +1,4 @@ - # open vscode Open a workspace in VS Code Desktop @@ -15,7 +14,7 @@ coder open vscode [flags] [] ### --generate-token | | | -| ----------- | ---------------------------------------------- | +|-------------|------------------------------------------------| | Type | bool | | Environment | $CODER_OPEN_VSCODE_GENERATE_TOKEN | diff --git a/docs/reference/cli/organizations.md b/docs/reference/cli/organizations.md index 1fbd076425ace..c2d4497173103 100644 --- a/docs/reference/cli/organizations.md +++ b/docs/reference/cli/organizations.md @@ -1,14 +1,13 @@ - # organizations Organization related commands Aliases: -- organization -- org -- orgs +* organization +* org +* orgs ## Usage @@ -19,7 +18,7 @@ coder organizations [flags] [subcommand] ## Subcommands | Name | Purpose | -| ---------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------| | [show](./organizations_show.md) | Show the organization. Using "selected" will show the selected organization from the "--org" flag. Using "me" will show all organizations you are a member of. | | [create](./organizations_create.md) | Create a new organization. | | [members](./organizations_members.md) | Manage organization members | @@ -31,7 +30,7 @@ coder organizations [flags] [subcommand] ### -O, --org | | | -| ----------- | -------------------------------- | +|-------------|----------------------------------| | Type | string | | Environment | $CODER_ORGANIZATION | diff --git a/docs/reference/cli/organizations_create.md b/docs/reference/cli/organizations_create.md index 416a1306456e2..14f40f55e00d1 100644 --- a/docs/reference/cli/organizations_create.md +++ b/docs/reference/cli/organizations_create.md @@ -1,5 +1,4 @@ - # organizations create Create a new organization. @@ -15,7 +14,7 @@ coder organizations create [flags] ### -y, --yes | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Bypass prompts. diff --git a/docs/reference/cli/organizations_members.md b/docs/reference/cli/organizations_members.md index 49d29ace004a8..b71372f13bdd9 100644 --- a/docs/reference/cli/organizations_members.md +++ b/docs/reference/cli/organizations_members.md @@ -1,12 +1,11 @@ - # organizations members Manage organization members Aliases: -- member +* member ## Usage @@ -17,7 +16,7 @@ coder organizations members ## Subcommands | Name | Purpose | -| ---------------------------------------------------------------- | ----------------------------------------------- | +|------------------------------------------------------------------|-------------------------------------------------| | [list](./organizations_members_list.md) | List all organization members | | [edit-roles](./organizations_members_edit-roles.md) | Edit organization member's roles | | [add](./organizations_members_add.md) | Add a new member to the current organization | diff --git a/docs/reference/cli/organizations_members_add.md b/docs/reference/cli/organizations_members_add.md index b912a7ab56545..57481f02dd859 100644 --- a/docs/reference/cli/organizations_members_add.md +++ b/docs/reference/cli/organizations_members_add.md @@ -1,5 +1,4 @@ - # organizations members add Add a new member to the current organization diff --git a/docs/reference/cli/organizations_members_edit-roles.md b/docs/reference/cli/organizations_members_edit-roles.md index 3bd9d2066f5cf..0d4a21a379e11 100644 --- a/docs/reference/cli/organizations_members_edit-roles.md +++ b/docs/reference/cli/organizations_members_edit-roles.md @@ -1,12 +1,11 @@ - # organizations members edit-roles Edit organization member's roles Aliases: -- edit-role +* edit-role ## Usage diff --git a/docs/reference/cli/organizations_members_list.md b/docs/reference/cli/organizations_members_list.md index 9a0a5d3fa0640..270fb1d49e945 100644 --- a/docs/reference/cli/organizations_members_list.md +++ b/docs/reference/cli/organizations_members_list.md @@ -1,5 +1,4 @@ - # organizations members list List all organization members @@ -15,7 +14,7 @@ coder organizations members list [flags] ### -c, --column | | | -| ------- | --------------------------------------------------------------------------------------------------- | +|---------|-----------------------------------------------------------------------------------------------------| | Type | [username\|name\|user id\|organization id\|created at\|updated at\|organization roles] | | Default | username,organization roles | @@ -24,7 +23,7 @@ Columns to display in table output. ### -o, --output | | | -| ------- | ------------------------ | +|---------|--------------------------| | Type | table\|json | | Default | table | diff --git a/docs/reference/cli/organizations_members_remove.md b/docs/reference/cli/organizations_members_remove.md index f36ea00b3ed48..9b6e29416557b 100644 --- a/docs/reference/cli/organizations_members_remove.md +++ b/docs/reference/cli/organizations_members_remove.md @@ -1,12 +1,11 @@ - # organizations members remove Remove a new member to the current organization Aliases: -- rm +* rm ## Usage diff --git a/docs/reference/cli/organizations_roles.md b/docs/reference/cli/organizations_roles.md index 536e6abe89c10..19b6271dcbf9c 100644 --- a/docs/reference/cli/organizations_roles.md +++ b/docs/reference/cli/organizations_roles.md @@ -1,12 +1,11 @@ - # organizations roles Manage organization roles. Aliases: -- role +* role ## Usage @@ -17,6 +16,6 @@ coder organizations roles ## Subcommands | Name | Purpose | -| -------------------------------------------------- | -------------------------------- | +|----------------------------------------------------|----------------------------------| | [show](./organizations_roles_show.md) | Show role(s) | | [edit](./organizations_roles_edit.md) | Edit an organization custom role | diff --git a/docs/reference/cli/organizations_roles_edit.md b/docs/reference/cli/organizations_roles_edit.md index 04fc8522a21ef..988f8c0eee1b2 100644 --- a/docs/reference/cli/organizations_roles_edit.md +++ b/docs/reference/cli/organizations_roles_edit.md @@ -1,5 +1,4 @@ - # organizations roles edit Edit an organization custom role @@ -23,7 +22,7 @@ coder organizations roles edit [flags] ### -y, --yes | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Bypass prompts. @@ -31,7 +30,7 @@ Bypass prompts. ### --dry-run | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Does all the work, but does not submit the final updated role. @@ -39,7 +38,7 @@ Does all the work, but does not submit the final updated role. ### --stdin | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Reads stdin for the json role definition to upload. @@ -47,7 +46,7 @@ Reads stdin for the json role definition to upload. ### -c, --column | | | -| ------- | ---------------------------------------------------------------------------------------------------------------- | +|---------|------------------------------------------------------------------------------------------------------------------| | Type | [name\|display name\|organization id\|site permissions\|organization permissions\|user permissions] | | Default | name,display name,site permissions,organization permissions,user permissions | @@ -56,7 +55,7 @@ Columns to display in table output. ### -o, --output | | | -| ------- | ------------------------ | +|---------|--------------------------| | Type | table\|json | | Default | table | diff --git a/docs/reference/cli/organizations_roles_show.md b/docs/reference/cli/organizations_roles_show.md index 2d75ae74d4576..1d5653839e756 100644 --- a/docs/reference/cli/organizations_roles_show.md +++ b/docs/reference/cli/organizations_roles_show.md @@ -1,5 +1,4 @@ - # organizations roles show Show role(s) @@ -15,7 +14,7 @@ coder organizations roles show [flags] [role_names ...] ### -c, --column | | | -| ------- | ---------------------------------------------------------------------------------------------------------------- | +|---------|------------------------------------------------------------------------------------------------------------------| | Type | [name\|display name\|organization id\|site permissions\|organization permissions\|user permissions] | | Default | name,display name,site permissions,organization permissions,user permissions | @@ -24,7 +23,7 @@ Columns to display in table output. ### -o, --output | | | -| ------- | ------------------------ | +|---------|--------------------------| | Type | table\|json | | Default | table | diff --git a/docs/reference/cli/organizations_settings.md b/docs/reference/cli/organizations_settings.md index 15093c984fedc..76a84135edb07 100644 --- a/docs/reference/cli/organizations_settings.md +++ b/docs/reference/cli/organizations_settings.md @@ -1,12 +1,11 @@ - # organizations settings Manage organization settings. Aliases: -- setting +* setting ## Usage @@ -17,6 +16,6 @@ coder organizations settings ## Subcommands | Name | Purpose | -| ----------------------------------------------------- | --------------------------------------- | +|-------------------------------------------------------|-----------------------------------------| | [show](./organizations_settings_show.md) | Outputs specified organization setting. | | [set](./organizations_settings_set.md) | Update specified organization setting. | diff --git a/docs/reference/cli/organizations_settings_set.md b/docs/reference/cli/organizations_settings_set.md index e1e9bf0261a1b..c7d0fd8f138e3 100644 --- a/docs/reference/cli/organizations_settings_set.md +++ b/docs/reference/cli/organizations_settings_set.md @@ -1,5 +1,4 @@ - # organizations settings set Update specified organization setting. @@ -21,7 +20,7 @@ coder organizations settings set ## Subcommands | Name | Purpose | -| ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------ | +|-------------------------------------------------------------------------------------|--------------------------------------------------------------------------| | [group-sync](./organizations_settings_set_group-sync.md) | Group sync settings to sync groups from an IdP. | | [role-sync](./organizations_settings_set_role-sync.md) | Role sync settings to sync organization roles from an IdP. | | [organization-sync](./organizations_settings_set_organization-sync.md) | Organization sync settings to sync organization memberships from an IdP. | diff --git a/docs/reference/cli/organizations_settings_set_group-sync.md b/docs/reference/cli/organizations_settings_set_group-sync.md index f60a456771763..ceefa22a523c2 100644 --- a/docs/reference/cli/organizations_settings_set_group-sync.md +++ b/docs/reference/cli/organizations_settings_set_group-sync.md @@ -1,12 +1,11 @@ - # organizations settings set group-sync Group sync settings to sync groups from an IdP. Aliases: -- groupsync +* groupsync ## Usage diff --git a/docs/reference/cli/organizations_settings_set_organization-sync.md b/docs/reference/cli/organizations_settings_set_organization-sync.md index 6b6557e2c3358..8580c6cef3767 100644 --- a/docs/reference/cli/organizations_settings_set_organization-sync.md +++ b/docs/reference/cli/organizations_settings_set_organization-sync.md @@ -1,14 +1,13 @@ - # organizations settings set organization-sync Organization sync settings to sync organization memberships from an IdP. Aliases: -- organizationsync -- org-sync -- orgsync +* organizationsync +* org-sync +* orgsync ## Usage diff --git a/docs/reference/cli/organizations_settings_set_role-sync.md b/docs/reference/cli/organizations_settings_set_role-sync.md index 40203b21f752e..01d46319f54a9 100644 --- a/docs/reference/cli/organizations_settings_set_role-sync.md +++ b/docs/reference/cli/organizations_settings_set_role-sync.md @@ -1,12 +1,11 @@ - # organizations settings set role-sync Role sync settings to sync organization roles from an IdP. Aliases: -- rolesync +* rolesync ## Usage diff --git a/docs/reference/cli/organizations_settings_show.md b/docs/reference/cli/organizations_settings_show.md index feaef7d0124f9..90dc642745707 100644 --- a/docs/reference/cli/organizations_settings_show.md +++ b/docs/reference/cli/organizations_settings_show.md @@ -1,5 +1,4 @@ - # organizations settings show Outputs specified organization setting. @@ -21,7 +20,7 @@ coder organizations settings show ## Subcommands | Name | Purpose | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +|--------------------------------------------------------------------------------------|--------------------------------------------------------------------------| | [group-sync](./organizations_settings_show_group-sync.md) | Group sync settings to sync groups from an IdP. | | [role-sync](./organizations_settings_show_role-sync.md) | Role sync settings to sync organization roles from an IdP. | | [organization-sync](./organizations_settings_show_organization-sync.md) | Organization sync settings to sync organization memberships from an IdP. | diff --git a/docs/reference/cli/organizations_settings_show_group-sync.md b/docs/reference/cli/organizations_settings_show_group-sync.md index 6ae796d117e61..75a4398f88bce 100644 --- a/docs/reference/cli/organizations_settings_show_group-sync.md +++ b/docs/reference/cli/organizations_settings_show_group-sync.md @@ -1,12 +1,11 @@ - # organizations settings show group-sync Group sync settings to sync groups from an IdP. Aliases: -- groupsync +* groupsync ## Usage diff --git a/docs/reference/cli/organizations_settings_show_organization-sync.md b/docs/reference/cli/organizations_settings_show_organization-sync.md index 7e2e025c2a4af..2054aa29b4cdb 100644 --- a/docs/reference/cli/organizations_settings_show_organization-sync.md +++ b/docs/reference/cli/organizations_settings_show_organization-sync.md @@ -1,14 +1,13 @@ - # organizations settings show organization-sync Organization sync settings to sync organization memberships from an IdP. Aliases: -- organizationsync -- org-sync -- orgsync +* organizationsync +* org-sync +* orgsync ## Usage diff --git a/docs/reference/cli/organizations_settings_show_role-sync.md b/docs/reference/cli/organizations_settings_show_role-sync.md index 8a32c138517d1..6fe2fd40a951c 100644 --- a/docs/reference/cli/organizations_settings_show_role-sync.md +++ b/docs/reference/cli/organizations_settings_show_role-sync.md @@ -1,12 +1,11 @@ - # organizations settings show role-sync Role sync settings to sync organization roles from an IdP. Aliases: -- rolesync +* rolesync ## Usage diff --git a/docs/reference/cli/organizations_show.md b/docs/reference/cli/organizations_show.md index 0cd111e9da0eb..540014b46802d 100644 --- a/docs/reference/cli/organizations_show.md +++ b/docs/reference/cli/organizations_show.md @@ -1,5 +1,4 @@ - # organizations show Show the organization. Using "selected" will show the selected organization from the "--org" flag. Using "me" will show all organizations you are a member of. @@ -35,7 +34,7 @@ coder organizations show [flags] ["selected"|"me"|uuid|org_name] ### --only-id | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Only print the organization ID. @@ -43,7 +42,7 @@ Only print the organization ID. ### -c, --column | | | -| ------- | ----------------------------------------------------------------------------------------- | +|---------|-------------------------------------------------------------------------------------------| | Type | [id\|name\|display name\|icon\|description\|created at\|updated at\|default] | | Default | id,name,default | @@ -52,7 +51,7 @@ Columns to display in table output. ### -o, --output | | | -| ------- | ------------------------------ | +|---------|--------------------------------| | Type | text\|table\|json | | Default | text | diff --git a/docs/reference/cli/ping.md b/docs/reference/cli/ping.md index c8d63addcf8d7..8fbc1eaf36e8e 100644 --- a/docs/reference/cli/ping.md +++ b/docs/reference/cli/ping.md @@ -1,5 +1,4 @@ - # ping Ping a workspace @@ -15,7 +14,7 @@ coder ping [flags] ### --wait | | | -| ------- | --------------------- | +|---------|-----------------------| | Type | duration | | Default | 1s | @@ -24,7 +23,7 @@ Specifies how long to wait between pings. ### -t, --timeout | | | -| ------- | --------------------- | +|---------|-----------------------| | Type | duration | | Default | 5s | @@ -33,7 +32,7 @@ Specifies how long to wait for a ping to complete. ### -n, --num | | | -| ---- | ---------------- | +|------|------------------| | Type | int | Specifies the number of pings to perform. By default, pings will continue until interrupted. diff --git a/docs/reference/cli/port-forward.md b/docs/reference/cli/port-forward.md index f279e2125d93b..976b830fca360 100644 --- a/docs/reference/cli/port-forward.md +++ b/docs/reference/cli/port-forward.md @@ -1,12 +1,11 @@ - # port-forward Forward ports from a workspace to the local machine. For reverse port forwarding, use "coder ssh -R". Aliases: -- tunnel +* tunnel ## Usage @@ -45,7 +44,7 @@ machine: ### -p, --tcp | | | -| ----------- | ------------------------------------ | +|-------------|--------------------------------------| | Type | string-array | | Environment | $CODER_PORT_FORWARD_TCP | @@ -54,7 +53,7 @@ Forward TCP port(s) from the workspace to the local machine. ### --udp | | | -| ----------- | ------------------------------------ | +|-------------|--------------------------------------| | Type | string-array | | Environment | $CODER_PORT_FORWARD_UDP | @@ -63,7 +62,7 @@ Forward UDP port(s) from the workspace to the local machine. The UDP connection ### --disable-autostart | | | -| ----------- | ----------------------------------------- | +|-------------|-------------------------------------------| | Type | bool | | Environment | $CODER_SSH_DISABLE_AUTOSTART | | Default | false | diff --git a/docs/reference/cli/provisioner.md b/docs/reference/cli/provisioner.md index 54cc28a84bea4..08f4918ec1cf0 100644 --- a/docs/reference/cli/provisioner.md +++ b/docs/reference/cli/provisioner.md @@ -1,12 +1,11 @@ - # provisioner Manage provisioner daemons Aliases: -- provisioners +* provisioners ## Usage @@ -17,6 +16,6 @@ coder provisioner ## Subcommands | Name | Purpose | -| -------------------------------------------- | ------------------------ | +|----------------------------------------------|--------------------------| | [start](./provisioner_start.md) | Run a provisioner daemon | | [keys](./provisioner_keys.md) | Manage provisioner keys | diff --git a/docs/reference/cli/provisioner_keys.md b/docs/reference/cli/provisioner_keys.md index 014af6f117c3a..80cfd8f0a31b8 100644 --- a/docs/reference/cli/provisioner_keys.md +++ b/docs/reference/cli/provisioner_keys.md @@ -1,12 +1,11 @@ - # provisioner keys Manage provisioner keys Aliases: -- key +* key ## Usage @@ -17,7 +16,7 @@ coder provisioner keys ## Subcommands | Name | Purpose | -| --------------------------------------------------- | ---------------------------------------- | +|-----------------------------------------------------|------------------------------------------| | [create](./provisioner_keys_create.md) | Create a new provisioner key | | [list](./provisioner_keys_list.md) | List provisioner keys in an organization | | [delete](./provisioner_keys_delete.md) | Delete a provisioner key | diff --git a/docs/reference/cli/provisioner_keys_create.md b/docs/reference/cli/provisioner_keys_create.md index da6479d15bfc9..737ba187c9c27 100644 --- a/docs/reference/cli/provisioner_keys_create.md +++ b/docs/reference/cli/provisioner_keys_create.md @@ -1,5 +1,4 @@ - # provisioner keys create Create a new provisioner key @@ -15,7 +14,7 @@ coder provisioner keys create [flags] ### -t, --tag | | | -| ----------- | ------------------------------------- | +|-------------|---------------------------------------| | Type | string-array | | Environment | $CODER_PROVISIONERD_TAGS | @@ -24,7 +23,7 @@ Tags to filter provisioner jobs by. ### -O, --org | | | -| ----------- | -------------------------------- | +|-------------|----------------------------------| | Type | string | | Environment | $CODER_ORGANIZATION | diff --git a/docs/reference/cli/provisioner_keys_delete.md b/docs/reference/cli/provisioner_keys_delete.md index 56e32e57d048b..4303491106716 100644 --- a/docs/reference/cli/provisioner_keys_delete.md +++ b/docs/reference/cli/provisioner_keys_delete.md @@ -1,12 +1,11 @@ - # provisioner keys delete Delete a provisioner key Aliases: -- rm +* rm ## Usage @@ -19,7 +18,7 @@ coder provisioner keys delete [flags] ### -y, --yes | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Bypass prompts. @@ -27,7 +26,7 @@ Bypass prompts. ### -O, --org | | | -| ----------- | -------------------------------- | +|-------------|----------------------------------| | Type | string | | Environment | $CODER_ORGANIZATION | diff --git a/docs/reference/cli/provisioner_keys_list.md b/docs/reference/cli/provisioner_keys_list.md index 366db05fa490f..61e00dde759a9 100644 --- a/docs/reference/cli/provisioner_keys_list.md +++ b/docs/reference/cli/provisioner_keys_list.md @@ -1,12 +1,11 @@ - # provisioner keys list List provisioner keys in an organization Aliases: -- ls +* ls ## Usage @@ -19,7 +18,7 @@ coder provisioner keys list [flags] ### -O, --org | | | -| ----------- | -------------------------------- | +|-------------|----------------------------------| | Type | string | | Environment | $CODER_ORGANIZATION | diff --git a/docs/reference/cli/provisioner_start.md b/docs/reference/cli/provisioner_start.md index 65254d18c0149..2a3c88ff93139 100644 --- a/docs/reference/cli/provisioner_start.md +++ b/docs/reference/cli/provisioner_start.md @@ -1,5 +1,4 @@ - # provisioner start Run a provisioner daemon @@ -15,7 +14,7 @@ coder provisioner start [flags] ### -c, --cache-dir | | | -| ----------- | ----------------------------------- | +|-------------|-------------------------------------| | Type | string | | Environment | $CODER_CACHE_DIRECTORY | | Default | ~/.cache/coder | @@ -25,7 +24,7 @@ Directory to store cached data. ### -t, --tag | | | -| ----------- | ------------------------------------- | +|-------------|---------------------------------------| | Type | string-array | | Environment | $CODER_PROVISIONERD_TAGS | @@ -34,7 +33,7 @@ Tags to filter provisioner jobs by. ### --poll-interval | | | -| ----------- | ---------------------------------------------- | +|-------------|------------------------------------------------| | Type | duration | | Environment | $CODER_PROVISIONERD_POLL_INTERVAL | | Default | 1s | @@ -44,7 +43,7 @@ Deprecated and ignored. ### --poll-jitter | | | -| ----------- | -------------------------------------------- | +|-------------|----------------------------------------------| | Type | duration | | Environment | $CODER_PROVISIONERD_POLL_JITTER | | Default | 100ms | @@ -54,7 +53,7 @@ Deprecated and ignored. ### --psk | | | -| ----------- | ------------------------------------------ | +|-------------|--------------------------------------------| | Type | string | | Environment | $CODER_PROVISIONER_DAEMON_PSK | @@ -63,7 +62,7 @@ Pre-shared key to authenticate with Coder server. ### --key | | | -| ----------- | ------------------------------------------ | +|-------------|--------------------------------------------| | Type | string | | Environment | $CODER_PROVISIONER_DAEMON_KEY | @@ -72,7 +71,7 @@ Provisioner key to authenticate with Coder server. ### --name | | | -| ----------- | ------------------------------------------- | +|-------------|---------------------------------------------| | Type | string | | Environment | $CODER_PROVISIONER_DAEMON_NAME | @@ -81,7 +80,7 @@ Name of this provisioner daemon. Defaults to the current hostname without FQDN. ### --verbose | | | -| ----------- | ---------------------------------------------- | +|-------------|------------------------------------------------| | Type | bool | | Environment | $CODER_PROVISIONER_DAEMON_VERBOSE | | Default | false | @@ -91,7 +90,7 @@ Output debug-level logs. ### --log-human | | | -| ----------- | ---------------------------------------------------- | +|-------------|------------------------------------------------------| | Type | string | | Environment | $CODER_PROVISIONER_DAEMON_LOGGING_HUMAN | | Default | /dev/stderr | @@ -101,7 +100,7 @@ Output human-readable logs to a given file. ### --log-json | | | -| ----------- | --------------------------------------------------- | +|-------------|-----------------------------------------------------| | Type | string | | Environment | $CODER_PROVISIONER_DAEMON_LOGGING_JSON | @@ -110,7 +109,7 @@ Output JSON logs to a given file. ### --log-stackdriver | | | -| ----------- | ---------------------------------------------------------- | +|-------------|------------------------------------------------------------| | Type | string | | Environment | $CODER_PROVISIONER_DAEMON_LOGGING_STACKDRIVER | @@ -119,16 +118,16 @@ Output Stackdriver compatible logs to a given file. ### --log-filter | | | -| ----------- | ------------------------------------------------- | +|-------------|---------------------------------------------------| | Type | string-array | | Environment | $CODER_PROVISIONER_DAEMON_LOG_FILTER | -Filter debug logs by matching against a given regex. Use .\* to match all debug logs. +Filter debug logs by matching against a given regex. Use .* to match all debug logs. ### --prometheus-enable | | | -| ----------- | ------------------------------------- | +|-------------|---------------------------------------| | Type | bool | | Environment | $CODER_PROMETHEUS_ENABLE | | Default | false | @@ -138,7 +137,7 @@ Serve prometheus metrics on the address defined by prometheus address. ### --prometheus-address | | | -| ----------- | -------------------------------------- | +|-------------|----------------------------------------| | Type | string | | Environment | $CODER_PROMETHEUS_ADDRESS | | Default | 127.0.0.1:2112 | @@ -148,7 +147,7 @@ The bind address to serve prometheus metrics. ### -O, --org | | | -| ----------- | -------------------------------- | +|-------------|----------------------------------| | Type | string | | Environment | $CODER_ORGANIZATION | diff --git a/docs/reference/cli/publickey.md b/docs/reference/cli/publickey.md index 63e19e7e54423..ec68d813b137b 100644 --- a/docs/reference/cli/publickey.md +++ b/docs/reference/cli/publickey.md @@ -1,12 +1,11 @@ - # publickey Output your Coder public key used for Git operations Aliases: -- pubkey +* pubkey ## Usage @@ -19,7 +18,7 @@ coder publickey [flags] ### --reset | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Regenerate your public key. This will require updating the key on any services it's registered with. @@ -27,7 +26,7 @@ Regenerate your public key. This will require updating the key on any services i ### -y, --yes | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Bypass prompts. diff --git a/docs/reference/cli/rename.md b/docs/reference/cli/rename.md index 5cb9242beba38..511ccc60f8d3b 100644 --- a/docs/reference/cli/rename.md +++ b/docs/reference/cli/rename.md @@ -1,5 +1,4 @@ - # rename Rename a workspace @@ -15,7 +14,7 @@ coder rename [flags] ### -y, --yes | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Bypass prompts. diff --git a/docs/reference/cli/reset-password.md b/docs/reference/cli/reset-password.md index 2d63226f02d26..ada9ad7e7db3e 100644 --- a/docs/reference/cli/reset-password.md +++ b/docs/reference/cli/reset-password.md @@ -1,5 +1,4 @@ - # reset-password Directly connect to the database to reset a user's password @@ -15,8 +14,18 @@ coder reset-password [flags] ### --postgres-url | | | -| ----------- | ------------------------------------- | +|-------------|---------------------------------------| | Type | string | | Environment | $CODER_PG_CONNECTION_URL | URL of a PostgreSQL database to connect to. + +### --postgres-connection-auth + +| | | +|-------------|----------------------------------------| +| Type | password\|awsiamrds | +| Environment | $CODER_PG_CONNECTION_AUTH | +| Default | password | + +Type of auth to use when connecting to postgres. diff --git a/docs/reference/cli/restart.md b/docs/reference/cli/restart.md index 3b06efb6e4855..1c30e3e1fffaa 100644 --- a/docs/reference/cli/restart.md +++ b/docs/reference/cli/restart.md @@ -1,5 +1,4 @@ - # restart Restart a workspace @@ -15,7 +14,7 @@ coder restart [flags] ### -y, --yes | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Bypass prompts. @@ -23,7 +22,7 @@ Bypass prompts. ### --build-option | | | -| ----------- | -------------------------------- | +|-------------|----------------------------------| | Type | string-array | | Environment | $CODER_BUILD_OPTION | @@ -32,7 +31,7 @@ Build option value in the format "name=value". ### --build-options | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Prompt for one-time build options defined with ephemeral parameters. @@ -40,7 +39,7 @@ Prompt for one-time build options defined with ephemeral parameters. ### --ephemeral-parameter | | | -| ----------- | --------------------------------------- | +|-------------|-----------------------------------------| | Type | string-array | | Environment | $CODER_EPHEMERAL_PARAMETER | @@ -49,7 +48,7 @@ Set the value of ephemeral parameters defined in the template. The format is "na ### --prompt-ephemeral-parameters | | | -| ----------- | ----------------------------------------------- | +|-------------|-------------------------------------------------| | Type | bool | | Environment | $CODER_PROMPT_EPHEMERAL_PARAMETERS | @@ -58,7 +57,7 @@ Prompt to set values of ephemeral parameters defined in the template. If a value ### --parameter | | | -| ----------- | ---------------------------------- | +|-------------|------------------------------------| | Type | string-array | | Environment | $CODER_RICH_PARAMETER | @@ -67,7 +66,7 @@ Rich parameter value in the format "name=value". ### --rich-parameter-file | | | -| ----------- | --------------------------------------- | +|-------------|-----------------------------------------| | Type | string | | Environment | $CODER_RICH_PARAMETER_FILE | @@ -76,7 +75,7 @@ Specify a file path with values for rich parameters defined in the template. The ### --parameter-default | | | -| ----------- | ------------------------------------------ | +|-------------|--------------------------------------------| | Type | string-array | | Environment | $CODER_RICH_PARAMETER_DEFAULT | @@ -85,7 +84,7 @@ Rich parameter default values in the format "name=value". ### --always-prompt | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Always prompt all parameters. Does not pull parameter values from existing workspace. diff --git a/docs/reference/cli/schedule.md b/docs/reference/cli/schedule.md index 4319f80438af3..c25bd4bf60036 100644 --- a/docs/reference/cli/schedule.md +++ b/docs/reference/cli/schedule.md @@ -1,5 +1,4 @@ - # schedule Schedule automated start and stop times for workspaces @@ -13,7 +12,7 @@ coder schedule { show | start | stop | extend } ## Subcommands | Name | Purpose | -| ------------------------------------------- | --------------------------------------------------------------- | +|---------------------------------------------|-----------------------------------------------------------------| | [show](./schedule_show.md) | Show workspace schedules | | [start](./schedule_start.md) | Edit workspace start schedule | | [stop](./schedule_stop.md) | Edit workspace stop schedule | diff --git a/docs/reference/cli/schedule_extend.md b/docs/reference/cli/schedule_extend.md index 06ba46d358da7..e4b696ad5c4a7 100644 --- a/docs/reference/cli/schedule_extend.md +++ b/docs/reference/cli/schedule_extend.md @@ -1,12 +1,11 @@ - # schedule extend Extend the stop time of a currently running workspace instance. Aliases: -- override-stop +* override-stop ## Usage diff --git a/docs/reference/cli/schedule_show.md b/docs/reference/cli/schedule_show.md index a9f848a242fda..65d858c1fbe38 100644 --- a/docs/reference/cli/schedule_show.md +++ b/docs/reference/cli/schedule_show.md @@ -1,5 +1,4 @@ - # schedule show Show workspace schedules @@ -26,7 +25,7 @@ Shows the following information for the given workspace(s): ### -a, --all | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Specifies whether all workspaces will be listed or not. @@ -34,7 +33,7 @@ Specifies whether all workspaces will be listed or not. ### --search | | | -| ------- | --------------------- | +|---------|-----------------------| | Type | string | | Default | owner:me | @@ -43,7 +42,7 @@ Search for a workspace with a query. ### -c, --column | | | -| ------- | ------------------------------------------------------------------------- | +|---------|---------------------------------------------------------------------------| | Type | [workspace\|starts at\|starts next\|stops after\|stops next] | | Default | workspace,starts at,starts next,stops after,stops next | @@ -52,7 +51,7 @@ Columns to display in table output. ### -o, --output | | | -| ------- | ------------------------ | +|---------|--------------------------| | Type | table\|json | | Default | table | diff --git a/docs/reference/cli/schedule_start.md b/docs/reference/cli/schedule_start.md index 771bb995e65b0..886e5edf1adaf 100644 --- a/docs/reference/cli/schedule_start.md +++ b/docs/reference/cli/schedule_start.md @@ -1,5 +1,4 @@ - # schedule start Edit workspace start schedule diff --git a/docs/reference/cli/schedule_stop.md b/docs/reference/cli/schedule_stop.md index 399bc69cd5fc9..a832c9c919573 100644 --- a/docs/reference/cli/schedule_stop.md +++ b/docs/reference/cli/schedule_stop.md @@ -1,5 +1,4 @@ - # schedule stop Edit workspace stop schedule diff --git a/docs/reference/cli/server.md b/docs/reference/cli/server.md index aa9b0cc0a3196..98cb2a90c20da 100644 --- a/docs/reference/cli/server.md +++ b/docs/reference/cli/server.md @@ -1,5 +1,4 @@ - # server Start a Coder server @@ -13,7 +12,7 @@ coder server [flags] ## Subcommands | Name | Purpose | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | +|---------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------| | [create-admin-user](./server_create-admin-user.md) | Create a new admin user with the given username, email and password and adds it to every organization. | | [postgres-builtin-url](./server_postgres-builtin-url.md) | Output the connection URL for the built-in PostgreSQL deployment. | | [postgres-builtin-serve](./server_postgres-builtin-serve.md) | Run the built-in PostgreSQL deployment. | @@ -24,7 +23,7 @@ coder server [flags] ### --access-url | | | -| ----------- | --------------------------------- | +|-------------|-----------------------------------| | Type | url | | Environment | $CODER_ACCESS_URL | | YAML | networking.accessURL | @@ -34,17 +33,17 @@ The URL that users will use to access the Coder deployment. ### --wildcard-access-url | | | -| ----------- | ----------------------------------------- | +|-------------|-------------------------------------------| | Type | string | | Environment | $CODER_WILDCARD_ACCESS_URL | | YAML | networking.wildcardAccessURL | -Specifies the wildcard hostname to use for workspace applications in the form "\*.example.com". +Specifies the wildcard hostname to use for workspace applications in the form "*.example.com". ### --docs-url | | | -| ----------- | ----------------------------------- | +|-------------|-------------------------------------| | Type | url | | Environment | $CODER_DOCS_URL | | YAML | networking.docsURL | @@ -55,7 +54,7 @@ Specifies the custom docs URL. ### --redirect-to-access-url | | | -| ----------- | ------------------------------------------- | +|-------------|---------------------------------------------| | Type | bool | | Environment | $CODER_REDIRECT_TO_ACCESS_URL | | YAML | networking.redirectToAccessURL | @@ -65,7 +64,7 @@ Specifies whether to redirect requests that do not match the access URL host. ### --http-address | | | -| ----------- | ---------------------------------------- | +|-------------|------------------------------------------| | Type | string | | Environment | $CODER_HTTP_ADDRESS | | YAML | networking.http.httpAddress | @@ -76,7 +75,7 @@ HTTP bind address of the server. Unset to disable the HTTP endpoint. ### --tls-address | | | -| ----------- | ----------------------------------- | +|-------------|-------------------------------------| | Type | host:port | | Environment | $CODER_TLS_ADDRESS | | YAML | networking.tls.address | @@ -87,7 +86,7 @@ HTTPS bind address of the server. ### --tls-enable | | | -| ----------- | ---------------------------------- | +|-------------|------------------------------------| | Type | bool | | Environment | $CODER_TLS_ENABLE | | YAML | networking.tls.enable | @@ -97,7 +96,7 @@ Whether TLS will be enabled. ### --tls-cert-file | | | -| ----------- | ------------------------------------- | +|-------------|---------------------------------------| | Type | string-array | | Environment | $CODER_TLS_CERT_FILE | | YAML | networking.tls.certFiles | @@ -107,7 +106,7 @@ Path to each certificate for TLS. It requires a PEM-encoded file. To configure t ### --tls-client-ca-file | | | -| ----------- | ---------------------------------------- | +|-------------|------------------------------------------| | Type | string | | Environment | $CODER_TLS_CLIENT_CA_FILE | | YAML | networking.tls.clientCAFile | @@ -117,7 +116,7 @@ PEM-encoded Certificate Authority file used for checking the authenticity of cli ### --tls-client-auth | | | -| ----------- | -------------------------------------- | +|-------------|----------------------------------------| | Type | string | | Environment | $CODER_TLS_CLIENT_AUTH | | YAML | networking.tls.clientAuth | @@ -128,7 +127,7 @@ Policy the server will follow for TLS Client Authentication. Accepted values are ### --tls-key-file | | | -| ----------- | ------------------------------------ | +|-------------|--------------------------------------| | Type | string-array | | Environment | $CODER_TLS_KEY_FILE | | YAML | networking.tls.keyFiles | @@ -138,7 +137,7 @@ Paths to the private keys for each of the certificates. It requires a PEM-encode ### --tls-min-version | | | -| ----------- | -------------------------------------- | +|-------------|----------------------------------------| | Type | string | | Environment | $CODER_TLS_MIN_VERSION | | YAML | networking.tls.minVersion | @@ -149,7 +148,7 @@ Minimum supported version of TLS. Accepted values are "tls10", "tls11", "tls12" ### --tls-client-cert-file | | | -| ----------- | ------------------------------------------ | +|-------------|--------------------------------------------| | Type | string | | Environment | $CODER_TLS_CLIENT_CERT_FILE | | YAML | networking.tls.clientCertFile | @@ -159,7 +158,7 @@ Path to certificate for client TLS authentication. It requires a PEM-encoded fil ### --tls-client-key-file | | | -| ----------- | ----------------------------------------- | +|-------------|-------------------------------------------| | Type | string | | Environment | $CODER_TLS_CLIENT_KEY_FILE | | YAML | networking.tls.clientKeyFile | @@ -169,7 +168,7 @@ Path to key for client TLS authentication. It requires a PEM-encoded file. ### --tls-ciphers | | | -| ----------- | -------------------------------------- | +|-------------|----------------------------------------| | Type | string-array | | Environment | $CODER_TLS_CIPHERS | | YAML | networking.tls.tlsCiphers | @@ -179,7 +178,7 @@ Specify specific TLS ciphers that allowed to be used. See https://github.com/gol ### --tls-allow-insecure-ciphers | | | -| ----------- | --------------------------------------------------- | +|-------------|-----------------------------------------------------| | Type | bool | | Environment | $CODER_TLS_ALLOW_INSECURE_CIPHERS | | YAML | networking.tls.tlsAllowInsecureCiphers | @@ -190,7 +189,7 @@ By default, only ciphers marked as 'secure' are allowed to be used. See https:// ### --derp-server-enable | | | -| ----------- | -------------------------------------- | +|-------------|----------------------------------------| | Type | bool | | Environment | $CODER_DERP_SERVER_ENABLE | | YAML | networking.derp.enable | @@ -201,7 +200,7 @@ Whether to enable or disable the embedded DERP relay server. ### --derp-server-region-name | | | -| ----------- | ------------------------------------------- | +|-------------|---------------------------------------------| | Type | string | | Environment | $CODER_DERP_SERVER_REGION_NAME | | YAML | networking.derp.regionName | @@ -212,7 +211,7 @@ Region name that for the embedded DERP server. ### --derp-server-stun-addresses | | | -| ----------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +|-------------|------------------------------------------------------------------------------------------------------------------------------------------| | Type | string-array | | Environment | $CODER_DERP_SERVER_STUN_ADDRESSES | | YAML | networking.derp.stunAddresses | @@ -223,7 +222,7 @@ Addresses for STUN servers to establish P2P connections. It's recommended to hav ### --derp-server-relay-url | | | -| ----------- | ----------------------------------------- | +|-------------|-------------------------------------------| | Type | url | | Environment | $CODER_DERP_SERVER_RELAY_URL | | YAML | networking.derp.relayURL | @@ -233,7 +232,7 @@ An HTTP URL that is accessible by other replicas to relay DERP traffic. Required ### --block-direct-connections | | | -| ----------- | ---------------------------------------- | +|-------------|------------------------------------------| | Type | bool | | Environment | $CODER_BLOCK_DIRECT | | YAML | networking.derp.blockDirect | @@ -243,7 +242,7 @@ Block peer-to-peer (aka. direct) workspace connections. All workspace connection ### --derp-force-websockets | | | -| ----------- | -------------------------------------------- | +|-------------|----------------------------------------------| | Type | bool | | Environment | $CODER_DERP_FORCE_WEBSOCKETS | | YAML | networking.derp.forceWebSockets | @@ -253,7 +252,7 @@ Force clients and agents to always use WebSocket to connect to DERP relay server ### --derp-config-url | | | -| ----------- | ----------------------------------- | +|-------------|-------------------------------------| | Type | string | | Environment | $CODER_DERP_CONFIG_URL | | YAML | networking.derp.url | @@ -263,7 +262,7 @@ URL to fetch a DERP mapping on startup. See: https://tailscale.com/kb/1118/custo ### --derp-config-path | | | -| ----------- | --------------------------------------- | +|-------------|-----------------------------------------| | Type | string | | Environment | $CODER_DERP_CONFIG_PATH | | YAML | networking.derp.configPath | @@ -273,7 +272,7 @@ Path to read a DERP mapping from. See: https://tailscale.com/kb/1118/custom-derp ### --prometheus-enable | | | -| ----------- | -------------------------------------------- | +|-------------|----------------------------------------------| | Type | bool | | Environment | $CODER_PROMETHEUS_ENABLE | | YAML | introspection.prometheus.enable | @@ -283,7 +282,7 @@ Serve prometheus metrics on the address defined by prometheus address. ### --prometheus-address | | | -| ----------- | --------------------------------------------- | +|-------------|-----------------------------------------------| | Type | host:port | | Environment | $CODER_PROMETHEUS_ADDRESS | | YAML | introspection.prometheus.address | @@ -294,7 +293,7 @@ The bind address to serve prometheus metrics. ### --prometheus-collect-agent-stats | | | -| ----------- | --------------------------------------------------------- | +|-------------|-----------------------------------------------------------| | Type | bool | | Environment | $CODER_PROMETHEUS_COLLECT_AGENT_STATS | | YAML | introspection.prometheus.collect_agent_stats | @@ -304,7 +303,7 @@ Collect agent stats (may increase charges for metrics storage). ### --prometheus-aggregate-agent-stats-by | | | -| ----------- | -------------------------------------------------------------- | +|-------------|----------------------------------------------------------------| | Type | string-array | | Environment | $CODER_PROMETHEUS_AGGREGATE_AGENT_STATS_BY | | YAML | introspection.prometheus.aggregate_agent_stats_by | @@ -315,7 +314,7 @@ When collecting agent stats, aggregate metrics by a given set of comma-separated ### --prometheus-collect-db-metrics | | | -| ----------- | -------------------------------------------------------- | +|-------------|----------------------------------------------------------| | Type | bool | | Environment | $CODER_PROMETHEUS_COLLECT_DB_METRICS | | YAML | introspection.prometheus.collect_db_metrics | @@ -326,7 +325,7 @@ Collect database query metrics (may increase charges for metrics storage). If se ### --pprof-enable | | | -| ----------- | --------------------------------------- | +|-------------|-----------------------------------------| | Type | bool | | Environment | $CODER_PPROF_ENABLE | | YAML | introspection.pprof.enable | @@ -336,7 +335,7 @@ Serve pprof metrics on the address defined by pprof address. ### --pprof-address | | | -| ----------- | ---------------------------------------- | +|-------------|------------------------------------------| | Type | host:port | | Environment | $CODER_PPROF_ADDRESS | | YAML | introspection.pprof.address | @@ -347,7 +346,7 @@ The bind address to serve pprof. ### --oauth2-github-client-id | | | -| ----------- | ------------------------------------------- | +|-------------|---------------------------------------------| | Type | string | | Environment | $CODER_OAUTH2_GITHUB_CLIENT_ID | | YAML | oauth2.github.clientID | @@ -357,7 +356,7 @@ Client ID for Login with GitHub. ### --oauth2-github-client-secret | | | -| ----------- | ----------------------------------------------- | +|-------------|-------------------------------------------------| | Type | string | | Environment | $CODER_OAUTH2_GITHUB_CLIENT_SECRET | @@ -366,7 +365,7 @@ Client secret for Login with GitHub. ### --oauth2-github-allowed-orgs | | | -| ----------- | ---------------------------------------------- | +|-------------|------------------------------------------------| | Type | string-array | | Environment | $CODER_OAUTH2_GITHUB_ALLOWED_ORGS | | YAML | oauth2.github.allowedOrgs | @@ -376,7 +375,7 @@ Organizations the user must be a member of to Login with GitHub. ### --oauth2-github-allowed-teams | | | -| ----------- | ----------------------------------------------- | +|-------------|-------------------------------------------------| | Type | string-array | | Environment | $CODER_OAUTH2_GITHUB_ALLOWED_TEAMS | | YAML | oauth2.github.allowedTeams | @@ -386,7 +385,7 @@ Teams inside organizations the user must be a member of to Login with GitHub. St ### --oauth2-github-allow-signups | | | -| ----------- | ----------------------------------------------- | +|-------------|-------------------------------------------------| | Type | bool | | Environment | $CODER_OAUTH2_GITHUB_ALLOW_SIGNUPS | | YAML | oauth2.github.allowSignups | @@ -396,7 +395,7 @@ Whether new users can sign up with GitHub. ### --oauth2-github-allow-everyone | | | -| ----------- | ------------------------------------------------ | +|-------------|--------------------------------------------------| | Type | bool | | Environment | $CODER_OAUTH2_GITHUB_ALLOW_EVERYONE | | YAML | oauth2.github.allowEveryone | @@ -406,7 +405,7 @@ Allow all logins, setting this option means allowed orgs and teams must be empty ### --oauth2-github-enterprise-base-url | | | -| ----------- | ----------------------------------------------------- | +|-------------|-------------------------------------------------------| | Type | string | | Environment | $CODER_OAUTH2_GITHUB_ENTERPRISE_BASE_URL | | YAML | oauth2.github.enterpriseBaseURL | @@ -416,7 +415,7 @@ Base URL of a GitHub Enterprise deployment to use for Login with GitHub. ### --oidc-allow-signups | | | -| ----------- | -------------------------------------- | +|-------------|----------------------------------------| | Type | bool | | Environment | $CODER_OIDC_ALLOW_SIGNUPS | | YAML | oidc.allowSignups | @@ -427,7 +426,7 @@ Whether new users can sign up with OIDC. ### --oidc-client-id | | | -| ----------- | ---------------------------------- | +|-------------|------------------------------------| | Type | string | | Environment | $CODER_OIDC_CLIENT_ID | | YAML | oidc.clientID | @@ -437,7 +436,7 @@ Client ID to use for Login with OIDC. ### --oidc-client-secret | | | -| ----------- | -------------------------------------- | +|-------------|----------------------------------------| | Type | string | | Environment | $CODER_OIDC_CLIENT_SECRET | @@ -446,7 +445,7 @@ Client secret to use for Login with OIDC. ### --oidc-client-key-file | | | -| ----------- | ---------------------------------------- | +|-------------|------------------------------------------| | Type | string | | Environment | $CODER_OIDC_CLIENT_KEY_FILE | | YAML | oidc.oidcClientKeyFile | @@ -456,7 +455,7 @@ Pem encoded RSA private key to use for oauth2 PKI/JWT authorization. This can be ### --oidc-client-cert-file | | | -| ----------- | ----------------------------------------- | +|-------------|-------------------------------------------| | Type | string | | Environment | $CODER_OIDC_CLIENT_CERT_FILE | | YAML | oidc.oidcClientCertFile | @@ -466,7 +465,7 @@ Pem encoded certificate file to use for oauth2 PKI/JWT authorization. The public ### --oidc-email-domain | | | -| ----------- | ------------------------------------- | +|-------------|---------------------------------------| | Type | string-array | | Environment | $CODER_OIDC_EMAIL_DOMAIN | | YAML | oidc.emailDomain | @@ -476,7 +475,7 @@ Email domains that clients logging in with OIDC must match. ### --oidc-issuer-url | | | -| ----------- | ----------------------------------- | +|-------------|-------------------------------------| | Type | string | | Environment | $CODER_OIDC_ISSUER_URL | | YAML | oidc.issuerURL | @@ -486,7 +485,7 @@ Issuer URL to use for Login with OIDC. ### --oidc-scopes | | | -| ----------- | --------------------------------- | +|-------------|-----------------------------------| | Type | string-array | | Environment | $CODER_OIDC_SCOPES | | YAML | oidc.scopes | @@ -497,7 +496,7 @@ Scopes to grant when authenticating with OIDC. ### --oidc-ignore-email-verified | | | -| ----------- | ---------------------------------------------- | +|-------------|------------------------------------------------| | Type | bool | | Environment | $CODER_OIDC_IGNORE_EMAIL_VERIFIED | | YAML | oidc.ignoreEmailVerified | @@ -507,7 +506,7 @@ Ignore the email_verified claim from the upstream provider. ### --oidc-username-field | | | -| ----------- | --------------------------------------- | +|-------------|-----------------------------------------| | Type | string | | Environment | $CODER_OIDC_USERNAME_FIELD | | YAML | oidc.usernameField | @@ -518,7 +517,7 @@ OIDC claim field to use as the username. ### --oidc-name-field | | | -| ----------- | ----------------------------------- | +|-------------|-------------------------------------| | Type | string | | Environment | $CODER_OIDC_NAME_FIELD | | YAML | oidc.nameField | @@ -529,7 +528,7 @@ OIDC claim field to use as the name. ### --oidc-email-field | | | -| ----------- | ------------------------------------ | +|-------------|--------------------------------------| | Type | string | | Environment | $CODER_OIDC_EMAIL_FIELD | | YAML | oidc.emailField | @@ -540,7 +539,7 @@ OIDC claim field to use as the email. ### --oidc-auth-url-params | | | -| ----------- | ---------------------------------------- | +|-------------|------------------------------------------| | Type | struct[map[string]string] | | Environment | $CODER_OIDC_AUTH_URL_PARAMS | | YAML | oidc.authURLParams | @@ -551,7 +550,7 @@ OIDC auth URL parameters to pass to the upstream provider. ### --oidc-ignore-userinfo | | | -| ----------- | ---------------------------------------- | +|-------------|------------------------------------------| | Type | bool | | Environment | $CODER_OIDC_IGNORE_USERINFO | | YAML | oidc.ignoreUserInfo | @@ -562,7 +561,7 @@ Ignore the userinfo endpoint and only use the ID token for user information. ### --oidc-group-field | | | -| ----------- | ------------------------------------ | +|-------------|--------------------------------------| | Type | string | | Environment | $CODER_OIDC_GROUP_FIELD | | YAML | oidc.groupField | @@ -572,7 +571,7 @@ This field must be set if using the group sync feature and the scope name is not ### --oidc-group-mapping | | | -| ----------- | -------------------------------------- | +|-------------|----------------------------------------| | Type | struct[map[string]string] | | Environment | $CODER_OIDC_GROUP_MAPPING | | YAML | oidc.groupMapping | @@ -583,7 +582,7 @@ A map of OIDC group IDs and the group in Coder it should map to. This is useful ### --oidc-group-auto-create | | | -| ----------- | ------------------------------------------ | +|-------------|--------------------------------------------| | Type | bool | | Environment | $CODER_OIDC_GROUP_AUTO_CREATE | | YAML | oidc.enableGroupAutoCreate | @@ -594,18 +593,18 @@ Automatically creates missing groups from a user's groups claim. ### --oidc-group-regex-filter | | | -| ----------- | ------------------------------------------- | +|-------------|---------------------------------------------| | Type | regexp | | Environment | $CODER_OIDC_GROUP_REGEX_FILTER | | YAML | oidc.groupRegexFilter | -| Default | .\* | +| Default | .* | If provided any group name not matching the regex is ignored. This allows for filtering out groups that are not needed. This filter is applied after the group mapping. ### --oidc-allowed-groups | | | -| ----------- | --------------------------------------- | +|-------------|-----------------------------------------| | Type | string-array | | Environment | $CODER_OIDC_ALLOWED_GROUPS | | YAML | oidc.groupAllowed | @@ -615,7 +614,7 @@ If provided any group name not in the list will not be allowed to authenticate. ### --oidc-user-role-field | | | -| ----------- | ---------------------------------------- | +|-------------|------------------------------------------| | Type | string | | Environment | $CODER_OIDC_USER_ROLE_FIELD | | YAML | oidc.userRoleField | @@ -625,7 +624,7 @@ This field must be set if using the user roles sync feature. Set this to the nam ### --oidc-user-role-mapping | | | -| ----------- | ------------------------------------------ | +|-------------|--------------------------------------------| | Type | struct[map[string][]string] | | Environment | $CODER_OIDC_USER_ROLE_MAPPING | | YAML | oidc.userRoleMapping | @@ -636,7 +635,7 @@ A map of the OIDC passed in user roles and the groups in Coder it should map to. ### --oidc-user-role-default | | | -| ----------- | ------------------------------------------ | +|-------------|--------------------------------------------| | Type | string-array | | Environment | $CODER_OIDC_USER_ROLE_DEFAULT | | YAML | oidc.userRoleDefault | @@ -646,7 +645,7 @@ If user role sync is enabled, these roles are always included for all authentica ### --oidc-sign-in-text | | | -| ----------- | ------------------------------------- | +|-------------|---------------------------------------| | Type | string | | Environment | $CODER_OIDC_SIGN_IN_TEXT | | YAML | oidc.signInText | @@ -657,7 +656,7 @@ The text to show on the OpenID Connect sign in button. ### --oidc-icon-url | | | -| ----------- | --------------------------------- | +|-------------|-----------------------------------| | Type | url | | Environment | $CODER_OIDC_ICON_URL | | YAML | oidc.iconURL | @@ -667,7 +666,7 @@ URL pointing to the icon to use on the OpenID Connect login button. ### --oidc-signups-disabled-text | | | -| ----------- | ---------------------------------------------- | +|-------------|------------------------------------------------| | Type | string | | Environment | $CODER_OIDC_SIGNUPS_DISABLED_TEXT | | YAML | oidc.signupsDisabledText | @@ -677,7 +676,7 @@ The custom text to show on the error page informing about disabled OIDC signups. ### --dangerous-oidc-skip-issuer-checks | | | -| ----------- | ----------------------------------------------------- | +|-------------|-------------------------------------------------------| | Type | bool | | Environment | $CODER_DANGEROUS_OIDC_SKIP_ISSUER_CHECKS | | YAML | oidc.dangerousSkipIssuerChecks | @@ -687,7 +686,7 @@ OIDC issuer urls must match in the request, the id_token 'iss' claim, and in the ### --telemetry | | | -| ----------- | ------------------------------------ | +|-------------|--------------------------------------| | Type | bool | | Environment | $CODER_TELEMETRY_ENABLE | | YAML | telemetry.enable | @@ -698,7 +697,7 @@ Whether telemetry is enabled or not. Coder collects anonymized usage data to hel ### --trace | | | -| ----------- | ----------------------------------------- | +|-------------|-------------------------------------------| | Type | bool | | Environment | $CODER_TRACE_ENABLE | | YAML | introspection.tracing.enable | @@ -708,7 +707,7 @@ Whether application tracing data is collected. It exports to a backend configure ### --trace-honeycomb-api-key | | | -| ----------- | ------------------------------------------- | +|-------------|---------------------------------------------| | Type | string | | Environment | $CODER_TRACE_HONEYCOMB_API_KEY | @@ -717,7 +716,7 @@ Enables trace exporting to Honeycomb.io using the provided API Key. ### --trace-logs | | | -| ----------- | ---------------------------------------------- | +|-------------|------------------------------------------------| | Type | bool | | Environment | $CODER_TRACE_LOGS | | YAML | introspection.tracing.captureLogs | @@ -727,7 +726,7 @@ Enables capturing of logs as events in traces. This is useful for debugging, but ### --provisioner-daemons | | | -| ----------- | --------------------------------------- | +|-------------|-----------------------------------------| | Type | int | | Environment | $CODER_PROVISIONER_DAEMONS | | YAML | provisioning.daemons | @@ -738,7 +737,7 @@ Number of provisioner daemons to create on start. If builds are stuck in queued ### --provisioner-daemon-poll-interval | | | -| ----------- | ---------------------------------------------------- | +|-------------|------------------------------------------------------| | Type | duration | | Environment | $CODER_PROVISIONER_DAEMON_POLL_INTERVAL | | YAML | provisioning.daemonPollInterval | @@ -749,7 +748,7 @@ Deprecated and ignored. ### --provisioner-daemon-poll-jitter | | | -| ----------- | -------------------------------------------------- | +|-------------|----------------------------------------------------| | Type | duration | | Environment | $CODER_PROVISIONER_DAEMON_POLL_JITTER | | YAML | provisioning.daemonPollJitter | @@ -760,7 +759,7 @@ Deprecated and ignored. ### --provisioner-force-cancel-interval | | | -| ----------- | ----------------------------------------------------- | +|-------------|-------------------------------------------------------| | Type | duration | | Environment | $CODER_PROVISIONER_FORCE_CANCEL_INTERVAL | | YAML | provisioning.forceCancelInterval | @@ -771,7 +770,7 @@ Time to force cancel provisioning tasks that are stuck. ### --provisioner-daemon-psk | | | -| ----------- | ------------------------------------------ | +|-------------|--------------------------------------------| | Type | string | | Environment | $CODER_PROVISIONER_DAEMON_PSK | @@ -780,17 +779,17 @@ Pre-shared key to authenticate external provisioner daemons to Coder server. ### -l, --log-filter | | | -| ----------- | ----------------------------------------- | +|-------------|-------------------------------------------| | Type | string-array | | Environment | $CODER_LOG_FILTER | | YAML | introspection.logging.filter | -Filter debug logs by matching against a given regex. Use .\* to match all debug logs. +Filter debug logs by matching against a given regex. Use .* to match all debug logs. ### --log-human | | | -| ----------- | -------------------------------------------- | +|-------------|----------------------------------------------| | Type | string | | Environment | $CODER_LOGGING_HUMAN | | YAML | introspection.logging.humanPath | @@ -801,7 +800,7 @@ Output human-readable logs to a given file. ### --log-json | | | -| ----------- | ------------------------------------------- | +|-------------|---------------------------------------------| | Type | string | | Environment | $CODER_LOGGING_JSON | | YAML | introspection.logging.jsonPath | @@ -811,7 +810,7 @@ Output JSON logs to a given file. ### --log-stackdriver | | | -| ----------- | -------------------------------------------------- | +|-------------|----------------------------------------------------| | Type | string | | Environment | $CODER_LOGGING_STACKDRIVER | | YAML | introspection.logging.stackdriverPath | @@ -821,7 +820,7 @@ Output Stackdriver compatible logs to a given file. ### --enable-terraform-debug-mode | | | -| ----------- | ----------------------------------------------------------- | +|-------------|-------------------------------------------------------------| | Type | bool | | Environment | $CODER_ENABLE_TERRAFORM_DEBUG_MODE | | YAML | introspection.logging.enableTerraformDebugMode | @@ -832,7 +831,7 @@ Allow administrators to enable Terraform debug output. ### --additional-csp-policy | | | -| ----------- | ------------------------------------------------ | +|-------------|--------------------------------------------------| | Type | string-array | | Environment | $CODER_ADDITIONAL_CSP_POLICY | | YAML | networking.http.additionalCSPPolicy | @@ -842,7 +841,7 @@ Coder configures a Content Security Policy (CSP) to protect against XSS attacks. ### --dangerous-allow-path-app-sharing | | | -| ----------- | ---------------------------------------------------- | +|-------------|------------------------------------------------------| | Type | bool | | Environment | $CODER_DANGEROUS_ALLOW_PATH_APP_SHARING | @@ -851,7 +850,7 @@ Allow workspace apps that are not served from subdomains to be shared. Path-base ### --dangerous-allow-path-app-site-owner-access | | | -| ----------- | -------------------------------------------------------------- | +|-------------|----------------------------------------------------------------| | Type | bool | | Environment | $CODER_DANGEROUS_ALLOW_PATH_APP_SITE_OWNER_ACCESS | @@ -860,17 +859,17 @@ Allow site-owners to access workspace apps from workspaces they do not own. Owne ### --experiments | | | -| ----------- | ------------------------------- | +|-------------|---------------------------------| | Type | string-array | | Environment | $CODER_EXPERIMENTS | | YAML | experiments | -Enable one or more experiments. These are not ready for production. Separate multiple experiments with commas, or enter '\*' to opt-in to all available experiments. +Enable one or more experiments. These are not ready for production. Separate multiple experiments with commas, or enter '*' to opt-in to all available experiments. ### --update-check | | | -| ----------- | -------------------------------- | +|-------------|----------------------------------| | Type | bool | | Environment | $CODER_UPDATE_CHECK | | YAML | updateCheck | @@ -881,7 +880,7 @@ Periodically check for new releases of Coder and inform the owner. The check is ### --max-token-lifetime | | | -| ----------- | --------------------------------------------- | +|-------------|-----------------------------------------------| | Type | duration | | Environment | $CODER_MAX_TOKEN_LIFETIME | | YAML | networking.http.maxTokenLifetime | @@ -892,7 +891,7 @@ The maximum lifetime duration users can specify when creating an API token. ### --default-token-lifetime | | | -| ----------- | ------------------------------------------ | +|-------------|--------------------------------------------| | Type | duration | | Environment | $CODER_DEFAULT_TOKEN_LIFETIME | | YAML | defaultTokenLifetime | @@ -903,7 +902,7 @@ The default lifetime duration for API tokens. This value is used when creating a ### --swagger-enable | | | -| ----------- | ---------------------------------- | +|-------------|------------------------------------| | Type | bool | | Environment | $CODER_SWAGGER_ENABLE | | YAML | enableSwagger | @@ -913,7 +912,7 @@ Expose the swagger endpoint via /swagger. ### --proxy-trusted-headers | | | -| ----------- | ------------------------------------------- | +|-------------|---------------------------------------------| | Type | string-array | | Environment | $CODER_PROXY_TRUSTED_HEADERS | | YAML | networking.proxyTrustedHeaders | @@ -923,7 +922,7 @@ Headers to trust for forwarding IP addresses. e.g. Cf-Connecting-Ip, True-Client ### --proxy-trusted-origins | | | -| ----------- | ------------------------------------------- | +|-------------|---------------------------------------------| | Type | string-array | | Environment | $CODER_PROXY_TRUSTED_ORIGINS | | YAML | networking.proxyTrustedOrigins | @@ -933,7 +932,7 @@ Origin addresses to respect "proxy-trusted-headers". e.g. 192.168.1.0/24. ### --cache-dir | | | -| ----------- | ----------------------------------- | +|-------------|-------------------------------------| | Type | string | | Environment | $CODER_CACHE_DIRECTORY | | YAML | cacheDir | @@ -944,7 +943,7 @@ The directory to cache temporary files. If unspecified and $CACHE_DIRECTORY is s ### --postgres-url | | | -| ----------- | ------------------------------------- | +|-------------|---------------------------------------| | Type | string | | Environment | $CODER_PG_CONNECTION_URL | @@ -953,7 +952,7 @@ URL of a PostgreSQL database. If empty, PostgreSQL binaries will be downloaded f ### --postgres-auth | | | -| ----------- | -------------------------------- | +|-------------|----------------------------------| | Type | password\|awsiamrds | | Environment | $CODER_PG_AUTH | | YAML | pgAuth | @@ -964,7 +963,7 @@ Type of auth to use when connecting to postgres. For AWS RDS, using IAM authenti ### --secure-auth-cookie | | | -| ----------- | ---------------------------------------- | +|-------------|------------------------------------------| | Type | bool | | Environment | $CODER_SECURE_AUTH_COOKIE | | YAML | networking.secureAuthCookie | @@ -974,7 +973,7 @@ Controls if the 'Secure' property is set on browser session cookies. ### --terms-of-service-url | | | -| ----------- | ---------------------------------------- | +|-------------|------------------------------------------| | Type | string | | Environment | $CODER_TERMS_OF_SERVICE_URL | | YAML | termsOfServiceURL | @@ -984,7 +983,7 @@ A URL to an external Terms of Service that must be accepted by users when loggin ### --strict-transport-security | | | -| ----------- | --------------------------------------------------- | +|-------------|-----------------------------------------------------| | Type | int | | Environment | $CODER_STRICT_TRANSPORT_SECURITY | | YAML | networking.tls.strictTransportSecurity | @@ -995,7 +994,7 @@ Controls if the 'Strict-Transport-Security' header is set on all static file res ### --strict-transport-security-options | | | -| ----------- | ---------------------------------------------------------- | +|-------------|------------------------------------------------------------| | Type | string-array | | Environment | $CODER_STRICT_TRANSPORT_SECURITY_OPTIONS | | YAML | networking.tls.strictTransportSecurityOptions | @@ -1005,7 +1004,7 @@ Two optional fields can be set in the Strict-Transport-Security header; 'include ### --ssh-keygen-algorithm | | | -| ----------- | ---------------------------------------- | +|-------------|------------------------------------------| | Type | string | | Environment | $CODER_SSH_KEYGEN_ALGORITHM | | YAML | sshKeygenAlgorithm | @@ -1016,7 +1015,7 @@ The algorithm to use for generating ssh keys. Accepted values are "ed25519", "ec ### --browser-only | | | -| ----------- | ----------------------------------- | +|-------------|-------------------------------------| | Type | bool | | Environment | $CODER_BROWSER_ONLY | | YAML | networking.browserOnly | @@ -1026,7 +1025,7 @@ Whether Coder only allows connections to workspaces via the browser. ### --scim-auth-header | | | -| ----------- | ------------------------------------ | +|-------------|--------------------------------------| | Type | string | | Environment | $CODER_SCIM_AUTH_HEADER | @@ -1035,7 +1034,7 @@ Enables SCIM and sets the authentication header for the built-in SCIM server. Ne ### --external-token-encryption-keys | | | -| ----------- | -------------------------------------------------- | +|-------------|----------------------------------------------------| | Type | string-array | | Environment | $CODER_EXTERNAL_TOKEN_ENCRYPTION_KEYS | @@ -1044,7 +1043,7 @@ Encrypt OIDC and Git authentication tokens with AES-256-GCM in the database. The ### --disable-path-apps | | | -| ----------- | ------------------------------------- | +|-------------|---------------------------------------| | Type | bool | | Environment | $CODER_DISABLE_PATH_APPS | | YAML | disablePathApps | @@ -1054,7 +1053,7 @@ Disable workspace apps that are not served from subdomains. Path-based apps can ### --disable-owner-workspace-access | | | -| ----------- | -------------------------------------------------- | +|-------------|----------------------------------------------------| | Type | bool | | Environment | $CODER_DISABLE_OWNER_WORKSPACE_ACCESS | | YAML | disableOwnerWorkspaceAccess | @@ -1064,7 +1063,7 @@ Remove the permission for the 'owner' role to have workspace execution on all wo ### --session-duration | | | -| ----------- | -------------------------------------------- | +|-------------|----------------------------------------------| | Type | duration | | Environment | $CODER_SESSION_DURATION | | YAML | networking.http.sessionDuration | @@ -1075,7 +1074,7 @@ The token expiry duration for browser sessions. Sessions may last longer if they ### --disable-session-expiry-refresh | | | -| ----------- | -------------------------------------------------------- | +|-------------|----------------------------------------------------------| | Type | bool | | Environment | $CODER_DISABLE_SESSION_EXPIRY_REFRESH | | YAML | networking.http.disableSessionExpiryRefresh | @@ -1085,7 +1084,7 @@ Disable automatic session expiry bumping due to activity. This forces all sessio ### --disable-password-auth | | | -| ----------- | ------------------------------------------------ | +|-------------|--------------------------------------------------| | Type | bool | | Environment | $CODER_DISABLE_PASSWORD_AUTH | | YAML | networking.http.disablePasswordAuth | @@ -1095,7 +1094,7 @@ Disable password authentication. This is recommended for security purposes in pr ### -c, --config | | | -| ----------- | ------------------------------- | +|-------------|---------------------------------| | Type | yaml-config-path | | Environment | $CODER_CONFIG_PATH | @@ -1104,7 +1103,7 @@ Specify a YAML file to load configuration from. ### --ssh-hostname-prefix | | | -| ----------- | --------------------------------------- | +|-------------|-----------------------------------------| | Type | string | | Environment | $CODER_SSH_HOSTNAME_PREFIX | | YAML | client.sshHostnamePrefix | @@ -1115,7 +1114,7 @@ The SSH deployment prefix is used in the Host of the ssh config. ### --ssh-config-options | | | -| ----------- | -------------------------------------- | +|-------------|----------------------------------------| | Type | string-array | | Environment | $CODER_SSH_CONFIG_OPTIONS | | YAML | client.sshConfigOptions | @@ -1125,7 +1124,7 @@ These SSH config options will override the default SSH config options. Provide o ### --cli-upgrade-message | | | -| ----------- | --------------------------------------- | +|-------------|-----------------------------------------| | Type | string | | Environment | $CODER_CLI_UPGRADE_MESSAGE | | YAML | client.cliUpgradeMessage | @@ -1135,7 +1134,7 @@ The upgrade message to display to users when a client/server mismatch is detecte ### --write-config | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool |
Write out the current server config as YAML to stdout. @@ -1143,7 +1142,7 @@ The upgrade message to display to users when a client/server mismatch is detecte ### --support-links | | | -| ----------- | ------------------------------------------ | +|-------------|--------------------------------------------| | Type | struct[[]codersdk.LinkConfig] | | Environment | $CODER_SUPPORT_LINKS | | YAML | supportLinks | @@ -1153,7 +1152,7 @@ Support links to display in the top right drop down menu. ### --proxy-health-interval | | | -| ----------- | ------------------------------------------------ | +|-------------|--------------------------------------------------| | Type | duration | | Environment | $CODER_PROXY_HEALTH_INTERVAL | | YAML | networking.http.proxyHealthInterval | @@ -1164,18 +1163,18 @@ The interval in which coderd should be checking the status of workspace proxies. ### --default-quiet-hours-schedule | | | -| ----------- | ------------------------------------------------------------- | +|-------------|---------------------------------------------------------------| | Type | string | | Environment | $CODER_QUIET_HOURS_DEFAULT_SCHEDULE | | YAML | userQuietHoursSchedule.defaultQuietHoursSchedule | -| Default | CRON_TZ=UTC 0 0 \* \* \* | +| Default | CRON_TZ=UTC 0 0 ** * | -The default daily cron schedule applied to users that haven't set a custom quiet hours schedule themselves. The quiet hours schedule determines when workspaces will be force stopped due to the template's autostop requirement, and will round the max deadline up to be within the user's quiet hours window (or default). The format is the same as the standard cron format, but the day-of-month, month and day-of-week must be \*. Only one hour and minute can be specified (ranges or comma separated values are not supported). +The default daily cron schedule applied to users that haven't set a custom quiet hours schedule themselves. The quiet hours schedule determines when workspaces will be force stopped due to the template's autostop requirement, and will round the max deadline up to be within the user's quiet hours window (or default). The format is the same as the standard cron format, but the day-of-month, month and day-of-week must be *. Only one hour and minute can be specified (ranges or comma separated values are not supported). ### --allow-custom-quiet-hours | | | -| ----------- | --------------------------------------------------------- | +|-------------|-----------------------------------------------------------| | Type | bool | | Environment | $CODER_ALLOW_CUSTOM_QUIET_HOURS | | YAML | userQuietHoursSchedule.allowCustomQuietHours | @@ -1186,7 +1185,7 @@ Allow users to set their own quiet hours schedule for workspaces to stop in (dep ### --web-terminal-renderer | | | -| ----------- | ----------------------------------------- | +|-------------|-------------------------------------------| | Type | string | | Environment | $CODER_WEB_TERMINAL_RENDERER | | YAML | client.webTerminalRenderer | @@ -1197,7 +1196,7 @@ The renderer to use when opening a web terminal. Valid values are 'canvas', 'web ### --allow-workspace-renames | | | -| ----------- | ------------------------------------------- | +|-------------|---------------------------------------------| | Type | bool | | Environment | $CODER_ALLOW_WORKSPACE_RENAMES | | YAML | allowWorkspaceRenames | @@ -1208,7 +1207,7 @@ DEPRECATED: Allow users to rename their workspaces. Use only for temporary compa ### --health-check-refresh | | | -| ----------- | ---------------------------------------------- | +|-------------|------------------------------------------------| | Type | duration | | Environment | $CODER_HEALTH_CHECK_REFRESH | | YAML | introspection.healthcheck.refresh | @@ -1219,7 +1218,7 @@ Refresh interval for healthchecks. ### --health-check-threshold-database | | | -| ----------- | -------------------------------------------------------- | +|-------------|----------------------------------------------------------| | Type | duration | | Environment | $CODER_HEALTH_CHECK_THRESHOLD_DATABASE | | YAML | introspection.healthcheck.thresholdDatabase | @@ -1230,7 +1229,7 @@ The threshold for the database health check. If the median latency of the databa ### --email-from | | | -| ----------- | ------------------------------ | +|-------------|--------------------------------| | Type | string | | Environment | $CODER_EMAIL_FROM | | YAML | email.from | @@ -1240,7 +1239,7 @@ The sender's address to use. ### --email-smarthost | | | -| ----------- | ----------------------------------- | +|-------------|-------------------------------------| | Type | string | | Environment | $CODER_EMAIL_SMARTHOST | | YAML | email.smarthost | @@ -1250,7 +1249,7 @@ The intermediary SMTP host through which emails are sent. ### --email-hello | | | -| ----------- | ------------------------------- | +|-------------|---------------------------------| | Type | string | | Environment | $CODER_EMAIL_HELLO | | YAML | email.hello | @@ -1261,7 +1260,7 @@ The hostname identifying the SMTP server. ### --email-force-tls | | | -| ----------- | ----------------------------------- | +|-------------|-------------------------------------| | Type | bool | | Environment | $CODER_EMAIL_FORCE_TLS | | YAML | email.forceTLS | @@ -1272,7 +1271,7 @@ Force a TLS connection to the configured SMTP smarthost. ### --email-auth-identity | | | -| ----------- | --------------------------------------- | +|-------------|-----------------------------------------| | Type | string | | Environment | $CODER_EMAIL_AUTH_IDENTITY | | YAML | email.emailAuth.identity | @@ -1282,7 +1281,7 @@ Identity to use with PLAIN authentication. ### --email-auth-username | | | -| ----------- | --------------------------------------- | +|-------------|-----------------------------------------| | Type | string | | Environment | $CODER_EMAIL_AUTH_USERNAME | | YAML | email.emailAuth.username | @@ -1292,7 +1291,7 @@ Username to use with PLAIN/LOGIN authentication. ### --email-auth-password | | | -| ----------- | --------------------------------------- | +|-------------|-----------------------------------------| | Type | string | | Environment | $CODER_EMAIL_AUTH_PASSWORD | @@ -1301,7 +1300,7 @@ Password to use with PLAIN/LOGIN authentication. ### --email-auth-password-file | | | -| ----------- | -------------------------------------------- | +|-------------|----------------------------------------------| | Type | string | | Environment | $CODER_EMAIL_AUTH_PASSWORD_FILE | | YAML | email.emailAuth.passwordFile | @@ -1311,7 +1310,7 @@ File from which to load password for use with PLAIN/LOGIN authentication. ### --email-tls-starttls | | | -| ----------- | -------------------------------------- | +|-------------|----------------------------------------| | Type | bool | | Environment | $CODER_EMAIL_TLS_STARTTLS | | YAML | email.emailTLS.startTLS | @@ -1321,7 +1320,7 @@ Enable STARTTLS to upgrade insecure SMTP connections using TLS. ### --email-tls-server-name | | | -| ----------- | ---------------------------------------- | +|-------------|------------------------------------------| | Type | string | | Environment | $CODER_EMAIL_TLS_SERVERNAME | | YAML | email.emailTLS.serverName | @@ -1331,7 +1330,7 @@ Server name to verify against the target certificate. ### --email-tls-skip-verify | | | -| ----------- | ---------------------------------------------- | +|-------------|------------------------------------------------| | Type | bool | | Environment | $CODER_EMAIL_TLS_SKIPVERIFY | | YAML | email.emailTLS.insecureSkipVerify | @@ -1341,7 +1340,7 @@ Skip verification of the target server's certificate (insecure). ### --email-tls-ca-cert-file | | | -| ----------- | ---------------------------------------- | +|-------------|------------------------------------------| | Type | string | | Environment | $CODER_EMAIL_TLS_CACERTFILE | | YAML | email.emailTLS.caCertFile | @@ -1351,7 +1350,7 @@ CA certificate file to use. ### --email-tls-cert-file | | | -| ----------- | -------------------------------------- | +|-------------|----------------------------------------| | Type | string | | Environment | $CODER_EMAIL_TLS_CERTFILE | | YAML | email.emailTLS.certFile | @@ -1361,7 +1360,7 @@ Certificate file to use. ### --email-tls-cert-key-file | | | -| ----------- | ----------------------------------------- | +|-------------|-------------------------------------------| | Type | string | | Environment | $CODER_EMAIL_TLS_CERTKEYFILE | | YAML | email.emailTLS.certKeyFile | @@ -1371,7 +1370,7 @@ Certificate key file to use. ### --notifications-method | | | -| ----------- | ---------------------------------------- | +|-------------|------------------------------------------| | Type | string | | Environment | $CODER_NOTIFICATIONS_METHOD | | YAML | notifications.method | @@ -1382,7 +1381,7 @@ Which delivery method to use (available options: 'smtp', 'webhook'). ### --notifications-dispatch-timeout | | | -| ----------- | -------------------------------------------------- | +|-------------|----------------------------------------------------| | Type | duration | | Environment | $CODER_NOTIFICATIONS_DISPATCH_TIMEOUT | | YAML | notifications.dispatchTimeout | @@ -1393,7 +1392,7 @@ How long to wait while a notification is being sent before giving up. ### --notifications-email-from | | | -| ----------- | -------------------------------------------- | +|-------------|----------------------------------------------| | Type | string | | Environment | $CODER_NOTIFICATIONS_EMAIL_FROM | | YAML | notifications.email.from | @@ -1403,7 +1402,7 @@ The sender's address to use. ### --notifications-email-smarthost | | | -| ----------- | ------------------------------------------------- | +|-------------|---------------------------------------------------| | Type | string | | Environment | $CODER_NOTIFICATIONS_EMAIL_SMARTHOST | | YAML | notifications.email.smarthost | @@ -1413,7 +1412,7 @@ The intermediary SMTP host through which emails are sent. ### --notifications-email-hello | | | -| ----------- | --------------------------------------------- | +|-------------|-----------------------------------------------| | Type | string | | Environment | $CODER_NOTIFICATIONS_EMAIL_HELLO | | YAML | notifications.email.hello | @@ -1423,7 +1422,7 @@ The hostname identifying the SMTP server. ### --notifications-email-force-tls | | | -| ----------- | ------------------------------------------------- | +|-------------|---------------------------------------------------| | Type | bool | | Environment | $CODER_NOTIFICATIONS_EMAIL_FORCE_TLS | | YAML | notifications.email.forceTLS | @@ -1433,7 +1432,7 @@ Force a TLS connection to the configured SMTP smarthost. ### --notifications-email-auth-identity | | | -| ----------- | ----------------------------------------------------- | +|-------------|-------------------------------------------------------| | Type | string | | Environment | $CODER_NOTIFICATIONS_EMAIL_AUTH_IDENTITY | | YAML | notifications.email.emailAuth.identity | @@ -1443,7 +1442,7 @@ Identity to use with PLAIN authentication. ### --notifications-email-auth-username | | | -| ----------- | ----------------------------------------------------- | +|-------------|-------------------------------------------------------| | Type | string | | Environment | $CODER_NOTIFICATIONS_EMAIL_AUTH_USERNAME | | YAML | notifications.email.emailAuth.username | @@ -1453,7 +1452,7 @@ Username to use with PLAIN/LOGIN authentication. ### --notifications-email-auth-password | | | -| ----------- | ----------------------------------------------------- | +|-------------|-------------------------------------------------------| | Type | string | | Environment | $CODER_NOTIFICATIONS_EMAIL_AUTH_PASSWORD | @@ -1462,7 +1461,7 @@ Password to use with PLAIN/LOGIN authentication. ### --notifications-email-auth-password-file | | | -| ----------- | ---------------------------------------------------------- | +|-------------|------------------------------------------------------------| | Type | string | | Environment | $CODER_NOTIFICATIONS_EMAIL_AUTH_PASSWORD_FILE | | YAML | notifications.email.emailAuth.passwordFile | @@ -1472,7 +1471,7 @@ File from which to load password for use with PLAIN/LOGIN authentication. ### --notifications-email-tls-starttls | | | -| ----------- | ---------------------------------------------------- | +|-------------|------------------------------------------------------| | Type | bool | | Environment | $CODER_NOTIFICATIONS_EMAIL_TLS_STARTTLS | | YAML | notifications.email.emailTLS.startTLS | @@ -1482,7 +1481,7 @@ Enable STARTTLS to upgrade insecure SMTP connections using TLS. ### --notifications-email-tls-server-name | | | -| ----------- | ------------------------------------------------------ | +|-------------|--------------------------------------------------------| | Type | string | | Environment | $CODER_NOTIFICATIONS_EMAIL_TLS_SERVERNAME | | YAML | notifications.email.emailTLS.serverName | @@ -1492,7 +1491,7 @@ Server name to verify against the target certificate. ### --notifications-email-tls-skip-verify | | | -| ----------- | ------------------------------------------------------------ | +|-------------|--------------------------------------------------------------| | Type | bool | | Environment | $CODER_NOTIFICATIONS_EMAIL_TLS_SKIPVERIFY | | YAML | notifications.email.emailTLS.insecureSkipVerify | @@ -1502,7 +1501,7 @@ Skip verification of the target server's certificate (insecure). ### --notifications-email-tls-ca-cert-file | | | -| ----------- | ------------------------------------------------------ | +|-------------|--------------------------------------------------------| | Type | string | | Environment | $CODER_NOTIFICATIONS_EMAIL_TLS_CACERTFILE | | YAML | notifications.email.emailTLS.caCertFile | @@ -1512,7 +1511,7 @@ CA certificate file to use. ### --notifications-email-tls-cert-file | | | -| ----------- | ---------------------------------------------------- | +|-------------|------------------------------------------------------| | Type | string | | Environment | $CODER_NOTIFICATIONS_EMAIL_TLS_CERTFILE | | YAML | notifications.email.emailTLS.certFile | @@ -1522,7 +1521,7 @@ Certificate file to use. ### --notifications-email-tls-cert-key-file | | | -| ----------- | ------------------------------------------------------- | +|-------------|---------------------------------------------------------| | Type | string | | Environment | $CODER_NOTIFICATIONS_EMAIL_TLS_CERTKEYFILE | | YAML | notifications.email.emailTLS.certKeyFile | @@ -1532,7 +1531,7 @@ Certificate key file to use. ### --notifications-webhook-endpoint | | | -| ----------- | -------------------------------------------------- | +|-------------|----------------------------------------------------| | Type | url | | Environment | $CODER_NOTIFICATIONS_WEBHOOK_ENDPOINT | | YAML | notifications.webhook.endpoint | @@ -1542,7 +1541,7 @@ The endpoint to which to send webhooks. ### --notifications-max-send-attempts | | | -| ----------- | --------------------------------------------------- | +|-------------|-----------------------------------------------------| | Type | int | | Environment | $CODER_NOTIFICATIONS_MAX_SEND_ATTEMPTS | | YAML | notifications.maxSendAttempts | diff --git a/docs/reference/cli/server_create-admin-user.md b/docs/reference/cli/server_create-admin-user.md index 611d95094c92e..361465c896dac 100644 --- a/docs/reference/cli/server_create-admin-user.md +++ b/docs/reference/cli/server_create-admin-user.md @@ -1,5 +1,4 @@ - # server create-admin-user Create a new admin user with the given username, email and password and adds it to every organization. @@ -15,7 +14,7 @@ coder server create-admin-user [flags] ### --postgres-url | | | -| ----------- | ------------------------------------- | +|-------------|---------------------------------------| | Type | string | | Environment | $CODER_PG_CONNECTION_URL | @@ -24,7 +23,7 @@ URL of a PostgreSQL database. If empty, the built-in PostgreSQL deployment will ### --postgres-connection-auth | | | -| ----------- | -------------------------------------- | +|-------------|----------------------------------------| | Type | password\|awsiamrds | | Environment | $CODER_PG_CONNECTION_AUTH | | Default | password | @@ -34,7 +33,7 @@ Type of auth to use when connecting to postgres. ### --ssh-keygen-algorithm | | | -| ----------- | ---------------------------------------- | +|-------------|------------------------------------------| | Type | string | | Environment | $CODER_SSH_KEYGEN_ALGORITHM | | Default | ed25519 | @@ -44,7 +43,7 @@ The algorithm to use for generating ssh keys. Accepted values are "ed25519", "ec ### --username | | | -| ----------- | ---------------------------- | +|-------------|------------------------------| | Type | string | | Environment | $CODER_USERNAME | @@ -53,7 +52,7 @@ The username of the new user. If not specified, you will be prompted via stdin. ### --email | | | -| ----------- | ------------------------- | +|-------------|---------------------------| | Type | string | | Environment | $CODER_EMAIL | @@ -62,7 +61,7 @@ The email of the new user. If not specified, you will be prompted via stdin. ### --password | | | -| ----------- | ---------------------------- | +|-------------|------------------------------| | Type | string | | Environment | $CODER_PASSWORD | @@ -71,7 +70,7 @@ The password of the new user. If not specified, you will be prompted via stdin. ### --raw-url | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Output the raw connection URL instead of a psql command. diff --git a/docs/reference/cli/server_dbcrypt.md b/docs/reference/cli/server_dbcrypt.md index be06560a275ca..f8d638a05ad53 100644 --- a/docs/reference/cli/server_dbcrypt.md +++ b/docs/reference/cli/server_dbcrypt.md @@ -1,5 +1,4 @@ - # server dbcrypt Manage database encryption. @@ -13,7 +12,7 @@ coder server dbcrypt ## Subcommands | Name | Purpose | -| --------------------------------------------------- | ----------------------------------------------------------------------------- | +|-----------------------------------------------------|-------------------------------------------------------------------------------| | [decrypt](./server_dbcrypt_decrypt.md) | Decrypt a previously encrypted database. | | [delete](./server_dbcrypt_delete.md) | Delete all encrypted data from the database. THIS IS A DESTRUCTIVE OPERATION. | | [rotate](./server_dbcrypt_rotate.md) | Rotate database encryption keys. | diff --git a/docs/reference/cli/server_dbcrypt_decrypt.md b/docs/reference/cli/server_dbcrypt_decrypt.md index 69780471817b1..5126ef0fccb25 100644 --- a/docs/reference/cli/server_dbcrypt_decrypt.md +++ b/docs/reference/cli/server_dbcrypt_decrypt.md @@ -1,5 +1,4 @@ - # server dbcrypt decrypt Decrypt a previously encrypted database. @@ -15,7 +14,7 @@ coder server dbcrypt decrypt [flags] ### --postgres-url | | | -| ----------- | ------------------------------------- | +|-------------|---------------------------------------| | Type | string | | Environment | $CODER_PG_CONNECTION_URL | @@ -24,7 +23,7 @@ The connection URL for the Postgres database. ### --postgres-connection-auth | | | -| ----------- | -------------------------------------- | +|-------------|----------------------------------------| | Type | password\|awsiamrds | | Environment | $CODER_PG_CONNECTION_AUTH | | Default | password | @@ -34,7 +33,7 @@ Type of auth to use when connecting to postgres. ### --keys | | | -| ----------- | ---------------------------------------------------------- | +|-------------|------------------------------------------------------------| | Type | string-array | | Environment | $CODER_EXTERNAL_TOKEN_ENCRYPTION_DECRYPT_KEYS | @@ -43,7 +42,7 @@ Keys required to decrypt existing data. Must be a comma-separated list of base64 ### -y, --yes | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Bypass prompts. diff --git a/docs/reference/cli/server_dbcrypt_delete.md b/docs/reference/cli/server_dbcrypt_delete.md index e33560d2ae990..a5e7d16715ecf 100644 --- a/docs/reference/cli/server_dbcrypt_delete.md +++ b/docs/reference/cli/server_dbcrypt_delete.md @@ -1,12 +1,11 @@ - # server dbcrypt delete Delete all encrypted data from the database. THIS IS A DESTRUCTIVE OPERATION. Aliases: -- rm +* rm ## Usage @@ -19,7 +18,7 @@ coder server dbcrypt delete [flags] ### --postgres-url | | | -| ----------- | ---------------------------------------------------------- | +|-------------|------------------------------------------------------------| | Type | string | | Environment | $CODER_EXTERNAL_TOKEN_ENCRYPTION_POSTGRES_URL | @@ -28,7 +27,7 @@ The connection URL for the Postgres database. ### --postgres-connection-auth | | | -| ----------- | -------------------------------------- | +|-------------|----------------------------------------| | Type | password\|awsiamrds | | Environment | $CODER_PG_CONNECTION_AUTH | | Default | password | @@ -38,7 +37,7 @@ Type of auth to use when connecting to postgres. ### -y, --yes | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Bypass prompts. diff --git a/docs/reference/cli/server_dbcrypt_rotate.md b/docs/reference/cli/server_dbcrypt_rotate.md index 02aaa1451f004..322a909a087b8 100644 --- a/docs/reference/cli/server_dbcrypt_rotate.md +++ b/docs/reference/cli/server_dbcrypt_rotate.md @@ -1,5 +1,4 @@ - # server dbcrypt rotate Rotate database encryption keys. @@ -15,7 +14,7 @@ coder server dbcrypt rotate [flags] ### --postgres-url | | | -| ----------- | ------------------------------------- | +|-------------|---------------------------------------| | Type | string | | Environment | $CODER_PG_CONNECTION_URL | @@ -24,7 +23,7 @@ The connection URL for the Postgres database. ### --postgres-connection-auth | | | -| ----------- | -------------------------------------- | +|-------------|----------------------------------------| | Type | password\|awsiamrds | | Environment | $CODER_PG_CONNECTION_AUTH | | Default | password | @@ -34,7 +33,7 @@ Type of auth to use when connecting to postgres. ### --new-key | | | -| ----------- | ------------------------------------------------------------- | +|-------------|---------------------------------------------------------------| | Type | string | | Environment | $CODER_EXTERNAL_TOKEN_ENCRYPTION_ENCRYPT_NEW_KEY | @@ -43,7 +42,7 @@ The new external token encryption key. Must be base64-encoded. ### --old-keys | | | -| ----------- | -------------------------------------------------------------- | +|-------------|----------------------------------------------------------------| | Type | string-array | | Environment | $CODER_EXTERNAL_TOKEN_ENCRYPTION_ENCRYPT_OLD_KEYS | @@ -52,7 +51,7 @@ The old external token encryption keys. Must be a comma-separated list of base64 ### -y, --yes | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Bypass prompts. diff --git a/docs/reference/cli/server_postgres-builtin-serve.md b/docs/reference/cli/server_postgres-builtin-serve.md index dda91692a0f78..55d8ad2a8d269 100644 --- a/docs/reference/cli/server_postgres-builtin-serve.md +++ b/docs/reference/cli/server_postgres-builtin-serve.md @@ -1,5 +1,4 @@ - # server postgres-builtin-serve Run the built-in PostgreSQL deployment. @@ -15,7 +14,7 @@ coder server postgres-builtin-serve [flags] ### --raw-url | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Output the raw connection URL instead of a psql command. diff --git a/docs/reference/cli/server_postgres-builtin-url.md b/docs/reference/cli/server_postgres-builtin-url.md index 8f3eb73307055..f8fdebb042e4a 100644 --- a/docs/reference/cli/server_postgres-builtin-url.md +++ b/docs/reference/cli/server_postgres-builtin-url.md @@ -1,5 +1,4 @@ - # server postgres-builtin-url Output the connection URL for the built-in PostgreSQL deployment. @@ -15,7 +14,7 @@ coder server postgres-builtin-url [flags] ### --raw-url | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Output the raw connection URL instead of a psql command. diff --git a/docs/reference/cli/show.md b/docs/reference/cli/show.md index c3a81f9e2c83f..87c527ed939f9 100644 --- a/docs/reference/cli/show.md +++ b/docs/reference/cli/show.md @@ -1,5 +1,4 @@ - # show Display details of a workspace's resources and agents diff --git a/docs/reference/cli/speedtest.md b/docs/reference/cli/speedtest.md index 664ac2d3f383e..d17125ad2abcb 100644 --- a/docs/reference/cli/speedtest.md +++ b/docs/reference/cli/speedtest.md @@ -1,5 +1,4 @@ - # speedtest Run upload and download tests from your machine to a workspace @@ -15,7 +14,7 @@ coder speedtest [flags] ### -d, --direct | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Specifies whether to wait for a direct connection before testing speed. @@ -23,7 +22,7 @@ Specifies whether to wait for a direct connection before testing speed. ### --direction | | | -| ------- | --------------------- | +|---------|-----------------------| | Type | up\|down | | Default | down | @@ -32,7 +31,7 @@ Specifies whether to run in reverse mode where the client receives and the serve ### -t, --time | | | -| ------- | --------------------- | +|---------|-----------------------| | Type | duration | | Default | 5s | @@ -41,7 +40,7 @@ Specifies the duration to monitor traffic. ### --pcap-file | | | -| ---- | ------------------- | +|------|---------------------| | Type | string | Specifies a file to write a network capture to. @@ -49,7 +48,7 @@ Specifies a file to write a network capture to. ### -c, --column | | | -| ------- | ----------------------------------- | +|---------|-------------------------------------| | Type | [Interval\|Throughput] | | Default | Interval,Throughput | @@ -58,7 +57,7 @@ Columns to display in table output. ### -o, --output | | | -| ------- | ------------------------ | +|---------|--------------------------| | Type | table\|json | | Default | table | diff --git a/docs/reference/cli/ssh.md b/docs/reference/cli/ssh.md index 477c706775e87..72513e0c9ecdc 100644 --- a/docs/reference/cli/ssh.md +++ b/docs/reference/cli/ssh.md @@ -1,5 +1,4 @@ - # ssh Start a shell into a workspace @@ -15,7 +14,7 @@ coder ssh [flags] ### --stdio | | | -| ----------- | ----------------------------- | +|-------------|-------------------------------| | Type | bool | | Environment | $CODER_SSH_STDIO | @@ -24,7 +23,7 @@ Specifies whether to emit SSH output over stdin/stdout. ### -A, --forward-agent | | | -| ----------- | ------------------------------------- | +|-------------|---------------------------------------| | Type | bool | | Environment | $CODER_SSH_FORWARD_AGENT | @@ -33,7 +32,7 @@ Specifies whether to forward the SSH agent specified in $SSH_AUTH_SOCK. ### -G, --forward-gpg | | | -| ----------- | ----------------------------------- | +|-------------|-------------------------------------| | Type | bool | | Environment | $CODER_SSH_FORWARD_GPG | @@ -42,7 +41,7 @@ Specifies whether to forward the GPG agent. Unsupported on Windows workspaces, b ### --identity-agent | | | -| ----------- | -------------------------------------- | +|-------------|----------------------------------------| | Type | string | | Environment | $CODER_SSH_IDENTITY_AGENT | @@ -51,7 +50,7 @@ Specifies which identity agent to use (overrides $SSH_AUTH_SOCK), forward agent ### --workspace-poll-interval | | | -| ----------- | ------------------------------------------- | +|-------------|---------------------------------------------| | Type | duration | | Environment | $CODER_WORKSPACE_POLL_INTERVAL | | Default | 1m | @@ -61,7 +60,7 @@ Specifies how often to poll for workspace automated shutdown. ### --wait | | | -| ----------- | ---------------------------- | +|-------------|------------------------------| | Type | yes\|no\|auto | | Environment | $CODER_SSH_WAIT | | Default | auto | @@ -71,7 +70,7 @@ Specifies whether or not to wait for the startup script to finish executing. Aut ### --no-wait | | | -| ----------- | ------------------------------- | +|-------------|---------------------------------| | Type | bool | | Environment | $CODER_SSH_NO_WAIT | @@ -80,7 +79,7 @@ Enter workspace immediately after the agent has connected. This is the default i ### -l, --log-dir | | | -| ----------- | ------------------------------- | +|-------------|---------------------------------| | Type | string | | Environment | $CODER_SSH_LOG_DIR | @@ -89,7 +88,7 @@ Specify the directory containing SSH diagnostic log files. ### -R, --remote-forward | | | -| ----------- | -------------------------------------- | +|-------------|----------------------------------------| | Type | string-array | | Environment | $CODER_SSH_REMOTE_FORWARD | @@ -98,7 +97,7 @@ Enable remote port forwarding (remote_port:local_address:local_port). ### -e, --env | | | -| ----------- | --------------------------- | +|-------------|-----------------------------| | Type | string-array | | Environment | $CODER_SSH_ENV | @@ -107,7 +106,7 @@ Set environment variable(s) for session (key1=value1,key2=value2,...). ### --disable-autostart | | | -| ----------- | ----------------------------------------- | +|-------------|-------------------------------------------| | Type | bool | | Environment | $CODER_SSH_DISABLE_AUTOSTART | | Default | false | diff --git a/docs/reference/cli/start.md b/docs/reference/cli/start.md index 9be64d5a83d85..1ab6df5a9c891 100644 --- a/docs/reference/cli/start.md +++ b/docs/reference/cli/start.md @@ -1,5 +1,4 @@ - # start Start a workspace @@ -15,7 +14,7 @@ coder start [flags] ### -y, --yes | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Bypass prompts. @@ -23,7 +22,7 @@ Bypass prompts. ### --build-option | | | -| ----------- | -------------------------------- | +|-------------|----------------------------------| | Type | string-array | | Environment | $CODER_BUILD_OPTION | @@ -32,7 +31,7 @@ Build option value in the format "name=value". ### --build-options | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Prompt for one-time build options defined with ephemeral parameters. @@ -40,7 +39,7 @@ Prompt for one-time build options defined with ephemeral parameters. ### --ephemeral-parameter | | | -| ----------- | --------------------------------------- | +|-------------|-----------------------------------------| | Type | string-array | | Environment | $CODER_EPHEMERAL_PARAMETER | @@ -49,7 +48,7 @@ Set the value of ephemeral parameters defined in the template. The format is "na ### --prompt-ephemeral-parameters | | | -| ----------- | ----------------------------------------------- | +|-------------|-------------------------------------------------| | Type | bool | | Environment | $CODER_PROMPT_EPHEMERAL_PARAMETERS | @@ -58,7 +57,7 @@ Prompt to set values of ephemeral parameters defined in the template. If a value ### --parameter | | | -| ----------- | ---------------------------------- | +|-------------|------------------------------------| | Type | string-array | | Environment | $CODER_RICH_PARAMETER | @@ -67,7 +66,7 @@ Rich parameter value in the format "name=value". ### --rich-parameter-file | | | -| ----------- | --------------------------------------- | +|-------------|-----------------------------------------| | Type | string | | Environment | $CODER_RICH_PARAMETER_FILE | @@ -76,7 +75,7 @@ Specify a file path with values for rich parameters defined in the template. The ### --parameter-default | | | -| ----------- | ------------------------------------------ | +|-------------|--------------------------------------------| | Type | string-array | | Environment | $CODER_RICH_PARAMETER_DEFAULT | @@ -85,7 +84,7 @@ Rich parameter default values in the format "name=value". ### --always-prompt | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Always prompt all parameters. Does not pull parameter values from existing workspace. diff --git a/docs/reference/cli/stat.md b/docs/reference/cli/stat.md index 70da8dee47f7a..c84c56ee5afdc 100644 --- a/docs/reference/cli/stat.md +++ b/docs/reference/cli/stat.md @@ -1,5 +1,4 @@ - # stat Show resource usage for the current workspace. @@ -13,7 +12,7 @@ coder stat [flags] ## Subcommands | Name | Purpose | -| ----------------------------------- | -------------------------------- | +|-------------------------------------|----------------------------------| | [cpu](./stat_cpu.md) | Show CPU usage, in cores. | | [mem](./stat_mem.md) | Show memory usage, in gigabytes. | | [disk](./stat_disk.md) | Show disk usage, in gigabytes. | @@ -23,7 +22,7 @@ coder stat [flags] ### -c, --column | | | -| ------- | -------------------------------------------------------------------------------- | +|---------|----------------------------------------------------------------------------------| | Type | [host cpu\|host memory\|home disk\|container cpu\|container memory] | | Default | host cpu,host memory,home disk,container cpu,container memory | @@ -32,7 +31,7 @@ Columns to display in table output. ### -o, --output | | | -| ------- | ------------------------ | +|---------|--------------------------| | Type | table\|json | | Default | table | diff --git a/docs/reference/cli/stat_cpu.md b/docs/reference/cli/stat_cpu.md index 8e86ef4ddc7f9..c7013e1683ec4 100644 --- a/docs/reference/cli/stat_cpu.md +++ b/docs/reference/cli/stat_cpu.md @@ -1,5 +1,4 @@ - # stat cpu Show CPU usage, in cores. @@ -15,7 +14,7 @@ coder stat cpu [flags] ### --host | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Force host CPU measurement. @@ -23,7 +22,7 @@ Force host CPU measurement. ### -o, --output | | | -| ------- | ----------------------- | +|---------|-------------------------| | Type | text\|json | | Default | text | diff --git a/docs/reference/cli/stat_disk.md b/docs/reference/cli/stat_disk.md index 6b5ca22ee5750..4cf80f6075e7d 100644 --- a/docs/reference/cli/stat_disk.md +++ b/docs/reference/cli/stat_disk.md @@ -1,5 +1,4 @@ - # stat disk Show disk usage, in gigabytes. @@ -15,7 +14,7 @@ coder stat disk [flags] ### --path | | | -| ------- | ------------------- | +|---------|---------------------| | Type | string | | Default | / | @@ -24,7 +23,7 @@ Path for which to check disk usage. ### --prefix | | | -| ------- | --------------------------- | +|---------|-----------------------------| | Type | Ki\|Mi\|Gi\|Ti | | Default | Gi | @@ -33,7 +32,7 @@ SI Prefix for disk measurement. ### -o, --output | | | -| ------- | ----------------------- | +|---------|-------------------------| | Type | text\|json | | Default | text | diff --git a/docs/reference/cli/stat_mem.md b/docs/reference/cli/stat_mem.md index 1f8b85d32e5fd..d69ba19ee8d11 100644 --- a/docs/reference/cli/stat_mem.md +++ b/docs/reference/cli/stat_mem.md @@ -1,5 +1,4 @@ - # stat mem Show memory usage, in gigabytes. @@ -15,7 +14,7 @@ coder stat mem [flags] ### --host | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Force host memory measurement. @@ -23,7 +22,7 @@ Force host memory measurement. ### --prefix | | | -| ------- | --------------------------- | +|---------|-----------------------------| | Type | Ki\|Mi\|Gi\|Ti | | Default | Gi | @@ -32,7 +31,7 @@ SI Prefix for memory measurement. ### -o, --output | | | -| ------- | ----------------------- | +|---------|-------------------------| | Type | text\|json | | Default | text | diff --git a/docs/reference/cli/state.md b/docs/reference/cli/state.md index b0e9ca7433750..ebac28a646895 100644 --- a/docs/reference/cli/state.md +++ b/docs/reference/cli/state.md @@ -1,5 +1,4 @@ - # state Manually manage Terraform state to fix broken workspaces @@ -13,6 +12,6 @@ coder state ## Subcommands | Name | Purpose | -| ------------------------------------ | --------------------------------------------- | +|--------------------------------------|-----------------------------------------------| | [pull](./state_pull.md) | Pull a Terraform state file from a workspace. | | [push](./state_push.md) | Push a Terraform state file to a workspace. | diff --git a/docs/reference/cli/state_pull.md b/docs/reference/cli/state_pull.md index 57009750cf64a..089548ab936b2 100644 --- a/docs/reference/cli/state_pull.md +++ b/docs/reference/cli/state_pull.md @@ -1,5 +1,4 @@ - # state pull Pull a Terraform state file from a workspace. @@ -15,7 +14,7 @@ coder state pull [flags] [file] ### -b, --build | | | -| ---- | ---------------- | +|------|------------------| | Type | int | Specify a workspace build to target by name. Defaults to latest. diff --git a/docs/reference/cli/state_push.md b/docs/reference/cli/state_push.md index c39831acc4992..039b03fc01c2f 100644 --- a/docs/reference/cli/state_push.md +++ b/docs/reference/cli/state_push.md @@ -1,5 +1,4 @@ - # state push Push a Terraform state file to a workspace. @@ -15,7 +14,7 @@ coder state push [flags] ### -b, --build | | | -| ---- | ---------------- | +|------|------------------| | Type | int | Specify a workspace build to target by name. Defaults to latest. diff --git a/docs/reference/cli/stop.md b/docs/reference/cli/stop.md index 65197a2cdbb66..dba81c5cf7e92 100644 --- a/docs/reference/cli/stop.md +++ b/docs/reference/cli/stop.md @@ -1,5 +1,4 @@ - # stop Stop a workspace @@ -15,7 +14,7 @@ coder stop [flags] ### -y, --yes | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Bypass prompts. diff --git a/docs/reference/cli/support.md b/docs/reference/cli/support.md index 81bb0509d16ab..b530264f36dd0 100644 --- a/docs/reference/cli/support.md +++ b/docs/reference/cli/support.md @@ -1,5 +1,4 @@ - # support Commands for troubleshooting issues with a Coder deployment. @@ -13,5 +12,5 @@ coder support ## Subcommands | Name | Purpose | -| ------------------------------------------ | --------------------------------------------------------------------------- | +|--------------------------------------------|-----------------------------------------------------------------------------| | [bundle](./support_bundle.md) | Generate a support bundle to troubleshoot issues connecting to a workspace. | diff --git a/docs/reference/cli/support_bundle.md b/docs/reference/cli/support_bundle.md index 602d11297ea3d..59b1fa4130deb 100644 --- a/docs/reference/cli/support_bundle.md +++ b/docs/reference/cli/support_bundle.md @@ -1,5 +1,4 @@ - # support bundle Generate a support bundle to troubleshoot issues connecting to a workspace. @@ -21,7 +20,7 @@ This command generates a file containing detailed troubleshooting information ab ### -y, --yes | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Bypass prompts. @@ -29,7 +28,7 @@ Bypass prompts. ### -O, --output-file | | | -| ----------- | ---------------------------------------------- | +|-------------|------------------------------------------------| | Type | string | | Environment | $CODER_SUPPORT_BUNDLE_OUTPUT_FILE | @@ -38,7 +37,7 @@ File path for writing the generated support bundle. Defaults to coder-support-$( ### --url-override | | | -| ----------- | ----------------------------------------------- | +|-------------|-------------------------------------------------| | Type | string | | Environment | $CODER_SUPPORT_BUNDLE_URL_OVERRIDE | diff --git a/docs/reference/cli/templates.md b/docs/reference/cli/templates.md index 9f3936daf787f..99052aa6c3e20 100644 --- a/docs/reference/cli/templates.md +++ b/docs/reference/cli/templates.md @@ -1,12 +1,11 @@ - # templates Manage templates Aliases: -- template +* template ## Usage @@ -27,7 +26,7 @@ workspaces: ## Subcommands | Name | Purpose | -| ------------------------------------------------ | -------------------------------------------------------------------------------- | +|--------------------------------------------------|----------------------------------------------------------------------------------| | [create](./templates_create.md) | DEPRECATED: Create a template from the current directory or as specified by flag | | [edit](./templates_edit.md) | Edit the metadata of a template by name. | | [init](./templates_init.md) | Get started with a templated template. | diff --git a/docs/reference/cli/templates_archive.md b/docs/reference/cli/templates_archive.md index a229222addf88..ef09707e5f323 100644 --- a/docs/reference/cli/templates_archive.md +++ b/docs/reference/cli/templates_archive.md @@ -1,5 +1,4 @@ - # templates archive Archive unused or failed template versions from a given template(s) @@ -7,7 +6,7 @@ Archive unused or failed template versions from a given template(s) ## Usage ```console -coder templates archive [flags] [template-name...] +coder templates archive [flags] [template-name...] ``` ## Options @@ -15,7 +14,7 @@ coder templates archive [flags] [template-name...] ### -y, --yes | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Bypass prompts. @@ -23,7 +22,7 @@ Bypass prompts. ### --all | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Include all unused template versions. By default, only failed template versions are archived. @@ -31,7 +30,7 @@ Include all unused template versions. By default, only failed template versions ### -O, --org | | | -| ----------- | -------------------------------- | +|-------------|----------------------------------| | Type | string | | Environment | $CODER_ORGANIZATION | diff --git a/docs/reference/cli/templates_create.md b/docs/reference/cli/templates_create.md index 01b153ff2911d..cd3754e383ad5 100644 --- a/docs/reference/cli/templates_create.md +++ b/docs/reference/cli/templates_create.md @@ -1,5 +1,4 @@ - # templates create DEPRECATED: Create a template from the current directory or as specified by flag @@ -15,7 +14,7 @@ coder templates create [flags] [name] ### --private | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Disable the default behavior of granting template access to the 'everyone' group. The template permissions must be updated to allow non-admin users to use this template. @@ -23,7 +22,7 @@ Disable the default behavior of granting template access to the 'everyone' group ### --variables-file | | | -| ---- | ------------------- | +|------|---------------------| | Type | string | Specify a file path with values for Terraform-managed variables. @@ -31,7 +30,7 @@ Specify a file path with values for Terraform-managed variables. ### --variable | | | -| ---- | ------------------------- | +|------|---------------------------| | Type | string-array | Specify a set of values for Terraform-managed variables. @@ -39,7 +38,7 @@ Specify a set of values for Terraform-managed variables. ### --var | | | -| ---- | ------------------------- | +|------|---------------------------| | Type | string-array | Alias of --variable. @@ -47,7 +46,7 @@ Alias of --variable. ### --provisioner-tag | | | -| ---- | ------------------------- | +|------|---------------------------| | Type | string-array | Specify a set of tags to target provisioner daemons. @@ -55,7 +54,7 @@ Specify a set of tags to target provisioner daemons. ### --default-ttl | | | -| ------- | --------------------- | +|---------|-----------------------| | Type | duration | | Default | 24h | @@ -64,7 +63,7 @@ Specify a default TTL for workspaces created from this template. It is the defau ### --failure-ttl | | | -| ------- | --------------------- | +|---------|-----------------------| | Type | duration | | Default | 0h | @@ -73,7 +72,7 @@ Specify a failure TTL for workspaces created from this template. It is the amoun ### --dormancy-threshold | | | -| ------- | --------------------- | +|---------|-----------------------| | Type | duration | | Default | 0h | @@ -82,7 +81,7 @@ Specify a duration workspaces may be inactive prior to being moved to the dorman ### --dormancy-auto-deletion | | | -| ------- | --------------------- | +|---------|-----------------------| | Type | duration | | Default | 0h | @@ -91,7 +90,7 @@ Specify a duration workspaces may be in the dormant state prior to being deleted ### --require-active-version | | | -| ------- | ------------------ | +|---------|--------------------| | Type | bool | | Default | false | @@ -100,7 +99,7 @@ Requires workspace builds to use the active template version. This setting does ### -y, --yes | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Bypass prompts. @@ -108,7 +107,7 @@ Bypass prompts. ### -O, --org | | | -| ----------- | -------------------------------- | +|-------------|----------------------------------| | Type | string | | Environment | $CODER_ORGANIZATION | @@ -117,7 +116,7 @@ Select which organization (uuid or name) to use. ### -d, --directory | | | -| ------- | ------------------- | +|---------|---------------------| | Type | string | | Default | . | @@ -126,7 +125,7 @@ Specify the directory to create from, use '-' to read tar from stdin. ### --ignore-lockfile | | | -| ------- | ------------------ | +|---------|--------------------| | Type | bool | | Default | false | @@ -135,7 +134,7 @@ Ignore warnings about not having a .terraform.lock.hcl file present in the templ ### -m, --message | | | -| ---- | ------------------- | +|------|---------------------| | Type | string | Specify a message describing the changes in this version of the template. Messages longer than 72 characters will be displayed as truncated. diff --git a/docs/reference/cli/templates_delete.md b/docs/reference/cli/templates_delete.md index 55730c7d609d8..9037a39d2b378 100644 --- a/docs/reference/cli/templates_delete.md +++ b/docs/reference/cli/templates_delete.md @@ -1,12 +1,11 @@ - # templates delete Delete templates Aliases: -- rm +* rm ## Usage @@ -19,7 +18,7 @@ coder templates delete [flags] [name...] ### -y, --yes | | | -| ---- | ----------------- | +|------|-------------------| | Type | bool | Bypass prompts. @@ -27,7 +26,7 @@ Bypass prompts. ### -O, --org | | | -| ----------- | -------------------------------- | +|-------------|----------------------------------| | Type | string | | Environment | $CODER_ORGANIZATION | diff --git a/docs/reference/cli/templates_edit.md b/docs/reference/cli/templates_edit.md index 81fdc04d1a176..5d9f6f0a55a0d 100644 --- a/docs/reference/cli/templates_edit.md +++ b/docs/reference/cli/templates_edit.md @@ -1,5 +1,4 @@ - # templates edit Edit the metadata of a template by name. @@ -15,7 +14,7 @@ coder templates edit [flags]