slservice
This page is generated from live --help output. Refresh it with:
python3 scripts/generate_cli_docs.py
Command
python3 deploy/slservice_cli.py --help
Help Output
usage: slservice_cli.py [-h] [--verify] [-v] [-l LOG]
[--am-rebuild [AMREBUILD]] [--mobile-cache-rebuild]
[-f] [--stop] [--start] [-r]
[-s SERVICES [SERVICES ...]] [-t] [--sas-config]
[--sas-output SASOUTPUT] [--cw-alarms]
[--db-query-deploy DBQUERY] [-j] [--web]
[--log-groups] [--secrets] [--intid-set [INTID]]
[--cf-loggroups] [--set-min-version MINVERSION]
[-e GETENV [GETENV ...]] [--get-cache-queue]
[--set-analytics-seat-count SETANALYTICSEATS]
[--format FORMAT] [--output OUTPUT]
[--set-log-level LLEVEL]
[--event-import [EVENTIMPORT]]
[--event-delete [EVENTDELETE]] [--throttle]
[--schema-reset] [--config-deploy] [--skip-restart]
[--gen5-version] [--uptime] [--lag LAG]
[--get-min-version]
[--get-secret-as-ecs [GETSECRETASECS]]
[--get-analytics-seat-count]
envInfo [log_since]
Manage ECR tags, start/stop services, restart services and MORE!
positional arguments:
envInfo SHORT_NAME-ENV, pass 'envs' to list all environments
log_since optional log start offset such as 10m, 2h, or 1d
options:
-h, --help show this help message and exit
--verify verify container images with tagged image repo checksum
-v, --version show version information
-l, --log LOG show logs for specified service
--am-rebuild [AMREBUILD]
rebuild aggregates for %short_name%, streetlights v5.6.4+ ONLY
--mobile-cache-rebuild
rebuild mobile cache for %short_name%, streetlights v5.6.4+ ONLY
-f, --force when used with --mobile-cache-rebuild forces the deletion of existing cache files
--stop stop service(s)
--start start service(s)
-r, --restart restart service(s)
-s, --service SERVICES [SERVICES ...]
service(s) to perform action on
Use 'all' to apply to all services including integrations
Use 'web' to apply to the web services omitting integrations or other services
-t, --tag tag service(s)
--sas-config generate SAS config for %short_name%
--sas-output SASOUTPUT
filepath to store SAS config
--cw-alarms Show alarms associated with instance cluster
--db-query-deploy DBQUERY
deploy sql file for db-query task
-j, --jump jump to an instance
--web open the web portal for this instance
--log-groups open CloudWatch and search log groups for this instance
--secrets open Secrets Manager and search secrets for this instance
--intid-set [INTID] set integration's application ID in database
--cf-loggroups use CloudFormation to generate CloudWatch log groups
--set-min-version MINVERSION
set minimum version required for mobile app ex) --set-min-version 5.4.10
-e, --get-env GETENV [GETENV ...]
get a specified environment variable from a service
--get-cache-queue get mobile cache queue for an instance, requires v5.6.10+
--set-analytics-seat-count SETANALYTICSEATS
set maximum analytics seats available on an instance, requires v5.5.3+
--format FORMAT output file type, json is default, other formats include: csv
--output OUTPUT filepath to save output
--set-log-level LLEVEL
(5.6.6+) Set the logging level of all streetlight services. 48 is default, -1 is enhanced logging.
--event-import [EVENTIMPORT]
Import JSON files in current folder to short_name-env
--event-delete [EVENTDELETE]
Delete events listed in a file from short_name-env
--throttle Set event import to throttle import for slower systems.
--schema-reset Reset the gen5 schema for an instance
--config-deploy deploy the default config from s3
--skip-restart Don't force-restart services. Works with --config-deploy and --schema-reset.
--gen5-version Display streetlights version.
--uptime Output running time information about services.
--lag LAG Returns the current 'commands', or 'events' time for the oldest command/event
--get-min-version get minimum version set for mobile app
--get-secret-as-ecs [GETSECRETASECS]
output ECS task definition secrets JSON for a secret name, or derive it from -s/--service
--get-analytics-seat-count
get assigned analytics seat count
Parameter Reference
Use envInfo for most environment-scoped commands. The value is normally SHORT_NAME-ENV, such as customer-prod or customer-staging. Pass envs to list known environments.
| Parameter | Value | Notes |
|---|---|---|
envInfo |
SHORT_NAME-ENV |
Required positional argument for the target deployment environment. Use envs to list available environments. |
log_since |
10m, 2h, 1d |
Optional positional log offset used with log-oriented commands. |
-h, --help |
none | Print command help and exit. |
-v, --version |
none | Show the installed slservice version. |
--verify |
none | Verify deployed container images against tagged ECR image repository checksums. |
-l, --log |
service name | Show logs for a specific service. Combine with log_since to control how far back logs start. |
--am-rebuild |
optional aggregate selector | Rebuild aggregates. With no value, defaults to all. Intended for Streetlights v5.6.4+. |
--mobile-cache-rebuild |
none | Rebuild the mobile cache. Intended for Streetlights v5.6.4+. |
-f, --force |
none | Used with --mobile-cache-rebuild to delete existing cache files before rebuilding. |
--stop |
none | Stop selected ECS service tasks. Use --service to choose targets. |
--start |
none | Start selected ECS services. Use --service to choose targets. |
-r, --restart |
none | Restart selected ECS services. Use --service to choose targets. |
-s, --service |
one or more service names | Select target services for service actions. Supports all for all services and web for web-facing services only. |
-t, --tag |
none | Retag selected service images in ECR according to the environment config. Use with --service. |
--sas-config |
none | Generate SAS configuration for the target short name. |
--sas-output |
file path | Write generated SAS configuration to a specific file path. Use with --sas-config. |
--cw-alarms |
none | Show CloudWatch alarms associated with the target ECS cluster. |
--db-query-deploy |
SQL file path | Deploy a SQL file for the db-query task. |
-j, --jump |
none | Start a jump/SSM session to an instance in the target environment. |
--web |
none | Open the web portal for the target environment. |
--log-groups |
none | Open CloudWatch Logs filtered to log groups for the target environment. |
--secrets |
none | Open AWS Secrets Manager filtered to secrets for the target environment. |
--intid-set |
optional integration ID | Set an integration application ID in the database. If omitted, the command uses its default interactive or derived behavior. |
--cf-loggroups |
none | Generate CloudWatch log groups through CloudFormation. |
--set-min-version |
version string | Set the minimum required mobile app version, for example 5.4.10. |
-e, --get-env |
one or more variable names | Read one or more environment variables from a service. Use --service to identify the source service. |
--get-cache-queue |
none | Return the mobile cache queue for the target instance. Requires Streetlights v5.6.10+. |
--set-analytics-seat-count |
integer | Set the maximum analytics seat count for an instance. Requires Streetlights v5.5.3+. |
--format |
json, csv |
Select output format for commands that support structured output. Defaults to json. |
--output |
file path | Save supported command output to a file. |
--set-log-level |
log level integer | Set logging level for Streetlights services. 48 is the default level; -1 enables enhanced logging. Requires Streetlights v5.6.6+. |
--event-import |
optional glob | Import JSON event files from the current directory. Defaults to *.json when no value is supplied. |
--event-delete |
optional file path | Delete events listed in a file. Defaults to guids.txt when no value is supplied. |
--throttle |
none | Slow event import for lower-capacity systems. Use with --event-import. |
--schema-reset |
none | Reset the Gen5 schema for the target instance. |
--config-deploy |
none | Deploy the default config from S3 to the target instance. |
--skip-restart |
none | Prevent forced service restarts after --config-deploy or --schema-reset. |
--gen5-version |
none | Display the deployed Streetlights/Gen5 version. |
--uptime |
none | Show running time information for services. |
--lag |
commands or events |
Return the oldest command or event lag time. |
--get-min-version |
none | Return the configured minimum mobile app version. |
--get-secret-as-ecs |
optional secret name | Output ECS task definition secrets JSON for a named secret. If omitted, derive the secret name from -s/--service. |
--get-analytics-seat-count |
none | Return the assigned analytics seat count. |
Common Combinations
# Restart all services in an environment.
slservice SHORT_NAME-ENV --restart --service all
# Restart only web-facing services.
slservice SHORT_NAME-ENV --restart --service web
# Show recent logs for one service.
slservice SHORT_NAME-ENV --log web-app 30m
# Deploy config without forcing a restart.
slservice SHORT_NAME-ENV --config-deploy --skip-restart
# Generate ECS secrets JSON for a service.
slservice SHORT_NAME-ENV --get-secret-as-ecs --service web-app