openBackhaul / MediatorInstanceManager

REST interface for addressing the Mediator Instance Manager inside the mediator VM
Apache License 2.0
0 stars 0 forks source link

Clarification regarding the service /v1/dismantle-mediator-instance for a non-existing device-name #10

Closed PrathibaJee closed 2 years ago

PrathibaJee commented 2 years ago

The service /v1/dismantle-mediator-instance is to delete a mediator instance based on the provided "device-name" in the request-body.

Scenario : Provided a non-existing "device-name" in the request body , /v1/dismantle-mediator-instance responds back with -> response-code: 204 , description : "Mediator deleted". As per the specification , this looks like an expected behavior.

Proposal : The response "Mediator deleted" for a non-existing "device-name" gives a false impression of the operation. For the scenario , can we prescribe in the specification to respond with -> response-code: 400 , description : "Object does not exists". Kindly let us know your views.

PrathibaJee commented 2 years ago

Discussion made on interface call on 26th of June : The current behavior mentioned in the scenario works as designed. The service /v1/dismantle-mediator-instance is idempotent , means executing the same request with the same set of attributes again, shall just lead to the same state. The advantage of the current behavior overweights the disadvantage , so decided to keep the design as it is.