你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Reservation Transactions - List

计费帐户范围内预留实例的事务列表。 注意:退款交易与其购买交易一起发布(即在购买计费月份)。 例如,退款是在 2021 年 5 月请求的。 此退款交易的日期为 2021 年 5 月,但预订购买时的计费月份为 2020 年 4 月。 注意:ARM 的有效负载大小限制为 12MB,因此,当响应大小超过 ARM 限制时,当前调用方将获得 400。 在这种情况下,应使用较小的日期范围进行 API 调用。

GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/reservationTransactions?api-version=2024-08-01
GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/reservationTransactions?$filter={$filter}&api-version=2024-08-01&useMarkupIfPartner={useMarkupIfPartner}&previewMarkupPercentage={previewMarkupPercentage}

URI 参数

名称 必需 类型 说明
billingAccountId
path True

string

BillingAccount ID

api-version
query True

string

要用于客户端请求的 API 的版本。 当前版本为 2023-03-01。

$filter
query

string

按日期范围筛选预留事务。 开始日期和结束日期的属性/EventDate。 筛选器支持“le”和“ge”。 注意:API 返回整个开始日期和结束日期计费月的数据。 例如,筛选器属性/eventDate+ge+2020-01-01+AND+properties/eventDate+le+2020-12-29 将包含整个 2020 年 12 月的数据(即将包含日期 12 月 30 和 31 日的记录)

previewMarkupPercentage
query

number (decimal)

要应用的预览标记百分比。

useMarkupIfPartner
query

boolean

如果调用方是合作伙伴,则应用对事务进行标记。

响应

名称 类型 说明
200 OK

ReservationTransactionsListResult

还行。 请求已成功。

Other Status Codes

ErrorResponse

描述作失败的原因的错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 Flow。

类型: oauth2
流向: implicit
授权 URL: https://login.microsoftonline.com/common/oauth2/authorize

作用域

名称 说明
user_impersonation 模拟用户帐户

示例

ReservationTransactionsByEnrollmentNumber

示例请求

GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/123456/providers/Microsoft.Consumption/reservationTransactions?$filter=properties/eventDate+ge+2020-05-20+AND+properties/eventDate+le+2020-05-30&api-version=2024-08-01&useMarkupIfPartner=True&previewMarkupPercentage=15.5

示例响应

{
  "value": [
    {
      "id": "/billingAccounts/123456/providers/Microsoft.Consumption/reservationtransactions/201909091919",
      "name": "201909091919",
      "type": "Microsoft.Consumption/reservationTransactions",
      "tags": [],
      "properties": {
        "eventDate": "2019-09-09T19:19:04Z",
        "reservationOrderId": "00000000-0000-0000-0000-000000000000",
        "description": "Standard_DS1_v2 westus 1 Year",
        "eventType": "Refund",
        "quantity": 1,
        "amount": -21,
        "currency": "USD",
        "reservationOrderName": "Transaction-DS1_v2",
        "purchasingEnrollment": "123456",
        "armSkuName": "Standard_DS1_v2",
        "term": "P1Y",
        "region": "westus",
        "purchasingSubscriptionGuid": "a838a8c3-a408-49e1-ac90-42cb95bff9b2",
        "purchasingSubscriptionName": "Infrastructure Subscription",
        "accountName": "Microsoft Infrastructure",
        "accountOwnerEmail": "admin@microsoft.com",
        "departmentName": "Unassigned",
        "costCenter": "",
        "currentEnrollment": "123456",
        "billingFrequency": "recurring",
        "billingMonth": 20190901,
        "monetaryCommitment": 523123.9,
        "overage": 23234.49
      }
    },
    {
      "id": "/billingAccounts/123456/providers/Microsoft.Consumption/reservationtransactions/201909091919",
      "name": "201909091919",
      "type": "Microsoft.Consumption/reservationTransactions",
      "tags": [],
      "properties": {
        "eventDate": "2019-09-09T19:19:04Z",
        "reservationOrderId": "00000000-0000-0000-0000-000000000000",
        "description": "Standard_DS1_v2 westus 1 Year",
        "eventType": "Purchase",
        "quantity": 1,
        "amount": 21,
        "currency": "USD",
        "reservationOrderName": "Transaction-DS1_v2",
        "purchasingEnrollment": "123456",
        "armSkuName": "Standard_DS1_v2",
        "term": "P1Y",
        "region": "westus",
        "purchasingSubscriptionGuid": "a838a8c3-a408-49e1-ac90-42cb95bff9b2",
        "purchasingSubscriptionName": "Infrastructure Subscription",
        "accountName": "Microsoft Infrastructure",
        "accountOwnerEmail": "admin@microsoft.com",
        "departmentName": "Unassigned",
        "costCenter": "",
        "currentEnrollment": "123456",
        "billingFrequency": "recurring",
        "billingMonth": 20190901,
        "monetaryCommitment": 523123.9,
        "overage": 23234.49
      }
    }
  ]
}

定义

名称 说明
ErrorDetails

错误的详细信息。

ErrorResponse

错误响应指示服务无法处理传入请求。 错误消息中提供了原因。

一些错误响应:

  • 429 TooManyRequests - 请求受到限制。 等待“x-ms-ratelimit-microsoft.consumption-retry-after”标头中指定的时间后重试。

  • 503 ServiceUnavailable - 服务暂时不可用。 在等待“Retry-After”标头中指定的时间后重试。

  • 504 网关超时 - 处理请求时服务超时。 尽可能减少请求中的日期范围。

ReservationTransaction

预留事务资源。

ReservationTransactionsListResult

列出预留建议的结果。

ErrorDetails

错误的详细信息。

名称 类型 说明
code

string

错误代码。

message

string

指示作失败的原因的错误消息。

ErrorResponse

错误响应指示服务无法处理传入请求。 错误消息中提供了原因。

一些错误响应:

  • 429 TooManyRequests - 请求受到限制。 等待“x-ms-ratelimit-microsoft.consumption-retry-after”标头中指定的时间后重试。

  • 503 ServiceUnavailable - 服务暂时不可用。 在等待“Retry-After”标头中指定的时间后重试。

  • 504 网关超时 - 处理请求时服务超时。 尽可能减少请求中的日期范围。

名称 类型 说明
error

ErrorDetails

错误的详细信息。

ReservationTransaction

预留事务资源。

名称 类型 说明
id

string

资源 ID。

name

string

资源名称。

properties.accountName

string

进行事务的帐户的名称。

properties.accountOwnerEmail

string

发出事务的帐户所有者的电子邮件。

properties.amount

number (decimal)

事务的费用。

properties.armSkuName

string

这是 ARM Sku 名称。 它可用于在使用情况记录中的其他信息中加入 serviceType 字段。

properties.billingFrequency

string

计费频率,可以是一次性或定期计费。

properties.billingMonth

integer (int32)

事件启动的计费月份(yyyyMMdd)。

properties.costCenter

string

如果此部门是部门和成本中心,则此部门的成本中心。

properties.currency

string

用于支付交易费用的 ISO 货币,例如美元。

properties.currentEnrollment

string

当前注册。

properties.departmentName

string

部门名称。

properties.description

string

事务的说明。

properties.eventDate

string (date-time)

事务的日期

properties.eventType

string

交易的类型(购买、取消或退款)。

properties.monetaryCommitment

number (decimal)

注册范围内的货币承诺金额。

properties.overage

number (decimal)

注册范围内的超额金额。

properties.purchasingEnrollment

string

购买注册。

properties.purchasingSubscriptionGuid

string (uuid)

进行事务的订阅 GUID。

properties.purchasingSubscriptionName

string

发出事务的订阅名称。

properties.quantity

number (decimal)

事务的数量。

properties.region

string

事务的区域。

properties.reservationOrderId

string

预留订单 ID 是预留购买的标识符。 每个预留订单 ID 表示单个购买交易。 预留订单包含预留。 预留顺序指定预留的 VM 大小和区域。

properties.reservationOrderName

string

预留订单的名称。

properties.term

string

这是事务的术语。

tags

string[]

资源标记。

type

string

资源类型。

ReservationTransactionsListResult

列出预留建议的结果。

名称 类型 说明
nextLink

string

指向下一页结果的链接(url)。

value

ReservationTransaction[]

预留建议的列表。