codersdk package - github.com/coder/coder/codersdk - Go Packages
- Constants
- Variables
- func BitmapToWeekdays(bitmap uint8) []string
- func DefaultCacheDir() string
- func IsConnectionError(err error) bool
- func IsSecretDeploymentOption(opt clibase.Option) bool
- func IsWorkspaceProxies(opt clibase.Option) bool
- func ParseSSHConfigOption(opt string) (key string, value string, err error)
- func ReadBodyAsError(res *http.Response) error
- func ServerSentEventReader(ctx context.Context, rc io.ReadCloser) func() (*ServerSentEvent, error)
- func TimezoneOffsetHour(loc *time.Location) int
- func ValidateNewWorkspaceParameters(richParameters []TemplateVersionParameter, ...) error
- func ValidateWorkspaceBuildParameter(richParameter TemplateVersionParameter, ...) error
- func ValidateWorkspaceBuildParameters(richParameters []TemplateVersionParameter, ...) error
- func WeekdaysToBitmap(days []string) (uint8, error)
- func WorkspaceDisplayStatus(jobStatus ProvisionerJobStatus, transition WorkspaceTransition) string
- func WorkspaceNotifyChannel(id uuid.UUID) string
- type APIKey
- type APIKeyScope
- type APIKeyWithOwner
- type AddLicenseRequest
- type AgentStatsReportRequest
- type AgentStatsReportResponse
- type AgentSubsystem
- type AppHostResponse
- type AppearanceConfig
- type AssignableRoles
- type AuditAction
- type AuditDiff
- type AuditDiffField
- type AuditLog
- type AuditLogResponse
- type AuditLogsRequest
- type AuthMethod
- type AuthMethods
- type AuthorizationCheck
- type AuthorizationObject
- type AuthorizationRequest
- type AuthorizationResponse
- type BuildInfoResponse
- type BuildReason
- type Client
- func (c *Client) APIKeyByID(ctx context.Context, userID string, id string) (*APIKey, error)
- func (c *Client) APIKeyByName(ctx context.Context, userID string, name string) (*APIKey, error)
- func (c *Client) AddLicense(ctx context.Context, r AddLicenseRequest) (License, error)
- func (c *Client) AppHost(ctx context.Context) (AppHostResponse, error)
- func (c *Client) Appearance(ctx context.Context) (AppearanceConfig, error)
- func (c *Client) AuditLogs(ctx context.Context, req AuditLogsRequest) (AuditLogResponse, error)
- func (c *Client) AuthCheck(ctx context.Context, req AuthorizationRequest) (AuthorizationResponse, error)
- func (c *Client) AuthMethods(ctx context.Context) (AuthMethods, error)
- func (c *Client) BuildInfo(ctx context.Context) (BuildInfoResponse, error)
- func (c *Client) CancelTemplateVersion(ctx context.Context, version uuid.UUID) error
- func (c *Client) CancelTemplateVersionDryRun(ctx context.Context, version, job uuid.UUID) error
- func (c *Client) CancelWorkspaceBuild(ctx context.Context, id uuid.UUID) error
- func (c *Client) ConvertLoginType(ctx context.Context, req ConvertLoginRequest) (OAuthConversionResponse, error)
- func (c *Client) CreateAPIKey(ctx context.Context, user string) (GenerateAPIKeyResponse, error)
- func (c *Client) CreateFirstUser(ctx context.Context, req CreateFirstUserRequest) (CreateFirstUserResponse, error)
- func (c *Client) CreateGroup(ctx context.Context, orgID uuid.UUID, req CreateGroupRequest) (Group, error)
- func (c *Client) CreateOrganization(ctx context.Context, req CreateOrganizationRequest) (Organization, error)
- func (c *Client) CreateTemplate(ctx context.Context, organizationID uuid.UUID, request CreateTemplateRequest) (Template, error)
- func (c *Client) CreateTemplateVersion(ctx context.Context, organizationID uuid.UUID, ...) (TemplateVersion, error)
- func (c *Client) CreateTemplateVersionDryRun(ctx context.Context, version uuid.UUID, req CreateTemplateVersionDryRunRequest) (ProvisionerJob, error)
- func (c *Client) CreateTestAuditLog(ctx context.Context, req CreateTestAuditLogRequest) error
- func (c *Client) CreateToken(ctx context.Context, userID string, req CreateTokenRequest) (GenerateAPIKeyResponse, error)
- func (c *Client) CreateUser(ctx context.Context, req CreateUserRequest) (User, error)
- func (c *Client) CreateWorkspace(ctx context.Context, organizationID uuid.UUID, user string, ...) (Workspace, error)
- func (c *Client) CreateWorkspaceBuild(ctx context.Context, workspace uuid.UUID, request CreateWorkspaceBuildRequest) (WorkspaceBuild, error)
- func (c *Client) CreateWorkspaceProxy(ctx context.Context, req CreateWorkspaceProxyRequest) (UpdateWorkspaceProxyResponse, error)
- func (c *Client) DeleteAPIKey(ctx context.Context, userID string, id string) error
- func (c *Client) DeleteGroup(ctx context.Context, group uuid.UUID) error
- func (c *Client) DeleteLicense(ctx context.Context, id int32) error
- func (c *Client) DeleteTemplate(ctx context.Context, template uuid.UUID) error
- func (c *Client) DeleteUser(ctx context.Context, id uuid.UUID) error
- func (c *Client) DeleteWorkspaceProxyByID(ctx context.Context, id uuid.UUID) error
- func (c *Client) DeleteWorkspaceProxyByName(ctx context.Context, name string) error
- func (c *Client) DeletedWorkspace(ctx context.Context, id uuid.UUID) (Workspace, error)
- func (c *Client) DeploymentConfig(ctx context.Context) (*DeploymentConfig, error)
- func (c *Client) DeploymentDAUs(ctx context.Context, tzOffset int) (*DAUsResponse, error)
- func (c *Client) DeploymentDAUsLocalTZ(ctx context.Context) (*DAUsResponse, error)
- func (c *Client) DeploymentStats(ctx context.Context) (DeploymentStats, error)
- func (c *Client) DialWorkspaceAgent(ctx context.Context, agentID uuid.UUID, options *DialWorkspaceAgentOptions) (agentConn *WorkspaceAgentConn, err error)
- func (c *Client) Download(ctx context.Context, id uuid.UUID) ([]byte, string, error)
- func (c *Client) Entitlements(ctx context.Context) (Entitlements, error)
- func (c *Client) Experiments(ctx context.Context) (Experiments, error)
- func (c *Client) GetTokenConfig(ctx context.Context, userID string) (TokenConfig, error)
- func (c *Client) GitAuthByID(ctx context.Context, provider string) (GitAuth, error)
- func (c *Client) GitAuthDeviceByID(ctx context.Context, provider string) (GitAuthDevice, error)
- func (c *Client) GitAuthDeviceExchange(ctx context.Context, provider string, req GitAuthDeviceExchange) error
- func (c *Client) GitSSHKey(ctx context.Context, user string) (GitSSHKey, error)
- func (c *Client) Group(ctx context.Context, group uuid.UUID) (Group, error)
- func (c *Client) GroupByOrgAndName(ctx context.Context, orgID uuid.UUID, name string) (Group, error)
- func (c *Client) GroupsByOrganization(ctx context.Context, orgID uuid.UUID) ([]Group, error)
- func (c *Client) HasFirstUser(ctx context.Context) (bool, error)
- func (c *Client) IssueReconnectingPTYSignedToken(ctx context.Context, req IssueReconnectingPTYSignedTokenRequest) (IssueReconnectingPTYSignedTokenResponse, error)
- func (c *Client) Licenses(ctx context.Context) ([]License, error)
- func (c *Client) ListOrganizationRoles(ctx context.Context, org uuid.UUID) ([]AssignableRoles, error)
- func (c *Client) ListSiteRoles(ctx context.Context) ([]AssignableRoles, error)
- func (c *Client) LogBodies() bool
- func (c *Client) Logger() slog.Logger
- func (c *Client) LoginWithPassword(ctx context.Context, req LoginWithPasswordRequest) (LoginWithPasswordResponse, error)
- func (c *Client) Logout(ctx context.Context) error
- func (c *Client) Organization(ctx context.Context, id uuid.UUID) (Organization, error)
- func (c *Client) OrganizationByName(ctx context.Context, user string, name string) (Organization, error)
- func (c *Client) OrganizationsByUser(ctx context.Context, user string) ([]Organization, error)
- func (c *Client) PatchGroup(ctx context.Context, group uuid.UUID, req PatchGroupRequest) (Group, error)
- func (c *Client) PatchWorkspaceProxy(ctx context.Context, req PatchWorkspaceProxy) (UpdateWorkspaceProxyResponse, error)
- func (c *Client) PreviousTemplateVersion(ctx context.Context, organization uuid.UUID, templateName, versionName string) (TemplateVersion, error)
- func (c *Client) ProvisionerDaemons(ctx context.Context) ([]ProvisionerDaemon, error)
- func (c *Client) PutExtendWorkspace(ctx context.Context, id uuid.UUID, req PutExtendWorkspaceRequest) error
- func (c *Client) RegenerateGitSSHKey(ctx context.Context, user string) (GitSSHKey, error)
- func (c *Client) Regions(ctx context.Context) ([]Region, error)
- func (c *Client) Replicas(ctx context.Context) ([]Replica, error)
- func (c *Client) Request(ctx context.Context, method, path string, body interface{}, ...) (*http.Response, error)
- func (c *Client) SSHConfiguration(ctx context.Context) (SSHConfigResponse, error)
- func (c *Client) ServeProvisionerDaemon(ctx context.Context, organization uuid.UUID, provisioners []ProvisionerType, ...) (proto.DRPCProvisionerDaemonClient, error)
- func (c *Client) SessionToken() string
- func (c *Client) SetLogBodies(logBodies bool)
- func (c *Client) SetLogger(logger slog.Logger)
- func (c *Client) SetSessionToken(token string)
- func (c *Client) Template(ctx context.Context, template uuid.UUID) (Template, error)
- func (c *Client) TemplateACL(ctx context.Context, templateID uuid.UUID) (TemplateACL, error)
- func (c *Client) TemplateByName(ctx context.Context, organizationID uuid.UUID, name string) (Template, error)
- func (c *Client) TemplateDAUs(ctx context.Context, templateID uuid.UUID, tzOffset int) (*DAUsResponse, error)
- func (c *Client) TemplateDAUsLocalTZ(ctx context.Context, templateID uuid.UUID) (*DAUsResponse, error)
- func (c *Client) TemplateExamples(ctx context.Context, organizationID uuid.UUID) ([]TemplateExample, error)
- func (c *Client) TemplateInsights(ctx context.Context, req TemplateInsightsRequest) (TemplateInsightsResponse, error)
- func (c *Client) TemplateVersion(ctx context.Context, id uuid.UUID) (TemplateVersion, error)
- func (c *Client) TemplateVersionByName(ctx context.Context, template uuid.UUID, name string) (TemplateVersion, error)
- func (c *Client) TemplateVersionByOrganizationAndName(ctx context.Context, organizationID uuid.UUID, ...) (TemplateVersion, error)
- func (c *Client) TemplateVersionDryRun(ctx context.Context, version, job uuid.UUID) (ProvisionerJob, error)
- func (c *Client) TemplateVersionDryRunLogsAfter(ctx context.Context, version, job uuid.UUID, after int64) (<-chan ProvisionerJobLog, io.Closer, error)
- func (c *Client) TemplateVersionDryRunResources(ctx context.Context, version, job uuid.UUID) ([]WorkspaceResource, error)
- func (c *Client) TemplateVersionGitAuth(ctx context.Context, version uuid.UUID) ([]TemplateVersionGitAuth, error)
- func (c *Client) TemplateVersionLogsAfter(ctx context.Context, version uuid.UUID, after int64) (<-chan ProvisionerJobLog, io.Closer, error)
- func (c *Client) TemplateVersionResources(ctx context.Context, version uuid.UUID) ([]WorkspaceResource, error)
- func (c *Client) TemplateVersionRichParameters(ctx context.Context, version uuid.UUID) ([]TemplateVersionParameter, error)
- func (c *Client) TemplateVersionVariables(ctx context.Context, version uuid.UUID) ([]TemplateVersionVariable, error)
- func (c *Client) TemplateVersionsByTemplate(ctx context.Context, req TemplateVersionsByTemplateRequest) ([]TemplateVersion, error)
- func (c *Client) TemplatesByOrganization(ctx context.Context, organizationID uuid.UUID) ([]Template, error)
- func (c *Client) Tokens(ctx context.Context, userID string, filter TokensFilter) ([]APIKeyWithOwner, error)
- func (c *Client) UpdateActiveTemplateVersion(ctx context.Context, template uuid.UUID, req UpdateActiveTemplateVersion) error
- func (c *Client) UpdateAppearance(ctx context.Context, appearance UpdateAppearanceConfig) error
- func (c *Client) UpdateCheck(ctx context.Context) (UpdateCheckResponse, error)
- func (c *Client) UpdateOrganizationMemberRoles(ctx context.Context, organizationID uuid.UUID, user string, req UpdateRoles) (OrganizationMember, error)
- func (c *Client) UpdateTemplateACL(ctx context.Context, templateID uuid.UUID, req UpdateTemplateACL) error
- func (c *Client) UpdateTemplateMeta(ctx context.Context, templateID uuid.UUID, req UpdateTemplateMeta) (Template, error)
- func (c *Client) UpdateTemplateVersion(ctx context.Context, versionID uuid.UUID, req PatchTemplateVersionRequest) (TemplateVersion, error)
- func (c *Client) UpdateUserPassword(ctx context.Context, user string, req UpdateUserPasswordRequest) error
- func (c *Client) UpdateUserProfile(ctx context.Context, user string, req UpdateUserProfileRequest) (User, error)
- func (c *Client) UpdateUserQuietHoursSchedule(ctx context.Context, userIdent string, req UpdateUserQuietHoursScheduleRequest) (UserQuietHoursScheduleResponse, error)
- func (c *Client) UpdateUserRoles(ctx context.Context, user string, req UpdateRoles) (User, error)
- func (c *Client) UpdateUserStatus(ctx context.Context, user string, status UserStatus) (User, error)
- func (c *Client) UpdateWorkspace(ctx context.Context, id uuid.UUID, req UpdateWorkspaceRequest) error
- func (c *Client) UpdateWorkspaceAutostart(ctx context.Context, id uuid.UUID, req UpdateWorkspaceAutostartRequest) error
- func (c *Client) UpdateWorkspaceLock(ctx context.Context, id uuid.UUID, req UpdateWorkspaceLock) error
- func (c *Client) UpdateWorkspaceTTL(ctx context.Context, id uuid.UUID, req UpdateWorkspaceTTLRequest) error
- func (c *Client) Upload(ctx context.Context, contentType string, rd io.Reader) (UploadResponse, error)
- func (c *Client) User(ctx context.Context, userIdent string) (User, error)
- func (c *Client) UserLatencyInsights(ctx context.Context, req UserLatencyInsightsRequest) (UserLatencyInsightsResponse, error)
- func (c *Client) UserQuietHoursSchedule(ctx context.Context, userIdent string) (UserQuietHoursScheduleResponse, error)
- func (c *Client) UserRoles(ctx context.Context, user string) (UserRoles, error)
- func (c *Client) Users(ctx context.Context, req UsersRequest) (GetUsersResponse, error)
- func (c *Client) WatchWorkspace(ctx context.Context, id uuid.UUID) (<-chan Workspace, error)
- func (c *Client) WatchWorkspaceAgentMetadata(ctx context.Context, id uuid.UUID) (<-chan []WorkspaceAgentMetadata, <-chan error)
- func (c *Client) Workspace(ctx context.Context, id uuid.UUID) (Workspace, error)
- func (c *Client) WorkspaceAgent(ctx context.Context, id uuid.UUID) (WorkspaceAgent, error)
- func (c *Client) WorkspaceAgentConnectionInfo(ctx context.Context) (*WorkspaceAgentConnectionInfo, error)
- func (c *Client) WorkspaceAgentListeningPorts(ctx context.Context, agentID uuid.UUID) (WorkspaceAgentListeningPortsResponse, error)
- func (c *Client) WorkspaceAgentReconnectingPTY(ctx context.Context, opts WorkspaceAgentReconnectingPTYOpts) (net.Conn, error)
- func (c *Client) WorkspaceAgentStartupLogsAfter(ctx context.Context, agentID uuid.UUID, after int64, follow bool) (<-chan []WorkspaceAgentStartupLog, io.Closer, error)
- func (c *Client) WorkspaceBuild(ctx context.Context, id uuid.UUID) (WorkspaceBuild, error)
- func (c *Client) WorkspaceBuildByUsernameAndWorkspaceNameAndBuildNumber(ctx context.Context, username string, workspaceName string, buildNumber string) (WorkspaceBuild, error)
- func (c *Client) WorkspaceBuildLogsAfter(ctx context.Context, build uuid.UUID, after int64) (<-chan ProvisionerJobLog, io.Closer, error)
- func (c *Client) WorkspaceBuildParameters(ctx context.Context, build uuid.UUID) ([]WorkspaceBuildParameter, error)
- func (c *Client) WorkspaceBuildState(ctx context.Context, build uuid.UUID) ([]byte, error)
- func (c *Client) WorkspaceBuilds(ctx context.Context, req WorkspaceBuildsRequest) ([]WorkspaceBuild, error)
- func (c *Client) WorkspaceByOwnerAndName(ctx context.Context, owner string, name string, params WorkspaceOptions) (Workspace, error)
- func (c *Client) WorkspaceProxies(ctx context.Context) (RegionsResponse[WorkspaceProxy], error)
- func (c *Client) WorkspaceProxyByID(ctx context.Context, id uuid.UUID) (WorkspaceProxy, error)
- func (c *Client) WorkspaceProxyByName(ctx context.Context, name string) (WorkspaceProxy, error)
- func (c *Client) WorkspaceQuota(ctx context.Context, userID string) (WorkspaceQuota, error)
- func (c *Client) Workspaces(ctx context.Context, filter WorkspaceFilter) (WorkspacesResponse, error)
- type ConnectionLatency
- type ConvertLoginRequest
- type CreateFirstUserRequest
- type CreateFirstUserResponse
- type CreateGroupRequest
- type CreateOrganizationRequest
- type CreateTemplateRequest
- type CreateTemplateVersionDryRunRequest
- type CreateTemplateVersionRequest
- type CreateTestAuditLogRequest
- type CreateTokenRequest
- type CreateUserRequest
- type CreateWorkspaceBuildRequest
- type CreateWorkspaceProxyRequest
- type CreateWorkspaceRequest
- type DAUEntry
- type DAURequest
- type DAUsResponse
- type DERP
- type DERPConfig
- type DERPRegion
- type DERPServerConfig
- type DangerousConfig
- type DeploymentConfig
- type DeploymentStats
- type DeploymentValues
- type DialWorkspaceAgentOptions
- type Entitlement
- type Entitlements
- type Error
- type Experiment
- type Experiments
- type Feature
- type FeatureName
- type GenerateAPIKeyResponse
- type GetUsersResponse
- type GitAuth
- type GitAuthAppInstallation
- type GitAuthConfig
- type GitAuthDevice
- type GitAuthDeviceExchange
- type GitAuthUser
- type GitProvider
- type GitSSHKey
- type Group
- type Healthcheck
- type InsightsReportInterval
- type IssueReconnectingPTYSignedTokenRequest
- type IssueReconnectingPTYSignedTokenResponse
- type JobErrorCode
- type License
- type LinkConfig
- type LogLevel
- type LogSource
- type LoggingConfig
- type LoginType
- type LoginWithPasswordRequest
- type LoginWithPasswordResponse
- type NullTime
- type OAuth2Config
- type OAuth2GithubConfig
- type OAuthConversionResponse
- type OIDCAuthMethod
- type OIDCConfig
- type Organization
- type OrganizationMember
- type Pagination
- type ParameterResolver
- type PatchGroupRequest
- type PatchTemplateVersionRequest
- type PatchWorkspaceProxy
- type PprofConfig
- type PrometheusConfig
- type ProvisionerConfig
- type ProvisionerDaemon
- type ProvisionerJob
- type ProvisionerJobLog
- type ProvisionerJobStatus
- type ProvisionerLogLevel
- type ProvisionerStorageMethod
- type ProvisionerType
- type ProxyHealthReport
- type ProxyHealthStatus
- type PutExtendWorkspaceRequest
- type RBACResource
- type RateLimitConfig
- type ReconnectingPTYRequest
- type Region
- type RegionTypes
- type RegionsResponse
- type Replica
- type RequestOption
- type ResourceType
- type Response
- type Role
- type SSHConfig
- type SSHConfigResponse
- type ServerSentEvent
- type ServerSentEventType
- type ServiceBannerConfig
- type SessionCountDeploymentStats
- type SupportConfig
- type SwaggerConfig
- type TLSConfig
- type TelemetryConfig
- type Template
- type TemplateACL
- type TemplateAppUsage
- type TemplateAppsType
- type TemplateBuildTimeStats
- type TemplateExample
- type TemplateGroup
- type TemplateInsightsIntervalReport
- type TemplateInsightsReport
- type TemplateInsightsRequest
- type TemplateInsightsResponse
- type TemplateRestartRequirement
- type TemplateRole
- type TemplateUser
- type TemplateVersion
- type TemplateVersionGitAuth
- type TemplateVersionParameter
- type TemplateVersionParameterOption
- type TemplateVersionVariable
- type TemplateVersionWarning
- type TemplateVersionsByTemplateRequest
- type TokenConfig
- type TokensFilter
- type TraceConfig
- type TransitionStats
- type UpdateActiveTemplateVersion
- type UpdateAppearanceConfig
- type UpdateCheckResponse
- type UpdateRoles
- type UpdateTemplateACL
- type UpdateTemplateMeta
- type UpdateUserPasswordRequest
- type UpdateUserProfileRequest
- type UpdateUserQuietHoursScheduleRequest
- type UpdateWorkspaceAutostartRequest
- type UpdateWorkspaceLock
- type UpdateWorkspaceProxyResponse
- type UpdateWorkspaceRequest
- type UpdateWorkspaceTTLRequest
- type UploadResponse
- type User
- type UserLatency
- type UserLatencyInsightsReport
- type UserLatencyInsightsRequest
- type UserLatencyInsightsResponse
- type UserLoginType
- type UserQuietHoursScheduleConfig
- type UserQuietHoursScheduleResponse
- type UserRoles
- type UserStatus
- type UsersRequest
- type ValidationError
- type ValidationMonotonicOrder
- type VariableValue
- type Workspace
- type WorkspaceAgent
- type WorkspaceAgentConn
- func (c *WorkspaceAgentConn) AwaitReachable(ctx context.Context) bool
- func (c *WorkspaceAgentConn) Close() error
- func (c *WorkspaceAgentConn) DialContext(ctx context.Context, network string, addr string) (net.Conn, error)
- func (c *WorkspaceAgentConn) ListeningPorts(ctx context.Context) (WorkspaceAgentListeningPortsResponse, error)
- func (c *WorkspaceAgentConn) Ping(ctx context.Context) (time.Duration, bool, *ipnstate.PingResult, error)
- func (c *WorkspaceAgentConn) ReconnectingPTY(ctx context.Context, id uuid.UUID, height, width uint16, command string) (net.Conn, error)
- func (c *WorkspaceAgentConn) SSH(ctx context.Context) (net.Conn, error)
- func (c *WorkspaceAgentConn) SSHClient(ctx context.Context) (*ssh.Client, error)
- func (c *WorkspaceAgentConn) Speedtest(ctx context.Context, direction speedtest.Direction, duration time.Duration) ([]speedtest.Result, error)
- type WorkspaceAgentConnOptions
- type WorkspaceAgentConnectionInfo
- type WorkspaceAgentHealth
- type WorkspaceAgentLifecycle
- type WorkspaceAgentListeningPort
- type WorkspaceAgentListeningPortsResponse
- type WorkspaceAgentMetadata
- type WorkspaceAgentMetadataDescription
- type WorkspaceAgentMetadataResult
- type WorkspaceAgentReconnectingPTYInit
- type WorkspaceAgentReconnectingPTYOpts
- type WorkspaceAgentStartupLog
- type WorkspaceAgentStartupScriptBehavior
- type WorkspaceAgentStatus
- type WorkspaceApp
- type WorkspaceAppHealth
- type WorkspaceAppSharingLevel
- type WorkspaceBuild
- type WorkspaceBuildParameter
- type WorkspaceBuildsRequest
- type WorkspaceConnectionLatencyMS
- type WorkspaceDeploymentStats
- type WorkspaceFilter
- type WorkspaceHealth
- type WorkspaceOptions
- type WorkspaceProxy
- type WorkspaceProxyBuildInfo
- type WorkspaceProxyStatus
- type WorkspaceQuota
- type WorkspaceResource
- type WorkspaceResourceMetadata
- type WorkspaceStatus
- type WorkspaceTransition
- type WorkspacesRequest
- type WorkspacesResponse
const ( SessionTokenCookie = "coder_session_token" SessionTokenHeader = "Coder-Session-Token" OAuth2StateCookie = "oauth_state" OAuth2RedirectCookie = "oauth_redirect" DevURLSessionTokenCookie = "coder_devurl_session_token" DevURLSignedAppTokenCookie = "coder_devurl_signed_app_token" SignedAppTokenQueryParameter = "coder_signed_app_token_23db1dde" BypassRatelimitHeader = "X-Coder-Bypass-Ratelimit" CLITelemetryHeader = "Coder-CLI-Telemetry" )
These cookies are Coder-specific. If a new one is added or changed, the name shouldn't be likely to conflict with any user-application set cookies. Be sure to strip additional cookies in httpapi.StripCoderCookies!
const ( LogSourceProvisionerDaemon LogSource = "provisioner_daemon" LogSourceProvisioner LogSource = "provisioner" LogLevelTrace LogLevel = "trace" LogLevelDebug LogLevel = "debug" LogLevelInfo LogLevel = "info" LogLevelWarn LogLevel = "warn" LogLevelError LogLevel = "error" )
const (
ContentTypeTar = "application/x-tar"
)
const (
LicenseExpiryClaim = "license_expires"
)
ExperimentsAll should include all experiments that are safe for users to opt-in to via --experimental='*'. Experiments that are not ready for consumption by all users should not be included here and will be essentially hidden.
var FeatureNames = []FeatureName{ FeatureUserLimit, FeatureAuditLog, FeatureBrowserOnly, FeatureSCIM, FeatureTemplateRBAC, FeatureHighAvailability, FeatureMultipleGitAuth, FeatureExternalProvisionerDaemons, FeatureAppearance, FeatureAdvancedTemplateScheduling, FeatureWorkspaceProxy, }
FeatureNames must be kept in-sync with the Feature enum above.
Me is used as a replacement for your own ID.
WorkspaceAgentIP is a static IPv6 address with the Tailscale prefix that is used to route connections from clients to this node. A dynamic address is not required because a Tailnet client only dials a single agent at a time.
Deprecated: use tailnet.IP() instead. This is kept for backwards compatibility with wsconncache. See: https://github.com/coder/coder/issues/8218
var WorkspaceAgentIgnoredListeningPorts = map[uint16]struct{}{
0: {},
1: {},
2: {},
3: {},
4: {},
5: {},
6: {},
7: {},
8: {},
20: {},
21: {},
22: {},
23: {},
25: {},
53: {},
110: {},
143: {},
179: {},
389: {},
636: {},
465: {},
587: {},
989: {},
990: {},
993: {},
995: {},
3306: {},
3389: {},
5432: {},
27017: {},
27018: {},
27019: {},
28017: {},
}
WorkspaceAgentIgnoredListeningPorts contains a list of ports to ignore when looking for running applications inside a workspace. We want to ignore non-HTTP servers, so we pre-populate this list with common ports that are not HTTP servers.
This is implemented as a map for fast lookup.
WorkspaceAgentLifecycleOrder is the order in which workspace agent lifecycle states are expected to be reported during the lifetime of the agent process. For instance, the agent can go from starting to ready without reporting timeout or error, but it should not go from ready to starting. This is merely a hint for the agent process, and is not enforced by the server.
BitmapToWeekdays converts a bitmap to a list of weekdays in accordance with the schedule package's rules (see above).
IsConnectionError is a convenience function for checking if the source of an error is due to a 'connection refused', 'no such host', etc.
IsWorkspaceProxies returns true if the cli option is used by workspace proxies.
ParseSSHConfigOption parses a single ssh config option into it's key/value pair.
func ReadBodyAsError ¶ added in v0.16.0
ReadBodyAsError reads the response as a codersdk.Response, and wraps it in a codersdk.Error type for easy marshaling.
func ValidateNewWorkspaceParameters(richParameters []TemplateVersionParameter, buildParameters []WorkspaceBuildParameter) error
func ValidateWorkspaceBuildParameter(richParameter TemplateVersionParameter, buildParameter *WorkspaceBuildParameter, lastBuildParameter *WorkspaceBuildParameter) error
func ValidateWorkspaceBuildParameters(richParameters []TemplateVersionParameter, buildParameters, lastBuildParameters []WorkspaceBuildParameter) error
WeekdaysToBitmap converts a list of weekdays to a bitmap in accordance with the schedule package's rules. The 0th bit is Monday, ..., the 6th bit is Sunday. The 7th bit is unused.
func WorkspaceDisplayStatus(jobStatus ProvisionerJobStatus, transition WorkspaceTransition) string
WorkspaceDisplayStatus computes a status to display on CLI/UI based on the workspace transition and the status of the provisioner job. This code is in sync with how we compute the status on frontend. Ref: site/src/util/workspace.ts (getWorkspaceStatus)
WorkspaceNotifyChannel is the PostgreSQL NOTIFY channel to listen for updates on. The payload is empty, because the size of a workspace payload can be very large.
type APIKey struct {
ID string `json:"id" validate:"required"`
UserID uuid.UUID `json:"user_id" validate:"required" format:"uuid"`
LastUsed time.Time `json:"last_used" validate:"required" format:"date-time"`
ExpiresAt time.Time `json:"expires_at" validate:"required" format:"date-time"`
CreatedAt time.Time `json:"created_at" validate:"required" format:"date-time"`
UpdatedAt time.Time `json:"updated_at" validate:"required" format:"date-time"`
LoginType LoginType `json:"login_type" validate:"required" enums:"password,github,oidc,token"`
Scope APIKeyScope `json:"scope" validate:"required" enums:"all,application_connect"`
TokenName string `json:"token_name" validate:"required"`
LifetimeSeconds int64 `json:"lifetime_seconds" validate:"required"`
}
APIKey: do not ever return the HashedSecret
const ( APIKeyScopeAll APIKeyScope = "all" APIKeyScopeApplicationConnect APIKeyScope = "application_connect" )
type AddLicenseRequest struct {
License string `json:"license" validate:"required"`
}
type AgentStatsReportRequest struct{}
AgentStatsReportRequest is a WebSocket request by coderd to the agent for stats. @typescript-ignore AgentStatsReportRequest
type AgentStatsReportResponse struct {
NumConns int64 `json:"num_comms"`
RxBytes int64 `json:"rx_bytes"`
TxBytes int64 `json:"tx_bytes"`
}
AgentStatsReportResponse is returned for each report request by the agent.
const (
AgentSubsystemEnvbox AgentSubsystem = "envbox"
)
type AppHostResponse struct {
Host string `json:"host"`
}
type AppearanceConfig struct {
LogoURL string `json:"logo_url"`
SupportLinks []LinkConfig `json:"support_links,omitempty"`
}
const ( AuditActionCreate AuditAction = "create" AuditActionWrite AuditAction = "write" AuditActionDelete AuditAction = "delete" AuditActionStart AuditAction = "start" AuditActionStop AuditAction = "stop" AuditActionLogin AuditAction = "login" AuditActionLogout AuditAction = "logout" AuditActionRegister AuditAction = "register" )
type AuditDiffField struct {
Old any `json:"old,omitempty"`
New any `json:"new,omitempty"`
Secret bool `json:"secret"`
}
type AuditLog struct {
ID uuid.UUID `json:"id" format:"uuid"`
RequestID uuid.UUID `json:"request_id" format:"uuid"`
Time time.Time `json:"time" format:"date-time"`
OrganizationID uuid.UUID `json:"organization_id" format:"uuid"`
IP netip.Addr `json:"ip"`
UserAgent string `json:"user_agent"`
ResourceType ResourceType `json:"resource_type"`
ResourceID uuid.UUID `json:"resource_id" format:"uuid"`
ResourceTarget string `json:"resource_target"`
ResourceIcon string `json:"resource_icon"`
Action AuditAction `json:"action"`
Diff AuditDiff `json:"diff"`
StatusCode int32 `json:"status_code"`
AdditionalFields json.RawMessage `json:"additional_fields"`
Description string `json:"description"`
ResourceLink string `json:"resource_link"`
IsDeleted bool `json:"is_deleted"`
User *User `json:"user"`
}
type AuditLogResponse struct {
AuditLogs []AuditLog `json:"audit_logs"`
Count int64 `json:"count"`
}
type AuditLogsRequest struct {
SearchQuery string `json:"q,omitempty"`
}
type AuthMethod struct {
Enabled bool `json:"enabled"`
}
type AuthMethods struct {
ConvertToOIDCEnabled bool `json:"convert_to_oidc_enabled"`
Password AuthMethod `json:"password"`
Github AuthMethod `json:"github"`
OIDC OIDCAuthMethod `json:"oidc"`
}
AuthMethods contains authentication method information like whether they are enabled or not or custom text, etc.
type AuthorizationCheck struct {
Object AuthorizationObject `json:"object"`
Action string `json:"action" enums:"create,read,update,delete"`
}
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.
@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 AuthorizationObject struct {
ResourceType RBACResource `json:"resource_type"`
OwnerID string `json:"owner_id,omitempty"`
OrganizationID string `json:"organization_id,omitempty"`
ResourceID string `json:"resource_id,omitempty"`
}
AuthorizationObject can represent a "set" of objects, such as: all workspaces in an organization, all workspaces owned by me, all workspaces across the entire product.
@Description AuthorizationObject can represent a "set" of objects, such as: all workspaces in an organization, all workspaces owned by me, @Description all workspaces across the entire product.
type AuthorizationRequest struct {
Checks map[string]AuthorizationCheck `json:"checks"`
}
AuthorizationRequest is a structure instead of a map because go-playground/validate can only validate structs. If you attempt to pass a map into `httpapi.Read`, you will get an invalid type error.
type BuildInfoResponse struct {
ExternalURL string `json:"external_url"`
Version string `json:"version"`
DashboardURL string `json:"dashboard_url"`
WorkspaceProxy bool `json:"workspace_proxy"`
}
BuildInfoResponse contains build information for this instance of Coder.
CanonicalVersion trims build information from the version. E.g. 'v0.7.4-devel+11573034' -> 'v0.7.4'.
const ( BuildReasonInitiator BuildReason = "initiator" BuildReasonAutostart BuildReason = "autostart" BuildReasonAutostop BuildReason = "autostop" )
Client is an HTTP caller for methods to the Coder API. @typescript-ignore Client
New creates a Coder client for the provided URL.
APIKeyByID returns the api key by id.
APIKeyByName returns the api key by name.
AppHost returns the site-wide application wildcard hostname without the leading "*.", e.g. "apps.coder.com". Apps are accessible at: "<app-name>--<agent-name>--<workspace-name>--<username>.<app-host>", e.g. "my-app--agent--workspace--username.apps.coder.com".
If the app host is not set, the response will contain an empty string.
Appearance returns the configuration that modifies the visual display of the dashboard.
AuditLogs retrieves audit logs from the given page.
AuthCheck allows the authenticated user to check if they have the given permissions to a set of resources.
AuthMethods returns types of authentication available to the user.
BuildInfo returns build information for this instance of Coder.
CancelTemplateVersion marks a template version job as canceled.
CancelTemplateVersionDryRun marks a template version dry-run job as canceled.
CancelWorkspaceBuild marks a workspace build job as canceled.
ConvertLoginType will send a request to convert the user from password based authentication to oauth based. The response has the oauth state code to use in the oauth flow.
CreateAPIKey generates an API key for the user ID provided. CreateToken should be used over CreateAPIKey. CreateToken allows better tracking of the token's usage and allows for custom expiration. Only use CreateAPIKey if you want to emulate the session created for a browser like login.
CreateFirstUser attempts to create the first user on a Coder deployment. This initial user has superadmin privileges. If >0 users exist, this request will fail.
CreateOrganization creates an organization and adds the provided user as an admin.
CreateTemplate creates a new template inside an organization.
CreateTemplateVersion processes source-code and optionally associates the version with a template. Executing without a template is useful for validating source-code.
CreateTemplateVersionDryRun begins a dry-run provisioner job against the given template version with the given parameter values.
CreateTestAuditLog creates a fake audit log. Only owners of the organization can perform this action. It's used for testing purposes.
CreateToken generates an API key for the user ID provided with custom expiration. These tokens can be used for long-lived access, like for use with CI.
CreateUser creates a new user.
CreateWorkspace creates a new workspace for the template specified.
CreateWorkspaceBuild queues a new build to occur for a workspace.
DeleteAPIKey deletes API key by id.
DeleteUser deletes a user.
DeletedWorkspace returns a single workspace that was deleted.
DeploymentConfig returns the deployment config for the coder server.
DeploymentDAUs requires a tzOffset in hours. Use 0 for UTC, and TimezoneOffsetHour(time.Local) for the local timezone.
Download fetches a file by uploaded hash.
GetTokenConfig returns deployment options related to token management
GitAuthByID returns the git auth for the given provider by ID.
ExchangeGitAuth exchanges a device code for a git auth token.
GitSSHKey returns the user's git SSH public key.
HasFirstUser returns whether the first user has been created.
ListOrganizationRoles lists all assignable roles for a given organization.
ListSiteRoles lists all assignable site wide roles.
LogBodies returns whether requests and response bodies are logged.
Logger returns the logger for the client.
LoginWithPassword creates a session token authenticating with an email and password. Call `SetSessionToken()` to apply the newly acquired token to the client.
Logout calls the /logout API Call `ClearSessionToken()` to clear the session token of the client.
OrganizationsByUser returns all organizations the user is a member of.
ProvisionerDaemonsByOrganization returns provisioner daemons available for an organization.
PutExtendWorkspace updates the deadline for resources of the latest workspace build.
RegenerateGitSSHKey will create a new SSH key pair for the user and return it.
Replicas fetches the list of replicas.
Request performs a HTTP request with the body provided. The caller is responsible for closing the response body.
SSHConfiguration returns information about the SSH configuration for the Coder instance.
ListenProvisionerDaemon returns the gRPC service for a provisioner daemon implementation. The context is during dial, not during the lifetime of the client. Client should be closed after use.
SessionToken returns the currently set token for the client.
SetLogBodies sets whether to log request and response bodies.
SetLogger sets the logger for the client.
SetSessionToken returns the currently set token for the client.
Template returns a single template.
TemplateByName finds a template inside the organization provided with a case-insensitive name.
TemplateDAUs requires a tzOffset in hours. Use 0 for UTC, and TimezoneOffsetHour(time.Local) for the local timezone.
TemplateExamples lists example templates embedded in coder.
TemplateVersion returns a template version by ID.
TemplateVersionByName returns a template version by it's friendly name. This is used for path-based routing. Like: /templates/example/versions/helloworld
TemplateVersionDryRun returns the current state of a template version dry-run job.
TemplateVersionDryRunLogsAfter streams logs for a template version dry-run that occurred after a specific log ID.
TemplateVersionDryRunResources returns the resources of a finished template version dry-run job.
TemplateVersionGitAuth returns git authentication for the requested template version.
TemplateVersionLogsAfter streams logs for a template version that occurred after a specific log ID.
TemplateVersionResources returns resources a template version declares.
TemplateVersionParameters returns parameters a template version exposes.
TemplateVersionVariables returns resources a template version variables.
TemplateVersionsByTemplate lists versions associated with a template.
TemplatesByOrganization lists all templates inside of an organization.
Tokens list machine API keys.
UpdateActiveTemplateVersion updates the active template version to the ID provided. The template version must be attached to the template.
UpdateCheck returns information about the latest release version of Coder and whether or not the server is running the latest release.
UpdateOrganizationMemberRoles grants the userID the specified roles in an org. Include ALL roles the user has.
UpdateUserPassword updates a user password. It calls PUT /users/{user}/password
UpdateUserProfile enables callers to update profile information
UpdateUserQuietHoursSchedule updates the quiet hours settings for the user. This endpoint only exists in enterprise editions.
UpdateUserRoles grants the userID the specified roles. Include ALL roles the user has.
UpdateUserStatus sets the user status to the given status
UpdateWorkspaceAutostart sets the autostart schedule for workspace by id. If the provided schedule is empty, autostart is disabled for the workspace.
UpdateWorkspaceLock locks or unlocks a workspace.
UpdateWorkspaceTTL sets the ttl for workspace by id. If the provided duration is nil, autostop is disabled for the workspace.
Upload uploads an arbitrary file with the content type provided. This is used to upload a source-code archive.
User returns a user for the ID/username provided.
UserQuietHoursSchedule returns the quiet hours settings for the user. This endpoint only exists in enterprise editions.
UserRoles returns all roles the user has
Users returns all users according to the request parameters. If no parameters are set, the default behavior is to return all users in a single page.
WatchWorkspaceAgentMetadata watches the metadata of a workspace agent. The returned channel will be closed when the context is canceled. Exactly one error will be sent on the error channel. The metadata channel is never closed.
Workspace returns a single workspace.
WorkspaceAgent returns an agent by ID.
WorkspaceAgentListeningPorts returns a list of ports that are currently being listened on inside the workspace agent's network namespace.
WorkspaceAgentReconnectingPTY spawns a PTY that reconnects using the token provided. It communicates using `agent.ReconnectingPTYRequest` marshaled as JSON. Responses are PTY output that can be rendered.
WorkspaceBuild returns a single workspace build for a workspace. If history is "", the latest version is returned.
WorkspaceBuildLogsAfter streams logs for a workspace build that occurred after a specific log ID.
WorkspaceBuildState returns the provisioner state of the build.
func (*Client) WorkspaceByOwnerAndName ¶ added in v0.5.0
WorkspaceByOwnerAndName returns a workspace by the owner's UUID and the workspace's name.
Workspaces returns all workspaces the authenticated user has access to.
type ConnectionLatency struct {
P50 float64 `json:"p50" example:"31.312"`
P95 float64 `json:"p95" example:"119.832"`
}
ConnectionLatency shows the latency for a connection.
type ConvertLoginRequest struct {
ToType LoginType `json:"to_type" validate:"required"`
Password string `json:"password" validate:"required"`
}
type CreateFirstUserRequest struct {
Email string `json:"email" validate:"required,email"`
Username string `json:"username" validate:"required,username"`
Password string `json:"password" validate:"required"`
Trial bool `json:"trial"`
}
type CreateFirstUserResponse struct {
UserID uuid.UUID `json:"user_id" format:"uuid"`
OrganizationID uuid.UUID `json:"organization_id" format:"uuid"`
}
CreateFirstUserResponse contains IDs for newly created user info.
type CreateGroupRequest struct {
Name string `json:"name"`
AvatarURL string `json:"avatar_url"`
QuotaAllowance int `json:"quota_allowance"`
}
type CreateOrganizationRequest struct {
Name string `json:"name" validate:"required,username"`
}
type CreateTemplateRequest struct {
Name string `json:"name" validate:"template_name,required"`
DisplayName string `json:"display_name,omitempty" validate:"template_display_name"`
Description string `json:"description,omitempty" validate:"lt=128"`
Icon string `json:"icon,omitempty"`
VersionID uuid.UUID `json:"template_version_id" validate:"required" format:"uuid"`
DefaultTTLMillis *int64 `json:"default_ttl_ms,omitempty"`
MaxTTLMillis *int64 `json:"max_ttl_ms,omitempty"`
RestartRequirement *TemplateRestartRequirement `json:"restart_requirement,omitempty"`
AllowUserCancelWorkspaceJobs *bool `json:"allow_user_cancel_workspace_jobs"`
AllowUserAutostart *bool `json:"allow_user_autostart"`
AllowUserAutostop *bool `json:"allow_user_autostop"`
FailureTTLMillis *int64 `json:"failure_ttl_ms,omitempty"`
InactivityTTLMillis *int64 `json:"inactivity_ttl_ms,omitempty"`
LockedTTLMillis *int64 `json:"locked_ttl_ms,omitempty"`
DisableEveryoneGroupAccess bool `json:"disable_everyone_group_access"`
}
CreateTemplateRequest provides options when creating a template.
type CreateTemplateVersionDryRunRequest struct {
WorkspaceName string `json:"workspace_name"`
RichParameterValues []WorkspaceBuildParameter `json:"rich_parameter_values"`
UserVariableValues []VariableValue `json:"user_variable_values,omitempty"`
}
CreateTemplateVersionDryRunRequest defines the request parameters for CreateTemplateVersionDryRun.
type CreateTemplateVersionRequest struct {
Name string `json:"name,omitempty" validate:"omitempty,template_version_name"`
Message string `json:"message,omitempty" validate:"lt=1048577"`
TemplateID uuid.UUID `json:"template_id,omitempty" format:"uuid"`
StorageMethod ProvisionerStorageMethod `json:"storage_method" validate:"oneof=file,required" enums:"file"`
FileID uuid.UUID `json:"file_id,omitempty" validate:"required_without=ExampleID" format:"uuid"`
ExampleID string `json:"example_id,omitempty" validate:"required_without=FileID"`
Provisioner ProvisionerType `json:"provisioner" validate:"oneof=terraform echo,required"`
ProvisionerTags map[string]string `json:"tags"`
UserVariableValues []VariableValue `json:"user_variable_values,omitempty"`
}
CreateTemplateVersionRequest enables callers to create a new Template Version.
type CreateTestAuditLogRequest struct {
Action AuditAction `json:"action,omitempty" enums:"create,write,delete,start,stop"`
ResourceType ResourceType `json:"resource_type,omitempty" enums:"template,template_version,user,workspace,workspace_build,git_ssh_key,auditable_group"`
ResourceID uuid.UUID `json:"resource_id,omitempty" format:"uuid"`
AdditionalFields json.RawMessage `json:"additional_fields,omitempty"`
Time time.Time `json:"time,omitempty" format:"date-time"`
BuildReason BuildReason `json:"build_reason,omitempty" enums:"autostart,autostop,initiator"`
}
type CreateTokenRequest struct {
Lifetime time.Duration `json:"lifetime"`
Scope APIKeyScope `json:"scope" enums:"all,application_connect"`
TokenName string `json:"token_name"`
}
type CreateUserRequest struct {
Email string `json:"email" validate:"required,email" format:"email"`
Username string `json:"username" validate:"required,username"`
Password string `json:"password" validate:"required_if=DisableLogin false"`
DisableLogin bool `json:"disable_login"`
OrganizationID uuid.UUID `json:"organization_id" validate:"" format:"uuid"`
}
type CreateWorkspaceBuildRequest struct {
TemplateVersionID uuid.UUID `json:"template_version_id,omitempty" format:"uuid"`
Transition WorkspaceTransition `json:"transition" validate:"oneof=create start stop delete,required"`
DryRun bool `json:"dry_run,omitempty"`
ProvisionerState []byte `json:"state,omitempty"`
Orphan bool `json:"orphan,omitempty"`
RichParameterValues []WorkspaceBuildParameter `json:"rich_parameter_values,omitempty"`
LogLevel ProvisionerLogLevel `json:"log_level,omitempty" validate:"omitempty,oneof=debug"`
}
CreateWorkspaceBuildRequest provides options to update the latest workspace build.
type CreateWorkspaceProxyRequest struct {
Name string `json:"name" validate:"required"`
DisplayName string `json:"display_name"`
Icon string `json:"icon"`
}
type CreateWorkspaceRequest struct {
TemplateID uuid.UUID `json:"template_id" validate:"required" format:"uuid"`
Name string `json:"name" validate:"workspace_name,required"`
AutostartSchedule *string `json:"autostart_schedule"`
TTLMillis *int64 `json:"ttl_ms,omitempty"`
RichParameterValues []WorkspaceBuildParameter `json:"rich_parameter_values,omitempty"`
}
CreateWorkspaceRequest provides options for creating a new workspace.
type DAURequest struct {
TZHourOffset int
}
type DAUsResponse struct {
Entries []DAUEntry `json:"entries"`
TZHourOffset int `json:"tz_hour_offset"`
}
type DERP struct {
Server DERPServerConfig `json:"server" typescript:",notnull"`
Config DERPConfig `json:"config" typescript:",notnull"`
}
type DERPConfig struct {
BlockDirect clibase.Bool `json:"block_direct" typescript:",notnull"`
URL clibase.String `json:"url" typescript:",notnull"`
Path clibase.String `json:"path" typescript:",notnull"`
}
type DERPRegion struct {
Preferred bool `json:"preferred"`
LatencyMilliseconds float64 `json:"latency_ms"`
}
type DERPServerConfig struct {
Enable clibase.Bool `json:"enable" typescript:",notnull"`
RegionID clibase.Int64 `json:"region_id" typescript:",notnull"`
RegionCode clibase.String `json:"region_code" typescript:",notnull"`
RegionName clibase.String `json:"region_name" typescript:",notnull"`
STUNAddresses clibase.StringArray `json:"stun_addresses" typescript:",notnull"`
RelayURL clibase.URL `json:"relay_url" typescript:",notnull"`
}
type DangerousConfig struct {
AllowPathAppSharing clibase.Bool `json:"allow_path_app_sharing" typescript:",notnull"`
AllowPathAppSiteOwnerAccess clibase.Bool `json:"allow_path_app_site_owner_access" typescript:",notnull"`
AllowAllCors clibase.Bool `json:"allow_all_cors" typescript:",notnull"`
}
type DeploymentConfig struct {
Values *DeploymentValues `json:"config,omitempty"`
Options clibase.OptionSet `json:"options,omitempty"`
}
DeploymentConfig contains both the deployment values and how they're set.
@typescript-ignore DeploymentConfig apitypings doesn't know how to generate the OptionSet... yet.
type DeploymentStats struct {
AggregatedFrom time.Time `json:"aggregated_from" format:"date-time"`
CollectedAt time.Time `json:"collected_at" format:"date-time"`
NextUpdateAt time.Time `json:"next_update_at" format:"date-time"`
Workspaces WorkspaceDeploymentStats `json:"workspaces"`
SessionCount SessionCountDeploymentStats `json:"session_count"`
}
type DeploymentValues struct {
Verbose clibase.Bool `json:"verbose,omitempty"`
AccessURL clibase.URL `json:"access_url,omitempty"`
WildcardAccessURL clibase.URL `json:"wildcard_access_url,omitempty"`
DocsURL clibase.URL `json:"docs_url,omitempty"`
RedirectToAccessURL clibase.Bool `json:"redirect_to_access_url,omitempty"`
HTTPAddress clibase.String `json:"http_address,omitempty" typescript:",notnull"`
AutobuildPollInterval clibase.Duration `json:"autobuild_poll_interval,omitempty"`
JobHangDetectorInterval clibase.Duration `json:"job_hang_detector_interval,omitempty"`
DERP DERP `json:"derp,omitempty" typescript:",notnull"`
Prometheus PrometheusConfig `json:"prometheus,omitempty" typescript:",notnull"`
Pprof PprofConfig `json:"pprof,omitempty" typescript:",notnull"`
ProxyTrustedOrigins clibase.StringArray `json:"proxy_trusted_origins,omitempty" typescript:",notnull"`
CacheDir clibase.String `json:"cache_directory,omitempty" typescript:",notnull"`
InMemoryDatabase clibase.Bool `json:"in_memory_database,omitempty" typescript:",notnull"`
PostgresURL clibase.String `json:"pg_connection_url,omitempty" typescript:",notnull"`
OAuth2 OAuth2Config `json:"oauth2,omitempty" typescript:",notnull"`
OIDC OIDCConfig `json:"oidc,omitempty" typescript:",notnull"`
Telemetry TelemetryConfig `json:"telemetry,omitempty" typescript:",notnull"`
TLS TLSConfig `json:"tls,omitempty" typescript:",notnull"`
Trace TraceConfig `json:"trace,omitempty" typescript:",notnull"`
SecureAuthCookie clibase.Bool `json:"secure_auth_cookie,omitempty" typescript:",notnull"`
StrictTransportSecurity clibase.Int64 `json:"strict_transport_security,omitempty" typescript:",notnull"`
StrictTransportSecurityOptions clibase.StringArray `json:"strict_transport_security_options,omitempty" typescript:",notnull"`
SSHKeygenAlgorithm clibase.String `json:"ssh_keygen_algorithm,omitempty" typescript:",notnull"`
MetricsCacheRefreshInterval clibase.Duration `json:"metrics_cache_refresh_interval,omitempty" typescript:",notnull"`
AgentStatRefreshInterval clibase.Duration `json:"agent_stat_refresh_interval,omitempty" typescript:",notnull"`
AgentFallbackTroubleshootingURL clibase.URL `json:"agent_fallback_troubleshooting_url,omitempty" typescript:",notnull"`
BrowserOnly clibase.Bool `json:"browser_only,omitempty" typescript:",notnull"`
SCIMAPIKey clibase.String `json:"scim_api_key,omitempty" typescript:",notnull"`
Provisioner ProvisionerConfig `json:"provisioner,omitempty" typescript:",notnull"`
RateLimit RateLimitConfig `json:"rate_limit,omitempty" typescript:",notnull"`
Experiments clibase.StringArray `json:"experiments,omitempty" typescript:",notnull"`
UpdateCheck clibase.Bool `json:"update_check,omitempty" typescript:",notnull"`
MaxTokenLifetime clibase.Duration `json:"max_token_lifetime,omitempty" typescript:",notnull"`
Swagger SwaggerConfig `json:"swagger,omitempty" typescript:",notnull"`
Logging LoggingConfig `json:"logging,omitempty" typescript:",notnull"`
Dangerous DangerousConfig `json:"dangerous,omitempty" typescript:",notnull"`
DisablePathApps clibase.Bool `json:"disable_path_apps,omitempty" typescript:",notnull"`
SessionDuration clibase.Duration `json:"max_session_expiry,omitempty" typescript:",notnull"`
DisableSessionExpiryRefresh clibase.Bool `json:"disable_session_expiry_refresh,omitempty" typescript:",notnull"`
DisablePasswordAuth clibase.Bool `json:"disable_password_auth,omitempty" typescript:",notnull"`
Support SupportConfig `json:"support,omitempty" typescript:",notnull"`
GitAuthProviders clibase.Struct[[]GitAuthConfig] `json:"git_auth,omitempty" typescript:",notnull"`
SSHConfig SSHConfig `json:"config_ssh,omitempty" typescript:",notnull"`
WgtunnelHost clibase.String `json:"wgtunnel_host,omitempty" typescript:",notnull"`
DisableOwnerWorkspaceExec clibase.Bool `json:"disable_owner_workspace_exec,omitempty" typescript:",notnull"`
ProxyHealthStatusInterval clibase.Duration `json:"proxy_health_status_interval,omitempty" typescript:",notnull"`
EnableTerraformDebugMode clibase.Bool `json:"enable_terraform_debug_mode,omitempty" typescript:",notnull"`
Config clibase.YAMLConfigPath `json:"config,omitempty" typescript:",notnull"`
WriteConfig clibase.Bool `json:"write_config,omitempty" typescript:",notnull"`
Address clibase.HostPort `json:"address,omitempty" typescript:",notnull"`
}
DeploymentValues is the central configuration values the coder server.
WithoutSecrets returns a copy of the config without secret values.
@typescript-ignore DialWorkspaceAgentOptions
Entitlement represents whether a feature is licensed.
const ( EntitlementEntitled Entitlement = "entitled" EntitlementGracePeriod Entitlement = "grace_period" EntitlementNotEntitled Entitlement = "not_entitled" )
type Entitlements struct {
Features map[FeatureName]Feature `json:"features"`
Warnings []string `json:"warnings"`
Errors []string `json:"errors"`
HasLicense bool `json:"has_license"`
Trial bool `json:"trial"`
RequireTelemetry bool `json:"require_telemetry"`
}
Error represents an unaccepted or invalid request to the API. @typescript-ignore Error
const ( ExperimentMoons Experiment = "moons" ExperimentWorkspaceActions Experiment = "workspace_actions" ExperimentTailnetHACoordinator Experiment = "tailnet_ha_coordinator" ExperimentConvertToOIDC Experiment = "convert-to-oidc" ExperimentSingleTailnet Experiment = "single_tailnet" ExperimentTemplateRestartRequirement Experiment = "template_restart_requirement" )
type Experiments []Experiment
Experiments is a list of experiments that are enabled for the deployment. Multiple experiments may be enabled at the same time. Experiments are not safe for production use, and are not guaranteed to be backwards compatible. They may be removed or renamed at any time.
type Feature struct {
Entitlement Entitlement `json:"entitlement"`
Enabled bool `json:"enabled"`
Limit *int64 `json:"limit,omitempty"`
Actual *int64 `json:"actual,omitempty"`
}
FeatureName represents the internal name of a feature. To add a new feature, add it to this set of enums as well as the FeatureNames array below.
const ( FeatureUserLimit FeatureName = "user_limit" FeatureAuditLog FeatureName = "audit_log" FeatureBrowserOnly FeatureName = "browser_only" FeatureSCIM FeatureName = "scim" FeatureTemplateRBAC FeatureName = "template_rbac" FeatureHighAvailability FeatureName = "high_availability" FeatureMultipleGitAuth FeatureName = "multiple_git_auth" FeatureExternalProvisionerDaemons FeatureName = "external_provisioner_daemons" FeatureAppearance FeatureName = "appearance" FeatureAdvancedTemplateScheduling FeatureName = "advanced_template_scheduling" FeatureTemplateRestartRequirement FeatureName = "template_restart_requirement" FeatureWorkspaceProxy FeatureName = "workspace_proxy" )
func (n FeatureName) AlwaysEnable() bool
AlwaysEnable returns if the feature is always enabled if entitled. Warning: We don't know if we need this functionality. This method may disappear at any time.
Humanize returns the feature name in a human-readable format.
type GenerateAPIKeyResponse struct {
Key string `json:"key"`
}
GenerateAPIKeyResponse contains an API key for a user.
type GitAuth struct {
Authenticated bool `json:"authenticated"`
Device bool `json:"device"`
Type string `json:"type"`
User *GitAuthUser `json:"user"`
AppInstallable bool `json:"app_installable"`
AppInstallations []GitAuthAppInstallation `json:"installations"`
AppInstallURL string `json:"app_install_url"`
}
type GitAuthAppInstallation struct {
ID int `json:"id"`
Account GitAuthUser `json:"account"`
ConfigureURL string `json:"configure_url"`
}
type GitAuthConfig struct {
ID string `json:"id"`
Type string `json:"type"`
ClientID string `json:"client_id"`
ClientSecret string `json:"-" yaml:"client_secret"`
AuthURL string `json:"auth_url"`
TokenURL string `json:"token_url"`
ValidateURL string `json:"validate_url"`
AppInstallURL string `json:"app_install_url"`
AppInstallationsURL string `json:"app_installations_url"`
Regex string `json:"regex"`
NoRefresh bool `json:"no_refresh"`
Scopes []string `json:"scopes"`
DeviceFlow bool `json:"device_flow"`
DeviceCodeURL string `json:"device_code_url"`
}
type GitAuthDeviceExchange struct {
DeviceCode string `json:"device_code"`
}
type GitAuthUser struct {
Login string `json:"login"`
AvatarURL string `json:"avatar_url"`
ProfileURL string `json:"profile_url"`
Name string `json:"name"`
}
GitProvider is a constant that represents the type of providers that are supported within Coder.
const ( GitProviderAzureDevops GitProvider = "azure-devops" GitProviderGitHub GitProvider = "github" GitProviderGitLab GitProvider = "gitlab" GitProviderBitBucket GitProvider = "bitbucket" )
type GitSSHKey struct {
UserID uuid.UUID `json:"user_id" format:"uuid"`
CreatedAt time.Time `json:"created_at" format:"date-time"`
UpdatedAt time.Time `json:"updated_at" format:"date-time"`
PublicKey string `json:"public_key"`
}
type Group struct {
ID uuid.UUID `json:"id" format:"uuid"`
Name string `json:"name"`
OrganizationID uuid.UUID `json:"organization_id" format:"uuid"`
Members []User `json:"members"`
AvatarURL string `json:"avatar_url"`
QuotaAllowance int `json:"quota_allowance"`
}
type Healthcheck struct {
URL string `json:"url"`
Interval int32 `json:"interval"`
Threshold int32 `json:"threshold"`
}
type InsightsReportInterval string
InsightsReportInterval is the interval of time over which to generate a smaller insights report within a time range.
const (
InsightsReportIntervalDay InsightsReportInterval = "day"
)
InsightsReportInterval enums.
type IssueReconnectingPTYSignedTokenRequest struct {
URL string `json:"url" validate:"required"`
AgentID uuid.UUID `json:"agentID" format:"uuid" validate:"required"`
}
type IssueReconnectingPTYSignedTokenResponse struct {
SignedToken string `json:"signed_token"`
}
JobErrorCode defines the error code returned by job runner.
const ( MissingTemplateParameter JobErrorCode = "MISSING_TEMPLATE_PARAMETER" RequiredTemplateVariables JobErrorCode = "REQUIRED_TEMPLATE_VARIABLES" )
type License struct {
ID int32 `json:"id"`
UUID uuid.UUID `json:"uuid" format:"uuid"`
UploadedAt time.Time `json:"uploaded_at" format:"date-time"`
Claims map[string]interface{} `json:"claims" table:"claims"`
}
ExpiresAt returns the expiration time of the license. If the claim is missing or has an unexpected type, an error is returned.
FeaturesClaims provides the feature claims in license. This only returns the explicit claims. If checking for actual usage, also check `AllFeaturesClaim`.
type LinkConfig struct {
Name string `json:"name" yaml:"name"`
Target string `json:"target" yaml:"target"`
Icon string `json:"icon" yaml:"icon"`
}
type LoggingConfig struct {
Human clibase.String `json:"human" typescript:",notnull"`
JSON clibase.String `json:"json" typescript:",notnull"`
Stackdriver clibase.String `json:"stackdriver" typescript:",notnull"`
}
LoginType is the type of login used to create the API key.
type LoginWithPasswordRequest struct {
Email string `json:"email" validate:"required,email" format:"email"`
Password string `json:"password" validate:"required"`
}
LoginWithPasswordRequest enables callers to authenticate with email and password.
type LoginWithPasswordResponse struct {
SessionToken string `json:"session_token" validate:"required"`
}
LoginWithPasswordResponse contains a session token for the newly authenticated user.
NullTime represents a nullable time.Time. @typescript-ignore NullTime
NewNullTime returns a new NullTime with the given time.Time.
IsZero return true if the time is null or zero.
MarshalJSON implements json.Marshaler.
UnmarshalJSON implements json.Unmarshaler.
type OAuth2Config struct {
Github OAuth2GithubConfig `json:"github" typescript:",notnull"`
}
type OAuth2GithubConfig struct {
ClientID clibase.String `json:"client_id" typescript:",notnull"`
ClientSecret clibase.String `json:"client_secret" typescript:",notnull"`
AllowedOrgs clibase.StringArray `json:"allowed_orgs" typescript:",notnull"`
AllowedTeams clibase.StringArray `json:"allowed_teams" typescript:",notnull"`
AllowSignups clibase.Bool `json:"allow_signups" typescript:",notnull"`
AllowEveryone clibase.Bool `json:"allow_everyone" typescript:",notnull"`
EnterpriseBaseURL clibase.String `json:"enterprise_base_url" typescript:",notnull"`
}
type OAuthConversionResponse struct {
StateString string `json:"state_string"`
ExpiresAt time.Time `json:"expires_at" format:"date-time"`
ToType LoginType `json:"to_type"`
UserID uuid.UUID `json:"user_id" format:"uuid"`
}
type OIDCAuthMethod struct {
AuthMethod
SignInText string `json:"signInText"`
IconURL string `json:"iconUrl"`
}
type OIDCConfig struct {
AllowSignups clibase.Bool `json:"allow_signups" typescript:",notnull"`
ClientID clibase.String `json:"client_id" typescript:",notnull"`
ClientSecret clibase.String `json:"client_secret" typescript:",notnull"`
EmailDomain clibase.StringArray `json:"email_domain" typescript:",notnull"`
IssuerURL clibase.String `json:"issuer_url" typescript:",notnull"`
Scopes clibase.StringArray `json:"scopes" typescript:",notnull"`
IgnoreEmailVerified clibase.Bool `json:"ignore_email_verified" typescript:",notnull"`
UsernameField clibase.String `json:"username_field" typescript:",notnull"`
EmailField clibase.String `json:"email_field" typescript:",notnull"`
AuthURLParams clibase.Struct[map[string]string] `json:"auth_url_params" typescript:",notnull"`
IgnoreUserInfo clibase.Bool `json:"ignore_user_info" typescript:",notnull"`
GroupField clibase.String `json:"groups_field" typescript:",notnull"`
GroupMapping clibase.Struct[map[string]string] `json:"group_mapping" typescript:",notnull"`
SignInText clibase.String `json:"sign_in_text" typescript:",notnull"`
IconURL clibase.URL `json:"icon_url" typescript:",notnull"`
}
type Organization struct {
ID uuid.UUID `json:"id" validate:"required" format:"uuid"`
Name string `json:"name" validate:"required"`
CreatedAt time.Time `json:"created_at" validate:"required" format:"date-time"`
UpdatedAt time.Time `json:"updated_at" validate:"required" format:"date-time"`
}
Organization is the JSON representation of a Coder organization.
type OrganizationMember struct {
UserID uuid.UUID `db:"user_id" json:"user_id" format:"uuid"`
OrganizationID uuid.UUID `db:"organization_id" json:"organization_id" format:"uuid"`
CreatedAt time.Time `db:"created_at" json:"created_at" format:"date-time"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at" format:"date-time"`
Roles []Role `db:"roles" json:"roles"`
}
type Pagination struct {
AfterID uuid.UUID `json:"after_id,omitempty" format:"uuid"`
Limit int `json:"limit,omitempty"`
Offset int `json:"offset,omitempty"`
}
Pagination sets pagination options for the endpoints that support it.
type ParameterResolver struct {
Rich []WorkspaceBuildParameter
}
ParameterResolver should be populated with legacy workload and rich parameter values from the previous build. It then supports queries against a current TemplateVersionParameter to determine whether a new value is required, or a value correctly validates. @typescript-ignore ParameterResolver
ValidateResolve checks the provided value, v, against the parameter, p, and the previous build. If v is nil, it also resolves the correct value. It returns the value of the parameter, if valid, and an error if invalid.
type PatchGroupRequest struct {
AddUsers []string `json:"add_users"`
RemoveUsers []string `json:"remove_users"`
Name string `json:"name"`
AvatarURL *string `json:"avatar_url"`
QuotaAllowance *int `json:"quota_allowance"`
}
type PatchTemplateVersionRequest struct {
Name string `json:"name" validate:"omitempty,template_version_name"`
Message *string `json:"message,omitempty" validate:"omitempty,lt=1048577"`
}
type PatchWorkspaceProxy struct {
ID uuid.UUID `json:"id" format:"uuid" validate:"required"`
Name string `json:"name" validate:"required"`
DisplayName string `json:"display_name" validate:"required"`
Icon string `json:"icon" validate:"required"`
RegenerateToken bool `json:"regenerate_token"`
}
type PprofConfig struct {
Enable clibase.Bool `json:"enable" typescript:",notnull"`
Address clibase.HostPort `json:"address" typescript:",notnull"`
}
type PrometheusConfig struct {
Enable clibase.Bool `json:"enable" typescript:",notnull"`
Address clibase.HostPort `json:"address" typescript:",notnull"`
CollectAgentStats clibase.Bool `json:"collect_agent_stats" typescript:",notnull"`
CollectDBMetrics clibase.Bool `json:"collect_db_metrics" typescript:",notnull"`
}
type ProvisionerConfig struct {
Daemons clibase.Int64 `json:"daemons" typescript:",notnull"`
DaemonsEcho clibase.Bool `json:"daemons_echo" typescript:",notnull"`
DaemonPollInterval clibase.Duration `json:"daemon_poll_interval" typescript:",notnull"`
DaemonPollJitter clibase.Duration `json:"daemon_poll_jitter" typescript:",notnull"`
ForceCancelInterval clibase.Duration `json:"force_cancel_interval" typescript:",notnull"`
}
type ProvisionerDaemon struct {
ID uuid.UUID `json:"id" format:"uuid"`
CreatedAt time.Time `json:"created_at" format:"date-time"`
UpdatedAt sql.NullTime `json:"updated_at" format:"date-time"`
Name string `json:"name"`
Provisioners []ProvisionerType `json:"provisioners"`
Tags map[string]string `json:"tags"`
}
type ProvisionerJob struct {
ID uuid.UUID `json:"id" format:"uuid"`
CreatedAt time.Time `json:"created_at" format:"date-time"`
StartedAt *time.Time `json:"started_at,omitempty" format:"date-time"`
CompletedAt *time.Time `json:"completed_at,omitempty" format:"date-time"`
CanceledAt *time.Time `json:"canceled_at,omitempty" format:"date-time"`
Error string `json:"error,omitempty"`
ErrorCode JobErrorCode `json:"error_code,omitempty" enums:"MISSING_TEMPLATE_PARAMETER,REQUIRED_TEMPLATE_VARIABLES"`
Status ProvisionerJobStatus `json:"status" enums:"pending,running,succeeded,canceling,canceled,failed"`
WorkerID *uuid.UUID `json:"worker_id,omitempty" format:"uuid"`
FileID uuid.UUID `json:"file_id" format:"uuid"`
Tags map[string]string `json:"tags"`
QueuePosition int `json:"queue_position"`
QueueSize int `json:"queue_size"`
}
ProvisionerJob describes the job executed by the provisioning daemon.
type ProvisionerJobLog struct {
ID int64 `json:"id"`
CreatedAt time.Time `json:"created_at" format:"date-time"`
Source LogSource `json:"log_source"`
Level LogLevel `json:"log_level" enums:"trace,debug,info,warn,error"`
Stage string `json:"stage"`
Output string `json:"output"`
}
ProvisionerJobLog represents the provisioner log entry annotated with source and level.
type ProvisionerJobStatus string
ProvisionerJobStatus represents the at-time state of a job.
const ( ProvisionerJobPending ProvisionerJobStatus = "pending" ProvisionerJobRunning ProvisionerJobStatus = "running" ProvisionerJobSucceeded ProvisionerJobStatus = "succeeded" ProvisionerJobCanceling ProvisionerJobStatus = "canceling" ProvisionerJobCanceled ProvisionerJobStatus = "canceled" ProvisionerJobFailed ProvisionerJobStatus = "failed" )
Active returns whether the job is still active or not. It returns true if canceling as well, since the job isn't in an entirely inactive state yet.
type ProvisionerLogLevel string
const (
ProvisionerLogLevelDebug ProvisionerLogLevel = "debug"
)
type ProvisionerStorageMethod string
const (
ProvisionerStorageMethodFile ProvisionerStorageMethod = "file"
)
const ( ProvisionerTypeEcho ProvisionerType = "echo" ProvisionerTypeTerraform ProvisionerType = "terraform" )
type ProxyHealthReport struct {
Errors []string `json:"errors"`
Warnings []string `json:"warnings"`
}
ProxyHealthReport is a report of the health of the workspace proxy. A healthy report will have no errors. Warnings are not fatal.
const ( ProxyHealthy ProxyHealthStatus = "ok" ProxyUnreachable ProxyHealthStatus = "unreachable" ProxyUnhealthy ProxyHealthStatus = "unhealthy" ProxyUnregistered ProxyHealthStatus = "unregistered" )
type PutExtendWorkspaceRequest struct {
Deadline time.Time `json:"deadline" validate:"required" format:"date-time"`
}
PutExtendWorkspaceRequest is a request to extend the deadline of the active workspace build.
const ( ResourceWorkspace RBACResource = "workspace" ResourceWorkspaceProxy RBACResource = "workspace_proxy" ResourceWorkspaceExecution RBACResource = "workspace_execution" ResourceWorkspaceApplicationConnect RBACResource = "application_connect" ResourceAuditLog RBACResource = "audit_log" ResourceTemplate RBACResource = "template" ResourceGroup RBACResource = "group" ResourceFile RBACResource = "file" ResourceProvisionerDaemon RBACResource = "provisioner_daemon" ResourceOrganization RBACResource = "organization" ResourceRoleAssignment RBACResource = "assign_role" ResourceOrgRoleAssignment RBACResource = "assign_org_role" ResourceAPIKey RBACResource = "api_key" ResourceUser RBACResource = "user" ResourceUserData RBACResource = "user_data" ResourceOrganizationMember RBACResource = "organization_member" ResourceLicense RBACResource = "license" ResourceDeploymentValues RBACResource = "deployment_config" ResourceDeploymentStats RBACResource = "deployment_stats" ResourceReplicas RBACResource = "replicas" ResourceDebugInfo RBACResource = "debug_info" ResourceSystem RBACResource = "system" )
type RateLimitConfig struct {
DisableAll clibase.Bool `json:"disable_all" typescript:",notnull"`
API clibase.Int64 `json:"api" typescript:",notnull"`
}
type ReconnectingPTYRequest struct {
Data string `json:"data,omitempty"`
Height uint16 `json:"height,omitempty"`
Width uint16 `json:"width,omitempty"`
}
ReconnectingPTYRequest is sent from the client to the server to pipe data to a PTY. @typescript-ignore ReconnectingPTYRequest
type Region struct {
ID uuid.UUID `json:"id" format:"uuid" table:"id"`
Name string `json:"name" table:"name,default_sort"`
DisplayName string `json:"display_name" table:"display_name"`
IconURL string `json:"icon_url" table:"icon_url"`
Healthy bool `json:"healthy" table:"healthy"`
PathAppURL string `json:"path_app_url" table:"url"`
WildcardHostname string `json:"wildcard_hostname" table:"wildcard_hostname"`
}
type RegionTypes interface {
Region | WorkspaceProxy
}
type RegionsResponse[R RegionTypes] struct { Regions []R `json:"regions"` }
type Replica struct {
ID uuid.UUID `json:"id" format:"uuid"`
Hostname string `json:"hostname"`
CreatedAt time.Time `json:"created_at" format:"date-time"`
RelayAddress string `json:"relay_address"`
RegionID int32 `json:"region_id"`
Error string `json:"error"`
DatabaseLatency int32 `json:"database_latency"`
}
RequestOption is a function that can be used to modify an http.Request.
func WithQueryParam(key, value string) RequestOption
WithQueryParam adds a query parameter to the request.
const ( ResourceTypeTemplate ResourceType = "template" ResourceTypeTemplateVersion ResourceType = "template_version" ResourceTypeUser ResourceType = "user" ResourceTypeWorkspace ResourceType = "workspace" ResourceTypeWorkspaceBuild ResourceType = "workspace_build" ResourceTypeGitSSHKey ResourceType = "git_ssh_key" ResourceTypeAPIKey ResourceType = "api_key" ResourceTypeGroup ResourceType = "group" ResourceTypeLicense ResourceType = "license" ResourceTypeConvertLogin ResourceType = "convert_login" )
type Response struct {
Message string `json:"message"`
Detail string `json:"detail,omitempty"`
Validations []ValidationError `json:"validations,omitempty"`
}
Response represents a generic HTTP response.
SSHConfig is configuration the cli & vscode extension use for configuring ssh connections.
type SSHConfigResponse struct {
HostnamePrefix string `json:"hostname_prefix"`
SSHConfigOptions map[string]string `json:"ssh_config_options"`
}
type ServerSentEvent struct {
Type ServerSentEventType `json:"type"`
Data interface{} `json:"data"`
}
type ServerSentEventType string
const ( ServerSentEventTypePing ServerSentEventType = "ping" ServerSentEventTypeData ServerSentEventType = "data" ServerSentEventTypeError ServerSentEventType = "error" )
type ServiceBannerConfig struct {
}
type SessionCountDeploymentStats struct {
VSCode int64 `json:"vscode"`
SSH int64 `json:"ssh"`
JetBrains int64 `json:"jetbrains"`
ReconnectingPTY int64 `json:"reconnecting_pty"`
}
type SupportConfig struct {
Links clibase.Struct[[]LinkConfig] `json:"links" typescript:",notnull"`
}
type TLSConfig struct {
Enable clibase.Bool `json:"enable" typescript:",notnull"`
Address clibase.HostPort `json:"address" typescript:",notnull"`
RedirectHTTP clibase.Bool `json:"redirect_http" typescript:",notnull"`
CertFiles clibase.StringArray `json:"cert_file" typescript:",notnull"`
ClientAuth clibase.String `json:"client_auth" typescript:",notnull"`
ClientCAFile clibase.String `json:"client_ca_file" typescript:",notnull"`
KeyFiles clibase.StringArray `json:"key_file" typescript:",notnull"`
MinVersion clibase.String `json:"min_version" typescript:",notnull"`
ClientCertFile clibase.String `json:"client_cert_file" typescript:",notnull"`
ClientKeyFile clibase.String `json:"client_key_file" typescript:",notnull"`
}
type TelemetryConfig struct {
Enable clibase.Bool `json:"enable" typescript:",notnull"`
Trace clibase.Bool `json:"trace" typescript:",notnull"`
URL clibase.URL `json:"url" typescript:",notnull"`
}
type Template struct {
ID uuid.UUID `json:"id" format:"uuid"`
CreatedAt time.Time `json:"created_at" format:"date-time"`
UpdatedAt time.Time `json:"updated_at" format:"date-time"`
OrganizationID uuid.UUID `json:"organization_id" format:"uuid"`
Name string `json:"name"`
DisplayName string `json:"display_name"`
Provisioner ProvisionerType `json:"provisioner" enums:"terraform"`
ActiveVersionID uuid.UUID `json:"active_version_id" format:"uuid"`
ActiveUserCount int `json:"active_user_count"`
BuildTimeStats TemplateBuildTimeStats `json:"build_time_stats"`
Description string `json:"description"`
Icon string `json:"icon"`
DefaultTTLMillis int64 `json:"default_ttl_ms"`
MaxTTLMillis int64 `json:"max_ttl_ms"`
RestartRequirement TemplateRestartRequirement `json:"restart_requirement"`
CreatedByID uuid.UUID `json:"created_by_id" format:"uuid"`
CreatedByName string `json:"created_by_name"`
AllowUserAutostart bool `json:"allow_user_autostart"`
AllowUserAutostop bool `json:"allow_user_autostop"`
AllowUserCancelWorkspaceJobs bool `json:"allow_user_cancel_workspace_jobs"`
FailureTTLMillis int64 `json:"failure_ttl_ms"`
InactivityTTLMillis int64 `json:"inactivity_ttl_ms"`
LockedTTLMillis int64 `json:"locked_ttl_ms"`
}
Template is the JSON representation of a Coder template. This type matches the database object for now, but is abstracted for ease of change later on.
type TemplateACL struct {
Users []TemplateUser `json:"users"`
Groups []TemplateGroup `json:"group"`
}
type TemplateAppUsage struct {
TemplateIDs []uuid.UUID `json:"template_ids" format:"uuid"`
Type TemplateAppsType `json:"type" example:"builtin"`
DisplayName string `json:"display_name" example:"Visual Studio Code"`
Slug string `json:"slug" example:"vscode"`
Icon string `json:"icon"`
Seconds int64 `json:"seconds" example:"80500"`
}
TemplateAppUsage shows the usage of an app for one or more templates.
TemplateAppsType defines the type of app reported.
const (
TemplateAppsTypeBuiltin TemplateAppsType = "builtin"
)
TemplateAppsType enums.
type TemplateBuildTimeStats map[WorkspaceTransition]TransitionStats
type TemplateExample struct {
ID string `json:"id" format:"uuid"`
URL string `json:"url"`
Name string `json:"name"`
Description string `json:"description"`
Icon string `json:"icon"`
Tags []string `json:"tags"`
Markdown string `json:"markdown"`
}
type TemplateGroup struct {
Group
Role TemplateRole `json:"role" enums:"admin,use"`
}
type TemplateInsightsIntervalReport struct {
StartTime time.Time `json:"start_time" format:"date-time"`
EndTime time.Time `json:"end_time" format:"date-time"`
TemplateIDs []uuid.UUID `json:"template_ids" format:"uuid"`
Interval InsightsReportInterval `json:"interval"`
ActiveUsers int64 `json:"active_users" example:"14"`
}
TemplateInsightsIntervalReport is the report from the template insights endpoint for a specific interval.
type TemplateInsightsReport struct {
StartTime time.Time `json:"start_time" format:"date-time"`
EndTime time.Time `json:"end_time" format:"date-time"`
TemplateIDs []uuid.UUID `json:"template_ids" format:"uuid"`
ActiveUsers int64 `json:"active_users" example:"22"`
AppsUsage []TemplateAppUsage `json:"apps_usage"`
}
TemplateInsightsReport is the report from the template insights endpoint.
type TemplateInsightsRequest struct {
StartTime time.Time `json:"start_time" format:"date-time"`
EndTime time.Time `json:"end_time" format:"date-time"`
TemplateIDs []uuid.UUID `json:"template_ids" format:"uuid"`
Interval InsightsReportInterval `json:"interval"`
}
type TemplateInsightsResponse struct {
Report TemplateInsightsReport `json:"report"`
IntervalReports []TemplateInsightsIntervalReport `json:"interval_reports"`
}
TemplateInsightsResponse is the response from the template insights endpoint.
type TemplateRestartRequirement struct {
DaysOfWeek []string `json:"days_of_week" enums:"monday,tuesday,wednesday,thursday,friday,saturday,sunday"`
Weeks int64 `json:"weeks"`
}
const ( TemplateRoleAdmin TemplateRole = "admin" TemplateRoleUse TemplateRole = "use" TemplateRoleDeleted TemplateRole = "" )
type TemplateUser struct {
User
Role TemplateRole `json:"role" enums:"admin,use"`
}
type TemplateVersion struct {
ID uuid.UUID `json:"id" format:"uuid"`
TemplateID *uuid.UUID `json:"template_id,omitempty" format:"uuid"`
OrganizationID uuid.UUID `json:"organization_id,omitempty" format:"uuid"`
CreatedAt time.Time `json:"created_at" format:"date-time"`
UpdatedAt time.Time `json:"updated_at" format:"date-time"`
Name string `json:"name"`
Message string `json:"message"`
Job ProvisionerJob `json:"job"`
Readme string `json:"readme"`
CreatedBy User `json:"created_by"`
Warnings []TemplateVersionWarning `json:"warnings,omitempty" enums:"DEPRECATED_PARAMETERS"`
}
TemplateVersion represents a single version of a template.
type TemplateVersionGitAuth struct {
ID string `json:"id"`
Type GitProvider `json:"type"`
AuthenticateURL string `json:"authenticate_url"`
Authenticated bool `json:"authenticated"`
}
type TemplateVersionParameter struct {
Name string `json:"name"`
DisplayName string `json:"display_name,omitempty"`
Description string `json:"description"`
DescriptionPlaintext string `json:"description_plaintext"`
Type string `json:"type" enums:"string,number,bool,list(string)"`
Mutable bool `json:"mutable"`
DefaultValue string `json:"default_value"`
Icon string `json:"icon"`
Options []TemplateVersionParameterOption `json:"options"`
ValidationError string `json:"validation_error,omitempty"`
ValidationRegex string `json:"validation_regex,omitempty"`
ValidationMin *int32 `json:"validation_min,omitempty"`
ValidationMax *int32 `json:"validation_max,omitempty"`
ValidationMonotonic ValidationMonotonicOrder `json:"validation_monotonic,omitempty" enums:"increasing,decreasing"`
Required bool `json:"required"`
Ephemeral bool `json:"ephemeral"`
}
TemplateVersionParameter represents a parameter for a template version.
type TemplateVersionParameterOption struct {
Name string `json:"name"`
Description string `json:"description"`
Value string `json:"value"`
Icon string `json:"icon"`
}
TemplateVersionParameterOption represents a selectable option for a template parameter.
type TemplateVersionVariable struct {
Name string `json:"name"`
Description string `json:"description"`
Type string `json:"type" enums:"string,number,bool"`
Value string `json:"value"`
DefaultValue string `json:"default_value"`
Required bool `json:"required"`
Sensitive bool `json:"sensitive"`
}
TemplateVersionVariable represents a managed template variable.
type TemplateVersionWarning string
const (
TemplateVersionWarningUnsupportedWorkspaces TemplateVersionWarning = "UNSUPPORTED_WORKSPACES"
)
type TemplateVersionsByTemplateRequest struct {
TemplateID uuid.UUID `json:"template_id" validate:"required" format:"uuid"`
}
TemplateVersionsByTemplateRequest defines the request parameters for TemplateVersionsByTemplate.
type TokensFilter struct {
IncludeAll bool `json:"include_all"`
}
type TraceConfig struct {
Enable clibase.Bool `json:"enable" typescript:",notnull"`
HoneycombAPIKey clibase.String `json:"honeycomb_api_key" typescript:",notnull"`
CaptureLogs clibase.Bool `json:"capture_logs" typescript:",notnull"`
}
type UpdateActiveTemplateVersion struct {
ID uuid.UUID `json:"id" validate:"required" format:"uuid"`
}
type UpdateAppearanceConfig struct {
LogoURL string `json:"logo_url"`
}
type UpdateCheckResponse struct {
Current bool `json:"current"`
Version string `json:"version"`
URL string `json:"url"`
}
UpdateCheckResponse contains information on the latest release of Coder.
type UpdateRoles struct {
Roles []string `json:"roles" validate:""`
}
type UpdateTemplateACL struct {
UserPerms map[string]TemplateRole `json:"user_perms,omitempty" example:"<group_id>:admin,4df59e74-c027-470b-ab4d-cbba8963a5e9:use"`
GroupPerms map[string]TemplateRole `json:"group_perms,omitempty" example:"<user_id>>:admin,8bd26b20-f3e8-48be-a903-46bb920cf671:use"`
}
type UpdateTemplateMeta struct {
Name string `json:"name,omitempty" validate:"omitempty,template_name"`
DisplayName string `json:"display_name,omitempty" validate:"omitempty,template_display_name"`
Description string `json:"description,omitempty"`
Icon string `json:"icon,omitempty"`
DefaultTTLMillis int64 `json:"default_ttl_ms,omitempty"`
MaxTTLMillis int64 `json:"max_ttl_ms,omitempty"`
RestartRequirement *TemplateRestartRequirement `json:"restart_requirement,omitempty"`
AllowUserAutostart bool `json:"allow_user_autostart,omitempty"`
AllowUserAutostop bool `json:"allow_user_autostop,omitempty"`
AllowUserCancelWorkspaceJobs bool `json:"allow_user_cancel_workspace_jobs,omitempty"`
FailureTTLMillis int64 `json:"failure_ttl_ms,omitempty"`
InactivityTTLMillis int64 `json:"inactivity_ttl_ms,omitempty"`
LockedTTLMillis int64 `json:"locked_ttl_ms,omitempty"`
}
type UpdateUserPasswordRequest struct {
OldPassword string `json:"old_password" validate:""`
Password string `json:"password" validate:"required"`
}
type UpdateUserProfileRequest struct {
Username string `json:"username" validate:"required,username"`
}
type UpdateUserQuietHoursScheduleRequest struct {
Schedule string `json:"schedule" validate:"required"`
}
type UpdateWorkspaceAutostartRequest struct {
Schedule *string `json:"schedule"`
}
UpdateWorkspaceAutostartRequest is a request to update a workspace's autostart schedule.
type UpdateWorkspaceLock struct {
Lock bool `json:"lock"`
}
UpdateWorkspaceLock is a request to lock or unlock a workspace.
type UpdateWorkspaceProxyResponse struct {
Proxy WorkspaceProxy `json:"proxy" table:"proxy,recursive"`
ProxyToken string `json:"proxy_token" table:"proxy token,default_sort"`
}
type UpdateWorkspaceRequest struct {
Name string `json:"name,omitempty" validate:"username"`
}
type UpdateWorkspaceTTLRequest struct {
TTLMillis *int64 `json:"ttl_ms"`
}
UpdateWorkspaceTTLRequest is a request to update a workspace's TTL.
UploadResponse contains the hash to reference the uploaded file.
type User struct {
ID uuid.UUID `json:"id" validate:"required" table:"id" format:"uuid"`
Username string `json:"username" validate:"required" table:"username,default_sort"`
Email string `json:"email" validate:"required" table:"email" format:"email"`
CreatedAt time.Time `json:"created_at" validate:"required" table:"created at" format:"date-time"`
LastSeenAt time.Time `json:"last_seen_at" format:"date-time"`
Status UserStatus `json:"status" table:"status" enums:"active,suspended"`
OrganizationIDs []uuid.UUID `json:"organization_ids" format:"uuid"`
Roles []Role `json:"roles"`
AvatarURL string `json:"avatar_url" format:"uri"`
}
User represents a user in Coder.
type UserLatency struct {
TemplateIDs []uuid.UUID `json:"template_ids" format:"uuid"`
UserID uuid.UUID `json:"user_id" format:"uuid"`
Username string `json:"username"`
LatencyMS ConnectionLatency `json:"latency_ms"`
}
UserLatency shows the connection latency for a user.
type UserLatencyInsightsReport struct {
StartTime time.Time `json:"start_time" format:"date-time"`
EndTime time.Time `json:"end_time" format:"date-time"`
TemplateIDs []uuid.UUID `json:"template_ids" format:"uuid"`
Users []UserLatency `json:"users"`
}
UserLatencyInsightsReport is the report from the user latency insights endpoint.
type UserLatencyInsightsRequest struct {
StartTime time.Time `json:"start_time" format:"date-time"`
EndTime time.Time `json:"end_time" format:"date-time"`
TemplateIDs []uuid.UUID `json:"template_ids" format:"uuid"`
}
type UserLatencyInsightsResponse struct {
Report UserLatencyInsightsReport `json:"report"`
}
UserLatencyInsightsResponse is the response from the user latency insights endpoint.
type UserLoginType struct {
LoginType LoginType `json:"login_type"`
}
type UserQuietHoursScheduleConfig struct {
}
type UserQuietHoursScheduleResponse struct {
UserSet bool `json:"user_set"`
Next time.Time `json:"next" format:"date-time"`
}
type UserRoles struct {
Roles []string `json:"roles"`
OrganizationRoles map[uuid.UUID][]string `json:"organization_roles"`
}
const ( UserStatusActive UserStatus = "active" UserStatusSuspended UserStatus = "suspended" )
type UsersRequest struct {
Search string `json:"search,omitempty" typescript:"-"`
Status UserStatus `json:"status,omitempty" typescript:"-"`
Role string `json:"role,omitempty" typescript:"-"`
SearchQuery string `json:"q,omitempty"`
}
type ValidationError struct {
Field string `json:"field" validate:"required"`
Detail string `json:"detail" validate:"required"`
}
ValidationError represents a scoped error to a user input.
type ValidationMonotonicOrder string
const ( MonotonicOrderIncreasing ValidationMonotonicOrder = "increasing" MonotonicOrderDecreasing ValidationMonotonicOrder = "decreasing" )
type Workspace struct {
ID uuid.UUID `json:"id" format:"uuid"`
CreatedAt time.Time `json:"created_at" format:"date-time"`
UpdatedAt time.Time `json:"updated_at" format:"date-time"`
OwnerID uuid.UUID `json:"owner_id" format:"uuid"`
OwnerName string `json:"owner_name"`
OrganizationID uuid.UUID `json:"organization_id" format:"uuid"`
TemplateID uuid.UUID `json:"template_id" format:"uuid"`
TemplateName string `json:"template_name"`
TemplateDisplayName string `json:"template_display_name"`
TemplateIcon string `json:"template_icon"`
TemplateAllowUserCancelWorkspaceJobs bool `json:"template_allow_user_cancel_workspace_jobs"`
LatestBuild WorkspaceBuild `json:"latest_build"`
Outdated bool `json:"outdated"`
Name string `json:"name"`
AutostartSchedule *string `json:"autostart_schedule,omitempty"`
TTLMillis *int64 `json:"ttl_ms,omitempty"`
LastUsedAt time.Time `json:"last_used_at" format:"date-time"`
DeletingAt *time.Time `json:"deleting_at" format:"date-time"`
LockedAt *time.Time `json:"locked_at" format:"date-time"`
Health WorkspaceHealth `json:"health"`
}
Workspace is a deployment of a template. It references a specific version and can be updated.
type WorkspaceAgent struct {
ID uuid.UUID `json:"id" format:"uuid"`
CreatedAt time.Time `json:"created_at" format:"date-time"`
UpdatedAt time.Time `json:"updated_at" format:"date-time"`
FirstConnectedAt *time.Time `json:"first_connected_at,omitempty" format:"date-time"`
LastConnectedAt *time.Time `json:"last_connected_at,omitempty" format:"date-time"`
DisconnectedAt *time.Time `json:"disconnected_at,omitempty" format:"date-time"`
StartedAt *time.Time `json:"started_at,omitempty" format:"date-time"`
ReadyAt *time.Time `json:"ready_at,omitempty" format:"date-time"`
Status WorkspaceAgentStatus `json:"status"`
LifecycleState WorkspaceAgentLifecycle `json:"lifecycle_state"`
Name string `json:"name"`
ResourceID uuid.UUID `json:"resource_id" format:"uuid"`
InstanceID string `json:"instance_id,omitempty"`
Architecture string `json:"architecture"`
EnvironmentVariables map[string]string `json:"environment_variables"`
OperatingSystem string `json:"operating_system"`
StartupScript string `json:"startup_script,omitempty"`
StartupScriptBehavior WorkspaceAgentStartupScriptBehavior `json:"startup_script_behavior"`
StartupScriptTimeoutSeconds int32 `json:"startup_script_timeout_seconds"`
StartupLogsLength int32 `json:"startup_logs_length"`
StartupLogsOverflowed bool `json:"startup_logs_overflowed"`
Directory string `json:"directory,omitempty"`
ExpandedDirectory string `json:"expanded_directory,omitempty"`
Version string `json:"version"`
Apps []WorkspaceApp `json:"apps"`
DERPLatency map[string]DERPRegion `json:"latency,omitempty"`
ConnectionTimeoutSeconds int32 `json:"connection_timeout_seconds"`
TroubleshootingURL string `json:"troubleshooting_url"`
LoginBeforeReady bool `json:"login_before_ready"`
ShutdownScript string `json:"shutdown_script,omitempty"`
ShutdownScriptTimeoutSeconds int32 `json:"shutdown_script_timeout_seconds"`
Subsystem AgentSubsystem `json:"subsystem"`
Health WorkspaceAgentHealth `json:"health"`
}
WorkspaceAgentConn represents a connection to a workspace agent. @typescript-ignore WorkspaceAgentConn
NewWorkspaceAgentConn creates a new WorkspaceAgentConn. `conn` may be unique to the WorkspaceAgentConn, or it may be shared in the case of coderd. If the conn is shared and closing it is undesirable, you may return ErrNoClose from opts.CloseFunc. This will ensure the underlying conn is not closed.
AwaitReachable waits for the agent to be reachable.
Close ends the connection to the workspace agent.
DialContext dials the address provided in the workspace agent. The network must be "tcp" or "udp".
ListeningPorts lists the ports that are currently in use by the workspace.
Ping pings the agent and returns the round-trip time. The bool returns true if the ping was made P2P.
ReconnectingPTY spawns a new reconnecting terminal session. `ReconnectingPTYRequest` should be JSON marshaled and written to the returned net.Conn. Raw terminal output will be read from the returned net.Conn.
SSH pipes the SSH protocol over the returned net.Conn. This connects to the built-in SSH server in the workspace agent.
SSHClient calls SSH to create a client that uses a weak cipher to improve throughput.
Speedtest runs a speedtest against the workspace agent.
@typescript-ignore WorkspaceAgentConnOptions
type WorkspaceAgentConnectionInfo struct {
DERPMap *tailcfg.DERPMap `json:"derp_map"`
DisableDirectConnections bool `json:"disable_direct_connections"`
}
WorkspaceAgentConnectionInfo returns required information for establishing a connection with a workspace. @typescript-ignore WorkspaceAgentConnectionInfo
type WorkspaceAgentHealth struct {
Healthy bool `json:"healthy" example:"false"`
Reason string `json:"reason,omitempty" example:"agent has lost connection"`
}
type WorkspaceAgentLifecycle string
WorkspaceAgentLifecycle represents the lifecycle state of a workspace agent.
The agent lifecycle starts in the "created" state, and transitions to "starting" when the agent reports it has begun preparing (e.g. started executing the startup script).
const ( WorkspaceAgentLifecycleCreated WorkspaceAgentLifecycle = "created" WorkspaceAgentLifecycleStarting WorkspaceAgentLifecycle = "starting" WorkspaceAgentLifecycleStartTimeout WorkspaceAgentLifecycle = "start_timeout" WorkspaceAgentLifecycleStartError WorkspaceAgentLifecycle = "start_error" WorkspaceAgentLifecycleReady WorkspaceAgentLifecycle = "ready" WorkspaceAgentLifecycleShuttingDown WorkspaceAgentLifecycle = "shutting_down" WorkspaceAgentLifecycleShutdownTimeout WorkspaceAgentLifecycle = "shutdown_timeout" WorkspaceAgentLifecycleShutdownError WorkspaceAgentLifecycle = "shutdown_error" WorkspaceAgentLifecycleOff WorkspaceAgentLifecycle = "off" )
WorkspaceAgentLifecycle enums.
ShuttingDown returns true if the agent is in the process of shutting down or has shut down.
Starting returns true if the agent is in the process of starting.
type WorkspaceAgentListeningPort struct {
ProcessName string `json:"process_name"`
Network string `json:"network"`
Port uint16 `json:"port"`
}
type WorkspaceAgentListeningPortsResponse struct {
Ports []WorkspaceAgentListeningPort `json:"ports"`
}
type WorkspaceAgentMetadata struct {
Result WorkspaceAgentMetadataResult `json:"result"`
Description WorkspaceAgentMetadataDescription `json:"description"`
}
type WorkspaceAgentMetadataDescription struct {
DisplayName string `json:"display_name"`
Key string `json:"key"`
Script string `json:"script"`
Interval int64 `json:"interval"`
Timeout int64 `json:"timeout"`
}
WorkspaceAgentMetadataDescription is a description of dynamic metadata the agent should report back to coderd. It is provided via the `metadata` list in the `coder_agent` block.
type WorkspaceAgentMetadataResult struct {
CollectedAt time.Time `json:"collected_at" format:"date-time"`
Age int64 `json:"age"`
Value string `json:"value"`
Error string `json:"error"`
}
WorkspaceAgentReconnectingPTYInit initializes a new reconnecting PTY session. @typescript-ignore WorkspaceAgentReconnectingPTYInit
@typescript-ignore:WorkspaceAgentReconnectingPTYOpts
type WorkspaceAgentStartupLog struct {
ID int64 `json:"id"`
CreatedAt time.Time `json:"created_at" format:"date-time"`
Output string `json:"output"`
Level LogLevel `json:"level"`
}
type WorkspaceAgentStartupScriptBehavior string
WorkspaceAgentStartupScriptBehavior defines whether or not the startup script should be considered blocking or non-blocking. The blocking behavior means that the agent will not be considered ready until the startup script has completed and, for example, SSH connections will wait for the agent to be ready (can be overridden).
Presently, non-blocking is the default, but this may change in the future.
const ( WorkspaceAgentStartupScriptBehaviorBlocking WorkspaceAgentStartupScriptBehavior = "blocking" WorkspaceAgentStartupScriptBehaviorNonBlocking WorkspaceAgentStartupScriptBehavior = "non-blocking" )
type WorkspaceAgentStatus string
const ( WorkspaceAgentConnecting WorkspaceAgentStatus = "connecting" WorkspaceAgentConnected WorkspaceAgentStatus = "connected" WorkspaceAgentDisconnected WorkspaceAgentStatus = "disconnected" WorkspaceAgentTimeout WorkspaceAgentStatus = "timeout" )
This is also in database/modelmethods.go and should be kept in sync.
type WorkspaceApp struct {
ID uuid.UUID `json:"id" format:"uuid"`
URL string `json:"url"`
External bool `json:"external"`
Slug string `json:"slug"`
DisplayName string `json:"display_name"`
Command string `json:"command,omitempty"`
Icon string `json:"icon,omitempty"`
Subdomain bool `json:"subdomain"`
SharingLevel WorkspaceAppSharingLevel `json:"sharing_level" enums:"owner,authenticated,public"`
Healthcheck Healthcheck `json:"healthcheck"`
Health WorkspaceAppHealth `json:"health"`
}
type WorkspaceAppHealth string
const ( WorkspaceAppHealthDisabled WorkspaceAppHealth = "disabled" WorkspaceAppHealthInitializing WorkspaceAppHealth = "initializing" WorkspaceAppHealthHealthy WorkspaceAppHealth = "healthy" WorkspaceAppHealthUnhealthy WorkspaceAppHealth = "unhealthy" )
type WorkspaceAppSharingLevel string
const ( WorkspaceAppSharingLevelOwner WorkspaceAppSharingLevel = "owner" WorkspaceAppSharingLevelAuthenticated WorkspaceAppSharingLevel = "authenticated" WorkspaceAppSharingLevelPublic WorkspaceAppSharingLevel = "public" )
type WorkspaceBuild struct {
ID uuid.UUID `json:"id" format:"uuid"`
CreatedAt time.Time `json:"created_at" format:"date-time"`
UpdatedAt time.Time `json:"updated_at" format:"date-time"`
WorkspaceID uuid.UUID `json:"workspace_id" format:"uuid"`
WorkspaceName string `json:"workspace_name"`
WorkspaceOwnerID uuid.UUID `json:"workspace_owner_id" format:"uuid"`
WorkspaceOwnerName string `json:"workspace_owner_name"`
TemplateVersionID uuid.UUID `json:"template_version_id" format:"uuid"`
TemplateVersionName string `json:"template_version_name"`
BuildNumber int32 `json:"build_number"`
Transition WorkspaceTransition `json:"transition" enums:"start,stop,delete"`
InitiatorID uuid.UUID `json:"initiator_id" format:"uuid"`
InitiatorUsername string `json:"initiator_name"`
Job ProvisionerJob `json:"job"`
Reason BuildReason `db:"reason" json:"reason" enums:"initiator,autostart,autostop"`
Resources []WorkspaceResource `json:"resources"`
Deadline NullTime `json:"deadline,omitempty" format:"date-time"`
MaxDeadline NullTime `json:"max_deadline,omitempty" format:"date-time"`
Status WorkspaceStatus `json:"status" enums:"pending,starting,running,stopping,stopped,failed,canceling,canceled,deleting,deleted"`
DailyCost int32 `json:"daily_cost"`
}
WorkspaceBuild is an at-point representation of a workspace state. BuildNumbers start at 1 and increase by 1 for each subsequent build
WorkspaceBuildParameter represents a parameter specific for a workspace build.
type WorkspaceDeploymentStats struct {
Pending int64 `json:"pending"`
Building int64 `json:"building"`
Running int64 `json:"running"`
Failed int64 `json:"failed"`
Stopped int64 `json:"stopped"`
ConnectionLatencyMS WorkspaceConnectionLatencyMS `json:"connection_latency_ms"`
RxBytes int64 `json:"rx_bytes"`
TxBytes int64 `json:"tx_bytes"`
}
type WorkspaceFilter struct {
Owner string `json:"owner,omitempty" typescript:"-"`
Template string `json:"template,omitempty" typescript:"-"`
Name string `json:"name,omitempty" typescript:"-"`
Status string `json:"status,omitempty" typescript:"-"`
Offset int `json:"offset,omitempty" typescript:"-"`
Limit int `json:"limit,omitempty" typescript:"-"`
FilterQuery string `json:"q,omitempty"`
}
type WorkspaceHealth struct {
Healthy bool `json:"healthy" example:"false"`
FailingAgents []uuid.UUID `json:"failing_agents" format:"uuid"`
}
type WorkspaceOptions struct {
IncludeDeleted bool `json:"include_deleted,omitempty"`
}
type WorkspaceProxy struct {
Region `table:"region,recursive_inline"`
Status WorkspaceProxyStatus `json:"status,omitempty" table:"proxy,recursive"`
CreatedAt time.Time `json:"created_at" format:"date-time" table:"created_at,default_sort"`
UpdatedAt time.Time `json:"updated_at" format:"date-time" table:"updated_at"`
Deleted bool `json:"deleted" table:"deleted"`
}
type WorkspaceProxyBuildInfo struct {
WorkspaceProxy bool `json:"workspace_proxy"`
DashboardURL string `json:"dashboard_url"`
}
type WorkspaceProxyStatus struct {
Status ProxyHealthStatus `json:"status" table:"status,default_sort"`
Report ProxyHealthReport `json:"report,omitempty" table:"report"`
CheckedAt time.Time `json:"checked_at" table:"checked_at" format:"date-time"`
}
type WorkspaceQuota struct {
CreditsConsumed int `json:"credits_consumed"`
Budget int `json:"budget"`
}
type WorkspaceResource struct {
ID uuid.UUID `json:"id" format:"uuid"`
CreatedAt time.Time `json:"created_at" format:"date-time"`
JobID uuid.UUID `json:"job_id" format:"uuid"`
Transition WorkspaceTransition `json:"workspace_transition" enums:"start,stop,delete"`
Type string `json:"type"`
Name string `json:"name"`
Hide bool `json:"hide"`
Icon string `json:"icon"`
Agents []WorkspaceAgent `json:"agents,omitempty"`
Metadata []WorkspaceResourceMetadata `json:"metadata,omitempty"`
DailyCost int32 `json:"daily_cost"`
}
WorkspaceResource describes resources used to create a workspace, for instance: containers, images, volumes.
type WorkspaceResourceMetadata struct {
Key string `json:"key"`
Value string `json:"value"`
Sensitive bool `json:"sensitive"`
}
WorkspaceResourceMetadata annotates the workspace resource with custom key-value pairs.
const ( WorkspaceStatusPending WorkspaceStatus = "pending" WorkspaceStatusStarting WorkspaceStatus = "starting" WorkspaceStatusRunning WorkspaceStatus = "running" WorkspaceStatusStopping WorkspaceStatus = "stopping" WorkspaceStatusStopped WorkspaceStatus = "stopped" WorkspaceStatusFailed WorkspaceStatus = "failed" WorkspaceStatusCanceling WorkspaceStatus = "canceling" WorkspaceStatusCanceled WorkspaceStatus = "canceled" WorkspaceStatusDeleting WorkspaceStatus = "deleting" WorkspaceStatusDeleted WorkspaceStatus = "deleted" )
type WorkspaceTransition string
const ( WorkspaceTransitionStart WorkspaceTransition = "start" WorkspaceTransitionStop WorkspaceTransition = "stop" WorkspaceTransitionDelete WorkspaceTransition = "delete" )
type WorkspacesRequest struct {
SearchQuery string `json:"q,omitempty"`
}