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.web.short_term_storage package

galaxy.web.short_term_storage.now()

Return a new datetime representing UTC day and time.

class galaxy.web.short_term_storage.ShortTermStorageConfiguration(short_term_storage_directory: str, default_storage_duration: int | float | NoneType = None, maximum_storage_duration: int | float | NoneType = None)[source]

Bases: object

short_term_storage_directory: str
default_storage_duration: int | float | None = None
maximum_storage_duration: int | float | None = None
__init__(short_term_storage_directory: str, default_storage_duration: int | float | None = None, maximum_storage_duration: int | float | None = None) None
class galaxy.web.short_term_storage.ShortTermStorageTargetSecurity(user_id: int | NoneType = None, session_id: int | NoneType = None)[source]

Bases: object

user_id: int | None = None
session_id: int | None = None
to_dict() Dict[str, int | None][source]
classmethod from_dict(as_dict: Dict[str, int | None]) ShortTermStorageTargetSecurity[source]
__init__(user_id: int | None = None, session_id: int | None = None) None
class galaxy.web.short_term_storage.ShortTermStorageTarget(request_id: uuid.UUID, raw_path: str, duration: int | float | NoneType = None)[source]

Bases: object

request_id: UUID
raw_path: str
duration: int | float | None = None
property path
__init__(request_id: UUID, raw_path: str, duration: int | float | None = None) None
class galaxy.web.short_term_storage.ShortTermStorageServeCompletedInformation(target: galaxy.web.short_term_storage.ShortTermStorageTarget, mime_type: str, filename: str, security: galaxy.web.short_term_storage.ShortTermStorageTargetSecurity)[source]

Bases: object

target: ShortTermStorageTarget
mime_type: str
filename: str
security: ShortTermStorageTargetSecurity
__init__(target: ShortTermStorageTarget, mime_type: str, filename: str, security: ShortTermStorageTargetSecurity) None
class galaxy.web.short_term_storage.ShortTermStorageServeCancelledInformation(target: galaxy.web.short_term_storage.ShortTermStorageTarget, status_code: int, exception: Dict[str, Any] | NoneType)[source]

Bases: object

target: ShortTermStorageTarget
status_code: int
exception: Dict[str, Any] | None
property message_exception: MessageException
__init__(target: ShortTermStorageTarget, status_code: int, exception: Dict[str, Any] | None) None
class galaxy.web.short_term_storage.ShortTermStorageAllocator[source]

Bases: object

abstract new_target(filename: str, mime_type: str, duration: int | None = None, security: ShortTermStorageTargetSecurity | None = None) ShortTermStorageTarget[source]

Return a new ShortTermStorageTarget for this short term file request.

class galaxy.web.short_term_storage.ShortTermStorageMonitor[source]

Bases: object

abstract is_ready(target: ShortTermStorageTarget) bool[source]

Check if storage is ready.

abstract get_serve_info(target: ShortTermStorageTarget) ShortTermStorageServeCompletedInformation | ShortTermStorageServeCancelledInformation[source]

Get information required to serve this short term storage target.

abstract finalize(target: ShortTermStorageTarget) None[source]

Indicate the file is ready to be served.

abstract cancel(target: ShortTermStorageTarget, exception: MessageException | None = None) None[source]

Store metadata for failed task.

Implementation is responsible for indicating target is finalized as well.

abstract target_path(target: ShortTermStorageTarget) Path[source]

Return fully qualified path on this server for specified target.

abstract cleanup() None[source]

Cleanup old requests.

abstract recover_target(request_id: UUID) ShortTermStorageTarget[source]

Return an existing ShortTermStorageTarget from a specified request_id.

class galaxy.web.short_term_storage.ShortTermStorageManager(config: ShortTermStorageConfiguration)[source]

Bases: ShortTermStorageAllocator, ShortTermStorageMonitor

__init__(config: ShortTermStorageConfiguration)[source]
new_target(filename: str, mime_type: str, duration: int | float | None = None, security: ShortTermStorageTargetSecurity | None = None) ShortTermStorageTarget[source]

Return a new ShortTermStorageTarget for this short term file request.

recover_target(request_id: UUID) ShortTermStorageTarget[source]

Return an existing ShortTermStorageTarget from a specified request_id.

is_ready(target: ShortTermStorageTarget) bool[source]

Check if storage is ready.

get_serve_info(target: ShortTermStorageTarget) ShortTermStorageServeCompletedInformation | ShortTermStorageServeCancelledInformation[source]

Get information required to serve this short term storage target.

cancel(target: ShortTermStorageTarget, exception: MessageException | None = None)[source]

Write metadata for failed task.

finalize(target: ShortTermStorageTarget) None[source]

Indicate the file is ready to be served.

target_path(target: ShortTermStorageTarget) Path[source]

Return fully qualified path on this server for specified target.

cleanup()[source]

Cleanup old requests.

galaxy.web.short_term_storage.storage_context(short_term_storage_request_id: UUID, short_term_storage_monitor: ShortTermStorageMonitor)[source]