Option List data from task/script

Headline:
Generate key/value data for Option List from a task


Description:
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.


Example/Use case(s):
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.


1 Like

Hello,

The post here may be some use to help you with more complex option list requirements: Example Morpheus Option Source Plugin

1 Like

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

@ollie your wish is my command: How to execute multiple API requests per Option List: Option Source Plugin Example

1 Like

:grinning: 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 :+1:

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)
c) SERVER which provides an endpoint on which to stage the filtered JSON data, the URL of which is used by the person creating the option list, rather than going direct to the data and in some cases needing to write quite complex javascript filters. Having written that sort JS myself think an app or plugin that could do this would make life simpler for Morpheus Admins.

Just my thoughts, though.

@ctaylor This is what I was thinking. Had to put up, or I’d have to shut up :wink:

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 :+1:

1 Like