Getting basic interactions with Tetration via our favourite media, the cli
Project description
Tetrationcli
to interact with Tetration Cluster via the cli
Installation
From PyPI
pip install tetrationcli
From sources
Download the sources from Github, extract and execute the following commands
$ pip install -r requirements.txt
$ pip install setup.py
How to use this application:
To access to the cluster you need to get the API Credentials with the following permissions
sensor_management
- option: SW sensor management: API to configure and monitor status of SW sensorshw_sensor_management
- option: HW sensor management: API to configure and monitor status of HW sensorsflow_inventory_query
- option: Flow and inventory search: API to query flows and inventory items in Tetration clusteruser_role_scope_management
- option: Users, roles and scope management: API for root scope owners to read/add/modify/remove users, roles and scopesapp_policy_management
- option: Applications and policy management: API to manage applications and enforce policies
Download the api_credentials.json locally and have it ready to get the information required for the setup.
A quick look for the help will list the current available options.
$ tetrationcli -h
usage: tetrationcli [-h] [-d] [-q] [-v]
{inventory,vrfs,applications,users,roles,scopes,switches,agents,clear,setup}
...
Tetration Analytics CLI tool
optional arguments:
-h, --help show this help message and exit
-d, --debug full application debug mode
-q, --quiet suppress all console output
-v, --version show program's version number and exit
sub-commands:
{inventory,vrfs,applications,users,roles,scopes,switches,agents,clear,setup}
inventory Interact with Inventory from Tetration Cluster
vrfs Interact with VRFs in Tetration Cluster
applications Interact with ADM Application from Tetration Cluster
users Interact with Users from Tetration Cluster
roles Interact with Roles in Tetration Cluster
scopes Interact with Scopes configured in Tetration Cluster
switches Interact with Hardware Sensors from Tetration Cluster
agents Interact with Software Sensors in Tetration Cluster
clear Clear the configuration
setup Application setup
Usage: tetrationcli command
Each subcommand has its own help that list the options available.
$ tetrationcli agents -h
usage: tetrationcli agents [-h] {delete,list} ...
optional arguments:
-h, --help show this help message and exit
sub-commands:
{delete,list}
delete delete the selected software agent via uuid
list list all software agents installed
Easy setup
Step 1: Issue tetrationcli setup
folow the instructions and place the correct requested information
$ tetrationcli setup
Tetration Analytics cluster (eg: https://great.example.com/): https://great.example.com/
Tetration API Key: ASDASDASADS
Tetration API Secret: ASDASDASDASDFFF
Step 2: Test if you can successfully query the cluster from the command line
$ tetrationcli agents list
Manually setup the application
The file api_credentials.json
downloaded from the cluster is expected to be placed in
folder ~/.config/tetrationcli/
then to define the cluster name you need to create the
config file tetrationcli.conf
in %HOME_USER_FOLDER%/.config/tetrationcli/
total 16
0 drwxr-xr-x 4 user staff 128 Nov 11 16:16 .
0 drwx------ 13 user staff 416 Nov 11 16:10 ..
8 -rw-r--r--@ 1 user staff 111 Nov 11 09:52 api_credentials.json
8 -rw-r--r-- 1 user staff 121 Nov 11 16:16 tetrationcli.conf
and the file tetrationcli.conf
requires the information:
[tetrationcli]
api_endpoint = https://mygreatapp.example.com
api_credentials = ~/.config/tetrationcli/api_credentials.json
More information
Options used
Current scope for tetrationcli
- inventory
- vrfs
- applications
- users
- roles
- scopes
- switches
- agents
For any new functionalites open an issue and we will evaluate to add it.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file tetrationcli-1.0.1.tar.gz
.
File metadata
- Download URL: tetrationcli-1.0.1.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b72f810dd9b2b69cc905f0bb1cef352375680af5b863ca6280430c59fd4802df |
|
MD5 | d030ebfc8cfa362d69f0cb5b4fbf8956 |
|
BLAKE2b-256 | a85077c9e92daafcad1c8ce447345f0306248b8f21cacd830013687626fa2a9a |
File details
Details for the file tetrationcli-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: tetrationcli-1.0.1-py3-none-any.whl
- Upload date:
- Size: 25.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 023a32a8970407ec57d322ef786111dffbb902239f4ba046474cc2b67f9466a9 |
|
MD5 | f833cd7a58bca9da10831bf47d5e4368 |
|
BLAKE2b-256 | 1486e58e5529675a083101af17a44abcce844ad78aded5de16c18e6cc1a83cbc |