Comments (2)
This will probably need special cases for each API call or group of API calls. Alternatively, it may be possible to attach a special-case filter to arguments (such as name
) instead. This would then automatically apply to all API calls that have this parameter.
Additional care must be taken to "inject" the other parameters given by the user into the query call.
Usage scenaria with special handling for project
and name
:
- User enters
start virtualmachine project=abc<TAB>
- cmk jumps into the special handler for the
project
parameter and issues alist projects
API call - cmk filters the results by the user-specified prefix "abc" and returns the list to the user
- User selects a project from the list, then enters
name=xy<TAB>
- cmk jumps into the special handler for
name
and issues alist virtualmachines
call, passing along the other parameters (project
in this case) - cmk filters the results by the "xy" prefix and presents the list of VMs to the user
- User selects the VM from the list and presses enter to send the start command
To make this work, it may be necessary to implement a sort of "translation" between the special parameters and the actual parameters sent later with the API call. For example, when autocompletion for one parameter terminates, the parameter could be automagically transformed into the actual parameter. For project
this would mean that after the user selects the project from the list, the parameter is replaced with projectid=<UUID>
.
from cloudstack-cloudmonkey.
@onitake you probably want to do filtering by manually calling APIs/response to find what you need or use the UI for adv. search capabilities which will probably require a lot of rewriting of cmk code; (to show a widget on CLI with probably a ncurses UI that takes in these filtering parameter while autocompletion).
from cloudstack-cloudmonkey.
Related Issues (20)
- filter is ignored on e.g. deploy virtual machine HOT 9
- associatednetworkid= does not autocomplete HOT 7
- verifycert option does not disable certificate signed by unknown authority error HOT 4
- Migrate to Github Actions HOT 2
- Create Role Permission Deny Rule Fails! HOT 1
- Provide "NOT" option when querying with cmk HOT 3
- Allow for CTRL-C to break the current operation HOT 6
- Allow cmk to pass * as parameter value HOT 2
- Readline issues when line goes beyond screen width HOT 1
- In CLI mode, cmk calls sync and doesn't cache it HOT 1
- Support POST method
- In CLI mode getting error: failed to authenticate, please check the credentials HOT 3
- How to run a cross-platform build? HOT 3
- hour value in the startdate,enddate parameter for command list usagerecords is ignored HOT 2
- Explore template/iso file upload from cmk
- Add support for 2FA in cmk HOT 3
- Validation for set cmd attributes (profile, url, etc)
- serviceofferingid autocomplete in deploy virtualmachine api cmd doesn't list the offering ids, instead picks some integer id
- Reverse parameter filtering
- 6.4.0 add host -> authentication error HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cloudstack-cloudmonkey.