I need to know Azure VM price and size in my Java application.
using java sdk I could get a VM size
List<VirtualMachine> vms =
azure.virtualMachines().listByResourceGroup(resourceGroup);
for (VirtualMachine vm : vms)
{
vm.size(); // returns "Standard_D4_v3"
vm.osType(); // returns "Linux"
}
Now I want to search for VM price.
Using Azure public API
"https://azure.microsoft.com/api/v2/pricing/virtual-machines-base/calculator"
I could search for VM price, but VM naming in calculator differs.
In calculator it will be named as "linux-d4v3-standard".
So, how could I compare VM in Java SDK to VM's in calculator API?
"Standard_D4_v3" and "Linux" to "linux-d4v3-standard"
Is it a way to get VM price from java SDK (I'm talking about abstract VMs that are not created yet, we want to calculate VMs price before VMs creation on our side)
Thank you.