You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
validErrs=append(validErrs, codersdk.ValidationError{Field: "default_ttl_ms", Detail: "Must be a positive integer."})
230
+
}
231
+
ifmaxTTL<0 {
232
+
validErrs=append(validErrs, codersdk.ValidationError{Field: "max_ttl_ms", Detail: "Must be a positive integer."})
233
+
}
234
+
ifmaxTTL!=0&&defaultTTL>maxTTL {
235
+
validErrs=append(validErrs, codersdk.ValidationError{Field: "default_ttl_ms", Detail: "Must be less than or equal to max_ttl_ms if max_ttl_ms is set."})
validErrs=append(validErrs, codersdk.ValidationError{Field: "default_ttl_ms", Detail: "Must be less than or equal to max_ttl_ms if max_ttl_ms is set."})
Copy file name to clipboardExpand all lines: docs/api/schemas.md
+2
Original file line number
Diff line number
Diff line change
@@ -953,6 +953,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a
953
953
"description": "string",
954
954
"display_name": "string",
955
955
"icon": "string",
956
+
"max_ttl_ms": 0,
956
957
"name": "string",
957
958
"parameter_values": [
958
959
{
@@ -976,6 +977,7 @@ CreateParameterRequest is a structure used to create a new parameter value for a
976
977
|`description`| string | false || Description is a description of what the template contains. It must be less than 128 bytes. |
977
978
|`display_name`| string | false || Display name is the displayed name of the template. |
978
979
|`icon`| string | false || Icon is a relative path or external URL that specifies an icon to be displayed in the dashboard. |
980
+
|`max_ttl_ms`| integer | false || Max ttl ms allows optionally specifying the max lifetime for workspaces created from this template. |
979
981
|`name`| string | true || Name is the name of the template. |
980
982
|`parameter_values`| array of [codersdk.CreateParameterRequest](#codersdkcreateparameterrequest)| false || Parameter values is a structure used to create a new parameter value for a scope.]|
981
983
|`template_version_id`| string | true || Template version ID is an in-progress or completed job to use as an initial version of the template. |
Copy file name to clipboardExpand all lines: site/src/i18n/en/templateSettingsPage.json
+7-3
Original file line number
Diff line number
Diff line change
@@ -5,14 +5,18 @@
5
5
"descriptionLabel": "Description",
6
6
"descriptionMaxError": "Please enter a description that is less than or equal to 128 characters.",
7
7
"defaultTtlLabel": "Auto-stop default",
8
+
"maxTtlLabel": "Maximum lifetime for started workspaces",
8
9
"iconLabel": "Icon",
9
10
"formAriaLabel": "Template settings form",
10
11
"selectEmoji": "Select emoji",
11
12
"ttlMaxError": "Please enter a limit that is less than or equal to 168 hours (7 days).",
12
13
"ttlMinError": "Default time until auto-stop must not be less than 0.",
13
-
"ttlHelperText_zero": "Workspaces created from this template will run until stopped manually.",
14
-
"ttlHelperText_one": "Workspaces created from this template will default to stopping after {{count}} hour.",
15
-
"ttlHelperText_other": "Workspaces created from this template will default to stopping after {{count}} hours.",
14
+
"defaultTTLHelperText_zero": "Workspaces created from this template will run until stopped manually.",
15
+
"defaultTTLHelperText_one": "Workspaces created from this template will default to stopping after {{count}} hour.",
16
+
"defaultTTLHelperText_other": "Workspaces created from this template will default to stopping after {{count}} hours.",
17
+
"maxTTLHelperText_zero": "Workspaces created from this template may run indefinitely.",
18
+
"maxTTLHelperText_one": "Workspaces created from this template must stop within {{count}} hour of starting.",
19
+
"maxTTLHelperText_other": "Workspaces created from this template must stop within {{count}} hours of starting.",
16
20
"allowUserCancelWorkspaceJobsLabel": "Allow users to cancel in-progress workspace jobs.",
17
21
"allowUserCancelWorkspaceJobsNotice": "Depending on your template, canceling builds may leave workspaces in an unhealthy state. This option isn't recommended for most use cases.",
0 commit comments