Anyone have an example of using plans in a catalogue instance?

I am desperately looking for an example of placing plans as an input in the catalogue. I can get the list to show in the catalog selection, but I need to know how to place that variable in the config file after the configuration wizard is ran. The simple ones for name and such I get, but the multipart items I need some assistance on. Any help is greatly appreciated! Thanks in advance!

I think I figured it out, but would still like to see examples if anyone is willing. Thanks!

@smittyt2 I simply use the id of the plan and replace.

image

targetPlan Translation:

for (var x = 0; x < data.length; x++) {
    results.push({name:data[x].name, value:data[x].id});
}

targetPlan Request:

if (input.targetCloud && input.targetGroup) {
  results.siteId = input.targetGroup
  results.zoneId = input.targetCloud
}

I know you mentioned you have the list working. Just putting this here for others:
Plans need to have siteId + zoneId (layoutId OR provisionTypeCode can be used for futher filtering and they will be pulled from catalog item config if hardcoded)

So if I already have the group information in the config file, and only want to show the clouds for that group, is that possible? At the moment, it will show all clouds in the selection. Basically my catalogue item is for one image in one cloud provider. That cloud provider is in one group (ex. GCP). If I select that group in the configuration wizard, how do I tell the option list to only pull clouds from the group specified in the config file? Hope that makes sense. :slight_smile:

If you use the Morpheus API type “Instance Type Clouds” the clouds will filter based on the cloud technology of your layout. That may assist some. Looking from my side to filter the list based off of a hardcoded groupId.

It is showing all clouds currently. Azure and GCP both even with GCP group hard coded in the group location within the config file.

So the best approach to doing your ask is as follows:

  1. utilize “Instance Type Clouds” for your Cloud Option List so it filters the available clouds to the supported instance type.

Translation:

for (var x = 0; x < data.length; x++) {
results.push({name:data[x].name, value:data[x].id});
    }

Request:

if (input.targetGroup) {
  results.siteId = input.targetGroup
}
  1. Create a “targetGroup” hidden Input. Hardcode this to the groupId you want to filter the clouds by.

  2. Attach both to the Catalog Item and inject correctly into the spec:

  3. Prosper!

Sweet!! That did get it rolling. One note is that the order of the inputs on the catalog instance is important with dependencies: If your dependency input is listed after the one needing it, it has issues. This order is what worked for me: (This one was specific for an azure group / catalog item)