Skip to content

docs: expand on TTL flags #9286

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cli/templatecreate.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,19 +182,19 @@ func (r *RootCmd) templateCreate() *clibase.Cmd {
},
{
Flag: "default-ttl",
Description: "Specify a default TTL for workspaces created from this template.",
Description: "Specify a default TTL for workspaces created from this template. It is the default time before shutdown - workspaces created from this template default to this value. Maps to \"Default autostop\" in the UI.",
Default: "24h",
Value: clibase.DurationOf(&defaultTTL),
},
{
Flag: "failure-ttl",
Description: "Specify a failure TTL for workspaces created from this template. This licensed feature's default is 0h (off).",
Description: "Specify a failure TTL for workspaces created from this template. It is the amount of time after a failed \"start\" build before coder automatically schedules a \"stop\" build to cleanup.This licensed feature's default is 0h (off). Maps to \"Failure cleanup\"in the UI.",
Default: "0h",
Value: clibase.DurationOf(&failureTTL),
},
{
Flag: "inactivity-ttl",
Description: "Specify an inactivity TTL for workspaces created from this template. This licensed feature's default is 0h (off).",
Description: "Specify an inactivity TTL for workspaces created from this template. It is the amount of time the workspace is not used before it is be stopped and auto-locked. This includes across multiple builds (e.g. auto-starts and stops). This licensed feature's default is 0h (off). Maps to \"Dormancy threshold\" in the UI.",
Default: "0h",
Value: clibase.DurationOf(&inactivityTTL),
},
Expand Down
8 changes: 4 additions & 4 deletions cli/templateedit.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,12 @@ func (r *RootCmd) templateEdit() *clibase.Cmd {
},
{
Flag: "default-ttl",
Description: "Edit the template default time before shutdown - workspaces created from this template default to this value.",
Description: "Edit the template default time before shutdown - workspaces created from this template default to this value. Maps to \"Default autostop\" in the UI.",
Value: clibase.DurationOf(&defaultTTL),
},
{
Flag: "max-ttl",
Description: "Edit the template maximum time before shutdown - workspaces created from this template must shutdown within the given duration after starting. This is an enterprise-only feature.",
Description: "Edit the template maximum time before shutdown - workspaces created from this template must shutdown within the given duration after starting, regardless of user activity. This is an enterprise-only feature. Maps to \"Max lifetime\" in the UI.",
Value: clibase.DurationOf(&maxTTL),
},
{
Expand Down Expand Up @@ -176,13 +176,13 @@ func (r *RootCmd) templateEdit() *clibase.Cmd {
},
{
Flag: "failure-ttl",
Description: "Specify a failure TTL for workspaces created from this template. This licensed feature's default is 0h (off).",
Description: "Specify a failure TTL for workspaces created from this template. It is the amount of time after a failed \"start\" build before coder automatically schedules a \"stop\" build to cleanup.This licensed feature's default is 0h (off). Maps to \"Failure cleanup\" in the UI.",
Default: "0h",
Value: clibase.DurationOf(&failureTTL),
},
{
Flag: "inactivity-ttl",
Description: "Specify an inactivity TTL for workspaces created from this template. This licensed feature's default is 0h (off).",
Description: "Specify an inactivity TTL for workspaces created from this template. It is the amount of time the workspace is not used before it is be stopped and auto-locked. This includes across multiple builds (e.g. auto-starts and stops). This licensed feature's default is 0h (off). Maps to \"Dormancy threshold\" in the UI.",
Default: "0h",
Value: clibase.DurationOf(&inactivityTTL),
},
Expand Down
15 changes: 11 additions & 4 deletions cli/testdata/coder_templates_create_--help.golden
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,29 @@ Create a template from the current directory or as specified by flag

Options
--default-ttl duration (default: 24h)
Specify a default TTL for workspaces created from this template.
Specify a default TTL for workspaces created from this template. It is
the default time before shutdown - workspaces created from this
template default to this value. Maps to "Default autostop" in the UI.

-d, --directory string (default: .)
Specify the directory to create from, use '-' to read tar from stdin.

--failure-ttl duration (default: 0h)
Specify a failure TTL for workspaces created from this template. This
licensed feature's default is 0h (off).
Specify a failure TTL for workspaces created from this template. It is
the amount of time after a failed "start" build before coder
automatically schedules a "stop" build to cleanup.This licensed
feature's default is 0h (off). Maps to "Failure cleanup"in the UI.

--ignore-lockfile bool (default: false)
Ignore warnings about not having a .terraform.lock.hcl file present in
the template.

--inactivity-ttl duration (default: 0h)
Specify an inactivity TTL for workspaces created from this template.
This licensed feature's default is 0h (off).
It is the amount of time the workspace is not used before it is be
stopped and auto-locked. This includes across multiple builds (e.g.
auto-starts and stops). This licensed feature's default is 0h (off).
Maps to "Dormancy threshold" in the UI.

-m, --message string
Specify a message describing the changes in this version of the
Expand Down
17 changes: 12 additions & 5 deletions cli/testdata/coder_templates_edit_--help.golden
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ Edit the metadata of a template by name.

--default-ttl duration
Edit the template default time before shutdown - workspaces created
from this template default to this value.
from this template default to this value. Maps to "Default autostop"
in the UI.

--description string
Edit the template description.
Expand All @@ -25,20 +26,26 @@ Edit the metadata of a template by name.
Edit the template display name.

--failure-ttl duration (default: 0h)
Specify a failure TTL for workspaces created from this template. This
licensed feature's default is 0h (off).
Specify a failure TTL for workspaces created from this template. It is
the amount of time after a failed "start" build before coder
automatically schedules a "stop" build to cleanup.This licensed
feature's default is 0h (off). Maps to "Failure cleanup" in the UI.

--icon string
Edit the template icon path.

--inactivity-ttl duration (default: 0h)
Specify an inactivity TTL for workspaces created from this template.
This licensed feature's default is 0h (off).
It is the amount of time the workspace is not used before it is be
stopped and auto-locked. This includes across multiple builds (e.g.
auto-starts and stops). This licensed feature's default is 0h (off).
Maps to "Dormancy threshold" in the UI.

--max-ttl duration
Edit the template maximum time before shutdown - workspaces created
from this template must shutdown within the given duration after
starting. This is an enterprise-only feature.
starting, regardless of user activity. This is an enterprise-only
feature. Maps to "Max lifetime" in the UI.

--name string
Edit the template name.
Expand Down
6 changes: 3 additions & 3 deletions docs/cli/templates_create.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions docs/cli/templates_edit.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.