mirror of
https://github.com/coder/coder.git
synced 2025-07-09 11:45:56 +00:00
feat: allow disabling autostart and custom autostop for template (#6933)
API only, frontend in upcoming PR.
This commit is contained in:
@ -95,6 +95,17 @@ type CreateTemplateRequest struct {
|
||||
// Allow users to cancel in-progress workspace jobs.
|
||||
// *bool as the default value is "true".
|
||||
AllowUserCancelWorkspaceJobs *bool `json:"allow_user_cancel_workspace_jobs"`
|
||||
|
||||
// AllowUserAutostart allows users to set a schedule for autostarting their
|
||||
// workspace. By default this is true. This can only be disabled when using
|
||||
// an enterprise license.
|
||||
AllowUserAutostart *bool `json:"allow_user_autostart"`
|
||||
|
||||
// AllowUserAutostop allows users to set a custom workspace TTL to use in
|
||||
// place of the template's DefaultTTL field. By default this is true. If
|
||||
// false, the DefaultTTL will always be used. This can only be disabled when
|
||||
// using an enterprise license.
|
||||
AllowUserAutostop *bool `json:"allow_user_autostop"`
|
||||
}
|
||||
|
||||
// CreateWorkspaceRequest provides options for creating a new workspace.
|
||||
|
@ -34,6 +34,11 @@ type Template struct {
|
||||
CreatedByID uuid.UUID `json:"created_by_id" format:"uuid"`
|
||||
CreatedByName string `json:"created_by_name"`
|
||||
|
||||
// AllowUserAutostart and AllowUserAutostop are enterprise-only. Their
|
||||
// values are only used if your license is entitled to use the advanced
|
||||
// template scheduling feature.
|
||||
AllowUserAutostart bool `json:"allow_user_autostart"`
|
||||
AllowUserAutostop bool `json:"allow_user_autostop"`
|
||||
AllowUserCancelWorkspaceJobs bool `json:"allow_user_cancel_workspace_jobs"`
|
||||
}
|
||||
|
||||
@ -87,6 +92,8 @@ type UpdateTemplateMeta struct {
|
||||
// template scheduling feature. If you attempt to set this value while
|
||||
// unlicensed, it will be ignored.
|
||||
MaxTTLMillis int64 `json:"max_ttl_ms,omitempty"`
|
||||
AllowUserAutostart bool `json:"allow_user_autostart,omitempty"`
|
||||
AllowUserAutostop bool `json:"allow_user_autostop,omitempty"`
|
||||
AllowUserCancelWorkspaceJobs bool `json:"allow_user_cancel_workspace_jobs,omitempty"`
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user