A CLI client which consumes the web service supporting following commands:
- get : displays the value of an existing key over HTTP.
- set : sets the value of the given key.
- watch : when executed this displays any new changes happening on the KV store in real time to the given key.
This script supports only Python 3.x
$ git clone https://github.com/deepak-nii/key-value_store_CLI_web-service.git
$ cd key-value_store_CLI_web-service
$ pip install -r requirements.txt
For Client
$ client.py [-h] <key> [--set] [--watch] [--root http://0.0.0.0:8080]
positional arguments:
key
optional arguments:
-h, --help show this help message and exit
--set
--watch
--root http://0.0.0.0:8080
For Server
$ server.py
For server
$ server.py
======== Running on http://0.0.0.0:8080 ========
(Press CTRL+C to quit)
watch: When executed this displays any new changes happening on the KV store in real time to the given key.
$ client.py random-key --watch
{"random-key": "12345"}
set: sets the value of the given key.
$ client.py random-key --set 12345
root (i.e. get) : displays the value of an existing key over HTTP.
$ client.py random-key --root http://0.0.0.0:8080
{'random-key': '12345'}