You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Core-command currently supports PUT API endpoints for setting AdminState and OperatingState on a specified device. The device can be specified either by name or ID.
The definition of the API endpoint is incorrect in that for the PUT operation, the URL should identify the device and the request body should contain the new value to set. Currently the URL contains both. In addition to being incorrectly defined, this prevents us from using request model validation for these endpoints.
As an example of the necessary refactoring, given the following current state route for AdminState: PUT http://localhost:48082/api/v1/device/name/livingroomthermostat/adminstate/unlocked
The URL should be changed to PUT http://localhost:48082/api/v1/device/name/livingroomthermostat
And the request body should be {"adminState":"unlocked"}
The same changes are required for the OperatingState route: http://localhost:48082/api/v1/device/name/livingroomthermostat/opstate/disabled
However the request body should be {"operatingState":"disabled"} not opstate as used above
Please modify RAML accordingly. This will also require changes to blackbox tests.
The text was updated successfully, but these errors were encountered:
Core-command currently supports PUT API endpoints for setting AdminState and OperatingState on a specified device. The device can be specified either by name or ID.
The definition of the API endpoint is incorrect in that for the PUT operation, the URL should identify the device and the request body should contain the new value to set. Currently the URL contains both. In addition to being incorrectly defined, this prevents us from using request model validation for these endpoints.
As an example of the necessary refactoring, given the following current state route for AdminState:
PUT http://localhost:48082/api/v1/device/name/livingroomthermostat/adminstate/unlocked
The URL should be changed to
PUT http://localhost:48082/api/v1/device/name/livingroomthermostat
And the request body should be
{"adminState":"unlocked"}
The same changes are required for the OperatingState route:
http://localhost:48082/api/v1/device/name/livingroomthermostat/opstate/disabled
However the request body should be
{"operatingState":"disabled"}
notopstate
as used abovePlease modify RAML accordingly. This will also require changes to blackbox tests.
The text was updated successfully, but these errors were encountered: