swh.deposit.api.edit_media module

class swh.deposit.api.edit_media.EditMediaAPI[source]

Bases: swh.deposit.api.common.APIPost, swh.deposit.api.common.APIPut, swh.deposit.api.common.APIDelete

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: swh.deposit.api.common.ParsedRequestHeaders, collection_name: str, deposit: swh.deposit.models.Deposit) → None[source]

Replace existing content for the existing deposit.

Returns

204 No content

process_post(req, headers: swh.deposit.api.common.ParsedRequestHeaders, collection_name: str, deposit: Optional[swh.deposit.models.Deposit] = None) → Tuple[int, str, swh.deposit.api.common.Receipt][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: str, deposit: swh.deposit.models.Deposit) → None[source]

Delete content (archives) from existing deposit.

Returns

204 Created