You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by im...@apache.org on 2015/10/13 13:06:33 UTC
[10/50] stratos git commit: added list_users to Straos
added list_users to Straos
Signed-off-by: Imesh Gunaratne <im...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/7e05c887
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/7e05c887
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/7e05c887
Branch: refs/heads/stratos-4.1.x
Commit: 7e05c887aa329d169f3415418e8e4f9cbdabdd93
Parents: 5c9a9bf
Author: Milindu Sanoj Kumarage <ag...@gmail.com>
Authored: Sat Jul 25 12:31:14 2015 +0530
Committer: Imesh Gunaratne <im...@apache.org>
Committed: Tue Oct 13 16:32:45 2015 +0530
----------------------------------------------------------------------
.../src/main/python/cli/Stratos.py | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/7e05c887/components/org.apache.stratos.python.cli/src/main/python/cli/Stratos.py
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.python.cli/src/main/python/cli/Stratos.py b/components/org.apache.stratos.python.cli/src/main/python/cli/Stratos.py
index 0c12816..360353d 100755
--- a/components/org.apache.stratos.python.cli/src/main/python/cli/Stratos.py
+++ b/components/org.apache.stratos.python.cli/src/main/python/cli/Stratos.py
@@ -1,4 +1,5 @@
import requests
+import Configs
class Stratos:
@@ -7,4 +8,19 @@ class Stratos:
def __init__(self):
pass
+ @staticmethod
+ def list_users():
+ r = requests.get(Configs.stratos_url + 'users',
+ auth=(Configs.stratos_username, Configs.stratos_password), verify=False)
+ if r.status_code is 200:
+ return r.json()
+
+ elif r.status_code is 400:
+ raise requests.HTTPError()
+
+ @staticmethod
+ def network_partitions():
+ pass
+
+