Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core-command: Revise PUT Endpoints for AdminState and OperatingState #1244

Closed
tsconn23 opened this issue Apr 11, 2019 · 0 comments
Closed

Core-command: Revise PUT Endpoints for AdminState and OperatingState #1244

tsconn23 opened this issue Apr 11, 2019 · 0 comments
Assignees
Labels
bug Something isn't working core-services edinburgh Items targeting Edinburgh release

Comments

@tsconn23
Copy link
Member

tsconn23 commented Apr 11, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core-services edinburgh Items targeting Edinburgh release
Projects
No open projects
Development

No branches or pull requests

2 participants