HPE Morpheus Enterprise
1849787 Members
4315 Online
104044 Solutions
New Discussion

Option List script example for specific Azure plans

 
SOLVED
Go to solution
Not applicable

Option List script example for specific Azure plans

Is there a way to extract only specific Azure plans from the Options List with REST/API? If this is possible could you provide an example of a translation/request script?

1 REPLY 1
cbunge
HPE Pro
Solution

Re: Option List script example for specific Azure plans

Yep so if you make a REST Option Type, set it to:
https://FQDN/api/service-plans?max=1000&includeZones=true&provisionTypeId=4 (you will have to determine the provisionTypeId for Azure)

Then the translate is

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

That should work!