allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [36/42] git commit: [#6692] Added documentation for bulk export API
Date Tue, 29 Oct 2013 22:23:37 GMT
[#6692] Added documentation for bulk export API

Signed-off-by: Cory Johns <cjohns@slashdotmedia.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/7cf73601
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/7cf73601
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/7cf73601

Branch: refs/heads/cj/6692
Commit: 7cf73601242ce8629ac4b08a26b17c3926108a02
Parents: 9fe0077
Author: Cory Johns <cjohns@slashdotmedia.com>
Authored: Tue Oct 22 19:39:14 2013 +0000
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Tue Oct 29 15:08:58 2013 +0000

----------------------------------------------------------------------
 Allura/allura/ext/admin/admin_main.py | 28 ++++++++++++++++++++++++++++
 Allura/docs/api/controllers.rst       |  5 +++++
 2 files changed, 33 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/7cf73601/Allura/allura/ext/admin/admin_main.py
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/admin/admin_main.py b/Allura/allura/ext/admin/admin_main.py
index c9ad7e2..68f14e0 100644
--- a/Allura/allura/ext/admin/admin_main.py
+++ b/Allura/allura/ext/admin/admin_main.py
@@ -658,6 +658,9 @@ class ProjectAdminController(BaseController):
 
 
 class ProjectAdminRestController(BaseController):
+    """
+    Exposes RESTful APi for project admin actions.
+    """
 
     def _check_security(self):
         require_access(c.project, 'admin')
@@ -665,6 +668,25 @@ class ProjectAdminRestController(BaseController):
     @expose('json:')
     @require_post()
     def export(self, tools=None, **kw):
+        """
+        Initiate a bulk export of the project data.
+
+        Must be given a list of tool mount points to include in the export.
+        The list can either be comma-separated or a repeated param, e.g.,
+        `export?tools=tickets&tools=discussion`.
+
+        If the tools are not provided, an invalid mount point is listed, or
+        there is some other problems with the arguments, a `400 Bad Request`
+        response will be returned.
+
+        If an export is already currently running for this project, a
+        `503 Unavailable` response will be returned.
+
+        Otherwise, a JSON object of the form
+        `{"status": "in progress", "filename": FILENAME}` will be returned,
+        where `FILENAME` is the filename of the export artifact relative to
+        the users shell account directory.
+        """
         if not asbool(config.get('bulk_export_enabled', True)):
             raise exc.HTTPNotFound()
         if not tools:
@@ -688,6 +710,12 @@ class ProjectAdminRestController(BaseController):
 
     @expose('json:')
     def export_status(self, **kw):
+        """
+        Check the status of a bulk export.
+
+        Returns an object containing only one key, `status`, whose value is
+        either `'busy'` or `'ready'`.
+        """
         status = c.project.bulk_export_status()
         return {'status': status or 'ready'}
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/7cf73601/Allura/docs/api/controllers.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/api/controllers.rst b/Allura/docs/api/controllers.rst
index 2595a07..0413720 100644
--- a/Allura/docs/api/controllers.rst
+++ b/Allura/docs/api/controllers.rst
@@ -26,3 +26,8 @@
 
     .. autoclass:: RestController
         :members:
+
+.. automodule:: allura.ext.admin.admin_main
+
+  .. autoclass:: ProjectAdminRestController
+        :members:


Mime
View raw message