api Package¶
repositories
Module¶
-
class
galaxy.webapps.tool_shed.api.repositories.
RepositoriesController
(app)[source]¶ Bases:
galaxy.web.base.controller.BaseAPIController
RESTful controller for interactions with repositories in the Tool Shed.
-
add_repository_registry_entry
(trans, *args, **kwargs)[source]¶ POST /api/repositories/add_repository_registry_entry Adds appropriate entries to the repository registry for the repository defined by the received name and owner.
Parameters: key – the user’s API key The following parameters are included in the payload. :param tool_shed_url (required): the base URL of the Tool Shed containing the Repository :param name (required): the name of the Repository :param owner (required): the owner of the Repository
-
create
(self, trans, payload, **kwd)[source]¶ - POST /api/repositories:
Creates a new repository. Only
name
andsynopsis
parameters are required.
Parameters: payload (dict) – dictionary structure containing:: ‘name’: new repo’s name (required) ‘synopsis’: new repo’s synopsis (required) ‘description’: new repo’s description (optional) ‘remote_repository_url’: new repo’s remote repo (optional) ‘homepage_url’: new repo’s homepage url (optional) ‘category_ids[]’: list of existing encoded TS category ids
the new repo should be associated with (optional)‘type’: new repo’s type, defaults to
unrestricted
(optional)Returns: detailed repository information Return type: dict Raises: RequestParameterMissingException, RequestParameterInvalidException
-
create_changeset_revision
(trans, *args, **kwargs)[source]¶ POST /api/repositories/{encoded_repository_id}/changeset_revision
Create a new tool shed repository commit - leaving PUT on parent resource open for updating meta-attributes of the repository (and Galaxy doesn’t allow PUT multipart data anyway https://trello.com/c/CQwmCeG6).
Parameters: id – the encoded id of the Repository object The following parameters may be included in the payload. :param commit_message: hg commit message for update.
-
get_ordered_installable_revisions
(trans, *args, **kwargs)[source]¶ GET /api/repositories/get_ordered_installable_revisions
Parameters: - name – the name of the Repository
- owner – the owner of the Repository
Returns the ordered list of changeset revision hash strings that are associated with installable revisions. As in the changelog, the list is ordered oldest to newest.
-
get_repository_revision_install_info
(trans, *args, **kwargs)[source]¶ GET /api/repositories/get_repository_revision_install_info
Parameters: - name – the name of the Repository
- owner – the owner of the Repository
- changeset_revision – the changeset_revision of the RepositoryMetadata object associated with the Repository
Returns a list of the following dictionaries:: - a dictionary defining the Repository. For example: {
“deleted”: false, “deprecated”: false, “description”: “add_column hello”, “id”: “f9cad7b01a472135”, “long_description”: “add_column hello”, “name”: “add_column”, “owner”: “test”, “private”: false, “times_downloaded”: 6, “url”: “/api/repositories/f9cad7b01a472135”, “user_id”: “f9cad7b01a472135”} - a dictionary defining the Repository revision (RepositoryMetadata). For example: {
“changeset_revision”: “3a08cc21466f”, “downloadable”: true, “has_repository_dependencies”: false, “has_repository_dependencies_only_if_compiling_contained_td”: false, “id”: “f9cad7b01a472135”, “includes_datatypes”: false, “includes_tool_dependencies”: false, “includes_tools”: true, “includes_tools_for_display_in_tool_panel”: true, “includes_workflows”: false, “malicious”: false, “repository_id”: “f9cad7b01a472135”, “url”: “/api/repository_revisions/f9cad7b01a472135”} - a dictionary including the additional information required to install the repository. For example: {
- “add_column”: [
- “add_column hello”, “http://test@localhost:9009/repos/test/add_column”, “3a08cc21466f”, “1”, “test”, {}, {}
]
}
-
import_capsule
(trans, *args, **kwargs)[source]¶ POST /api/repositories/new/import_capsule Import a repository capsule into the Tool Shed.
Parameters: key – the user’s API key The following parameters are included in the payload. :param tool_shed_url (required): the base URL of the Tool Shed into which the capsule should be imported. :param capsule_file_name (required): the name of the capsule file.
-
index
(trans, *args, **kwargs)[source]¶ GET /api/repositories
Parameters: - deleted – True/False, displays repositories that are or are not set to deleted.
- owner – the owner’s public username.
- name – the repository name.
Displays a collection (list) of repositories.
-
remove_repository_registry_entry
(trans, *args, **kwargs)[source]¶ POST /api/repositories/remove_repository_registry_entry Removes appropriate entries from the repository registry for the repository defined by the received name and owner.
Parameters: key – the user’s API key The following parameters are included in the payload. :param tool_shed_url (required): the base URL of the Tool Shed containing the Repository :param name (required): the name of the Repository :param owner (required): the owner of the Repository
-
repository_ids_for_setting_metadata
(trans, *args, **kwargs)[source]¶ GET /api/repository_ids_for_setting_metadata
Displays a collection (list) of repository ids ordered for setting metadata.
Parameters: - key – the API key of the Tool Shed user.
- (optional) (my_writable) – if the API key is associated with an admin user in the Tool Shed, setting this param value to True will restrict resetting metadata to only repositories that are writable by the user in addition to those repositories of type tool_dependency_definition. This param is ignored if the current user is not an admin user, in which case this same restriction is automatic.
-
reset_metadata_on_repositories
(trans, *args, **kwargs)[source]¶ PUT /api/repositories/reset_metadata_on_repositories
Resets all metadata on all repositories in the Tool Shed in an “orderly fashion”. Since there are currently only two repository types (tool_dependecy_definition and unrestricted), the order in which metadata is reset is repositories of type tool_dependecy_definition first followed by repositories of type unrestricted, and only one pass is necessary. If a new repository type is introduced, the process will undoubtedly need to be revisited. To facilitate this order, an in-memory list of repository ids that have been processed is maintained.
Parameters: key – the API key of the Tool Shed user. The following parameters can optionally be included in the payload. :param my_writable (optional): if the API key is associated with an admin user in the Tool Shed, setting this param value
to True will restrict resetting metadata to only repositories that are writable by the user in addition to those repositories of type tool_dependency_definition. This param is ignored if the current user is not an admin user, in which case this same restriction is automatic.Parameters: - (optional) (skip_file) – a list of encoded repository ids for repositories that should not be processed.
- (optional) – A local file name that contains the encoded repository ids associated with repositories to skip. This param can be used as an alternative to the above encoded_ids_to_skip.
-
reset_metadata_on_repository
(trans, *args, **kwargs)[source]¶ PUT /api/repositories/reset_metadata_on_repository
Resets all metadata on a specified repository in the Tool Shed.
Parameters: key – the API key of the Tool Shed user. The following parameters must be included in the payload. :param repository_id: the encoded id of the repository on which metadata is to be reset.
-
show
(trans, *args, **kwargs)[source]¶ GET /api/repositories/{encoded_repository_id} Returns information about a repository in the Tool Shed.
Example URL: http://localhost:9009/api/repositories/f9cad7b01a472135
Parameters: id (encoded str) – the encoded id of the Repository object Returns: detailed repository information Return type: dict Raises: ObjectNotFound, MalformedId
-
update
(trans, *args, **kwargs)[source]¶ PATCH /api/repositories/{encoded_repository_id} Updates information about a repository in the Tool Shed.
Parameters: - id – the encoded id of the Repository object
- payload (dict) –
dictionary structure containing:: ‘name’: repo’s name (optional) ‘synopsis’: repo’s synopsis (optional) ‘description’: repo’s description (optional) ‘remote_repository_url’: repo’s remote repo (optional) ‘homepage_url’: repo’s homepage url (optional) ‘category_ids’: list of existing encoded TS category ids
the updated repo should be associated with (optional)
Returns: detailed repository information
Return type: dict
Raises: RequestParameterInvalidException, InsufficientPermissionsException
-
repository_revisions
Module¶
-
class
galaxy.webapps.tool_shed.api.repository_revisions.
RepositoryRevisionsController
(app)[source]¶ Bases:
galaxy.web.base.controller.BaseAPIController
RESTful controller for interactions with tool shed repository revisions.
-
export
(trans, *args, **kwargs)[source]¶ 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
-
index
(trans, *args, **kwargs)[source]¶ GET /api/repository_revisions Displays a collection (list) of repository revisions.
-
repository_dependencies
(trans, *args, **kwargs)[source]¶ GET /api/repository_revisions/{encoded repository_metadata id}/repository_dependencies
Returns a list of dictionaries that each define a specific downloadable revision of a repository in the Tool Shed. This method returns dictionaries with more information in them than other methods in this controller. The information about repository_metdata is enhanced to include information about the repository (e.g., name, owner, etc) associated with the repository_metadata record.
Parameters: id – the encoded id of the RepositoryMetadata object
-