routr-ctl v1.0.20
Routr Command-Line Tool

The rctl is a command-line interface for running commands against a Routr server. This overview covers rctl syntax, describes the command operations and provides common examples. For details about each command, including all the supported flags and subcommands, see the reference documentation below. This tool ships separately from the Routr server.
Installation
To get the Routr Command-Line Tool run the following command:
npm install -g routr-ctlThe command-line tool is now globally accessible.
Alternatively, you can install the tool in seconds on Linux (Ubuntu and others) with:
sudo snap install rctlLogin to a Routr server
To login to a Routr server, use the login command.
rctl login https://127.0.0.1:4567/api/{apiVersion} -u admin -p changeitThe current API version is v1beta1
Syntax
Use the following syntax to run rctl commands from your terminal window:
rctl COMMAND [REF] [flags]where COMMAND, subcommand REF, and flags are:
COMMAND: Specifies the operation that you want to perform on one or more resources. For example, create, get, delete, locate(loc).subcommand: Specifies the resource type. Resource types are case-sensitive, and you can specify the singular, plural, or abbreviated forms. For example, the following commands produce the same output:
$ rctl get gateway gweef506
$ rctl get gateways gweef506
$ rctl get gw gweef506REF: Specifies the reference to the resource. References are case-sensitive. For a full list, omit the reference. For example,$ rctl get agents.flags: Specifies optional flags. For example, you can use the --filter to further reduce the output of thegetcommand .
The --filter flag uses JsonPath to perform the filtering. The root is always '$'. All you need to add is the path to the property and the filter operators. For example:
# This returns all the Numbers in Gateway 'gweef506'
rctl get numbers --filter "@.metadata.gwRef=='gweef506'" If you need help, just run rctl --help from the terminal window.
$ rctl --help
usage: rctl [-h] [-v] COMMAND ...
A tool for the management of a Routr instance
named arguments:
-h, --help show this help message and exit
-v, --version print version information and quit
Commands:
COMMAND
get display a list of resources
create (crea) creates new resource(s)
apply apply changes over existing resource(s)
delete (del) delete an existing resource(s)
locate (loc) locate sip device(s)
registry (reg) shows gateways registrations
proxy run a proxy to the server (beta)
login sets connection info
logout clear session credentials
logs dumps all the available system logs
restart restarts the engine
stop stops the engine
ping checks engine status
version (ver) obtain rctl's version information
config manage routr configuration
Run 'rctl COMMAND --help' for more information on a commandImportant: Some commands (i.e.: create, delete) are not available in the default implementation of the
resourcesmodules. Only persistent implementations support these commands.
Examples: Common operations
Use the following set of examples to help you familiarize yourself with running the commonly used rctl operations:
rctl locate or rctl loc - Locate a sip device registered on the Routr server
// Locate all Sip Devices registered against a Routr server
$ rctl locrctl registry or rctl reg - Shows Gateways current registration.
// Shows the registry
$ rctl regrctl get - List one or more resources.
// List all numbers
$ rctl get numbers
// List all numbers that belong to gateway reference gweef506
$ rctl get numbers --filter "@.metadata.ref=='gweef506'"
// List number by reference
$ rctl get numbers dd50baa4
// List all agents
$ rctl get agentsrctl create - create a new resource.
// Create a new gateway(s) using a .yaml or .yml file
$ rctl create -f new-gateway.yamlrctl apply - update an existing resource(s)
// Update an existing resource(s) .yaml or .yml.
$ rctl apply -f new-gateway.yamlrctl delete - delete a resource.
// Delete all numbers for gateway reference gweef506
$ rctl delete numbers --filter "@.metadata.gwRef=='gweef506'"
// Delete a single agent (using delete alias)
$ rctl del agent ag3f77f6Cheat Sheet
Create, delete, and update are only available in some implementations of the
resourcesmodule.
Request and store token
# Request authentication for subsequent commands
$ rctl login https://127.0.0.1:4567/api/{apiVersion} -u admin -p changeitClear out the session credentials
# Clear session credentials
$ rctl logoutLaunch the Web Console
# The Web Console re-uses the credentials of your Command-Line Tool
rctl proxyShowing the Registry
# Shows all the Gateways that are currently available
$ rctl registry # Shows only current registrations. You may use `reg` for shortLocating SIP Devices
# Find all sip devices available at the location service
$ rctl locate # This list does not include number-ingress-routes or domain-egress-routesCreating Resources
# Create new peers and agents
$ rctl create -f asterisk.yaml # Create Peer in file asterisk.yaml
$ rctl create -f agents-list.yaml # Create Agents in file agents-list.yamlFinding Resources
# Get Numbers
$ rctl get numbers # List all available Numbers
$ rctl get number # List all available Numbers
$ rctl get number --filter "@.metadata.ref=='dd50baa4'" # Shows Number with reference 'Number0001'
$ rctl get number --filter "@.metadata.gwRef=='gweef506'" # Shows Numbers with Gateway reference 'GW1232'
# Get agents
$ rctl get agents # List all AgentsDeleting Resources
# Delete command by refernce or filter
$ rctl delete agent ag3f77f6 # Delete Agent by reference
$ rctl del numbers --filter '@.metadata.gwRef=gweef506' # Delete Numbers using a filterUpdating Resources
$ rctl apply -f asterisk.yaml # Create Peer in file asterisk.yaml
$ rctl apply -f agents-list.yaml # Create Agents in file agents-list.yamlDump all available logs
$ rctl logsRestart the engine
# To restart the engine immediately use the --now flag
$ rctl restart --nowStop the engine
# To stop the engine immediately use the --now flag
$ rctl restart --nowCheck the engine status
$ rctl pingDisplay version information
$ rctl verManage general configuration
# To update configuration use the apply subommand
$ rctl config apply -f /path/to/config.yml
# To see the configuration use the describe subcommand
$ rctl config describe --fullBugs and Feedback
For bugs, questions, and discussions please use the Github Issues
Contributing
For contributing, please see the following links:
Authors
LICENSE
Copyright (C) 2020 by Fonoster Inc. MIT License (see LICENSE for details).
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
7 years ago
7 years ago
7 years ago