Skip to main content

tw labels

Manage workspace labels and resource labels.

Run tw labels -h to view supported label operations.

tw labels add

Add a label.

tw labels add [OPTIONS]

Options

OptionDescriptionRequiredDefault
-n, --nameLabel name
-v, --valueLabel value
-w, --workspaceWorkspace numeric identifier or reference in OrganizationName/WorkspaceName format (defaults to TOWER_WORKSPACE_ID environment variable)${TOWER_WORKSPACE_ID}

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
-t, --typeLabel type: normal, resource, or all (default: all)all
-f, --filterFilter labels by substring
-w, --workspaceWorkspace numeric identifier or reference in OrganizationName/WorkspaceName format (defaults to TOWER_WORKSPACE_ID environment variable)${TOWER_WORKSPACE_ID}
--pagePage number for paginated results (default: 1)
--offsetRow offset for paginated results (default: 0)
--maxMaximum number of records to display (default: )

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

tw labels list

Labels at 97652229034604 workspace:

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 identifier
-n, --nameLabel name
-v, --valueLabel value
-w, --workspaceWorkspace numeric identifier or reference in OrganizationName/WorkspaceName format (defaults to TOWER_WORKSPACE_ID environment variable)${TOWER_WORKSPACE_ID}

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

Example

tw labels update -i 444555666777888 -n label3 -w 123456789012345

# Output:
Label with id '444555666777888' at '123456789012345' workspace updated to 'label3'

tw labels delete

Delete a label.

tw labels delete [OPTIONS]

Options

OptionDescriptionRequiredDefault
-i, --idLabel ID
-w, --workspaceWorkspace numeric identifier or reference in OrganizationName/WorkspaceName format (defaults to TOWER_WORKSPACE_ID environment variable)${TOWER_WORKSPACE_ID}

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