Skip to content

Allow Replace HTTP 201 response #573

@fmigneault

Description

@fmigneault

Requirement /req/deploy-replace-undeploy/replace-response allows either 200, 202 or 204, depending on what should be represented by the response.

I would like to extend this to allow HTTP 201 Created as well.

The reasoning is that, when a process is replaced (PUT), our implementation actually creates a new process with the modified parameters and version, such that the previous iteration can still be employed. Therefore, the /processes/{processId} location is what gets replaced to refer to this newly created process, but /processes/{processId}:x.y.z can still be used to refer to any older version before it.

We can communicate this nuance with 201. However, it is seamless either to the final user/client since the resulting /processes/{processId} is the latest replacement as if it was actually substituted.

Another reason is that certain DBs allow upsert (update or insert), so it makes sense to indicate this distinction with 200/201 respectively.

Details of our process update/replace strategy: https://pavics-weaver.readthedocs.io/en/latest/processes.html#modify-an-existing-process-update-replace-undeploy

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions