Generate key/value data for Option List from a task
Some Option Lists require REST calls to external systems that are not a single request, or have more complex requirements. It would be great if an Option List could be populated from the JSON output of a task to give more flexibility for obtaining and filtering data.
To query an external system that requires an authentication POST followed by a GET request, then filter the results based on the currently-logged in user’s tenant.
The post here may be some use to help you with more complex option list requirements: Example Morpheus Option Source Plugin
Oh excellent, I’ll take a look at that - thanks!
I think there’s also a use case for some sort of proxy app, that takes a configuration, executes the REST calls, modifies it accordingly, and then stages the JSON so it can be set up as an option list, using the basic translation script, or no script at all. That would be a killer plugin @ctaylor
I can imagine you writing that through gritted teeth Chris. LOL. I will check that out. If it does what I think that will be a really useful plugin for the community - it’s a big ask to write a plugin for every use case, configuration much more useful, and easier
I probably misunderstood your request on reflection. Perhaps you should start this plugin for us all to contribute to? Sounds like a good idea.
You know what my groovy skills are like Chris. Beyond me, I would probably have to write it as a standalone app. The goal would be a plugin or app that accepts YAML type config, which is translates into
a) REST calls to obtain the data, through authentication and multiple calls etc.
b) FILTERS (JQ style) to extract the data into name/value pair JSON array for HTML select control (meaning the basic translation script is enough)
Just my thoughts, though.
@ctaylor This is what I was thinking. Had to put up, or I’d have to shut up
There’s no server, any web server would do, but this application is doing the work outlined in my above post. Its not JQ level, I’m using a regex to find data on an object key, but the result is that this can present data to Morpheus which needs no translation script since Morpheus reads name/value keys automatically.
Only tested on unauthenticated GET requests
Morpheus admins have a fab UX just consuming REST, no need know the the JS object model. I reckon a plugin could do this just as well