swh.deposit.api.edit_media module#

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

Bases: APIPost, APIPut, 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

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

parser_classes = (<class 'swh.deposit.parsers.SWHFileUploadZipParser'>, <class 'swh.deposit.parsers.SWHFileUploadTarParser'>)#
process_put(req, headers: ParsedRequestHeaders, collection_name: str, deposit: Deposit) None[source]#

Replace existing content for the existing deposit.

Returns:

204 No content

process_post(req, headers: ParsedRequestHeaders, collection_name: str, deposit: Deposit | None = None) Tuple[int, str, 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: Deposit) None[source]#

Delete content (archives) from existing deposit.

Returns:

204 Created