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.webapps.galaxy.services package¶
Submodules¶
galaxy.webapps.galaxy.services.authenticate module¶
- class galaxy.webapps.galaxy.services.authenticate.APIKeyResponse(*, api_key: str)[source]¶
Bases:
BaseModel
- 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]¶
galaxy.webapps.galaxy.services.base module¶
- class galaxy.webapps.galaxy.services.base.ServiceBase(security: IdEncodingHelper)[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)[source]¶
- decode_id(id: EncodedDatabaseIdField) int [source]¶
Decodes a previously encoded database ID.
- encode_id(id: int) EncodedDatabaseIdField [source]¶
Encodes a raw database ID.
- decode_ids(ids: List[EncodedDatabaseIdField]) 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: Optional[str] = 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
- property export_store¶
Alias for field number 0
- property export_target¶
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]¶
- 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:
BaseModel
Contains attributes that can be updated for all elements in a dataset collection.
- class galaxy.webapps.galaxy.services.dataset_collections.DatasetCollectionAttributesResult(*, dbkey: str, extension: str, model_class: str = 'HistoryDatasetCollectionAssociation', dbkeys: Set[str] = None, extensions: Set[str] = None, tags: TagCollection)[source]¶
Bases:
BaseModel
- tags: TagCollection¶
- class galaxy.webapps.galaxy.services.dataset_collections.SuitableConverter(*, tool_id: str, name: str, target_type: str, original_type: str)[source]¶
Bases:
BaseModel
- class galaxy.webapps.galaxy.services.dataset_collections.SuitableConverters(*, __root__: List[SuitableConverter])[source]¶
Bases:
BaseModel
Collection of converters that can be used on a particular dataset collection.
- class galaxy.webapps.galaxy.services.dataset_collections.DatasetCollectionContentElements(*, __root__: List[DCESummary])[source]¶
Bases:
BaseModel
Represents a collection of elements contained in the dataset collection.
- class galaxy.webapps.galaxy.services.dataset_collections.DatasetCollectionsService(security: IdEncodingHelper, history_manager: HistoryManager, hdca_manager: HDCAManager, collection_manager: DatasetCollectionManager, datatypes_registry: Registry)[source]¶
Bases:
ServiceBase
,UsesLibraryMixinItems
- __init__(security: IdEncodingHelper, history_manager: HistoryManager, 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
- Returns
element view of new dataset collection
- copy(trans: ProvidesHistoryContext, id: EncodedDatabaseIdField, 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: EncodedDatabaseIdField, instance_type: DatasetCollectionInstanceType = DatasetCollectionInstanceType.history) DatasetCollectionAttributesResult [source]¶
Returns dbkey/extension for collection elements
- suitable_converters(trans: ProvidesHistoryContext, id: EncodedDatabaseIdField, instance_type: DatasetCollectionInstanceType = DatasetCollectionInstanceType.history) SuitableConverters [source]¶
Returns suitable converters for all datatypes in collection
- show(trans: ProvidesHistoryContext, id: EncodedDatabaseIdField, instance_type: DatasetCollectionInstanceType = DatasetCollectionInstanceType.history) Union[HDCADetailed, HDCASummary] [source]¶
Returns information about a particular dataset collection.
- contents(trans: ProvidesHistoryContext, hdca_id: EncodedDatabaseIdField, parent_id: EncodedDatabaseIdField, instance_type: DatasetCollectionInstanceType = DatasetCollectionInstanceType.history, limit: Optional[int] = None, offset: Optional[int] = 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
- 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]¶
-
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.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])[source]¶
Bases:
Model
- class galaxy.webapps.galaxy.services.datasets.DatasetInheritanceChainEntry(*, name: str, dep: str)[source]¶
Bases:
Model
- class galaxy.webapps.galaxy.services.datasets.DatasetInheritanceChain(*, __root__: List[DatasetInheritanceChainEntry] = [])[source]¶
Bases:
Model
- class galaxy.webapps.galaxy.services.datasets.ExtraFilesEntryClass(value)[source]¶
-
An enumeration.
- Directory = 'Directory'¶
- File = 'File'¶
- class galaxy.webapps.galaxy.services.datasets.ExtraFileEntry(*, class: ~galaxy.webapps.galaxy.services.datasets.ExtraFilesEntryClass, path: str)[source]¶
Bases:
Model
- class_: ExtraFilesEntryClass¶
- class galaxy.webapps.galaxy.services.datasets.DatasetTextContentDetails(*, item_data: str = None, truncated: bool, item_url: str)[source]¶
Bases:
Model
- class galaxy.webapps.galaxy.services.datasets.ConvertedDatasetsMap(*, __root__: Dict[str, EncodedDatabaseIdField])[source]¶
Bases:
BaseModel
Map of file extension -> converted dataset encoded id
- class galaxy.webapps.galaxy.services.datasets.DataMode(value)[source]¶
-
An enumeration.
- Coverage = 'Coverage'¶
- Auto = 'Auto'¶
- class galaxy.webapps.galaxy.services.datasets.DataResult(*, data: List[Any], dataset_type: str = None, message: str = None, extra_info: Any = None)[source]¶
Bases:
BaseModel
- class galaxy.webapps.galaxy.services.datasets.BamDataResult(*, data: List[Any], dataset_type: str = None, message: str = None, extra_info: Any = None, max_low: int, max_high: int)[source]¶
Bases:
DataResult
- class galaxy.webapps.galaxy.services.datasets.DeleteDatasetBatchPayload(*, datasets: List[DatasetSourceId], purge: bool = False)[source]¶
Bases:
BaseModel
- datasets: List[DatasetSourceId]¶
- class galaxy.webapps.galaxy.services.datasets.DatasetErrorMessage(*, dataset: DatasetSourceId, error_message: str)[source]¶
Bases:
BaseModel
- dataset: DatasetSourceId¶
- class galaxy.webapps.galaxy.services.datasets.DeleteDatasetBatchResult(*, success_count: int, errors: List[DatasetErrorMessage] = None)[source]¶
Bases:
BaseModel
- errors: Optional[List[DatasetErrorMessage]]¶
- 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)[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)[source]¶
- property serializer_by_type: Dict[str, ModelSerializer]¶
- property dataset_manager_by_type: Dict[str, DatasetAssociationManager]¶
- index(trans: ProvidesHistoryContext, history_id: Optional[EncodedDatabaseIdField], serialization_params: SerializationParams, filter_query_params: FilterQueryParams) List[Union[HDADetailed, HDASummary, HDCADetailed, HDCASummary, CustomHistoryItem]] [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: EncodedDatabaseIdField, hda_ldda: DatasetSourceType, serialization_params: SerializationParams, data_type: Optional[RequestDataType] = None, **extra_params)[source]¶
Displays information about and/or content of a dataset.
- show_storage(trans: ProvidesHistoryContext, dataset_id: EncodedDatabaseIdField, 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: EncodedDatabaseIdField, hda_ldda: DatasetSourceType = DatasetSourceType.hda) DatasetInheritanceChain [source]¶
Display inheritance chain for the given dataset.
- update_permissions(trans: ProvidesHistoryContext, dataset_id: EncodedDatabaseIdField, payload: UpdateDatasetPermissionsPayload, hda_ldda: DatasetSourceType = DatasetSourceType.hda) DatasetAssociationRoles [source]¶
Updates permissions of a dataset.
- extra_files(trans: ProvidesHistoryContext, history_content_id: EncodedDatabaseIdField)[source]¶
Generate list of extra files.
- display(trans: ProvidesHistoryContext, history_content_id: EncodedDatabaseIdField, preview: bool = False, filename: Optional[str] = None, to_ext: Optional[str] = None, raw: bool = False, **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 defult if raw is unspecified or explicitly false.
- get_content_as_text(trans: ProvidesHistoryContext, dataset_id: EncodedDatabaseIdField) DatasetTextContentDetails [source]¶
Returns dataset content as Text.
- get_metadata_file(trans: ProvidesHistoryContext, history_content_id: EncodedDatabaseIdField, 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: EncodedDatabaseIdField, ext: str, serialization_params: SerializationParams) Union[HDADetailed, HDASummary] [source]¶
Return information about datasets made by converting this dataset to a new format
- converted(trans: ProvidesHistoryContext, dataset_id: EncodedDatabaseIdField) 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.
galaxy.webapps.galaxy.services.histories module¶
- class galaxy.webapps.galaxy.services.histories.HistoriesService(security: IdEncodingHelper, manager: HistoryManager, user_manager: UserManager, serializer: HistorySerializer, deserializer: HistoryDeserializer, citations_manager: CitationsManager, history_export_view: HistoryExportView, filters: HistoryFilters, short_term_storage_allocator: ShortTermStorageAllocator)[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_view: HistoryExportView, filters: HistoryFilters, short_term_storage_allocator: ShortTermStorageAllocator)[source]¶
- index(trans: ProvidesHistoryContext, serialization_params: SerializationParams, filter_query_params: FilterQueryParams, deleted_only: Optional[bool] = False, all_histories: Optional[bool] = 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
- 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) Union[HistoryBeta, HistoryDetailed, HistorySummary, Any] [source]¶
- create_from_store_async(trans, payload: CreateHistoryFromStore) AsyncTaskResultSummary [source]¶
- show(trans: ProvidesHistoryContext, serialization_params: SerializationParams, history_id: Optional[EncodedDatabaseIdField] = 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
id (an optional encoded id string) – the encoded id of the history to query or None to use the most recently used
serialization_params (dictionary) – contains the optional view, keys and default_view for serialization
- Return type
dictionary
- Returns
detailed history information
- prepare_download(trans: ProvidesHistoryContext, history_id: EncodedDatabaseIdField, payload: StoreExportPayload) AsyncFile [source]¶
- write_store(trans: ProvidesHistoryContext, history_id: EncodedDatabaseIdField, payload: WriteStoreToPayload) AsyncTaskResultSummary [source]¶
- update(trans: ProvidesHistoryContext, id: EncodedDatabaseIdField, payload, serialization_params: SerializationParams)[source]¶
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
serialization_params (dictionary) – contains the optional view, keys and default_view for serialization
- Return type
- 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: EncodedDatabaseIdField, 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.- Parameters
serialization_params (dictionary) – contains the optional view, keys and default_view for serialization
- Return type
- Returns
the deleted or purged history
- undelete(trans: ProvidesHistoryContext, history_id: EncodedDatabaseIdField, serialization_params: SerializationParams)[source]¶
Undelete history (that hasn’t been purged) with the given
id
Return all histories that are shared with the current user. The results can be filtered.
- 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: EncodedDatabaseIdField)[source]¶
Return all the citations for the tools used to produce the datasets in the history.
- index_exports(trans: ProvidesHistoryContext, id: EncodedDatabaseIdField)[source]¶
Get previous history exports (to links). Effectively returns serialized JEHA objects.
- archive_export(trans, id: EncodedDatabaseIdField, payload: Optional[ExportHistoryArchivePayload] = None) Tuple[Union[JobExportHistoryArchiveModel, JobIdResponse], bool] [source]¶
start job (if needed) to create history export for corresponding history.
- get_ready_history_export(trans: ProvidesHistoryContext, id: EncodedDatabaseIdField, jeha_id: Union[EncodedDatabaseIdField, 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, id: EncodedDatabaseIdField, jeha_id: EncodedDatabaseIdField)[source]¶
If ready and available, return raw contents of exported history.
- get_custom_builds_metadata(trans: ProvidesHistoryContext, id: EncodedDatabaseIdField) CustomBuildsMetadataResponse [source]¶
Returns metadata for custom builds.
galaxy.webapps.galaxy.services.history_contents module¶
- class galaxy.webapps.galaxy.services.history_contents.DirectionOptions(value)[source]¶
-
An enumeration.
- near = 'near'¶
- before = 'before'¶
- after = 'after'¶
- class galaxy.webapps.galaxy.services.history_contents.HistoryContentsIndexParams(*, v: typing_extensions.Literal[dev] = None, dataset_details: Optional[Union[Set[EncodedDatabaseIdField], typing_extensions.Literal[all]]] = None)[source]¶
Bases:
Model
Query parameters exclusively used by the new version of index operation.
- dataset_details: Optional[Union[Set[EncodedDatabaseIdField], typing_extensions.Literal[all]]]¶
- class galaxy.webapps.galaxy.services.history_contents.LegacyHistoryContentsIndexParams(*, ids: List[EncodedDatabaseIdField] = None, types: List[HistoryContentType], dataset_details: Optional[Union[Set[EncodedDatabaseIdField], typing_extensions.Literal[all]]] = None, deleted: bool = None, visible: bool = None)[source]¶
Bases:
Model
Query parameters exclusively used by the legacy version of index operation.
- ids: Optional[List[EncodedDatabaseIdField]]¶
- types: List[HistoryContentType]¶
- dataset_details: Optional[Union[Set[EncodedDatabaseIdField], typing_extensions.Literal[all]]]¶
- class galaxy.webapps.galaxy.services.history_contents.HistoryContentsIndexJobsSummaryParams(*, ids: List[EncodedDatabaseIdField] = [], types: List[JobSourceType] = [])[source]¶
Bases:
Model
Query parameters exclusively used by the index_jobs_summary operation.
- ids: List[EncodedDatabaseIdField]¶
- types: List[JobSourceType]¶
- class galaxy.webapps.galaxy.services.history_contents.CreateHistoryContentPayloadBase(*, type: HistoryContentType = HistoryContentType.dataset)[source]¶
Bases:
Model
- type: Optional[HistoryContentType]¶
- class galaxy.webapps.galaxy.services.history_contents.CreateHistoryContentPayloadFromCopy(*, type: HistoryContentType = HistoryContentType.dataset, source: HistoryContentSource = None, content: EncodedDatabaseIdField = None)[source]¶
Bases:
CreateHistoryContentPayloadBase
- source: Optional[HistoryContentSource]¶
- content: Optional[EncodedDatabaseIdField]¶
- class galaxy.webapps.galaxy.services.history_contents.CollectionElementIdentifier(*, name: str = None, src: ColletionSourceType, id: EncodedDatabaseIdField = None, tags: List[str] = [], element_identifiers: List[CollectionElementIdentifier] = None, collection_type: str = None)[source]¶
Bases:
Model
- src: ColletionSourceType¶
- element_identifiers: Optional[List[CollectionElementIdentifier]]¶
- class galaxy.webapps.galaxy.services.history_contents.CreateHistoryContentFromStore(*, store_content_uri: str = None, store_dict: Dict[str, Any] = None, model_store_format: ModelStoreFormat = None)[source]¶
Bases:
StoreContentSource
- model_store_format: Optional[ModelStoreFormat]¶
- class galaxy.webapps.galaxy.services.history_contents.CreateHistoryContentPayloadFromCollection(*, type: HistoryContentType = HistoryContentType.dataset, source: HistoryContentSource = None, content: EncodedDatabaseIdField = None, dbkey: str = None, copy_elements: bool = False)[source]¶
- class galaxy.webapps.galaxy.services.history_contents.CreateHistoryContentPayload(*, collection_type: str = None, element_identifiers: List[CollectionElementIdentifier] = None, name: str = None, hide_source_items: bool = False, copy_elements: bool = False, instance_type: DatasetCollectionInstanceType = DatasetCollectionInstanceType.history, history_id: EncodedDatabaseIdField = None, folder_id: EncodedDatabaseIdField = None, type: HistoryContentType = HistoryContentType.dataset, source: HistoryContentSource = None, content: EncodedDatabaseIdField = None, dbkey: str = None, **extra_data: Any)[source]¶
Bases:
CreateHistoryContentPayloadFromCollection
,CreateNewCollectionPayload
- source: Optional[HistoryContentSource]¶
- content: Optional[EncodedDatabaseIdField]¶
- type: Optional[HistoryContentType]¶
- class galaxy.webapps.galaxy.services.history_contents.HistoriesContentsService(security: IdEncodingHelper, history_manager: HistoryManager, history_contents_manager: HistoryContentsManager, hda_manager: HDAManager, hdca_manager: HDCAManager, dataset_collection_manager: DatasetCollectionManager, ldda_manager: LibraryDatasetsManager, folder_manager: FolderManager, hda_serializer: HDASerializer, hda_deserializer: HDADeserializer, hdca_serializer: HDCASerializer, history_contents_filters: HistoryContentsFilters, short_term_storage_allocator: ShortTermStorageAllocator, genomes_manager: GenomesManager)[source]¶
Bases:
ServiceBase
,ServesExportStores
,ConsumesModelStores
Common interface/service logic for interactions with histories contents 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, history_manager: HistoryManager, history_contents_manager: HistoryContentsManager, hda_manager: HDAManager, hdca_manager: HDCAManager, dataset_collection_manager: DatasetCollectionManager, ldda_manager: LibraryDatasetsManager, folder_manager: FolderManager, hda_serializer: HDASerializer, hda_deserializer: HDADeserializer, hdca_serializer: HDCASerializer, history_contents_filters: HistoryContentsFilters, short_term_storage_allocator: ShortTermStorageAllocator, genomes_manager: GenomesManager)[source]¶
- index(trans, history_id: EncodedDatabaseIdField, params: HistoryContentsIndexParams, legacy_params: LegacyHistoryContentsIndexParams, serialization_params: SerializationParams, filter_query_params: FilterQueryParams, accept: str) Union[HistoryContentsResult, HistoryContentsWithStatsResult] [source]¶
Return a list of contents (HDAs and HDCAs) for the history with the given
ID
.Note
Anonymous users are allowed to get their current history contents.
- show(trans, id: EncodedDatabaseIdField, serialization_params: SerializationParams, contents_type: HistoryContentType, fuzzy_count: Optional[int] = None) Union[HDADetailed, HDASummary, HDCADetailed, HDCASummary, CustomHistoryItem] [source]¶
Return detailed information about an HDA or HDCA within a history
Note
Anonymous users are allowed to get their current history contents
- Parameters
id – the encoded id of the HDA or HDCA to return
contents_type – ‘dataset’ or ‘dataset_collection’
serialization_params.view – 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 – 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.
- Returns
dictionary containing detailed HDA or HDCA information
- prepare_store_download(trans: ProvidesHistoryContext, id: EncodedDatabaseIdField, payload: StoreExportPayload, contents_type: HistoryContentType = HistoryContentType.dataset) AsyncFile [source]¶
- write_store(trans: ProvidesHistoryContext, id: EncodedDatabaseIdField, payload: WriteStoreToPayload, contents_type: HistoryContentType = HistoryContentType.dataset)[source]¶
- index_jobs_summary(trans, params: HistoryContentsIndexJobsSummaryParams) List[Union[JobStateSummary, ImplicitCollectionJobsStateSummary, WorkflowInvocationStateSummary]] [source]¶
Return job state summary info for jobs, implicit groups jobs for collections or workflow invocations
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.
- show_jobs_summary(trans, id: EncodedDatabaseIdField, contents_type: HistoryContentType) Union[JobStateSummary, ImplicitCollectionJobsStateSummary, WorkflowInvocationStateSummary] [source]¶
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 – the encoded id of the HDA or HDCA to return
contents_type – ‘dataset’ or ‘dataset_collection’
- Returns
dictionary containing jobs summary object
- get_dataset_collection_archive_for_download(trans, id: EncodedDatabaseIdField)[source]¶
Download the content of a HistoryDatasetCollection as a tgz archive while maintaining approximate collection structure.
- Parameters
id – encoded HistoryDatasetCollectionAssociation (HDCA) id
- prepare_collection_download(trans, id: EncodedDatabaseIdField) AsyncFile [source]¶
- create(trans, history_id: EncodedDatabaseIdField, payload: CreateHistoryContentPayload, serialization_params: SerializationParams) Union[HDADetailed, HDASummary, HDCADetailed, HDCASummary, CustomHistoryItem, List[Union[HDADetailed, HDASummary, HDCADetailed, HDCASummary, CustomHistoryItem]]] [source]¶
Create a new HDA or HDCA.
- ..note:
Currently, a user can only copy an HDA from a history that the user owns.
- create_from_store(trans, history_id: EncodedDatabaseIdField, payload: CreateHistoryContentFromStore, serialization_params: SerializationParams) List[Union[HDADetailed, HDASummary, HDCADetailed, HDCASummary, CustomHistoryItem]] [source]¶
- materialize(trans, request: MaterializeDatasetInstanceRequest) AsyncTaskResultSummary [source]¶
- update_permissions(trans, history_content_id: EncodedDatabaseIdField, payload: UpdateDatasetPermissionsPayload) DatasetAssociationRoles [source]¶
Set permissions of the given dataset to the given role ids.
- Parameters
payload (dict) –
dictionary structure containing:
action: (required) describes what action should be performed. Available actions: make_private, remove_restrictions, set_permissions
access_ids[]: list of Role.id defining roles that should have access permission on the dataset
manage_ids[]: list of Role.id defining roles that should have manage permission on the dataset
modify_ids[]: list of Role.id defining roles that should have modify permission on the library dataset item
- Raises
RequestParameterInvalidException, ObjectNotFound, InsufficientPermissionsException, InternalServerError RequestParameterMissingException
- update(trans, history_id: EncodedDatabaseIdField, id: EncodedDatabaseIdField, payload: Dict[str, Any], serialization_params: SerializationParams, contents_type: HistoryContentType)[source]¶
Updates the values for the history content item with the given
id
- Parameters
history_id – encoded id string of the items’s History
id – the encoded id of the history item to update
payload – a dictionary containing any or all the fields for HDA or HDCA with values different than the defaults
- Returns
an error object if an error occurred or a dictionary containing any values that were different from the original and, therefore, updated
- update_batch(trans, history_id: EncodedDatabaseIdField, payload: UpdateHistoryContentsBatchPayload, serialization_params: SerializationParams) List[Union[HDADetailed, HDASummary, HDCADetailed, HDCASummary, CustomHistoryItem]] [source]¶
PUT /api/histories/{history_id}/contents
- Parameters
- Return type
- Returns
an error object if an error occurred or a dictionary containing any values that were different from the original and, therefore, updated
- bulk_operation(trans: ProvidesHistoryContext, history_id: EncodedDatabaseIdField, filter_query_params: ValueFilterQueryParams, payload: HistoryContentBulkOperationPayload) HistoryContentBulkOperationResult [source]¶
- validate(trans, history_id: EncodedDatabaseIdField, history_content_id: EncodedDatabaseIdField)[source]¶
Validates the metadata associated with a dataset within a History.
- delete(trans, id, serialization_params: SerializationParams, contents_type: HistoryContentType, payload: DeleteHistoryContentPayload)[source]¶
Delete the history content with the given
id
and specified type (defaults to dataset)
- archive(trans, history_id: EncodedDatabaseIdField, filter_query_params: FilterQueryParams, filename: Optional[str] = '', dry_run: Optional[bool] = True) Union[HistoryContentsArchiveDryRunResult, ZipstreamWrapper] [source]¶
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 or json in dry run mode
- contents_near(trans, history_id: EncodedDatabaseIdField, serialization_params: SerializationParams, filter_params: List[List[Any]], direction: DirectionOptions, hid: int, limit: int, since: Optional[datetime] = None) Optional[ContentsNearResult] [source]¶
Return {limit} history items “near” the {hid}. The {direction} determines what items are selected:
before: select items with hid < {hid}
after: select items with hid > {hid}
near: select items “around” {hid}, so that n. items before <= limit // 2, n. items after <= limit // 2 + 1
Additional counts provided in the HTTP headers.
- class galaxy.webapps.galaxy.services.history_contents.ItemOperation(*args, **kwds)[source]¶
Bases:
Protocol
- __init__(*args, **kwargs)¶
- class galaxy.webapps.galaxy.services.history_contents.HistoryItemOperator(hda_manager: HDAManager, hdca_manager: HDCAManager, dataset_collection_manager: DatasetCollectionManager)[source]¶
Bases:
object
Defines operations on history items.
- __init__(hda_manager: HDAManager, hdca_manager: HDCAManager, dataset_collection_manager: DatasetCollectionManager)[source]¶
- apply(operation: HistoryContentItemOperation, item: Union[HistoryDatasetAssociation, HistoryDatasetCollectionAssociation], params: Optional[Union[ChangeDatatypeOperationParams, ChangeDbkeyOperationParams, TagOperationParams]], trans: ProvidesHistoryContext)[source]¶
galaxy.webapps.galaxy.services.invocations module¶
- class galaxy.webapps.galaxy.services.invocations.InvocationSerializationView(value)[source]¶
-
An enumeration.
- element = 'element'¶
- collection = 'collection'¶
- class galaxy.webapps.galaxy.services.invocations.InvocationSerializationParams(*, view: InvocationSerializationView = None, step_details: bool = False, legacy_job_state: bool = False)[source]¶
Bases:
BaseModel
Contains common parameters for customizing model serialization.
- class galaxy.webapps.galaxy.services.invocations.InvocationIndexPayload(*, workflow_id: DecodedDatabaseIdField = None, history_id: DecodedDatabaseIdField = None, job_id: DecodedDatabaseIdField = None, user_id: DecodedDatabaseIdField = None, sort_by: InvocationSortByEnum = None, sort_desc: bool = False, include_terminal: bool = True, limit: ConstrainedIntValue = 100, offset: int = 0, instance: bool = False)[source]¶
Bases:
InvocationIndexQueryPayload
- class galaxy.webapps.galaxy.services.invocations.PrepareStoreDownloadPayload(*, model_store_format: ModelStoreFormat = ModelStoreFormat.TAR_DOT_GZ, include_files: bool = True, include_deleted: bool = False, include_hidden: bool = False)[source]¶
Bases:
StoreExportPayload
- model_store_format: ModelStoreFormat¶
- class galaxy.webapps.galaxy.services.invocations.InvocationsService(security: IdEncodingHelper, histories_manager: HistoryManager, workflows_manager: WorkflowsManager, short_term_storage_allocator: ShortTermStorageAllocator)[source]¶
Bases:
ServiceBase
- __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[Dict[str, Any]], int] [source]¶
- prepare_store_download(trans, invocation_id: EncodedDatabaseIdField, payload: PrepareStoreDownloadPayload) AsyncFile [source]¶
- write_store(trans, invocation_id: EncodedDatabaseIdField, payload: WriteStoreToPayload) AsyncTaskResultSummary [source]¶
- serialize_workflow_invocation(invocation, params: InvocationSerializationParams, default_view: InvocationSerializationView = InvocationSerializationView.element)[source]¶
- serialize_workflow_invocations(invocations, params: InvocationSerializationParams, default_view: InvocationSerializationView = InvocationSerializationView.collection)[source]¶
galaxy.webapps.galaxy.services.jobs module¶
- class galaxy.webapps.galaxy.services.jobs.JobIndexViewEnum(value)[source]¶
-
An enumeration.
- collection = 'collection'¶
- admin_job_list = 'admin_job_list'¶
- class galaxy.webapps.galaxy.services.jobs.JobIndexPayload(*, states: List[str] = None, user_details: bool = False, user_id: DecodedDatabaseIdField = None, tool_ids: List[str] = None, tool_ids_like: List[str] = None, date_range_min: Optional[Union[OffsetNaiveDatetime, date]] = None, date_range_max: Optional[Union[OffsetNaiveDatetime, date]] = None, history_id: DecodedDatabaseIdField = None, workflow_id: DecodedDatabaseIdField = None, invocation_id: DecodedDatabaseIdField = None, order_by: JobIndexSortByEnum = JobIndexSortByEnum.update_time, search: str = None, limit: int = 500, offset: int = 0, view: JobIndexViewEnum = JobIndexViewEnum.collection)[source]¶
Bases:
JobIndexQueryPayload
- view: JobIndexViewEnum¶
- class galaxy.webapps.galaxy.services.jobs.JobsService(job_manager: JobManager, job_search: JobSearch, hda_manager: HDAManager)[source]¶
Bases:
object
- __init__(job_manager: JobManager, job_search: JobSearch, hda_manager: HDAManager)[source]¶
- job_manager: JobManager¶
- hda_manager: HDAManager¶
- show(trans: ProvidesUserContext, id: EncodedDatabaseIdField, full: bool = False) Dict[str, Any] [source]¶
- index(trans: ProvidesUserContext, payload: JobIndexPayload)[source]¶
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: Optional[bool] = 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 onlynon-deleted
- Returns
list of dictionaries containing library information
- Return type
- show(trans, id: EncodedDatabaseIdField) LibrarySummary [source]¶
Returns detailed information about a 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
- Raises
MalformedId, ObjectNotFound
- create(trans, payload: CreateLibraryPayload) LibrarySummary [source]¶
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
- Raises
RequestParameterMissingException
- create_from_store(trans, payload: CreateLibrariesFromStore) List[LibrarySummary] [source]¶
- update(trans, id: EncodedDatabaseIdField, payload: UpdateLibraryPayload) LibrarySummary [source]¶
Updates the library defined by an
encoded_id
with the data in the payload.- Parameters
id (an encoded id string) – the encoded id of the library
payload (dict) – 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
- Returns
detailed library information
- Return type
- Raises
RequestParameterMissingException
- delete(trans, id: EncodedDatabaseIdField, undelete: Optional[bool] = 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
id (an encoded id string) – the encoded id of the library to un/delete
undelete (bool) – (optional) flag specifying whether the item should be deleted or undeleted, defaults to false:
- Returns
detailed library information
- Return type
dictionary
- get_permissions(trans, id: EncodedDatabaseIdField, scope: Optional[LibraryPermissionScope] = LibraryPermissionScope.current, is_library_access: Optional[bool] = False, page: Optional[int] = 1, page_limit: Optional[int] = 10, query: Optional[str] = None) Union[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: EncodedDatabaseIdField, payload: Dict[str, Any]) Union[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) 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.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, folder_id, limit=None, offset=None, search_text=None, include_deleted=False)[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.
- ..example:
- limit and offset can be combined. Skip the first two and return five:
‘?offset=2&limit=5’
- Parameters
folder_id (encoded string) – encoded ID of the folder which contents should be library_dataset_dict
offset (optional int) – number of folder contents to skip
limit (optional int) – maximum number of folder contents to return
include_deleted (optional bool (default False)) – whether to include deleted items in the results
- Returns
dictionary containing all items and metadata
- Type
- Raises
MalformedId, InconsistentDatabase, ObjectNotFound, InternalServerError
- create(trans, encoded_folder_id, payload, **kwd)[source]¶
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 iffrom_hdca_id
is supplied.- Return type
- Raises
ObjectAttributeInvalidException, InsufficientPermissionsException, ItemAccessibilityException, InternalServerError
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, id: EncodedDatabaseIdField) 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
- create(trans, encoded_parent_folder_id: EncodedDatabaseIdField, payload: CreateLibraryFolderPayload) LibraryFolderDetails [source]¶
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, encoded_folder_id: EncodedDatabaseIdField, scope: Optional[LibraryPermissionScope] = LibraryPermissionScope.current, page: Optional[int] = 1, page_limit: Optional[int] = 10, query: Optional[str] = None) Union[LibraryFolderCurrentPermissions, LibraryAvailablePermissions] [source]¶
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, encoded_folder_id: EncodedDatabaseIdField, payload: dict) LibraryFolderCurrentPermissions [source]¶
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(trans, encoded_folder_id: EncodedDatabaseIdField, undelete: Optional[bool] = False) LibraryFolderDetails [source]¶
DELETE /api/folders/{encoded_folder_id}
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
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, encoded_folder_id: EncodedDatabaseIdField, payload: UpdateLibraryFolderPayload) LibraryFolderDetails [source]¶
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
galaxy.webapps.galaxy.services.pages module¶
- class galaxy.webapps.galaxy.services.pages.PagesService(security: IdEncodingHelper, manager: PageManager, serializer: PageSerializer, short_term_storage_allocator: ShortTermStorageAllocator)[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)[source]¶
- index(trans, payload: PageIndexQueryPayload) PageSummaryList [source]¶
Return a list of Pages viewable by the user
- Parameters
deleted – Display deleted pages
- Return type
- Returns
dictionaries containing summary or detailed Page information
- create(trans, payload: CreatePagePayload) PageSummary [source]¶
Create a page and return Page summary
- delete(trans, id: EncodedDatabaseIdField)[source]¶
Deletes a page (or marks it as deleted)
- show(trans, id: EncodedDatabaseIdField) PageDetails [source]¶
View a page summary and the content of the latest revision
- Parameters
id – ID of page to be displayed
- Return type
- Returns
Dictionary return of the Page.to_dict call with the ‘content’ field populated by the most recent revision
- show_pdf(trans, id: EncodedDatabaseIdField)[source]¶
View a page summary and the content of the latest revision as PDF.
- Parameters
id – ID of page to be displayed
- Return type
- Returns
Dictionary return of the Page.to_dict call with the ‘content’ field populated by the most recent revision
- prepare_pdf(trans, id: EncodedDatabaseIdField) 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 collection (list) of quotas.
- show(trans: ProvidesUserContext, id: EncodedDatabaseIdField, 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: EncodedDatabaseIdField, params: UpdateQuotaParams) str [source]¶
Modifies a quota.
- delete(trans: ProvidesUserContext, id: EncodedDatabaseIdField, payload: Optional[DeleteQuotaPayload] = None) str [source]¶
Marks a quota as deleted.
- undelete(trans: ProvidesUserContext, id: EncodedDatabaseIdField) str [source]¶
Restores a previously deleted quota.
galaxy.webapps.galaxy.services.sharable module¶
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.
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.
Makes this item publicly accessible. If this item contains other elements they will be publicly accessible too.
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: Union[FetchDataFormPayload, FetchDataPayload], files: Optional[List[UploadFile]] = None)[source]¶
galaxy.webapps.galaxy.services.users module¶
- class galaxy.webapps.galaxy.services.users.UsersService(security: IdEncodingHelper, user_manager: UserManager)[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)[source]¶
- recalculate_disk_usage(trans: ProvidesUserContext)[source]¶
galaxy.webapps.galaxy.services.visualizations module¶
- class galaxy.webapps.galaxy.services.visualizations.VisualizationsService(security: IdEncodingHelper, manager: VisualizationManager, serializer: VisualizationSerializer)[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)[source]¶
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, show_shared: bool = None, sort_by: WorkflowSortByEnum = None, sort_desc: bool = None, limit: ConstrainedIntValue = None, offset: int = 0, search: str = None, skip_step_counts: bool = False, missing_tools: bool = False)[source]¶
Bases:
WorkflowIndexQueryPayload
- class galaxy.webapps.galaxy.services.workflows.WorkflowsService(workflows_manager: WorkflowsManager, workflow_contents_manager: WorkflowContentsManager, serializer: WorkflowSerializer, tool_shed_registry: Registry)[source]¶
Bases:
ServiceBase
- __init__(workflows_manager: WorkflowsManager, workflow_contents_manager: WorkflowContentsManager, serializer: WorkflowSerializer, tool_shed_registry: Registry)[source]¶