'POST /api/repository_revisions/export
Creates and saves a gzip compressed tar archive of a repository and optionally all of its repository dependencies.
The following parameters are included in the payload.
:param tool_shed_url (required): the base URL of the Tool Shed from which the Repository is to be exported
:param name (required): the name of the Repository
:param owner (required): the owner of the Repository
:param changeset_revision (required): the changeset_revision of the RepositoryMetadata object associated with the Repository
:param export_repository_dependencies (optional): whether to export repository dependencies - defaults to False
:param download_dir (optional): the local directory to which to download the archive - defaults to /tmp'

@web.expose_api_anonymous
def export(self, trans, payload, **kwd):

    tool_shed_url = payload.get('tool_shed_url', '')
    if (not tool_shed_url):
        raise HTTPBadRequest(detail="Missing    required    parameter    'tool_shed_url'.")
    tool_shed_url = tool_shed_url.rstrip('/')
    name = payload.get('name', '')
    if (not name):
        raise HTTPBadRequest(detail="Missing    required    parameter    'name'.")
    owner = payload.get('owner', '')
    if (not owner):
        raise HTTPBadRequest(detail="Missing    required    parameter    'owner'.")
    changeset_revision = payload.get('changeset_revision', '')
    if (not changeset_revision):
        raise HTTPBadRequest(detail="Missing    required    parameter    'changeset_revision'.")
    export_repository_dependencies = payload.get('export_repository_dependencies', False)
    export_repository_dependencies = util.asbool(export_repository_dependencies)
    repository = repository_util.get_repository_by_name_and_owner(trans.app, name, owner)
    if (repository is None):
        error_message = ('Cannot    locate    repository    with    name    %s    and    owner    %s,' % (str(name), str(owner)))
        log.debug(error_message)
        return (None, error_message)
    erm = capsule_manager.ExportRepositoryManager(app=trans.app, user=trans.user, tool_shed_url=tool_shed_url, repository=repository, changeset_revision=changeset_revision, export_repository_dependencies=export_repository_dependencies, using_api=True)
    return erm.export_repository()
