你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Balances - Get By Billing Account
按 billingAccountId 获取范围的余额。 余额仅适用于 2014 年 5 月 1 日或更高版本的此 API。
GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/balances?api-version=2024-08-01
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
billing
|
path | True |
string |
BillingAccount ID |
api-version
|
query | True |
string |
要用于客户端请求的 API 的版本。 当前版本为 2023-03-01。 |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK |
还行。 请求已成功。 |
|
Other Status Codes |
描述作失败的原因的错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow。
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
名称 | 说明 |
---|---|
user_impersonation | 模拟用户帐户 |
示例
Balances
示例请求
GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.Consumption/balances?api-version=2024-08-01
示例响应
{
"id": "/providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.Billing/billingPeriods/201702/providers/Microsoft.Consumption/balances/balanceId1",
"name": "balanceId1",
"type": "Microsoft.Consumption/balances",
"properties": {
"currency": "USD ",
"beginningBalance": 3396469.19,
"endingBalance": 2922371.02,
"newPurchases": 0,
"adjustments": 0,
"utilized": 474098.17,
"serviceOverage": 0,
"chargesBilledSeparately": 0,
"totalOverage": 0,
"totalUsage": 474098.17,
"azureMarketplaceServiceCharges": 609.82,
"billingFrequency": "Month",
"priceHidden": false,
"overageRefund": 2012.61,
"newPurchasesDetails": [
{
"name": "Promo Purchase",
"value": 1
}
],
"adjustmentDetails": [
{
"name": "Promo Credit",
"value": 1.1
},
{
"name": "SIE Credit",
"value": 1
}
]
}
}
定义
名称 | 说明 |
---|---|
Adjustment |
调整列表(促销信用、SIE 信用等)。 |
Balance |
平衡资源。 |
Billing |
计费频率。 |
Error |
错误的详细信息。 |
Error |
错误响应指示服务无法处理传入请求。 错误消息中提供了原因。 一些错误响应:
|
New |
新购买的列表。 |
AdjustmentDetails
调整列表(促销信用、SIE 信用等)。
名称 | 类型 | 说明 |
---|---|---|
name |
string |
新调整的名称。 |
value |
number (decimal) |
新调整的值。 |
Balance
平衡资源。
名称 | 类型 | 说明 |
---|---|---|
etag |
string |
资源的 etag。 |
id |
string |
事件的完整限定 ARM ID。 |
name |
string |
唯一标识事件的 ID。 |
properties.adjustmentDetails |
调整列表(促销信用、SIE 信用等)。 |
|
properties.adjustments |
number (decimal) |
总调整量。 |
properties.azureMarketplaceServiceCharges |
number (decimal) |
Azure 市场的总费用。 |
properties.beginningBalance |
number (decimal) |
计费周期的开始余额。 |
properties.billingFrequency |
计费频率。 |
|
properties.chargesBilledSeparately |
number (decimal) |
单独计费的费用。 |
properties.currency |
string |
计量费用的 ISO 货币,例如美元。 |
properties.endingBalance |
number (decimal) |
计费周期的结束余额(对于开放时段,这将每日更新)。 |
properties.newPurchases |
number (decimal) |
新购买金额总计。 |
properties.newPurchasesDetails |
新购买的列表。 |
|
properties.overageRefund |
number (decimal) |
超额退款 |
properties.priceHidden |
boolean |
价格是隐藏的。 |
properties.serviceOverage |
number (decimal) |
Azure 服务的超额。 |
properties.totalOverage |
number (decimal) |
serviceOverage + chargesBilledSeparately。 |
properties.totalUsage |
number (decimal) |
Azure 服务承诺 + 总超额。 |
properties.utilized |
number (decimal) |
总承诺使用量。 |
tags |
object |
资源标记。 |
type |
string |
资源类型。 |
BillingFrequency
计费频率。
值 | 说明 |
---|---|
Month | |
Quarter | |
Year |
ErrorDetails
错误的详细信息。
名称 | 类型 | 说明 |
---|---|---|
code |
string |
错误代码。 |
message |
string |
指示作失败的原因的错误消息。 |
ErrorResponse
错误响应指示服务无法处理传入请求。 错误消息中提供了原因。
一些错误响应:
429 TooManyRequests - 请求受到限制。 等待“x-ms-ratelimit-microsoft.consumption-retry-after”标头中指定的时间后重试。
503 ServiceUnavailable - 服务暂时不可用。 在等待“Retry-After”标头中指定的时间后重试。
504 网关超时 - 处理请求时服务超时。 尽可能减少请求中的日期范围。
名称 | 类型 | 说明 |
---|---|---|
error |
错误的详细信息。 |
NewPurchasesDetails
新购买的列表。
名称 | 类型 | 说明 |
---|---|---|
name |
string |
新购买的名称。 |
value |
number (decimal) |
新购买的值。 |