From a23a471034b1d21ce0fe54afb91d382d8a5e99ba Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Tue, 10 Jan 2023 15:47:08 +0100 Subject: [PATCH] docs: update swaggo/swag v1.8.9 (#5590) * docs: update swaggo/swag v1.8.9 * Fix: format * swaggo: time.Duration * swaggo: provisionertype * Fix: AuthorizationObject * Fix: enums * Fix: netip.Addr * Fix: clickable response properties --- .swaggo | 6 + coderd/apidoc/docs.go | 381 ++++++++- coderd/apidoc/swagger.json | 348 +++++++-- codersdk/authorization.go | 5 +- codersdk/templates.go | 2 +- docs/api/agents.md | 6 +- docs/api/audit.md | 8 +- docs/api/builds.md | 334 ++++---- docs/api/general.md | 42 +- docs/api/parameters.md | 22 +- docs/api/schemas.md | 727 ++++++++++++------ docs/api/templates.md | 62 +- docs/api/workspaces.md | 8 +- scripts/apidocgen/generate.sh | 2 +- scripts/apidocgen/markdown-template/main.dot | 10 +- .../apidocgen/markdown-template/responses.def | 3 +- 16 files changed, 1413 insertions(+), 553 deletions(-) diff --git a/.swaggo b/.swaggo index 4dcbb3ff4b..e4b76f3ed8 100644 --- a/.swaggo +++ b/.swaggo @@ -1,2 +1,8 @@ // Replace all NullTime with string replace github.com/coder/coder/codersdk.NullTime string +// Prevent swaggo from rendering enums for time.Duration +replace time.Duration int64 +// Do not expose "echo" provider +replace github.com/coder/coder/codersdk.ProvisionerType string +// Do not render netip.Addr +replace netip.Addr string diff --git a/coderd/apidoc/docs.go b/coderd/apidoc/docs.go index bb38f325e0..7e7f19de03 100644 --- a/coderd/apidoc/docs.go +++ b/coderd/apidoc/docs.go @@ -1918,6 +1918,23 @@ const docTemplate = `{ } } }, + "codersdk.AuditAction": { + "type": "string", + "enum": [ + "create", + "write", + "delete", + "start", + "stop" + ], + "x-enum-varnames": [ + "AuditActionCreate", + "AuditActionWrite", + "AuditActionDelete", + "AuditActionStart", + "AuditActionStop" + ] + }, "codersdk.AuditDiff": { "type": "object", "additionalProperties": { @@ -1938,7 +1955,7 @@ const docTemplate = `{ "type": "object", "properties": { "action": { - "type": "string" + "$ref": "#/definitions/codersdk.AuditAction" }, "additional_fields": { "type": "array", @@ -1956,7 +1973,7 @@ const docTemplate = `{ "type": "string" }, "ip": { - "$ref": "#/definitions/netip.Addr" + "type": "string" }, "is_deleted": { "type": "boolean" @@ -1981,7 +1998,7 @@ const docTemplate = `{ "type": "string" }, "resource_type": { - "type": "string" + "$ref": "#/definitions/codersdk.ResourceType" }, "status_code": { "type": "integer" @@ -2025,8 +2042,12 @@ const docTemplate = `{ ] }, "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" + "description": "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.\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.", + "allOf": [ + { + "$ref": "#/definitions/codersdk.AuthorizationObject" + } + ] } } }, @@ -2098,6 +2119,19 @@ const docTemplate = `{ } } }, + "codersdk.BuildReason": { + "type": "string", + "enum": [ + "initiator", + "autostart", + "autostop" + ], + "x-enum-varnames": [ + "BuildReasonInitiator", + "BuildReasonAutostart", + "BuildReasonAutostop" + ] + }, "codersdk.CreateParameterRequest": { "description": "CreateParameterRequest is a structure used to create a new parameter value for a scope.", "type": "object", @@ -2113,21 +2147,29 @@ const docTemplate = `{ "type": "string" }, "destination_scheme": { - "type": "string", "enum": [ "none", "environment_variable", "provisioner_variable" + ], + "allOf": [ + { + "$ref": "#/definitions/codersdk.ParameterDestinationScheme" + } ] }, "name": { "type": "string" }, "source_scheme": { - "type": "string", "enum": [ "none", "data" + ], + "allOf": [ + { + "$ref": "#/definitions/codersdk.ParameterSourceScheme" + } ] }, "source_value": { @@ -2182,20 +2224,23 @@ const docTemplate = `{ "type": "object", "properties": { "action": { - "type": "string", "enum": [ "create", "write", "delete", "start", "stop" + ], + "allOf": [ + { + "$ref": "#/definitions/codersdk.AuditAction" + } ] }, "resource_id": { "type": "string" }, "resource_type": { - "type": "string", "enum": [ "organization", "template", @@ -2206,6 +2251,11 @@ const docTemplate = `{ "git_ssh_key", "api_key", "group" + ], + "allOf": [ + { + "$ref": "#/definitions/codersdk.ResourceType" + } ] }, "time": { @@ -2243,12 +2293,16 @@ const docTemplate = `{ "type": "string" }, "transition": { - "type": "string", "enum": [ "create", "start", "stop", "delete" + ], + "allOf": [ + { + "$ref": "#/definitions/codersdk.WorkspaceTransition" + } ] } } @@ -2317,7 +2371,11 @@ const docTemplate = `{ }, "address": { "description": "DEPRECATED: Use HTTPAddress or TLS.Address instead.", - "$ref": "#/definitions/codersdk.DeploymentConfigField-string" + "allOf": [ + { + "$ref": "#/definitions/codersdk.DeploymentConfigField-string" + } + ] }, "agent_fallback_troubleshooting_url": { "$ref": "#/definitions/codersdk.DeploymentConfigField-string" @@ -2445,7 +2503,10 @@ const docTemplate = `{ "type": "string" }, "value": { - "$ref": "#/definitions/codersdk.GitAuthConfig" + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.GitAuthConfig" + } } } }, @@ -2480,7 +2541,10 @@ const docTemplate = `{ "type": "string" }, "value": { - "type": "string" + "type": "array", + "items": { + "type": "string" + } } } }, @@ -2684,6 +2748,34 @@ const docTemplate = `{ } } }, + "codersdk.LogLevel": { + "type": "string", + "enum": [ + "trace", + "debug", + "info", + "warn", + "error" + ], + "x-enum-varnames": [ + "LogLevelTrace", + "LogLevelDebug", + "LogLevelInfo", + "LogLevelWarn", + "LogLevelError" + ] + }, + "codersdk.LogSource": { + "type": "string", + "enum": [ + "provisioner_daemon", + "provisioner" + ], + "x-enum-varnames": [ + "LogSourceProvisionerDaemon", + "LogSourceProvisioner" + ] + }, "codersdk.OAuth2Config": { "type": "object", "properties": { @@ -2756,11 +2848,15 @@ const docTemplate = `{ "format": "date-time" }, "destination_scheme": { - "type": "string", "enum": [ "none", "environment_variable", "provisioner_variable" + ], + "allOf": [ + { + "$ref": "#/definitions/codersdk.ParameterDestinationScheme" + } ] }, "id": { @@ -2771,11 +2867,15 @@ const docTemplate = `{ "type": "string" }, "scope": { - "type": "string", "enum": [ "template", "workspace", "import_job" + ], + "allOf": [ + { + "$ref": "#/definitions/codersdk.ParameterScope" + } ] }, "scope_id": { @@ -2783,10 +2883,14 @@ const docTemplate = `{ "format": "uuid" }, "source_scheme": { - "type": "string", "enum": [ "none", "data" + ], + "allOf": [ + { + "$ref": "#/definitions/codersdk.ParameterSourceScheme" + } ] }, "updated_at": { @@ -2795,6 +2899,43 @@ const docTemplate = `{ } } }, + "codersdk.ParameterDestinationScheme": { + "type": "string", + "enum": [ + "none", + "environment_variable", + "provisioner_variable" + ], + "x-enum-varnames": [ + "ParameterDestinationSchemeNone", + "ParameterDestinationSchemeEnvironmentVariable", + "ParameterDestinationSchemeProvisionerVariable" + ] + }, + "codersdk.ParameterScope": { + "type": "string", + "enum": [ + "template", + "workspace", + "import_job" + ], + "x-enum-varnames": [ + "ParameterTemplate", + "ParameterWorkspace", + "ParameterImportJob" + ] + }, + "codersdk.ParameterSourceScheme": { + "type": "string", + "enum": [ + "none", + "data" + ], + "x-enum-varnames": [ + "ParameterSourceSchemeNone", + "ParameterSourceSchemeData" + ] + }, "codersdk.PostWorkspaceAgentVersionRequest": { "description": "x-apidocgen:skip", "type": "object", @@ -2811,7 +2952,7 @@ const docTemplate = `{ "description": "Healths is a map of the workspace app name and the health of the app.", "type": "object", "additionalProperties": { - "type": "string" + "$ref": "#/definitions/codersdk.WorkspaceAppHealth" } } } @@ -2886,7 +3027,6 @@ const docTemplate = `{ "format": "date-time" }, "status": { - "type": "string", "enum": [ "pending", "running", @@ -2894,6 +3034,11 @@ const docTemplate = `{ "canceling", "canceled", "failed" + ], + "allOf": [ + { + "$ref": "#/definitions/codersdk.ProvisionerJobStatus" + } ] }, "tags": { @@ -2919,17 +3064,21 @@ const docTemplate = `{ "type": "integer" }, "log_level": { - "type": "string", "enum": [ "trace", "debug", "info", "warn", "error" + ], + "allOf": [ + { + "$ref": "#/definitions/codersdk.LogLevel" + } ] }, "log_source": { - "type": "string" + "$ref": "#/definitions/codersdk.LogSource" }, "output": { "type": "string" @@ -2939,6 +3088,25 @@ const docTemplate = `{ } } }, + "codersdk.ProvisionerJobStatus": { + "type": "string", + "enum": [ + "pending", + "running", + "succeeded", + "canceling", + "canceled", + "failed" + ], + "x-enum-varnames": [ + "ProvisionerJobPending", + "ProvisionerJobRunning", + "ProvisionerJobSucceeded", + "ProvisionerJobCanceling", + "ProvisionerJobCanceled", + "ProvisionerJobFailed" + ] + }, "codersdk.PutExtendWorkspaceRequest": { "type": "object", "required": [ @@ -2961,6 +3129,31 @@ const docTemplate = `{ } } }, + "codersdk.ResourceType": { + "type": "string", + "enum": [ + "organization", + "template", + "template_version", + "user", + "workspace", + "workspace_build", + "git_ssh_key", + "api_key", + "group" + ], + "x-enum-varnames": [ + "ResourceTypeOrganization", + "ResourceTypeTemplate", + "ResourceTypeTemplateVersion", + "ResourceTypeUser", + "ResourceTypeWorkspace", + "ResourceTypeWorkspaceBuild", + "ResourceTypeGitSSHKey", + "ResourceTypeAPIKey", + "ResourceTypeGroup" + ] + }, "codersdk.Response": { "type": "object", "properties": { @@ -3100,7 +3293,10 @@ const docTemplate = `{ "format": "uuid" }, "provisioner": { - "type": "string" + "type": "string", + "enum": [ + "terraform" + ] }, "updated_at": { "type": "string", @@ -3231,13 +3427,24 @@ const docTemplate = `{ } }, "status": { - "type": "string" + "$ref": "#/definitions/codersdk.UserStatus" }, "username": { "type": "string" } } }, + "codersdk.UserStatus": { + "type": "string", + "enum": [ + "active", + "suspended" + ], + "x-enum-varnames": [ + "UserStatusActive", + "UserStatusSuspended" + ] + }, "codersdk.ValidationError": { "type": "object", "required": [ @@ -3380,12 +3587,16 @@ const docTemplate = `{ "type": "string" }, "status": { - "type": "string", "enum": [ "connecting", "connected", "disconnected", "timeout" + ], + "allOf": [ + { + "$ref": "#/definitions/codersdk.WorkspaceAgentStatus" + } ] }, "troubleshooting_url": { @@ -3458,6 +3669,21 @@ const docTemplate = `{ } } }, + "codersdk.WorkspaceAgentStatus": { + "type": "string", + "enum": [ + "connecting", + "connected", + "disconnected", + "timeout" + ], + "x-enum-varnames": [ + "WorkspaceAgentConnecting", + "WorkspaceAgentConnected", + "WorkspaceAgentDisconnected", + "WorkspaceAgentTimeout" + ] + }, "codersdk.WorkspaceApp": { "type": "object", "properties": { @@ -3473,11 +3699,15 @@ const docTemplate = `{ "type": "boolean" }, "health": { - "type": "string" + "$ref": "#/definitions/codersdk.WorkspaceAppHealth" }, "healthcheck": { "description": "Healthcheck specifies the configuration for checking app health.", - "$ref": "#/definitions/codersdk.Healthcheck" + "allOf": [ + { + "$ref": "#/definitions/codersdk.Healthcheck" + } + ] }, "icon": { "description": "Icon is a relative path or external URL that specifies\nan icon to be displayed in the dashboard.", @@ -3488,11 +3718,15 @@ const docTemplate = `{ "format": "uuid" }, "sharing_level": { - "type": "string", "enum": [ "owner", "authenticated", "public" + ], + "allOf": [ + { + "$ref": "#/definitions/codersdk.WorkspaceAppSharingLevel" + } ] }, "slug": { @@ -3509,6 +3743,34 @@ const docTemplate = `{ } } }, + "codersdk.WorkspaceAppHealth": { + "type": "string", + "enum": [ + "disabled", + "initializing", + "healthy", + "unhealthy" + ], + "x-enum-varnames": [ + "WorkspaceAppHealthDisabled", + "WorkspaceAppHealthInitializing", + "WorkspaceAppHealthHealthy", + "WorkspaceAppHealthUnhealthy" + ] + }, + "codersdk.WorkspaceAppSharingLevel": { + "type": "string", + "enum": [ + "owner", + "authenticated", + "public" + ], + "x-enum-varnames": [ + "WorkspaceAppSharingLevelOwner", + "WorkspaceAppSharingLevelAuthenticated", + "WorkspaceAppSharingLevelPublic" + ] + }, "codersdk.WorkspaceBuild": { "type": "object", "properties": { @@ -3541,11 +3803,15 @@ const docTemplate = `{ "$ref": "#/definitions/codersdk.ProvisionerJob" }, "reason": { - "type": "string", "enum": [ "initiator", "autostart", "autostop" + ], + "allOf": [ + { + "$ref": "#/definitions/codersdk.BuildReason" + } ] }, "resources": { @@ -3555,7 +3821,6 @@ const docTemplate = `{ } }, "status": { - "type": "string", "enum": [ "pending", "starting", @@ -3567,6 +3832,11 @@ const docTemplate = `{ "canceled", "deleting", "deleted" + ], + "allOf": [ + { + "$ref": "#/definitions/codersdk.WorkspaceStatus" + } ] }, "template_version_id": { @@ -3577,11 +3847,15 @@ const docTemplate = `{ "type": "string" }, "transition": { - "type": "string", "enum": [ "start", "stop", "delete" + ], + "allOf": [ + { + "$ref": "#/definitions/codersdk.WorkspaceTransition" + } ] }, "updated_at": { @@ -3647,11 +3921,15 @@ const docTemplate = `{ "type": "string" }, "workspace_transition": { - "type": "string", "enum": [ "start", "stop", "delete" + ], + "allOf": [ + { + "$ref": "#/definitions/codersdk.WorkspaceTransition" + } ] } } @@ -3670,6 +3948,46 @@ const docTemplate = `{ } } }, + "codersdk.WorkspaceStatus": { + "type": "string", + "enum": [ + "pending", + "starting", + "running", + "stopping", + "stopped", + "failed", + "canceling", + "canceled", + "deleting", + "deleted" + ], + "x-enum-varnames": [ + "WorkspaceStatusPending", + "WorkspaceStatusStarting", + "WorkspaceStatusRunning", + "WorkspaceStatusStopping", + "WorkspaceStatusStopped", + "WorkspaceStatusFailed", + "WorkspaceStatusCanceling", + "WorkspaceStatusCanceled", + "WorkspaceStatusDeleting", + "WorkspaceStatusDeleted" + ] + }, + "codersdk.WorkspaceTransition": { + "type": "string", + "enum": [ + "start", + "stop", + "delete" + ], + "x-enum-varnames": [ + "WorkspaceTransitionStart", + "WorkspaceTransitionStop", + "WorkspaceTransitionDelete" + ] + }, "codersdk.WorkspacesResponse": { "type": "object", "properties": { @@ -3684,9 +4002,6 @@ const docTemplate = `{ } } }, - "netip.Addr": { - "type": "object" - }, "tailcfg.DERPMap": { "type": "object", "properties": { diff --git a/coderd/apidoc/swagger.json b/coderd/apidoc/swagger.json index 265abb4d5d..af5c7fdc51 100644 --- a/coderd/apidoc/swagger.json +++ b/coderd/apidoc/swagger.json @@ -1682,6 +1682,17 @@ } } }, + "codersdk.AuditAction": { + "type": "string", + "enum": ["create", "write", "delete", "start", "stop"], + "x-enum-varnames": [ + "AuditActionCreate", + "AuditActionWrite", + "AuditActionDelete", + "AuditActionStart", + "AuditActionStop" + ] + }, "codersdk.AuditDiff": { "type": "object", "additionalProperties": { @@ -1702,7 +1713,7 @@ "type": "object", "properties": { "action": { - "type": "string" + "$ref": "#/definitions/codersdk.AuditAction" }, "additional_fields": { "type": "array", @@ -1720,7 +1731,7 @@ "type": "string" }, "ip": { - "$ref": "#/definitions/netip.Addr" + "type": "string" }, "is_deleted": { "type": "boolean" @@ -1745,7 +1756,7 @@ "type": "string" }, "resource_type": { - "type": "string" + "$ref": "#/definitions/codersdk.ResourceType" }, "status_code": { "type": "integer" @@ -1784,8 +1795,12 @@ "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" + "description": "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.\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.", + "allOf": [ + { + "$ref": "#/definitions/codersdk.AuthorizationObject" + } + ] } } }, @@ -1854,6 +1869,15 @@ } } }, + "codersdk.BuildReason": { + "type": "string", + "enum": ["initiator", "autostart", "autostop"], + "x-enum-varnames": [ + "BuildReasonInitiator", + "BuildReasonAutostart", + "BuildReasonAutostop" + ] + }, "codersdk.CreateParameterRequest": { "description": "CreateParameterRequest is a structure used to create a new parameter value for a scope.", "type": "object", @@ -1869,15 +1893,23 @@ "type": "string" }, "destination_scheme": { - "type": "string", - "enum": ["none", "environment_variable", "provisioner_variable"] + "enum": ["none", "environment_variable", "provisioner_variable"], + "allOf": [ + { + "$ref": "#/definitions/codersdk.ParameterDestinationScheme" + } + ] }, "name": { "type": "string" }, "source_scheme": { - "type": "string", - "enum": ["none", "data"] + "enum": ["none", "data"], + "allOf": [ + { + "$ref": "#/definitions/codersdk.ParameterSourceScheme" + } + ] }, "source_value": { "type": "string" @@ -1928,14 +1960,17 @@ "type": "object", "properties": { "action": { - "type": "string", - "enum": ["create", "write", "delete", "start", "stop"] + "enum": ["create", "write", "delete", "start", "stop"], + "allOf": [ + { + "$ref": "#/definitions/codersdk.AuditAction" + } + ] }, "resource_id": { "type": "string" }, "resource_type": { - "type": "string", "enum": [ "organization", "template", @@ -1946,6 +1981,11 @@ "git_ssh_key", "api_key", "group" + ], + "allOf": [ + { + "$ref": "#/definitions/codersdk.ResourceType" + } ] }, "time": { @@ -1981,8 +2021,12 @@ "type": "string" }, "transition": { - "type": "string", - "enum": ["create", "start", "stop", "delete"] + "enum": ["create", "start", "stop", "delete"], + "allOf": [ + { + "$ref": "#/definitions/codersdk.WorkspaceTransition" + } + ] } } }, @@ -2050,7 +2094,11 @@ }, "address": { "description": "DEPRECATED: Use HTTPAddress or TLS.Address instead.", - "$ref": "#/definitions/codersdk.DeploymentConfigField-string" + "allOf": [ + { + "$ref": "#/definitions/codersdk.DeploymentConfigField-string" + } + ] }, "agent_fallback_troubleshooting_url": { "$ref": "#/definitions/codersdk.DeploymentConfigField-string" @@ -2178,7 +2226,10 @@ "type": "string" }, "value": { - "$ref": "#/definitions/codersdk.GitAuthConfig" + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.GitAuthConfig" + } } } }, @@ -2213,7 +2264,10 @@ "type": "string" }, "value": { - "type": "string" + "type": "array", + "items": { + "type": "string" + } } } }, @@ -2415,6 +2469,22 @@ } } }, + "codersdk.LogLevel": { + "type": "string", + "enum": ["trace", "debug", "info", "warn", "error"], + "x-enum-varnames": [ + "LogLevelTrace", + "LogLevelDebug", + "LogLevelInfo", + "LogLevelWarn", + "LogLevelError" + ] + }, + "codersdk.LogSource": { + "type": "string", + "enum": ["provisioner_daemon", "provisioner"], + "x-enum-varnames": ["LogSourceProvisionerDaemon", "LogSourceProvisioner"] + }, "codersdk.OAuth2Config": { "type": "object", "properties": { @@ -2487,8 +2557,12 @@ "format": "date-time" }, "destination_scheme": { - "type": "string", - "enum": ["none", "environment_variable", "provisioner_variable"] + "enum": ["none", "environment_variable", "provisioner_variable"], + "allOf": [ + { + "$ref": "#/definitions/codersdk.ParameterDestinationScheme" + } + ] }, "id": { "type": "string", @@ -2498,16 +2572,24 @@ "type": "string" }, "scope": { - "type": "string", - "enum": ["template", "workspace", "import_job"] + "enum": ["template", "workspace", "import_job"], + "allOf": [ + { + "$ref": "#/definitions/codersdk.ParameterScope" + } + ] }, "scope_id": { "type": "string", "format": "uuid" }, "source_scheme": { - "type": "string", - "enum": ["none", "data"] + "enum": ["none", "data"], + "allOf": [ + { + "$ref": "#/definitions/codersdk.ParameterSourceScheme" + } + ] }, "updated_at": { "type": "string", @@ -2515,6 +2597,32 @@ } } }, + "codersdk.ParameterDestinationScheme": { + "type": "string", + "enum": ["none", "environment_variable", "provisioner_variable"], + "x-enum-varnames": [ + "ParameterDestinationSchemeNone", + "ParameterDestinationSchemeEnvironmentVariable", + "ParameterDestinationSchemeProvisionerVariable" + ] + }, + "codersdk.ParameterScope": { + "type": "string", + "enum": ["template", "workspace", "import_job"], + "x-enum-varnames": [ + "ParameterTemplate", + "ParameterWorkspace", + "ParameterImportJob" + ] + }, + "codersdk.ParameterSourceScheme": { + "type": "string", + "enum": ["none", "data"], + "x-enum-varnames": [ + "ParameterSourceSchemeNone", + "ParameterSourceSchemeData" + ] + }, "codersdk.PostWorkspaceAgentVersionRequest": { "description": "x-apidocgen:skip", "type": "object", @@ -2531,7 +2639,7 @@ "description": "Healths is a map of the workspace app name and the health of the app.", "type": "object", "additionalProperties": { - "type": "string" + "$ref": "#/definitions/codersdk.WorkspaceAppHealth" } } } @@ -2606,7 +2714,6 @@ "format": "date-time" }, "status": { - "type": "string", "enum": [ "pending", "running", @@ -2614,6 +2721,11 @@ "canceling", "canceled", "failed" + ], + "allOf": [ + { + "$ref": "#/definitions/codersdk.ProvisionerJobStatus" + } ] }, "tags": { @@ -2639,11 +2751,15 @@ "type": "integer" }, "log_level": { - "type": "string", - "enum": ["trace", "debug", "info", "warn", "error"] + "enum": ["trace", "debug", "info", "warn", "error"], + "allOf": [ + { + "$ref": "#/definitions/codersdk.LogLevel" + } + ] }, "log_source": { - "type": "string" + "$ref": "#/definitions/codersdk.LogSource" }, "output": { "type": "string" @@ -2653,6 +2769,25 @@ } } }, + "codersdk.ProvisionerJobStatus": { + "type": "string", + "enum": [ + "pending", + "running", + "succeeded", + "canceling", + "canceled", + "failed" + ], + "x-enum-varnames": [ + "ProvisionerJobPending", + "ProvisionerJobRunning", + "ProvisionerJobSucceeded", + "ProvisionerJobCanceling", + "ProvisionerJobCanceled", + "ProvisionerJobFailed" + ] + }, "codersdk.PutExtendWorkspaceRequest": { "type": "object", "required": ["deadline"], @@ -2673,6 +2808,31 @@ } } }, + "codersdk.ResourceType": { + "type": "string", + "enum": [ + "organization", + "template", + "template_version", + "user", + "workspace", + "workspace_build", + "git_ssh_key", + "api_key", + "group" + ], + "x-enum-varnames": [ + "ResourceTypeOrganization", + "ResourceTypeTemplate", + "ResourceTypeTemplateVersion", + "ResourceTypeUser", + "ResourceTypeWorkspace", + "ResourceTypeWorkspaceBuild", + "ResourceTypeGitSSHKey", + "ResourceTypeAPIKey", + "ResourceTypeGroup" + ] + }, "codersdk.Response": { "type": "object", "properties": { @@ -2812,7 +2972,8 @@ "format": "uuid" }, "provisioner": { - "type": "string" + "type": "string", + "enum": ["terraform"] }, "updated_at": { "type": "string", @@ -2938,13 +3099,18 @@ } }, "status": { - "type": "string" + "$ref": "#/definitions/codersdk.UserStatus" }, "username": { "type": "string" } } }, + "codersdk.UserStatus": { + "type": "string", + "enum": ["active", "suspended"], + "x-enum-varnames": ["UserStatusActive", "UserStatusSuspended"] + }, "codersdk.ValidationError": { "type": "object", "required": ["detail", "field"], @@ -3084,8 +3250,12 @@ "type": "string" }, "status": { - "type": "string", - "enum": ["connecting", "connected", "disconnected", "timeout"] + "enum": ["connecting", "connected", "disconnected", "timeout"], + "allOf": [ + { + "$ref": "#/definitions/codersdk.WorkspaceAgentStatus" + } + ] }, "troubleshooting_url": { "type": "string" @@ -3157,6 +3327,16 @@ } } }, + "codersdk.WorkspaceAgentStatus": { + "type": "string", + "enum": ["connecting", "connected", "disconnected", "timeout"], + "x-enum-varnames": [ + "WorkspaceAgentConnecting", + "WorkspaceAgentConnected", + "WorkspaceAgentDisconnected", + "WorkspaceAgentTimeout" + ] + }, "codersdk.WorkspaceApp": { "type": "object", "properties": { @@ -3172,11 +3352,15 @@ "type": "boolean" }, "health": { - "type": "string" + "$ref": "#/definitions/codersdk.WorkspaceAppHealth" }, "healthcheck": { "description": "Healthcheck specifies the configuration for checking app health.", - "$ref": "#/definitions/codersdk.Healthcheck" + "allOf": [ + { + "$ref": "#/definitions/codersdk.Healthcheck" + } + ] }, "icon": { "description": "Icon is a relative path or external URL that specifies\nan icon to be displayed in the dashboard.", @@ -3187,8 +3371,12 @@ "format": "uuid" }, "sharing_level": { - "type": "string", - "enum": ["owner", "authenticated", "public"] + "enum": ["owner", "authenticated", "public"], + "allOf": [ + { + "$ref": "#/definitions/codersdk.WorkspaceAppSharingLevel" + } + ] }, "slug": { "description": "Slug is a unique identifier within the agent.", @@ -3204,6 +3392,25 @@ } } }, + "codersdk.WorkspaceAppHealth": { + "type": "string", + "enum": ["disabled", "initializing", "healthy", "unhealthy"], + "x-enum-varnames": [ + "WorkspaceAppHealthDisabled", + "WorkspaceAppHealthInitializing", + "WorkspaceAppHealthHealthy", + "WorkspaceAppHealthUnhealthy" + ] + }, + "codersdk.WorkspaceAppSharingLevel": { + "type": "string", + "enum": ["owner", "authenticated", "public"], + "x-enum-varnames": [ + "WorkspaceAppSharingLevelOwner", + "WorkspaceAppSharingLevelAuthenticated", + "WorkspaceAppSharingLevelPublic" + ] + }, "codersdk.WorkspaceBuild": { "type": "object", "properties": { @@ -3236,8 +3443,12 @@ "$ref": "#/definitions/codersdk.ProvisionerJob" }, "reason": { - "type": "string", - "enum": ["initiator", "autostart", "autostop"] + "enum": ["initiator", "autostart", "autostop"], + "allOf": [ + { + "$ref": "#/definitions/codersdk.BuildReason" + } + ] }, "resources": { "type": "array", @@ -3246,7 +3457,6 @@ } }, "status": { - "type": "string", "enum": [ "pending", "starting", @@ -3258,6 +3468,11 @@ "canceled", "deleting", "deleted" + ], + "allOf": [ + { + "$ref": "#/definitions/codersdk.WorkspaceStatus" + } ] }, "template_version_id": { @@ -3268,8 +3483,12 @@ "type": "string" }, "transition": { - "type": "string", - "enum": ["start", "stop", "delete"] + "enum": ["start", "stop", "delete"], + "allOf": [ + { + "$ref": "#/definitions/codersdk.WorkspaceTransition" + } + ] }, "updated_at": { "type": "string", @@ -3334,8 +3553,12 @@ "type": "string" }, "workspace_transition": { - "type": "string", - "enum": ["start", "stop", "delete"] + "enum": ["start", "stop", "delete"], + "allOf": [ + { + "$ref": "#/definitions/codersdk.WorkspaceTransition" + } + ] } } }, @@ -3353,6 +3576,42 @@ } } }, + "codersdk.WorkspaceStatus": { + "type": "string", + "enum": [ + "pending", + "starting", + "running", + "stopping", + "stopped", + "failed", + "canceling", + "canceled", + "deleting", + "deleted" + ], + "x-enum-varnames": [ + "WorkspaceStatusPending", + "WorkspaceStatusStarting", + "WorkspaceStatusRunning", + "WorkspaceStatusStopping", + "WorkspaceStatusStopped", + "WorkspaceStatusFailed", + "WorkspaceStatusCanceling", + "WorkspaceStatusCanceled", + "WorkspaceStatusDeleting", + "WorkspaceStatusDeleted" + ] + }, + "codersdk.WorkspaceTransition": { + "type": "string", + "enum": ["start", "stop", "delete"], + "x-enum-varnames": [ + "WorkspaceTransitionStart", + "WorkspaceTransitionStop", + "WorkspaceTransitionDelete" + ] + }, "codersdk.WorkspacesResponse": { "type": "object", "properties": { @@ -3367,9 +3626,6 @@ } } }, - "netip.Addr": { - "type": "object" - }, "tailcfg.DERPMap": { "type": "object", "properties": { diff --git a/codersdk/authorization.go b/codersdk/authorization.go index 21b3f74ad8..b16e924236 100644 --- a/codersdk/authorization.go +++ b/codersdk/authorization.go @@ -24,10 +24,7 @@ type AuthorizationRequest struct { // // @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 AuthorizationCheck struct { - // Object can represent a "set" of objects, such as: - // - All workspaces in an organization - // - All workspaces owned by me - // - All workspaces across the entire product + // 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 diff --git a/codersdk/templates.go b/codersdk/templates.go index 3e066beb8b..7dc5e18252 100644 --- a/codersdk/templates.go +++ b/codersdk/templates.go @@ -20,7 +20,7 @@ type Template struct { OrganizationID uuid.UUID `json:"organization_id" format:"uuid"` Name string `json:"name"` DisplayName string `json:"display_name"` - Provisioner ProvisionerType `json:"provisioner"` + Provisioner ProvisionerType `json:"provisioner" enums:"terraform"` ActiveVersionID uuid.UUID `json:"active_version_id"` WorkspaceOwnerCount uint32 `json:"workspace_owner_count"` // ActiveUserCount is set to -1 when loading. diff --git a/docs/api/agents.md b/docs/api/agents.md index 4a02ff56dc..dbbbe61c8d 100644 --- a/docs/api/agents.md +++ b/docs/api/agents.md @@ -160,8 +160,8 @@ curl -X POST http://coder-server:8080/api/v2/workspaceagents/me/app-health \ ```json { "healths": { - "property1": "string", - "property2": "string" + "property1": "disabled", + "property2": "disabled" } } ``` @@ -299,7 +299,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/me/metadata \ "command": "string", "display_name": "string", "external": true, - "health": "string", + "health": "disabled", "healthcheck": { "interval": 0, "threshold": 0, diff --git a/docs/api/audit.md b/docs/api/audit.md index 8c85b97f68..fa5a3796c7 100644 --- a/docs/api/audit.md +++ b/docs/api/audit.md @@ -32,7 +32,7 @@ curl -X GET http://coder-server:8080/api/v2/audit?q=string \ { "audit_logs": [ { - "action": "string", + "action": "create", "additional_fields": [0], "description": "string", "diff": { @@ -48,7 +48,7 @@ curl -X GET http://coder-server:8080/api/v2/audit?q=string \ } }, "id": "string", - "ip": {}, + "ip": "string", "is_deleted": true, "organization_id": "string", "request_id": "string", @@ -56,7 +56,7 @@ curl -X GET http://coder-server:8080/api/v2/audit?q=string \ "resource_id": "string", "resource_link": "string", "resource_target": "string", - "resource_type": "string", + "resource_type": "organization", "status_code": 0, "time": "string", "user": { @@ -72,7 +72,7 @@ curl -X GET http://coder-server:8080/api/v2/audit?q=string \ "name": "string" } ], - "status": "string", + "status": "active", "username": "string" }, "user_agent": "string" diff --git a/docs/api/builds.md b/docs/api/builds.md index 053819796c..d55f1659de 100644 --- a/docs/api/builds.md +++ b/docs/api/builds.md @@ -59,7 +59,7 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild} \ "command": "string", "display_name": "string", "external": true, - "health": "string", + "health": "disabled", "healthcheck": { "interval": 0, "threshold": 0, @@ -220,7 +220,7 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/log "created_at": "2019-08-24T14:15:22Z", "id": 0, "log_level": "trace", - "log_source": "string", + "log_source": "provisioner_daemon", "output": "string", "stage": "string" } @@ -237,25 +237,27 @@ 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 | | | -| `» log_level` | string | false | | | -| `» log_source` | string | false | | | -| `» output` | string | false | | | -| `» stage` | string | false | | | +| Name | Type | Required | Restrictions | Description | +| -------------- | -------------------------------------------------- | -------- | ------------ | ----------- | +| `[array item]` | array | false | | | +| `» created_at` | string(date-time) | false | | | +| `» id` | integer | false | | | +| `» log_level` | [codersdk.LogLevel](schemas.md#codersdkloglevel) | false | | | +| `» log_source` | [codersdk.LogSource](schemas.md#codersdklogsource) | false | | | +| `» output` | string | false | | | +| `» stage` | string | false | | | #### Enumerated Values -| Property | Value | -| ----------- | ------- | -| `log_level` | `trace` | -| `log_level` | `debug` | -| `log_level` | `info` | -| `log_level` | `warn` | -| `log_level` | `error` | +| Property | Value | +| ------------ | -------------------- | +| `log_level` | `trace` | +| `log_level` | `debug` | +| `log_level` | `info` | +| `log_level` | `warn` | +| `log_level` | `error` | +| `log_source` | `provisioner_daemon` | +| `log_source` | `provisioner` | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -292,7 +294,7 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/res "command": "string", "display_name": "string", "external": true, - "health": "string", + "health": "disabled", "healthcheck": { "interval": 0, "threshold": 0, @@ -369,66 +371,70 @@ 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 | | | -| `»» apps` | array | false | | | -| `»»» command` | string | false | | | -| `»»» display_name` | string | false | | DisplayName is a friendly name for the app. | -| `»»» external` | boolean | false | | External specifies whether the URL should be opened externally on
the client or not. | -| `»»» health` | string | false | | | -| `»»» healthcheck` | `codersdk.Healthcheck` | false | | | -| `»»»» 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. | -| `»»» 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 | | | -| `»»» sharing_level` | string | 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. | -| `»»» url` | string | false | | URL is the address being proxied to inside the workspace.
If external is specified, this will be opened on the client. | -| `»» architecture` | string | false | | | -| `»» connection_timeout_seconds` | integer | false | | | -| `»» created_at` | string(date-time) | false | | | -| `»» directory` | string | false | | | -| `»» disconnected_at` | string(date-time) | false | | | -| `»» environment_variables` | object | false | | | -| `»»» [any property]` | string | false | | | -| `»» first_connected_at` | string(date-time) | false | | | -| `»» id` | string(uuid) | false | | | -| `»» instance_id` | string | false | | | -| `»» last_connected_at` | string(date-time) | false | | | -| `»» latency` | object | false | | DERPLatency is mapped by region name (e.g. "New York City", "Seattle"). | -| `»»» [any property]` | `codersdk.DERPRegion` | false | | | -| `»»»» latency_ms` | number | false | | | -| `»»»» preferred` | boolean | false | | | -| `»» name` | string | false | | | -| `»» operating_system` | string | false | | | -| `»» resource_id` | string(uuid) | false | | | -| `»» startup_script` | string | false | | | -| `»» status` | string | false | | | -| `»» troubleshooting_url` | string | false | | | -| `»» updated_at` | string(date-time) | false | | | -| `»» version` | string | false | | | -| `» created_at` | string(date-time) | false | | | -| `» daily_cost` | integer | false | | | -| `» hide` | boolean | false | | | -| `» icon` | string | false | | | -| `» id` | string(uuid) | false | | | -| `» job_id` | string(uuid) | false | | | -| `» metadata` | array | false | | | -| `»» key` | string | false | | | -| `»» sensitive` | boolean | false | | | -| `»» value` | string | false | | | -| `» name` | string | false | | | -| `» type` | string | false | | | -| `» workspace_transition` | string | false | | | +| Name | Type | Required | Restrictions | Description | +| ------------------------------- | -------------------------------------------------------------------------------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `[array item]` | array | false | | | +| `» agents` | array | false | | | +| `»» apps` | array | false | | | +| `»»» command` | string | false | | | +| `»»» display_name` | string | false | | DisplayName is a friendly name for the app. | +| `»»» external` | boolean | false | | External specifies whether the URL should be opened externally on
the client or not. | +| `»»» health` | [codersdk.WorkspaceAppHealth](schemas.md#codersdkworkspaceapphealth) | false | | | +| `»»» healthcheck` | [codersdk.Healthcheck](schemas.md#codersdkhealthcheck) | false | | Healthcheck specifies the configuration for checking app health. | +| `»»»» 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. | +| `»»» 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 | | | +| `»»» 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. | +| `»»» url` | string | false | | URL is the address being proxied to inside the workspace.
If external is specified, this will be opened on the client. | +| `»» architecture` | string | false | | | +| `»» connection_timeout_seconds` | integer | false | | | +| `»» created_at` | string(date-time) | false | | | +| `»» directory` | string | false | | | +| `»» disconnected_at` | string(date-time) | false | | | +| `»» environment_variables` | object | false | | | +| `»»» [any property]` | string | false | | | +| `»» first_connected_at` | string(date-time) | false | | | +| `»» id` | string(uuid) | false | | | +| `»» instance_id` | string | false | | | +| `»» last_connected_at` | string(date-time) | false | | | +| `»» latency` | object | false | | DERPLatency is mapped by region name (e.g. "New York City", "Seattle"). | +| `»»» [any property]` | [codersdk.DERPRegion](schemas.md#codersdkderpregion) | false | | | +| `»»»» latency_ms` | number | false | | | +| `»»»» preferred` | boolean | false | | | +| `»» name` | string | false | | | +| `»» operating_system` | string | false | | | +| `»» resource_id` | string(uuid) | false | | | +| `»» startup_script` | string | false | | | +| `»» status` | [codersdk.WorkspaceAgentStatus](schemas.md#codersdkworkspaceagentstatus) | false | | | +| `»» troubleshooting_url` | string | false | | | +| `»» updated_at` | string(date-time) | false | | | +| `»» version` | string | false | | | +| `» created_at` | string(date-time) | false | | | +| `» daily_cost` | integer | false | | | +| `» hide` | boolean | false | | | +| `» icon` | string | false | | | +| `» id` | string(uuid) | false | | | +| `» job_id` | string(uuid) | false | | | +| `» metadata` | array | false | | | +| `»» key` | string | false | | | +| `»» sensitive` | boolean | false | | | +| `»» value` | string | false | | | +| `» name` | string | false | | | +| `» type` | string | false | | | +| `» workspace_transition` | [codersdk.WorkspaceTransition](schemas.md#codersdkworkspacetransition) | false | | | #### Enumerated Values | Property | Value | | ---------------------- | --------------- | +| `health` | `disabled` | +| `health` | `initializing` | +| `health` | `healthy` | +| `health` | `unhealthy` | | `sharing_level` | `owner` | | `sharing_level` | `authenticated` | | `sharing_level` | `public` | @@ -499,7 +505,7 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/sta "command": "string", "display_name": "string", "external": true, - "health": "string", + "health": "disabled", "healthcheck": { "interval": 0, "threshold": 0, @@ -646,7 +652,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{id}/builds \ "command": "string", "display_name": "string", "external": true, - "health": "string", + "health": "disabled", "healthcheck": { "interval": 0, "threshold": 0, @@ -734,91 +740,91 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{id}/builds \ Status Code **200** -| Name | Type | Required | Restrictions | Description | -| -------------------------------- | ------------------------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `[array item]` | array | false | | | -| `» build_number` | integer | false | | | -| `» created_at` | string(date-time) | false | | | -| `» daily_cost` | integer | false | | | -| `» deadline` | string(date-time) | false | | | -| `» id` | string(uuid) | false | | | -| `» initiator_id` | string(uuid) | false | | | -| `» initiator_name` | string | false | | | -| `» job` | `codersdk.ProvisionerJob` | false | | | -| `»» canceled_at` | string(date-time) | false | | | -| `»» completed_at` | string(date-time) | false | | | -| `»» created_at` | string(date-time) | false | | | -| `»» error` | string | false | | | -| `»» file_id` | string(uuid) | false | | | -| `»» id` | string(uuid) | false | | | -| `»» started_at` | string(date-time) | false | | | -| `»» status` | string | false | | | -| `»» tags` | object | false | | | -| `»»» [any property]` | string | false | | | -| `»» worker_id` | string(uuid) | false | | | -| `» reason` | string | false | | | -| `» resources` | array | false | | | -| `»» agents` | array | false | | | -| `»»» apps` | array | false | | | -| `»»»» command` | string | false | | | -| `»»»» display_name` | string | false | | DisplayName is a friendly name for the app. | -| `»»»» external` | boolean | false | | External specifies whether the URL should be opened externally on
the client or not. | -| `»»»» health` | string | false | | | -| `»»»» healthcheck` | `codersdk.Healthcheck` | false | | | -| `»»»»» 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. | -| `»»»» 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 | | | -| `»»»» sharing_level` | string | 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. | -| `»»»» url` | string | false | | URL is the address being proxied to inside the workspace.
If external is specified, this will be opened on the client. | -| `»»» architecture` | string | false | | | -| `»»» connection_timeout_seconds` | integer | false | | | -| `»»» created_at` | string(date-time) | false | | | -| `»»» directory` | string | false | | | -| `»»» disconnected_at` | string(date-time) | false | | | -| `»»» environment_variables` | object | false | | | -| `»»»» [any property]` | string | false | | | -| `»»» first_connected_at` | string(date-time) | false | | | -| `»»» id` | string(uuid) | false | | | -| `»»» instance_id` | string | false | | | -| `»»» last_connected_at` | string(date-time) | false | | | -| `»»» latency` | object | false | | DERPLatency is mapped by region name (e.g. "New York City", "Seattle"). | -| `»»»» [any property]` | `codersdk.DERPRegion` | false | | | -| `»»»»» latency_ms` | number | false | | | -| `»»»»» preferred` | boolean | false | | | -| `»»» name` | string | false | | | -| `»»» operating_system` | string | false | | | -| `»»» resource_id` | string(uuid) | false | | | -| `»»» startup_script` | string | false | | | -| `»»» status` | string | false | | | -| `»»» troubleshooting_url` | string | false | | | -| `»»» updated_at` | string(date-time) | false | | | -| `»»» version` | string | false | | | -| `»» created_at` | string(date-time) | false | | | -| `»» daily_cost` | integer | false | | | -| `»» hide` | boolean | false | | | -| `»» icon` | string | false | | | -| `»» id` | string(uuid) | false | | | -| `»» job_id` | string(uuid) | false | | | -| `»» metadata` | array | false | | | -| `»»» key` | string | false | | | -| `»»» sensitive` | boolean | false | | | -| `»»» value` | string | false | | | -| `»» name` | string | false | | | -| `»» type` | string | false | | | -| `»» workspace_transition` | string | false | | | -| `» status` | string | false | | | -| `» template_version_id` | string(uuid) | false | | | -| `» template_version_name` | string | false | | | -| `» transition` | string | false | | | -| `» updated_at` | string(date-time) | false | | | -| `» workspace_id` | string(uuid) | false | | | -| `» workspace_name` | string | false | | | -| `» workspace_owner_id` | string(uuid) | false | | | -| `» workspace_owner_name` | string | false | | | +| Name | Type | Required | Restrictions | Description | +| -------------------------------- | -------------------------------------------------------------------------------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `[array item]` | array | false | | | +| `» build_number` | integer | false | | | +| `» created_at` | string(date-time) | false | | | +| `» daily_cost` | integer | false | | | +| `» deadline` | string(date-time) | false | | | +| `» id` | string(uuid) | false | | | +| `» initiator_id` | string(uuid) | false | | | +| `» initiator_name` | string | false | | | +| `» job` | [codersdk.ProvisionerJob](schemas.md#codersdkprovisionerjob) | false | | | +| `»» canceled_at` | string(date-time) | false | | | +| `»» completed_at` | string(date-time) | false | | | +| `»» created_at` | string(date-time) | false | | | +| `»» error` | string | false | | | +| `»» file_id` | string(uuid) | false | | | +| `»» id` | string(uuid) | false | | | +| `»» started_at` | string(date-time) | false | | | +| `»» status` | [codersdk.ProvisionerJobStatus](schemas.md#codersdkprovisionerjobstatus) | false | | | +| `»» tags` | object | false | | | +| `»»» [any property]` | string | false | | | +| `»» worker_id` | string(uuid) | false | | | +| `» reason` | [codersdk.BuildReason](schemas.md#codersdkbuildreason) | false | | | +| `» resources` | array | false | | | +| `»» agents` | array | false | | | +| `»»» apps` | array | false | | | +| `»»»» command` | string | false | | | +| `»»»» display_name` | string | false | | DisplayName is a friendly name for the app. | +| `»»»» external` | boolean | false | | External specifies whether the URL should be opened externally on
the client or not. | +| `»»»» health` | [codersdk.WorkspaceAppHealth](schemas.md#codersdkworkspaceapphealth) | false | | | +| `»»»» healthcheck` | [codersdk.Healthcheck](schemas.md#codersdkhealthcheck) | false | | Healthcheck specifies the configuration for checking app health. | +| `»»»»» 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. | +| `»»»» 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 | | | +| `»»»» 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. | +| `»»»» url` | string | false | | URL is the address being proxied to inside the workspace.
If external is specified, this will be opened on the client. | +| `»»» architecture` | string | false | | | +| `»»» connection_timeout_seconds` | integer | false | | | +| `»»» created_at` | string(date-time) | false | | | +| `»»» directory` | string | false | | | +| `»»» disconnected_at` | string(date-time) | false | | | +| `»»» environment_variables` | object | false | | | +| `»»»» [any property]` | string | false | | | +| `»»» first_connected_at` | string(date-time) | false | | | +| `»»» id` | string(uuid) | false | | | +| `»»» instance_id` | string | false | | | +| `»»» last_connected_at` | string(date-time) | false | | | +| `»»» latency` | object | false | | DERPLatency is mapped by region name (e.g. "New York City", "Seattle"). | +| `»»»» [any property]` | [codersdk.DERPRegion](schemas.md#codersdkderpregion) | false | | | +| `»»»»» latency_ms` | number | false | | | +| `»»»»» preferred` | boolean | false | | | +| `»»» name` | string | false | | | +| `»»» operating_system` | string | false | | | +| `»»» resource_id` | string(uuid) | false | | | +| `»»» startup_script` | string | false | | | +| `»»» status` | [codersdk.WorkspaceAgentStatus](schemas.md#codersdkworkspaceagentstatus) | false | | | +| `»»» troubleshooting_url` | string | false | | | +| `»»» updated_at` | string(date-time) | false | | | +| `»»» version` | string | false | | | +| `»» created_at` | string(date-time) | false | | | +| `»» daily_cost` | integer | false | | | +| `»» hide` | boolean | false | | | +| `»» icon` | string | false | | | +| `»» id` | string(uuid) | false | | | +| `»» job_id` | string(uuid) | false | | | +| `»» metadata` | array | false | | | +| `»»» key` | string | false | | | +| `»»» sensitive` | boolean | false | | | +| `»»» value` | string | false | | | +| `»» name` | string | false | | | +| `»» type` | string | false | | | +| `»» workspace_transition` | [codersdk.WorkspaceTransition](schemas.md#codersdkworkspacetransition) | false | | | +| `» status` | [codersdk.WorkspaceStatus](schemas.md#codersdkworkspacestatus) | false | | | +| `» template_version_id` | string(uuid) | false | | | +| `» template_version_name` | string | false | | | +| `» transition` | [codersdk.WorkspaceTransition](schemas.md#codersdkworkspacetransition) | false | | | +| `» updated_at` | string(date-time) | false | | | +| `» workspace_id` | string(uuid) | false | | | +| `» workspace_name` | string | false | | | +| `» workspace_owner_id` | string(uuid) | false | | | +| `» workspace_owner_name` | string | false | | | #### Enumerated Values @@ -833,6 +839,10 @@ Status Code **200** | `reason` | `initiator` | | `reason` | `autostart` | | `reason` | `autostop` | +| `health` | `disabled` | +| `health` | `initializing` | +| `health` | `healthy` | +| `health` | `unhealthy` | | `sharing_level` | `owner` | | `sharing_level` | `authenticated` | | `sharing_level` | `public` | @@ -939,7 +949,7 @@ curl -X POST http://coder-server:8080/api/v2/workspaces/{id}/builds \ "command": "string", "display_name": "string", "external": true, - "health": "string", + "health": "disabled", "healthcheck": { "interval": 0, "threshold": 0, diff --git a/docs/api/general.md b/docs/api/general.md index df45ce62b3..85167d8dd2 100644 --- a/docs/api/general.md +++ b/docs/api/general.md @@ -263,7 +263,7 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] } } }, @@ -299,17 +299,19 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ "secret": true, "shorthand": "string", "usage": "string", - "value": { - "auth_url": "string", - "client_id": "string", - "id": "string", - "no_refresh": true, - "regex": "string", - "scopes": ["string"], - "token_url": "string", - "type": "string", - "validate_url": "string" - } + "value": [ + { + "auth_url": "string", + "client_id": "string", + "id": "string", + "no_refresh": true, + "regex": "string", + "scopes": ["string"], + "token_url": "string", + "type": "string", + "validate_url": "string" + } + ] }, "http_address": { "default": "string", @@ -388,7 +390,7 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] }, "allowed_teams": { "default": ["string"], @@ -399,7 +401,7 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] }, "client_id": { "default": "string", @@ -479,7 +481,7 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] }, "ignore_email_verified": { "default": true, @@ -512,7 +514,7 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] }, "username_field": { "default": "string", @@ -640,7 +642,7 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] }, "proxy_trusted_origins": { "default": ["string"], @@ -651,7 +653,7 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] }, "rate_limit": { "api": { @@ -779,7 +781,7 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] }, "client_auth": { "default": "string", @@ -845,7 +847,7 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] }, "min_version": { "default": "string", diff --git a/docs/api/parameters.md b/docs/api/parameters.md index b17ac81678..051eb02c1c 100644 --- a/docs/api/parameters.md +++ b/docs/api/parameters.md @@ -59,17 +59,17 @@ curl -X GET http://coder-server:8080/api/v2/parameters/{scope}/{id} \ Status Code **200** -| Name | Type | Required | Restrictions | Description | -| ---------------------- | ----------------- | -------- | ------------ | ------------------------------------------------- | -| `[array item]` | array | false | | [Parameter represents a set value for the scope.] | -| `» created_at` | string(date-time) | false | | | -| `» destination_scheme` | string | false | | | -| `» id` | string(uuid) | false | | | -| `» name` | string | false | | | -| `» scope` | string | false | | | -| `» scope_id` | string(uuid) | false | | | -| `» source_scheme` | string | false | | | -| `» updated_at` | string(date-time) | false | | | +| Name | Type | Required | Restrictions | Description | +| ---------------------- | ------------------------------------------------------------------------------------ | -------- | ------------ | ------------------------------------------------- | +| `[array item]` | array | false | | [Parameter represents a set value for the scope.] | +| `» created_at` | string(date-time) | false | | | +| `» destination_scheme` | [codersdk.ParameterDestinationScheme](schemas.md#codersdkparameterdestinationscheme) | false | | | +| `» id` | string(uuid) | false | | | +| `» name` | string | false | | | +| `» scope` | [codersdk.ParameterScope](schemas.md#codersdkparameterscope) | false | | | +| `» scope_id` | string(uuid) | false | | | +| `» source_scheme` | [codersdk.ParameterSourceScheme](schemas.md#codersdkparametersourcescheme) | false | | | +| `» updated_at` | string(date-time) | false | | | #### Enumerated Values diff --git a/docs/api/schemas.md b/docs/api/schemas.md index 23a21d918e..07a5c9ee3a 100644 --- a/docs/api/schemas.md +++ b/docs/api/schemas.md @@ -90,6 +90,24 @@ | ----------------- | ------- | -------- | ------------ | ------------------------------------------------------------------------------ | | `report_interval` | integer | false | | Report interval is the duration after which the agent should send stats again. | +## codersdk.AuditAction + +```json +"create" +``` + +### Properties + +#### Enumerated Values + +| Value | +| -------- | +| `create` | +| `write` | +| `delete` | +| `start` | +| `stop` | + ## codersdk.AuditDiff ```json @@ -135,7 +153,7 @@ ```json { - "action": "string", + "action": "create", "additional_fields": [0], "description": "string", "diff": { @@ -151,7 +169,7 @@ } }, "id": "string", - "ip": {}, + "ip": "string", "is_deleted": true, "organization_id": "string", "request_id": "string", @@ -159,7 +177,7 @@ "resource_id": "string", "resource_link": "string", "resource_target": "string", - "resource_type": "string", + "resource_type": "organization", "status_code": 0, "time": "string", "user": { @@ -175,7 +193,7 @@ "name": "string" } ], - "status": "string", + "status": "active", "username": "string" }, "user_agent": "string" @@ -184,26 +202,26 @@ ### Properties -| Name | Type | Required | Restrictions | Description | -| ------------------- | ---------------------------------------- | -------- | ------------ | -------------------------------------------- | -| `action` | string | false | | | -| `additional_fields` | array of integer | false | | | -| `description` | string | false | | | -| `diff` | [codersdk.AuditDiff](#codersdkauditdiff) | false | | | -| `id` | string | false | | | -| `ip` | [netip.Addr](#netipaddr) | false | | | -| `is_deleted` | boolean | false | | | -| `organization_id` | string | false | | | -| `request_id` | string | false | | | -| `resource_icon` | string | false | | | -| `resource_id` | string | false | | | -| `resource_link` | string | false | | | -| `resource_target` | string | false | | Resource target is the name of the resource. | -| `resource_type` | string | false | | | -| `status_code` | integer | false | | | -| `time` | string | false | | | -| `user` | [codersdk.User](#codersdkuser) | false | | | -| `user_agent` | string | false | | | +| Name | Type | Required | Restrictions | Description | +| ------------------- | ---------------------------------------------- | -------- | ------------ | -------------------------------------------- | +| `action` | [codersdk.AuditAction](#codersdkauditaction) | false | | | +| `additional_fields` | array of integer | false | | | +| `description` | string | false | | | +| `diff` | [codersdk.AuditDiff](#codersdkauditdiff) | false | | | +| `id` | string | false | | | +| `ip` | string | false | | | +| `is_deleted` | boolean | false | | | +| `organization_id` | string | false | | | +| `request_id` | string | false | | | +| `resource_icon` | string | false | | | +| `resource_id` | string | false | | | +| `resource_link` | string | false | | | +| `resource_target` | string | false | | Resource target is the name of the resource. | +| `resource_type` | [codersdk.ResourceType](#codersdkresourcetype) | false | | | +| `status_code` | integer | false | | | +| `time` | string | false | | | +| `user` | [codersdk.User](#codersdkuser) | false | | | +| `user_agent` | string | false | | | ## codersdk.AuditLogResponse @@ -211,7 +229,7 @@ { "audit_logs": [ { - "action": "string", + "action": "create", "additional_fields": [0], "description": "string", "diff": { @@ -227,7 +245,7 @@ } }, "id": "string", - "ip": {}, + "ip": "string", "is_deleted": true, "organization_id": "string", "request_id": "string", @@ -235,7 +253,7 @@ "resource_id": "string", "resource_link": "string", "resource_target": "string", - "resource_type": "string", + "resource_type": "organization", "status_code": 0, "time": "string", "user": { @@ -251,7 +269,7 @@ "name": "string" } ], - "status": "string", + "status": "active", "username": "string" }, "user_agent": "string" @@ -286,10 +304,10 @@ AuthorizationCheck is used to check if the currently authenticated user (or the ### Properties -| Name | Type | Required | Restrictions | Description | -| -------- | ------------------------------------------------------------ | -------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `action` | string | 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, all workspaces across the entire product. | +| Name | Type | Required | Restrictions | Description | +| -------- | ------------------------------------------------------------ | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `action` | string | 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 @@ -403,6 +421,22 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in | `external_url` | string | false | | External URL references the current Coder version. For production builds, this will link directly to a release. For development builds, this will link to a commit. | | `version` | string | false | | Version returns the semantic version of the build. | +## codersdk.BuildReason + +```json +"initiator" +``` + +### Properties + +#### Enumerated Values + +| Value | +| ----------- | +| `initiator` | +| `autostart` | +| `autostop` | + ## codersdk.CreateParameterRequest ```json @@ -419,13 +453,13 @@ CreateParameterRequest is a structure used to create a new parameter value for a ### Properties -| Name | Type | Required | Restrictions | Description | -| --------------------- | ------ | -------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `copy_from_parameter` | string | false | | Copy from parameter allows copying the value of another parameter. The other param must be related to the same template_id for this to succeed. No other fields are required if using this, as all fields will be copied from the other parameter. | -| `destination_scheme` | string | true | | | -| `name` | string | true | | | -| `source_scheme` | string | true | | | -| `source_value` | string | true | | | +| Name | Type | Required | Restrictions | Description | +| --------------------- | -------------------------------------------------------------------------- | -------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `copy_from_parameter` | string | false | | Copy from parameter allows copying the value of another parameter. The other param must be related to the same template_id for this to succeed. No other fields are required if using this, as all fields will be copied from the other parameter. | +| `destination_scheme` | [codersdk.ParameterDestinationScheme](#codersdkparameterdestinationscheme) | true | | | +| `name` | string | true | | | +| `source_scheme` | [codersdk.ParameterSourceScheme](#codersdkparametersourcescheme) | true | | | +| `source_value` | string | true | | | #### Enumerated Values @@ -487,12 +521,12 @@ CreateParameterRequest is a structure used to create a new parameter value for a ### Properties -| Name | Type | Required | Restrictions | Description | -| --------------- | ------ | -------- | ------------ | ----------- | -| `action` | string | false | | | -| `resource_id` | string | false | | | -| `resource_type` | string | false | | | -| `time` | string | false | | | +| Name | Type | Required | Restrictions | Description | +| --------------- | ---------------------------------------------- | -------- | ------------ | ----------- | +| `action` | [codersdk.AuditAction](#codersdkauditaction) | false | | | +| `resource_id` | string | false | | | +| `resource_type` | [codersdk.ResourceType](#codersdkresourcetype) | false | | | +| `time` | string | false | | | #### Enumerated Values @@ -543,7 +577,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a | `parameter_values` | array of [codersdk.CreateParameterRequest](#codersdkcreateparameterrequest) | false | | Parameter values are optional. It will write params to the 'workspace' scope. This will overwrite any existing parameters with the same name. This will not delete old params not included in this list. | | `state` | array of integer | false | | | | `template_version_id` | string | false | | | -| `transition` | string | true | | | +| `transition` | [codersdk.WorkspaceTransition](#codersdkworkspacetransition) | true | | | #### Enumerated Values @@ -647,7 +681,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] } } } @@ -780,7 +814,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] } } ``` @@ -978,7 +1012,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] } } }, @@ -1014,17 +1048,19 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": { - "auth_url": "string", - "client_id": "string", - "id": "string", - "no_refresh": true, - "regex": "string", - "scopes": ["string"], - "token_url": "string", - "type": "string", - "validate_url": "string" - } + "value": [ + { + "auth_url": "string", + "client_id": "string", + "id": "string", + "no_refresh": true, + "regex": "string", + "scopes": ["string"], + "token_url": "string", + "type": "string", + "validate_url": "string" + } + ] }, "http_address": { "default": "string", @@ -1103,7 +1139,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] }, "allowed_teams": { "default": ["string"], @@ -1114,7 +1150,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] }, "client_id": { "default": "string", @@ -1194,7 +1230,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] }, "ignore_email_verified": { "default": true, @@ -1227,7 +1263,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] }, "username_field": { "default": "string", @@ -1355,7 +1391,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] }, "proxy_trusted_origins": { "default": ["string"], @@ -1366,7 +1402,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] }, "rate_limit": { "api": { @@ -1494,7 +1530,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] }, "client_auth": { "default": "string", @@ -1560,7 +1596,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] }, "min_version": { "default": "string", @@ -1647,41 +1683,41 @@ CreateParameterRequest is a structure used to create a new parameter value for a ### Properties -| Name | Type | Required | Restrictions | Description | -| ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- | -------- | ------------ | ----------- | -| `access_url` | [codersdk.DeploymentConfigField-string](#codersdkdeploymentconfigfield-string) | false | | | -| `address` | [codersdk.DeploymentConfigField-string](#codersdkdeploymentconfigfield-string) | false | | | -| `agent_fallback_troubleshooting_url` | [codersdk.DeploymentConfigField-string](#codersdkdeploymentconfigfield-string) | false | | | -| `agent_stat_refresh_interval` | [codersdk.DeploymentConfigField-time_Duration](#codersdkdeploymentconfigfield-time_duration) | false | | | -| `audit_logging` | [codersdk.DeploymentConfigField-bool](#codersdkdeploymentconfigfield-bool) | false | | | -| `autobuild_poll_interval` | [codersdk.DeploymentConfigField-time_Duration](#codersdkdeploymentconfigfield-time_duration) | false | | | -| `browser_only` | [codersdk.DeploymentConfigField-bool](#codersdkdeploymentconfigfield-bool) | false | | | -| `cache_directory` | [codersdk.DeploymentConfigField-string](#codersdkdeploymentconfigfield-string) | false | | | -| `derp` | [codersdk.DERP](#codersdkderp) | false | | | -| `experimental` | [codersdk.DeploymentConfigField-bool](#codersdkdeploymentconfigfield-bool) | false | | | -| `gitauth` | [codersdk.DeploymentConfigField-array_codersdk_GitAuthConfig](#codersdkdeploymentconfigfield-array_codersdk_gitauthconfig) | false | | | -| `http_address` | [codersdk.DeploymentConfigField-string](#codersdkdeploymentconfigfield-string) | false | | | -| `in_memory_database` | [codersdk.DeploymentConfigField-bool](#codersdkdeploymentconfigfield-bool) | false | | | -| `max_token_lifetime` | [codersdk.DeploymentConfigField-time_Duration](#codersdkdeploymentconfigfield-time_duration) | false | | | -| `metrics_cache_refresh_interval` | [codersdk.DeploymentConfigField-time_Duration](#codersdkdeploymentconfigfield-time_duration) | false | | | -| `oauth2` | [codersdk.OAuth2Config](#codersdkoauth2config) | false | | | -| `oidc` | [codersdk.OIDCConfig](#codersdkoidcconfig) | false | | | -| `pg_connection_url` | [codersdk.DeploymentConfigField-string](#codersdkdeploymentconfigfield-string) | false | | | -| `pprof` | [codersdk.PprofConfig](#codersdkpprofconfig) | false | | | -| `prometheus` | [codersdk.PrometheusConfig](#codersdkprometheusconfig) | false | | | -| `provisioner` | [codersdk.ProvisionerConfig](#codersdkprovisionerconfig) | false | | | -| `proxy_trusted_headers` | [codersdk.DeploymentConfigField-array_string](#codersdkdeploymentconfigfield-array_string) | false | | | -| `proxy_trusted_origins` | [codersdk.DeploymentConfigField-array_string](#codersdkdeploymentconfigfield-array_string) | false | | | -| `rate_limit` | [codersdk.RateLimitConfig](#codersdkratelimitconfig) | false | | | -| `scim_api_key` | [codersdk.DeploymentConfigField-string](#codersdkdeploymentconfigfield-string) | false | | | -| `secure_auth_cookie` | [codersdk.DeploymentConfigField-bool](#codersdkdeploymentconfigfield-bool) | false | | | -| `ssh_keygen_algorithm` | [codersdk.DeploymentConfigField-string](#codersdkdeploymentconfigfield-string) | false | | | -| `swagger` | [codersdk.SwaggerConfig](#codersdkswaggerconfig) | false | | | -| `telemetry` | [codersdk.TelemetryConfig](#codersdktelemetryconfig) | false | | | -| `tls` | [codersdk.TLSConfig](#codersdktlsconfig) | false | | | -| `trace` | [codersdk.TraceConfig](#codersdktraceconfig) | false | | | -| `update_check` | [codersdk.DeploymentConfigField-bool](#codersdkdeploymentconfigfield-bool) | false | | | -| `wildcard_access_url` | [codersdk.DeploymentConfigField-string](#codersdkdeploymentconfigfield-string) | false | | | +| Name | Type | Required | Restrictions | Description | +| ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- | -------- | ------------ | ----------------------------------------------- | +| `access_url` | [codersdk.DeploymentConfigField-string](#codersdkdeploymentconfigfield-string) | false | | | +| `address` | [codersdk.DeploymentConfigField-string](#codersdkdeploymentconfigfield-string) | false | | Address Use HTTPAddress or TLS.Address instead. | +| `agent_fallback_troubleshooting_url` | [codersdk.DeploymentConfigField-string](#codersdkdeploymentconfigfield-string) | false | | | +| `agent_stat_refresh_interval` | [codersdk.DeploymentConfigField-time_Duration](#codersdkdeploymentconfigfield-time_duration) | false | | | +| `audit_logging` | [codersdk.DeploymentConfigField-bool](#codersdkdeploymentconfigfield-bool) | false | | | +| `autobuild_poll_interval` | [codersdk.DeploymentConfigField-time_Duration](#codersdkdeploymentconfigfield-time_duration) | false | | | +| `browser_only` | [codersdk.DeploymentConfigField-bool](#codersdkdeploymentconfigfield-bool) | false | | | +| `cache_directory` | [codersdk.DeploymentConfigField-string](#codersdkdeploymentconfigfield-string) | false | | | +| `derp` | [codersdk.DERP](#codersdkderp) | false | | | +| `experimental` | [codersdk.DeploymentConfigField-bool](#codersdkdeploymentconfigfield-bool) | false | | | +| `gitauth` | [codersdk.DeploymentConfigField-array_codersdk_GitAuthConfig](#codersdkdeploymentconfigfield-array_codersdk_gitauthconfig) | false | | | +| `http_address` | [codersdk.DeploymentConfigField-string](#codersdkdeploymentconfigfield-string) | false | | | +| `in_memory_database` | [codersdk.DeploymentConfigField-bool](#codersdkdeploymentconfigfield-bool) | false | | | +| `max_token_lifetime` | [codersdk.DeploymentConfigField-time_Duration](#codersdkdeploymentconfigfield-time_duration) | false | | | +| `metrics_cache_refresh_interval` | [codersdk.DeploymentConfigField-time_Duration](#codersdkdeploymentconfigfield-time_duration) | false | | | +| `oauth2` | [codersdk.OAuth2Config](#codersdkoauth2config) | false | | | +| `oidc` | [codersdk.OIDCConfig](#codersdkoidcconfig) | false | | | +| `pg_connection_url` | [codersdk.DeploymentConfigField-string](#codersdkdeploymentconfigfield-string) | false | | | +| `pprof` | [codersdk.PprofConfig](#codersdkpprofconfig) | false | | | +| `prometheus` | [codersdk.PrometheusConfig](#codersdkprometheusconfig) | false | | | +| `provisioner` | [codersdk.ProvisionerConfig](#codersdkprovisionerconfig) | false | | | +| `proxy_trusted_headers` | [codersdk.DeploymentConfigField-array_string](#codersdkdeploymentconfigfield-array_string) | false | | | +| `proxy_trusted_origins` | [codersdk.DeploymentConfigField-array_string](#codersdkdeploymentconfigfield-array_string) | false | | | +| `rate_limit` | [codersdk.RateLimitConfig](#codersdkratelimitconfig) | false | | | +| `scim_api_key` | [codersdk.DeploymentConfigField-string](#codersdkdeploymentconfigfield-string) | false | | | +| `secure_auth_cookie` | [codersdk.DeploymentConfigField-bool](#codersdkdeploymentconfigfield-bool) | false | | | +| `ssh_keygen_algorithm` | [codersdk.DeploymentConfigField-string](#codersdkdeploymentconfigfield-string) | false | | | +| `swagger` | [codersdk.SwaggerConfig](#codersdkswaggerconfig) | false | | | +| `telemetry` | [codersdk.TelemetryConfig](#codersdktelemetryconfig) | false | | | +| `tls` | [codersdk.TLSConfig](#codersdktlsconfig) | false | | | +| `trace` | [codersdk.TraceConfig](#codersdktraceconfig) | false | | | +| `update_check` | [codersdk.DeploymentConfigField-bool](#codersdkdeploymentconfigfield-bool) | false | | | +| `wildcard_access_url` | [codersdk.DeploymentConfigField-string](#codersdkdeploymentconfigfield-string) | false | | | ## codersdk.DeploymentConfigField-array_codersdk_GitAuthConfig @@ -1707,17 +1743,19 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": { - "auth_url": "string", - "client_id": "string", - "id": "string", - "no_refresh": true, - "regex": "string", - "scopes": ["string"], - "token_url": "string", - "type": "string", - "validate_url": "string" - } + "value": [ + { + "auth_url": "string", + "client_id": "string", + "id": "string", + "no_refresh": true, + "regex": "string", + "scopes": ["string"], + "token_url": "string", + "type": "string", + "validate_url": "string" + } + ] } ``` @@ -1733,7 +1771,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a | `secret` | boolean | false | | | | `shorthand` | string | false | | | | `usage` | string | false | | | -| `value` | [codersdk.GitAuthConfig](#codersdkgitauthconfig) | false | | | +| `value` | array of [codersdk.GitAuthConfig](#codersdkgitauthconfig) | false | | | ## codersdk.DeploymentConfigField-array_string @@ -1747,7 +1785,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] } ``` @@ -1763,7 +1801,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a | `secret` | boolean | false | | | | `shorthand` | string | false | | | | `usage` | string | false | | | -| `value` | string | false | | | +| `value` | array of string | false | | | ## codersdk.DeploymentConfigField-bool @@ -1961,6 +1999,39 @@ CreateParameterRequest is a structure used to create a new parameter value for a | `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. | +## codersdk.LogLevel + +```json +"trace" +``` + +### Properties + +#### Enumerated Values + +| Value | +| ------- | +| `trace` | +| `debug` | +| `info` | +| `warn` | +| `error` | + +## codersdk.LogSource + +```json +"provisioner_daemon" +``` + +### Properties + +#### Enumerated Values + +| Value | +| -------------------- | +| `provisioner_daemon` | +| `provisioner` | + ## codersdk.OAuth2Config ```json @@ -1997,7 +2068,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] }, "allowed_teams": { "default": ["string"], @@ -2008,7 +2079,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] }, "client_id": { "default": "string", @@ -2088,7 +2159,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] }, "allowed_teams": { "default": ["string"], @@ -2099,7 +2170,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] }, "client_id": { "default": "string", @@ -2195,7 +2266,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] }, "ignore_email_verified": { "default": true, @@ -2228,7 +2299,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] }, "username_field": { "default": "string", @@ -2276,16 +2347,16 @@ Parameter represents a set value for the scope. ### Properties -| Name | Type | Required | Restrictions | Description | -| -------------------- | ------ | -------- | ------------ | ----------- | -| `created_at` | string | false | | | -| `destination_scheme` | string | false | | | -| `id` | string | false | | | -| `name` | string | false | | | -| `scope` | string | false | | | -| `scope_id` | string | false | | | -| `source_scheme` | string | false | | | -| `updated_at` | string | false | | | +| Name | Type | Required | Restrictions | Description | +| -------------------- | -------------------------------------------------------------------------- | -------- | ------------ | ----------- | +| `created_at` | string | false | | | +| `destination_scheme` | [codersdk.ParameterDestinationScheme](#codersdkparameterdestinationscheme) | false | | | +| `id` | string | false | | | +| `name` | string | false | | | +| `scope` | [codersdk.ParameterScope](#codersdkparameterscope) | false | | | +| `scope_id` | string | false | | | +| `source_scheme` | [codersdk.ParameterSourceScheme](#codersdkparametersourcescheme) | false | | | +| `updated_at` | string | false | | | #### Enumerated Values @@ -2300,23 +2371,70 @@ Parameter represents a set value for the scope. | `source_scheme` | `none` | | `source_scheme` | `data` | +## codersdk.ParameterDestinationScheme + +```json +"none" +``` + +### Properties + +#### Enumerated Values + +| Value | +| ---------------------- | +| `none` | +| `environment_variable` | +| `provisioner_variable` | + +## codersdk.ParameterScope + +```json +"template" +``` + +### Properties + +#### Enumerated Values + +| Value | +| ------------ | +| `template` | +| `workspace` | +| `import_job` | + +## codersdk.ParameterSourceScheme + +```json +"none" +``` + +### Properties + +#### Enumerated Values + +| Value | +| ------ | +| `none` | +| `data` | + ## codersdk.PostWorkspaceAppHealthsRequest ```json { "healths": { - "property1": "string", - "property2": "string" + "property1": "disabled", + "property2": "disabled" } } ``` ### Properties -| Name | Type | Required | Restrictions | Description | -| ------------------ | ------ | -------- | ------------ | --------------------------------------------------------------------- | -| `healths` | object | false | | Healths is a map of the workspace app name and the health of the app. | -| » `[any property]` | string | false | | | +| Name | Type | Required | Restrictions | Description | +| ------------------ | ---------------------------------------------------------- | -------- | ------------ | --------------------------------------------------------------------- | +| `healths` | object | false | | Healths is a map of the workspace app name and the health of the app. | +| » `[any property]` | [codersdk.WorkspaceAppHealth](#codersdkworkspaceapphealth) | false | | | ## codersdk.PprofConfig @@ -2472,19 +2590,19 @@ Parameter represents a set value for the scope. ### Properties -| Name | Type | Required | Restrictions | Description | -| ------------------ | ------ | -------- | ------------ | ----------- | -| `canceled_at` | string | false | | | -| `completed_at` | string | false | | | -| `created_at` | string | false | | | -| `error` | string | false | | | -| `file_id` | string | false | | | -| `id` | string | false | | | -| `started_at` | string | false | | | -| `status` | string | false | | | -| `tags` | object | false | | | -| » `[any property]` | string | false | | | -| `worker_id` | string | false | | | +| Name | Type | Required | Restrictions | Description | +| ------------------ | -------------------------------------------------------------- | -------- | ------------ | ----------- | +| `canceled_at` | string | false | | | +| `completed_at` | string | false | | | +| `created_at` | string | false | | | +| `error` | string | false | | | +| `file_id` | string | false | | | +| `id` | string | false | | | +| `started_at` | string | false | | | +| `status` | [codersdk.ProvisionerJobStatus](#codersdkprovisionerjobstatus) | false | | | +| `tags` | object | false | | | +| » `[any property]` | string | false | | | +| `worker_id` | string | false | | | #### Enumerated Values @@ -2504,7 +2622,7 @@ Parameter represents a set value for the scope. "created_at": "2019-08-24T14:15:22Z", "id": 0, "log_level": "trace", - "log_source": "string", + "log_source": "provisioner_daemon", "output": "string", "stage": "string" } @@ -2512,14 +2630,14 @@ Parameter represents a set value for the scope. ### Properties -| Name | Type | Required | Restrictions | Description | -| ------------ | ------- | -------- | ------------ | ----------- | -| `created_at` | string | false | | | -| `id` | integer | false | | | -| `log_level` | string | false | | | -| `log_source` | string | false | | | -| `output` | string | false | | | -| `stage` | string | false | | | +| Name | Type | Required | Restrictions | Description | +| ------------ | ---------------------------------------- | -------- | ------------ | ----------- | +| `created_at` | string | false | | | +| `id` | integer | false | | | +| `log_level` | [codersdk.LogLevel](#codersdkloglevel) | false | | | +| `log_source` | [codersdk.LogSource](#codersdklogsource) | false | | | +| `output` | string | false | | | +| `stage` | string | false | | | #### Enumerated Values @@ -2531,6 +2649,25 @@ Parameter represents a set value for the scope. | `log_level` | `warn` | | `log_level` | `error` | +## codersdk.ProvisionerJobStatus + +```json +"pending" +``` + +### Properties + +#### Enumerated Values + +| Value | +| ----------- | +| `pending` | +| `running` | +| `succeeded` | +| `canceling` | +| `canceled` | +| `failed` | + ## codersdk.PutExtendWorkspaceRequest ```json @@ -2581,6 +2718,28 @@ Parameter represents a set value for the scope. | `api` | [codersdk.DeploymentConfigField-int](#codersdkdeploymentconfigfield-int) | false | | | | `disable_all` | [codersdk.DeploymentConfigField-bool](#codersdkdeploymentconfigfield-bool) | false | | | +## codersdk.ResourceType + +```json +"organization" +``` + +### Properties + +#### Enumerated Values + +| Value | +| ------------------ | +| `organization` | +| `template` | +| `template_version` | +| `user` | +| `workspace` | +| `workspace_build` | +| `git_ssh_key` | +| `api_key` | +| `group` | + ## codersdk.Response ```json @@ -2668,7 +2827,7 @@ Parameter represents a set value for the scope. "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] }, "client_auth": { "default": "string", @@ -2734,7 +2893,7 @@ Parameter represents a set value for the scope. "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] }, "min_version": { "default": "string", @@ -2851,7 +3010,7 @@ Parameter represents a set value for the scope. "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "provisioner": "string", + "provisioner": "terraform", "updated_at": "2019-08-24T14:15:22Z", "workspace_owner_count": 0 } @@ -2879,6 +3038,12 @@ Parameter represents a set value for the scope. | `updated_at` | string | false | | | | `workspace_owner_count` | integer | false | | | +#### Enumerated Values + +| Property | Value | +| ------------- | ----------- | +| `provisioner` | `terraform` | + ## codersdk.TemplateBuildTimeStats ```json @@ -3054,24 +3219,39 @@ Parameter represents a set value for the scope. "name": "string" } ], - "status": "string", + "status": "active", "username": "string" } ``` ### Properties -| Name | Type | Required | Restrictions | Description | -| ------------------ | --------------------------------------- | -------- | ------------ | ----------- | -| `avatar_url` | string | false | | | -| `created_at` | string | true | | | -| `email` | string | true | | | -| `id` | string | true | | | -| `last_seen_at` | string | false | | | -| `organization_ids` | array of string | false | | | -| `roles` | array of [codersdk.Role](#codersdkrole) | false | | | -| `status` | string | false | | | -| `username` | string | true | | | +| Name | Type | Required | Restrictions | Description | +| ------------------ | ------------------------------------------ | -------- | ------------ | ----------- | +| `avatar_url` | string | false | | | +| `created_at` | string | true | | | +| `email` | string | true | | | +| `id` | string | true | | | +| `last_seen_at` | string | false | | | +| `organization_ids` | array of string | false | | | +| `roles` | array of [codersdk.Role](#codersdkrole) | false | | | +| `status` | [codersdk.UserStatus](#codersdkuserstatus) | false | | | +| `username` | string | true | | | + +## codersdk.UserStatus + +```json +"active" +``` + +### Properties + +#### Enumerated Values + +| Value | +| ----------- | +| `active` | +| `suspended` | ## codersdk.ValidationError @@ -3130,7 +3310,7 @@ Parameter represents a set value for the scope. "command": "string", "display_name": "string", "external": true, - "health": "string", + "health": "disabled", "healthcheck": { "interval": 0, "threshold": 0, @@ -3249,7 +3429,7 @@ Parameter represents a set value for the scope. "command": "string", "display_name": "string", "external": true, - "health": "string", + "health": "disabled", "healthcheck": { "interval": 0, "threshold": 0, @@ -3299,30 +3479,30 @@ Parameter represents a set value for the scope. ### Properties -| Name | Type | Required | Restrictions | Description | -| ---------------------------- | ------------------------------------------------------- | -------- | ------------ | ------------------------------------------------------------------- | -| `apps` | array of [codersdk.WorkspaceApp](#codersdkworkspaceapp) | false | | | -| `architecture` | string | false | | | -| `connection_timeout_seconds` | integer | false | | | -| `created_at` | string | false | | | -| `directory` | string | false | | | -| `disconnected_at` | string | false | | | -| `environment_variables` | object | false | | | -| » `[any property]` | string | false | | | -| `first_connected_at` | string | false | | | -| `id` | string | false | | | -| `instance_id` | string | false | | | -| `last_connected_at` | string | false | | | -| `latency` | object | false | | Latency is mapped by region name (e.g. "New York City", "Seattle"). | -| » `[any property]` | [codersdk.DERPRegion](#codersdkderpregion) | false | | | -| `name` | string | false | | | -| `operating_system` | string | false | | | -| `resource_id` | string | false | | | -| `startup_script` | string | false | | | -| `status` | string | false | | | -| `troubleshooting_url` | string | false | | | -| `updated_at` | string | false | | | -| `version` | string | false | | | +| Name | Type | Required | Restrictions | Description | +| ---------------------------- | -------------------------------------------------------------- | -------- | ------------ | ------------------------------------------------------------------- | +| `apps` | array of [codersdk.WorkspaceApp](#codersdkworkspaceapp) | false | | | +| `architecture` | string | false | | | +| `connection_timeout_seconds` | integer | false | | | +| `created_at` | string | false | | | +| `directory` | string | false | | | +| `disconnected_at` | string | false | | | +| `environment_variables` | object | false | | | +| » `[any property]` | string | false | | | +| `first_connected_at` | string | false | | | +| `id` | string | false | | | +| `instance_id` | string | false | | | +| `last_connected_at` | string | false | | | +| `latency` | object | false | | Latency is mapped by region name (e.g. "New York City", "Seattle"). | +| » `[any property]` | [codersdk.DERPRegion](#codersdkderpregion) | false | | | +| `name` | string | false | | | +| `operating_system` | string | false | | | +| `resource_id` | string | false | | | +| `startup_script` | string | false | | | +| `status` | [codersdk.WorkspaceAgentStatus](#codersdkworkspaceagentstatus) | false | | | +| `troubleshooting_url` | string | false | | | +| `updated_at` | string | false | | | +| `version` | string | false | | | #### Enumerated Values @@ -3374,7 +3554,7 @@ Parameter represents a set value for the scope. "command": "string", "display_name": "string", "external": true, - "health": "string", + "health": "disabled", "healthcheck": { "interval": 0, "threshold": 0, @@ -3465,6 +3645,23 @@ Parameter represents a set value for the scope. | `startup_script` | string | false | | | | `vscode_port_proxy_uri` | string | false | | | +## codersdk.WorkspaceAgentStatus + +```json +"connecting" +``` + +### Properties + +#### Enumerated Values + +| Value | +| -------------- | +| `connecting` | +| `connected` | +| `disconnected` | +| `timeout` | + ## codersdk.WorkspaceApp ```json @@ -3472,7 +3669,7 @@ Parameter represents a set value for the scope. "command": "string", "display_name": "string", "external": true, - "health": "string", + "health": "disabled", "healthcheck": { "interval": 0, "threshold": 0, @@ -3489,19 +3686,19 @@ Parameter represents a set value for the scope. ### 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. | -| `health` | string | false | | | -| `healthcheck` | [codersdk.Healthcheck](#codersdkhealthcheck) | 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 | | | -| `sharing_level` | string | 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. | -| `url` | string | false | | URL is the address being proxied to inside the workspace. If external is specified, this will be opened on the client. | +| 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. | +| `health` | [codersdk.WorkspaceAppHealth](#codersdkworkspaceapphealth) | false | | | +| `healthcheck` | [codersdk.Healthcheck](#codersdkhealthcheck) | false | | Healthcheck specifies the configuration for checking app health. | +| `icon` | string | false | | Icon is a relative path or external URL that specifies an icon to be displayed in the dashboard. | +| `id` | string | 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. | +| `url` | string | false | | URL is the address being proxied to inside the workspace. If external is specified, this will be opened on the client. | #### Enumerated Values @@ -3511,6 +3708,39 @@ Parameter represents a set value for the scope. | `sharing_level` | `authenticated` | | `sharing_level` | `public` | +## codersdk.WorkspaceAppHealth + +```json +"disabled" +``` + +### Properties + +#### Enumerated Values + +| Value | +| -------------- | +| `disabled` | +| `initializing` | +| `healthy` | +| `unhealthy` | + +## codersdk.WorkspaceAppSharingLevel + +```json +"owner" +``` + +### Properties + +#### Enumerated Values + +| Value | +| --------------- | +| `owner` | +| `authenticated` | +| `public` | + ## codersdk.WorkspaceBuild ```json @@ -3547,7 +3777,7 @@ Parameter represents a set value for the scope. "command": "string", "display_name": "string", "external": true, - "health": "string", + "health": "disabled", "healthcheck": { "interval": 0, "threshold": 0, @@ -3636,12 +3866,12 @@ Parameter represents a set value for the scope. | `initiator_id` | string | false | | | | `initiator_name` | string | false | | | | `job` | [codersdk.ProvisionerJob](#codersdkprovisionerjob) | false | | | -| `reason` | string | false | | | +| `reason` | [codersdk.BuildReason](#codersdkbuildreason) | false | | | | `resources` | array of [codersdk.WorkspaceResource](#codersdkworkspaceresource) | false | | | -| `status` | string | false | | | +| `status` | [codersdk.WorkspaceStatus](#codersdkworkspacestatus) | false | | | | `template_version_id` | string | false | | | | `template_version_name` | string | false | | | -| `transition` | string | false | | | +| `transition` | [codersdk.WorkspaceTransition](#codersdkworkspacetransition) | false | | | | `updated_at` | string | false | | | | `workspace_id` | string | false | | | | `workspace_name` | string | false | | | @@ -3680,7 +3910,7 @@ Parameter represents a set value for the scope. "command": "string", "display_name": "string", "external": true, - "health": "string", + "health": "disabled", "healthcheck": { "interval": 0, "threshold": 0, @@ -3760,7 +3990,7 @@ Parameter represents a set value for the scope. | `metadata` | array of [codersdk.WorkspaceResourceMetadata](#codersdkworkspaceresourcemetadata) | false | | | | `name` | string | false | | | | `type` | string | false | | | -| `workspace_transition` | string | false | | | +| `workspace_transition` | [codersdk.WorkspaceTransition](#codersdkworkspacetransition) | false | | | #### Enumerated Values @@ -3788,6 +4018,45 @@ Parameter represents a set value for the scope. | `sensitive` | boolean | false | | | | `value` | string | false | | | +## codersdk.WorkspaceStatus + +```json +"pending" +``` + +### Properties + +#### Enumerated Values + +| Value | +| ----------- | +| `pending` | +| `starting` | +| `running` | +| `stopping` | +| `stopped` | +| `failed` | +| `canceling` | +| `canceled` | +| `deleting` | +| `deleted` | + +## codersdk.WorkspaceTransition + +```json +"start" +``` + +### Properties + +#### Enumerated Values + +| Value | +| -------- | +| `start` | +| `stop` | +| `delete` | + ## codersdk.WorkspacesResponse ```json @@ -3832,7 +4101,7 @@ Parameter represents a set value for the scope. "command": "string", "display_name": "string", "external": true, - "health": "string", + "health": "disabled", "healthcheck": {}, "icon": "string", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", @@ -3926,16 +4195,6 @@ Parameter represents a set value for the scope. | `count` | integer | false | | | | `workspaces` | array of [codersdk.Workspace](#codersdkworkspace) | false | | | -## netip.Addr - -```json -{} -``` - -### Properties - -_None_ - ## tailcfg.DERPMap ```json diff --git a/docs/api/templates.md b/docs/api/templates.md index 8b8f5b9783..43ea098e8a 100644 --- a/docs/api/templates.md +++ b/docs/api/templates.md @@ -75,7 +75,7 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization-id}/tem "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "provisioner": "string", + "provisioner": "terraform", "updated_at": "2019-08-24T14:15:22Z", "workspace_owner_count": 0 } @@ -138,7 +138,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/templat "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "provisioner": "string", + "provisioner": "terraform", "updated_at": "2019-08-24T14:15:22Z", "workspace_owner_count": 0 } @@ -155,29 +155,35 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/templat Status Code **200** -| Name | Type | Required | Restrictions | Description | -| ------------------------------------ | --------------------------------- | -------- | ------------ | ------------------------------------------ | -| `[array item]` | array | false | | | -| `» active_user_count` | integer | false | | ActiveUserCount is set to -1 when loading. | -| `» active_version_id` | string | false | | | -| `» allow_user_cancel_workspace_jobs` | boolean | false | | | -| `» build_time_stats` | `codersdk.TemplateBuildTimeStats` | false | | | -| `»» [any property]` | `codersdk.TransitionStats` | 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 | | | -| `» description` | string | false | | | -| `» display_name` | string | false | | | -| `» icon` | string | false | | | -| `» id` | string(uuid) | false | | | -| `» name` | string | false | | | -| `» organization_id` | string(uuid) | false | | | -| `» provisioner` | string | false | | | -| `» updated_at` | string(date-time) | false | | | -| `» workspace_owner_count` | integer | false | | | +| Name | Type | Required | Restrictions | Description | +| ------------------------------------ | ---------------------------------------------------------------------------- | -------- | ------------ | ------------------------------------------ | +| `[array item]` | array | false | | | +| `» active_user_count` | integer | false | | ActiveUserCount is set to -1 when loading. | +| `» active_version_id` | string | false | | | +| `» allow_user_cancel_workspace_jobs` | boolean | false | | | +| `» 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 | | | +| `» description` | string | false | | | +| `» display_name` | string | false | | | +| `» icon` | string | false | | | +| `» id` | string(uuid) | false | | | +| `» name` | string | false | | | +| `» organization_id` | string(uuid) | false | | | +| `» provisioner` | string | false | | | +| `» updated_at` | string(date-time) | false | | | +| `» workspace_owner_count` | integer | false | | | + +#### Enumerated Values + +| Property | Value | +| ------------- | ----------- | +| `provisioner` | `terraform` | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -230,7 +236,7 @@ curl -X GET http://coder-server:8080/api/v2/organizations/{organization}/templat "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "provisioner": "string", + "provisioner": "terraform", "updated_at": "2019-08-24T14:15:22Z", "workspace_owner_count": 0 } @@ -292,7 +298,7 @@ curl -X GET http://coder-server:8080/api/v2/templates/{id} \ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "provisioner": "string", + "provisioner": "terraform", "updated_at": "2019-08-24T14:15:22Z", "workspace_owner_count": 0 } @@ -398,7 +404,7 @@ curl -X PATCH http://coder-server:8080/api/v2/templates/{id} \ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6", - "provisioner": "string", + "provisioner": "terraform", "updated_at": "2019-08-24T14:15:22Z", "workspace_owner_count": 0 } diff --git a/docs/api/workspaces.md b/docs/api/workspaces.md index afd7f0ffaa..bd362e8249 100644 --- a/docs/api/workspaces.md +++ b/docs/api/workspaces.md @@ -65,7 +65,7 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/member "command": "string", "display_name": "string", "external": true, - "health": "string", + "health": "disabled", "healthcheck": { "interval": 0, "threshold": 0, @@ -226,7 +226,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/workspace/{workspacenam "command": "string", "display_name": "string", "external": true, - "health": "string", + "health": "disabled", "healthcheck": { "interval": 0, "threshold": 0, @@ -410,7 +410,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaces \ "command": "string", "display_name": "string", "external": true, - "health": "string", + "health": "disabled", "healthcheck": {}, "icon": "string", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", @@ -568,7 +568,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{id} \ "command": "string", "display_name": "string", "external": true, - "health": "string", + "health": "disabled", "healthcheck": { "interval": 0, "threshold": 0, diff --git a/scripts/apidocgen/generate.sh b/scripts/apidocgen/generate.sh index a02ecf131b..b13eb2bc26 100755 --- a/scripts/apidocgen/generate.sh +++ b/scripts/apidocgen/generate.sh @@ -18,7 +18,7 @@ trap cleanup EXIT log "Use temporary file: ${API_MD_TMP_FILE}" pushd "${PROJECT_ROOT}" -go run github.com/swaggo/swag/cmd/swag@v1.8.6 init \ +go run github.com/swaggo/swag/cmd/swag@v1.8.9 init \ --generalInfo="coderd.go" \ --dir="./coderd,./codersdk" \ --output="./coderd/apidoc" \ diff --git a/scripts/apidocgen/markdown-template/main.dot b/scripts/apidocgen/markdown-template/main.dot index 6c324570d3..a4fa2d6b03 100644 --- a/scripts/apidocgen/markdown-template/main.dot +++ b/scripts/apidocgen/markdown-template/main.dot @@ -133,10 +133,10 @@ {{? block===blocks[0] }} {{= data.tags.section }} - ### Properties {{?}} +{{? block.rows.length > 0 && block.rows[0].displayName != "*anonymous*"}} {{? block.rows.length}}|Name|Type|Required|Restrictions|Description| |---|---|---|---|---|{{?}} {{~ block.rows :p}}|{{= renderDisplayName(p)}}|{{= renderPropertyType(p)}}|{{=p.required}}|{{=p.restrictions||''}}|{{= renderDescription(p)}}| @@ -145,16 +145,24 @@ {{? (blocks[0].rows.length === 0) && (blocks.length === 1) }} *None* {{?}} +{{?}} {{? enums.length > 0 }} {{= data.tags.section }} #### Enumerated Values +{{? block.rows.length > 0 && block.rows[0].displayName != "*anonymous*"}} |Property|Value| |---|---| {{~ enums :e}}|`{{=e.name}}`|`{{=data.utils.toPrimitive(e.value)}}`| {{~}} +{{??}} +|Value| +|---| +{{~ enums :e}}|`{{=data.utils.toPrimitive(e.value)}}`| +{{~}} +{{?}} {{= data.tags.endSection }} {{?}} diff --git a/scripts/apidocgen/markdown-template/responses.def b/scripts/apidocgen/markdown-template/responses.def index 8fe3e36c4f..843c676594 100644 --- a/scripts/apidocgen/markdown-template/responses.def +++ b/scripts/apidocgen/markdown-template/responses.def @@ -35,7 +35,8 @@ function renderResponsePropertyType(p) { if (p.$ref) { - return '`' + p.$ref + '`'; + const href = p.$ref.replace(".","").toLowerCase(); + return "[" + p.$ref + "](schemas.md#" + href + ")"; } if (p.type == 'array') {