occiware / OCCInterface

OCCI API developer online playground
MIT License
3 stars 1 forks source link

Support OCCI actions #14

Open mdutoo opened 7 years ago

mdutoo commented 7 years ago

Allow to call, on the selected OCCI resource, its defined actions.

What is the priority of this feature ?

mdutoo commented 7 years ago

(priority is ASAP)

Workaround: write actions as POST samples within markdown, see ex. how to start and stop a compute in https://github.com/occiware/OCCInterface/blob/master/src/readings/GettingStarted.md

gibello commented 7 years ago

Necessary when resources are discovered dynamically (because IDs are not known in advance and can't be guessed).

mdutoo commented 7 years ago

=> other workaround that allows for any resource uuid :

gibello commented 7 years ago

Works, but takes as much time as editing the ID in the javascript template then reloading / launching it... And not prettier in the context of a demo !

Le 11/01/2017 à 10:16, Marc Dutoo a écrit :

=> other workaround that allows for any resource uuid :

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/occiware/OCCInterface/issues/14#issuecomment-271817249, or mute the thread https://github.com/notifications/unsubscribe-auth/ABLIf1p8KRy4b_TlgAdCbE4uoEQ88kLrks5rRJ3bgaJpZM4LCWO_.

mdutoo commented 7 years ago

Still TODO:

  1. Allow to input action parameters when an action has some:

When an action has parameters (according to the "schemes" metamodel parsed from the Query Interface in [Navbar.js](https://github.com/occiware/OCCInterface/blob/master/src/components/Navbar.js and that can be used in ActionButton.js where it has been set through redux at line 89) and is clicked, change the ActionButton text from "ACT..." to "Do it!" and reset the JSON content to {} like at line 61 in Content.js, and only POST the action when again clicking on the button. And then revert its text, and re-GET the Resource's JSON content.

  1. Generate a sample JSON for these action parameters:

Rather than setting the JSON content to {} as above, set it to a JSON that is generated from said "schemes" metamodel (which has been built in Navbar.getSchemes() ), by introspecting it (like in ActionButton.render() line 59), so that it at least contains names of each action parameter, and an as much as possible good default value.