-
Notifications
You must be signed in to change notification settings - Fork 58
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
[feature] Added missing endpoints for DeviceFirmware and UpgradeOperation #206 #231
Conversation
The code adds four endpoints: 1. upgrade-operation/ - List all the upgrade operation in the system 2. upgrade-operation/<id>/ - Display detail of a particular upgrade id 3. device/<id>/upgrade-operation/ - return a list of upgrade-operation ids for a given device id 4. device/<id>/firmware/ - PUT: if DeviceFirmware doesn't exist, create a new object else update the image of the DeviceFirmware. Returns the DeviceFirmware object and if an upgrade operation was created, also return the id of the UpgradeOperation - GET: return the DeviceFirmware object Closes #206
ff245c8
to
9a26cb0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I will spend more time testing this tomorrow!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's some feedback from the first round of testing.
I did a quick test of the different endpoints which seem to work quite well.
Below I have some minor change requests.
Upgrade Operation List:
- can you allow to filter by org and org_slug?
- can you allow to filter by device ID (can we avoid generating the select with the entire device list in the UI to avoid this to fail on large instances?)
- allow filter by image ID (can we avoid generating the select with the entire image list in the UI to avoid this to fail on large instances?)
- allow filter by status
Device Upgrade Operation List:
- allow filter by status
I will do another round of acid testing and code review tomorrow.
- Added api filters tests.
- Additionally, included the missing mentions of API list filters for the following endpoints: build/, build/<build_id>/image, and batch-upgrade-operation/
5e8256a
to
86a3e8e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's looking good, I have some remaining doubts below.
- `ValidatedModelSerializer` is not required for read-only API views.
f922903
to
54f8d6a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! 👍
Blockers
[chores] Use SeleniumTestMixin from openwisp-utils #234
[fix] Fixed related org field filtering in multitentant dj-filters openwisp-users#352
This PR adds four endpoints:
upgrade-operation/
upgrade-operation/<id>/
device/<device_pk>/upgrade-operation/
device/<device_pk>/firmware/
PUT: if DeviceFirmware doesn't exist, create a new object else
update the image of the DeviceFirmware.
Returns the DeviceFirmware object and if an upgrade operation
was created, also return the id of the UpgradeOperation.
GET: return the DeviceFirmware object,
Closes #206