-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A set of device list cleanups (#397)
* Cleanup: pass device filter options as a map This allows to fully move an argument parsing logic from the client into the command. Before the change, an argument parsing logic was split between the two. * Cleanup: use name instead of name_ilike to filter device list A new API has a newer name argument for few months already. Use it instead of the obsolete name_ilike. * Cleanup: use net/url to escape special characters in device list Currently, we onlhy special-cased the URL escaping of a ? for device name pattern. But, other characters are not escaped, and uuid pattern is not escaped at all. Most of the time this just works, but may produce unexpected results. For example `fioctl devices list 'a*&'` will ignore the trailing ampersand, and behave just like `fioctl device list 'a*'`, matching unexpected devices. Using the `net/url` to URL escape the query makes filtering more predictable for such edge cases. * Cleanup: only pass non-empty filters to device list API This shortens the URL, making it easier to debug. Signed-off-by: Volodymyr Khoroz <[email protected]>
- Loading branch information
Showing
2 changed files
with
34 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters