简体   繁体   English

Azure 价目表 Api 获取 VM 价格

[英]Azure Ratecard Api to get VM price

AWS provides a pricing api to get cost details of each service. AWS 提供定价 api 以获取每项服务的成本详细信息。 If you want to know the price of an EC2 instance, you just pass the region,instance type(eg:t2.micro) and service code of EC2 to the pricing API and it returns the pricing details.如果您想知道 EC2 实例的价格,只需将 EC2 的区域、实例类型(例如:t2.micro)和服务代码传递给定价 API,它就会返回定价详细信息。 I understand that azure exposes Ratecard API to get the prices.我了解 azure 会公开 Ratecard API 以获取价格。 But It returns a huge JSON with all the services.但它返回一个巨大的 JSON 以及所有服务。 How do I filter based on service type and its attributes.如何根据服务类型及其属性进行过滤。 For example, I want the pricing details of Azure VM of instance type Standard_B2S in Central US.例如,我想要美国中部实例类型 Standard_B2S 的 Azure VM 的定价详细信息。 Is this possible?这可能吗?

No there is no separate API available for it apart from RateCard, if you need to get the details of particular VM you can use Virtual Machine Rest API.不,除了 RateCard 之外,没有单独的 API 可用,如果您需要获取特定 VM 的详细信息,您可以使用虚拟机 Rest API。 See this link .请参阅此link

GET得到

https://management.azure.com/subscriptions/ {subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes?api-version={apiVersion} https://management.azure.com/subscriptions/ {subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes?api-version={apiVersion}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM