From a46e7c81ac1c219c2cb1222ec04c6493b061a12a Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Thu, 5 Jan 2023 15:33:53 +0100 Subject: [PATCH 1/8] docs: update swaggo/swag v1.8.9 --- coderd/apidoc/docs.go | 467 +++++++++++++++-- coderd/apidoc/swagger.json | 402 +++++++++++++-- docs/api/agents.md | 8 +- docs/api/audit.md | 6 +- docs/api/builds.md | 334 +++++++------ docs/api/general.md | 70 +-- docs/api/parameters.md | 22 +- docs/api/schemas.md | 913 ++++++++++++++++++++++++---------- docs/api/templates.md | 19 +- docs/api/workspaces.md | 8 +- scripts/apidocgen/generate.sh | 2 +- 11 files changed, 1691 insertions(+), 560 deletions(-) diff --git a/coderd/apidoc/docs.go b/coderd/apidoc/docs.go index 051674d0661c3..3c504063557a7 100644 --- a/coderd/apidoc/docs.go +++ b/coderd/apidoc/docs.go @@ -1914,10 +1914,31 @@ const docTemplate = `{ "properties": { "report_interval": { "description": "ReportInterval is the duration after which the agent should send stats\nagain.", - "type": "integer" + "allOf": [ + { + "$ref": "#/definitions/time.Duration" + } + ] } } }, + "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 +1959,7 @@ const docTemplate = `{ "type": "object", "properties": { "action": { - "type": "string" + "$ref": "#/definitions/codersdk.AuditAction" }, "additional_fields": { "type": "array", @@ -1981,7 +2002,7 @@ const docTemplate = `{ "type": "string" }, "resource_type": { - "type": "string" + "$ref": "#/definitions/codersdk.ResourceType" }, "status_code": { "type": "integer" @@ -2026,7 +2047,11 @@ 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" + "allOf": [ + { + "$ref": "#/definitions/codersdk.AuthorizationObject" + } + ] } } }, @@ -2098,6 +2123,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 +2151,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 +2228,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 +2255,11 @@ const docTemplate = `{ "git_ssh_key", "api_key", "group" + ], + "allOf": [ + { + "$ref": "#/definitions/codersdk.ResourceType" + } ] }, "time": { @@ -2243,12 +2297,16 @@ const docTemplate = `{ "type": "string" }, "transition": { - "type": "string", "enum": [ "create", "start", "stop", "delete" + ], + "allOf": [ + { + "$ref": "#/definitions/codersdk.WorkspaceTransition" + } ] } } @@ -2317,7 +2375,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 +2507,10 @@ const docTemplate = `{ "type": "string" }, "value": { - "$ref": "#/definitions/codersdk.GitAuthConfig" + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.GitAuthConfig" + } } } }, @@ -2480,7 +2545,10 @@ const docTemplate = `{ "type": "string" }, "value": { - "type": "string" + "type": "array", + "items": { + "type": "string" + } } } }, @@ -2584,7 +2652,7 @@ const docTemplate = `{ "type": "object", "properties": { "default": { - "type": "integer" + "$ref": "#/definitions/time.Duration" }, "enterprise": { "type": "boolean" @@ -2608,7 +2676,7 @@ const docTemplate = `{ "type": "string" }, "value": { - "type": "integer" + "$ref": "#/definitions/time.Duration" } } }, @@ -2684,6 +2752,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 +2852,15 @@ const docTemplate = `{ "format": "date-time" }, "destination_scheme": { - "type": "string", "enum": [ "none", "environment_variable", "provisioner_variable" + ], + "allOf": [ + { + "$ref": "#/definitions/codersdk.ParameterDestinationScheme" + } ] }, "id": { @@ -2771,11 +2871,15 @@ const docTemplate = `{ "type": "string" }, "scope": { - "type": "string", "enum": [ "template", "workspace", "import_job" + ], + "allOf": [ + { + "$ref": "#/definitions/codersdk.ParameterScope" + } ] }, "scope_id": { @@ -2783,10 +2887,14 @@ const docTemplate = `{ "format": "uuid" }, "source_scheme": { - "type": "string", "enum": [ "none", "data" + ], + "allOf": [ + { + "$ref": "#/definitions/codersdk.ParameterSourceScheme" + } ] }, "updated_at": { @@ -2795,6 +2903,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 +2956,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 +3031,6 @@ const docTemplate = `{ "format": "date-time" }, "status": { - "type": "string", "enum": [ "pending", "running", @@ -2894,6 +3038,11 @@ const docTemplate = `{ "canceling", "canceled", "failed" + ], + "allOf": [ + { + "$ref": "#/definitions/codersdk.ProvisionerJobStatus" + } ] }, "tags": { @@ -2919,17 +3068,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 +3092,36 @@ const docTemplate = `{ } } }, + "codersdk.ProvisionerJobStatus": { + "type": "string", + "enum": [ + "pending", + "running", + "succeeded", + "canceling", + "canceled", + "failed" + ], + "x-enum-varnames": [ + "ProvisionerJobPending", + "ProvisionerJobRunning", + "ProvisionerJobSucceeded", + "ProvisionerJobCanceling", + "ProvisionerJobCanceled", + "ProvisionerJobFailed" + ] + }, + "codersdk.ProvisionerType": { + "type": "string", + "enum": [ + "echo", + "terraform" + ], + "x-enum-varnames": [ + "ProvisionerTypeEcho", + "ProvisionerTypeTerraform" + ] + }, "codersdk.PutExtendWorkspaceRequest": { "type": "object", "required": [ @@ -2950,6 +3133,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": { @@ -3089,7 +3297,7 @@ const docTemplate = `{ "format": "uuid" }, "provisioner": { - "type": "string" + "$ref": "#/definitions/codersdk.ProvisionerType" }, "updated_at": { "type": "string", @@ -3220,13 +3428,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": [ @@ -3369,12 +3588,16 @@ const docTemplate = `{ "type": "string" }, "status": { - "type": "string", "enum": [ "connecting", "connected", "disconnected", "timeout" + ], + "allOf": [ + { + "$ref": "#/definitions/codersdk.WorkspaceAgentStatus" + } ] }, "troubleshooting_url": { @@ -3447,6 +3670,21 @@ const docTemplate = `{ } } }, + "codersdk.WorkspaceAgentStatus": { + "type": "string", + "enum": [ + "connecting", + "connected", + "disconnected", + "timeout" + ], + "x-enum-varnames": [ + "WorkspaceAgentConnecting", + "WorkspaceAgentConnected", + "WorkspaceAgentDisconnected", + "WorkspaceAgentTimeout" + ] + }, "codersdk.WorkspaceApp": { "type": "object", "properties": { @@ -3462,11 +3700,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.", @@ -3477,11 +3719,15 @@ const docTemplate = `{ "format": "uuid" }, "sharing_level": { - "type": "string", "enum": [ "owner", "authenticated", "public" + ], + "allOf": [ + { + "$ref": "#/definitions/codersdk.WorkspaceAppSharingLevel" + } ] }, "slug": { @@ -3498,6 +3744,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": { @@ -3530,11 +3804,15 @@ const docTemplate = `{ "$ref": "#/definitions/codersdk.ProvisionerJob" }, "reason": { - "type": "string", "enum": [ "initiator", "autostart", "autostop" + ], + "allOf": [ + { + "$ref": "#/definitions/codersdk.BuildReason" + } ] }, "resources": { @@ -3544,7 +3822,6 @@ const docTemplate = `{ } }, "status": { - "type": "string", "enum": [ "pending", "starting", @@ -3556,6 +3833,11 @@ const docTemplate = `{ "canceled", "deleting", "deleted" + ], + "allOf": [ + { + "$ref": "#/definitions/codersdk.WorkspaceStatus" + } ] }, "template_version_id": { @@ -3566,11 +3848,15 @@ const docTemplate = `{ "type": "string" }, "transition": { - "type": "string", "enum": [ "start", "stop", "delete" + ], + "allOf": [ + { + "$ref": "#/definitions/codersdk.WorkspaceTransition" + } ] }, "updated_at": { @@ -3636,11 +3922,15 @@ const docTemplate = `{ "type": "string" }, "workspace_transition": { - "type": "string", "enum": [ "start", "stop", "delete" + ], + "allOf": [ + { + "$ref": "#/definitions/codersdk.WorkspaceTransition" + } ] } } @@ -3659,6 +3949,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": { @@ -3776,6 +4106,81 @@ const docTemplate = `{ "type": "string" } } + }, + "time.Duration": { + "type": "integer", + "enum": [ + -9223372036854775808, + 9223372036854775807, + 1, + 1000, + 1000000, + 1000000000, + 60000000000, + 3600000000000, + -9223372036854775808, + 9223372036854775807, + 1, + 1000, + 1000000, + 1000000000, + 60000000000, + 3600000000000, + -9223372036854775808, + 9223372036854775807, + 1, + 1000, + 1000000, + 1000000000, + 60000000000, + 3600000000000, + 1, + 1000, + 1000000, + 1000000000, + 60000000000, + 1, + 1000, + 1000000, + 1000000000, + 60000000000 + ], + "x-enum-varnames": [ + "minDuration", + "maxDuration", + "Nanosecond", + "Microsecond", + "Millisecond", + "Second", + "Minute", + "Hour", + "minDuration", + "maxDuration", + "Nanosecond", + "Microsecond", + "Millisecond", + "Second", + "Minute", + "Hour", + "minDuration", + "maxDuration", + "Nanosecond", + "Microsecond", + "Millisecond", + "Second", + "Minute", + "Hour", + "Nanosecond", + "Microsecond", + "Millisecond", + "Second", + "Minute", + "Nanosecond", + "Microsecond", + "Millisecond", + "Second", + "Minute" + ] } }, "securityDefinitions": { diff --git a/coderd/apidoc/swagger.json b/coderd/apidoc/swagger.json index 71193925a37d3..a7b1a26d415ff 100644 --- a/coderd/apidoc/swagger.json +++ b/coderd/apidoc/swagger.json @@ -1678,10 +1678,25 @@ "properties": { "report_interval": { "description": "ReportInterval is the duration after which the agent should send stats\nagain.", - "type": "integer" + "allOf": [ + { + "$ref": "#/definitions/time.Duration" + } + ] } } }, + "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 +1717,7 @@ "type": "object", "properties": { "action": { - "type": "string" + "$ref": "#/definitions/codersdk.AuditAction" }, "additional_fields": { "type": "array", @@ -1745,7 +1760,7 @@ "type": "string" }, "resource_type": { - "type": "string" + "$ref": "#/definitions/codersdk.ResourceType" }, "status_code": { "type": "integer" @@ -1785,7 +1800,11 @@ }, "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" + "allOf": [ + { + "$ref": "#/definitions/codersdk.AuthorizationObject" + } + ] } } }, @@ -1854,6 +1873,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 +1897,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 +1964,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 +1985,11 @@ "git_ssh_key", "api_key", "group" + ], + "allOf": [ + { + "$ref": "#/definitions/codersdk.ResourceType" + } ] }, "time": { @@ -1981,8 +2025,12 @@ "type": "string" }, "transition": { - "type": "string", - "enum": ["create", "start", "stop", "delete"] + "enum": ["create", "start", "stop", "delete"], + "allOf": [ + { + "$ref": "#/definitions/codersdk.WorkspaceTransition" + } + ] } } }, @@ -2050,7 +2098,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 +2230,10 @@ "type": "string" }, "value": { - "$ref": "#/definitions/codersdk.GitAuthConfig" + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.GitAuthConfig" + } } } }, @@ -2213,7 +2268,10 @@ "type": "string" }, "value": { - "type": "string" + "type": "array", + "items": { + "type": "string" + } } } }, @@ -2317,7 +2375,7 @@ "type": "object", "properties": { "default": { - "type": "integer" + "$ref": "#/definitions/time.Duration" }, "enterprise": { "type": "boolean" @@ -2341,7 +2399,7 @@ "type": "string" }, "value": { - "type": "integer" + "$ref": "#/definitions/time.Duration" } } }, @@ -2415,6 +2473,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 +2561,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 +2576,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 +2601,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 +2643,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 +2718,6 @@ "format": "date-time" }, "status": { - "type": "string", "enum": [ "pending", "running", @@ -2614,6 +2725,11 @@ "canceling", "canceled", "failed" + ], + "allOf": [ + { + "$ref": "#/definitions/codersdk.ProvisionerJobStatus" + } ] }, "tags": { @@ -2639,11 +2755,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 +2773,30 @@ } } }, + "codersdk.ProvisionerJobStatus": { + "type": "string", + "enum": [ + "pending", + "running", + "succeeded", + "canceling", + "canceled", + "failed" + ], + "x-enum-varnames": [ + "ProvisionerJobPending", + "ProvisionerJobRunning", + "ProvisionerJobSucceeded", + "ProvisionerJobCanceling", + "ProvisionerJobCanceled", + "ProvisionerJobFailed" + ] + }, + "codersdk.ProvisionerType": { + "type": "string", + "enum": ["echo", "terraform"], + "x-enum-varnames": ["ProvisionerTypeEcho", "ProvisionerTypeTerraform"] + }, "codersdk.PutExtendWorkspaceRequest": { "type": "object", "required": ["deadline"], @@ -2662,6 +2806,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": { @@ -2801,7 +2970,7 @@ "format": "uuid" }, "provisioner": { - "type": "string" + "$ref": "#/definitions/codersdk.ProvisionerType" }, "updated_at": { "type": "string", @@ -2927,13 +3096,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"], @@ -3073,8 +3247,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" @@ -3146,6 +3324,16 @@ } } }, + "codersdk.WorkspaceAgentStatus": { + "type": "string", + "enum": ["connecting", "connected", "disconnected", "timeout"], + "x-enum-varnames": [ + "WorkspaceAgentConnecting", + "WorkspaceAgentConnected", + "WorkspaceAgentDisconnected", + "WorkspaceAgentTimeout" + ] + }, "codersdk.WorkspaceApp": { "type": "object", "properties": { @@ -3161,11 +3349,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.", @@ -3176,8 +3368,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.", @@ -3193,6 +3389,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": { @@ -3225,8 +3440,12 @@ "$ref": "#/definitions/codersdk.ProvisionerJob" }, "reason": { - "type": "string", - "enum": ["initiator", "autostart", "autostop"] + "enum": ["initiator", "autostart", "autostop"], + "allOf": [ + { + "$ref": "#/definitions/codersdk.BuildReason" + } + ] }, "resources": { "type": "array", @@ -3235,7 +3454,6 @@ } }, "status": { - "type": "string", "enum": [ "pending", "starting", @@ -3247,6 +3465,11 @@ "canceled", "deleting", "deleted" + ], + "allOf": [ + { + "$ref": "#/definitions/codersdk.WorkspaceStatus" + } ] }, "template_version_id": { @@ -3257,8 +3480,12 @@ "type": "string" }, "transition": { - "type": "string", - "enum": ["start", "stop", "delete"] + "enum": ["start", "stop", "delete"], + "allOf": [ + { + "$ref": "#/definitions/codersdk.WorkspaceTransition" + } + ] }, "updated_at": { "type": "string", @@ -3323,8 +3550,12 @@ "type": "string" }, "workspace_transition": { - "type": "string", - "enum": ["start", "stop", "delete"] + "enum": ["start", "stop", "delete"], + "allOf": [ + { + "$ref": "#/definitions/codersdk.WorkspaceTransition" + } + ] } } }, @@ -3342,6 +3573,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": { @@ -3459,6 +3726,53 @@ "type": "string" } } + }, + "time.Duration": { + "type": "integer", + "enum": [ + -9223372036854775808, 9223372036854775807, 1, 1000, 1000000, 1000000000, + 60000000000, 3600000000000, -9223372036854775808, 9223372036854775807, + 1, 1000, 1000000, 1000000000, 60000000000, 3600000000000, + -9223372036854775808, 9223372036854775807, 1, 1000, 1000000, 1000000000, + 60000000000, 3600000000000, 1, 1000, 1000000, 1000000000, 60000000000, + 1, 1000, 1000000, 1000000000, 60000000000 + ], + "x-enum-varnames": [ + "minDuration", + "maxDuration", + "Nanosecond", + "Microsecond", + "Millisecond", + "Second", + "Minute", + "Hour", + "minDuration", + "maxDuration", + "Nanosecond", + "Microsecond", + "Millisecond", + "Second", + "Minute", + "Hour", + "minDuration", + "maxDuration", + "Nanosecond", + "Microsecond", + "Millisecond", + "Second", + "Minute", + "Hour", + "Nanosecond", + "Microsecond", + "Millisecond", + "Second", + "Minute", + "Nanosecond", + "Microsecond", + "Millisecond", + "Second", + "Minute" + ] } }, "securityDefinitions": { diff --git a/docs/api/agents.md b/docs/api/agents.md index 4a02ff56dc637..a9439a48463b7 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, @@ -426,7 +426,7 @@ curl -X POST http://coder-server:8080/api/v2/workspaceagents/me/report-stats \ ```json { - "report_interval": 0 + "report_interval": -9223372036854776000 } ``` diff --git a/docs/api/audit.md b/docs/api/audit.md index 8c85b97f68618..05feffbbf4d98 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": { @@ -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 053819796c123..a28a5ec35fdfb 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` | false | | | +| `» log_source` | `codersdk.LogSource` | 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` | false | | | +| `»»» healthcheck` | `codersdk.Healthcheck` | 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` | 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` | `codersdk.WorkspaceAgentStatus` | 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` | 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` | 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` | false | | | +| `»» tags` | object | false | | | +| `»»» [any property]` | string | false | | | +| `»» worker_id` | string(uuid) | false | | | +| `» reason` | `codersdk.BuildReason` | 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` | false | | | +| `»»»» healthcheck` | `codersdk.Healthcheck` | 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` | 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` | `codersdk.WorkspaceAgentStatus` | 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` | false | | | +| `» status` | `codersdk.WorkspaceStatus` | false | | | +| `» template_version_id` | string(uuid) | false | | | +| `» template_version_name` | string | false | | | +| `» transition` | `codersdk.WorkspaceTransition` | 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 53927245a057b..a1ba13036b1bc 100644 --- a/docs/api/general.md +++ b/docs/api/general.md @@ -119,7 +119,7 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ "value": "string" }, "agent_stat_refresh_interval": { - "default": 0, + "default": -9223372036854776000, "enterprise": true, "flag": "string", "hidden": true, @@ -127,7 +127,7 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ "secret": true, "shorthand": "string", "usage": "string", - "value": 0 + "value": -9223372036854776000 }, "api_rate_limit": { "default": 0, @@ -152,7 +152,7 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ "value": true }, "autobuild_poll_interval": { - "default": 0, + "default": -9223372036854776000, "enterprise": true, "flag": "string", "hidden": true, @@ -160,7 +160,7 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ "secret": true, "shorthand": "string", "usage": "string", - "value": 0 + "value": -9223372036854776000 }, "browser_only": { "default": true, @@ -274,7 +274,7 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] } } }, @@ -310,17 +310,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", @@ -345,7 +347,7 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ "value": true }, "max_token_lifetime": { - "default": 0, + "default": -9223372036854776000, "enterprise": true, "flag": "string", "hidden": true, @@ -353,10 +355,10 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ "secret": true, "shorthand": "string", "usage": "string", - "value": 0 + "value": -9223372036854776000 }, "metrics_cache_refresh_interval": { - "default": 0, + "default": -9223372036854776000, "enterprise": true, "flag": "string", "hidden": true, @@ -364,7 +366,7 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ "secret": true, "shorthand": "string", "usage": "string", - "value": 0 + "value": -9223372036854776000 }, "oauth2": { "github": { @@ -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"] }, "allowed_teams": { "default": ["string"], @@ -410,7 +412,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", @@ -490,7 +492,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, @@ -523,7 +525,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", @@ -598,7 +600,7 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ }, "provisioner": { "daemon_poll_interval": { - "default": 0, + "default": -9223372036854776000, "enterprise": true, "flag": "string", "hidden": true, @@ -606,10 +608,10 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ "secret": true, "shorthand": "string", "usage": "string", - "value": 0 + "value": -9223372036854776000 }, "daemon_poll_jitter": { - "default": 0, + "default": -9223372036854776000, "enterprise": true, "flag": "string", "hidden": true, @@ -617,7 +619,7 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ "secret": true, "shorthand": "string", "usage": "string", - "value": 0 + "value": -9223372036854776000 }, "daemons": { "default": 0, @@ -631,7 +633,7 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ "value": 0 }, "force_cancel_interval": { - "default": 0, + "default": -9223372036854776000, "enterprise": true, "flag": "string", "hidden": true, @@ -639,7 +641,7 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ "secret": true, "shorthand": "string", "usage": "string", - "value": 0 + "value": -9223372036854776000 } }, "proxy_trusted_headers": { @@ -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"] }, "proxy_trusted_origins": { "default": ["string"], @@ -662,7 +664,7 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] }, "scim_api_key": { "default": "string", @@ -766,7 +768,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", @@ -832,7 +834,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 b17ac81678fbb..793b00dc62333 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` | false | | | +| `» id` | string(uuid) | false | | | +| `» name` | string | false | | | +| `» scope` | `codersdk.ParameterScope` | false | | | +| `» scope_id` | string(uuid) | false | | | +| `» source_scheme` | `codersdk.ParameterSourceScheme` | false | | | +| `» updated_at` | string(date-time) | false | | | #### Enumerated Values diff --git a/docs/api/schemas.md b/docs/api/schemas.md index 97bbf9adb496f..af95371a61f22 100644 --- a/docs/api/schemas.md +++ b/docs/api/schemas.md @@ -80,15 +80,37 @@ ```json { - "report_interval": 0 + "report_interval": -9223372036854776000 } ``` ### Properties -| Name | Type | Required | Restrictions | Description | -| ----------------- | ------- | -------- | ------------ | ------------------------------------------------------------------------------ | -| `report_interval` | integer | false | | Report interval is the duration after which the agent should send stats again. | +| Name | Type | Required | Restrictions | Description | +| ----------------- | ------------------------------ | -------- | ------------ | ------------------------------------------------------------------------------ | +| `report_interval` | [time.Duration](#timeduration) | false | | Report interval is the duration after which the agent should send stats again. | + +## codersdk.AuditAction + +```json +"create" +``` + +### Properties + +| Name | Type | Required | Restrictions | Description | +| ------------- | ------ | -------- | ------------ | ----------- | +| `*anonymous*` | string | false | | | + +#### Enumerated Values + +| Property | Value | +| ------------- | -------- | +| `*anonymous*` | `create` | +| `*anonymous*` | `write` | +| `*anonymous*` | `delete` | +| `*anonymous*` | `start` | +| `*anonymous*` | `stop` | ## codersdk.AuditDiff @@ -135,7 +157,7 @@ ```json { - "action": "string", + "action": "create", "additional_fields": [0], "description": "string", "diff": { @@ -159,7 +181,7 @@ "resource_id": "string", "resource_link": "string", "resource_target": "string", - "resource_type": "string", + "resource_type": "organization", "status_code": 0, "time": "string", "user": { @@ -175,7 +197,7 @@ "name": "string" } ], - "status": "string", + "status": "active", "username": "string" }, "user_agent": "string" @@ -184,26 +206,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` | [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` | [codersdk.ResourceType](#codersdkresourcetype) | false | | | +| `status_code` | integer | false | | | +| `time` | string | false | | | +| `user` | [codersdk.User](#codersdkuser) | false | | | +| `user_agent` | string | false | | | ## codersdk.AuditLogResponse @@ -211,7 +233,7 @@ { "audit_logs": [ { - "action": "string", + "action": "create", "additional_fields": [0], "description": "string", "diff": { @@ -235,7 +257,7 @@ "resource_id": "string", "resource_link": "string", "resource_target": "string", - "resource_type": "string", + "resource_type": "organization", "status_code": 0, "time": "string", "user": { @@ -251,7 +273,7 @@ "name": "string" } ], - "status": "string", + "status": "active", "username": "string" }, "user_agent": "string" @@ -286,10 +308,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 - 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 +425,26 @@ 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 + +| Name | Type | Required | Restrictions | Description | +| ------------- | ------ | -------- | ------------ | ----------- | +| `*anonymous*` | string | false | | | + +#### Enumerated Values + +| Property | Value | +| ------------- | ----------- | +| `*anonymous*` | `initiator` | +| `*anonymous*` | `autostart` | +| `*anonymous*` | `autostop` | + ## codersdk.CreateParameterRequest ```json @@ -419,13 +461,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 +529,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 +585,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 +689,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 +822,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] } } ``` @@ -834,7 +876,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "value": "string" }, "agent_stat_refresh_interval": { - "default": 0, + "default": -9223372036854776000, "enterprise": true, "flag": "string", "hidden": true, @@ -842,7 +884,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": 0 + "value": -9223372036854776000 }, "api_rate_limit": { "default": 0, @@ -867,7 +909,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "value": true }, "autobuild_poll_interval": { - "default": 0, + "default": -9223372036854776000, "enterprise": true, "flag": "string", "hidden": true, @@ -875,7 +917,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": 0 + "value": -9223372036854776000 }, "browser_only": { "default": true, @@ -989,7 +1031,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] } } }, @@ -1025,17 +1067,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", @@ -1060,7 +1104,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "value": true }, "max_token_lifetime": { - "default": 0, + "default": -9223372036854776000, "enterprise": true, "flag": "string", "hidden": true, @@ -1068,10 +1112,10 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": 0 + "value": -9223372036854776000 }, "metrics_cache_refresh_interval": { - "default": 0, + "default": -9223372036854776000, "enterprise": true, "flag": "string", "hidden": true, @@ -1079,7 +1123,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": 0 + "value": -9223372036854776000 }, "oauth2": { "github": { @@ -1114,7 +1158,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"], @@ -1125,7 +1169,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", @@ -1205,7 +1249,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, @@ -1238,7 +1282,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", @@ -1313,7 +1357,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a }, "provisioner": { "daemon_poll_interval": { - "default": 0, + "default": -9223372036854776000, "enterprise": true, "flag": "string", "hidden": true, @@ -1321,10 +1365,10 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": 0 + "value": -9223372036854776000 }, "daemon_poll_jitter": { - "default": 0, + "default": -9223372036854776000, "enterprise": true, "flag": "string", "hidden": true, @@ -1332,7 +1376,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": 0 + "value": -9223372036854776000 }, "daemons": { "default": 0, @@ -1346,7 +1390,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "value": 0 }, "force_cancel_interval": { - "default": 0, + "default": -9223372036854776000, "enterprise": true, "flag": "string", "hidden": true, @@ -1354,7 +1398,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": 0 + "value": -9223372036854776000 } }, "proxy_trusted_headers": { @@ -1366,7 +1410,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"], @@ -1377,7 +1421,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] }, "scim_api_key": { "default": "string", @@ -1481,7 +1525,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", @@ -1547,7 +1591,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", @@ -1634,41 +1678,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 | | | -| `api_rate_limit` | [codersdk.DeploymentConfigField-int](#codersdkdeploymentconfigfield-int) | 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 | | | -| `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 | | | +| `api_rate_limit` | [codersdk.DeploymentConfigField-int](#codersdkdeploymentconfigfield-int) | 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 | | | +| `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 @@ -1694,17 +1738,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" + } + ] } ``` @@ -1720,7 +1766,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 @@ -1734,7 +1780,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] } ``` @@ -1750,7 +1796,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 @@ -1846,7 +1892,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a ```json { - "default": 0, + "default": -9223372036854776000, "enterprise": true, "flag": "string", "hidden": true, @@ -1854,23 +1900,23 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": 0 + "value": -9223372036854776000 } ``` ### Properties -| Name | Type | Required | Restrictions | Description | -| ------------ | ------- | -------- | ------------ | ----------- | -| `default` | integer | false | | | -| `enterprise` | boolean | false | | | -| `flag` | string | false | | | -| `hidden` | boolean | false | | | -| `name` | string | false | | | -| `secret` | boolean | false | | | -| `shorthand` | string | false | | | -| `usage` | string | false | | | -| `value` | integer | false | | | +| Name | Type | Required | Restrictions | Description | +| ------------ | ------------------------------ | -------- | ------------ | ----------- | +| `default` | [time.Duration](#timeduration) | false | | | +| `enterprise` | boolean | false | | | +| `flag` | string | false | | | +| `hidden` | boolean | false | | | +| `name` | string | false | | | +| `secret` | boolean | false | | | +| `shorthand` | string | false | | | +| `usage` | string | false | | | +| `value` | [time.Duration](#timeduration) | false | | | ## codersdk.GetAppHostResponse @@ -1948,6 +1994,47 @@ 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 + +| Name | Type | Required | Restrictions | Description | +| ------------- | ------ | -------- | ------------ | ----------- | +| `*anonymous*` | string | false | | | + +#### Enumerated Values + +| Property | Value | +| ------------- | ------- | +| `*anonymous*` | `trace` | +| `*anonymous*` | `debug` | +| `*anonymous*` | `info` | +| `*anonymous*` | `warn` | +| `*anonymous*` | `error` | + +## codersdk.LogSource + +```json +"provisioner_daemon" +``` + +### Properties + +| Name | Type | Required | Restrictions | Description | +| ------------- | ------ | -------- | ------------ | ----------- | +| `*anonymous*` | string | false | | | + +#### Enumerated Values + +| Property | Value | +| ------------- | -------------------- | +| `*anonymous*` | `provisioner_daemon` | +| `*anonymous*` | `provisioner` | + ## codersdk.OAuth2Config ```json @@ -1984,7 +2071,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"], @@ -1995,7 +2082,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", @@ -2075,7 +2162,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"], @@ -2086,7 +2173,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", @@ -2182,7 +2269,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, @@ -2215,7 +2302,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", @@ -2263,16 +2350,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 @@ -2287,23 +2374,82 @@ Parameter represents a set value for the scope. | `source_scheme` | `none` | | `source_scheme` | `data` | +## codersdk.ParameterDestinationScheme + +```json +"none" +``` + +### Properties + +| Name | Type | Required | Restrictions | Description | +| ------------- | ------ | -------- | ------------ | ----------- | +| `*anonymous*` | string | false | | | + +#### Enumerated Values + +| Property | Value | +| ------------- | ---------------------- | +| `*anonymous*` | `none` | +| `*anonymous*` | `environment_variable` | +| `*anonymous*` | `provisioner_variable` | + +## codersdk.ParameterScope + +```json +"template" +``` + +### Properties + +| Name | Type | Required | Restrictions | Description | +| ------------- | ------ | -------- | ------------ | ----------- | +| `*anonymous*` | string | false | | | + +#### Enumerated Values + +| Property | Value | +| ------------- | ------------ | +| `*anonymous*` | `template` | +| `*anonymous*` | `workspace` | +| `*anonymous*` | `import_job` | + +## codersdk.ParameterSourceScheme + +```json +"none" +``` + +### Properties + +| Name | Type | Required | Restrictions | Description | +| ------------- | ------ | -------- | ------------ | ----------- | +| `*anonymous*` | string | false | | | + +#### Enumerated Values + +| Property | Value | +| ------------- | ------ | +| `*anonymous*` | `none` | +| `*anonymous*` | `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 @@ -2382,7 +2528,7 @@ Parameter represents a set value for the scope. ```json { "daemon_poll_interval": { - "default": 0, + "default": -9223372036854776000, "enterprise": true, "flag": "string", "hidden": true, @@ -2390,10 +2536,10 @@ Parameter represents a set value for the scope. "secret": true, "shorthand": "string", "usage": "string", - "value": 0 + "value": -9223372036854776000 }, "daemon_poll_jitter": { - "default": 0, + "default": -9223372036854776000, "enterprise": true, "flag": "string", "hidden": true, @@ -2401,7 +2547,7 @@ Parameter represents a set value for the scope. "secret": true, "shorthand": "string", "usage": "string", - "value": 0 + "value": -9223372036854776000 }, "daemons": { "default": 0, @@ -2415,7 +2561,7 @@ Parameter represents a set value for the scope. "value": 0 }, "force_cancel_interval": { - "default": 0, + "default": -9223372036854776000, "enterprise": true, "flag": "string", "hidden": true, @@ -2423,7 +2569,7 @@ Parameter represents a set value for the scope. "secret": true, "shorthand": "string", "usage": "string", - "value": 0 + "value": -9223372036854776000 } } ``` @@ -2459,19 +2605,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 @@ -2491,7 +2637,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" } @@ -2499,14 +2645,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 @@ -2518,6 +2664,48 @@ Parameter represents a set value for the scope. | `log_level` | `warn` | | `log_level` | `error` | +## codersdk.ProvisionerJobStatus + +```json +"pending" +``` + +### Properties + +| Name | Type | Required | Restrictions | Description | +| ------------- | ------ | -------- | ------------ | ----------- | +| `*anonymous*` | string | false | | | + +#### Enumerated Values + +| Property | Value | +| ------------- | ----------- | +| `*anonymous*` | `pending` | +| `*anonymous*` | `running` | +| `*anonymous*` | `succeeded` | +| `*anonymous*` | `canceling` | +| `*anonymous*` | `canceled` | +| `*anonymous*` | `failed` | + +## codersdk.ProvisionerType + +```json +"echo" +``` + +### Properties + +| Name | Type | Required | Restrictions | Description | +| ------------- | ------ | -------- | ------------ | ----------- | +| `*anonymous*` | string | false | | | + +#### Enumerated Values + +| Property | Value | +| ------------- | ----------- | +| `*anonymous*` | `echo` | +| `*anonymous*` | `terraform` | + ## codersdk.PutExtendWorkspaceRequest ```json @@ -2532,6 +2720,32 @@ Parameter represents a set value for the scope. | ---------- | ------ | -------- | ------------ | ----------- | | `deadline` | string | true | | | +## codersdk.ResourceType + +```json +"organization" +``` + +### Properties + +| Name | Type | Required | Restrictions | Description | +| ------------- | ------ | -------- | ------------ | ----------- | +| `*anonymous*` | string | false | | | + +#### Enumerated Values + +| Property | Value | +| ------------- | ------------------ | +| `*anonymous*` | `organization` | +| `*anonymous*` | `template` | +| `*anonymous*` | `template_version` | +| `*anonymous*` | `user` | +| `*anonymous*` | `workspace` | +| `*anonymous*` | `workspace_build` | +| `*anonymous*` | `git_ssh_key` | +| `*anonymous*` | `api_key` | +| `*anonymous*` | `group` | + ## codersdk.Response ```json @@ -2619,7 +2833,7 @@ Parameter represents a set value for the scope. "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] }, "client_auth": { "default": "string", @@ -2685,7 +2899,7 @@ Parameter represents a set value for the scope. "secret": true, "shorthand": "string", "usage": "string", - "value": "string" + "value": ["string"] }, "min_version": { "default": "string", @@ -2802,7 +3016,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": "echo", "updated_at": "2019-08-24T14:15:22Z", "workspace_owner_count": 0 } @@ -2826,7 +3040,7 @@ Parameter represents a set value for the scope. | `id` | string | false | | | | `name` | string | false | | | | `organization_id` | string | false | | | -| `provisioner` | string | false | | | +| `provisioner` | [codersdk.ProvisionerType](#codersdkprovisionertype) | false | | | | `updated_at` | string | false | | | | `workspace_owner_count` | integer | false | | | @@ -3005,24 +3219,43 @@ 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 + +| Name | Type | Required | Restrictions | Description | +| ------------- | ------ | -------- | ------------ | ----------- | +| `*anonymous*` | string | false | | | + +#### Enumerated Values + +| Property | Value | +| ------------- | ----------- | +| `*anonymous*` | `active` | +| `*anonymous*` | `suspended` | ## codersdk.ValidationError @@ -3081,7 +3314,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, @@ -3200,7 +3433,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, @@ -3250,30 +3483,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 @@ -3325,7 +3558,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, @@ -3416,6 +3649,27 @@ Parameter represents a set value for the scope. | `startup_script` | string | false | | | | `vscode_port_proxy_uri` | string | false | | | +## codersdk.WorkspaceAgentStatus + +```json +"connecting" +``` + +### Properties + +| Name | Type | Required | Restrictions | Description | +| ------------- | ------ | -------- | ------------ | ----------- | +| `*anonymous*` | string | false | | | + +#### Enumerated Values + +| Property | Value | +| ------------- | -------------- | +| `*anonymous*` | `connecting` | +| `*anonymous*` | `connected` | +| `*anonymous*` | `disconnected` | +| `*anonymous*` | `timeout` | + ## codersdk.WorkspaceApp ```json @@ -3423,7 +3677,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, @@ -3440,19 +3694,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 @@ -3462,6 +3716,47 @@ Parameter represents a set value for the scope. | `sharing_level` | `authenticated` | | `sharing_level` | `public` | +## codersdk.WorkspaceAppHealth + +```json +"disabled" +``` + +### Properties + +| Name | Type | Required | Restrictions | Description | +| ------------- | ------ | -------- | ------------ | ----------- | +| `*anonymous*` | string | false | | | + +#### Enumerated Values + +| Property | Value | +| ------------- | -------------- | +| `*anonymous*` | `disabled` | +| `*anonymous*` | `initializing` | +| `*anonymous*` | `healthy` | +| `*anonymous*` | `unhealthy` | + +## codersdk.WorkspaceAppSharingLevel + +```json +"owner" +``` + +### Properties + +| Name | Type | Required | Restrictions | Description | +| ------------- | ------ | -------- | ------------ | ----------- | +| `*anonymous*` | string | false | | | + +#### Enumerated Values + +| Property | Value | +| ------------- | --------------- | +| `*anonymous*` | `owner` | +| `*anonymous*` | `authenticated` | +| `*anonymous*` | `public` | + ## codersdk.WorkspaceBuild ```json @@ -3498,7 +3793,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, @@ -3587,12 +3882,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 | | | @@ -3631,7 +3926,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, @@ -3711,7 +4006,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 @@ -3739,6 +4034,53 @@ Parameter represents a set value for the scope. | `sensitive` | boolean | false | | | | `value` | string | false | | | +## codersdk.WorkspaceStatus + +```json +"pending" +``` + +### Properties + +| Name | Type | Required | Restrictions | Description | +| ------------- | ------ | -------- | ------------ | ----------- | +| `*anonymous*` | string | false | | | + +#### Enumerated Values + +| Property | Value | +| ------------- | ----------- | +| `*anonymous*` | `pending` | +| `*anonymous*` | `starting` | +| `*anonymous*` | `running` | +| `*anonymous*` | `stopping` | +| `*anonymous*` | `stopped` | +| `*anonymous*` | `failed` | +| `*anonymous*` | `canceling` | +| `*anonymous*` | `canceled` | +| `*anonymous*` | `deleting` | +| `*anonymous*` | `deleted` | + +## codersdk.WorkspaceTransition + +```json +"start" +``` + +### Properties + +| Name | Type | Required | Restrictions | Description | +| ------------- | ------ | -------- | ------------ | ----------- | +| `*anonymous*` | string | false | | | + +#### Enumerated Values + +| Property | Value | +| ------------- | -------- | +| `*anonymous*` | `start` | +| `*anonymous*` | `stop` | +| `*anonymous*` | `delete` | + ## codersdk.WorkspacesResponse ```json @@ -3783,7 +4125,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", @@ -4035,3 +4377,54 @@ It corresponds to the legacy derpN.tailscale.com hostnames used by older clients RegionIDs must be non-zero, positive, and guaranteed to fit in a JavaScript number. RegionIDs in range 900-999 are reserved for end users to run their own DERP nodes.| |`regionName`|string|false||Regionname is a long English name for the region: "New York City", "San Francisco", "Singapore", "Frankfurt", etc.| + +## time.Duration + +```json +-9223372036854776000 +``` + +### Properties + +| Name | Type | Required | Restrictions | Description | +| ------------- | ------- | -------- | ------------ | ----------- | +| `*anonymous*` | integer | false | | | + +#### Enumerated Values + +| Property | Value | +| ------------- | ---------------------- | +| `*anonymous*` | `-9223372036854776000` | +| `*anonymous*` | `9223372036854776000` | +| `*anonymous*` | `1` | +| `*anonymous*` | `1000` | +| `*anonymous*` | `1000000` | +| `*anonymous*` | `1000000000` | +| `*anonymous*` | `60000000000` | +| `*anonymous*` | `3600000000000` | +| `*anonymous*` | `-9223372036854776000` | +| `*anonymous*` | `9223372036854776000` | +| `*anonymous*` | `1` | +| `*anonymous*` | `1000` | +| `*anonymous*` | `1000000` | +| `*anonymous*` | `1000000000` | +| `*anonymous*` | `60000000000` | +| `*anonymous*` | `3600000000000` | +| `*anonymous*` | `-9223372036854776000` | +| `*anonymous*` | `9223372036854776000` | +| `*anonymous*` | `1` | +| `*anonymous*` | `1000` | +| `*anonymous*` | `1000000` | +| `*anonymous*` | `1000000000` | +| `*anonymous*` | `60000000000` | +| `*anonymous*` | `3600000000000` | +| `*anonymous*` | `1` | +| `*anonymous*` | `1000` | +| `*anonymous*` | `1000000` | +| `*anonymous*` | `1000000000` | +| `*anonymous*` | `60000000000` | +| `*anonymous*` | `1` | +| `*anonymous*` | `1000` | +| `*anonymous*` | `1000000` | +| `*anonymous*` | `1000000000` | +| `*anonymous*` | `60000000000` | diff --git a/docs/api/templates.md b/docs/api/templates.md index 8b8f5b9783e9b..012db17bd93e0 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": "echo", "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": "echo", "updated_at": "2019-08-24T14:15:22Z", "workspace_owner_count": 0 } @@ -175,10 +175,17 @@ Status Code **200** | `» id` | string(uuid) | false | | | | `» name` | string | false | | | | `» organization_id` | string(uuid) | false | | | -| `» provisioner` | string | false | | | +| `» provisioner` | `codersdk.ProvisionerType` | false | | | | `» updated_at` | string(date-time) | false | | | | `» workspace_owner_count` | integer | false | | | +#### Enumerated Values + +| Property | Value | +| ------------- | ----------- | +| `provisioner` | `echo` | +| `provisioner` | `terraform` | + To perform this operation, you must be authenticated. [Learn more](authentication.md). ## Get templates by organization and template name @@ -230,7 +237,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": "echo", "updated_at": "2019-08-24T14:15:22Z", "workspace_owner_count": 0 } @@ -292,7 +299,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": "echo", "updated_at": "2019-08-24T14:15:22Z", "workspace_owner_count": 0 } @@ -398,7 +405,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": "echo", "updated_at": "2019-08-24T14:15:22Z", "workspace_owner_count": 0 } diff --git a/docs/api/workspaces.md b/docs/api/workspaces.md index afd7f0ffaaf7c..bd362e8249fb4 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 a02ecf131b801..b13eb2bc260d0 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" \ From 4a38d4044eaaaf4ec37c0860c17f991e23ec8448 Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Thu, 5 Jan 2023 15:44:30 +0100 Subject: [PATCH 2/8] Fix: format --- coderd/apidoc/docs.go | 16 ++++++++++++++-- coderd/apidoc/swagger.json | 14 +++++++++++--- docs/api/schemas.md | 6 ++++++ 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/coderd/apidoc/docs.go b/coderd/apidoc/docs.go index 3c504063557a7..6ac757fa8a5ff 100644 --- a/coderd/apidoc/docs.go +++ b/coderd/apidoc/docs.go @@ -4134,16 +4134,22 @@ const docTemplate = `{ 1000000000, 60000000000, 3600000000000, + -9223372036854775808, + 9223372036854775807, 1, 1000, 1000000, 1000000000, 60000000000, + 3600000000000, + -9223372036854775808, + 9223372036854775807, 1, 1000, 1000000, 1000000000, - 60000000000 + 60000000000, + 3600000000000 ], "x-enum-varnames": [ "minDuration", @@ -4170,16 +4176,22 @@ const docTemplate = `{ "Second", "Minute", "Hour", + "minDuration", + "maxDuration", "Nanosecond", "Microsecond", "Millisecond", "Second", "Minute", + "Hour", + "minDuration", + "maxDuration", "Nanosecond", "Microsecond", "Millisecond", "Second", - "Minute" + "Minute", + "Hour" ] } }, diff --git a/coderd/apidoc/swagger.json b/coderd/apidoc/swagger.json index a7b1a26d415ff..af3a1d1a81105 100644 --- a/coderd/apidoc/swagger.json +++ b/coderd/apidoc/swagger.json @@ -3734,8 +3734,10 @@ 60000000000, 3600000000000, -9223372036854775808, 9223372036854775807, 1, 1000, 1000000, 1000000000, 60000000000, 3600000000000, -9223372036854775808, 9223372036854775807, 1, 1000, 1000000, 1000000000, - 60000000000, 3600000000000, 1, 1000, 1000000, 1000000000, 60000000000, - 1, 1000, 1000000, 1000000000, 60000000000 + 60000000000, 3600000000000, -9223372036854775808, 9223372036854775807, + 1, 1000, 1000000, 1000000000, 60000000000, 3600000000000, + -9223372036854775808, 9223372036854775807, 1, 1000, 1000000, 1000000000, + 60000000000, 3600000000000 ], "x-enum-varnames": [ "minDuration", @@ -3762,16 +3764,22 @@ "Second", "Minute", "Hour", + "minDuration", + "maxDuration", "Nanosecond", "Microsecond", "Millisecond", "Second", "Minute", + "Hour", + "minDuration", + "maxDuration", "Nanosecond", "Microsecond", "Millisecond", "Second", - "Minute" + "Minute", + "Hour" ] } }, diff --git a/docs/api/schemas.md b/docs/api/schemas.md index af95371a61f22..dc9686c079baf 100644 --- a/docs/api/schemas.md +++ b/docs/api/schemas.md @@ -4418,13 +4418,19 @@ RegionIDs in range 900-999 are reserved for end users to run their own DERP node | `*anonymous*` | `1000000000` | | `*anonymous*` | `60000000000` | | `*anonymous*` | `3600000000000` | +| `*anonymous*` | `-9223372036854776000` | +| `*anonymous*` | `9223372036854776000` | | `*anonymous*` | `1` | | `*anonymous*` | `1000` | | `*anonymous*` | `1000000` | | `*anonymous*` | `1000000000` | | `*anonymous*` | `60000000000` | +| `*anonymous*` | `3600000000000` | +| `*anonymous*` | `-9223372036854776000` | +| `*anonymous*` | `9223372036854776000` | | `*anonymous*` | `1` | | `*anonymous*` | `1000` | | `*anonymous*` | `1000000` | | `*anonymous*` | `1000000000` | | `*anonymous*` | `60000000000` | +| `*anonymous*` | `3600000000000` | From 25af4d0435ad5926ff0c83be99f2196f7b8f2b41 Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Tue, 10 Jan 2023 14:13:09 +0100 Subject: [PATCH 3/8] swaggo: time.Duration --- .swaggo | 2 + coderd/apidoc/docs.go | 97 +-------------------------- coderd/apidoc/swagger.json | 65 +----------------- docs/api/agents.md | 2 +- docs/api/general.md | 28 ++++---- docs/api/schemas.md | 131 +++++++++++-------------------------- 6 files changed, 60 insertions(+), 265 deletions(-) diff --git a/.swaggo b/.swaggo index 4dcbb3ff4b9dc..d1ae6bd54a29f 100644 --- a/.swaggo +++ b/.swaggo @@ -1,2 +1,4 @@ // 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 diff --git a/coderd/apidoc/docs.go b/coderd/apidoc/docs.go index b9202b5ac243f..34c5c19e317c2 100644 --- a/coderd/apidoc/docs.go +++ b/coderd/apidoc/docs.go @@ -1914,11 +1914,7 @@ const docTemplate = `{ "properties": { "report_interval": { "description": "ReportInterval is the duration after which the agent should send stats\nagain.", - "allOf": [ - { - "$ref": "#/definitions/time.Duration" - } - ] + "type": "integer" } } }, @@ -2652,7 +2648,7 @@ const docTemplate = `{ "type": "object", "properties": { "default": { - "$ref": "#/definitions/time.Duration" + "type": "integer" }, "enterprise": { "type": "boolean" @@ -2676,7 +2672,7 @@ const docTemplate = `{ "type": "string" }, "value": { - "$ref": "#/definitions/time.Duration" + "type": "integer" } } }, @@ -4117,93 +4113,6 @@ const docTemplate = `{ "type": "string" } } - }, - "time.Duration": { - "type": "integer", - "enum": [ - -9223372036854775808, - 9223372036854775807, - 1, - 1000, - 1000000, - 1000000000, - 60000000000, - 3600000000000, - -9223372036854775808, - 9223372036854775807, - 1, - 1000, - 1000000, - 1000000000, - 60000000000, - 3600000000000, - -9223372036854775808, - 9223372036854775807, - 1, - 1000, - 1000000, - 1000000000, - 60000000000, - 3600000000000, - -9223372036854775808, - 9223372036854775807, - 1, - 1000, - 1000000, - 1000000000, - 60000000000, - 3600000000000, - -9223372036854775808, - 9223372036854775807, - 1, - 1000, - 1000000, - 1000000000, - 60000000000, - 3600000000000 - ], - "x-enum-varnames": [ - "minDuration", - "maxDuration", - "Nanosecond", - "Microsecond", - "Millisecond", - "Second", - "Minute", - "Hour", - "minDuration", - "maxDuration", - "Nanosecond", - "Microsecond", - "Millisecond", - "Second", - "Minute", - "Hour", - "minDuration", - "maxDuration", - "Nanosecond", - "Microsecond", - "Millisecond", - "Second", - "Minute", - "Hour", - "minDuration", - "maxDuration", - "Nanosecond", - "Microsecond", - "Millisecond", - "Second", - "Minute", - "Hour", - "minDuration", - "maxDuration", - "Nanosecond", - "Microsecond", - "Millisecond", - "Second", - "Minute", - "Hour" - ] } }, "securityDefinitions": { diff --git a/coderd/apidoc/swagger.json b/coderd/apidoc/swagger.json index 8c878c2703ea2..a2acfaceb463c 100644 --- a/coderd/apidoc/swagger.json +++ b/coderd/apidoc/swagger.json @@ -1678,11 +1678,7 @@ "properties": { "report_interval": { "description": "ReportInterval is the duration after which the agent should send stats\nagain.", - "allOf": [ - { - "$ref": "#/definitions/time.Duration" - } - ] + "type": "integer" } } }, @@ -2375,7 +2371,7 @@ "type": "object", "properties": { "default": { - "$ref": "#/definitions/time.Duration" + "type": "integer" }, "enterprise": { "type": "boolean" @@ -2399,7 +2395,7 @@ "type": "string" }, "value": { - "$ref": "#/definitions/time.Duration" + "type": "integer" } } }, @@ -3737,61 +3733,6 @@ "type": "string" } } - }, - "time.Duration": { - "type": "integer", - "enum": [ - -9223372036854775808, 9223372036854775807, 1, 1000, 1000000, 1000000000, - 60000000000, 3600000000000, -9223372036854775808, 9223372036854775807, - 1, 1000, 1000000, 1000000000, 60000000000, 3600000000000, - -9223372036854775808, 9223372036854775807, 1, 1000, 1000000, 1000000000, - 60000000000, 3600000000000, -9223372036854775808, 9223372036854775807, - 1, 1000, 1000000, 1000000000, 60000000000, 3600000000000, - -9223372036854775808, 9223372036854775807, 1, 1000, 1000000, 1000000000, - 60000000000, 3600000000000 - ], - "x-enum-varnames": [ - "minDuration", - "maxDuration", - "Nanosecond", - "Microsecond", - "Millisecond", - "Second", - "Minute", - "Hour", - "minDuration", - "maxDuration", - "Nanosecond", - "Microsecond", - "Millisecond", - "Second", - "Minute", - "Hour", - "minDuration", - "maxDuration", - "Nanosecond", - "Microsecond", - "Millisecond", - "Second", - "Minute", - "Hour", - "minDuration", - "maxDuration", - "Nanosecond", - "Microsecond", - "Millisecond", - "Second", - "Minute", - "Hour", - "minDuration", - "maxDuration", - "Nanosecond", - "Microsecond", - "Millisecond", - "Second", - "Minute", - "Hour" - ] } }, "securityDefinitions": { diff --git a/docs/api/agents.md b/docs/api/agents.md index a9439a48463b7..dbbbe61c8d3ae 100644 --- a/docs/api/agents.md +++ b/docs/api/agents.md @@ -426,7 +426,7 @@ curl -X POST http://coder-server:8080/api/v2/workspaceagents/me/report-stats \ ```json { - "report_interval": -9223372036854776000 + "report_interval": 0 } ``` diff --git a/docs/api/general.md b/docs/api/general.md index 573b2f26979ae..85167d8dd2ee9 100644 --- a/docs/api/general.md +++ b/docs/api/general.md @@ -119,7 +119,7 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ "value": "string" }, "agent_stat_refresh_interval": { - "default": -9223372036854776000, + "default": 0, "enterprise": true, "flag": "string", "hidden": true, @@ -127,7 +127,7 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ "secret": true, "shorthand": "string", "usage": "string", - "value": -9223372036854776000 + "value": 0 }, "audit_logging": { "default": true, @@ -141,7 +141,7 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ "value": true }, "autobuild_poll_interval": { - "default": -9223372036854776000, + "default": 0, "enterprise": true, "flag": "string", "hidden": true, @@ -149,7 +149,7 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ "secret": true, "shorthand": "string", "usage": "string", - "value": -9223372036854776000 + "value": 0 }, "browser_only": { "default": true, @@ -336,7 +336,7 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ "value": true }, "max_token_lifetime": { - "default": -9223372036854776000, + "default": 0, "enterprise": true, "flag": "string", "hidden": true, @@ -344,10 +344,10 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ "secret": true, "shorthand": "string", "usage": "string", - "value": -9223372036854776000 + "value": 0 }, "metrics_cache_refresh_interval": { - "default": -9223372036854776000, + "default": 0, "enterprise": true, "flag": "string", "hidden": true, @@ -355,7 +355,7 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ "secret": true, "shorthand": "string", "usage": "string", - "value": -9223372036854776000 + "value": 0 }, "oauth2": { "github": { @@ -589,7 +589,7 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ }, "provisioner": { "daemon_poll_interval": { - "default": -9223372036854776000, + "default": 0, "enterprise": true, "flag": "string", "hidden": true, @@ -597,10 +597,10 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ "secret": true, "shorthand": "string", "usage": "string", - "value": -9223372036854776000 + "value": 0 }, "daemon_poll_jitter": { - "default": -9223372036854776000, + "default": 0, "enterprise": true, "flag": "string", "hidden": true, @@ -608,7 +608,7 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ "secret": true, "shorthand": "string", "usage": "string", - "value": -9223372036854776000 + "value": 0 }, "daemons": { "default": 0, @@ -622,7 +622,7 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ "value": 0 }, "force_cancel_interval": { - "default": -9223372036854776000, + "default": 0, "enterprise": true, "flag": "string", "hidden": true, @@ -630,7 +630,7 @@ curl -X GET http://coder-server:8080/api/v2/config/deployment \ "secret": true, "shorthand": "string", "usage": "string", - "value": -9223372036854776000 + "value": 0 } }, "proxy_trusted_headers": { diff --git a/docs/api/schemas.md b/docs/api/schemas.md index 8cf147538c95e..d9eded60fe93b 100644 --- a/docs/api/schemas.md +++ b/docs/api/schemas.md @@ -80,15 +80,15 @@ ```json { - "report_interval": -9223372036854776000 + "report_interval": 0 } ``` ### Properties -| Name | Type | Required | Restrictions | Description | -| ----------------- | ------------------------------ | -------- | ------------ | ------------------------------------------------------------------------------ | -| `report_interval` | [time.Duration](#timeduration) | false | | Report interval is the duration after which the agent should send stats again. | +| Name | Type | Required | Restrictions | Description | +| ----------------- | ------- | -------- | ------------ | ------------------------------------------------------------------------------ | +| `report_interval` | integer | false | | Report interval is the duration after which the agent should send stats again. | ## codersdk.AuditAction @@ -876,7 +876,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "value": "string" }, "agent_stat_refresh_interval": { - "default": -9223372036854776000, + "default": 0, "enterprise": true, "flag": "string", "hidden": true, @@ -884,7 +884,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": -9223372036854776000 + "value": 0 }, "audit_logging": { "default": true, @@ -898,7 +898,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "value": true }, "autobuild_poll_interval": { - "default": -9223372036854776000, + "default": 0, "enterprise": true, "flag": "string", "hidden": true, @@ -906,7 +906,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": -9223372036854776000 + "value": 0 }, "browser_only": { "default": true, @@ -1093,7 +1093,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "value": true }, "max_token_lifetime": { - "default": -9223372036854776000, + "default": 0, "enterprise": true, "flag": "string", "hidden": true, @@ -1101,10 +1101,10 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": -9223372036854776000 + "value": 0 }, "metrics_cache_refresh_interval": { - "default": -9223372036854776000, + "default": 0, "enterprise": true, "flag": "string", "hidden": true, @@ -1112,7 +1112,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": -9223372036854776000 + "value": 0 }, "oauth2": { "github": { @@ -1346,7 +1346,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a }, "provisioner": { "daemon_poll_interval": { - "default": -9223372036854776000, + "default": 0, "enterprise": true, "flag": "string", "hidden": true, @@ -1354,10 +1354,10 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": -9223372036854776000 + "value": 0 }, "daemon_poll_jitter": { - "default": -9223372036854776000, + "default": 0, "enterprise": true, "flag": "string", "hidden": true, @@ -1365,7 +1365,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": -9223372036854776000 + "value": 0 }, "daemons": { "default": 0, @@ -1379,7 +1379,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "value": 0 }, "force_cancel_interval": { - "default": -9223372036854776000, + "default": 0, "enterprise": true, "flag": "string", "hidden": true, @@ -1387,7 +1387,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": -9223372036854776000 + "value": 0 } }, "proxy_trusted_headers": { @@ -1905,7 +1905,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a ```json { - "default": -9223372036854776000, + "default": 0, "enterprise": true, "flag": "string", "hidden": true, @@ -1913,23 +1913,23 @@ CreateParameterRequest is a structure used to create a new parameter value for a "secret": true, "shorthand": "string", "usage": "string", - "value": -9223372036854776000 + "value": 0 } ``` ### Properties -| Name | Type | Required | Restrictions | Description | -| ------------ | ------------------------------ | -------- | ------------ | ----------- | -| `default` | [time.Duration](#timeduration) | false | | | -| `enterprise` | boolean | false | | | -| `flag` | string | false | | | -| `hidden` | boolean | false | | | -| `name` | string | false | | | -| `secret` | boolean | false | | | -| `shorthand` | string | false | | | -| `usage` | string | false | | | -| `value` | [time.Duration](#timeduration) | false | | | +| Name | Type | Required | Restrictions | Description | +| ------------ | ------- | -------- | ------------ | ----------- | +| `default` | integer | false | | | +| `enterprise` | boolean | false | | | +| `flag` | string | false | | | +| `hidden` | boolean | false | | | +| `name` | string | false | | | +| `secret` | boolean | false | | | +| `shorthand` | string | false | | | +| `usage` | string | false | | | +| `value` | integer | false | | | ## codersdk.GetAppHostResponse @@ -2541,7 +2541,7 @@ Parameter represents a set value for the scope. ```json { "daemon_poll_interval": { - "default": -9223372036854776000, + "default": 0, "enterprise": true, "flag": "string", "hidden": true, @@ -2549,10 +2549,10 @@ Parameter represents a set value for the scope. "secret": true, "shorthand": "string", "usage": "string", - "value": -9223372036854776000 + "value": 0 }, "daemon_poll_jitter": { - "default": -9223372036854776000, + "default": 0, "enterprise": true, "flag": "string", "hidden": true, @@ -2560,7 +2560,7 @@ Parameter represents a set value for the scope. "secret": true, "shorthand": "string", "usage": "string", - "value": -9223372036854776000 + "value": 0 }, "daemons": { "default": 0, @@ -2574,7 +2574,7 @@ Parameter represents a set value for the scope. "value": 0 }, "force_cancel_interval": { - "default": -9223372036854776000, + "default": 0, "enterprise": true, "flag": "string", "hidden": true, @@ -2582,7 +2582,7 @@ Parameter represents a set value for the scope. "secret": true, "shorthand": "string", "usage": "string", - "value": -9223372036854776000 + "value": 0 } } ``` @@ -4426,60 +4426,3 @@ It corresponds to the legacy derpN.tailscale.com hostnames used by older clients RegionIDs must be non-zero, positive, and guaranteed to fit in a JavaScript number. RegionIDs in range 900-999 are reserved for end users to run their own DERP nodes.| |`regionName`|string|false||Regionname is a long English name for the region: "New York City", "San Francisco", "Singapore", "Frankfurt", etc.| - -## time.Duration - -```json --9223372036854776000 -``` - -### Properties - -| Name | Type | Required | Restrictions | Description | -| ------------- | ------- | -------- | ------------ | ----------- | -| `*anonymous*` | integer | false | | | - -#### Enumerated Values - -| Property | Value | -| ------------- | ---------------------- | -| `*anonymous*` | `-9223372036854776000` | -| `*anonymous*` | `9223372036854776000` | -| `*anonymous*` | `1` | -| `*anonymous*` | `1000` | -| `*anonymous*` | `1000000` | -| `*anonymous*` | `1000000000` | -| `*anonymous*` | `60000000000` | -| `*anonymous*` | `3600000000000` | -| `*anonymous*` | `-9223372036854776000` | -| `*anonymous*` | `9223372036854776000` | -| `*anonymous*` | `1` | -| `*anonymous*` | `1000` | -| `*anonymous*` | `1000000` | -| `*anonymous*` | `1000000000` | -| `*anonymous*` | `60000000000` | -| `*anonymous*` | `3600000000000` | -| `*anonymous*` | `-9223372036854776000` | -| `*anonymous*` | `9223372036854776000` | -| `*anonymous*` | `1` | -| `*anonymous*` | `1000` | -| `*anonymous*` | `1000000` | -| `*anonymous*` | `1000000000` | -| `*anonymous*` | `60000000000` | -| `*anonymous*` | `3600000000000` | -| `*anonymous*` | `-9223372036854776000` | -| `*anonymous*` | `9223372036854776000` | -| `*anonymous*` | `1` | -| `*anonymous*` | `1000` | -| `*anonymous*` | `1000000` | -| `*anonymous*` | `1000000000` | -| `*anonymous*` | `60000000000` | -| `*anonymous*` | `3600000000000` | -| `*anonymous*` | `-9223372036854776000` | -| `*anonymous*` | `9223372036854776000` | -| `*anonymous*` | `1` | -| `*anonymous*` | `1000` | -| `*anonymous*` | `1000000` | -| `*anonymous*` | `1000000000` | -| `*anonymous*` | `60000000000` | -| `*anonymous*` | `3600000000000` | From 7a9b226fb342e39d2e49293f7be75c1eba009cf3 Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Tue, 10 Jan 2023 14:16:20 +0100 Subject: [PATCH 4/8] swaggo: provisionertype --- .swaggo | 2 ++ coderd/apidoc/docs.go | 16 ++++------------ coderd/apidoc/swagger.json | 8 ++------ codersdk/templates.go | 2 +- docs/api/schemas.md | 29 ++++++++--------------------- docs/api/templates.md | 13 ++++++------- 6 files changed, 23 insertions(+), 47 deletions(-) diff --git a/.swaggo b/.swaggo index d1ae6bd54a29f..9f26756debd28 100644 --- a/.swaggo +++ b/.swaggo @@ -2,3 +2,5 @@ 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 diff --git a/coderd/apidoc/docs.go b/coderd/apidoc/docs.go index 34c5c19e317c2..39379f66fccb5 100644 --- a/coderd/apidoc/docs.go +++ b/coderd/apidoc/docs.go @@ -3107,17 +3107,6 @@ const docTemplate = `{ "ProvisionerJobFailed" ] }, - "codersdk.ProvisionerType": { - "type": "string", - "enum": [ - "echo", - "terraform" - ], - "x-enum-varnames": [ - "ProvisionerTypeEcho", - "ProvisionerTypeTerraform" - ] - }, "codersdk.PutExtendWorkspaceRequest": { "type": "object", "required": [ @@ -3304,7 +3293,10 @@ const docTemplate = `{ "format": "uuid" }, "provisioner": { - "$ref": "#/definitions/codersdk.ProvisionerType" + "type": "string", + "enum": [ + "terraform" + ] }, "updated_at": { "type": "string", diff --git a/coderd/apidoc/swagger.json b/coderd/apidoc/swagger.json index a2acfaceb463c..f3a46d31b5fb6 100644 --- a/coderd/apidoc/swagger.json +++ b/coderd/apidoc/swagger.json @@ -2788,11 +2788,6 @@ "ProvisionerJobFailed" ] }, - "codersdk.ProvisionerType": { - "type": "string", - "enum": ["echo", "terraform"], - "x-enum-varnames": ["ProvisionerTypeEcho", "ProvisionerTypeTerraform"] - }, "codersdk.PutExtendWorkspaceRequest": { "type": "object", "required": ["deadline"], @@ -2977,7 +2972,8 @@ "format": "uuid" }, "provisioner": { - "$ref": "#/definitions/codersdk.ProvisionerType" + "type": "string", + "enum": ["terraform"] }, "updated_at": { "type": "string", diff --git a/codersdk/templates.go b/codersdk/templates.go index 3e066beb8bf7f..7dc5e18252021 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/schemas.md b/docs/api/schemas.md index d9eded60fe93b..9f15e46a33a4f 100644 --- a/docs/api/schemas.md +++ b/docs/api/schemas.md @@ -2700,25 +2700,6 @@ Parameter represents a set value for the scope. | `*anonymous*` | `canceled` | | `*anonymous*` | `failed` | -## codersdk.ProvisionerType - -```json -"echo" -``` - -### Properties - -| Name | Type | Required | Restrictions | Description | -| ------------- | ------ | -------- | ------------ | ----------- | -| `*anonymous*` | string | false | | | - -#### Enumerated Values - -| Property | Value | -| ------------- | ----------- | -| `*anonymous*` | `echo` | -| `*anonymous*` | `terraform` | - ## codersdk.PutExtendWorkspaceRequest ```json @@ -3065,7 +3046,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": "echo", + "provisioner": "terraform", "updated_at": "2019-08-24T14:15:22Z", "workspace_owner_count": 0 } @@ -3089,10 +3070,16 @@ Parameter represents a set value for the scope. | `id` | string | false | | | | `name` | string | false | | | | `organization_id` | string | false | | | -| `provisioner` | [codersdk.ProvisionerType](#codersdkprovisionertype) | false | | | +| `provisioner` | string | false | | | | `updated_at` | string | false | | | | `workspace_owner_count` | integer | false | | | +#### Enumerated Values + +| Property | Value | +| ------------- | ----------- | +| `provisioner` | `terraform` | + ## codersdk.TemplateBuildTimeStats ```json diff --git a/docs/api/templates.md b/docs/api/templates.md index 012db17bd93e0..ed6a7e8084d85 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": "echo", + "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": "echo", + "provisioner": "terraform", "updated_at": "2019-08-24T14:15:22Z", "workspace_owner_count": 0 } @@ -175,7 +175,7 @@ Status Code **200** | `» id` | string(uuid) | false | | | | `» name` | string | false | | | | `» organization_id` | string(uuid) | false | | | -| `» provisioner` | `codersdk.ProvisionerType` | false | | | +| `» provisioner` | string | false | | | | `» updated_at` | string(date-time) | false | | | | `» workspace_owner_count` | integer | false | | | @@ -183,7 +183,6 @@ Status Code **200** | Property | Value | | ------------- | ----------- | -| `provisioner` | `echo` | | `provisioner` | `terraform` | To perform this operation, you must be authenticated. [Learn more](authentication.md). @@ -237,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": "echo", + "provisioner": "terraform", "updated_at": "2019-08-24T14:15:22Z", "workspace_owner_count": 0 } @@ -299,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": "echo", + "provisioner": "terraform", "updated_at": "2019-08-24T14:15:22Z", "workspace_owner_count": 0 } @@ -405,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": "echo", + "provisioner": "terraform", "updated_at": "2019-08-24T14:15:22Z", "workspace_owner_count": 0 } From 4cf0669bfc7be83a0192e11a697fa28f9d31ca22 Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Tue, 10 Jan 2023 14:28:57 +0100 Subject: [PATCH 5/8] Fix: AuthorizationObject --- coderd/apidoc/docs.go | 2 +- coderd/apidoc/swagger.json | 2 +- codersdk/authorization.go | 5 +---- docs/api/schemas.md | 8 ++++---- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/coderd/apidoc/docs.go b/coderd/apidoc/docs.go index 39379f66fccb5..eb51ff48f5c93 100644 --- a/coderd/apidoc/docs.go +++ b/coderd/apidoc/docs.go @@ -2042,7 +2042,7 @@ 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.", + "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" diff --git a/coderd/apidoc/swagger.json b/coderd/apidoc/swagger.json index f3a46d31b5fb6..09ffaa992de16 100644 --- a/coderd/apidoc/swagger.json +++ b/coderd/apidoc/swagger.json @@ -1795,7 +1795,7 @@ "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.", + "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" diff --git a/codersdk/authorization.go b/codersdk/authorization.go index 21b3f74ad84fa..b16e924236501 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/docs/api/schemas.md b/docs/api/schemas.md index 9f15e46a33a4f..8694a082b9a6a 100644 --- a/docs/api/schemas.md +++ b/docs/api/schemas.md @@ -308,10 +308,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 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. | +| 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 From b0813dd14a6ce866ba8d6d7854169d7ac99d28ec Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Tue, 10 Jan 2023 15:12:55 +0100 Subject: [PATCH 6/8] Fix: enums --- docs/api/schemas.md | 248 +++++++------------ scripts/apidocgen/markdown-template/main.dot | 10 +- 2 files changed, 103 insertions(+), 155 deletions(-) diff --git a/docs/api/schemas.md b/docs/api/schemas.md index 8694a082b9a6a..4e7cb90b1257e 100644 --- a/docs/api/schemas.md +++ b/docs/api/schemas.md @@ -98,19 +98,15 @@ ### Properties -| Name | Type | Required | Restrictions | Description | -| ------------- | ------ | -------- | ------------ | ----------- | -| `*anonymous*` | string | false | | | - #### Enumerated Values -| Property | Value | -| ------------- | -------- | -| `*anonymous*` | `create` | -| `*anonymous*` | `write` | -| `*anonymous*` | `delete` | -| `*anonymous*` | `start` | -| `*anonymous*` | `stop` | +| Value | +| -------- | +| `create` | +| `write` | +| `delete` | +| `start` | +| `stop` | ## codersdk.AuditDiff @@ -433,17 +429,13 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in ### Properties -| Name | Type | Required | Restrictions | Description | -| ------------- | ------ | -------- | ------------ | ----------- | -| `*anonymous*` | string | false | | | - #### Enumerated Values -| Property | Value | -| ------------- | ----------- | -| `*anonymous*` | `initiator` | -| `*anonymous*` | `autostart` | -| `*anonymous*` | `autostop` | +| Value | +| ----------- | +| `initiator` | +| `autostart` | +| `autostop` | ## codersdk.CreateParameterRequest @@ -2015,19 +2007,15 @@ CreateParameterRequest is a structure used to create a new parameter value for a ### Properties -| Name | Type | Required | Restrictions | Description | -| ------------- | ------ | -------- | ------------ | ----------- | -| `*anonymous*` | string | false | | | - #### Enumerated Values -| Property | Value | -| ------------- | ------- | -| `*anonymous*` | `trace` | -| `*anonymous*` | `debug` | -| `*anonymous*` | `info` | -| `*anonymous*` | `warn` | -| `*anonymous*` | `error` | +| Value | +| ------- | +| `trace` | +| `debug` | +| `info` | +| `warn` | +| `error` | ## codersdk.LogSource @@ -2037,16 +2025,12 @@ CreateParameterRequest is a structure used to create a new parameter value for a ### Properties -| Name | Type | Required | Restrictions | Description | -| ------------- | ------ | -------- | ------------ | ----------- | -| `*anonymous*` | string | false | | | - #### Enumerated Values -| Property | Value | -| ------------- | -------------------- | -| `*anonymous*` | `provisioner_daemon` | -| `*anonymous*` | `provisioner` | +| Value | +| -------------------- | +| `provisioner_daemon` | +| `provisioner` | ## codersdk.OAuth2Config @@ -2395,17 +2379,13 @@ Parameter represents a set value for the scope. ### Properties -| Name | Type | Required | Restrictions | Description | -| ------------- | ------ | -------- | ------------ | ----------- | -| `*anonymous*` | string | false | | | - #### Enumerated Values -| Property | Value | -| ------------- | ---------------------- | -| `*anonymous*` | `none` | -| `*anonymous*` | `environment_variable` | -| `*anonymous*` | `provisioner_variable` | +| Value | +| ---------------------- | +| `none` | +| `environment_variable` | +| `provisioner_variable` | ## codersdk.ParameterScope @@ -2415,17 +2395,13 @@ Parameter represents a set value for the scope. ### Properties -| Name | Type | Required | Restrictions | Description | -| ------------- | ------ | -------- | ------------ | ----------- | -| `*anonymous*` | string | false | | | - #### Enumerated Values -| Property | Value | -| ------------- | ------------ | -| `*anonymous*` | `template` | -| `*anonymous*` | `workspace` | -| `*anonymous*` | `import_job` | +| Value | +| ------------ | +| `template` | +| `workspace` | +| `import_job` | ## codersdk.ParameterSourceScheme @@ -2435,16 +2411,12 @@ Parameter represents a set value for the scope. ### Properties -| Name | Type | Required | Restrictions | Description | -| ------------- | ------ | -------- | ------------ | ----------- | -| `*anonymous*` | string | false | | | - #### Enumerated Values -| Property | Value | -| ------------- | ------ | -| `*anonymous*` | `none` | -| `*anonymous*` | `data` | +| Value | +| ------ | +| `none` | +| `data` | ## codersdk.PostWorkspaceAppHealthsRequest @@ -2685,20 +2657,16 @@ Parameter represents a set value for the scope. ### Properties -| Name | Type | Required | Restrictions | Description | -| ------------- | ------ | -------- | ------------ | ----------- | -| `*anonymous*` | string | false | | | - #### Enumerated Values -| Property | Value | -| ------------- | ----------- | -| `*anonymous*` | `pending` | -| `*anonymous*` | `running` | -| `*anonymous*` | `succeeded` | -| `*anonymous*` | `canceling` | -| `*anonymous*` | `canceled` | -| `*anonymous*` | `failed` | +| Value | +| ----------- | +| `pending` | +| `running` | +| `succeeded` | +| `canceling` | +| `canceled` | +| `failed` | ## codersdk.PutExtendWorkspaceRequest @@ -2758,23 +2726,19 @@ Parameter represents a set value for the scope. ### Properties -| Name | Type | Required | Restrictions | Description | -| ------------- | ------ | -------- | ------------ | ----------- | -| `*anonymous*` | string | false | | | - #### Enumerated Values -| Property | Value | -| ------------- | ------------------ | -| `*anonymous*` | `organization` | -| `*anonymous*` | `template` | -| `*anonymous*` | `template_version` | -| `*anonymous*` | `user` | -| `*anonymous*` | `workspace` | -| `*anonymous*` | `workspace_build` | -| `*anonymous*` | `git_ssh_key` | -| `*anonymous*` | `api_key` | -| `*anonymous*` | `group` | +| Value | +| ------------------ | +| `organization` | +| `template` | +| `template_version` | +| `user` | +| `workspace` | +| `workspace_build` | +| `git_ssh_key` | +| `api_key` | +| `group` | ## codersdk.Response @@ -3282,16 +3246,12 @@ Parameter represents a set value for the scope. ### Properties -| Name | Type | Required | Restrictions | Description | -| ------------- | ------ | -------- | ------------ | ----------- | -| `*anonymous*` | string | false | | | - #### Enumerated Values -| Property | Value | -| ------------- | ----------- | -| `*anonymous*` | `active` | -| `*anonymous*` | `suspended` | +| Value | +| ----------- | +| `active` | +| `suspended` | ## codersdk.ValidationError @@ -3693,18 +3653,14 @@ Parameter represents a set value for the scope. ### Properties -| Name | Type | Required | Restrictions | Description | -| ------------- | ------ | -------- | ------------ | ----------- | -| `*anonymous*` | string | false | | | - #### Enumerated Values -| Property | Value | -| ------------- | -------------- | -| `*anonymous*` | `connecting` | -| `*anonymous*` | `connected` | -| `*anonymous*` | `disconnected` | -| `*anonymous*` | `timeout` | +| Value | +| -------------- | +| `connecting` | +| `connected` | +| `disconnected` | +| `timeout` | ## codersdk.WorkspaceApp @@ -3760,18 +3716,14 @@ Parameter represents a set value for the scope. ### Properties -| Name | Type | Required | Restrictions | Description | -| ------------- | ------ | -------- | ------------ | ----------- | -| `*anonymous*` | string | false | | | - #### Enumerated Values -| Property | Value | -| ------------- | -------------- | -| `*anonymous*` | `disabled` | -| `*anonymous*` | `initializing` | -| `*anonymous*` | `healthy` | -| `*anonymous*` | `unhealthy` | +| Value | +| -------------- | +| `disabled` | +| `initializing` | +| `healthy` | +| `unhealthy` | ## codersdk.WorkspaceAppSharingLevel @@ -3781,17 +3733,13 @@ Parameter represents a set value for the scope. ### Properties -| Name | Type | Required | Restrictions | Description | -| ------------- | ------ | -------- | ------------ | ----------- | -| `*anonymous*` | string | false | | | - #### Enumerated Values -| Property | Value | -| ------------- | --------------- | -| `*anonymous*` | `owner` | -| `*anonymous*` | `authenticated` | -| `*anonymous*` | `public` | +| Value | +| --------------- | +| `owner` | +| `authenticated` | +| `public` | ## codersdk.WorkspaceBuild @@ -4078,24 +4026,20 @@ Parameter represents a set value for the scope. ### Properties -| Name | Type | Required | Restrictions | Description | -| ------------- | ------ | -------- | ------------ | ----------- | -| `*anonymous*` | string | false | | | - #### Enumerated Values -| Property | Value | -| ------------- | ----------- | -| `*anonymous*` | `pending` | -| `*anonymous*` | `starting` | -| `*anonymous*` | `running` | -| `*anonymous*` | `stopping` | -| `*anonymous*` | `stopped` | -| `*anonymous*` | `failed` | -| `*anonymous*` | `canceling` | -| `*anonymous*` | `canceled` | -| `*anonymous*` | `deleting` | -| `*anonymous*` | `deleted` | +| Value | +| ----------- | +| `pending` | +| `starting` | +| `running` | +| `stopping` | +| `stopped` | +| `failed` | +| `canceling` | +| `canceled` | +| `deleting` | +| `deleted` | ## codersdk.WorkspaceTransition @@ -4105,17 +4049,13 @@ Parameter represents a set value for the scope. ### Properties -| Name | Type | Required | Restrictions | Description | -| ------------- | ------ | -------- | ------------ | ----------- | -| `*anonymous*` | string | false | | | - #### Enumerated Values -| Property | Value | -| ------------- | -------- | -| `*anonymous*` | `start` | -| `*anonymous*` | `stop` | -| `*anonymous*` | `delete` | +| Value | +| -------- | +| `start` | +| `stop` | +| `delete` | ## codersdk.WorkspacesResponse diff --git a/scripts/apidocgen/markdown-template/main.dot b/scripts/apidocgen/markdown-template/main.dot index 6c324570d353e..a4fa2d6b037ee 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 }} {{?}} From 1fe5795eb0c666d4fc27f9479223b6f88b4185ba Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Tue, 10 Jan 2023 15:15:37 +0100 Subject: [PATCH 7/8] Fix: netip.Addr --- .swaggo | 2 ++ coderd/apidoc/docs.go | 5 +---- coderd/apidoc/swagger.json | 5 +---- docs/api/audit.md | 2 +- docs/api/schemas.md | 16 +++------------- 5 files changed, 8 insertions(+), 22 deletions(-) diff --git a/.swaggo b/.swaggo index 9f26756debd28..e4b76f3ed82d9 100644 --- a/.swaggo +++ b/.swaggo @@ -4,3 +4,5 @@ replace github.com/coder/coder/codersdk.NullTime string 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 eb51ff48f5c93..7e7f19de034d6 100644 --- a/coderd/apidoc/docs.go +++ b/coderd/apidoc/docs.go @@ -1973,7 +1973,7 @@ const docTemplate = `{ "type": "string" }, "ip": { - "$ref": "#/definitions/netip.Addr" + "type": "string" }, "is_deleted": { "type": "boolean" @@ -4002,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 09ffaa992de16..af5c7fdc510a3 100644 --- a/coderd/apidoc/swagger.json +++ b/coderd/apidoc/swagger.json @@ -1731,7 +1731,7 @@ "type": "string" }, "ip": { - "$ref": "#/definitions/netip.Addr" + "type": "string" }, "is_deleted": { "type": "boolean" @@ -3626,9 +3626,6 @@ } } }, - "netip.Addr": { - "type": "object" - }, "tailcfg.DERPMap": { "type": "object", "properties": { diff --git a/docs/api/audit.md b/docs/api/audit.md index 05feffbbf4d98..fa5a3796c7a3e 100644 --- a/docs/api/audit.md +++ b/docs/api/audit.md @@ -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", diff --git a/docs/api/schemas.md b/docs/api/schemas.md index 4e7cb90b1257e..07a5c9ee3af20 100644 --- a/docs/api/schemas.md +++ b/docs/api/schemas.md @@ -169,7 +169,7 @@ } }, "id": "string", - "ip": {}, + "ip": "string", "is_deleted": true, "organization_id": "string", "request_id": "string", @@ -209,7 +209,7 @@ | `description` | string | false | | | | `diff` | [codersdk.AuditDiff](#codersdkauditdiff) | false | | | | `id` | string | false | | | -| `ip` | [netip.Addr](#netipaddr) | false | | | +| `ip` | string | false | | | | `is_deleted` | boolean | false | | | | `organization_id` | string | false | | | | `request_id` | string | false | | | @@ -245,7 +245,7 @@ } }, "id": "string", - "ip": {}, + "ip": "string", "is_deleted": true, "organization_id": "string", "request_id": "string", @@ -4195,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 From c6e3b6d39ca465eda4c89063245f755d3da505fc Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Tue, 10 Jan 2023 15:20:52 +0100 Subject: [PATCH 8/8] Fix: clickable response properties --- docs/api/builds.md | 298 +++++++++--------- docs/api/parameters.md | 22 +- docs/api/templates.md | 46 +-- .../apidocgen/markdown-template/responses.def | 3 +- 4 files changed, 185 insertions(+), 184 deletions(-) diff --git a/docs/api/builds.md b/docs/api/builds.md index a28a5ec35fdfb..d55f1659de325 100644 --- a/docs/api/builds.md +++ b/docs/api/builds.md @@ -237,15 +237,15 @@ 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` | `codersdk.LogLevel` | false | | | -| `» log_source` | `codersdk.LogSource` | 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 @@ -371,61 +371,61 @@ 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` | `codersdk.WorkspaceAppHealth` | false | | | -| `»»» healthcheck` | `codersdk.Healthcheck` | 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` | 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` | `codersdk.WorkspaceAgentStatus` | 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` | 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 @@ -740,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` | `codersdk.ProvisionerJobStatus` | false | | | -| `»» tags` | object | false | | | -| `»»» [any property]` | string | false | | | -| `»» worker_id` | string(uuid) | false | | | -| `» reason` | `codersdk.BuildReason` | 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` | false | | | -| `»»»» healthcheck` | `codersdk.Healthcheck` | 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` | 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` | `codersdk.WorkspaceAgentStatus` | 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` | false | | | -| `» status` | `codersdk.WorkspaceStatus` | false | | | -| `» template_version_id` | string(uuid) | false | | | -| `» template_version_name` | string | false | | | -| `» transition` | `codersdk.WorkspaceTransition` | 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 diff --git a/docs/api/parameters.md b/docs/api/parameters.md index 793b00dc62333..051eb02c1cca9 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` | `codersdk.ParameterDestinationScheme` | false | | | -| `» id` | string(uuid) | false | | | -| `» name` | string | false | | | -| `» scope` | `codersdk.ParameterScope` | false | | | -| `» scope_id` | string(uuid) | false | | | -| `» source_scheme` | `codersdk.ParameterSourceScheme` | 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/templates.md b/docs/api/templates.md index ed6a7e8084d85..43ea098e8aebc 100644 --- a/docs/api/templates.md +++ b/docs/api/templates.md @@ -155,29 +155,29 @@ 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 diff --git a/scripts/apidocgen/markdown-template/responses.def b/scripts/apidocgen/markdown-template/responses.def index 8fe3e36c4f240..843c676594412 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') {