Skip to main content

tw labels

Manage workspace labels

Run tw labels -h to view supported label operations.

Manage labels and resource labels.

tw labels add

Add a label

tw labels add [OPTIONS]

Options

OptionDescriptionRequiredDefault
-n, --nameLabel nameYes
-w, --workspaceWorkspace numeric identifier or reference in OrganizationName/WorkspaceName format (defaults to TOWER_WORKSPACE_ID environment variable)No
-v, --valueLabel valueNo

Run tw labels add -h to view the required and optional fields for adding a label.

note

Resource labels consist of a name=value pair and can only be applied to compute environments, pipelines, runs, and actions. Labels require only a name and can be applied to pipelines, runs, and actions.

tw labels add -n Label1 -w DocTestOrg2/Testing -v Value1

Label 'Label1=Value1' added at 'DocTestOrg2/Testing' workspace with id '268741348267491'

tw labels list

List labels

tw labels list [OPTIONS]

Options

OptionDescriptionRequiredDefault
-w, --workspaceWorkspace numeric identifier or reference in OrganizationName/WorkspaceName format (defaults to TOWER_WORKSPACE_ID environment variable)No
-t, --typeLabel type: normal, resource, or all (default: all)Noall
-f, --filterFilter labels by substringNo
--pagePage number for paginated results (default: 1)No
--offsetRow offset for paginated results (default: 0)No
--maxMaximum number of records to display (default: 100)No

Run tw labels list -h to view the optional fields for filtering labels.

Command:

tw labels list

Labels at 97652229034604 workspace:

Example output:

ID            | Name                   | Value     | Type
-----------------+------------------------+-----------+----------
116734717739444 | manual-fusion-amd64 | | Normal
120599302764779 | test-with-prefix | | Normal
128477232893714 | manual-fusion-arm64 | | Normal
214201679620273 | test-config-link | | Normal
244634136444435 | manual-nonfusion-amd64 | | Normal
9184612610501 | Resource1 | Value1 | Resource

tw labels update

Update a label

tw labels update [OPTIONS]

Options

OptionDescriptionRequiredDefault
-i, --idLabel identifierYes
-n, --nameLabel nameNo
-v, --valueLabel valueNo
-w, --workspaceWorkspace numeric identifier or reference in OrganizationName/WorkspaceName format (defaults to TOWER_WORKSPACE_ID environment variable)No

Run tw labels update -h to view the required and optional fields for updating labels.

tw labels delete

Delete a label

tw labels delete [OPTIONS]

Options

OptionDescriptionRequiredDefault
-i, --idLabel IDYes
-w, --workspaceWorkspace numeric identifier or reference in OrganizationName/WorkspaceName format (defaults to TOWER_WORKSPACE_ID environment variable)No

Run tw labels delete -h to view the required and optional fields for deleting labels.

tw labels delete -i 203879852150462

Label '203879852150462' deleted at '97652229034604' workspace