restify-ENGYAK

Abstractions should save typing, not thinking! This project will provide a quick and simple CLI for REST API consumption. Build your own library of known API endpoints/modifiers, and consume directly via the CLI.


Keywords
nsx-t, python, python3, rest-api
License
GPL-3.0
Install
pip install restify-ENGYAK==0.2.11

Documentation

Python REST Tool

Synopsis

Provide a python tool to quickly invoke REST calls with a pre-defined list of settings, plays.

Code style: black

How to use this tool

Download the package:

python3 -m pip install restify-ENGYAK

Set Environment Variables. APIUSER and APIPASS are mandatory.

export APIUSER=username
export APIPASS=password
export APIENDPOINT={{ API Full URL }}

Invoke via the CLI:

python3 -m restify -f settings.json list_plays

To build a new settings file:

python3 -m restify create_settings > settings.json

To list plays provided by a settings file:

python3 -m restify -f settings.json list_plays

API Invocation

Once the package is installed, the namshub() API can be used by:

# Import Restify Library
from restify.RuminatingCogitation import Settings
from restify.RuminatingCogitation import Reliquary
# Set the interface - apply from variables no matter what
cogitation_interface = Reliquary(args.f, input_user=api_user, input_pass=api_pass)
# Exposed variables: def namshub(self, namshub_string, namshub_variables=False, namshub_dryrun=False):
cogitation_interface.namshub({{ }}, namshub_variables={{ }})

And then process data from there. namshub currently exports text from the API, and may support a dict in the future.

Notes

Authors

  • Nick Schmidt