swh.deposit.api.edit module#
- class swh.deposit.api.edit.EditAPI[source]#
-
Deposit request class defining api endpoints for sword deposit.
What’s known as ‘Edit-IRI’ in the sword specification.
HTTP verbs supported: PUT, DELETE
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'>)#
- restrict_access(request: Request, headers: ParsedRequestHeaders, deposit: Deposit) None [source]#
Relax restriction access to allow metadata update on deposit with status “done” when a swhid is provided.
- process_put(request, headers: ParsedRequestHeaders, collection_name: str, deposit: Deposit) None [source]#
This allows the following scenarios:
multipart: replace all the deposit (status partial) metadata and archive with the provided ones.
atom: replace all the deposit (status partial) metadata with the provided ones.
with swhid, atom: Add new metadata to deposit (status done) with provided ones and push such metadata to the metadata storage directly.
- Raises:
400 if any of the following occur –
- the swhid provided and the deposit swhid do not match –
- the provided metadata xml file is malformed –
- the provided xml atom entry is empty –
- the provided swhid does not exist in the archive –