This repository has been archived by the owner on Mar 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 108
Improve 'vcd search' #575
Open
odraghi
wants to merge
15
commits into
vmware-archive:master
Choose a base branch
from
odraghi:search-improvements
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Improve 'vcd search' #575
Conversation
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
Signed-off-by: Olivier DRAGHI <odraghi@gmail.com>
Allow to hide id with '--do-not-show-id'. Allow to call _search() function from other click commands. ( useful to implement 'vm list' ) Signed-off-by: Olivier DRAGHI <odraghi@gmail.com>
Signed-off-by: Olivier DRAGHI <odraghi@gmail.com>
Add sort-asc and sort-desc to 'vcd search'. Signed-off-by: Olivier DRAGHI <odraghi@gmail.com>
Rename function _search by query to be proprely called by other script Signed-off-by: Olivier DRAGHI <odraghi@gmail.com>
In --fields option, you can now specify custom name with 'as'. exemple: vcd search vm --fields 'name,ownerName as owner,isAutoNature as standalone' name owner standalone ------------ ------- ------------ web1 johndoe flase web2 johndoe flase bdd johndoe true Signed-off-by: Olivier DRAGHI <odraghi@gmail.com>
AttributeError: 'dict_keys' object has no attribute 'remove' When sort_headers=False headers need to be a list to call remove() Signed-off-by: Olivier DRAGHI <odraghi@gmail.com>
Signed-off-by: Olivier DRAGHI <odraghi@gmail.com>
Init field with a default of None. For exemple query api 'vm' doesn't return ipAddress if the vm do not have newtork interface. Signed-off-by: Olivier DRAGHI <odraghi@gmail.com>
Add option --sort-next to add sort on a second field. This option must be used with --sort-asc or --sort-desc Signed-off-by: Olivier DRAGHI <odraghi@gmail.com>
Change in query(): - Remove param show_id - Don't show the result but return it to the caller This add flexibility to the caller. Signed-off-by: Olivier DRAGHI <odraghi@gmail.com>
Signed-off-by: Olivier DRAGHI <odraghi@gmail.com>
Signed-off-by: Olivier DRAGHI <odraghi@gmail.com>
Signed-off-by: Olivier DRAGHI <odraghi@gmail.com>
Signed-off-by: Olivier DRAGHI <odraghi@gmail.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New options for 'vcd search':
-t, --fields [fields] fields to show
--show-id / --hide-id show id [default: show-id]
--sort-asc [field] sort in ascending order on a field
--sort-desc [field] sort in descending order on a field
I also create a function 'query' to import it in other script.
It's a good way to speedup other command with this function.
Futur use cases: