ska_dlm.dlm_storage.dlm_storage_requests

DLM Storage API module.

Functions

check_item_on_storage([item_name, oid, uid, ...])

Check whether item is on storage.

check_storage_access([storage_name, ...])

Check whether storage is accessible.

check_storage_capacity()

Check remaining capacity of all storage items.

create_rclone_config(config)

Create a new rclone backend configuration entry on the rclone server.

create_storage_config(config[, storage_id, ...])

Create a new record in the storage_config table for a given storage_id.

database_error_handler(request, exc)

Catch DatabaseOperationError and send a JSONResponse.

delete_data_item_payload(uid)

Delete the payload of a data_item referred to by the provided UID.

delete_uids()

Check for expired data items and trigger deletion.

get_ssh_public_key()

Get the sftp ssh public key.

get_storage_config([storage_id, ...])

Get the storage configuration entry for a particular storage backend.

init_location(location_name, location_type)

Initialise a new location for a storage by specifying the location_name and location_type.

init_storage(storage_name, storage_type, ...)

Initialise a new storage.

invalidquery_exception_handler(request, exc)

Catch InvalidQueryParameters and send a JSONResponse.

lifespan(_)

Startup function.

perform_phase_transitions()

Check for OIDs with insufficient phase, and trigger a phase transition.

query_location([location_name, location_id])

Query a location.

query_location_facility()

Query the location_facility table for valid facilities.

query_storage([storage_name, storage_id])

Query storage locations.

rclone_access(volume[, remote_file_path, config])

Check whether a configured backend is accessible.

rclone_delete(volume, fpath)

Delete a file, referred to by fpath from a volume using rclone.

set_storage_availability(storage_name, available)

Set if storage is available.

unmetprecondition_exception_handler(request, exc)

Catch UnmetPreconditionForOperation and send a JSONResponse.

valuealreadyindb_exception_handler(request, exc)

Catch ValueAlreadyInDB and send a JSONResponse.