openwisp / openwisp-firmware-upgrader

Firmware upgrade solution for OpenWRT with possibility to add support for other embedded OSes. Provides features like automatic retry for network failures, mass upgrades, REST API and more.
https://openwisp.io/docs/dev/firmware-upgrader/
Other
53 stars 60 forks source link

[feature] REST API is missing endpoints for DeviceFirmware #206 #229

Closed tspare closed 1 year ago

tspare commented 1 year ago

[feature] REST API is missing endpoints for DeviceFirmware #206

The code adds three endpoints:

  1. upgrade-operation/ - List all the upgrade operation in the system
  2. upgrade-operation// - Display detail of a particular upgrade id
  3. device//upgrade-operation/ - return a list of upgrade-operation ids for a gven device id
tspare commented 1 year ago

Thanks for reviewing and I'll take a further look. I thought it was too easy to be a feature :-).

P.S. Sorry for the errors, I should have ran the qa_check before the pull request.

tspare commented 1 year ago

Thanks for contributing!

The main requirement of the feature is not satisfied:

* CRUD operations of DeviceFirmware objects, eg: /api/v1/firmware upgrader/device/[id]/firmware/
  When a device firmwre is created or changed (which creates an upgrade operation) we should return the upgrade operation ID to allow clients to check the state of the upgrade

We will need to add tests and docs (add these endpoints to the README).

I updated the code to add the changes. However, I am not sure if you want the upgrade operation to be saved in to the DeviceFirmware model or just return it as a separate field as part of the PUT request. I left it as a separate field that is returned as part of the PUT request. Please let me know if this is what you had in mind or if I am out on the left field. I will wait for your comment before updating the tests. Not sure about the documentation and how they get updated so I will need your guidance on this.

nemesifier commented 1 year ago

Thanks for your effort @tspare, we improved upon your work and merged this in https://github.com/openwisp/openwisp-firmware-upgrader/pull/231.

tspare commented 1 year ago

You are welcome. Glad I could help.

On Mon, May 29, 2023 at 6:56 PM Federico Capoano @.***> wrote:

Thanks for your effort @tspare https://github.com/tspare, we improved upon your work and merged this in #231 https://github.com/openwisp/openwisp-firmware-upgrader/pull/231.

— Reply to this email directly, view it on GitHub https://github.com/openwisp/openwisp-firmware-upgrader/pull/229#issuecomment-1567577259, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIG4NL5BEMRFRU7ANADC7SDXIUSQHANCNFSM6AAAAAAWTICPT4 . You are receiving this because you were mentioned.Message ID: @.***>