Azure的定价API

时间:2017-12-06 06:38:14

标签: azure

是否存在类似于AWS对产品列表和定价目录的定价api。例如,获取EC2定价和产品目录AWS提供JSON/CSV file,想知道Azure是否有类似的东西

4 个答案:

答案 0 :(得分:2)

https://prices.azure.com/api/retail/prices

您可以使用查询来阅读以下特定项目

https://prices.azure.com/api/retail/prices?$filter=ArmRegionName%20eq%20%27eastus%27

答案 1 :(得分:0)

您可以使用消费API用法详细信息-列表

<Button Content="Add Name " Width="100" Height="30" 
    IsEnabled="{Binding ElementName=txtName, Path=Text.Length, Mode=OneWay}">
</Button>

这是 documentation

如果要查看用法详细信息,请使用api

Get Virtual Machine usage metrics using the REST API

答案 2 :(得分:0)

使用Azure消耗Price Sheet API

jQuery(document).ready(function() {
  $("button[name=btn-add]").on('click', function(e) {
    e.preventDefault();
    let Button_Id = $(this).attr("id")
    console.log(Button_Id);
    let test_content = $("#div-clone");
    stri = '<div>' + Button_Id + '</div>';
    test_content.find('#hello').replaceWith(Button_Id);
    test_content = test_content.html();
    console.log(test_content);
  });
});

使用<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <button type="button" class="btn btn-outline-success" name="btn-add" id="1"> <i class="fas fa-plus fa-1x"></i> <span style="padding-left:3px;"> button 1 </span> </button> <button type="button" class="btn btn-outline-success" name="btn-add" id="2"> <i class="fas fa-plus fa-1x"></i> <span style="padding-left:3px;"> button 2 </span> </button> <div name="div_test" id="div-clone" style="display:none"> <span id="hello"> hello </span> </div>参数,您将获得如下所示的定价列表:

GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/pricesheets/default?api-version=2019-10-01

另请参阅以下堆栈溢出问题:How to get Azure service pricing details programmatically?

答案 3 :(得分:0)

这里是官方文档

https://docs.microsoft.com/en-us/rest/api/cost-management/retail-prices/azure-retail-prices

示例api(您不需要azure帐户即可访问这些api) "https://prices.azure.com/api/retail/prices?$filter=serviceName eq 'Virtual Machines' 和 priceType eq 'Reservation'"

"https://prices.azure.com/api/retail/prices?$filter=serviceFamily eq 'Storage'"

"https://prices.azure.com/api/retail/prices?$filter=serviceFamily eq 'Compute'"

"https://prices.azure.com/api/retail/prices?$filter=endswith(armRegionName, 'europe')"

相关问题