'POST /api/tool_shed_repositories/install
Initiate the installation of a repository.
:param install_resolver_dependencies: True to install resolvable dependencies.
:param install_tool_dependencies: True to install tool dependencies.
:param install_repository_dependencies: True to install repository dependencies.
:param tool_panel_section_id: The unique identifier for an existing tool panel section
:param new_tool_panel_section_label: Create a new tool panel section with this label
:param shed_tool_conf: The shed tool config file to use for this installation
:param tool_shed_url: The URL for the toolshed whence this repository is being installed
:param changeset: The changeset to update to after cloning the repository'

@expose_api
@web.require_admin
def install(self, trans, **kwd):

    irm = InstallRepositoryManager(self.app)
    tool_shed_url = kwd.get('tool_shed_url', None)
    repositories = json.loads(kwd.get('repositories', '[]'))
    repo_info_dict = self.__get_repo_info_dict(trans, repositories, tool_shed_url)
    includes_tools = False
    includes_tools_for_display_in_tool_panel = False
    has_repository_dependencies = False
    includes_tool_dependencies = False
    install_resolver_dependencies = util.asbool(kwd.get('install_resolver_dependencies', False))
    for encoded_repo_info_dict in repo_info_dict.get('repo_info_dicts', []):
        decoded_repo_info_dict = encoding_util.tool_shed_decode(encoded_repo_info_dict)
        if (not includes_tools):
            includes_tools = util.string_as_bool(decoded_repo_info_dict.get('includes_tools', False))
        if (not includes_tools_for_display_in_tool_panel):
            includes_tools_for_display_in_tool_panel = util.string_as_bool(decoded_repo_info_dict.get('includes_tools_for_display_in_tool_panel', False))
        if (not has_repository_dependencies):
            has_repository_dependencies = util.string_as_bool(repo_info_dict.get('has_repository_dependencies', False))
        if (not includes_tool_dependencies):
            includes_tool_dependencies = util.string_as_bool(repo_info_dict.get('includes_tool_dependencies', False))
    encoded_repo_info_dicts = util.listify(repo_info_dict.get('repo_info_dicts', []))
    repo_info_dicts = [encoding_util.tool_shed_decode(encoded_repo_info_dict) for encoded_repo_info_dict in encoded_repo_info_dicts]
    tool_panel_section_id = kwd.get('tool_panel_section_id', None)
    new_tool_panel_section_label = kwd.get('new_tool_panel_section', None)
    tool_panel_section_mapping = json.loads(kwd.get('tool_panel_section', '{}'))
    install_tool_dependencies = util.asbool(kwd.get('install_tool_dependencies', False))
    install_repository_dependencies = util.asbool(kwd.get('install_repository_dependencies', False))
    shed_tool_conf = kwd.get('shed_tool_conf', None)
    tool_path = suc.get_tool_path_by_shed_tool_conf_filename(self.app, shed_tool_conf)
    installation_dict = dict(install_repository_dependencies=install_repository_dependencies, new_tool_panel_section_label=new_tool_panel_section_label, no_changes_checked=False, repo_info_dicts=repo_info_dicts, tool_panel_section_id=tool_panel_section_id, tool_path=tool_path, tool_shed_url=tool_shed_url)
    (new_repositories, tool_panel_keys, repo_info_dicts, filtered_repos) = irm.handle_tool_shed_repositories(installation_dict)
    if new_repositories:
        installation_dict = dict(created_or_updated_tool_shed_repositories=new_repositories, filtered_repo_info_dicts=filtered_repos, has_repository_dependencies=has_repository_dependencies, includes_tool_dependencies=includes_tool_dependencies, includes_tools=includes_tools, includes_tools_for_display_in_tool_panel=includes_tools_for_display_in_tool_panel, install_repository_dependencies=install_repository_dependencies, install_tool_dependencies=install_tool_dependencies, message='', new_tool_panel_section_label=new_tool_panel_section_label, tool_panel_section_mapping=tool_panel_section_mapping, install_resolver_dependencies=install_resolver_dependencies, shed_tool_conf=shed_tool_conf, status='ok', tool_panel_section_id=tool_panel_section_id, tool_panel_section_keys=tool_panel_keys, tool_path=tool_path, tool_shed_url=tool_shed_url)
        (encoded_kwd, query, tool_shed_repositories, encoded_repository_ids) = irm.initiate_repository_installation(installation_dict)
        return json.dumps(dict(operation='install', api=True, install_resolver_dependencies=install_resolver_dependencies, install_tool_dependencies=install_tool_dependencies, encoded_kwd=encoded_kwd, reinstalling=False, tool_shed_repository_ids=json.dumps([repo[0] for repo in repositories]), repositories=[trans.security.encode_id(repo.id) for repo in new_repositories]))
