Files
coder/coderd/apidoc/docs.go
Marcin Tojek cfd02d959c docs: api root, buildinfo, csp (#5493)
* docs: Applications

* WIP

* WIP

* WIP

* Fix: consume

* Fix: @Description

* Fix

* docs: apiroot, buildinfo, csp

* Fix: buildinfo

* docs: updatecheck

* docs: apiroot

* Fix: s/none//g

* Fix: godoc nice

* Fix: description

* Fix: It

* Fix: code sample trim empty line

* More fixes

* Fix: br

* Merge

* Fix: no-security on updatecheck

* Fix: code tags

* Fix: enumerated values in code tags

* Rephrased

* Address PR comments

* Fix: URL, id

* Fix: array items

* Fix: any property

* Fix: array item singular
2022-12-22 15:53:14 +01:00

1616 lines
55 KiB
Go

// Package apidoc GENERATED BY SWAG; DO NOT EDIT
// This file was generated by swaggo/swag
package apidoc
import "github.com/swaggo/swag"
const docTemplate = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{escape .Description}}",
"title": "{{.Title}}",
"termsOfService": "https://coder.com/legal/terms-of-service",
"contact": {
"name": "API Support",
"url": "https://coder.com",
"email": "support@coder.com"
},
"license": {
"name": "AGPL-3.0",
"url": "https://github.com/coder/coder/blob/main/LICENSE"
},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/": {
"get": {
"produces": [
"application/json"
],
"tags": [
"General"
],
"summary": "API root handler",
"operationId": "api-root-handler",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/codersdk.Response"
}
}
}
}
},
"/applications/auth-redirect": {
"get": {
"security": [
{
"CoderSessionToken": []
}
],
"tags": [
"Applications"
],
"summary": "Redirect to URI with encrypted API key",
"operationId": "redirect-to-uri-with-encrypted-api-key",
"parameters": [
{
"type": "string",
"description": "Redirect destination",
"name": "redirect_uri",
"in": "query"
}
],
"responses": {
"307": {
"description": "Temporary Redirect"
}
}
}
},
"/applications/host": {
"get": {
"security": [
{
"CoderSessionToken": []
}
],
"produces": [
"application/json"
],
"tags": [
"Applications"
],
"summary": "Get applications host",
"operationId": "get-app-host",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/codersdk.GetAppHostResponse"
}
}
}
}
},
"/authcheck": {
"post": {
"security": [
{
"CoderSessionToken": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Authorization"
],
"summary": "Check authorization",
"operationId": "check-authorization",
"parameters": [
{
"description": "Authorization request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/codersdk.AuthorizationRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/codersdk.AuthorizationResponse"
}
}
}
}
},
"/buildinfo": {
"get": {
"produces": [
"application/json"
],
"tags": [
"General"
],
"summary": "Build info",
"operationId": "build-info",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/codersdk.BuildInfoResponse"
}
}
}
}
},
"/csp/reports": {
"post": {
"security": [
{
"CoderSessionToken": []
}
],
"consumes": [
"application/json"
],
"produces": [
"text/plain"
],
"tags": [
"General"
],
"summary": "Report CSP violations",
"operationId": "report-csp-violations",
"parameters": [
{
"description": "Violation report",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/coderd.cspViolation"
}
}
],
"responses": {
"200": {
"description": "OK"
}
}
}
},
"/organizations/{organization-id}/templates/": {
"post": {
"security": [
{
"CoderSessionToken": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Templates"
],
"summary": "Create template by organization",
"operationId": "create-template-by-organization",
"parameters": [
{
"description": "Request body",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/codersdk.CreateTemplateRequest"
}
},
{
"type": "string",
"description": "Organization ID",
"name": "organization-id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/codersdk.Template"
}
}
}
}
},
"/organizations/{organization}/members/{user}/workspaces": {
"post": {
"security": [
{
"CoderSessionToken": []
}
],
"produces": [
"application/json"
],
"tags": [
"Workspaces"
],
"summary": "Create workspace by organization",
"operationId": "create-workspace-by-organization",
"parameters": [
{
"type": "string",
"format": "uuid",
"description": "Organization ID",
"name": "organization",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Username",
"name": "user",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/codersdk.Workspace"
}
}
}
}
},
"/organizations/{organization}/templates": {
"get": {
"security": [
{
"CoderSessionToken": []
}
],
"produces": [
"application/json"
],
"tags": [
"Templates"
],
"summary": "Get templates by organization",
"operationId": "get-templates-by-organization",
"parameters": [
{
"type": "string",
"format": "uuid",
"description": "Organization ID",
"name": "organization",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/codersdk.Template"
}
}
}
}
}
},
"/organizations/{organization}/templates/{template-name}": {
"get": {
"security": [
{
"CoderSessionToken": []
}
],
"produces": [
"application/json"
],
"tags": [
"Templates"
],
"summary": "Get templates by organization and template name",
"operationId": "get-templates-by-organization-and-template-name",
"parameters": [
{
"type": "string",
"format": "uuid",
"description": "Organization ID",
"name": "organization",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Template name",
"name": "template-name",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/codersdk.Template"
}
}
}
}
},
"/templates/{id}": {
"get": {
"security": [
{
"CoderSessionToken": []
}
],
"produces": [
"application/json"
],
"tags": [
"Templates"
],
"summary": "Update template metadata by ID",
"operationId": "update-template-metadata",
"parameters": [
{
"type": "string",
"format": "uuid",
"description": "Template ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/codersdk.Template"
}
}
}
},
"delete": {
"security": [
{
"CoderSessionToken": []
}
],
"produces": [
"application/json"
],
"tags": [
"Templates"
],
"summary": "Delete template by ID",
"operationId": "delete-template-by-id",
"parameters": [
{
"type": "string",
"format": "uuid",
"description": "Template ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/codersdk.Response"
}
}
}
}
},
"/updatecheck": {
"get": {
"produces": [
"application/json"
],
"tags": [
"General"
],
"summary": "Update check",
"operationId": "update-check",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/codersdk.UpdateCheckResponse"
}
}
}
}
},
"/users/{user}/workspace/{workspacename}": {
"get": {
"security": [
{
"CoderSessionToken": []
}
],
"produces": [
"application/json"
],
"tags": [
"Workspaces"
],
"summary": "Get workspace metadata by owner and workspace name",
"operationId": "get-workspace-metadata-by-owner-and-workspace-name",
"parameters": [
{
"type": "string",
"description": "Owner username",
"name": "user",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Workspace name",
"name": "workspacename",
"in": "path",
"required": true
},
{
"type": "boolean",
"description": "Return data instead of HTTP 404 if the workspace is deleted",
"name": "include_deleted",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/codersdk.Workspace"
}
}
}
}
},
"/workspaces": {
"get": {
"security": [
{
"CoderSessionToken": []
}
],
"produces": [
"application/json"
],
"tags": [
"Workspaces"
],
"summary": "List workspaces",
"operationId": "get-workspaces",
"parameters": [
{
"type": "string",
"description": "Filter by owner username",
"name": "owner",
"in": "query"
},
{
"type": "string",
"description": "Filter by template name",
"name": "template",
"in": "query"
},
{
"type": "string",
"description": "Filter with partial-match by workspace name",
"name": "name",
"in": "query"
},
{
"enum": [
"pending",
"running",
"stopping",
"stopped",
"failed",
"canceling",
"canceled",
"deleted",
"deleting"
],
"type": "string",
"description": "Filter by workspace status",
"name": "status",
"in": "query"
},
{
"enum": [
"connected",
"connecting",
"disconnected",
"timeout"
],
"type": "string",
"description": "Filter by agent status",
"name": "has_agent",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/codersdk.WorkspacesResponse"
}
}
}
}
},
"/workspaces/{id}": {
"get": {
"security": [
{
"CoderSessionToken": []
}
],
"produces": [
"application/json"
],
"tags": [
"Workspaces"
],
"summary": "Get workspace metadata by ID",
"operationId": "get-workspace-metadata-by-id",
"parameters": [
{
"type": "string",
"format": "uuid",
"description": "Workspace ID",
"name": "id",
"in": "path",
"required": true
},
{
"type": "boolean",
"description": "Return data instead of HTTP 404 if the workspace is deleted",
"name": "include_deleted",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/codersdk.Workspace"
}
}
}
}
},
"/workspaces/{workspace}": {
"patch": {
"security": [
{
"CoderSessionToken": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Workspaces"
],
"summary": "Update workspace metadata by ID",
"operationId": "update-workspace-metadata-by-id",
"parameters": [
{
"type": "string",
"format": "uuid",
"description": "Workspace ID",
"name": "workspace",
"in": "path",
"required": true
},
{
"description": "Metadata update request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/codersdk.UpdateWorkspaceRequest"
}
}
],
"responses": {
"204": {
"description": "No Content"
}
}
}
},
"/workspaces/{workspace}/autostart": {
"put": {
"security": [
{
"CoderSessionToken": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Workspaces"
],
"summary": "Update workspace autostart schedule by ID",
"operationId": "update-workspace-autostart-schedule-by-id",
"parameters": [
{
"type": "string",
"format": "uuid",
"description": "Workspace ID",
"name": "workspace",
"in": "path",
"required": true
},
{
"description": "Schedule update request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/codersdk.UpdateWorkspaceAutostartRequest"
}
}
],
"responses": {
"204": {
"description": "No Content"
}
}
}
},
"/workspaces/{workspace}/extend": {
"put": {
"security": [
{
"CoderSessionToken": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Workspaces"
],
"summary": "Extend workspace deadline by ID",
"operationId": "extend-workspace-deadline-by-id",
"parameters": [
{
"type": "string",
"format": "uuid",
"description": "Workspace ID",
"name": "workspace",
"in": "path",
"required": true
},
{
"description": "Extend deadline update request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/codersdk.PutExtendWorkspaceRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/codersdk.Response"
}
}
}
}
},
"/workspaces/{workspace}/ttl": {
"put": {
"security": [
{
"CoderSessionToken": []
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Workspaces"
],
"summary": "Update workspace TTL by ID",
"operationId": "update-workspace-ttl-by-id",
"parameters": [
{
"type": "string",
"format": "uuid",
"description": "Workspace ID",
"name": "workspace",
"in": "path",
"required": true
},
{
"description": "Workspace TTL update request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/codersdk.UpdateWorkspaceTTLRequest"
}
}
],
"responses": {
"204": {
"description": "No Content"
}
}
}
},
"/workspaces/{workspace}/watch": {
"get": {
"security": [
{
"CoderSessionToken": []
}
],
"produces": [
"text/event-stream"
],
"tags": [
"Workspaces"
],
"summary": "Watch workspace by ID",
"operationId": "watch-workspace-id",
"parameters": [
{
"type": "string",
"format": "uuid",
"description": "Workspace ID",
"name": "workspace",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/codersdk.Response"
}
}
}
}
}
},
"definitions": {
"coderd.cspViolation": {
"type": "object",
"properties": {
"csp-report": {
"type": "object",
"additionalProperties": true
}
}
},
"codersdk.AuthorizationCheck": {
"description": "AuthorizationCheck is used to check if the currently authenticated user (or the specified user) can do a given action to a given set of objects.",
"type": "object",
"properties": {
"action": {
"type": "string",
"enum": [
"create",
"read",
"update",
"delete"
]
},
"object": {
"description": "Object can represent a \"set\" of objects, such as:\n\t- All workspaces in an organization\n\t- All workspaces owned by me\n\t- All workspaces across the entire product\nWhen defining an object, use the most specific language when possible to\nproduce the smallest set. Meaning to set as many fields on 'Object' as\nyou can. Example, if you want to check if you can update all workspaces\nowned by 'me', try to also add an 'OrganizationID' to the settings.\nOmitting the 'OrganizationID' could produce the incorrect value, as\nworkspaces have both ` + "`" + `user` + "`" + ` and ` + "`" + `organization` + "`" + ` owners.",
"$ref": "#/definitions/codersdk.AuthorizationObject"
}
}
},
"codersdk.AuthorizationObject": {
"description": "AuthorizationObject can represent a \"set\" of objects, such as: all workspaces in an organization, all workspaces owned by me, all workspaces across the entire product.",
"type": "object",
"properties": {
"organization_id": {
"description": "OrganizationID (optional) adds the set constraint to all resources owned by a given organization.",
"type": "string"
},
"owner_id": {
"description": "OwnerID (optional) adds the set constraint to all resources owned by a given user.",
"type": "string"
},
"resource_id": {
"description": "ResourceID (optional) reduces the set to a singular resource. This assigns\na resource ID to the resource type, eg: a single workspace.\nThe rbac library will not fetch the resource from the database, so if you\nare using this option, you should also set the owner ID and organization ID\nif possible. Be as specific as possible using all the fields relevant.",
"type": "string"
},
"resource_type": {
"description": "ResourceType is the name of the resource.\n` + "`" + `./coderd/rbac/object.go` + "`" + ` has the list of valid resource types.",
"type": "string"
}
}
},
"codersdk.AuthorizationRequest": {
"type": "object",
"properties": {
"checks": {
"description": "Checks is a map keyed with an arbitrary string to a permission check.\nThe key can be any string that is helpful to the caller, and allows\nmultiple permission checks to be run in a single request.\nThe key ensures that each permission check has the same key in the\nresponse.",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/codersdk.AuthorizationCheck"
}
}
}
},
"codersdk.AuthorizationResponse": {
"type": "object",
"additionalProperties": {
"type": "boolean"
}
},
"codersdk.BuildInfoResponse": {
"type": "object",
"properties": {
"external_url": {
"description": "ExternalURL references the current Coder version.\nFor production builds, this will link directly to a release. For development builds, this will link to a commit.",
"type": "string"
},
"version": {
"description": "Version returns the semantic version of the build.",
"type": "string"
}
}
},
"codersdk.CreateParameterRequest": {
"description": "CreateParameterRequest is a structure used to create a new parameter value for a scope.",
"type": "object",
"required": [
"destination_scheme",
"name",
"source_scheme",
"source_value"
],
"properties": {
"copy_from_parameter": {
"description": "CloneID allows copying the value of another parameter.\nThe other param must be related to the same template_id for this to\nsucceed.\nNo other fields are required if using this, as all fields will be copied\nfrom the other parameter.",
"type": "string"
},
"destination_scheme": {
"type": "string",
"enum": [
"environment_variable",
"provisioner_variable"
]
},
"name": {
"type": "string"
},
"source_scheme": {
"type": "string",
"enum": [
"data"
]
},
"source_value": {
"type": "string"
}
}
},
"codersdk.CreateTemplateRequest": {
"type": "object",
"required": [
"name",
"template_version_id"
],
"properties": {
"allow_user_cancel_workspace_jobs": {
"description": "Allow users to cancel in-progress workspace jobs.\n*bool as the default value is \"true\".",
"type": "boolean"
},
"default_ttl_ms": {
"description": "DefaultTTLMillis allows optionally specifying the default TTL\nfor all workspaces created from this template.",
"type": "integer"
},
"description": {
"description": "Description is a description of what the template contains. It must be\nless than 128 bytes.",
"type": "string"
},
"display_name": {
"description": "DisplayName is the displayed name of the template.",
"type": "string"
},
"icon": {
"description": "Icon is a relative path or external URL that specifies\nan icon to be displayed in the dashboard.",
"type": "string"
},
"name": {
"description": "Name is the name of the template.",
"type": "string"
},
"parameter_values": {
"type": "array",
"items": {
"$ref": "#/definitions/codersdk.CreateParameterRequest"
}
},
"template_version_id": {
"description": "VersionID is an in-progress or completed job to use as an initial version\nof the template.\n\nThis is required on creation to enable a user-flow of validating a\ntemplate works. There is no reason the data-model cannot support empty\ntemplates, but it doesn't make sense for users.",
"type": "string"
}
}
},
"codersdk.DERPRegion": {
"type": "object",
"properties": {
"latency_ms": {
"type": "number"
},
"preferred": {
"type": "boolean"
}
}
},
"codersdk.GetAppHostResponse": {
"type": "object",
"properties": {
"host": {
"description": "Host is the externally accessible URL for the Coder instance.",
"type": "string"
}
}
},
"codersdk.Healthcheck": {
"type": "object",
"properties": {
"interval": {
"description": "Interval specifies the seconds between each health check.",
"type": "integer"
},
"threshold": {
"description": "Threshold specifies the number of consecutive failed health checks before returning \"unhealthy\".",
"type": "integer"
},
"url": {
"description": "URL specifies the endpoint to check for the app health.",
"type": "string"
}
}
},
"codersdk.NullTime": {
"type": "object",
"properties": {
"time": {
"type": "string"
},
"valid": {
"description": "Valid is true if Time is not NULL",
"type": "boolean"
}
}
},
"codersdk.ProvisionerJob": {
"type": "object",
"properties": {
"canceled_at": {
"type": "string"
},
"completed_at": {
"type": "string"
},
"created_at": {
"type": "string"
},
"error": {
"type": "string"
},
"file_id": {
"type": "string"
},
"id": {
"type": "string"
},
"started_at": {
"type": "string"
},
"status": {
"type": "string"
},
"tags": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"worker_id": {
"type": "string"
}
}
},
"codersdk.PutExtendWorkspaceRequest": {
"type": "object",
"required": [
"deadline"
],
"properties": {
"deadline": {
"type": "string"
}
}
},
"codersdk.Response": {
"type": "object",
"properties": {
"detail": {
"description": "Detail is a debug message that provides further insight into why the\naction failed. This information can be technical and a regular golang\nerr.Error() text.\n- \"database: too many open connections\"\n- \"stat: too many open files\"",
"type": "string"
},
"message": {
"description": "Message is an actionable message that depicts actions the request took.\nThese messages should be fully formed sentences with proper punctuation.\nExamples:\n- \"A user has been created.\"\n- \"Failed to create a user.\"",
"type": "string"
},
"validations": {
"description": "Validations are form field-specific friendly error messages. They will be\nshown on a form field in the UI. These can also be used to add additional\ncontext if there is a set of errors in the primary 'Message'.",
"type": "array",
"items": {
"$ref": "#/definitions/codersdk.ValidationError"
}
}
}
},
"codersdk.Template": {
"type": "object",
"properties": {
"active_user_count": {
"description": "ActiveUserCount is set to -1 when loading.",
"type": "integer"
},
"active_version_id": {
"type": "string"
},
"allow_user_cancel_workspace_jobs": {
"type": "boolean"
},
"build_time_stats": {
"$ref": "#/definitions/codersdk.TemplateBuildTimeStats"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"created_by_id": {
"type": "string",
"format": "uuid"
},
"created_by_name": {
"type": "string"
},
"default_ttl_ms": {
"type": "integer"
},
"description": {
"type": "string"
},
"display_name": {
"type": "string"
},
"icon": {
"type": "string"
},
"id": {
"type": "string",
"format": "uuid"
},
"name": {
"type": "string"
},
"organization_id": {
"type": "string",
"format": "uuid"
},
"provisioner": {
"type": "string"
},
"updated_at": {
"type": "string",
"format": "date-time"
},
"workspace_owner_count": {
"type": "integer"
}
}
},
"codersdk.TemplateBuildTimeStats": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/codersdk.TransitionStats"
}
},
"codersdk.TransitionStats": {
"type": "object",
"properties": {
"p50": {
"type": "integer",
"example": 123
},
"p95": {
"type": "integer",
"example": 146
}
}
},
"codersdk.UpdateCheckResponse": {
"type": "object",
"properties": {
"current": {
"description": "Current indicates whether the server version is the same as the latest.",
"type": "boolean"
},
"url": {
"description": "URL to download the latest release of Coder.",
"type": "string"
},
"version": {
"description": "Version is the semantic version for the latest release of Coder.",
"type": "string"
}
}
},
"codersdk.UpdateWorkspaceAutostartRequest": {
"type": "object",
"properties": {
"schedule": {
"type": "string"
}
}
},
"codersdk.UpdateWorkspaceRequest": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
}
},
"codersdk.UpdateWorkspaceTTLRequest": {
"type": "object",
"properties": {
"ttl_ms": {
"type": "integer"
}
}
},
"codersdk.ValidationError": {
"type": "object",
"required": [
"detail",
"field"
],
"properties": {
"detail": {
"type": "string"
},
"field": {
"type": "string"
}
}
},
"codersdk.Workspace": {
"type": "object",
"properties": {
"autostart_schedule": {
"type": "string"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"id": {
"type": "string",
"format": "uuid"
},
"last_used_at": {
"type": "string",
"format": "date-time"
},
"latest_build": {
"$ref": "#/definitions/codersdk.WorkspaceBuild"
},
"name": {
"type": "string"
},
"outdated": {
"type": "boolean"
},
"owner_id": {
"type": "string",
"format": "uuid"
},
"owner_name": {
"type": "string"
},
"template_allow_user_cancel_workspace_jobs": {
"type": "boolean"
},
"template_display_name": {
"type": "string"
},
"template_icon": {
"type": "string"
},
"template_id": {
"type": "string",
"format": "uuid"
},
"template_name": {
"type": "string"
},
"ttl_ms": {
"type": "integer"
},
"updated_at": {
"type": "string",
"format": "date-time"
}
}
},
"codersdk.WorkspaceAgent": {
"type": "object",
"properties": {
"apps": {
"type": "array",
"items": {
"$ref": "#/definitions/codersdk.WorkspaceApp"
}
},
"architecture": {
"type": "string"
},
"connection_timeout_seconds": {
"type": "integer"
},
"created_at": {
"type": "string"
},
"directory": {
"type": "string"
},
"disconnected_at": {
"type": "string"
},
"environment_variables": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"first_connected_at": {
"type": "string"
},
"id": {
"type": "string"
},
"instance_id": {
"type": "string"
},
"last_connected_at": {
"type": "string"
},
"latency": {
"description": "DERPLatency is mapped by region name (e.g. \"New York City\", \"Seattle\").",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/codersdk.DERPRegion"
}
},
"name": {
"type": "string"
},
"operating_system": {
"type": "string"
},
"resource_id": {
"type": "string"
},
"startup_script": {
"type": "string"
},
"status": {
"type": "string"
},
"troubleshooting_url": {
"type": "string"
},
"updated_at": {
"type": "string"
},
"version": {
"type": "string"
}
}
},
"codersdk.WorkspaceApp": {
"type": "object",
"properties": {
"command": {
"type": "string"
},
"display_name": {
"description": "DisplayName is a friendly name for the app.",
"type": "string"
},
"external": {
"description": "External specifies whether the URL should be opened externally on\nthe client or not.",
"type": "boolean"
},
"health": {
"type": "string"
},
"healthcheck": {
"description": "Healthcheck specifies the configuration for checking app health.",
"$ref": "#/definitions/codersdk.Healthcheck"
},
"icon": {
"description": "Icon is a relative path or external URL that specifies\nan icon to be displayed in the dashboard.",
"type": "string"
},
"id": {
"type": "string"
},
"sharing_level": {
"type": "string"
},
"slug": {
"description": "Slug is a unique identifier within the agent.",
"type": "string"
},
"subdomain": {
"description": "Subdomain denotes whether the app should be accessed via a path on the\n` + "`" + `coder server` + "`" + ` or via a hostname-based dev URL. If this is set to true\nand there is no app wildcard configured on the server, the app will not\nbe accessible in the UI.",
"type": "boolean"
},
"url": {
"description": "URL is the address being proxied to inside the workspace.\nIf external is specified, this will be opened on the client.",
"type": "string"
}
}
},
"codersdk.WorkspaceBuild": {
"type": "object",
"properties": {
"build_number": {
"type": "integer"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"daily_cost": {
"type": "integer"
},
"deadline": {
"$ref": "#/definitions/codersdk.NullTime"
},
"id": {
"type": "string",
"format": "uuid"
},
"initiator_id": {
"type": "string",
"format": "uuid"
},
"initiator_name": {
"type": "string"
},
"job": {
"$ref": "#/definitions/codersdk.ProvisionerJob"
},
"reason": {
"type": "string"
},
"resources": {
"type": "array",
"items": {
"$ref": "#/definitions/codersdk.WorkspaceResource"
}
},
"status": {
"type": "string",
"enum": [
"pending",
"starting",
"running",
"stopping",
"stopped",
"failed",
"canceling",
"canceled",
"deleting",
"deleted"
]
},
"template_version_id": {
"type": "string",
"format": "uuid"
},
"template_version_name": {
"type": "string"
},
"transition": {
"type": "string",
"enum": [
"start",
"stop",
"delete"
]
},
"updated_at": {
"type": "string",
"format": "date-time"
},
"workspace_id": {
"type": "string",
"format": "uuid"
},
"workspace_name": {
"type": "string"
},
"workspace_owner_id": {
"type": "string",
"format": "uuid"
},
"workspace_owner_name": {
"type": "string"
}
}
},
"codersdk.WorkspaceResource": {
"type": "object",
"properties": {
"agents": {
"type": "array",
"items": {
"$ref": "#/definitions/codersdk.WorkspaceAgent"
}
},
"created_at": {
"type": "string",
"format": "date-time"
},
"daily_cost": {
"type": "integer"
},
"hide": {
"type": "boolean"
},
"icon": {
"type": "string"
},
"id": {
"type": "string",
"format": "uuid"
},
"job_id": {
"type": "string",
"format": "uuid"
},
"metadata": {
"type": "array",
"items": {
"$ref": "#/definitions/codersdk.WorkspaceResourceMetadata"
}
},
"name": {
"type": "string"
},
"type": {
"type": "string"
},
"workspace_transition": {
"type": "string",
"enum": [
"start",
"stop",
"delete"
]
}
}
},
"codersdk.WorkspaceResourceMetadata": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"sensitive": {
"type": "boolean"
},
"value": {
"type": "string"
}
}
},
"codersdk.WorkspacesResponse": {
"type": "object",
"properties": {
"count": {
"type": "integer"
},
"workspaces": {
"type": "array",
"items": {
"$ref": "#/definitions/codersdk.Workspace"
}
}
}
}
},
"securityDefinitions": {
"CoderSessionToken": {
"type": "apiKey",
"name": "Coder-Session-Token",
"in": "header"
}
}
}`
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "2.0",
Host: "",
BasePath: "/api/v2",
Schemes: []string{},
Title: "Coder API",
Description: "Coderd is the service created by running coder server. It is a thin API that connects workspaces, provisioners and users. coderd stores its state in Postgres and is the only service that communicates with Postgres.",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
}
func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}