swh.deposit.api.deposit_update module

class swh.deposit.api.deposit_update.SWHUpdateArchiveDeposit(**config)[source]

Bases: swh.deposit.api.common.SWHPostDepositAPI, swh.deposit.api.common.SWHPutDepositAPI, swh.deposit.api.common.SWHDeleteDepositAPI

Deposit request class defining api endpoints for sword deposit.

What’s known as ‘EM IRI’ in the sword specification.

HTTP verbs supported: PUT, POST, DELETE

parser_classes = (<class 'swh.deposit.parsers.SWHFileUploadZipParser'>, <class 'swh.deposit.parsers.SWHFileUploadTarParser'>)
process_put(req, headers, collection_name, deposit_id)[source]

Replace existing content for the existing deposit.

Returns

204 No content

process_post(req, headers, collection_name, deposit_id)[source]

Add new content to the existing deposit.

Returns

201 Created Headers: Location: [Cont-File-IRI]

Body: [optional Deposit Receipt]

process_delete(req, collection_name, deposit_id)[source]

Delete content (archives) from existing deposit.

Returns

204 Created

class swh.deposit.api.deposit_update.SWHUpdateMetadataDeposit(**config)[source]

Bases: swh.deposit.api.common.SWHPostDepositAPI, swh.deposit.api.common.SWHPutDepositAPI, swh.deposit.api.common.SWHDeleteDepositAPI

Deposit request class defining api endpoints for sword deposit.

What’s known as ‘Edit IRI’ (and SE IRI) in the sword specification.

HTTP verbs supported: POST (SE IRI), PUT (Edit IRI), DELETE

parser_classes = (<class 'swh.deposit.parsers.SWHMultiPartParser'>, <class 'swh.deposit.parsers.SWHAtomEntryParser'>)
process_put(req, headers, collection_name, deposit_id)[source]

Replace existing deposit’s metadata/archive with new ones.

Returns

204 No content

process_post(req, headers, collection_name, deposit_id)[source]

Add new metadata/archive to existing deposit.

This also deals with an empty post corner case to finalize a deposit.

Returns

In optimal case for a multipart and atom-entry update, a 201 Created response. The body response will hold a deposit. And the response headers will contain an entry ‘Location’ with the EM-IRI.

For the empty post case, this returns a 200.

process_delete(req, collection_name, deposit_id)[source]

Delete the container (deposit).

source: http://swordapp.github.io/SWORDv2-Profile/SWORDProfile.html#protocoloperations_deleteconteiner # noqa