Command Line Interface
We provide a command line interface to interact with the Gallagher Command Centre. It uses the API client to communicate with the server, which doubly serves as a reference example of how to use the API client.
We use typer to construct the CLI, which in turn uses click. We also use rich to make the output nicer. The CLI is decoupled from the API client, and is not install by default.
We follow a git
like command
, sub-command
pattern, so it should feel quite familiar.
poetry will install the alias gal
for you to interact with the CLI. You can ask for help with:
app
gala is a command line interface for the gallagher security command centre.
It works by accessing and mutating objects on the command centre via it's
JSON API, directly or via the cloud gateway.
It's intent it to make available scriptable endpoints to ease automation.
Usage:
Options:
--install-completion Install completion for the current shell.
--show-completion Show completion for the current shell, to copy it or
customize the installation.
ag
Query access groups on the command centre
Usage:
alarm
List, query, follow, act on alarms in the command centre
Usage:
ack
Acknowledge alarms, optionally with a comment
Acknowledge one or more alarms, optionally with a comment
use this to bulk process alarms, handy for automation.
Usage:
Options:
IDS... alarm id \[required]
-m, --message TEXT comment to add to history
-y, --yes acknowledge without confirmation
comment
Comment on an alarm
Leave a comment on a particular alarm, note that
this does not mark the alarm as acknowledged or processed
Usage:
Options:
get
Get details of an alarm by ID
Fetches details of am alarm by the identifier and presents
the hrefs as clickable links.
Usage:
Options:
history
Show history of an alarm
Usage:
Options:
list
Lists current alarms
Provides a summary of alarms in the system, colour coded by severity,
use this to get an overview of your current alarms and use their IDs
in subsequent operations
Usage:
process
Mark one or more alarms as processed, optionally with a comment
Use this to mark an alarm as processed, this is useful when you
want to keep track of alarms that have been actioned by the team.
Usage:
Options:
IDS... alarm id \[required]
-m, --message TEXT comment to add to history
-y, --yes acknowledge without confirmation
tail
Watch for alarm updates
Keeps following alarms without you having to run the command
to get updates.
Usage:
view
Mark one or more alarm as viewed, optionally with a comment
Use this to mark an alarm as viewed, this is useful when you
want to keep track of alarms that have been seen by the team.
Usage:
Options:
az
Query access zones on the command centre
Usage:
ch
List, query or manage or watch changes to cardholders
Usage:
find
find cardholders by name
Usage:
Options:
NAME First or last name to search for \[required]
--sort [id|-id|name|-name] Sort order \[default: name]
--desc TEXT Keywords to search in description
--top INTEGER Results to fetch from top \[default: 100]
--div INTEGER Division id for hierarchical search
--ddiv INTEGER Division id for direct search
get
get a cardholder by id
Usage:
Options:
list
list all cardholders
Usage:
comp
Events can queried
Usage:
day
Query or modify items on the command centre
Usage:
div
query or modify divisions
Usage:
get
get a division by id
Usage:
Options:
list
list all divisions
Usage:
door
Door category
Usage:
elevator
Query or modify elevator group
Usage:
event
Events can queried
Usage:
fence
Query fence zone
Usage:
ilock
Interlock
Usage:
item
Query or modify items on the command centre
Usage:
locker
Events can queried
Usage:
macro
Macro search, summary
Usage:
output
Output
Usage:
Query personal data definitions
Usage:
reception
Receptions
Usage:
redaction
Redactions can queried
Usage:
roles
Roles
Usage:
schedule
Schedule
Usage:
visits
Visits
Usage: