allura.controllers

Controllers for the allura application.

REST Controller

class allura.controllers.rest.RestController
index(**kw)

Return site summary information as JSON.

Currently, the only summary information returned are any site_stats whose providers are defined as entry points under the ‘allura.site_stats’ group in a package or tool’s setup.py, e.g.:

[allura.site_stats]
new_users_24hr = allura.site_stats:new_users_24hr

The stat provider will be called with no arguments to generate the stat, which will be included under a key equal to the name of the entry point.

Example output:

{
    'site_stats': {
        'new_users_24hr': 10
    }
}
class allura.ext.admin.admin_main.ProjectAdminRestController

Exposes RESTful API for project admin actions.

admin_options(mount_point=None, **kw)

Returns the admin options for a given mount_point

export(tools=None, send_email=False, with_attachments=False, **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.

export_status(**kw)

Check the status of a bulk export.

Returns an object containing only one key, status, whose value is either ‘busy’ or ‘ready’.

install_tool(tool=None, mount_point=None, mount_label=None, order=None, **kw)

API for installing tools in current project.

Requires a valid tool, mount point and mount label names. (All arguments are required.)

Usage example:

POST to:
/rest/p/testproject/admin/install_tool/

with params:
{
    'tool': 'tickets',
    'mount_point': 'mountpoint',
    'mount_label': 'mountlabel',
    'order': 'first|last|alpha_tool'
}

Example output (in successful case):

{
    "info": "Tool tickets with mount_point mountpoint and mount_label mountlabel was created.",
    "success": true
}
installable_tools(**kw)

List of installable tools and their default options.