swh.deposit.api.sword_edit module

class swh.deposit.api.sword_edit.SwordEditAPI[source]

Bases: swh.deposit.api.common.APIPost

Deposit request class defining api endpoints for sword deposit.

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

HTTP verbs supported: POST

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

parser_classes = (<class 'swh.deposit.parsers.SWHMultiPartParser'>, <class 'swh.deposit.parsers.SWHAtomEntryParser'>)
process_post(request, 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 metadata/archive to existing deposit.

This allows the following scenarios to occur:

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.