Label¶
Labels provide metadata tags for organizing folders and resources in Strata Cloud Manager. The scm CLI provides commands to create, update, delete, list, bulk import, and back up labels.
Overview¶
The label commands allow you to:
- Create labels with optional descriptions
- Update existing label configurations
- Delete labels that are no longer needed
- Bulk import labels from YAML files
- Export labels for backup or migration
Set Label¶
Create or update a label.
Syntax¶
Options¶
| Option | Description | Required |
|---|---|---|
--name TEXT |
Label name | Yes |
--description TEXT |
Description | No |
Examples¶
Create a Simple Label¶
Create a Label with Description¶
$ scm set setup label \
--name staging \
--description "Staging environment"
---> 100%
Created label: staging
Delete Label¶
Delete a label from SCM.
Syntax¶
Options¶
| Option | Description | Required |
|---|---|---|
--name TEXT |
Name of the label to delete | Yes |
--force |
Skip confirmation prompt | No |
Example¶
Load Label¶
Load multiple labels from a YAML file.
Syntax¶
Options¶
| Option | Description | Required |
|---|---|---|
--file PATH |
YAML file to load configurations from | Yes |
--dry-run |
Simulate execution without applying changes | No |
YAML File Format¶
---
labels:
- name: production
description: "Production environment"
- name: staging
description: "Staging environment"
Examples¶
Load Labels from File¶
$ scm load setup label --file labels.yaml
---> 100%
✓ Loaded label: production
✓ Loaded label: staging
Processed 2 labels from labels.yaml
Dry Run¶
$ scm load setup label --file labels.yaml --dry-run
---> 100%
Dry run mode: would apply the following configurations:
- name: production
description: Production environment
- name: staging
description: Staging environment
Show Label¶
Display label objects.
Syntax¶
Options¶
| Option | Description | Required |
|---|---|---|
--name TEXT |
Name of the label to show | No |
Note
When no --name is specified, all labels are listed by default.
Examples¶
Show Specific Label¶
$ scm show setup label --name production
---> 100%
Label: production
================================================================================
Description: Production environment
List All Labels (Default Behavior)¶
$ scm show setup label
---> 100%
Labels (3):
--------------------------------------------------------------------------------
Name: production
Description: Production environment
--------------------------------------------------------------------------------
Name: staging
Description: Staging environment
--------------------------------------------------------------------------------
Name: development
Description: Development environment
--------------------------------------------------------------------------------
Backup Labels¶
Backup all label objects to a YAML file.
Syntax¶
Options¶
| Option | Description | Required |
|---|---|---|
--file TEXT |
Output filename for backup | No |
Examples¶
Backup with Default Filename¶
Backup with Custom Filename¶
$ scm backup setup label --file my-labels.yaml
---> 100%
Successfully backed up 5 labels to my-labels.yaml
Best Practices¶
- Use Consistent Naming: Adopt a naming convention for labels (e.g., lowercase with hyphens) and apply it uniformly.
- Add Descriptions: Include descriptions to clarify each label's purpose for team members.
- Back Up Regularly: Export labels before making bulk changes to preserve your organization scheme.
- Use Dry Run for Bulk Imports: Preview bulk imports with
--dry-runbefore applying changes.