HomeSoftware Heritage

Adapt existing POST to a collection to allow metadata-only deposit

Description

Adapt existing POST to a collection to allow metadata-only deposit

The following endpoint is adapted to allow it:

POST /1/<collection>
HEADER: Content-type: application/atom+xml;type=entry
And the xml provided by the client contains either:

<swh:deposit>

<swh:reference>
  <swh:object swhid="{swhid}" />
</swh:reference>

</swh:deposit>
or:

<swh:deposit>

<swh:reference>
  <swh:origin url="{url}" />
</swh:reference>

</swh:deposit>

Any invalid swhid raises a 400 bad request. If everything passes, a 201
response with usual deposit receipt is received by the deposit user. The
deposit row is updated with status "done", complete_date and reception_date to
the same and current date, the swhid columns are updated as well if any.

Note: Technically, this is reusing the existing code from the metadata update
scenario. The current metadata update still happens the same way as before.

Related to T2537