Can we create an option list for Azure Subnets, I created an option list for Networks using Morpheus API but it fetches only the VNET not all the subnets residing into it.
The following translation script and request script can be used to fetch the subnets. To fetch only azure subnets you will need to specify the âProvionTypeIdâ which in my case was 2 for Azure.
//Transalation Script
for(var x=0;x < data.length; x++) {
var isSubnet = data[x].value.includes("subnet");
if (isSubnet){//Only show subnets
results.push({name: data[x].name,value:data[x].id});
}
}
//Request Script
results.siteId = 1; //Group ID
results.zoneId = 3; // Cloud ID
provisionTypeId=2; //ProvionTypeId 2 = Azure
I see bungeâs post, and did not identify this suggested fix is in combination with the âInstance Networksâ API.
The documentation infers that âInstance Networksâ is just a pre-filtered âNetworksâ API Type.
However, I am getting the correct value now utilizing âInstance Networksâ, where as I have been struggling with âNetworksâ to get the mysterious âsubnet-###â value. So âInstance Networksâ actually is doing something else behind the scenes, or our version of Morpheus is incompatible with doing this on the âNetworksâ type.
Much appreciate this insight, and really hoping this will be captured in the Morpheus Documentation pages officially!