Skip to main content

Tag Objects

Tags provide a flexible way to categorize and organize objects across Strata Cloud Manager. The scm CLI provides commands to create, update, delete, show, backup, and load tag objects.

Overview​

The tag commands allow you to:

  • Create tags with specific colors for visual identification
  • Add descriptive comments to tags
  • Delete tags that are no longer needed
  • Bulk import tags from YAML files
  • Export tags for backup or migration

Supported Colors​

The following 42 colors are supported:

Color NameColor NameColor Name
RedGreenBlue
YellowCopperOrange
PurpleGrayLight Green
CyanLight GrayBlue Gray
LimeBlackGold
BrownOliveMaroon
Red-OrangeYellow-OrangeForest Green
Turquoise BlueAzure BlueCerulean Blue
Midnight BlueMedium BlueCobalt Blue
Violet BlueBlue VioletMedium Violet
Medium RoseLavenderOrchid
ThistlePeachSalmon
MagentaRed VioletMahogany
Burnt SiennaChestnut

Set Tag​

Create or update a tag object.

Syntax​

scm set object tag NAME [OPTIONS]

Arguments​

ArgumentDescriptionRequired
NAMEName of the tagYes

Options​

OptionDescriptionRequired
--folder TEXTFolder locationYes*
--snippet TEXTSnippet locationYes*
--device TEXTDevice locationYes*
--color TEXTColor for visual identificationNo
--comments TEXTDescriptive comments about the tagNo

* Exactly one of --folder, --snippet, or --device is required.

Examples​

Create a Tag with Color​

$ scm set object tag production \
--folder Texas \
--color "Red" \
--comments "Production environment resources"
---> 100%
Created tag: production in folder Texas

Create Multiple Environment Tags​

$ scm set object tag critical \
--folder Texas \
--color "Orange"
---> 100%
Created tag: critical in folder Texas
$ scm set object tag database \
--folder Texas \
--color "Blue"
---> 100%
Created tag: database in folder Texas

Delete Tag​

Delete a tag object from SCM.

Syntax​

scm delete object tag NAME [OPTIONS]

Arguments​

ArgumentDescriptionRequired
NAMEName of the tag to deleteYes

Options​

OptionDescriptionRequired
--folder TEXTFolder locationYes*
--snippet TEXTSnippet locationYes*
--device TEXTDevice locationYes*
--forceSkip confirmation promptNo

* Exactly one of --folder, --snippet, or --device is required.

Example​

$ scm delete object tag production --folder Texas --force
---> 100%
Deleted tag: production from folder Texas

Load Tags​

Load multiple tag objects from a YAML file.

Syntax​

scm load object tag [OPTIONS]

Options​

OptionDescriptionRequired
--file TEXTPath to YAML file containing tag definitionsYes
--folder TEXTOverride folder location for all objectsNo
--snippet TEXTOverride snippet location for all objectsNo
--device TEXTOverride device location for all objectsNo
--dry-runPreview changes without applying themNo

YAML File Format​

---
tags:
- name: production
folder: Texas
color: "Red"
comments: "Production environment resources"

- name: staging
folder: Texas
color: "Orange"
comments: "Staging environment resources"

- name: development
folder: Texas
color: "Yellow"
comments: "Development environment resources"

- name: finance
folder: Texas
color: "Gold"
comments: "Finance department resources"

- name: it
folder: Texas
color: "Blue"
comments: "IT department resources"

- name: restricted
folder: Texas
color: "Magenta"
comments: "Restricted access resources"

Examples​

Load with Original Locations​

$ scm load object tag --file tags.yml
---> 100%
✓ Loaded tag: production
✓ Loaded tag: staging
✓ Loaded tag: development
✓ Loaded tag: finance
✓ Loaded tag: it
✓ Loaded tag: restricted

Successfully loaded 6 out of 6 tags from 'tags.yml'

Load with Folder Override​

$ scm load object tag --file tags.yml --folder Austin
---> 100%
✓ Loaded tag: production
✓ Loaded tag: staging
✓ Loaded tag: development
✓ Loaded tag: finance
✓ Loaded tag: it
✓ Loaded tag: restricted

Successfully loaded 6 out of 6 tags from 'tags.yml'
note

When using container override options (--folder, --snippet, --device), all tags will be loaded into the specified container, ignoring the container specified in the YAML file.

Show Tag​

Display tag objects.

Syntax​

scm show object tag [NAME] [OPTIONS]

Arguments​

ArgumentDescriptionRequired
NAMEName of the tag to show; omit to list allNo

Options​

OptionDescriptionRequired
--folder TEXTFolder locationYes*
--snippet TEXTSnippet locationYes*
--device TEXTDevice locationYes*
--max-results INTEGERMaximum number of results to displayNo
--output [table|json|yaml]Output format (default: table)No

* Exactly one of --folder, --snippet, or --device is required.

note

When no NAME argument is provided, all items are listed by default.

Examples​

Show Specific Tag​

$ scm show object tag production --folder Texas
---> 100%
Tag: production
Location: Folder 'Texas'
Color: Red
Comments: Production environment resources

List All Tags (Default Behavior)​

$ scm show object tag --folder Texas
---> 100%
Tags in folder 'Texas':
------------------------------------------------------------
Name: production
Color: Red
Comments: Production environment resources
------------------------------------------------------------
Name: staging
Color: Orange
Comments: Staging environment resources
------------------------------------------------------------
Name: development
Color: Yellow
Comments: Development environment resources
------------------------------------------------------------
Name: critical
Color: Orange
------------------------------------------------------------
Name: database
Color: Blue
------------------------------------------------------------

Backup Tags​

Backup all tag objects from a specified location to a YAML file.

Syntax​

scm backup object tag [OPTIONS]

Options​

OptionDescriptionRequired
--folder TEXTFolder to backup tags fromNo*
--snippet TEXTSnippet to backup tags fromNo*
--device TEXTDevice to backup tags fromNo*
--file TEXTOutput filename (defaults to auto-generated)No

* One of --folder, --snippet, or --device is required.

Examples​

Backup from Folder​

$ scm backup object tag --folder Texas
---> 100%
Successfully backed up 42 tags to tag_folder_texas_20240115_120530.yaml

Backup with Custom Filename​

$ scm backup object tag --folder Texas --file texas-tags.yaml
---> 100%
Successfully backed up 42 tags to texas-tags.yaml

Best Practices​

  1. Consistent Naming: Use a consistent naming convention (e.g., env-prod, dept-finance).
  2. Color Coding: Establish a color scheme (e.g., Red for production, Green for development).
  3. Documentation: Always add comments to explain the tag's purpose.
  4. Hierarchical Tagging: Use prefixes to create logical hierarchies.
  5. Regular Cleanup: Remove unused tags to maintain organization.
  6. Create Tags First: Tags must exist before being referenced by other objects.