Azure定价API无法正确过滤
我无法过滤从Azure CLI返回的价格:
az rest -u https://prices.azure.com/api/retail/prices --url-parameters '{"skuName":"F4s v2"}'
产生一个清晰未过滤的结果,
{
"armRegionName": "westcentralus",
"armSkuName": "Standard_E4ds_v5",
"currencyCode": "USD",
"effectiveStartDate": "2021-11-01T00:00:00Z",
"isPrimaryMeterRegion": true,
"location": "US West Central",
"meterId": "00172462-4604-5a25-b1d4-f057577d68e0",
"meterName": "E4ds v5 Low Priority",
"productId": "DZH318Z096SL",
"productName": "Virtual Machines Edsv5 Series Windows",
"retailPrice": 0.212,
"serviceFamily": "Compute",
"serviceId": "DZH313Z7MMC8",
"serviceName": "Virtual Machines",
"skuId": "DZH318Z096SL/0424",
"skuName": "E4ds v5 Low Priority",
"tierMinimumUnits": 0.0,
"type": "Consumption",
"unitOfMeasure": "1 Hour",
"unitPrice": 0.212
}
],
"NextPageLink": "https://prices.azure.com:443/api/retail/prices?skuName=F4s%20v2&$skip=100"
}
但如果我转到:
https://prices.azure.com/api/retail/retail/retail/prices?currencycode=gbpppp& $ filter = skuname%20EQ%20%27F4S%20v2%27
它可以提起定价信息,这没问题。
谁能解释我在做什么错误?
谢谢
I am unable to filter the prices returned from the azure cli:
az rest -u https://prices.azure.com/api/retail/prices --url-parameters '{"skuName":"F4s v2"}'
produces a clearly unfiltered result ending with:
{
"armRegionName": "westcentralus",
"armSkuName": "Standard_E4ds_v5",
"currencyCode": "USD",
"effectiveStartDate": "2021-11-01T00:00:00Z",
"isPrimaryMeterRegion": true,
"location": "US West Central",
"meterId": "00172462-4604-5a25-b1d4-f057577d68e0",
"meterName": "E4ds v5 Low Priority",
"productId": "DZH318Z096SL",
"productName": "Virtual Machines Edsv5 Series Windows",
"retailPrice": 0.212,
"serviceFamily": "Compute",
"serviceId": "DZH313Z7MMC8",
"serviceName": "Virtual Machines",
"skuId": "DZH318Z096SL/0424",
"skuName": "E4ds v5 Low Priority",
"tierMinimumUnits": 0.0,
"type": "Consumption",
"unitOfMeasure": "1 Hour",
"unitPrice": 0.212
}
],
"NextPageLink": "https://prices.azure.com:443/api/retail/prices?skuName=F4s%20v2&$skip=100"
}
Although if i go to:
https://prices.azure.com/api/retail/prices?currencyCode=GBP&$filter=skuName%20eq%20%27F4s%20v2%27
it pulls up the pricing info filtered no problem.
Can anyone explain what I am doing incorrectly?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能遵循的解决方案之一是为了达到上述要求,
看来,标题有一个问题,因为您提供了参数,因为
skuname
,因此未正确列出了价格尝试使用$ filter
。您可以使用以下
api
格式。您会得到以下类似的东西;
有关完整信息,请参阅以下链接:
Microsoft文档 | API端点的价格详细信息 。
博客 | 过滤Azure定价API 。
One of the workaround you may follow to achieve the above requirement ,
It seems there is an issue with the header as you have provide the parameter as the
skuname
so the pricings are not listed properly instead of that try to use$filter
.You may use the below
api
format for example ;You will get something like below;
For complete information please refer the below links:
MICROSOFT DOCUMENT|API endpoint for pricing details .
BLOG| Filtering the Azure pricing API .