Return-Path: X-Original-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 412EF1086E for ; Thu, 31 Oct 2013 18:41:18 +0000 (UTC) Received: (qmail 47856 invoked by uid 500); 31 Oct 2013 18:41:18 -0000 Delivered-To: apmail-incubator-allura-commits-archive@incubator.apache.org Received: (qmail 47812 invoked by uid 500); 31 Oct 2013 18:41:18 -0000 Mailing-List: contact allura-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: allura-dev@incubator.apache.org Delivered-To: mailing list allura-commits@incubator.apache.org Received: (qmail 47534 invoked by uid 99); 31 Oct 2013 18:41:18 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Oct 2013 18:41:17 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 91D9466AF; Thu, 31 Oct 2013 18:41:17 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: johnsca@apache.org To: allura-commits@incubator.apache.org Date: Thu, 31 Oct 2013 18:41:37 -0000 Message-Id: <97892bdd0dc24e5a98b0db8ea919b982@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [22/27] git commit: [#6692] Added documentation for bulk export API [#6692] Added documentation for bulk export API Signed-off-by: Cory Johns 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 Authored: Tue Oct 22 19:39:14 2013 +0000 Committer: Cory Johns 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: