diff options
-rw-r--r-- | cli/cli.py | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -48,6 +48,19 @@ class OgREST(): sys.exit(f"Cannot connect to ogServer: {e}") return r + def delete(self, path, payload): + try: + r = requests.delete(f'{self.URL}{path}', + headers=self.HEADERS, + json=payload) + print(r.text) + if r.status_code != 200: + sys.exit(f"Unsuccessful request to ogServer: " + f"{r.status_code} HTTP status code") + except IOError as e: + sys.exit(f"Cannot connect to ogServer: {e}") + return r + class OgCLI(): def __init__(self, cfg): |