Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cascading Options - Multiple values in JSON file #8995

Open
rcmccarrick opened this issue Mar 11, 2024 · 0 comments
Open

Cascading Options - Multiple values in JSON file #8995

rcmccarrick opened this issue Mar 11, 2024 · 0 comments

Comments

@rcmccarrick
Copy link

I use cascading options a lot.

My JSON file for the option "Client", looks like :

[
{
"name":"Client-ABC",
"value":"ABC.json"
},
{
"name":"Client-XYZ",
"value":"XYZ.json"
}
]

So in the Rundeck drop-down for Client, I can choose Client-ABC or Client-XYZ
If I choose Client-ABC, the next option loads the file (Remote URL):
$pathToFile/${option.Client.value}
which would actually be $pathToFile/ABC.json

Is it possible to have, multiple values in the JSON file, value1, value2 etc?

[
{
"name":"Client1-ABC",
"value":"ABC.json",
"value2":"US"
},
{
"name":"Client2-XYZ",
"value":"XYZ.json",
"value2":"UK"
}
]

In this case if I chose Client-ABC, I want one option to load the file:
$pathToFile/${option.Client.value}
which would actually be $pathToFile/ABC.json

and if I choose to, I can have another option's value equal:
$pathToFile/${option.Client.value2}
which would actually be "US"

Or even sub-values. (Sub-values might be better).

[
{
"name":"Client-ABC",
"value":
{
"subvalue1":"ABC.json",
"subvalue2":"US"
}
},
{
"name":"Client-XYZ",
"value":
{
"subvalue1":"XYZ.json",
"subvalue2":"UK"
}
}
]

In this case if I chose Client-ABC, I want one option to load the file :
$pathToFile/${option.Client.value.subvalue1}
which would actually be $pathToFile/ABC.json

and I could have another option's value equal:
$pathToFile/${option.Client.value.subvalue2}
which would actually be "US"

So I want the Client option to determine 2 or more other options.

I have tried the above, but I get error:
Exception: java.net.URISyntaxException: Illegal character in path at index 71: file:PathToFile/${option.Client.value2}

I create my dropdown JSON files dynamically daily by pulling data from a DB.
Right now it seems that Rundeck can only read 'Name' and 'Value'.
If we could allow it to read multiple values, we could load multiple cascading options from one JSON file.

Just to go deeper into the above example, I have a list of clients that are either in the US or UK Azure regions. Engineers should not have to know which region, they should just pick the client name.

If they pick Client-ABC, they will get a dropdown from ABC.json with other options specific to that client.

But I also want anther option that populates from value2 . (or value.subvalue2) that will be 'US' or 'UK'.
Then from that option,, I would just load another dropdown from US.json or UK.json and these JSON files will have Azure regions specific to those countries, like eastus, westus etc.

So ultimately my request is to allow rundeck to read multiple values or sub-values from JSON files to create cascading options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant