你当前正在访问 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=2023-05-01
GET https://management.azure.com/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/reservationTransactions?$filter={$filter}&api-version=2023-05-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 返回整个开始日期和结束日期的计费月份的数据。 例如,filter properties/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 流。

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

名称 说明
user_impersonation 模拟用户帐户

示例

ReservationTransactionsByEnrollmentNumber

Sample Request

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=2023-05-01&useMarkupIfPartner=True&previewMarkupPercentage=15.5

Sample Response

{
  "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”标头中指定的时间后重试。

ReservationTransaction

预留事务资源。

ReservationTransactionsListResult

列出预留建议的结果。

ErrorDetails

错误的详细信息。

名称 类型 说明
code

string

错误代码。

message

string

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

ErrorResponse

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

某些错误响应:

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

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

名称 类型 说明
error

ErrorDetails

错误的详细信息。

ReservationTransaction

预留事务资源。

名称 类型 说明
id

string

资源 ID。

name

string

资源名称。

properties.accountName

string

进行事务的帐户的名称。

properties.accountOwnerEmail

string

进行交易的帐户所有者的电子邮件。

properties.amount

number

事务的费用。

properties.armSkuName

string

这是 ARM SKU 名称。 它可用于与使用情况记录中其他信息中的 serviceType 字段联接。

properties.billingFrequency

string

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

properties.billingMonth

integer

计费月 (yyyyMMdd) ,事件启动时间。

properties.costCenter

string

此部门的成本中心(如果为部门和成本中心提供)。

properties.currency

string

向交易收费的 ISO 货币,例如 USD。

properties.currentEnrollment

string

当前注册。

properties.departmentName

string

部门名称。

properties.description

string

交易说明。

properties.eventDate

string

事务的日期

properties.eventType

string

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

properties.monetaryCommitment

number

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

properties.overage

number

注册范围内的超额金额。

properties.purchasingEnrollment

string

购买注册。

properties.purchasingSubscriptionGuid

string

进行事务的订阅 GUID。

properties.purchasingSubscriptionName

string

进行事务的订阅名称。

properties.quantity

number

事务的数量。

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[]

预留建议的列表。