swh.deposit.api.private.deposit_check module#

swh.deposit.api.private.deposit_check.known_archive_format(filename)[source]#
class swh.deposit.api.private.deposit_check.APIChecks[source]#

Bases: APIPrivateView, APIGet, DepositReadMixin

Dedicated class to trigger the deposit checks on deposit archives and metadata.

Only GET is supported.

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

process_get(req: Request, collection_name: str, deposit: Deposit) Tuple[int, Dict, str][source]#

Trigger the checks on the deposit archives and then on the deposit metadata. If any problems (or warnings) are raised, the deposit status and status detail are updated accordingly. If all checks are ok, the deposit status is updated to the ‘verified’ status (details updated with warning if any) and a loading task is scheduled for the deposit to be ingested. Otherwise, the deposit is marked as ‘rejected’ with the error details. A json response is returned to the caller with the deposit checks.

Parameters:
  • req – Client request

  • collection_name – Collection owning the deposit

  • deposit – Deposit concerned by the reading

Returns:

Tuple (status, json response, content-type)

swh.deposit.api.private.deposit_check.reset_content_settings_if_needed(archive) None[source]#

This resets the content_settings on the associated blob stored in an azure blobstorage. This prevents the correct reading of the file and failing the checks for no good reason.