Pody client utility โ
Pody client CLI utility is a command-line tool that allows you to interact with the Pody API. It act like curl but is more fiendly for Pody API.
The utility is written in Python and can be installed using pip:
pip install podyConfiguration โ
The authentication is done by setup the environment variables PODY_API_BASE, PODY_USERNAME and PODY_PASSWORD.
One way to do this is to set them in your shell profile file (e.g. .bashrc, .zshrc):
export PODY_API_BASE="http://localhost:5000"
export PODY_USERNAME="username"
export PODY_PASSWORD="password"Another way is to use a configuration file, e.g. you can create a directory to store your credentials:
mkdir -p ~/pody-credentials
vi ~/pody-credentials/node1.sh # set the variables as aboveThen you can source the file in your shell profile to login to the server ๐๐:
source ~/pody-credentials/node1.shThe latter method is more flexible and allows you to switch between different servers easily.
Usage โ
The usage follows folloiwing pattern:
pody [METHOD] [ROUTE] [OPTIONS...]For example, to restart a pod you can run:
pody post pod/restart ins:myinsThe method is not strictly a HTTP method, it can be one of get, post, fetch, help, version. Notebly, fetch is used to automatically select appropriate method based on the route. So the above command can be written as:
pody fetch pod/restart ins:myinsUse shorthand! ๐
pody fetch is the most used command, a simple shorthand podx is provided for it. Which means podx ... is equivalent to pody fetch .... The above command can be written as :
podx pod/restart ins:myinsHelp โ
You can also use help to get help on a specific route, or a subset of routes:
pody help pod/restart
pody help pod/Example
pody help user/โโโโโโโโโโโโโโโโโโโณโโโโโโโโโโณโโโโโโโโโ
โ Path โ Methods โ Params โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ /user/info โ GET โ โ
โ /user/list โ GET โ โ
โ /user/ch-passwd โ POST โ passwd โ
โโโโโโโโโโโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโAnother shorthand ๐
The get/post/fetch methods, when applied to a route, will invoke the help method instead,
i.e. pody get user/ or podx user/ will invoke pody help user/ and show the parameters.
To get the version of the utility:
pody versionYou should use this command to check if the utility version is in sync with the server version.