'POST /api/tool_shed_repositories/install_repository_revision
Install a specified repository revision from a specified tool shed into Galaxy.
:param key: the current Galaxy admin user\'s API key
The following parameters are included in the payload.
:param tool_shed_url (required): the base URL of the Tool Shed from which to install the Repository
: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 new_tool_panel_section_label (optional): label of a new section to be added to the Galaxy tool panel in which to load
tools contained in the Repository.  Either this parameter must be an empty string or
the tool_panel_section_id parameter must be an empty string or both must be an empty
string (both cannot be used simultaneously).
:param tool_panel_section_id (optional): id of the Galaxy tool panel section in which to load tools contained in the Repository.
If this parameter is an empty string and the above new_tool_panel_section_label parameter is an
empty string, tools will be loaded outside of any sections in the tool panel.  Either this
parameter must be an empty string or the tool_panel_section_id parameter must be an empty string
of both must be an empty string (both cannot be used simultaneously).
:param install_repository_dependencies (optional): Set to True if you want to install repository dependencies defined for the specified
repository being installed.  The default setting is False.
:param install_tool_dependencies (optional): Set to True if you want to install tool dependencies defined for the specified repository being
installed.  The default setting is False.
:param shed_tool_conf (optional): The shed-related tool panel configuration file configured in the "tool_config_file" setting in the Galaxy config file
(e.g., galaxy.ini).  At least one shed-related tool panel config file is required to be configured. Setting
this parameter to a specific file enables you to choose where the specified repository will be installed because
the tool_path attribute of the <toolbox> from the specified file is used as the installation location
(e.g., <toolbox tool_path="../shed_tools">).  If this parameter is not set, a shed-related tool panel configuration
file will be selected automatically.'

@expose_api
def install_repository_revision(self, trans, payload, **kwd):

    (tool_shed_url, name, owner, changeset_revision) = self.__parse_repository_from_payload(payload, include_changeset=True)
    self.__ensure_can_install_repos(trans)
    irm = InstallRepositoryManager(self.app)
    installed_tool_shed_repositories = irm.install(tool_shed_url, name, owner, changeset_revision, payload)
    def to_dict(tool_shed_repository):
        tool_shed_repository_dict = tool_shed_repository.as_dict(value_mapper=self.__get_value_mapper(trans, tool_shed_repository))
        tool_shed_repository_dict['url'] = web.url_for(controller='tool_shed_repositories', action='show', id=trans.security.encode_id(tool_shed_repository.id))
        return tool_shed_repository_dict
    if installed_tool_shed_repositories:
        return map(to_dict, installed_tool_shed_repositories)
    message = 'No    repositories    were    installed,    possibly    because    the    selected    repository    has    already    been    installed.'
    return dict(status='ok', message=message)
