az reservations
Note
此参考是 Azure CLI(版本 2.50.0 或更高版本) 的预留 扩展的一部分。 该扩展将在首次运行 az reservations 命令时自动安装。 了解更多关于扩展的信息。
此命令组处于预览状态,正在开发中。 参考和支持级别:https://aka.ms/CLI_refstatus
Azure 预留。
命令
| 名称 | 说明 | 类型 | Status |
|---|---|---|---|
| az reservations calculate-exchange |
如果没有策略错误,则计算交换 |
Extension | Preview |
| az reservations catalog |
预留目录。 |
Extension | Preview |
| az reservations catalog show |
获取可用预留目录。 |
Extension | Preview |
| az reservations exchange |
返回一个或多个 |
Extension | Preview |
| az reservations list |
列出用户有权在当前租户中访问的预留。 |
Extension | Preview |
| az reservations reservation |
预留。 |
Extension | Preview |
| az reservations reservation-order |
预留订单。 |
Extension | Preview |
| az reservations reservation-order-id |
预留订单 ID。 |
Extension | Preview |
| az reservations reservation-order-id list |
列出应用于此订阅或此订阅下的资源组的适用 |
Extension | Preview |
| az reservations reservation-order calculate |
计算放置 |
Extension | Preview |
| az reservations reservation-order calculate-refund |
如果没有策略错误,则计算返回 |
Extension | Preview |
| az reservations reservation-order change-directory |
将 |
Extension | Preview |
| az reservations reservation-order list |
用户有权访问当前租户中的所有 |
Extension | Preview |
| az reservations reservation-order purchase |
在指定的 URI 下创建 |
Extension | Preview |
| az reservations reservation-order return |
返回预留。 |
Extension | Preview |
| az reservations reservation-order show |
获取 |
Extension | Preview |
| az reservations reservation-order wait |
将 CLI 置于等待状态,直到满足条件。 |
Extension | Preview |
| az reservations reservation archive |
存档处于已取消/过期状态的 |
Extension | Preview |
| az reservations reservation list |
在单个 |
Extension | Preview |
| az reservations reservation list-available-scope |
列出 |
Extension | Preview |
| az reservations reservation list-history |
|
Extension | Preview |
| az reservations reservation merge |
将指定的 |
Extension | Preview |
| az reservations reservation show |
获取特定 |
Extension | Preview |
| az reservations reservation split |
将 |
Extension | Preview |
| az reservations reservation unarchive |
取消存档 |
Extension | Preview |
| az reservations reservation update |
更新应用的作用域、续订、名称、 |
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]
示例
计算交换
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.
不等待长时间运行的操作完成。
| 属性 | 值 |
|---|---|
| 接受的值: | 0, 1, f, false, n, no, t, true, y, yes |
在此交换中返回的预留的列表。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。
| 属性 | 值 |
|---|---|
| Parameter group: | Properties Arguments |
在此交换中购买的预留列表。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。
| 属性 | 值 |
|---|---|
| Parameter group: | Properties Arguments |
在此交换中购买的储蓄计划列表。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。
| 属性 | 值 |
|---|---|
| Parameter group: | Properties Arguments |
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
增加日志记录详细程度。 使用 --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 预留
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.
不等待长时间运行的操作完成。
| 属性 | 值 |
|---|---|
| 接受的值: | 0, 1, f, false, n, no, t, true, y, yes |
CalculateExchange API 返回的 SessionId。
| 属性 | 值 |
|---|---|
| Parameter group: | Properties Arguments |
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
增加日志记录详细程度。 使用 --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.
可用于按预留属性进行筛选。 筛选器支持“eq”、“or”和“and”。 它目前不支持“ne”、“gt”、“le”、“ge”或“not”。 预留属性包括 sku/name、properties/{appliedScopeType、archived、displayName、displayProvisioningState、effectiveDateTime、expiryDate、provisioningState、quantity、renew、reservedResourceType、term、userFriendlyAppliedScopeType、userFriendlyRenewState}。
命令输出中要返回的项总数。 如果可用的项总数大于指定的值,则会在命令的输出中提供令牌。 若要恢复分页,请在后续命令的 --next-token 参数中提供令牌值。
| 属性 | 值 |
|---|---|
| Parameter group: | Pagination Arguments |
用于指定开始分页的位置的令牌。 这是先前截断的响应中的令牌值。
| 属性 | 值 |
|---|---|
| Parameter group: | Pagination Arguments |
可用于按预留属性对订单进行排序。
所选预配状态。
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |