Skip to main content

Service Objects

Service objects define network services by protocol and port combinations in Strata Cloud Manager. The scm CLI provides commands to create, update, delete, show, backup, and load service objects.

Overview

The service commands allow you to:

  • Create custom service definitions with TCP or UDP protocols
  • Define port configurations (single, range, or comma-separated)
  • Set timeout values for connection handling
  • Delete services that are no longer needed
  • Bulk import services from YAML files
  • Export services for backup or migration

Port Specification Formats

FormatExampleDescription
Single port8080One specific port
Port range8000-8100All ports in the range
Multiple ports80,443,8080Specific listed ports
Mixed80,443,8000-8100Combination of formats

Set Service

Create or update a service object.

Syntax

scm set object service NAME [OPTIONS]

Arguments

ArgumentDescriptionRequired
NAMEName of the serviceYes

Options

OptionDescriptionRequired
--folder TEXTFolder locationYes*
--snippet TEXTSnippet locationYes*
--device TEXTDevice locationYes*
--protocol TEXTProtocol type (tcp or udp)Yes
--port TEXTPort specificationYes
--description TEXTDescription of the serviceNo
--tags TEXTTag to apply (repeat for multiple)No
--timeout INTEGERSession timeout in seconds (TCP only)No
--halfclose-timeout INTEGERTCP half-close timeoutNo
--timewait-timeout INTEGERTCP time-wait timeoutNo

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

Examples

Create a Basic TCP Service

$ scm set object service custom-web \
--folder Texas \
--protocol tcp \
--port "8080,8443" \
--description "Custom web service ports"
---> 100%
Created service: custom-web in folder Texas

Create a UDP Service with Port Range

$ scm set object service custom-voip \
--folder Texas \
--protocol udp \
--port "5060-5070" \
--description "VoIP signaling ports"
---> 100%
Created service: custom-voip in folder Texas

Create a TCP Service with Timeout Overrides

$ scm set object service database-service \
--folder Texas \
--protocol tcp \
--port "3306" \
--timeout 7200 \
--halfclose-timeout 120 \
--timewait-timeout 30 \
--description "MySQL with extended timeouts"
---> 100%
Created service: database-service in folder Texas

Delete Service

Delete a service object from SCM.

Syntax

scm delete object service NAME [OPTIONS]

Arguments

ArgumentDescriptionRequired
NAMEName of the service 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 service custom-web --folder Texas --force
---> 100%
Deleted service: custom-web from folder Texas

Load Services

Load multiple service objects from a YAML file.

Syntax

scm load object service [OPTIONS]

Options

OptionDescriptionRequired
--file TEXTPath to YAML file containing service 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

---
services:
- name: custom-web
folder: Texas
protocol: tcp
port: "8080,8443"
description: "Custom web service ports"

- name: database-cluster
folder: Texas
protocol: tcp
port: "3306-3310"
description: "MySQL cluster ports"
override:
timeout: 7200
halfclose_timeout: 120
timewait_timeout: 30

- name: custom-dns
folder: Texas
protocol: udp
port: "5353"
description: "mDNS/Bonjour service"
tag:
- network
- discovery

- name: legacy-app
folder: Texas
protocol: tcp
port: "9000,9001,9002"
description: "Legacy application ports"
tag:
- legacy
- monitor

Examples

Load with Original Locations

$ scm load object service --file services.yml
---> 100%
✓ Loaded service: custom-web
✓ Loaded service: database-cluster
✓ Loaded service: custom-dns
✓ Loaded service: legacy-app

Successfully loaded 4 out of 4 services from 'services.yml'

Load with Folder Override

$ scm load object service --file services.yml --folder Austin
---> 100%
✓ Loaded service: custom-web
✓ Loaded service: database-cluster
✓ Loaded service: custom-dns
✓ Loaded service: legacy-app

Successfully loaded 4 out of 4 services from 'services.yml'
note

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

Show Service

Display service objects.

Syntax

scm show object service [NAME] [OPTIONS]

Arguments

ArgumentDescriptionRequired
NAMEName of the service 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 Service

$ scm show object service custom-web --folder Texas
---> 100%
Service: custom-web
Location: Folder 'Texas'
Protocol: tcp
Ports: 8080,8443
Description: Custom web service ports
Tags: None

List All Services (Default Behavior)

$ scm show object service --folder Texas
---> 100%
Services in folder 'Texas':
------------------------------------------------------------
Name: custom-web
Protocol: tcp
Ports: 8080,8443
Description: Custom web service ports
------------------------------------------------------------
Name: custom-voip
Protocol: udp
Ports: 5060-5070
Description: VoIP signaling ports
------------------------------------------------------------
Name: database-service
Protocol: tcp
Ports: 3306
Timeout: 7200s
Description: MySQL with extended timeouts
------------------------------------------------------------

Backup Services

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

Syntax

scm backup object service [OPTIONS]

Options

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

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

Examples

Backup from Folder

$ scm backup object service --folder Texas
---> 100%
Successfully backed up 15 services to service_folder_texas_20240115_120530.yaml

Backup with Custom Filename

$ scm backup object service --folder Texas --file texas-services.yaml
---> 100%
Successfully backed up 15 services to texas-services.yaml

Best Practices

  1. Descriptive Names: Use names that clearly identify the service purpose.
  2. Port Documentation: Always include descriptions explaining port usage.
  3. Timeout Considerations: Only override timeouts when necessary for application requirements.
  4. Tag Organization: Use consistent tags for easier filtering and management.
  5. Port Range Efficiency: Use ranges instead of listing sequential ports.
  6. Use YAML for Bulk Operations: For large deployments, use YAML files.