Skip to main content

Folder

Folders organize configurations hierarchically in Strata Cloud Manager. The scm CLI provides commands to create, update, delete, list, bulk import, and back up folders.

Overview​

The folder commands allow you to:

  • Create folders with a parent hierarchy and optional labels
  • Update existing folder configurations
  • Delete folders that are no longer needed
  • Bulk import folders from YAML files
  • Export folders for backup or migration

Set Folder​

Create or update a folder.

Syntax​

scm set setup folder NAME [OPTIONS]

Arguments​

ArgumentDescriptionRequired
NAMEFolder nameYes

Options​

OptionDescriptionRequired
--parent TEXTParent folder nameYes
--description TEXTDescriptionNo
--labels TEXTLabels to applyNo
--snippets TEXTSnippet IDs to associateNo

Examples​

Create a Top-Level Folder​

$ scm set setup folder Texas \
--parent "All"
---> 100%
Created folder: Texas (parent: All)

Create a Child Folder with Description​

$ scm set setup folder Branch \
--parent Texas \
--description "Branch offices"
---> 100%
Created folder: Branch (parent: Texas)

Create a Folder with Labels​

$ scm set setup folder Austin \
--parent Texas \
--labels production \
--labels west-region
---> 100%
Created folder: Austin (parent: Texas)

Delete Folder​

Delete a folder from SCM.

Syntax​

scm delete setup folder NAME [OPTIONS]

Arguments​

ArgumentDescriptionRequired
NAMEName of the folder to deleteYes

Options​

OptionDescriptionRequired
--forceSkip confirmation promptNo

Example​

$ scm delete setup folder Branch --force
---> 100%
Deleted folder: Branch

Load Folder​

Load multiple folders from a YAML file.

Syntax​

scm load setup folder [OPTIONS]

Options​

OptionDescriptionRequired
--file PATHYAML file to load configurations fromYes
--dry-runSimulate execution without applying changesNo

YAML File Format​

---
folders:
- name: Texas
parent: "All"
description: "Texas regional office"

- name: Austin
parent: Texas
description: "Austin branch"
labels:
- production

Examples​

Load Folders from File​

$ scm load setup folder --file folders.yaml
---> 100%
✓ Loaded folder: Texas
✓ Loaded folder: Austin

Processed 2 folders from folders.yaml

Dry Run​

$ scm load setup folder --file folders.yaml --dry-run
---> 100%
Dry run mode: would apply the following configurations:
- name: Texas
parent: All
description: Texas regional office
- name: Austin
parent: Texas
description: Austin branch

Show Folder​

Display folder objects.

Syntax​

scm show setup folder [NAME] [OPTIONS]

Arguments​

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

Options​

OptionDescriptionRequired
--output, -o [table|json|yaml]Output format (default: table)No
--max-results INTEGERMaximum number of results to displayNo
note

When no NAME is specified, all folders are listed by default.

Examples​

Show Specific Folder​

$ scm show setup folder Texas
---> 100%
Folder: Texas
================================================================================
Parent: All
Description: Texas regional office
Labels: production, west-region

List All Folders (Default Behavior)​

$ scm show setup folder
---> 100%
Folders (3):
--------------------------------------------------------------------------------
Name: All
Parent: N/A
--------------------------------------------------------------------------------
Name: Texas
Parent: All
Description: Texas regional office
--------------------------------------------------------------------------------
Name: Austin
Parent: Texas
Description: Austin branch
--------------------------------------------------------------------------------

Backup Folders​

Backup all folder objects to a YAML file.

Syntax​

scm backup setup folder [OPTIONS]

Options​

OptionDescriptionRequired
--file TEXTOutput filename for backupNo

Examples​

Backup with Default Filename​

$ scm backup setup folder
---> 100%
Successfully backed up 12 folders to folders_20240115_120530.yaml

Backup with Custom Filename​

$ scm backup setup folder --file my-folders.yaml
---> 100%
Successfully backed up 12 folders to my-folders.yaml

Best Practices​

  1. Plan Your Hierarchy: Design the folder structure before creating folders to avoid reorganization later.
  2. Use Descriptive Names: Choose folder names that clearly indicate their purpose or geographic scope.
  3. Apply Labels Consistently: Use labels to categorize folders for easier filtering and management.
  4. Back Up Before Changes: Export your folder structure before making significant modifications.
  5. Use Dry Run for Bulk Imports: Always preview bulk imports with --dry-run before applying changes.