incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [22/27] git commit: [#6692] Added documentation for bulk export API
Date Thu, 31 Oct 2013 18:41: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/cf02aab2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/cf02aab2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/cf02aab2

Branch: refs/heads/cj/6692
Commit: cf02aab29d70cf3f56e5ccf3f3b306859838b1cd
Parents: 9f34fc5
Author: Cory Johns <cjohns@slashdotmedia.com>
Authored: Tue Oct 22 19:39:14 2013 +0000
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Thu Oct 31 18:41:03 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/cf02aab2/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/cf02aab2/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