mirror of
https://github.com/coder/coder.git
synced 2025-07-09 11:45:56 +00:00
feat: change template max_ttl to default_ttl (#4843)
This commit is contained in:
@ -66,14 +66,9 @@ type CreateTemplateRequest struct {
|
||||
VersionID uuid.UUID `json:"template_version_id" validate:"required"`
|
||||
ParameterValues []CreateParameterRequest `json:"parameter_values,omitempty"`
|
||||
|
||||
// MaxTTLMillis allows optionally specifying the maximum allowable TTL
|
||||
// DefaultTTLMillis allows optionally specifying the default TTL
|
||||
// for all workspaces created from this template.
|
||||
MaxTTLMillis *int64 `json:"max_ttl_ms,omitempty"`
|
||||
|
||||
// MinAutostartIntervalMillis allows optionally specifying the minimum
|
||||
// allowable duration between autostarts for all workspaces created from
|
||||
// this template.
|
||||
MinAutostartIntervalMillis *int64 `json:"min_autostart_interval_ms,omitempty"`
|
||||
DefaultTTLMillis *int64 `json:"default_ttl_ms,omitempty"`
|
||||
}
|
||||
|
||||
// CreateWorkspaceRequest provides options for creating a new workspace.
|
||||
|
@ -23,14 +23,13 @@ type Template struct {
|
||||
ActiveVersionID uuid.UUID `json:"active_version_id"`
|
||||
WorkspaceOwnerCount uint32 `json:"workspace_owner_count"`
|
||||
// ActiveUserCount is set to -1 when loading.
|
||||
ActiveUserCount int `json:"active_user_count"`
|
||||
BuildTimeStats TemplateBuildTimeStats `json:"build_time_stats"`
|
||||
Description string `json:"description"`
|
||||
Icon string `json:"icon"`
|
||||
MaxTTLMillis int64 `json:"max_ttl_ms"`
|
||||
MinAutostartIntervalMillis int64 `json:"min_autostart_interval_ms"`
|
||||
CreatedByID uuid.UUID `json:"created_by_id"`
|
||||
CreatedByName string `json:"created_by_name"`
|
||||
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"`
|
||||
CreatedByID uuid.UUID `json:"created_by_id"`
|
||||
CreatedByName string `json:"created_by_name"`
|
||||
}
|
||||
|
||||
type TemplateBuildTimeStats struct {
|
||||
@ -72,11 +71,10 @@ type UpdateTemplateACL struct {
|
||||
}
|
||||
|
||||
type UpdateTemplateMeta struct {
|
||||
Name string `json:"name,omitempty" validate:"omitempty,username"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Icon string `json:"icon,omitempty"`
|
||||
MaxTTLMillis int64 `json:"max_ttl_ms,omitempty"`
|
||||
MinAutostartIntervalMillis int64 `json:"min_autostart_interval_ms,omitempty"`
|
||||
Name string `json:"name,omitempty" validate:"omitempty,username"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Icon string `json:"icon,omitempty"`
|
||||
DefaultTTLMillis int64 `json:"default_ttl_ms,omitempty"`
|
||||
}
|
||||
|
||||
// Template returns a single template.
|
||||
|
Reference in New Issue
Block a user