swh.deposit.api.sword_edit module#
- class swh.deposit.api.sword_edit.SwordEditAPI[source]#
Bases:
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: ParsedRequestHeaders, collection_name: str, deposit: Deposit | None = None) Tuple[int, str, Receipt] [source]#
Add new metadata/archive to existing deposit.
This allows the following scenarios to occur:
multipart: Add new metadata and archive to a deposit in status partial with the provided ones.
empty atom: Allows to finalize a deposit in status partial (transition to deposited).
source: - http://swordapp.github.io/SWORDv2-Profile/SWORDProfile.html#protocoloperations_addingcontent_metadata - http://swordapp.github.io/SWORDv2-Profile/SWORDProfile.html#protocoloperations_addingcontent_multipart - http://swordapp.github.io/SWORDv2-Profile/SWORDProfile.html#continueddeposit_complete
- 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.