Code Monkey home page Code Monkey logo

Comments (2)

onitake avatar onitake commented on July 27, 2024

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:

  1. User enters start virtualmachine project=abc<TAB>
  2. cmk jumps into the special handler for the project parameter and issues a list projects API call
  3. cmk filters the results by the user-specified prefix "abc" and returns the list to the user
  4. User selects a project from the list, then enters name=xy<TAB>
  5. cmk jumps into the special handler for name and issues a list virtualmachines call, passing along the other parameters (project in this case)
  6. cmk filters the results by the "xy" prefix and presents the list of VMs to the user
  7. 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.

rohityadavcloud avatar rohityadavcloud commented on July 27, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.