Warning

This document is for an in-development version 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.webapps.galaxy.services package

Submodules

galaxy.webapps.galaxy.services.authenticate module

class galaxy.webapps.galaxy.services.authenticate.APIKeyResponse(*, api_key: str)[source]

Bases: BaseModel

api_key: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class galaxy.webapps.galaxy.services.authenticate.AuthenticationService(user_manager: UserManager, auth_manager: AuthManager, api_keys_manager: ApiKeyManager)[source]

Bases: object

__init__(user_manager: UserManager, auth_manager: AuthManager, api_keys_manager: ApiKeyManager)[source]
get_api_key(environ: Dict[str, Any], request: Request | Request) APIKeyResponse[source]

galaxy.webapps.galaxy.services.base module

galaxy.webapps.galaxy.services.base.ensure_celery_tasks_enabled(config)[source]
exception galaxy.webapps.galaxy.services.base.SecurityNotProvidedError[source]

Bases: Exception

class galaxy.webapps.galaxy.services.base.ServiceBase(security: IdEncodingHelper | None = None)[source]

Bases: object

Base class with common logic and utils reused by other services.

A service class:
  • Provides top level operations (Index, Show, Delete…) that are usually consumed directly by the API controllers or other services.

  • Uses a combination of managers to perform the operations and avoids accessing the database layer directly.

  • Can speak ‘pydantic’ and has rich type annotations to be explicit about the required parameters and outputs of each operation.

__init__(security: IdEncodingHelper | None = None)[source]
property security: IdEncodingHelper
decode_id(id: str[str], kind: str | None = None) int[source]

Decodes a previously encoded database ID.

encode_id(id: int, kind: str | None = None) str[str][source]

Encodes a raw database ID.

decode_ids(ids: List[str[str]]) List[int][source]

Decodes all encoded IDs in the given list.

encode_all_ids(rval, recursive: bool = False)[source]

Encodes all integer values in the dict rval whose keys are ‘id’ or end with ‘_id’

It might be useful to turn this in to a decorator

build_order_by(manager: SortableManager, order_by_query: str | None = None)[source]

Returns an ORM compatible order_by clause using the order attribute and the given manager.

The manager has to implement the parse_order_by function to support all the sortable model attributes.

get_class(class_name)[source]

Returns the class object that a string denotes. Without this method, we’d have to do eval(<class_name>).

get_object(trans, id, class_name, check_ownership=False, check_accessible=False, deleted=None)[source]

Convenience method to get a model object with the specified checks.

check_user_is_authenticated(trans: ProvidesUserContext)[source]

Raises an exception if the request is anonymous.

get_authenticated_user(trans: ProvidesUserContext) User[source]

Gets the authenticated user and prevents access from anonymous users.

class galaxy.webapps.galaxy.services.base.ServedExportStore(export_store, export_target)[source]

Bases: tuple

export_store: ModelExportStore

Alias for field number 0

export_target: Any

Alias for field number 1

galaxy.webapps.galaxy.services.base.model_store_storage_target(short_term_storage_allocator: ShortTermStorageAllocator, file_name: str, model_store_format: str) ShortTermStorageTarget[source]
class galaxy.webapps.galaxy.services.base.ServesExportStores[source]

Bases: object

serve_export_store(app, download_format: str)[source]
class galaxy.webapps.galaxy.services.base.ConsumesModelStores[source]

Bases: object

create_objects_from_store(trans, payload, history=None, for_library=False)[source]
galaxy.webapps.galaxy.services.base.async_task_summary(async_result: AsyncResult) AsyncTaskResultSummary[source]

galaxy.webapps.galaxy.services.dataset_collections module

class galaxy.webapps.galaxy.services.dataset_collections.UpdateCollectionAttributePayload(*, dbkey: str)[source]

Bases: Model

Contains attributes that can be updated for all elements in a dataset collection.

dbkey: str
model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'populate_by_name': True, 'protected_namespaces': (), 'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class galaxy.webapps.galaxy.services.dataset_collections.DatasetCollectionAttributesResult(*, dbkey: str, extension: str, model_class: typing_extensions.Literal[HistoryDatasetCollectionAssociation], dbkeys: Set[str] | None, extensions: Set[str] | None, tags: TagCollection)[source]

Bases: Model

dbkey: str
extension: str
model_class: typing_extensions.Literal[HistoryDatasetCollectionAssociation]
dbkeys: Set[str] | None
extensions: Set[str] | None
tags: TagCollection
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class galaxy.webapps.galaxy.services.dataset_collections.SuitableConverter(*, tool_id: str, name: str, target_type: str, original_type: str)[source]

Bases: Model

tool_id: str
name: str
target_type: str
original_type: str
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class galaxy.webapps.galaxy.services.dataset_collections.SuitableConverters(root: RootModelRootType = PydanticUndefined)[source]

Bases: RootModel

Collection of converters that can be used on a particular dataset collection.

root: List[SuitableConverter]
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class galaxy.webapps.galaxy.services.dataset_collections.DatasetCollectionContentElements(root: RootModelRootType = PydanticUndefined)[source]

Bases: RootModel

Represents a collection of elements contained in the dataset collection.

root: List[DCESummary]
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class galaxy.webapps.galaxy.services.dataset_collections.DatasetCollectionsService(security: IdEncodingHelper, history_manager: HistoryManager, hda_manager: HDAManager, hdca_manager: HDCAManager, collection_manager: DatasetCollectionManager, datatypes_registry: Registry)[source]

Bases: ServiceBase, UsesLibraryMixinItems

__init__(security: IdEncodingHelper, history_manager: HistoryManager, hda_manager: HDAManager, hdca_manager: HDCAManager, collection_manager: DatasetCollectionManager, datatypes_registry: Registry)[source]
create(trans: ProvidesHistoryContext, payload: CreateNewCollectionPayload) HDCADetailed[source]

Create a new dataset collection instance.

Parameters:

payload (dict) – (optional) dictionary structure containing: * collection_type: dataset collection 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

copy(trans: ProvidesHistoryContext, id: int[int], payload: UpdateCollectionAttributePayload)[source]

Iterate over all datasets of a collection and copy datasets with new attributes to a new collection. e.g attributes = {‘dbkey’: ‘dm3’}

attributes(trans: ProvidesHistoryContext, id: int[int], instance_type: typing_extensions.Literal[history, library] = 'history') DatasetCollectionAttributesResult[source]

Returns dbkey/extension for collection elements

suitable_converters(trans: ProvidesHistoryContext, id: int[int], instance_type: typing_extensions.Literal[history, library] = 'history') SuitableConverters[source]

Returns suitable converters for all datatypes in collection

show(trans: ProvidesHistoryContext, id: int[int], instance_type: typing_extensions.Literal[history, library] = 'history', view: str = 'element') HDCACustom | HDCADetailed | HDCASummary[source]

Returns information about a particular dataset collection.

dce_content(trans: ProvidesHistoryContext, dce_id: int[int]) DCESummary[source]
contents(trans: ProvidesHistoryContext, hdca_id: int[int], parent_id: int[int], instance_type: typing_extensions.Literal[history, library] = 'history', limit: int | None = None, offset: int | None = None) DatasetCollectionContentElements[source]

Shows direct child contents of indicated dataset collection parent id

Parameters:
  • id – HDCA.id

  • parent_id – parent dataset_collection.id for the dataset contents to be viewed

  • limit – pagination limit for returned dataset collection elements

  • offset – pagination offset for returned dataset collection elements

Return type:

list

Returns:

list of dataset collection elements and contents

galaxy.webapps.galaxy.services.datasets module

API operations on the contents of a history dataset.

class galaxy.webapps.galaxy.services.datasets.RequestDataType(value)[source]

Bases: str, Enum

Particular pieces of information that can be requested for a dataset.

state = 'state'
converted_datasets_state = 'converted_datasets_state'
data = 'data'
features = 'features'
raw_data = 'raw_data'
track_config = 'track_config'
genome_data = 'genome_data'
in_use_state = 'in_use_state'
class galaxy.webapps.galaxy.services.datasets.DatasetContentType(value)[source]

Bases: str, Enum

For retrieving content from a structured dataset (e.g. HDF5)

meta = 'meta'
attr = 'attr'
stats = 'stats'
data = 'data'
class galaxy.webapps.galaxy.services.datasets.ConcreteObjectStoreQuotaSourceDetails(*, source: str | None, enabled: bool)[source]

Bases: Model

source: str | None
enabled: bool
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class galaxy.webapps.galaxy.services.datasets.DatasetStorageDetails(*, object_store_id: str | None, name: str | None, description: str | None, percent_used: float | None, dataset_state: str, hashes: List[dict], sources: List[dict], shareable: bool, quota: ConcreteObjectStoreQuotaSourceDetails, badges: List[BadgeDict], relocatable: bool)[source]

Bases: Model

object_store_id: str | None
name: str | None
description: str | None
percent_used: float | None
dataset_state: str
hashes: List[dict]
sources: List[dict]
shareable: bool
quota: ConcreteObjectStoreQuotaSourceDetails
badges: List[BadgeDict]
relocatable: bool
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class galaxy.webapps.galaxy.services.datasets.DatasetInheritanceChainEntry(*, name: str, dep: str)[source]

Bases: Model

name: str
dep: str
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class galaxy.webapps.galaxy.services.datasets.DatasetInheritanceChain(root: RootModelRootType = PydanticUndefined)[source]

Bases: RootModel

root: List[DatasetInheritanceChainEntry]
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class galaxy.webapps.galaxy.services.datasets.ExtraFilesEntryClass(value)[source]

Bases: str, Enum

An enumeration.

Directory = 'Directory'
File = 'File'
class galaxy.webapps.galaxy.services.datasets.ExtraFileEntry(*, class_: ExtraFilesEntryClass, path: str)[source]

Bases: Model

class_: ExtraFilesEntryClass
path: str
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class galaxy.webapps.galaxy.services.datasets.DatasetExtraFiles(root: RootModelRootType = PydanticUndefined)[source]

Bases: RootModel

A list of extra files associated with a dataset.

root: List[ExtraFileEntry]
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class galaxy.webapps.galaxy.services.datasets.DatasetTextContentDetails(*, item_data: str | None, truncated: bool, item_url: str)[source]

Bases: Model

item_data: str | None
truncated: bool
item_url: str
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class galaxy.webapps.galaxy.services.datasets.ConvertedDatasetsMap(root: RootModelRootType = PydanticUndefined)[source]

Bases: RootModel

Map of file extension -> converted dataset encoded id

root: Dict[str, int[int]]
model_config: ClassVar[ConfigDict] = {'json_schema_extra': {'example': {'csv': 'dataset_id'}}}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class galaxy.webapps.galaxy.services.datasets.DataMode(value)[source]

Bases: str, Enum

An enumeration.

Coverage = 'Coverage'
Auto = 'Auto'
class galaxy.webapps.galaxy.services.datasets.DataResult(*, data: List[Any], dataset_type: str | None = None, message: str | None = None, extra_info: Any | None = None)[source]

Bases: Model

data: List[Any]
dataset_type: str | None
message: str | None
extra_info: Any | None
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class galaxy.webapps.galaxy.services.datasets.BamDataResult(*, data: List[Any], dataset_type: str | None = None, message: str | None = None, extra_info: Any | None = None, max_low: int, max_high: int)[source]

Bases: DataResult

max_low: int
max_high: int
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class galaxy.webapps.galaxy.services.datasets.DeleteDatasetBatchPayload(*, datasets: List[DatasetSourceId], purge: bool | None = False)[source]

Bases: Model

datasets: List[DatasetSourceId]
purge: bool | None
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class galaxy.webapps.galaxy.services.datasets.ComputeDatasetHashPayload(*, hash_function: HashFunctionNameEnum | None = HashFunctionNameEnum.md5, extra_files_path: str | None = None)[source]

Bases: Model

hash_function: HashFunctionNameEnum | None
extra_files_path: str | None
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class galaxy.webapps.galaxy.services.datasets.UpdateObjectStoreIdPayload(*, object_store_id: str)[source]

Bases: Model

object_store_id: str
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class galaxy.webapps.galaxy.services.datasets.DatasetErrorMessage(*, dataset: EncodedDatasetSourceId, error_message: str)[source]

Bases: Model

dataset: EncodedDatasetSourceId
error_message: str
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class galaxy.webapps.galaxy.services.datasets.DeleteDatasetBatchResult(*, success_count: int, errors: List[DatasetErrorMessage] | None = None)[source]

Bases: Model

success_count: int
errors: List[DatasetErrorMessage] | None
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class galaxy.webapps.galaxy.services.datasets.DatasetsService(security: IdEncodingHelper, history_manager: HistoryManager, hda_manager: HDAManager, hda_serializer: HDASerializer, hdca_serializer: HDCASerializer, ldda_manager: LDDAManager, history_contents_manager: HistoryContentsManager, history_contents_filters: HistoryContentsFilters, data_provider_registry: DataProviderRegistry, dataset_manager: DatasetManager)[source]

Bases: ServiceBase, UsesVisualizationMixin

__init__(security: IdEncodingHelper, history_manager: HistoryManager, hda_manager: HDAManager, hda_serializer: HDASerializer, hdca_serializer: HDCASerializer, ldda_manager: LDDAManager, history_contents_manager: HistoryContentsManager, history_contents_filters: HistoryContentsFilters, data_provider_registry: DataProviderRegistry, dataset_manager: DatasetManager)[source]
property serializer_by_type: Dict[str, ModelSerializer]
property dataset_manager_by_type: Dict[str, DatasetAssociationManager]
index(trans: ProvidesHistoryContext, history_id: int[int] | None, serialization_params: SerializationParams, filter_query_params: FilterQueryParams) Tuple[List[HDACustom | galaxy.schema.schema.HDADetailed | galaxy.schema.schema.HDASummary | galaxy.schema.schema.HDAInaccessible | galaxy.schema.schema.HDCACustom | galaxy.schema.schema.HDCADetailed | galaxy.schema.schema.HDCASummary[HDACustom | HDADetailed | HDASummary | HDAInaccessible | HDCACustom | HDCADetailed | HDCASummary]], int][source]

Search datasets or collections using a query system and returns a list containing summary of dataset or dataset_collection information.

show(trans: ProvidesHistoryContext, dataset_id: int[int], hda_ldda: DatasetSourceType, serialization_params: SerializationParams, data_type: RequestDataType | None = None, **extra_params)[source]

Displays information about and/or content of a dataset.

show_storage(trans: ProvidesHistoryContext, dataset_id: int[int], hda_ldda: DatasetSourceType = DatasetSourceType.hda) DatasetStorageDetails[source]

Display user-facing storage details related to the objectstore a dataset resides in.

show_inheritance_chain(trans: ProvidesHistoryContext, dataset_id: int[int], hda_ldda: DatasetSourceType = DatasetSourceType.hda) DatasetInheritanceChain[source]

Display inheritance chain for the given dataset.

compute_hash(trans: ProvidesHistoryContext, dataset_id: int[int], payload: ComputeDatasetHashPayload, hda_ldda: DatasetSourceType = DatasetSourceType.hda) AsyncTaskResultSummary[source]
drs_dataset_instance(object_id: str) Tuple[int, DatasetSourceType][source]
get_drs_object(trans: ProvidesHistoryContext, object_id: str, request_url: URL) DrsObject[source]
update_permissions(trans: ProvidesHistoryContext, dataset_id: int[int], payload: UpdateDatasetPermissionsPayload, hda_ldda: DatasetSourceType = DatasetSourceType.hda) DatasetAssociationRoles[source]

Updates permissions of a dataset.

extra_files(trans: ProvidesHistoryContext, history_content_id: int[int])[source]

Generate list of extra files.

display(trans: ProvidesHistoryContext, dataset_id: int[int], hda_ldda: DatasetSourceType = DatasetSourceType.hda, preview: bool = False, filename: str | None = None, to_ext: str | None = None, raw: bool = False, offset: int | None = None, ck_size: int | None = None, **kwd)[source]

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 default if raw is unspecified or explicitly false.

get_content_as_text(trans: ProvidesHistoryContext, dataset_id: int[int]) DatasetTextContentDetails[source]

Returns dataset content as Text.

get_metadata_file(trans: ProvidesHistoryContext, history_content_id: int[int], metadata_file: str, open_file: bool = False)[source]

Gets the associated metadata file.

The open_file parameter determines if we return the path of the file or the opened file handle. TODO: Remove the open_file parameter when removing the associated legacy endpoint.

converted_ext(trans: ProvidesHistoryContext, dataset_id: int[int], ext: str, serialization_params: SerializationParams) HDACustom | HDADetailed | HDASummary | HDAInaccessible[source]

Return information about datasets made by converting this dataset to a new format

converted(trans: ProvidesHistoryContext, dataset_id: int[int]) ConvertedDatasetsMap[source]

Return a file extension -> converted dataset encoded id map with all the existing converted datasets associated with this instance.

delete_batch(trans: ProvidesHistoryContext, payload: DeleteDatasetBatchPayload) DeleteDatasetBatchResult[source]

Deletes or purges a batch of datasets. Warning: only the ownership of the dataset and upload state for HDAs is checked, no other checks or restrictions are made.

get_structured_content(trans: ProvidesHistoryContext, dataset_id: int[int], content_type: DatasetContentType, **params)[source]

Retrieves contents of a dataset. It is left to the datatype to decide how to interpret the content types.

update_object_store_id(trans, dataset_id: int[int], payload: UpdateObjectStoreIdPayload)[source]

galaxy.webapps.galaxy.services.histories module

class galaxy.webapps.galaxy.services.histories.ShareableHistoryService(manager: SharableModelManager, serializer: SharableModelSerializer, notification_service: NotificationService)[source]

Bases: ShareableService

share_with_status_cls

alias of ShareHistoryWithStatus

share_with_users(trans, id: int[int], payload: ShareWithPayload) ShareHistoryWithStatus[source]
class galaxy.webapps.galaxy.services.histories.HistoriesService(security: IdEncodingHelper, manager: HistoryManager, user_manager: UserManager, serializer: HistorySerializer, deserializer: HistoryDeserializer, citations_manager: CitationsManager, history_export_manager: HistoryExportManager, filters: HistoryFilters, short_term_storage_allocator: ShortTermStorageAllocator, notification_service: NotificationService)[source]

Bases: ServiceBase, ConsumesModelStores, ServesExportStores

Common interface/service logic for interactions with histories in the context of the API.

Provides the logic of the actions invoked by API controllers and uses type definitions and pydantic models to declare its parameters and return types.

__init__(security: IdEncodingHelper, manager: HistoryManager, user_manager: UserManager, serializer: HistorySerializer, deserializer: HistoryDeserializer, citations_manager: CitationsManager, history_export_manager: HistoryExportManager, filters: HistoryFilters, short_term_storage_allocator: ShortTermStorageAllocator, notification_service: NotificationService)[source]
index(trans: ProvidesHistoryContext, serialization_params: SerializationParams, filter_query_params: FilterQueryParams, deleted_only: bool | None = False, all_histories: bool | None = False)[source]

Return a collection of histories for the current user. Additional filters can be applied.

Parameters:

deleted_only (optional boolean) – if True, show only deleted histories, if False, non-deleted

Note

Anonymous users are allowed to get their current history

index_query(trans, payload: HistoryIndexQueryPayload, serialization_params: SerializationParams, include_total_count: bool = False) Tuple[List[CustomHistoryView | galaxy.schema.schema.HistoryDetailed | galaxy.schema.schema.HistorySummary[CustomHistoryView | HistoryDetailed | HistorySummary]], int][source]

Return a list of History accessible by the user

Return type:

list

Returns:

dictionaries containing History details

create(trans: ProvidesHistoryContext, payload: CreateHistoryPayload, serialization_params: SerializationParams)[source]

Create a new history from scratch, by copying an existing one or by importing from URL or File depending on the provided parameters in the payload.

create_from_store(trans, payload: CreateHistoryFromStore, serialization_params: SerializationParams) CustomHistoryView | galaxy.schema.schema.HistoryDetailed | galaxy.schema.schema.HistorySummary[CustomHistoryView | HistoryDetailed | HistorySummary][source]
create_from_store_async(trans, payload: CreateHistoryFromStore) AsyncTaskResultSummary[source]
show(trans: ProvidesHistoryContext, serialization_params: SerializationParams, history_id: int[int] | None = None)[source]

Returns detailed information about the history with the given encoded id. If no id is provided, then the most recently used history will be returned.

Parameters:
  • history_id – the encoded id of the history to query or None to use the most recently used

  • serialization_params – contains the optional view, keys and default_view for serialization

Returns:

detailed history information

prepare_download(trans: ProvidesHistoryContext, history_id: int[int], payload: StoreExportPayload) AsyncFile[source]
write_store(trans: ProvidesHistoryContext, history_id: int[int], payload: WriteStoreToPayload) AsyncTaskResultSummary[source]
update(trans: ProvidesHistoryContext, history_id: int[int], payload, serialization_params: SerializationParams)[source]

Updates the values for the history with the given id

Parameters:
  • history_id – the encoded id of the history to update

  • payload

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

    • annotation: an annotation for the history

  • serialization_params – contains the optional view, keys and default_view for serialization

Returns:

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

delete(trans: ProvidesHistoryContext, history_id: int[int], serialization_params: SerializationParams, purge: bool = False)[source]

Delete the history with the given id

Note

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

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

undelete(trans: ProvidesHistoryContext, history_id: int[int], serialization_params: SerializationParams)[source]

Undelete history (that hasn’t been purged) with the given id

Parameters:
  • history_id – the encoded id of the history to undelete

  • serialization_params – contains the optional view, keys and default_view for serialization

Returns:

the undeleted history

shared_with_me(trans: ProvidesHistoryContext, serialization_params: SerializationParams, filter_query_params: FilterQueryParams)[source]

Return all histories that are shared with the current user. The results can be filtered.

count(trans: ProvidesHistoryContext)[source]

Returns number of histories for the current user.

published(trans: ProvidesHistoryContext, serialization_params: SerializationParams, filter_query_params: FilterQueryParams)[source]

Return all histories that are published. The results can be filtered.

citations(trans: ProvidesHistoryContext, history_id: int[int])[source]

Return all the citations for the tools used to produce the datasets in the history.

index_exports(trans: ProvidesHistoryContext, history_id: int[int], use_tasks: bool = False, limit: int | None = None, offset: int | None = None)[source]
archive_export(trans, history_id: int[int], payload: ExportHistoryArchivePayload | None = None) Tuple[JobExportHistoryArchiveModel | JobIdResponse, bool][source]

start job (if needed) to create history export for corresponding history.

Parameters:

history_id – the encoded id of the history to export

Returns:

object containing url to fetch export from.

get_ready_history_export(trans: ProvidesHistoryContext, history_id: int[int], jeha_id: int[int] | typing_extensions.Literal[latest]) JobExportHistoryArchive[source]

Returns the exported history archive information if it’s ready or raises an exception if not.

get_archive_download_path(trans: ProvidesHistoryContext, jeha: JobExportHistoryArchive) str[source]

If ready and available, return raw contents of exported history using a generator function.

get_archive_media_type(jeha: JobExportHistoryArchive)[source]
legacy_archive_download(trans: ProvidesHistoryContext, history_id: int[int], jeha_id: int[int])[source]

If ready and available, return raw contents of exported history.

get_custom_builds_metadata(trans: ProvidesHistoryContext, history_id: int[int]) CustomBuildsMetadataResponse[source]

Returns metadata for custom builds.

archive_history(trans: ProvidesHistoryContext, history_id: int[int], payload: ArchiveHistoryRequestPayload | None = None) CustomArchivedHistoryView | galaxy.schema.schema.ArchivedHistoryDetailed | galaxy.schema.schema.ArchivedHistorySummary[CustomArchivedHistoryView | ArchivedHistoryDetailed | ArchivedHistorySummary][source]

Marks the history with the given id as archived and optionally associates it with the given archive export record in the payload.

Archived histories are not part of the active histories of the user, so they won’t be shown to the user by default.

restore_archived_history(trans: ProvidesHistoryContext, history_id: int[int], force: bool | None = False) CustomHistoryView | galaxy.schema.schema.HistoryDetailed | galaxy.schema.schema.HistorySummary[CustomHistoryView | HistoryDetailed | HistorySummary][source]
get_archived_histories(trans: ProvidesHistoryContext, serialization_params: SerializationParams, filter_query_params: FilterQueryParams, include_total_matches: bool = False) Tuple[List[CustomArchivedHistoryView | galaxy.schema.schema.ArchivedHistoryDetailed | galaxy.schema.schema.ArchivedHistorySummary[CustomArchivedHistoryView | ArchivedHistoryDetailed | ArchivedHistorySummary]], int | None][source]
galaxy.webapps.galaxy.services.histories.get_fasta_hdas_by_history(session: galaxy_scoped_session, history_id: int)[source]

galaxy.webapps.galaxy.services.history_contents module

galaxy.webapps.galaxy.services.invocations module

class galaxy.webapps.galaxy.services.invocations.InvocationIndexPayload(*, workflow_id: int | None = None, history_id: int | None = None, job_id: int | None = None, user_id: int | None = None, sort_by: InvocationSortByEnum | None = None, sort_desc: bool = False, include_terminal: bool = True, limit: int | None[int | None] = 100, offset: int | None = 0, include_nested_invocations: bool = True, instance: bool = False)[source]

Bases: InvocationIndexQueryPayload

instance: bool
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class galaxy.webapps.galaxy.services.invocations.PrepareStoreDownloadPayload(*, bco_merge_history_metadata: bool = False, bco_override_environment_variables: Dict[str, str] | None = None, bco_override_empirical_error: Dict[str, str] | None = None, bco_override_algorithmic_error: Dict[str, str] | None = None, bco_override_xref: List[XrefItem] | None = None, model_store_format: ModelStoreFormat = ModelStoreFormat.TAR_DOT_GZ, include_files: bool = True, include_deleted: bool = False, include_hidden: bool = False)[source]

Bases: StoreExportPayload, BcoGenerationParametersMixin

model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_store_format: ModelStoreFormat
include_files: bool
include_deleted: bool
include_hidden: bool
class galaxy.webapps.galaxy.services.invocations.WriteInvocationStoreToPayload(*, bco_merge_history_metadata: bool = False, bco_override_environment_variables: Dict[str, str] | None = None, bco_override_empirical_error: Dict[str, str] | None = None, bco_override_algorithmic_error: Dict[str, str] | None = None, bco_override_xref: List[XrefItem] | None = None, model_store_format: ModelStoreFormat = ModelStoreFormat.TAR_DOT_GZ, include_files: bool = True, include_deleted: bool = False, include_hidden: bool = False, target_uri: str)[source]

Bases: WriteStoreToPayload, BcoGenerationParametersMixin

model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

target_uri: str
model_store_format: ModelStoreFormat
include_files: bool
include_deleted: bool
include_hidden: bool
class galaxy.webapps.galaxy.services.invocations.InvocationsService(security: IdEncodingHelper, histories_manager: HistoryManager, workflows_manager: WorkflowsManager, short_term_storage_allocator: ShortTermStorageAllocator)[source]

Bases: ServiceBase, ConsumesModelStores

__init__(security: IdEncodingHelper, histories_manager: HistoryManager, workflows_manager: WorkflowsManager, short_term_storage_allocator: ShortTermStorageAllocator)[source]
index(trans, invocation_payload: InvocationIndexPayload, serialization_params: InvocationSerializationParams) Tuple[List[WorkflowInvocationResponse], int][source]
show(trans, invocation_id, serialization_params, eager=False)[source]
as_request(trans: ProvidesUserContext, invocation_id) WorkflowInvocationRequestModel[source]
cancel(trans, invocation_id, serialization_params)[source]
show_invocation_report(trans, invocation_id, format='json')[source]
show_invocation_step(trans, step_id) InvocationStep[source]
show_invocation_metrics(trans: ProvidesHistoryContext, invocation_id: int)[source]
update_invocation_step(trans, step_id, action)[source]
show_invocation_step_jobs_summary(trans, invocation_id) List[Dict[str, Any]][source]
show_invocation_jobs_summary(trans, invocation_id) Dict[str, Any][source]
prepare_store_download(trans, invocation_id: int[int], payload: PrepareStoreDownloadPayload) AsyncFile[source]
write_store(trans, invocation_id: int[int], payload: WriteInvocationStoreToPayload) AsyncTaskResultSummary[source]
serialize_workflow_invocation(invocation: WorkflowInvocation, params: InvocationSerializationParams, default_view: InvocationSerializationView = InvocationSerializationView.element)[source]
serialize_workflow_invocations(invocations, params: InvocationSerializationParams, default_view: InvocationSerializationView = InvocationSerializationView.collection)[source]
serialize_workflow_invocation_step(invocation_step: WorkflowInvocationStep)[source]
create_from_store(trans: ProvidesHistoryContext, payload: CreateInvocationFromStore, serialization_params: InvocationSerializationParams)[source]
serialize_workflow_invocation_to_request(trans: ProvidesUserContext, invocation: WorkflowInvocation) WorkflowInvocationRequestModel[source]

galaxy.webapps.galaxy.services.jobs module

galaxy.webapps.galaxy.services.libraries module

class galaxy.webapps.galaxy.services.libraries.LibrariesService(security: IdEncodingHelper, folder_manager: FolderManager, library_manager: LibraryManager, role_manager: RoleManager)[source]

Bases: ServiceBase, ConsumesModelStores

Common interface/service logic for interactions with libraries (top level) in the context of the API.

Provides the logic of the actions invoked by API controllers and uses type definitions and pydantic models to declare its parameters and return types.

__init__(security: IdEncodingHelper, folder_manager: FolderManager, library_manager: LibraryManager, role_manager: RoleManager)[source]
index(trans: ProvidesAppContext, deleted: bool | None = False) LibrarySummaryList[source]

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(trans, id: int[int]) LibrarySummary[source]

Returns detailed information about a library.

create(trans, payload: CreateLibraryPayload) LibrarySummary[source]

Creates a new library.

Note

Currently, only admin users can create libraries.

create_from_store(trans, payload: CreateLibrariesFromStore) List[LibrarySummary][source]
update(trans, id: int[int], payload: UpdateLibraryPayload) LibrarySummary[source]

Updates the library with given id with the data in the payload.

delete(trans, id: int[int], undelete: bool | None = False) LibrarySummary[source]

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:

undelete (bool) – (optional) flag specifying whether the item should be deleted or undeleted, defaults to false:

get_permissions(trans, id: int[int], scope: LibraryPermissionScope | None = LibraryPermissionScope.current, is_library_access: bool | None = False, page: int = 1, page_limit: int = 10, query: str | None = None) LibraryCurrentPermissions | LibraryAvailablePermissions[source]

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

Parameters:
  • 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, id: int[int], payload: Dict[str, Any]) LibraryLegacySummary | LibraryCurrentPermissions[source]

Set permissions of the given library to the given role ids.

Parameters:
  • 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: Dict[str, Any]) LibraryLegacySummary[source]

* old implementation for backward compatibility *

Updates the library permissions.

galaxy.webapps.galaxy.services.library_folder_contents module

class galaxy.webapps.galaxy.services.library_folder_contents.UserFolderPermissions(access: bool, modify: bool, add: bool, manage: bool)[source]

Bases: object

access: bool
modify: bool
add: bool
manage: bool
__init__(access: bool, modify: bool, add: bool, manage: bool) None
class galaxy.webapps.galaxy.services.library_folder_contents.LibraryFolderContentsService(security: IdEncodingHelper, hda_manager: HDAManager, folder_manager: FolderManager)[source]

Bases: ServiceBase, UsesLibraryMixinItems

Interface/service shared by controllers for interacting with the contents of a library folder.

__init__(security: IdEncodingHelper, hda_manager: HDAManager, folder_manager: FolderManager)[source]
get_object(trans, id, class_name, check_ownership=False, check_accessible=False, deleted=None)[source]

Convenience method to get a model object with the specified checks.

index(trans: ProvidesUserContext, folder_id: int[int], payload: LibraryFolderContentsIndexQueryPayload) LibraryFolderContentsIndexResult[source]

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.

create(trans: ProvidesUserContext, folder_id: int[int], payload: CreateLibraryFilePayload)[source]

Create a new library file from an HDA/HDCA.

galaxy.webapps.galaxy.services.library_folders module

class galaxy.webapps.galaxy.services.library_folders.LibraryFoldersService(security: IdEncodingHelper, folder_manager: FolderManager, role_manager: RoleManager)[source]

Bases: ServiceBase

Common interface/service logic for interactions with library folders in the context of the API. Provides the logic of the actions invoked by API controllers and uses type definitions and pydantic models to declare its parameters and return types.

__init__(security: IdEncodingHelper, folder_manager: FolderManager, role_manager: RoleManager)[source]
show(trans, folder_id: int[int]) LibraryFolderDetails[source]

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, parent_folder_id: int[int], payload: CreateLibraryFolderPayload) LibraryFolderDetails[source]

Create a new folder object underneath the one specified in the parameters.

Parameters:
  • parent_folder_id – (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, folder_id: int[int], scope: LibraryPermissionScope | None = LibraryPermissionScope.current, page: int = 1, page_limit: int = 10, query: str | None = None) LibraryFolderCurrentPermissions | LibraryAvailablePermissions[source]

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

Parameters:
  • folder_id – 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, folder_id: int[int], payload: dict) LibraryFolderCurrentPermissions[source]

Set permissions of the given folder to the given role ids.

Parameters:
  • folder_id – 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(trans, folder_id: int[int], undelete: bool | None = False) LibraryFolderDetails[source]

Mark the folder with the given encoded_folder_id as deleted (or remove the deleted mark if the undelete param is true).

Note

Currently, only admin users can un/delete folders.

Parameters:
  • folder_id – 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, folder_id: int[int], payload: UpdateLibraryFolderPayload) LibraryFolderDetails[source]

Update the folder with id folder_id with the data in the payload.

Note

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

param folder_id:

the encoded id of the folder

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

galaxy.webapps.galaxy.services.pages module

class galaxy.webapps.galaxy.services.pages.PagesService(security: IdEncodingHelper, manager: PageManager, serializer: PageSerializer, short_term_storage_allocator: ShortTermStorageAllocator, notification_service: NotificationService)[source]

Bases: ServiceBase

Common interface/service logic for interactions with pages in the context of the API.

Provides the logic of the actions invoked by API controllers and uses type definitions and pydantic models to declare its parameters and return types.

__init__(security: IdEncodingHelper, manager: PageManager, serializer: PageSerializer, short_term_storage_allocator: ShortTermStorageAllocator, notification_service: NotificationService)[source]
index(trans, payload: PageIndexQueryPayload, include_total_count: bool = False) Tuple[PageSummaryList, int][source]

Return a list of Pages viewable by the user

Return type:

list

Returns:

dictionaries containing summary or detailed Page information

create(trans, payload: CreatePagePayload) PageSummary[source]

Create a page and return Page summary

delete(trans, id: int[int])[source]

Mark page as deleted

Parameters:

id – ID of the page to be deleted

undelete(trans, id: int[int])[source]

Undelete page

Parameters:

id – ID of the page to be undeleted

show(trans, id: int[int]) PageDetails[source]

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

show_pdf(trans, id: int[int])[source]

View a page summary and the content of the latest revision as PDF.

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

prepare_pdf(trans, id: int[int]) AsyncFile[source]

galaxy.webapps.galaxy.services.quotas module

class galaxy.webapps.galaxy.services.quotas.QuotasService(security: IdEncodingHelper, quota_manager: QuotaManager)[source]

Bases: ServiceBase

Interface/service object shared by controllers for interacting with quotas.

__init__(security: IdEncodingHelper, quota_manager: QuotaManager)[source]
index(trans: ProvidesUserContext, deleted: bool = False) QuotaSummaryList[source]

Displays a list of quotas.

show(trans: ProvidesUserContext, id: int[int], deleted: bool = False) QuotaDetails[source]

Displays information about a quota.

create(trans: ProvidesUserContext, params: CreateQuotaParams) CreateQuotaResult[source]

Creates a new quota.

update(trans: ProvidesUserContext, id: int[int], params: UpdateQuotaParams) str[source]

Modifies a quota.

delete(trans: ProvidesUserContext, id: int[int], payload: DeleteQuotaPayload | None = None) str[source]

Marks a quota as deleted.

purge(trans: ProvidesUserContext, id: int[int]) str[source]

Purges a previously deleted quota.

undelete(trans: ProvidesUserContext, id: int[int]) str[source]

Restores a previously deleted quota.

validate_in_users_and_groups(trans, payload)[source]

For convenience, in_users and in_groups can be encoded IDs or emails/group names in the API.

galaxy.webapps.galaxy.services.quotas.get_quotas(session: galaxy_scoped_session, deleted: bool = False)[source]

galaxy.webapps.galaxy.services.sharable module

class galaxy.webapps.galaxy.services.sharable.ShareableService(manager: SharableModelManager, serializer: SharableModelSerializer, notification_service: NotificationService)[source]

Bases: object

Provides the common logic used by the API to share any kind of resource with other users.

The Manager class of the particular resource must implement the SharableModelManager and have a compatible SharableModelSerializer implementation.

share_with_status_cls

alias of ShareWithStatus

__init__(manager: SharableModelManager, serializer: SharableModelSerializer, notification_service: NotificationService) None[source]
set_slug(trans, id: int[int], payload: SetSlugPayload)[source]
sharing(trans, id: int[int]) SharingStatus[source]

Gets the current sharing status of the item with the given id.

Makes this item accessible by link. If this item contains other elements they will be publicly accessible too.

publish(trans, id: int[int]) SharingStatus[source]

Makes this item publicly accessible. If this item contains other elements they will be publicly accessible too.

unpublish(trans, id: int[int]) SharingStatus[source]
share_with_users(trans, id: int[int], payload: ShareWithPayload) ShareWithStatus[source]
class galaxy.webapps.galaxy.services.sharable.SharedItemNotificationFactory[source]

Bases: object

source = 'galaxy_sharing_system'
type_map: Dict[Type[History | StoredWorkflow | Visualization | Page], typing_extensions.Literal[history, workflow, visualization, page]] = {<class 'galaxy.model.History'>: 'history', <class 'galaxy.model.StoredWorkflow'>: 'workflow', <class 'galaxy.model.Visualization'>: 'visualization', <class 'galaxy.model.Page'>: 'page'}
static build_notification_request(item: History | StoredWorkflow | Visualization | Page, users_to_notify: Set[User], status: ShareWithStatus, galaxy_url: str | None = None) NotificationCreateRequest[source]

galaxy.webapps.galaxy.services.tools module

class galaxy.webapps.galaxy.services.tools.ToolsService(config: GalaxyAppConfiguration, toolbox_search: ToolBoxSearch, security: IdEncodingHelper, history_manager: HistoryManager)[source]

Bases: ServiceBase

__init__(config: GalaxyAppConfiguration, toolbox_search: ToolBoxSearch, security: IdEncodingHelper, history_manager: HistoryManager)[source]
create_fetch(trans: ProvidesHistoryContext, fetch_payload: FetchDataFormPayload | FetchDataPayload, files: List[UploadFile] | None = None)[source]

galaxy.webapps.galaxy.services.users module

class galaxy.webapps.galaxy.services.users.UsersService(security: IdEncodingHelper, user_manager: UserManager, api_key_manager: ApiKeyManager, user_serializer: UserSerializer, user_deserializer: UserDeserializer, quota_agent: QuotaAgent)[source]

Bases: ServiceBase

Common interface/service logic for interactions with users in the context of the API.

Provides the logic of the actions invoked by API controllers and uses type definitions and pydantic models to declare its parameters and return types.

__init__(security: IdEncodingHelper, user_manager: UserManager, api_key_manager: ApiKeyManager, user_serializer: UserSerializer, user_deserializer: UserDeserializer, quota_agent: QuotaAgent)[source]
recalculate_disk_usage(trans: ProvidesUserContext, user_id: int)[source]
get_api_key(trans: ProvidesUserContext, user_id: int) APIKeyModel | None[source]

Returns the current API key or None if the user doesn’t have any valid API key.

get_or_create_api_key(trans: ProvidesUserContext, user_id: int) str[source]

Returns the current API key (as plain string) or creates a new one.

create_api_key(trans: ProvidesUserContext, user_id: int) APIKeyModel[source]

Creates a new API key for the given user

delete_api_key(trans: ProvidesUserContext, user_id: int) None[source]

Deletes a particular API key

get_user(trans: ProvidesUserContext, user_id)[source]
get_non_anonymous_user_full(trans: ProvidesUserContext, user_id: int[int] | typing_extensions.Literal[current], deleted: bool) User[source]
get_user_full(trans: ProvidesUserContext, user_id: int[int] | typing_extensions.Literal[current], deleted: bool) User | None[source]
show_user(trans: ProvidesHistoryContext, user_id: int[int] | typing_extensions.Literal[current], deleted: bool) DetailedUserModel | AnonUserModel[source]
user_to_detailed_model(user: User) DetailedUserModel[source]
get_index(trans: ProvidesUserContext, deleted: bool, f_email: str | None, f_name: str | None, f_any: str | None) List[UserModel | LimitedUserModel][source]
get_user_roles(trans, user_id)[source]

galaxy.webapps.galaxy.services.visualizations module

class galaxy.webapps.galaxy.services.visualizations.VisualizationsService(security: IdEncodingHelper, manager: VisualizationManager, serializer: VisualizationSerializer, notification_service: NotificationService)[source]

Bases: ServiceBase

Common interface/service logic for interactions with visualizations in the context of the API.

Provides the logic of the actions invoked by API controllers and uses type definitions and pydantic models to declare its parameters and return types.

__init__(security: IdEncodingHelper, manager: VisualizationManager, serializer: VisualizationSerializer, notification_service: NotificationService)[source]
index(trans: ProvidesUserContext, payload: VisualizationIndexQueryPayload, include_total_count: bool = False) Tuple[VisualizationSummaryList, int][source]

Return a list of Visualizations viewable by the user

Return type:

list

Returns:

dictionaries containing Visualization details

show(trans: ProvidesUserContext, visualization_id: int[int]) VisualizationShowResponse[source]

Return a dictionary containing the Visualization’s details

Return type:

dictionary

Returns:

Visualization details

create(trans: ProvidesUserContext, import_id: int[int] | None, payload: VisualizationCreatePayload) VisualizationCreateResponse[source]

Returns a dictionary of the created visualization

Return type:

dictionary

Returns:

dictionary containing Visualization details

update(trans: ProvidesUserContext, visualization_id: int[int], payload: VisualizationUpdatePayload) VisualizationUpdateResponse | None[source]

Update a visualization

Return type:

dictionary

Returns:

dictionary containing Visualization details

galaxy.webapps.galaxy.services.workflows module

class galaxy.webapps.galaxy.services.workflows.WorkflowIndexPayload(*, show_deleted: bool = False, show_hidden: bool = False, show_published: bool | None = None, show_shared: bool | None = None, sort_by: typing_extensions.Literal[create_time, update_time, name] | None = None, sort_desc: bool | None = None, limit: int | None[int | None] = None, offset: int | None = 0, search: str | None = None, skip_step_counts: bool = False, missing_tools: bool = False)[source]

Bases: WorkflowIndexQueryPayload

missing_tools: bool
model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'protected_namespaces': (), 'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class galaxy.webapps.galaxy.services.workflows.WorkflowsService(workflows_manager: WorkflowsManager, workflow_contents_manager: WorkflowContentsManager, serializer: WorkflowSerializer, tool_shed_registry: Registry, notification_service: NotificationService)[source]

Bases: ServiceBase

__init__(workflows_manager: WorkflowsManager, workflow_contents_manager: WorkflowContentsManager, serializer: WorkflowSerializer, tool_shed_registry: Registry, notification_service: NotificationService)[source]
index(trans: ProvidesUserContext, payload: WorkflowIndexPayload, include_total_count: bool = False) Tuple[List[Dict[str, Any]], int | None][source]
invoke_workflow(trans, workflow_id, payload: InvokeWorkflowPayload) WorkflowInvocationResponse | List[WorkflowInvocationResponse][source]
delete(trans, workflow_id)[source]
undelete(trans, workflow_id)[source]
get_versions(trans, workflow_id, instance: bool)[source]
invocation_counts(trans, workflow_id, instance: bool) RootModel[Dict[str, int]][source]
get_workflow_menu(trans, payload)[source]
refactor(trans, workflow_id, payload, instance: bool) RefactorResponse[source]
show_workflow(trans, workflow_id, instance, legacy, version) StoredWorkflowDetailed[source]