Region
Regions define geographic locations with optional latitude, longitude, and address associations for use in security policies. The scm CLI provides commands to create, update, delete, show, load, and backup region objects.
Overview
The region commands allow you to:
- Create regions with geographic coordinates
- Associate address ranges with regions
- Delete regions that are no longer needed
- Bulk import regions from YAML files
- Export regions for backup or migration
Set Region
Create or update a region.
Syntax
scm set object region NAME [OPTIONS]
Arguments
| Argument | Description | Required |
|---|---|---|
NAME | Name of the region | Yes |
Options
| Option | Description | Required |
|---|---|---|
--folder TEXT | Folder location | Yes* |
--snippet TEXT | Snippet location | Yes* |
--device TEXT | Device location | Yes* |
--latitude FLOAT | Latitude (-90 to 90) | No |
--longitude FLOAT | Longitude (-180 to 180) | No |
--address TEXT | Address CIDR to associate (repeat for multiple) | No |
* Exactly one of --folder, --snippet, or --device is required.
Examples
Create a Region with Coordinates
$ scm set object region us-west \
--folder Texas \
--latitude 37.7749 \
--longitude -122.4194
---> 100%
Created region: us-west in folder Texas
Create a Region with Addresses
$ scm set object region branch-offices \
--folder Texas \
--address 10.0.0.0/8 \
--address 172.16.0.0/12
---> 100%
Created region: branch-offices in folder Texas
Delete Region
Delete a region from SCM.
Syntax
scm delete object region NAME [OPTIONS]
Arguments
| Argument | Description | Required |
|---|---|---|
NAME | Name of the region to delete | Yes |
Options
| Option | Description | Required |
|---|---|---|
--folder TEXT | Folder location | Yes* |
--snippet TEXT | Snippet location | Yes* |
--device TEXT | Device location | Yes* |
--force | Skip confirmation prompt | No |
* Exactly one of --folder, --snippet, or --device is required.
Example
$ scm delete object region us-west --folder Texas --force
---> 100%
Deleted region: us-west from folder Texas
Load Regions
Load multiple regions from a YAML file.
Syntax
scm load object region [OPTIONS]
Options
| Option | Description | Required |
|---|---|---|
--file TEXT | Path to YAML file containing region definitions | Yes |
--folder TEXT | Override folder location for all objects | No |
--snippet TEXT | Override snippet location for all objects | No |
--device TEXT | Override device location for all objects | No |
--dry-run | Preview changes without applying them | No |
YAML File Format
---
regions:
- name: us-west
folder: Texas
latitude: 37.7749
longitude: -122.4194
- name: branch-offices
folder: Texas
addresses:
- 10.0.0.0/8
- 172.16.0.0/12
Examples
Load with Original Locations
$ scm load object region --file regions.yaml
---> 100%
✓ Loaded region: us-west
✓ Loaded region: branch-offices
Successfully loaded 2 out of 2 regions from 'regions.yaml'
Load with Folder Override
$ scm load object region --file regions.yaml --folder Austin
---> 100%
✓ Loaded region: us-west
✓ Loaded region: branch-offices
Successfully loaded 2 out of 2 regions from 'regions.yaml'
When using container override options (--folder, --snippet, --device), all regions will be loaded into the specified container, ignoring the container specified in the YAML file.
Show Region
Display region objects.
Syntax
scm show object region [NAME] [OPTIONS]
Arguments
| Argument | Description | Required |
|---|---|---|
NAME | Name of the region to show; omit to list all | No |
Options
| Option | Description | Required |
|---|---|---|
--folder TEXT | Folder location | Yes* |
--snippet TEXT | Snippet location | Yes* |
--device TEXT | Device location | Yes* |
--max-results INTEGER | Maximum number of results to display | No |
--output [table|json|yaml] | Output format (default: table) | No |
* Exactly one of --folder, --snippet, or --device is required.
When no NAME argument is provided, all items are listed by default.
Examples
Show Specific Region
$ scm show object region us-west --folder Texas
---> 100%
Region: us-west
Location: Folder 'Texas'
Latitude: 37.7749
Longitude: -122.4194
List All Regions (Default Behavior)
$ scm show object region --folder Texas
---> 100%
Regions in folder 'Texas':
------------------------------------------------------------
Name: us-west
Latitude: 37.7749
Longitude: -122.4194
------------------------------------------------------------
Name: branch-offices
Addresses: 10.0.0.0/8, 172.16.0.0/12
------------------------------------------------------------
Backup Regions
Backup all region objects from a specified location to a YAML file.
Syntax
scm backup object region [OPTIONS]
Options
| Option | Description | Required |
|---|---|---|
--folder TEXT | Folder to backup regions from | No* |
--snippet TEXT | Snippet to backup regions from | No* |
--device TEXT | Device to backup regions from | No* |
--file TEXT | Output filename (defaults to auto-generated) | No |
* One of --folder, --snippet, or --device is required.
Examples
Backup from Folder
$ scm backup object region --folder Texas
---> 100%
Successfully backed up 5 regions to region_folder_texas_20240115_120530.yaml
Backup with Custom Filename
$ scm backup object region --folder Texas --file texas-regions.yaml
---> 100%
Successfully backed up 5 regions to texas-regions.yaml
Best Practices
- Use Descriptive Names: Name regions after geographic locations or office names.
- Include Coordinates: Add latitude and longitude for map-based visualization.
- Associate Addresses: Link IP address ranges to regions for geographic policy enforcement.
- Use YAML for Bulk Operations: For managing multiple regions, use YAML files.
- Organize by Folder: Keep regions organized in logical folders.