本文介绍了如何使用Azure Billing API获得“可用信用"和“剩余天数"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用如下所示的Azure Billing或RateCard API获取旧管理门户的两个指标?

Is it possible to get the two indicators of the old management portal using the Azure Billing or RateCard API like shown below?

谢谢!

推荐答案

因此,您需要寻找两件事:

So there're two things you're looking for:

  • 订阅的结算期:从今天开始,无法以编程方式获取订阅的结算期.
  • 剩余信用额度:剩余信用额度无法通过API直接获得,但是可以计算得出.首先,您需要找到可用的总积分.可以通过 Rate Cart API 来获取此信息.这将在响应中的OfferTerms元素下提供.
  • Subscription Billing Period: As of today, it is not possible to fetch the billing period of a Subscription programmatically.
  • Remaining Credits: Remaining credits is not directly available via the API however it is possible to calculate this. For this first, you would need to find the total credits available. This information can be fetched via Rate Cart API. This will be available under OfferTerms element in the response.

接下来,您需要使用 .根据用量和价目表,您需要计算用量.信用额与该金额之间的差额将为您提供剩余金额.

Next you would need to calculate the actual usage using the Usage API. Based on the usage and the rate card, you will need to calculate the usage amount. Difference between the credit and this amount will give you remaining amount.

这篇关于如何使用Azure Billing API获得“可用信用"和“剩余天数"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 18:19