diff --git a/astakosclient/astakosclient/__init__.py b/astakosclient/astakosclient/__init__.py
index 004ee7e8caeed532bd2169e1808ac1bc8163a196..50e297106dd711e88d26bd516f60e3ed30ad32dd 100644
--- a/astakosclient/astakosclient/__init__.py
+++ b/astakosclient/astakosclient/__init__.py
@@ -233,10 +233,6 @@ class AstakosClient(object):
def api_projects(self):
return join_urls(self.account_prefix, "projects")
- @property
- def api_applications(self):
- return join_urls(self.api_projects, "apps")
-
@property
def api_memberships(self):
return join_urls(self.api_projects, "memberships")
@@ -893,56 +889,30 @@ class AstakosClient(object):
path = join_urls(self.api_projects, str(project_id))
path = join_urls(path, "action")
req_headers = {'content-type': 'application/json'}
- req_body = parse_request({action: reason}, self.logger)
+ req_body = parse_request({action: {"reason": reason}}, self.logger)
return self._call_astakos(path, headers=req_headers,
body=req_body, method="POST")
- # --------------------------------
- # do a GET to ``API_APPLICATIONS``
- def get_applications(self, project=None):
- """Retrieve all accessible applications
-
- Arguments:
- project -- filter by project (optional)
-
- In case of success, return a list of application descriptions.
- """
- req_headers = {'content-type': 'application/json'}
- body = {"project": project} if project is not None else None
- req_body = parse_request(body, self.logger) if body else None
- return self._call_astakos(self.api_applications,
- headers=req_headers, body=req_body)
-
- # -----------------------------------------
- # do a GET to ``API_APPLICATIONS``/<app_id>
- def get_application(self, app_id):
- """Retrieve application description, if accessible
-
- Arguments:
- app_id -- application identifier
-
- In case of success, return application description.
- """
- path = join_urls(self.api_applications, str(app_id))
- return self._call_astakos(path)
-
# -------------------------------------------------
- # do a POST to ``API_APPLICATIONS``/<app_id>/action
- def application_action(self, app_id, action, reason=""):
- """Perform action on an application
+ # do a POST to ``API_PROJECTS``/<project_id>/action
+ def application_action(self, project_id, app_id, action, reason=""):
+ """Perform action on a project application
Arguments:
- app_id -- application identifier
- action -- action to perform, one of "approve", "deny",
- "dismiss", "cancel"
- reason -- reason of performing the action
+ project_id -- project identifier
+ app_id -- application identifier
+ action -- action to perform, one of "approve", "deny",
+ "dismiss", "cancel"
+ reason -- reason of performing the action
In case of success, return nothing.
"""
- path = join_urls(self.api_applications, str(app_id))
+ path = join_urls(self.api_projects, str(project_id))
path = join_urls(path, "action")
req_headers = {'content-type': 'application/json'}
- req_body = parse_request({action: reason}, self.logger)
+ req_body = parse_request({action: {
+ "reasons": reason,
+ "app_id": app_id}}, self.logger)
return self._call_astakos(path, headers=req_headers,
body=req_body, method="POST")
diff --git a/astakosclient/docs/index.rst b/astakosclient/docs/index.rst
index d802837a74f824879ec5d25110fc2be54d63ab87..a945b2f6c761ee91a2bdf93370bc06226a8d77b0 100644
--- a/astakosclient/docs/index.rst
+++ b/astakosclient/docs/index.rst
@@ -204,14 +204,8 @@ retry=0, use_pool=False, pool_size=8, logger=None\ **)**
**project_action(**\ project_id, action, reason=""\ **)**
Perform action on a project
- **get_applications(**\ project=None\ **)**
- Retrieve all accessible applications
-
- **get_application(**\ app_id\ **)**
- Retrieve application description, if accessible
-
- **application_action(**\ app_id, action, reason=""\ **)**
- Perform action on an application
+ **application_action(**\ project_id, app_id, action, reason=""\ **)**
+ Perform action on a project application
**get_memberships(**\ project=None\ **)**
Retrieve all accessible memberships