summaryrefslogtreecommitdiffstats
path: root/cli.py
diff options
context:
space:
mode:
authorMark Beierl <mark.beierl@emc.com>2016-05-20 09:30:46 -0400
committerMark Beierl <mark.beierl@emc.com>2016-05-20 09:30:46 -0400
commit68b1262791f4d0e0ea5cf7caa16678ea72307527 (patch)
treeef866936240e9d16ea521336ed9c9575887468cd /cli.py
parent3a179cd6fb3cc3358a2c78815e1a59f4ee68487b (diff)
Standardize the ReST API
Change-Id: I004824711abf17f06781302cf48a0b0e3d095ecb Signed-off-by: Mark Beierl <mark.beierl@emc.com>
Diffstat (limited to 'cli.py')
-rw-r--r--cli.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/cli.py b/cli.py
index 85ebcfd..fda05c2 100644
--- a/cli.py
+++ b/cli.py
@@ -17,12 +17,11 @@ import json
import logging
import logging.config
import logging.handlers
+import requests
import socket
import struct
import sys
-import requests
-
class Usage(Exception):
pass
@@ -132,7 +131,7 @@ def main(argv=None):
if (erase):
response = requests.delete(
- 'http://127.0.0.1:5000/api/v1.0/configure')
+ 'http://127.0.0.1:5000/api/v1.0/configurations')
if (response.status_code == 400):
content = json.loads(response.content)
raise Usage(content['message'])
@@ -140,7 +139,7 @@ def main(argv=None):
if (terminate):
response = requests.delete(
- 'http://127.0.0.1:5000/api/v1.0/job')
+ 'http://127.0.0.1:5000/api/v1.0/jobs')
if (response.status_code == 400):
content = json.loads(response.content)
raise Usage(content['message'])
@@ -148,7 +147,7 @@ def main(argv=None):
if (configuration is not None):
response = requests.post(
- 'http://127.0.0.1:5000/api/v1.0/configure', json=configuration)
+ 'http://127.0.0.1:5000/api/v1.0/configurations', json=configuration)
if (response.status_code == 400):
content = json.loads(response.content)
raise Usage(content['message'])
@@ -156,7 +155,7 @@ def main(argv=None):
if (report is not None):
print "Fetching report for %s..." % (report,)
response = requests.get(
- 'http://127.0.0.1:5000/api/v1.0/job?id=%s' % (report,))
+ 'http://127.0.0.1:5000/api/v1.0/jobs?id=%s' % (report,))
if (response.status_code == 400):
content = json.loads(response.content)
raise Usage(content['message'])
@@ -165,7 +164,7 @@ def main(argv=None):
else:
print "Calling start..."
response = requests.post(
- 'http://127.0.0.1:5000/api/v1.0/job', json=options)
+ 'http://127.0.0.1:5000/api/v1.0/jobs', json=options)
if (response.status_code == 400):
content = json.loads(response.content)
raise Usage(content['message'])