Open mdutoo opened 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
Necessary when resources are discovered dynamically (because IDs are not known in advance and can't be guessed).
=> other workaround that allows for any resource uuid :
{"action" : "http://schemas.ogf.org/occi/infrastructure/compute/action#start"}
curl -v 'http://localhost:8080/compute/6df690d2-3158-40c4-88fb-d1c41584d6e5?action=start' -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"action" : "http://schemas.ogf.org/occi/infrastructure/compute/action#start"}'
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 :
- in OCCInterface, go to resource (ex. select its kind in dropdown, then find in results the resource itself and click on its the location attribute ex. http://localhost:8080/compute/6df690d2-3158-40c4-88fb-d1c41584d6e5")
- click on "Edit"
- replace the content by the right "action" attribute : {"action" : "http://schemas.ogf.org/occi/infrastructure/compute/action#start"}
- add to the URL : ?action=start (so it should fully be ex. /compute/6df690d2-3158-40c4-88fb-d1c41584d6e5?action=start)
- and click on POST ! This should generate the right
— 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_.
Still TODO:
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.
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.
Allow to call, on the selected OCCI resource, its defined actions.
What is the priority of this feature ?