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

az reservations

Note

This reference is part of the reservation extension for the Azure CLI (version 2.50.0 or higher). The extension will automatically install the first time you run an az reservations command. Learn more about extensions.

此命令组处于预览状态,正在开发中。 参考和支持级别:https://aka.ms/CLI_refstatus

Azure Reservations.

命令

名称 说明 类型 Status
az reservations calculate-exchange

如果没有策略错误,则计算交换 Reservations 的价格。

Extension Preview
az reservations catalog

Reservations catalog.

Extension Preview
az reservations catalog show

获取可用预留目录。

Extension Preview
az reservations exchange

返回一个或多个 Reservations,以换取一个或多个 Reservation 购买。

Extension Preview
az reservations list

列出用户有权在当前租户中访问的预留。

Extension Preview
az reservations reservation

Reservations reservation.

Extension Preview
az reservations reservation-order

Reservations reservation-order.

Extension Preview
az reservations reservation-order-id

Reservations reservation-order-id.

Extension Preview
az reservations reservation-order-id list

列出应用于此订阅或此订阅下的资源组的适用 Reservation

Extension Preview
az reservations reservation-order calculate

计算放置 ReservationOrder的价格。

Extension Preview
az reservations reservation-order calculate-refund

如果没有策略错误,则计算返回 Reservations 的价格。

Extension Preview
az reservations reservation-order change-directory

ReservationOrder 的目录(租户)及其下的所有 Reservation 更改为指定的租户 ID。

Extension Preview
az reservations reservation-order list

用户有权访问当前租户中的所有 ReservationOrder的列表。

Extension Preview
az reservations reservation-order purchase

在指定的 URI 下创建 ReservationOrder 并创建资源。

Extension Preview
az reservations reservation-order return

返回预留。

Extension Preview
az reservations reservation-order show

获取 ReservationOrder的详细信息。

Extension Preview
az reservations reservation-order wait

将 CLI 置于等待状态,直到满足条件。

Extension Preview
az reservations reservation archive

存档处于已取消/过期状态的 Reservation,并将其移动到 Archived 状态。

Extension Preview
az reservations reservation list

在单个 ReservationOrder内列出预留项。

Extension Preview
az reservations reservation list-available-scope

列出 Reservation的可用范围。

Extension Preview
az reservations reservation list-history

Reservation的所有修订列表。

Extension Preview
az reservations reservation merge

将指定的 Reservation合并为新的 Reservation。 要合并的两个 Reservation必须具有相同的属性。

Extension Preview
az reservations reservation show

获取特定 Reservation 详细信息。

Extension Preview
az reservations reservation split

Reservation 拆分为具有指定数量分布的两个 Reservation

Extension Preview
az reservations reservation unarchive

取消存档 Reservation 将其移动到存档之前的状态。

Extension Preview
az reservations reservation update

更新应用的作用域、续订、名称、Reservation实例灵活性。

Extension Preview
az reservations reservation wait

将 CLI 置于等待状态,直到满足条件。

Extension Preview

az reservations calculate-exchange

预览

命令组“reservations”处于预览状态,正在开发中。 参考和支持级别:https://aka.ms/CLI_refstatus

如果没有策略错误,则计算交换 Reservations 的价格。

az reservations calculate-exchange [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                   [--ris-to-exchange]
                                   [--ris-to-purchase]
                                   [--sp-to-purchase]

示例

Calculate exchange

az reservations calculate-exchange --ris-to-exchange "[{reservation-id:/providers/microsoft.capacity/reservationOrders/40000000-aaaa-bbbb-cccc-200000000012/reservations/51000000-aaaa-bbbb-cccc-200000000012,quantity:1},{reservation-id:/providers/microsoft.capacity/reservationOrders/90000000-aaaa-bbbb-cccc-200000000012/reservations/36000000-aaaa-bbbb-cccc-200000000012,quantity:1}]" --ris-to-purchase "[{reserved-resource-type:VirtualMachines,applied-scope-type:Shared,billing-scope:12350000-aaaa-bbbb-cccc-200000000012,display-name:exchangeTest1,quantity:1,sku:Standard_B1s,term:P1Y,billing-plan:Monthly,location:eastus},{reserved-resource-type:VirtualMachines,applied-scope-type:Shared,billing-scope:12350000-aaaa-bbbb-cccc-200000000012,display-name:exchangeTest2,quantity:1,sku:Standard_B1s,term:P1Y,billing-plan:Monthly,location:eastus}]"

可选参数

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--no-wait

不等待长时间运行的操作完成。

属性
接受的值: 0, 1, f, false, n, no, t, true, y, yes
--ris-to-exchange

在此交换中返回的预留的列表。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

属性
Parameter group: Properties Arguments
--ris-to-purchase

在此交换中购买的预留列表。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

属性
Parameter group: Properties Arguments
--sp-to-purchase

在此交换中购买的储蓄计划列表。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

属性
Parameter group: Properties Arguments
全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

Output format.

属性
默认值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

属性
默认值: False

az reservations exchange

预览

命令组“reservations”处于预览状态,正在开发中。 参考和支持级别:https://aka.ms/CLI_refstatus

返回一个或多个 Reservations,以换取一个或多个 Reservation 购买。

az reservations exchange [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                         [--session-id]

示例

Exchange reservations

az reservations exchange --session-id 40000000-aaaa-bbbb-cccc-200000000012

可选参数

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--no-wait

不等待长时间运行的操作完成。

属性
接受的值: 0, 1, f, false, n, no, t, true, y, yes
--session-id

CalculateExchange API 返回的 SessionId。

属性
Parameter group: Properties Arguments
全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

Output format.

属性
默认值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

属性
默认值: False

az reservations list

预览

命令组“reservations”处于预览状态,正在开发中。 参考和支持级别:https://aka.ms/CLI_refstatus

列出用户有权在当前租户中访问的预留。

az reservations list [--filter]
                     [--max-items]
                     [--next-token]
                     [--orderby]
                     [--selected-state]

示例

列出当前租户下的预留

az reservations list

列出当前租户下的“失败”状态的预留

az reservations list --selected-state "Failed"

列出当前租户下的所有“VirtualMachines”预留

az az reservations list --filter "properties/reservedResourceType eq 'VirtualMachines'"

按数量按降序列出预留和订购结果

az reservations list --orderby 'properties/quantity desc'

可选参数

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--filter

可用于按预留属性进行筛选。 筛选器支持“eq”、“or”和“and”。 它目前不支持“ne”、“gt”、“le”、“ge”或“not”。 预留属性包括 sku/name、properties/{appliedScopeType、archived、displayName、displayProvisioningState、effectiveDateTime、expiryDate、provisioningState、quantity、renew、reservedResourceType、term、userFriendlyAppliedScopeType、userFriendlyRenewState}。

--max-items

命令输出中要返回的项总数。 如果可用的项总数大于指定的值,则会在命令的输出中提供令牌。 若要恢复分页,请在后续命令的 --next-token 参数中提供令牌值。

属性
Parameter group: Pagination Arguments
--next-token

用于指定开始分页的位置的令牌。 这是先前截断的响应中的令牌值。

属性
Parameter group: Pagination Arguments
--orderby

可用于按预留属性对订单进行排序。

--selected-state

所选预配状态。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

Output format.

属性
默认值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

属性
默认值: False