Warning

This document is for an old release of Galaxy. You can alternatively view this page in the latest release if it exists or view the top of the latest release's documentation.

Galaxy API

annotations module

API operations on annotations.

class galaxy.webapps.galaxy.api.annotations.BaseAnnotationsController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesStoredWorkflowMixin, galaxy.model.item_attrs.UsesAnnotations

index(trans, *args, **kwargs)[source]
create(trans, *args, **kwargs)[source]
delete(trans, *args, **kwargs)[source]
undelete(trans, *args, **kwargs)[source]
class galaxy.webapps.galaxy.api.annotations.HistoryAnnotationsController(app)[source]

Bases: galaxy.webapps.galaxy.api.annotations.BaseAnnotationsController

controller_name = 'history_annotations'
tagged_item_id = 'history_id'
__init__(app)[source]
class galaxy.webapps.galaxy.api.annotations.HistoryContentAnnotationsController(app)[source]

Bases: galaxy.webapps.galaxy.api.annotations.BaseAnnotationsController

controller_name = 'history_content_annotations'
tagged_item_id = 'history_content_id'
__init__(app)[source]
class galaxy.webapps.galaxy.api.annotations.WorkflowAnnotationsController(app)[source]

Bases: galaxy.webapps.galaxy.api.annotations.BaseAnnotationsController

controller_name = 'workflow_annotations'
tagged_item_id = 'workflow_id'

authenticate module

API key retrieval through BaseAuth Sample usage:

curl –user zipzap@foo.com:password http://localhost:8080/api/authenticate/baseauth

Returns:

{
“api_key”: “baa4d6e3a156d3033f05736255f195f9”

}

class galaxy.webapps.galaxy.api.authenticate.AuthenticationController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

__init__(app)[source]
get_api_key(trans, *args, **kwargs)[source]

def get_api_key( self, trans, **kwd ) * GET /api/authenticate/baseauth

returns an API key for authenticated user based on BaseAuth headers
Returns:api_key in json format
Return type:dict
Raises:ObjectNotFound, HTTPBadRequest

configuration module

API operations allowing clients to determine Galaxy instance’s capabilities and configuration settings.

class galaxy.webapps.galaxy.api.configuration.ConfigurationController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

__init__(app)[source]
whoami(trans, *args, **kwargs)[source]

GET /api/whoami Return information about the current authenticated user.

Returns:dictionary with user information
Return type:dict
index(trans, *args, **kwargs)[source]

GET /api/configuration Return an object containing exposable configuration settings.

Note: a more complete list is returned if the user is an admin.

version(trans, *args, **kwargs)[source]

GET /api/version Return a description of the major version of Galaxy (e.g. 15.03).

Return type:dict
Returns:dictionary with major version keyed on ‘version_major’
get_config_dict(trans, return_admin=False, view=None, keys=None, default_view='all')[source]

Return a dictionary with (a subset of) current Galaxy settings.

If return_admin also include a subset of more sensitive keys. Pass in view (String) and comma seperated list of keys to control which configuration settings are returned.

dynamic_tool_confs(trans, *args, **kwargs)[source]
decode_id(trans, *args, **kwargs)[source]

Decode a given id.

tool_lineages(trans, *args, **kwargs)[source]
reload_toolbox(trans, *args, **kwargs)[source]

PUT /api/configuration/toolbox Reload the Galaxy toolbox (but not individual tools).

dataset_collections module

class galaxy.webapps.galaxy.api.dataset_collections.DatasetCollectionsController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesLibraryMixinItems

__init__(app)[source]
index(trans, *args, **kwargs)[source]
create(trans, *args, **kwargs)[source]
  • POST /api/dataset_collections:
    create a new dataset collection instance.
Parameters:payload (dict) – (optional) dictionary structure containing: * collection_type: dataset colltion type to create. * instance_type: Instance type - ‘history’ or ‘library’. * name: the new dataset collections’s name * datasets: object describing datasets for collection
Return type:dict
Returns:element view of new dataset collection
show(trans, *args, **kwargs)[source]

datasets module

API operations on the contents of a history dataset.

class galaxy.webapps.galaxy.api.datasets.DatasetsController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesVisualizationMixin

__init__(app)[source]
index(trans, *args, **kwargs)[source]

GET /api/datasets Lists datasets.

show(trans, *args, **kwargs)[source]

GET /api/datasets/{encoded_dataset_id} Displays information about and/or content of a dataset.

display(trans, *args, **kwargs)[source]

GET /api/histories/{encoded_history_id}/contents/{encoded_content_id}/display Displays history content (dataset).

The query parameter ‘raw’ should be considered experimental and may be dropped at some point in the future without warning. Generally, data should be processed by its datatype prior to display (the defult if raw is unspecified or explicitly false.

get_metadata_file(trans, *args, **kwargs)[source]
converted(self, trans, dataset_id, ext, **kwargs)[source]
  • GET /api/datasets/{dataset_id}/converted/{ext}
    return information about datasets made by converting this dataset to a new format
Parameters:
  • dataset_id (str) – the encoded id of the original HDA to check
  • ext (str) – file extension of the target format or None.

If there is no existing converted dataset for the format in ext, one will be created.

If ext is None, a dictionary will be returned of the form { <converted extension> : <converted id>, … } containing all the existing converted datasets.

..note: view and keys are also available to control the serialization
of individual datasets. They have no effect when ext is None.
Return type:dict
Returns:dictionary containing detailed HDA information or (if ext is None) an extension->dataset_id map

datatypes module

API operations allowing clients to determine datatype supported by Galaxy.

class galaxy.webapps.galaxy.api.datatypes.DatatypesController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

index(trans, *args, **kwargs)[source]

GET /api/datatypes Return an object containing upload datatypes.

mapping(trans, *args, **kwargs)[source]

GET /api/datatypes/mapping Return a dictionary of class to class mappings.

sniffers(trans, *args, **kwargs)[source]

GET /api/datatypes/sniffers Return a list of sniffers.

converters(trans, *args, **kwargs)[source]
edam_formats(trans, *args, **kwargs)[source]
edam_data(trans, *args, **kwargs)[source]

extended_metadata module

API operations on annotations.

class galaxy.webapps.galaxy.api.extended_metadata.BaseExtendedMetadataController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesExtendedMetadataMixin, galaxy.web.base.controller.UsesLibraryMixinItems, galaxy.web.base.controller.UsesStoredWorkflowMixin

index(trans, *args, **kwargs)[source]
create(trans, *args, **kwargs)[source]
delete(trans, *args, **kwargs)[source]
undelete(trans, *args, **kwargs)[source]
class galaxy.webapps.galaxy.api.extended_metadata.LibraryDatasetExtendMetadataController(app)[source]

Bases: galaxy.webapps.galaxy.api.extended_metadata.BaseExtendedMetadataController

controller_name = 'library_dataset_extended_metadata'
exmeta_item_id = 'library_content_id'
class galaxy.webapps.galaxy.api.extended_metadata.HistoryDatasetExtendMetadataController(app)[source]

Bases: galaxy.webapps.galaxy.api.extended_metadata.BaseExtendedMetadataController

controller_name = 'history_dataset_extended_metadata'
exmeta_item_id = 'history_content_id'
__init__(app)[source]

folder_contents module

API operations on the contents of a library folder.

class galaxy.webapps.galaxy.api.folder_contents.FolderContentsController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesLibraryMixin, galaxy.web.base.controller.UsesLibraryMixinItems

Class controls retrieval, creation and updating of folder contents.

__init__(app)[source]
index(trans, *args, **kwargs)[source]

GET /api/folders/{encoded_folder_id}/contents

Displays a collection (list) of a folder’s contents (files and folders). Encoded folder ID is prepended with ‘F’ if it is a folder as opposed to a data set which does not have it. Full path is provided in response as a separate object providing data for breadcrumb path building.

Parameters:
  • folder_id (encoded string) – encoded ID of the folder which contents should be library_dataset_dict
  • kwd (dict) – keyword dictionary with other params
Returns:

dictionary containing all items and metadata

Type:

dict

Raises:

MalformedId, InconsistentDatabase, ObjectNotFound, InternalServerError

build_path(trans, folder)[source]

Search the path upwards recursively and load the whole route of names and ids for breadcrumb building purposes.

Parameters:
  • folder – current folder for navigating up
  • type – Galaxy LibraryFolder
Returns:

list consisting of full path to the library

Type:

list

create(trans, *args, **kwargs)[source]
  • POST /api/folders/{encoded_id}/contents
    create a new library file from an HDA
Parameters:
  • encoded_folder_id (an encoded id string) – the encoded id of the folder to import dataset(s) to
  • payload (dict) – dictionary structure containing: :param from_hda_id: (optional) the id of an accessible HDA to copy into the library :type from_hda_id: encoded id :param from_hdca_id: (optional) the id of an accessible HDCA to copy into the library :type from_hdca_id: encoded id :param ldda_message: (optional) the new message attribute of the LDDA created :type ldda_message: str :param extended_metadata: (optional) dub-dictionary containing any extended metadata to associate with the item :type extended_metadata: dict
Returns:

a dictionary describing the new item if from_hda_id is supplied or a list of such dictionaries describing the new items if from_hdca_id is supplied.

Return type:

object

Raises:

ObjectAttributeInvalidException, InsufficientPermissionsException, ItemAccessibilityException, InternalServerError

show(trans, *args, **kwargs)[source]

GET /api/folders/{encoded_folder_id}/

update(trans, *args, **kwargs)[source]

PUT /api/folders/{encoded_folder_id}/contents

folders module

API operations on library folders.

class galaxy.webapps.galaxy.api.folders.FoldersController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesLibraryMixin, galaxy.web.base.controller.UsesLibraryMixinItems

__init__(app)[source]
index(trans, *args, **kwargs)[source]

*GET /api/folders/ This would normally display a list of folders. However, that would be across multiple libraries, so it’s not implemented.

show(self, trans, id, **kwd)[source]

*GET /api/folders/{encoded_folder_id}

Displays information about a folder.

Parameters:id (an encoded id string (has to be prefixed by 'F')) – the folder’s encoded id (required)
Returns:dictionary including details of the folder
Return type:dict
create(trans, *args, **kwargs)[source]
*POST /api/folders/{encoded_parent_folder_id}
Create a new folder object underneath the one specified in the parameters.
Parameters:
  • encoded_parent_folder_id (an encoded id string (should be prefixed by 'F')) – (required) the parent folder’s id
  • payload – dictionary structure containing: :param name: (required) the name of the new folder :type name: str :param description: the description of the new folder :type description: str

:type dictionary :returns: information about newly created folder, notably including ID :rtype: dictionary :raises: RequestParameterMissingException

get_permissions(trans, *args, **kwargs)[source]
  • GET /api/folders/{id}/permissions

Load all permissions for the given folder id and return it.

Parameters:
  • encoded_folder_id (an encoded id string) – the encoded id of the folder
  • scope (string) – either ‘current’ or ‘available’
Returns:

dictionary with all applicable permissions’ values

Return type:

dictionary

Raises:

InsufficientPermissionsException

set_permissions(trans, *args, **kwargs)[source]
*POST /api/folders/{encoded_folder_id}/permissions
Set permissions of the given folder to the given role ids.
Parameters:
  • encoded_folder_id (an encoded id string) – the encoded id of the folder to set the permissions of
  • payload – dictionary structure containing: :param action: (required) describes what action should be performed :type action: string :param add_ids[]: list of Role.id defining roles that should have add item permission on the folder :type add_ids[]: string or list :param manage_ids[]: list of Role.id defining roles that should have manage permission on the folder :type manage_ids[]: string or list :param modify_ids[]: list of Role.id defining roles that should have modify permission on the folder :type modify_ids[]: string or list

:type dictionary :returns: dict of current roles for all available permission types. :rtype: dictionary :raises: RequestParameterInvalidException, InsufficientPermissionsException, RequestParameterMissingException

delete(self, trans, encoded_folder_id, **kwd)[source]
  • DELETE /api/folders/{encoded_folder_id}
    marks the folder with the given encoded_folder_id as deleted (or removes the deleted mark if the undelete param is true)

Note

Currently, only admin users can un/delete folders.

Parameters:
  • encoded_folder_id (an encoded id string) – the encoded id of the folder to un/delete
  • undelete (bool) – (optional) flag specifying whether the item should be deleted or undeleted, defaults to false:
Returns:

detailed folder information

Return type:

dictionary

update(trans, *args, **kwargs)[source]
  • PATCH /api/folders/{encoded_folder_id}
    Update the folder defined by an encoded_folder_id with the data in the payload.

Note

Currently, only admin users can update library folders. Also the folder must not be deleted.

param id:the encoded id of the folder
type id:an encoded id string
param payload:(required) dictionary structure containing:: ‘name’: new folder’s name, cannot be empty ‘description’: new folder’s description
type payload:dict
returns:detailed folder information
rtype:dict
raises:RequestParameterMissingException

forms module

API operations on FormDefinition objects.

class galaxy.webapps.galaxy.api.forms.FormDefinitionAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

index(trans, *args, **kwargs)[source]

GET /api/forms Displays a collection (list) of forms.

show(trans, *args, **kwargs)[source]

GET /api/forms/{encoded_form_id} Displays information about a form.

create(trans, *args, **kwargs)[source]

POST /api/forms Creates a new form.

genomes module

galaxy.webapps.galaxy.api.genomes.get_id(base, format)[source]
class galaxy.webapps.galaxy.api.genomes.GenomesController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

RESTful controller for interactions with genome data.

index(trans, *args, **kwargs)[source]

GET /api/genomes: returns a list of installed genomes

show(trans, *args, **kwargs)[source]

GET /api/genomes/{id}

Returns information about build <id>

indexes(trans, *args, **kwargs)[source]

GET /api/genomes/{id}/indexes?type={table name}

Returns all available indexes for a genome id for type={table name} For instance, /api/genomes/hg19/indexes?type=fasta_indexes

sequences(trans, *args, **kwargs)[source]

GET /api/genomes/{id}/sequences

This is a wrapper for accepting sequence requests that want a raw return, not json

group_roles module

API operations on Group objects.

class galaxy.webapps.galaxy.api.group_roles.GroupRolesAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

index(trans, *args, **kwargs)[source]

GET /api/groups/{encoded_group_id}/roles Displays a collection (list) of groups.

show(trans, *args, **kwargs)[source]

GET /api/groups/{encoded_group_id}/roles/{encoded_role_id} Displays information about a group role.

update(trans, *args, **kwargs)[source]

PUT /api/groups/{encoded_group_id}/roles/{encoded_role_id} Adds a role to a group

delete(trans, *args, **kwargs)[source]

DELETE /api/groups/{encoded_group_id}/roles/{encoded_role_id} Removes a role from a group

group_users module

API operations on Group objects.

class galaxy.webapps.galaxy.api.group_users.GroupUsersAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

index(trans, *args, **kwargs)[source]

GET /api/groups/{encoded_group_id}/users Displays a collection (list) of groups.

show(trans, *args, **kwargs)[source]

GET /api/groups/{encoded_group_id}/users/{encoded_user_id} Displays information about a group user.

update(trans, *args, **kwargs)[source]

PUT /api/groups/{encoded_group_id}/users/{encoded_user_id} Adds a user to a group

delete(trans, *args, **kwargs)[source]

DELETE /api/groups/{encoded_group_id}/users/{encoded_user_id} Removes a user from a group

groups module

API operations on Group objects.

class galaxy.webapps.galaxy.api.groups.GroupAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

index(trans, *args, **kwargs)[source]

GET /api/groups Displays a collection (list) of groups.

create(trans, *args, **kwargs)[source]

POST /api/groups Creates a new group.

show(trans, *args, **kwargs)[source]

GET /api/groups/{encoded_group_id} Displays information about a group.

update(trans, *args, **kwargs)[source]

PUT /api/groups/{encoded_group_id} Modifies a group.

histories module

API operations on a history.

class galaxy.webapps.galaxy.api.histories.HistoriesController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.ExportsHistoryMixin, galaxy.web.base.controller.ImportsHistoryMixin

__init__(app)[source]
index(trans, deleted='False')[source]
  • GET /api/histories:
    return undeleted histories for the current user
  • GET /api/histories/deleted:
    return deleted histories for the current user

Note

Anonymous users are allowed to get their current history

Parameters:deleted (boolean) – if True, show only deleted histories, if False, non-deleted
Return type:list
Returns:list of dictionaries containing summary history information
The following are optional parameters:
view: string, one of (‘summary’,’detailed’), defaults to ‘summary’
controls which set of properties to return
keys: comma separated strings, unused by default
keys/names of individual properties to return

If neither keys or views are sent, the default view (set of keys) is returned. If both a view and keys are sent, the key list and the view’s keys are combined. If keys are send and no view, only those properties in keys are returned.

For which properties are available see:
galaxy/managers/histories/HistorySerializer
The list returned can be filtered by using two optional parameters:
q: string, generally a property name to filter by followed
by an (often optional) hyphen and operator string.

qv: string, the value to filter by

..example:

To filter the list to only those created after 2015-01-29, the query string would look like:

‘?q=create_time-gt&qv=2015-01-29’
Multiple filters can be sent in using multiple q/qv pairs:
‘?q=create_time-gt&qv=2015-01-29&q=tag-has&qv=experiment-1’
The list returned can be paginated using two optional parameters:
limit: integer, defaults to no value and no limit (return all)
how many items to return
offset: integer, defaults to 0 and starts at the beginning
skip the first ( offset - 1 ) items and begin returning at the Nth item
..example:
limit and offset can be combined. Skip the first two and return five:
‘?limit=5&offset=3’
The list returned can be ordered using the optional parameter:
order: string containing one of the valid ordering attributes followed
(optionally) by ‘-asc’ or ‘-dsc’ for ascending and descending order respectively. Orders can be stacked as a comma- separated list of values.
..example:
To sort by name descending then create time descending:
‘?order=name-dsc,create_time’
The ordering attributes and their default orders are:
create_time defaults to ‘create_time-dsc’ update_time defaults to ‘update_time-dsc’ name defaults to ‘name-asc’

‘order’ defaults to ‘create_time-dsc’

show(trans, id, deleted='False')[source]
  • GET /api/histories/{id}:
    return the history with id
  • GET /api/histories/deleted/{id}:
    return the deleted history with id
  • GET /api/histories/most_recently_used:
    return the most recently used history
Parameters:
  • id (an encoded id string) – the encoded id of the history to query or the string ‘most_recently_used’
  • deleted (boolean) – if True, allow information on a deleted history to be shown.
  • keys – same as the use of keys in the index function above
  • view – same as the use of view in the index function above
Return type:

dictionary

Returns:

detailed history information

citations(trans, *args, **kwargs)[source]
published(trans, *args, **kwargs)[source]

published( self, trans, **kwd ): * GET /api/histories/published:

return all histories that are published
Return type:list
Returns:list of dictionaries containing summary history information

Follows the same filtering logic as the index() method above.

shared_with_me(self, trans, **kwd)[source]
  • GET /api/histories/shared_with_me:
    return all histories that are shared with the current user
Return type:list
Returns:list of dictionaries containing summary history information

Follows the same filtering logic as the index() method above.

create(trans, payload)[source]
  • POST /api/histories:
    create a new history
Parameters:
  • payload (dict) – (optional) dictionary structure containing: * name: the new history’s name * history_id: the id of the history to copy * all_datasets: copy deleted hdas/hdcas? ‘True’ or ‘False’, defaults to True * archive_source: the url that will generate the archive to import * archive_type: ‘url’ (default)
  • keys – same as the use of keys in the index function above
  • view – same as the use of view in the index function above
Return type:

dict

Returns:

element view of new history

delete(self, trans, id, **kwd)[source]
  • DELETE /api/histories/{id}
    delete the history with the given id

Note

Stops all active jobs in the history if purge is set.

Parameters:
  • id (str) – the encoded id of the history to delete
  • kwd (dict) – (optional) dictionary structure containing extra parameters

You can purge a history, removing all it’s datasets from disk (if unshared), by passing in purge=True in the url.

Parameters:
  • keys – same as the use of keys in the index function above
  • view – same as the use of view in the index function above
Return type:

dict

Returns:

the deleted or purged history

undelete(self, trans, id, **kwd)[source]
  • POST /api/histories/deleted/{id}/undelete:
    undelete history (that hasn’t been purged) with the given id
Parameters:
  • id (str) – the encoded id of the history to undelete
  • keys – same as the use of keys in the index function above
  • view – same as the use of view in the index function above
Return type:

str

Returns:

‘OK’ if the history was undeleted

update(self, trans, id, payload, **kwd)[source]
  • PUT /api/histories/{id}
    updates the values for the history with the given id
Parameters:
  • id (str) – the encoded id of the history to update
  • payload (dict) –

    a dictionary containing any or all the fields in galaxy.model.History.to_dict() and/or the following:

    • annotation: an annotation for the history
  • keys – same as the use of keys in the index function above
  • view – same as the use of view in the index function above
Return type:

dict

Returns:

an error object if an error occurred or a dictionary containing any values that were different from the original and, therefore, updated

archive_export(trans, *args, **kwargs)[source]

export_archive( self, trans, id, payload ) * PUT /api/histories/{id}/exports:

start job (if needed) to create history export for corresponding history.
Parameters:id (str) – the encoded id of the history to export
Return type:dict
Returns:object containing url to fetch export from.
archive_download(trans, *args, **kwargs)[source]

export_download( self, trans, id, jeha_id ) * GET /api/histories/{id}/exports/{jeha_id}:

If ready and available, return raw contents of exported history. Use/poll “PUT /api/histories/{id}/exports” to initiate the creation of such an export - when ready that route will return 200 status code (instead of 202) with a JSON dictionary containing a download_url.
get_custom_builds_metadata(trans, *args, **kwargs)[source]

GET /api/histories/{id}/custom_builds_metadata Returns meta data for custom builds.

Parameters:id (str) – the encoded history id

history_contents module

API operations on the contents of a history.

class galaxy.webapps.galaxy.api.history_contents.HistoryContentsController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesLibraryMixin, galaxy.web.base.controller.UsesLibraryMixinItems, galaxy.web.base.controller.UsesTagsMixin

__init__(app)[source]
index(self, trans, history_id, ids=None, **kwd)[source]
  • GET /api/histories/{history_id}/contents
    return a list of HDA data for the history with the given id

Note

Anonymous users are allowed to get their current history contents

If Ids is not given, index returns a list of summary objects for every HDA associated with the given history_id.

If ids is given, index returns a more complete json object for each HDA in the ids list.

Parameters:
  • history_id (str) – encoded id string of the HDA’s History
  • ids (str) – (optional) a comma separated list of encoded HDA ids
  • types (str) – (optional) kinds of contents to index (currently just dataset, but dataset_collection will be added shortly).
Return type:

list

Returns:

dictionaries containing summary or detailed HDA information

show(trans, *args, **kwargs)[source]
  • GET /api/histories/{history_id}/contents/{id}
  • GET /api/histories/{history_id}/contents/{type}/{id}
    return detailed information about an HDA or HDCA within a history

Note

Anonymous users are allowed to get their current history contents

Parameters:
  • id (str) – the encoded id of the HDA or HDCA to return
  • id – ‘dataset’ or ‘dataset_collection’
  • history_id (str) – encoded id string of the HDA’s or HDCA’s History
  • view (str) – if fetching a dataset collection - the view style of the dataset collection to produce. ‘collection’ returns no element information, ‘element’ returns detailed element information for all datasets, ‘element-reference’ returns a minimal set of information about datasets (for instance id, type, and state but not metadata, peek, info, or name). The default is ‘element’.
  • fuzzy_count (int) – this value can be used to broadly restrict the magnitude of the number of elements returned via the API for large collections. The number of actual elements returned may be “a bit” more than this number or “a lot” less - varying on the depth of nesting, balance of nesting at each level, and size of target collection. The consumer of this API should not expect a stable number or pre-calculable number of elements to be produced given this parameter - the only promise is that this API will not respond with an order of magnitude more elements estimated with this value. The UI uses this parameter to fetch a “balanced” concept of the “start” of large collections at every depth of the collection.
Return type:

dict

Returns:

dictionary containing detailed HDA or HDCA information

index_jobs_summary(trans, *args, **kwargs)[source]
  • GET /api/histories/{history_id}/jobs_summary
    return detailed information about an HDA or HDCAs jobs

Warning: We allow anyone to fetch job state information about any object they can guess an encoded ID for - it isn’t considered protected data. This keeps polling IDs as part of state calculation for large histories and collections as efficient as possible.

Parameters:
  • history_id (str) – encoded id string of the HDA’s or the HDCA’s History
  • ids (str[]) – the encoded ids of job summary objects to return - if ids is specified types must also be specified and have same length.
  • types (str[]) – type of object represented by elements in the ids array - either Job or ImplicitCollectionJob.
Return type:

dict[]

Returns:

an array of job summary object dictionaries.

show_jobs_summary(trans, *args, **kwargs)[source]
  • GET /api/histories/{history_id}/contents/{type}/{id}/jobs_summary
    return detailed information about an HDA or HDCAs jobs

Warning: We allow anyone to fetch job state information about any object they can guess an encoded ID for - it isn’t considered protected data. This keeps polling IDs as part of state calculation for large histories and collections as efficient as possible.

Parameters:
  • id (str) – the encoded id of the HDA to return
  • history_id (str) – encoded id string of the HDA’s or the HDCA’s History
Return type:

dict

Returns:

dictionary containing jobs summary object

download_dataset_collection(trans, *args, **kwargs)[source]
  • GET /api/histories/{history_id}/contents/{id}/download
  • GET /api/dataset_collection/{id}/download

Download the content of a HistoryDatasetCollection as a tgz archive while maintaining approximate collection structure.

Parameters:
  • id – encoded HistoryDatasetCollectionAssociation (HDCA) id
  • history_id – encoded id string of the HDCA’s History
create(self, trans, history_id, payload, **kwd)[source]
  • POST /api/histories/{history_id}/contents/{type}s
  • POST /api/histories/{history_id}/contents
    create a new HDA or HDCA
Parameters:
  • history_id (str) – encoded id string of the new HDA’s History
  • type (str) – Type of history content - ‘dataset’ (default) or ‘dataset_collection’. This can be passed in via payload or parsed from the route.
  • payload (dict) –

    dictionary structure containing:: copy from library (for type ‘dataset’): ‘source’ = ‘library’ ‘content’ = [the encoded id from the library dataset]

    copy from library folder ‘source’ = ‘library_folder’ ‘content’ = [the encoded id from the library folder]

    copy from history dataset (for type ‘dataset’): ‘source’ = ‘hda’ ‘content’ = [the encoded id from the HDA]

    copy from history dataset collection (for type ‘dataset_collection’) ‘source’ = ‘hdca’ ‘content’ = [the encoded id from the HDCA] ‘copy_elements’ = Copy child HDAs into the target history as well,

    defaults to False but this is less than ideal and may be changed in future releases.

    create new history dataset collection (for type ‘dataset_collection’) ‘source’ = ‘new_collection’ (default ‘source’ if type is

    ’dataset_collection’ - no need to specify this)

    ’collection_type’ = For example, “list”, “paired”, “list:paired”. ‘name’ = Name of new dataset collection. ‘element_identifiers’ = Recursive list structure defining collection.

    Each element must have ‘src’ which can be ‘hda’, ‘ldda’, ‘hdca’, or ‘new_collection’, as well as a ‘name’ which is the name of element (e.g. “forward” or “reverse” for paired datasets, or arbitrary sample names for instance for lists). For all src’s except ‘new_collection’ - a encoded ‘id’ attribute must be included wiht element as well. ‘new_collection’ sources must defined a ‘collection_type’ and their own list of (potentially) nested ‘element_identifiers’.
..note:
Currently, a user can only copy an HDA from a history that the user owns.
Return type:dict
Returns:dictionary containing detailed information for the new HDA
update(self, trans, history_id, id, payload, **kwd)[source]
  • PUT /api/histories/{history_id}/contents/{id}
    updates the values for the HDA with the given id
Parameters:
  • history_id (str) – encoded id string of the HDA’s History
  • id (str) – the encoded id of the history to update
  • payload (dict) –

    a dictionary containing any or all the fields in galaxy.model.HistoryDatasetAssociation.to_dict() and/or the following:

    • annotation: an annotation for the HDA
Return type:

dict

Returns:

an error object if an error occurred or a dictionary containing any values that were different from the original and, therefore, updated

delete(self, trans, history_id, id, **kwd)[source]
  • DELETE /api/histories/{history_id}/contents/{id}
  • DELETE /api/histories/{history_id}/contents/{type}s/{id}
    delete the history content with the given id and specified type (defaults to dataset)

Note

Currently does not stop any active jobs for which this dataset is an output.

Parameters:
  • id (str) – the encoded id of the history to delete
  • recursive (bool) – if True, and deleted an HDCA also delete containing HDAs
  • purge (bool) – if True, purge the target HDA or child HDAs of the target HDCA
  • kwd (dict) –

    (optional) dictionary structure containing:

    • payload: a dictionary itself containing:
      • purge: if True, purge the HDA
      • recursive: if True, see above.

Note

that payload optionally can be placed in the query string of the request. This allows clients that strip the request body to still purge the dataset.

Return type:dict
Returns:an error object if an error occurred or a dictionary containing: * id: the encoded id of the history, * deleted: if the history was marked as deleted, * purged: if the history was purged
encode_type_id(type_id)[source]
archive(self, trans, history_id, filename='', format='tgz', dry_run=True, **kwd)[source]
  • GET /api/histories/{history_id}/contents/archive/{id}
  • GET /api/histories/{history_id}/contents/archive/{filename}.{format}
    build and return a compressed archive of the selected history contents
Parameters:
  • filename (string) – (optional) archive name (defaults to history name)
  • dry_run (boolean) – (optional) if True, return the archive and file paths only as json and not an archive file
Returns:

archive file for download

Note

this is a volatile endpoint and settings and behavior may change.

item_tags module

API operations related to tagging items.

class galaxy.webapps.galaxy.api.item_tags.BaseItemTagsController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesTagsMixin

index(trans, *args, **kwargs)[source]
show(trans, *args, **kwargs)[source]
create(trans, *args, **kwargs)[source]
update(trans, *args, **kwargs)
delete(trans, *args, **kwargs)[source]
class galaxy.webapps.galaxy.api.item_tags.HistoryContentTagsController(app)[source]

Bases: galaxy.webapps.galaxy.api.item_tags.BaseItemTagsController

controller_name = 'history_content_tags'
tagged_item_class = 'HistoryDatasetAssociation'
tagged_item_id = 'history_content_id'
class galaxy.webapps.galaxy.api.item_tags.HistoryTagsController(app)[source]

Bases: galaxy.webapps.galaxy.api.item_tags.BaseItemTagsController

controller_name = 'history_tags'
tagged_item_class = 'History'
tagged_item_id = 'history_id'
class galaxy.webapps.galaxy.api.item_tags.WorkflowTagsController(app)[source]

Bases: galaxy.webapps.galaxy.api.item_tags.BaseItemTagsController

controller_name = 'workflow_tags'
tagged_item_class = 'StoredWorkflow'
tagged_item_id = 'workflow_id'

job_files module

API for asynchronous job running mechanisms can use to fetch or put files related to running and queued jobs.

class galaxy.webapps.galaxy.api.job_files.JobFilesAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

This job files controller allows remote job running mechanisms to read and modify the current state of files for queued and running jobs. It is certainly not meant to represent part of Galaxy’s stable, user facing API.

Furthermore, even if a user key corresponds to the user running the job, it should not be accepted for authorization - this API allows access to low-level unfiltered files and such authorization would break Galaxy’s security model for tool execution.

index(self, trans, job_id, **kwargs)[source]
  • GET /api/jobs/{job_id}/files
    Get a file required to staging a job (proper datasets, extra inputs, task-split inputs, working directory files).
Parameters:
  • job_id (str) – encoded id string of the job
  • path (str) – Path to file.
  • job_key (str) – A key used to authenticate this request as acting on behalf or a job runner for the specified job.
..note:
This API method is intended only for consumption by job runners, not end users.
Return type:binary
Returns:contents of file
create(self, trans, job_id, payload, **kwargs)[source]
  • POST /api/jobs/{job_id}/files
    Populate an output file (formal dataset, task split part, working directory file (such as those related to metadata)). This should be a multipart post with a ‘file’ parameter containing the contents of the actual file to create.
Parameters:
  • job_id (str) – encoded id string of the job
  • payload (dict) – dictionary structure containing:: ‘job_key’ = Key authenticating ‘path’ = Path to file to create.
..note:
This API method is intended only for consumption by job runners, not end users.
Return type:dict
Returns:an okay message

jobs module

API operations on a jobs.

See also

galaxy.model.Jobs

class galaxy.webapps.galaxy.api.jobs.JobController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesLibraryMixinItems

__init__(app)[source]
index(trans, state=None, tool_id=None, history_id=None, date_range_min=None, date_range_max=None, user_details=False)[source]
  • GET /api/jobs:

    return jobs for current user

    !! if user is admin and user_details is True, then

    return jobs for all galaxy users based on filtering - this is an extended service

Parameters:state (string or list) – limit listing of jobs to those that match one of the included states. If none, all are returned.
Valid Galaxy job states include:
‘new’, ‘upload’, ‘waiting’, ‘queued’, ‘running’, ‘ok’, ‘error’, ‘paused’, ‘deleted’, ‘deleted_new’
Parameters:
  • tool_id (string or list) – limit listing of jobs to those that match one of the included tool_ids. If none, all are returned.
  • user_details (boolean) – if true, and requestor is an admin, will return external job id and user email.
  • date_range_min (string '2014-01-01') – limit the listing of jobs to those updated on or after requested date
  • date_range_max (string '2014-12-31') – limit the listing of jobs to those updated on or before requested date
  • history_id (string) – limit listing of jobs to those that match the history_id. If none, all are returned.
Return type:

list

Returns:

list of dictionaries containing summary job information

show(trans, id)[source]
  • GET /api/jobs/{id}:
    return jobs for current user
Parameters:
  • id (string) – Specific job id
  • full (boolean) – whether to return extra information
Return type:

dictionary

Returns:

dictionary containing full description of job data

inputs(trans, *args, **kwargs)[source]

show( trans, id ) * GET /api/jobs/{id}/inputs

returns input datasets created by job
Parameters:id (string) – Encoded job id
Return type:dictionary
Returns:dictionary containing input dataset associations
outputs(trans, id)[source]
  • GET /api/jobs/{id}/outputs
    returns output datasets created by job
Parameters:id (string) – Encoded job id
Return type:dictionary
Returns:dictionary containing output dataset associations
delete(trans, id)[source]
  • Delete /api/jobs/{id}
    cancels specified job
Parameters:id (string) – Encoded job id
build_for_rerun(trans, *args, **kwargs)[source]
  • GET /api/jobs/{id}/build_for_rerun
    returns a tool input/param template prepopulated with this job’s information, suitable for rerunning or rendering parameters of the job.
Parameters:id (string) – Encoded job id
Return type:dictionary
Returns:dictionary containing output dataset associations
create(trans, *args, **kwargs)[source]

See the create method in tools.py in order to submit a job.

search(trans, payload)[source]
  • POST /api/jobs/search:
    return jobs for current user
Parameters:payload (dict) – Dictionary containing description of requested job. This is in the same format as a request to POST /apt/tools would take to initiate a job
Return type:list
Returns:list of dictionaries containing summary job information of the jobs that match the requested job run

This method is designed to scan the list of previously run jobs and find records of jobs that had the exact some input parameters and datasets. This can be used to minimize the amount of repeated work, and simply recycle the old results.

error(trans, id)[source]
  • POST /api/jobs/{id}/error
    submits a bug report via the API.
Parameters:id (string) – Encoded job id
Return type:dictionary
Returns:dictionary containing information regarding where the error report was sent.

lda_datasets module

libraries module

API operations on a data library.

class galaxy.webapps.galaxy.api.libraries.LibrariesController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

__init__(app)[source]
index(self, trans, **kwd)[source]
  • GET /api/libraries:
    Returns a list of summary data for all libraries.
Parameters:deleted (boolean (optional)) – if True, show only deleted libraries, if False show only non-deleted
Returns:list of dictionaries containing library information
Return type:list
show(self, trans, id, deleted='False', **kwd)[source]
  • GET /api/libraries/{encoded_id}:
    returns detailed information about a library
  • GET /api/libraries/deleted/{encoded_id}:
    returns detailed information about a deleted library
Parameters:
  • id (an encoded id string) – the encoded id of the library
  • deleted (boolean) – if True, allow information on a deleted library
Returns:

detailed library information

Return type:

dictionary

Raises:MalformedId, ObjectNotFound
create(trans, *args, **kwargs)[source]
  • POST /api/libraries:
    Creates a new library.

Note

Currently, only admin users can create libraries.

Parameters:payload (dict) – dictionary structure containing:: :param name: (required) the new library’s name :type name: str :param description: the new library’s description :type description: str :param synopsis: the new library’s synopsis :type synopsis: str
Returns:detailed library information
Return type:dict
Raises:RequestParameterMissingException
update(trans, *args, **kwargs)[source]
  • PATCH /api/libraries/{encoded_id}
    Updates the library defined by an encoded_id with the data in the payload.

Note

Currently, only admin users can update libraries. Also the library must not be deleted.

param id:the encoded id of the library
type id:an encoded id string
param payload:dictionary structure containing:: :param name: new library’s name, cannot be empty :type name: str :param description: new library’s description :type description: str :param synopsis: new library’s synopsis :type synopsis: str
type payload:dict
returns:detailed library information
rtype:dict
raises:RequestParameterMissingException
delete(trans, *args, **kwargs)[source]
  • DELETE /api/libraries/{id}
    marks the library with the given id as deleted (or removes the deleted mark if the undelete param is true)

Note

Currently, only admin users can un/delete libraries.

Parameters:
  • id (an encoded id string) – the encoded id of the library to un/delete
  • payload – dictionary structure containing: :param undelete: (optional) flag specifying whether the item should be deleted or undeleted, defaults to false: :type undelete: bool
Type:

dictionary

Returns:

detailed library information

Return type:

dictionary

get_permissions(trans, *args, **kwargs)[source]
  • GET /api/libraries/{id}/permissions

Load all permissions for the given library id and return it.

Parameters:
  • encoded_library_id (an encoded id string) – the encoded id of the library
  • scope (string) – either ‘current’ or ‘available’
  • is_library_access (bool) – indicates whether the roles available for the library access are requested
Returns:

dictionary with all applicable permissions’ values

Return type:

dictionary

Raises:

InsufficientPermissionsException

set_permissions(trans, *args, **kwargs)[source]
*POST /api/libraries/{encoded_library_id}/permissions
Set permissions of the given library to the given role ids.
Parameters:
  • encoded_library_id (an encoded id string) – the encoded id of the library to set the permissions of
  • payload

    dictionary structure containing: :param action: (required) describes what action should be performed

    available actions: remove_restrictions, set_permissions
    type action:str
    param access_ids[]:
     list of Role.id defining roles that should have access permission on the library
    type access_ids[]:
     string or list
    param add_ids[]:
     list of Role.id defining roles that should have add item permission on the library
    type add_ids[]:
     string or list
    param manage_ids[]:
     list of Role.id defining roles that should have manage permission on the library
    type manage_ids[]:
     string or list
    param modify_ids[]:
     list of Role.id defining roles that should have modify permission on the library
    type modify_ids[]:
     string or list
Type:

dictionary

Returns:

dict of current roles for all available permission types

Return type:

dictionary

Raises:

RequestParameterInvalidException, InsufficientPermissionsException, InternalServerError RequestParameterMissingException

set_permissions_old(trans, library, payload, **kwd)[source]

* old implementation for backward compatibility *

POST /api/libraries/{encoded_library_id}/permissions Updates the library permissions.

library_contents module

API operations on the contents of a data library.

class galaxy.webapps.galaxy.api.library_contents.LibraryContentsController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesLibraryMixin, galaxy.web.base.controller.UsesLibraryMixinItems, galaxy.web.base.controller.UsesFormDefinitionsMixin, galaxy.actions.library.LibraryActions

__init__(app)[source]
index(self, trans, library_id, **kwd)[source]
  • GET /api/libraries/{library_id}/contents:
    Returns a list of library files and folders.

Note

May be slow! Returns all content traversing recursively through all folders.

See also

galaxy.webapps.galaxy.api.FolderContentsController.index for a non-recursive solution

Parameters:library_id (str) – the encoded id of the library
Returns:list of dictionaries of the form: * id: the encoded id of the library item * name: the ‘library path’
or relationship of the library item to the root
  • type: ‘file’ or ‘folder’
  • url: the url to get detailed information on the library item
Return type:list
Raises:MalformedId, InconsistentDatabase, RequestParameterInvalidException, InternalServerError
show(self, trans, id, library_id, **kwd)[source]
  • GET /api/libraries/{library_id}/contents/{id}
    Returns information about library file or folder.
Parameters:
  • id (str) – the encoded id of the library item to return
  • library_id (str) – the encoded id of the library that contains this item
Returns:

detailed library item information

Return type:

dict

create(self, trans, library_id, payload, **kwd)[source]
  • POST /api/libraries/{library_id}/contents:
    create a new library file or folder

To copy an HDA into a library send create_type of ‘file’ and the HDA’s encoded id in from_hda_id (and optionally ldda_message).

To copy an HDCA into a library send create_type of ‘file’ and the HDCA’s encoded id in from_hdca_id (and optionally ldda_message).

Parameters:
  • library_id (str) – the encoded id of the library where to create the new item
  • payload (dict) –

    dictionary structure containing:

    • folder_id: the encoded id of the parent folder of the new item
    • create_type: the type of item to create (‘file’, ‘folder’ or ‘collection’)
    • from_hda_id: (optional, only if create_type is ‘file’) the
      encoded id of an accessible HDA to copy into the library
    • ldda_message: (optional) the new message attribute of the LDDA created
    • extended_metadata: (optional) sub-dictionary containing any extended
      metadata to associate with the item
    • upload_option: (optional) one of ‘upload_file’ (default), ‘upload_directory’ or ‘upload_paths’
    • server_dir: (optional, only if upload_option is
      ’upload_directory’) relative path of the subdirectory of Galaxy library_import_dir to upload. All and only the files (i.e. no subdirectories) contained in the specified directory will be uploaded.
    • filesystem_paths: (optional, only if upload_option is
      ’upload_paths’ and the user is an admin) file paths on the Galaxy server to upload to the library, one file per line
    • link_data_only: (optional, only when upload_option is
      ’upload_directory’ or ‘upload_paths’) either ‘copy_files’ (default) or ‘link_to_files’. Setting to ‘link_to_files’ symlinks instead of copying the files
    • name: (optional, only if create_type is ‘folder’) name of the
      folder to create
    • description: (optional, only if create_type is ‘folder’)
      description of the folder to create
    • tag_using_filename: (optional)
      create tags on datasets using the file’s original name
Returns:

a dictionary describing the new item unless from_hdca_id is supplied, in that case a list of such dictionaries is returned.

Return type:

object

update(self, trans, id, library_id, payload, **kwd)[source]
  • PUT /api/libraries/{library_id}/contents/{id}
    create a ImplicitlyConvertedDatasetAssociation
Parameters:
  • id (str) – the encoded id of the library item to return
  • library_id (str) – the encoded id of the library that contains this item
  • payload (dict) – dictionary structure containing:: ‘converted_dataset_id’:
Return type:

None

Returns:

None

delete(self, trans, library_id, id, **kwd)[source]
  • DELETE /api/libraries/{library_id}/contents/{id}
    delete the LibraryDataset with the given id
Parameters:
  • id (str) – the encoded id of the library dataset to delete
  • kwd (dict) –

    (optional) dictionary structure containing:

    • payload: a dictionary itself containing:
      • purge: if True, purge the LD
Return type:

dict

Returns:

an error object if an error occurred or a dictionary containing: * id: the encoded id of the library dataset, * deleted: if the library dataset was marked as deleted, * purged: if the library dataset was purged

metrics module

API operations for for querying and recording user metrics from some client (typically a user’s browser).

class galaxy.webapps.galaxy.api.metrics.MetricsController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

__init__(app)[source]
debugging = None

set to true to send additional debugging info to the log

create(trans, payload)[source]
  • POST /api/metrics:
    record any metrics sent and return some status object

Note

Anonymous users can post metrics

Parameters:payload (dict) –

(optional) dictionary structure containing: * metrics: a list containing dictionaries of the form:

** namespace: label indicating the source of the metric ** time: isoformat datetime when the metric was recorded ** level: an integer representing the metric’s log level ** args: a json string containing an array of extra data
Return type:dict
Returns:status object

page_revisions module

API for updating Galaxy Pages

class galaxy.webapps.galaxy.api.page_revisions.PageRevisionsController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.SharableItemSecurityMixin, galaxy.model.item_attrs.UsesAnnotations, galaxy.web.base.controller.SharableMixin

index(self, trans, page_id, **kwd)[source]
  • GET /api/pages/{page_id}/revisions
    return a list of Page revisions
Parameters:page_id – Display the revisions of Page with ID=page_id
Return type:list
Returns:dictionaries containing different revisions of the page
create(self, trans, page_id, payload **kwd)[source]
  • POST /api/pages/{page_id}/revisions
    Create a new revision for a page
Parameters:
  • page_id – Add revision to Page with ID=page_id
  • payload – A dictionary containing:: ‘title’ = New title of the page ‘content’ = New content of the page
Return type:

dictionary

Returns:

Dictionary with ‘success’ or ‘error’ element to indicate the result of the request

pages module

API for updating Galaxy Pages

class galaxy.webapps.galaxy.api.pages.PagesController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.SharableItemSecurityMixin, galaxy.model.item_attrs.UsesAnnotations, galaxy.web.base.controller.SharableMixin

index(self, trans, deleted=False, **kwd)[source]
  • GET /api/pages
    return a list of Pages viewable by the user
Parameters:deleted – Display deleted pages
Return type:list
Returns:dictionaries containing summary or detailed Page information
create(self, trans, payload, **kwd)[source]
  • POST /api/pages
    Create a page and return dictionary containing Page summary
Parameters:payload – dictionary structure containing:: ‘slug’ = The title slug for the page URL, must be unique ‘title’ = Title of the page ‘content’ = HTML contents of the page ‘annotation’ = Annotation that will be attached to the page
Return type:dict
Returns:Dictionary return of the Page.to_dict call
delete(self, trans, id, **kwd)[source]
  • DELETE /api/pages/{id}
    Create a page and return dictionary containing Page summary
Parameters:id – ID of page to be deleted
Return type:dict
Returns:Dictionary with ‘success’ or ‘error’ element to indicate the result of the request
show(self, trans, id, **kwd)[source]
  • GET /api/pages/{id}
    View a page summary and the content of the latest revision
Parameters:id – ID of page to be displayed
Return type:dict
Returns:Dictionary return of the Page.to_dict call with the ‘content’ field populated by the most recent revision

provenance module

API operations provenance

class galaxy.webapps.galaxy.api.provenance.BaseProvenanceController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

__init__(app)[source]
index(trans, *args, **kwargs)[source]
show(trans, *args, **kwargs)[source]
create(trans, *args, **kwargs)[source]
delete(trans, *args, **kwargs)[source]
class galaxy.webapps.galaxy.api.provenance.HDAProvenanceController(app)[source]

Bases: galaxy.webapps.galaxy.api.provenance.BaseProvenanceController

controller_name = 'history_content_provenance'
provenance_item_class = 'HistoryDatasetAssociation'
provenance_item_id = 'history_content_id'
class galaxy.webapps.galaxy.api.provenance.LDDAProvenanceController(app)[source]

Bases: galaxy.webapps.galaxy.api.provenance.BaseProvenanceController

controller_name = 'ldda_provenance'
provenance_item_class = 'LibraryDatasetDatasetAssociation'
provenance_item_id = 'library_content_id'

quotas module

API operations on Quota objects.

class galaxy.webapps.galaxy.api.quotas.QuotaAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.actions.admin.AdminActions, galaxy.web.base.controller.UsesQuotaMixin, galaxy.web.params.QuotaParamParser

index(trans, *args, **kwargs)[source]

GET /api/quotas GET /api/quotas/deleted Displays a collection (list) of quotas.

show(trans, *args, **kwargs)[source]

GET /api/quotas/{encoded_quota_id} GET /api/quotas/deleted/{encoded_quota_id} Displays information about a quota.

create(trans, *args, **kwargs)[source]

POST /api/quotas Creates a new quota.

update(trans, *args, **kwargs)[source]

PUT /api/quotas/{encoded_quota_id} Modifies a quota.

delete(trans, *args, **kwargs)[source]

DELETE /api/quotas/{encoded_quota_id} Deletes a quota

undelete(trans, *args, **kwargs)[source]

POST /api/quotas/deleted/{encoded_quota_id}/undelete Undeletes a quota

remote_files module

API operations on remote files.

class galaxy.webapps.galaxy.api.remote_files.RemoteFilesAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

index(trans, *args, **kwargs)[source]

GET /api/remote_files/

Displays remote files.

Parameters:
  • target (str) – target to load available datasets from, defaults to ftp possible values: ftp, userdir, importdir
  • format – requested format of data, defaults to flat possible values: flat, jstree, ajax
Returns:

list of available files

Return type:

list

request_types module

requests module

roles module

API operations on Role objects.

class galaxy.webapps.galaxy.api.roles.RoleAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

index(trans, *args, **kwargs)[source]

GET /api/roles Displays a collection (list) of roles.

show(trans, *args, **kwargs)[source]

GET /api/roles/{encoded_role_id} Displays information about a role.

create(trans, *args, **kwargs)[source]

POST /api/roles Creates a new role.

samples module

search module

API for searching Galaxy Datasets

class galaxy.webapps.galaxy.api.search.SearchController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.SharableItemSecurityMixin

create(trans, *args, **kwargs)[source]

POST /api/search Do a search of the various elements of Galaxy.

tool_data module

class galaxy.webapps.galaxy.api.tool_data.ToolData(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

RESTful controller for interactions with tool data

index(trans, *args, **kwargs)[source]

GET /api/tool_data: returns a list tool_data tables:

show(trans, *args, **kwargs)[source]
reload(trans, *args, **kwargs)[source]

GET /api/tool_data/{id}/reload

Reloads a tool_data table.

delete(trans, *args, **kwargs)[source]

DELETE /api/tool_data/{id} Removes an item from a data table

Parameters:
  • id (str) – the id of the data table containing the item to delete
  • kwd (dict) –

    (required) dictionary structure containing:

    • payload: a dictionary itself containing:
      • values: <TAB> separated list of column contents, there must be a value for all the columns of the data table
show_field(trans, *args, **kwargs)[source]

GET /api/tool_data/<id>/fields/<value>

Get information about a partiular field in a tool_data table

download_field_file(trans, *args, **kwargs)[source]

tool_dependencies module

API operations allowing clients to manage tool dependencies.

class galaxy.webapps.galaxy.api.tool_dependencies.ToolDependenciesAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

__init__(app)[source]
index(trans, *args, **kwargs)[source]

GET /api/dependency_resolvers

show(trans, *args, **kwargs)[source]

GET /api/dependency_resolvers/<id>

update(trans, *args, **kwargs)[source]

PUT /api/dependency_resolvers

Reload tool dependency resolution configuration.

resolver_dependency(trans, *args, **kwargs)[source]

GET /api/dependency_resolvers/{index}/dependency

Resolve described requirement against specified dependency resolver.

Parameters:
  • index (int) – index of the dependency resolver
  • kwds (dict) – dictionary structure containing extra parameters
  • name (str) – name of the requirement to find a dependency for (required)
  • version (str) – version of the requirement to find a dependency for (required)
  • exact (bool) – require an exact match to specify requirement (do not discard version information to resolve dependency).
Return type:

dict

Returns:

a dictified description of the dependency, with attribute dependency_type: None if no match was found.

install_dependency(trans, *args, **kwargs)[source]

POST /api/dependency_resolvers/{index}/dependency

Install described requirement against specified dependency resolver.

Parameters:
  • index (int) – index of the dependency resolver
  • kwds (dict) – dictionary structure containing extra parameters
  • name (str) – name of the requirement to find a dependency for (required)
  • version (str) – version of the requirement to find a dependency for (required)
  • exact (bool) – require an exact match to specify requirement (do not discard version information to resolve dependency).
Return type:

dict

Returns:

a dictified description of the dependency, with attribute dependency_type: None if no match was found.

manager_dependency(trans, *args, **kwargs)[source]

GET /api/dependency_resolvers/dependency

Resolve described requirement against all dependency resolvers, returning the match with highest priority.

Parameters:
  • index (int) – index of the dependency resolver
  • kwds (dict) – dictionary structure containing extra parameters
  • name (str) – name of the requirement to find a dependency for (required)
  • version (str) – version of the requirement to find a dependency for (required)
  • exact (bool) – require an exact match to specify requirement (do not discard version information to resolve dependency).
Return type:

dict

Returns:

a dictified description of the dependency, with type: None if no match was found.

resolver_requirements(trans, *args, **kwargs)[source]

GET /api/dependency_resolvers/{index}/requirements

Find all “simple” requirements that could be resolved “exactly” by this dependency resolver. The dependency resolver must implement ListDependencyResolver.

Parameters:index (int) – index of the dependency resolver
Return type:dict
Returns:a dictified description of the requirement that could be resolved.
manager_requirements(trans, *args, **kwargs)[source]

GET /api/dependency_resolvers/requirements

Find all “simple” requirements that could be resolved “exactly” by all dependency resolvers that support this operation.

Parameters:index (int) – index of the dependency resolver
Return type:dict
Returns:a dictified description of the requirement that could be resolved (keyed on ‘requirement’) and the index of the corresponding resolver (keyed on ‘index’).
clean(trans, *args, **kwargs)[source]

POST /api/dependency_resolvers/{index}/clean

Cleans up intermediate files created by resolvers during the dependency installation.

Parameters:index (int) – index of the dependency resolver
Return type:dict
Returns:a dictified description of the requirement that could be resolved (keyed on ‘requirement’) and the index of the corresponding resolver (keyed on ‘index’).

tool_shed_repositories module

galaxy.webapps.galaxy.api.tool_shed_repositories.get_message_for_no_shed_tool_config()[source]
class galaxy.webapps.galaxy.api.tool_shed_repositories.ToolShedRepositoriesController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

RESTful controller for interactions with tool shed repositories.

check_for_updates(trans, *args, **kwargs)[source]

GET /api/tool_shed_repositories/check_for_updates Check for updates to the specified repository, or all installed repositories.

Parameters:
  • key – the current Galaxy admin user’s API key
  • id – the galaxy-side encoded repository ID
exported_workflows(trans, *args, **kwargs)[source]

GET /api/tool_shed_repositories/{encoded_tool_shed_repository_id}/exported_workflows

Display a list of dictionaries containing information about this tool shed repository’s exported workflows.

Parameters:id – the encoded id of the ToolShedRepository object
get_latest_installable_revision(trans, *args, **kwargs)[source]

POST /api/tool_shed_repositories/get_latest_installable_revision Get the latest installable revision of a specified repository from a specified Tool Shed.

Parameters: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 retrieve the Repository revision. :param name (required): the name of the Repository :param owner (required): the owner of the Repository

shed_category(trans, *args, **kwargs)[source]

GET /api/tool_shed_repositories/shed_category

Display a list of repositories in the selected category.

Parameters:
  • tool_shed_url – the url of the toolshed to get repositories from
  • category_id – the category to get repositories from
shed_repository(trans, *args, **kwargs)[source]

GET /api/tool_shed_repositories/shed_repository

Get details about the specified repository from its shed.

Parameters:
  • tsr_id – the tool_shed_repository_id
  • tsr_id – str
  • tool_shed_url – the URL of the toolshed whence to retrieve repository details
  • tool_shed_url – str
  • tool_ids – (optional) comma-separated list of tool IDs
  • tool_ids – str

GET /api/tool_shed_repositories/shed_search

Search for a specific repository in the toolshed.

Parameters:
  • q – the query string to search for
  • q – str
  • tool_shed_url – the URL of the toolshed to search
  • tool_shed_url – str
import_workflow(trans, *args, **kwargs)[source]

POST /api/tool_shed_repositories/import_workflow

Import the specified exported workflow contained in the specified installed tool shed repository into Galaxy.

Parameters:
  • key – the API key of the Galaxy user with which the imported workflow will be associated.
  • id – the encoded id of the ToolShedRepository object

The following parameters are included in the payload. :param index: the index location of the workflow tuple in the list of exported workflows stored in the metadata for the specified repository

import_workflows(trans, *args, **kwargs)[source]

POST /api/tool_shed_repositories/import_workflows

Import all of the exported workflows contained in the specified installed tool shed repository into Galaxy.

Parameters:
  • key – the API key of the Galaxy user with which the imported workflows will be associated.
  • id – the encoded id of the ToolShedRepository object
index(trans, *args, **kwargs)[source]

GET /api/tool_shed_repositories Display a list of dictionaries containing information about installed tool shed repositories.

install(trans, *args, **kwargs)[source]

POST /api/tool_shed_repositories/install Initiate the installation of a repository.

Parameters:
  • install_resolver_dependencies – True to install resolvable dependencies.
  • install_tool_dependencies – True to install tool dependencies.
  • install_repository_dependencies – True to install repository dependencies.
  • tool_panel_section_id – The unique identifier for an existing tool panel section
  • new_tool_panel_section_label – Create a new tool panel section with this label
  • shed_tool_conf – The shed tool config file to use for this installation
  • tool_shed_url – The URL for the toolshed whence this repository is being installed
  • changeset – The changeset to update to after cloning the repository
install_repository_revision(trans, *args, **kwargs)[source]

POST /api/tool_shed_repositories/install_repository_revision Install a specified repository revision from a specified tool shed into Galaxy.

Parameters: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).
Parameters:
  • (optional) (shed_tool_conf) – 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).
  • (optional) – Set to True if you want to install repository dependencies defined for the specified repository being installed. The default setting is False.
  • (optional) – Set to True if you want to install tool dependencies defined for the specified repository being installed. The default setting is False.
  • (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.
install_repository_revisions(trans, *args, **kwargs)[source]

POST /api/tool_shed_repositories/install_repository_revisions Install one or more specified repository revisions from one or more specified tool sheds into Galaxy. The received parameters must be ordered lists so that positional values in tool_shed_urls, names, owners and changeset_revisions are associated.

It’s questionable whether this method is needed as the above method for installing a single repository can probably cover all desired scenarios. We’ll keep this one around just in case…

Parameters:key – the current Galaxy admin user’s API key

The following parameters are included in the payload. :param tool_shed_urls: the base URLs of the Tool Sheds from which to install a specified Repository :param names: the names of the Repositories to be installed :param owners: the owners of the Repositories to be installed :param changeset_revisions: the changeset_revisions of each RepositoryMetadata object associated with each Repository to be installed :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, as both cannot be used.
Parameters:
  • tool_panel_section_id – optional id of the Galaxy tool panel section in which to load tools contained in the Repository. If not set, 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, as both cannot be used.
  • (optional) (shed_tool_conf) – Set to True if you want to install repository dependencies defined for the specified repository being installed. The default setting is False.
  • (optional) – Set to True if you want to install tool dependencies defined for the specified repository being installed. The default setting is False.
  • (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.
uninstall_repository(trans, *args, **kwargs)[source]

DELETE /api/tool_shed_repositories/id DELETE /api/tool_shed_repositories/

Parameters:
  • id – encoded repository id. Either id or name, owner, changeset_revision and tool_shed_url need to be supplied
  • kwd
    ‘remove_from_disk’ : Remove repository from disk or deactivate repository.
    Defaults to True (= remove repository from disk).

    ’name’ : Repository name ‘owner’ : Repository owner ‘changeset_revision’: Changeset revision to uninstall ‘tool_shed_url’ : Tool Shed URL

repair_repository_revision(trans, *args, **kwargs)[source]

POST /api/tool_shed_repositories/repair_repository_revision Repair a specified repository revision previously installed into Galaxy.

Parameters: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 the Repository was installed :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

reset_metadata_on_installed_repositories(trans, *args, **kwargs)[source]

PUT /api/tool_shed_repositories/reset_metadata_on_installed_repositories

Resets all metadata on all repositories installed into Galaxy in an “orderly fashion”.

Parameters:key – the API key of the Galaxy admin user.
show(trans, *args, **kwargs)[source]

GET /api/tool_shed_repositories/{encoded_tool_shed_repsository_id} Display a dictionary containing information about a specified tool_shed_repository.

Parameters:id – the encoded id of the ToolShedRepository object
status(trans, *args, **kwargs)[source]

GET /api/tool_shed_repositories/{id}/status Display a dictionary containing information about a specified repository’s installation status and a list of its dependencies and the status of each.

Parameters:id – the repository’s encoded id

tools module

class galaxy.webapps.galaxy.api.tools.ToolsController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesVisualizationMixin

RESTful controller for interactions with tools.

__init__(app)[source]
index(trans, *args, **kwargs)[source]

GET /api/tools: returns a list of tools defined by parameters:

parameters:

    in_panel  - if true, tools are returned in panel structure,
                including sections and labels
    trackster - if true, only tools that are compatible with
                Trackster are returned
    q         - if present search on the given query will be performed
    tool_id   - if present the given tool_id will be searched for
                all installed versions
show(trans, *args, **kwargs)[source]

GET /api/tools/{tool_id} Returns tool information, including parameters and inputs.

build(trans, *args, **kwargs)[source]

GET /api/tools/{tool_id}/build Returns a tool model including dynamic parameters and updated values, repeats block etc.

reload(trans, *args, **kwargs)[source]

GET /api/tools/{tool_id}/reload Reload specified tool.

all_requirements(trans, *args, **kwargs)[source]

GET /api/tools/all_requirements Return list of unique requirements for all tools.

requirements(trans, *args, **kwargs)[source]

GET /api/tools/{tool_id}/requirements Return the resolver status for a specific tool id. [{“status”: “installed”, “name”: “hisat2”, “versionless”: false, “resolver_type”: “conda”, “version”: “2.0.3”, “type”: “package”}]

install_dependencies(trans, *args, **kwargs)[source]

POST /api/tools/{tool_id}/dependencies

This endpoint is also available through POST /api/tools/{tool_id}/install_dependencies, but will be deprecated in the future.

Attempts to install requirements via the dependency resolver

parameters:
build_dependency_cache: If true, attempts to cache dependencies for this tool force_rebuild: If true and cache dir exists, attempts to delete cache dir
uninstall_dependencies(trans, *args, **kwargs)[source]

DELETE /api/tools/{tool_id}/dependencies Attempts to uninstall requirements via the dependency resolver

build_dependency_cache(trans, *args, **kwargs)[source]

POST /api/tools/{tool_id}/build_dependency_cache Attempts to cache installed dependencies.

parameters:
force_rebuild: If true and chache dir exists, attempts to delete cache dir
diagnostics(trans, *args, **kwargs)[source]

GET /api/tools/{tool_id}/diagnostics Return diagnostic information to help debug panel and dependency related problems.

citations(trans, *args, **kwargs)[source]
download(trans, *args, **kwargs)[source]
create(trans, *args, **kwargs)[source]

POST /api/tools Executes tool using specified inputs and returns tool’s outputs.

toolshed module

class galaxy.webapps.galaxy.api.toolshed.ToolShedController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

RESTful controller for interactions with tool sheds.

index(trans, *args, **kwargs)[source]

GET /api/tool_shed Interact with this galaxy instance’s toolshed registry.

status(trans, *args, **kwargs)[source]

GET /api/tool_shed_repositories/{id}/status Display a dictionary containing information about a specified repository’s installation status and a list of its dependencies and the status of each.

Parameters:id – the repository’s encoded id
tool_json(trans, *args, **kwargs)[source]

GET /api/tool_shed_repositories/shed_tool_json

Get the tool form JSON for a tool in a toolshed repository.

Parameters:
  • guid – the GUID of the tool
  • guid – str
  • tsr_id – the ID of the repository
  • tsr_id – str
  • changeset – the changeset at which to load the tool json
  • changeset – str
  • tool_shed_url – the URL of the toolshed to load from
  • tool_shed_url – str
show(trans, *args, **kwargs)[source]

GET /api/tool_shed/contents

Display a list of categories in the selected toolshed.

Parameters:tool_shed_url – the url of the toolshed to get categories from
category(trans, *args, **kwargs)[source]

GET /api/tool_shed/category

Display a list of repositories in the selected category.

Parameters:
  • tool_shed_url – the url of the toolshed to get repositories from
  • category_id – the category to get repositories from
repository(trans, *args, **kwargs)[source]

GET /api/tool_shed/repository

Get details about the specified repository from its shed.

Parameters:
  • repository_id – the tool_shed_repository_id
  • repository_id – str
  • tool_shed_url – the URL of the toolshed whence to retrieve repository details
  • tool_shed_url – str
  • tool_ids – (optional) comma-separated list of tool IDs
  • tool_ids – str
search(trans, *args, **kwargs)[source]

GET /api/tool_shed/search Search for a specific repository in the toolshed. :param q: the query string to search for :param q: str :param tool_shed_url: the URL of the toolshed to search :param tool_shed_url: str

tours module

API Controller providing Galaxy Tours

class galaxy.webapps.galaxy.api.tours.ToursController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

__init__(app)[source]
index(trans, *args, **kwargs)[source]

*GET /api/tours/ Displays available tours

show(trans, *args, **kwargs)[source]

load_config( self, trans, Tour_config_file, **kwd ) * GET /api/tours/{tour_id}:

Read a yaml file containing the specified tour definition
Returns:tour definition
Return type:dictionary
update_tour(trans, *args, **kwargs)[source]

This simply reloads tours right now. It’s a quick hack.

TODO: allow creation of new tours (which get written to the filesystem).

users module

API operations on User objects.

class galaxy.webapps.galaxy.api.users.UserAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesTagsMixin, galaxy.web.base.controller.CreatesUsersMixin, galaxy.web.base.controller.CreatesApiKeysMixin, galaxy.web.base.controller.BaseUIController, galaxy.web.base.controller.UsesFormDefinitionsMixin

__init__(app)[source]
index(trans, *args, **kwargs)[source]

GET /api/users GET /api/users/deleted Displays a collection (list) of users.

Parameters:
  • deleted (bool) – (optional) If true, show deleted users
  • f_email (str) – (optional) An email address to filter on. (Non-admin users can only use this if expose_user_email is True in galaxy.ini)
  • f_name (str) – (optional) A username to filter on. (Non-admin users can only use this if expose_user_name is True in galaxy.ini)
  • f_any (str) – (optional) Filter on username OR email. (Non-admin users can use this, the email filter and username filter will only be active if their corresponding expose_user_* is True in galaxy.ini)
show(trans, *args, **kwargs)[source]

GET /api/users/{encoded_id} GET /api/users/deleted/{encoded_id} GET /api/users/current Displays information about a user.

create(trans, *args, **kwargs)[source]

POST /api/users Creates a new Galaxy user.

update(self, trans, id, payload, **kwd)[source]
  • PUT /api/users/{id}
    updates the values for the item with the given id
Parameters:
  • id (str) – the encoded id of the item to update
  • payload (dict) – a dictionary of new attribute values
Return type:

dict

Returns:

an error object if an error occurred or a dictionary containing the serialized item after any changes

delete(trans, *args, **kwargs)[source]

DELETE /api/users/{id} delete the user with the given id

Parameters:
  • id (str) – the encoded id of the user to delete
  • purge (bool) – (optional) if True, purge the user
undelete(trans, *args, **kwargs)[source]
anon_user_api_value(trans)[source]

Return data for an anonymous user, truncated to only usage and quota_percent

get_information(trans, *args, **kwargs)[source]

GET /api/users/{id}/information Return user details such as username, email, addresses etc.

Parameters:id (str) – the encoded id of the user
set_information(trans, *args, **kwargs)[source]

POST /api/users/{id}/information Save a user’s email, username, addresses etc.

Parameters:
  • id (str) – the encoded id of the user
  • payload (dict) – data with new settings
send_verification_email(trans, email, username)[source]

Send the verification email containing the activation link to the user’s email.

Prepare the account activation link for the user.

get_activation_token(trans, email)[source]

Check for the activation token. Create new activation token and store it in the database if no token found.

get_password(trans, *args, **kwargs)[source]

Return available password inputs.

set_password(trans, *args, **kwargs)[source]

Allows to change a user password.

get_permissions(trans, *args, **kwargs)[source]

Get the user’s default permissions for the new histories

set_permissions(trans, *args, **kwargs)[source]

Set the user’s default permissions for the new histories

get_toolbox_filters(trans, *args, **kwargs)[source]

API call for fetching toolbox filters data. Toolbox filters are specified in galaxy.ini. The user can activate them and the choice is stored in user_preferences.

set_toolbox_filters(trans, *args, **kwargs)[source]

API call to update toolbox filters data.

api_key(trans, *args, **kwargs)[source]

Create API key.

get_api_key(trans, *args, **kwargs)[source]

Get API key inputs.

set_api_key(trans, *args, **kwargs)[source]

Get API key inputs with new API key.

get_communication(trans, *args, **kwargs)[source]

Build communication server inputs.

set_communication(trans, *args, **kwargs)[source]

Allows the user to activate/deactivate the communication server.

get_custom_builds(trans, *args, **kwargs)[source]

GET /api/users/{id}/custom_builds Returns collection of custom builds.

Parameters:id (str) – the encoded id of the user
add_custom_builds(trans, *args, **kwargs)[source]

PUT /api/users/{id}/custom_builds/{key} Add new custom build.

Parameters:
  • id (str) – the encoded id of the user
  • id – custom build key
  • payload (dict) – data with new build details
delete_custom_builds(trans, *args, **kwargs)[source]

DELETE /api/users/{id}/custom_builds/{key} Delete a custom build.

Parameters:
  • id (str) – the encoded id of the user
  • id – custom build key to be deleted

visualizations module

Visualizations resource control over the API.

NOTE!: this is a work in progress and functionality and data structures may change often.

class galaxy.webapps.galaxy.api.visualizations.VisualizationsController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesVisualizationMixin, galaxy.web.base.controller.SharableMixin, galaxy.model.item_attrs.UsesAnnotations

RESTful controller for interactions with visualizations.

index(trans, *args, **kwargs)[source]

GET /api/visualizations:

show(trans, *args, **kwargs)[source]

GET /api/visualizations/{viz_id}

create(trans, *args, **kwargs)[source]

POST /api/visualizations creates a new visualization using the given payload

POST /api/visualizations?import_id={encoded_visualization_id} imports a copy of an existing visualization into the user’s workspace

update(trans, *args, **kwargs)[source]

PUT /api/visualizations/{encoded_visualization_id}

webhooks module

API Controller providing Galaxy Webhooks

class galaxy.webapps.galaxy.api.webhooks.WebhooksController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController

__init__(app)[source]
all_webhooks(trans, *args, **kwargs)[source]

*GET /api/webhooks/ Returns all webhooks

webhook_data(trans, *args, **kwargs)[source]

*GET /api/webhooks/{webhook_id}/data/{params} Returns the result of executing helper function

workflows module

API operations for Workflows

class galaxy.webapps.galaxy.api.workflows.WorkflowsAPIController(app)[source]

Bases: galaxy.web.base.controller.BaseAPIController, galaxy.web.base.controller.UsesStoredWorkflowMixin, galaxy.model.item_attrs.UsesAnnotations, galaxy.web.base.controller.SharableMixin

__init__(app)[source]
index(trans, *args, **kwargs)[source]

GET /api/workflows

get_workflow_menu(trans, *args, **kwargs)[source]

Get workflows present in the tools panel GET /api/workflows/menu

set_workflow_menu(trans, *args, **kwargs)[source]

Save workflow menu to be shown in the tool panel PUT /api/workflows/menu

get_workflows_list(trans, kwd)[source]

Displays a collection of workflows.

Parameters:
  • show_published (boolean) – if True, show also published workflows
  • missing_tools (boolean) – if True, include a list of missing tools per workflow
show(trans, *args, **kwargs)[source]

GET /api/workflows/{encoded_workflow_id}

Displays information needed to run a workflow from the command line.

create(trans, *args, **kwargs)[source]

POST /api/workflows

Run or create workflows from the api.

If installed_repository_file or from_history_id is specified a new workflow will be created for this user. Otherwise, workflow_id must be specified and this API method will cause a workflow to execute.

:param installed_repository_file The path of a workflow to import. Either workflow_id, installed_repository_file or from_history_id must be specified :type installed_repository_file str

Parameters:
  • workflow_id (str) – An existing workflow id. Either workflow_id, installed_repository_file or from_history_id must be specified
  • parameters (dict) – If workflow_id is set - see _update_step_parameters()
  • ds_map (dict) – If workflow_id is set - a dictionary mapping each input step id to a dictionary with 2 keys: ‘src’ (which can be ‘ldda’, ‘ld’ or ‘hda’) and ‘id’ (which should be the id of a LibraryDatasetDatasetAssociation, LibraryDataset or HistoryDatasetAssociation respectively)
  • no_add_to_history (str) – If workflow_id is set - if present in the payload with any value, the input datasets will not be added to the selected history
  • history (str) – If workflow_id is set - optional history where to run the workflow, either the name of a new history or “hist_id=HIST_ID” where HIST_ID is the id of an existing history. If not specified, the workflow will be run a new unnamed history
  • replacement_params (dict) – If workflow_id is set - an optional dictionary used when renaming datasets
  • from_history_id (str) – Id of history to extract a workflow from. Either workflow_id, installed_repository_file or from_history_id must be specified
  • job_ids (str) – If from_history_id is set - optional list of jobs to include when extracting a workflow from history
  • dataset_ids (str) – If from_history_id is set - optional list of HDA `hid`s corresponding to workflow inputs when extracting a workflow from history
  • dataset_collection_ids (str) – If from_history_id is set - optional list of HDCA `hid`s corresponding to workflow inputs when extracting a workflow from history
  • workflow_name (str) – If from_history_id is set - name of the workflow to create when extracting a workflow from history
  • allow_tool_state_corrections (bool) – If set to True, any Tool parameter changes will not prevent running workflow, defaults to False
  • use_cached_job – If set to True galaxy will attempt to find previously executed steps for all workflow steps with the exact same parameter combinations and will copy the outputs of the previously executed step.
workflow_dict(trans, *args, **kwargs)[source]

GET /api/workflows/{encoded_workflow_id}/download Returns a selected workflow as a json dictionary.

delete(trans, *args, **kwargs)[source]

DELETE /api/workflows/{encoded_workflow_id} Deletes a specified workflow Author: rpark

copied from galaxy.web.controllers.workflows.py (delete)

import_new_workflow_deprecated(trans, *args, **kwargs)[source]

POST /api/workflows/upload Importing dynamic workflows from the api. Return newly generated workflow id. Author: rpark

# currently assumes payload[‘workflow’] is a json representation of a workflow to be inserted into the database

Deprecated in favor to POST /api/workflows with encoded ‘workflow’ in payload the same way.

update(trans, *args, **kwargs)[source]
  • PUT /api/workflows/{id}
    updates the workflow stored with id
Parameters:
  • id (str) – the encoded id of the workflow to update
  • payload (dict) –

    a dictionary containing any or all the * workflow the json description of the workflow as would be

    produced by GET workflows/<id>/download or given to POST workflows

    The workflow contents will be updated to target this.

    • name optional string name for the workflow, if not present in payload,
      name defaults to existing name
    • annotation optional string annotation for the workflow, if not present in payload,
      annotation defaults to existing annotation
    • menu_entry optional boolean marking if the workflow should appear in the user’s menu,
      if not present, workflow menu entries are not modified
Return type:

dict

Returns:

serialized version of the workflow

build_module(trans, *args, **kwargs)[source]

POST /api/workflows/build_module Builds module models for the workflow editor.

import_shared_workflow_deprecated(trans, *args, **kwargs)[source]

POST /api/workflows/import Import a workflow shared by other users.

Parameters:workflow_id (str) – the workflow id (required)
Raises:exceptions.MessageException, exceptions.ObjectNotFound
invoke(trans, *args, **kwargs)[source]

POST /api/workflows/{encoded_workflow_id}/invocations

Schedule the workflow specified by workflow_id to run.

index_invocations(trans, *args, **kwargs)[source]

GET /api/workflows/{workflow_id}/invocations

Get the list of the workflow invocations

Parameters:workflow_id (str) – the workflow id (required)
Raises:exceptions.MessageException, exceptions.ObjectNotFound
show_invocation(trans, *args, **kwargs)[source]

GET /api/workflows/{workflow_id}/invocations/{invocation_id} Get detailed description of workflow invocation

Parameters:
  • workflow_id (str) – the workflow id (required)
  • invocation_id (str) – the invocation id (required)
  • step_details (bool) – fetch details about individual invocation steps and populate a steps attribute in the resulting dictionary. Defaults to false.
  • legacy_job_state (bool) – If step_details is rrue, and this is set to true populate the invocation step state with the job state instead of the invocation step state. This will also produce one step per job in mapping jobs to mimic the older behavior with respect to collections. Partially scheduled steps may provide incomplete information and the listed steps outputs are the mapped over step outputs but the individual job outputs when this is set - at least for now.
Raises:

exceptions.MessageException, exceptions.ObjectNotFound

cancel_invocation(trans, *args, **kwargs)[source]

DELETE /api/workflows/{workflow_id}/invocations/{invocation_id} Cancel the specified workflow invocation.

Parameters:
  • workflow_id (str) – the workflow id (required)
  • invocation_id (str) – the usage id (required)
Raises:

exceptions.MessageException, exceptions.ObjectNotFound

invocation_step(trans, *args, **kwargs)[source]

GET /api/workflows/{workflow_id}/invocations/{invocation_id}/steps/{step_id}

Parameters:
  • workflow_id (str) – the workflow id (required)
  • invocation_id (str) – the invocation id (required)
  • step_id (str) – encoded id of the WorkflowInvocationStep (required)
  • payload – payload containing update action information for running workflow.
Raises:

exceptions.MessageException, exceptions.ObjectNotFound

update_invocation_step(trans, *args, **kwargs)[source]

PUT /api/workflows/{workflow_id}/invocations/{invocation_id}/steps/{step_id} Update state of running workflow step invocation - still very nebulous but this would be for stuff like confirming paused steps can proceed etc….

Parameters:
  • workflow_id (str) – the workflow id (required)
  • invocation_id (str) – the usage id (required)
  • step_id (str) – encoded id of the WorkflowInvocationStep (required)
Raises:

exceptions.MessageException, exceptions.ObjectNotFound