summaryrefslogtreecommitdiffstats
path: root/pykolab/wap_client/__init__.py
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-02-19 14:08:32 -0500
committerThomas Bruederli <bruederli@kolabsys.com>2014-02-19 14:08:32 -0500
commit09da7edba58a0b7137f2a29f95bea5f5bfb7ac52 (patch)
tree60fb53252d7250f5034f52c9c54f1c44a3c54fe3 /pykolab/wap_client/__init__.py
parenta22f4b8ef619b4dd8ea85c4248198ee8c4eae7ce (diff)
downloadpykolab-09da7edba58a0b7137f2a29f95bea5f5bfb7ac52.tar.gz
Add WAP client functions to manage resources + functional tests for them
Diffstat (limited to 'pykolab/wap_client/__init__.py')
-rw-r--r--pykolab/wap_client/__init__.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/pykolab/wap_client/__init__.py b/pykolab/wap_client/__init__.py
index 674673c..54ef541 100644
--- a/pykolab/wap_client/__init__.py
+++ b/pykolab/wap_client/__init__.py
@@ -524,3 +524,28 @@ def user_types_list():
def users_list():
return request('GET', 'users.list')
+def resource_types_list():
+ return request('GET', 'resource_types.list')
+
+def resources_list():
+ return request('GET', 'resources.list')
+
+def resource_info(resource=None):
+ if resource == None:
+ resource = utils.ask_question("Resource DN")
+ return request('GET', 'resource.info', get={ 'id': resource })
+
+def resource_add(params=None):
+ if params == None:
+ params = get_user_input()
+
+ return request('POST', 'resource.add', post=json.dumps(params))
+
+def resource_delete(params=None):
+ if params == None:
+ params = {
+ 'id': utils.ask_question("Resource DN to delete", "resource")
+ }
+
+ return request('POST', 'resource.delete', post=json.dumps(params))
+