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

az reservations reservation

注意

此参考是 Azure CLI(版本 2.50.0 或更高版本)的预留扩展的一部分。 该扩展将在首次运行 az reservations reservation 命令时自动安装。 详细了解扩展。

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

预留。

命令

名称 说明 类型 状态
az reservations reservation archive

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

分机 预览
az reservations reservation list

列出单个 ReservationOrder中的预留项。

扩展 预览
az reservations reservation list-available-scope

列出可用的范围 Reservation

分机 预览版
az reservations reservation list-history

所有修订 Reservation的列表。

分机 预览
az reservations reservation merge

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

分机 预览
az reservations reservation show

获取特定 Reservation 详细信息。

分机 预览
az reservations reservation split

将一个 Reservation 拆分为具有指定数量分布的两 Reservation个 s。

扩展 预览版
az reservations reservation unarchive

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

扩展 预览
az reservations reservation update

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

分机 预览版
az reservations reservation wait

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

分机 预览

az reservations reservation archive

预览

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

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

az reservations reservation archive --reservation-id
                                    --reservation-order-id

示例

存档预留

az reservations reservation archive --reservation-order-id 40000000-aaaa-bbbb-cccc-20000000000 --reservation-id 50000000-aaaa-bbbb-cccc-200000000000

必需参数

--reservation-id

预留项的 ID。

--reservation-order-id

预留的订单 ID。

全局参数
--debug

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

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

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

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

--subscription

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

--verbose

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

az reservations reservation list

预览

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

列出单个 ReservationOrder中的预留项。

az reservations reservation list --reservation-order-id
                                 [--max-items]
                                 [--next-token]

示例

列出预留订单中的所有预留。

az reservations reservation list --reservation-order-id 50000000-aaaa-bbbb-cccc-100000000002

必需参数

--reservation-order-id

预留的订单 ID。

可选参数

--max-items

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

--next-token

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

全局参数
--debug

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

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

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

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

--subscription

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

--verbose

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

az reservations reservation list-available-scope

预览

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

列出可用的范围 Reservation

az reservations reservation list-available-scope --reservation-id
                                                 --reservation-order-id
                                                 [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                                 [--scopes]

示例

列出可用预留范围

az reservations reservation list-available-scope --reservation-order-id 40000000-aaaa-bbbb-cccc-20000000000 --reservation-id 30000000-aaaa-bbbb-cccc-20000000000 --scopes ['/subscriptions/60000000-aaaa-bbbb-cccc-20000000000']

必需参数

--reservation-id

预留项的 ID。

--reservation-order-id

预留的订单 ID。

可选参数

--no-wait

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

接受的值: 0, 1, f, false, n, no, t, true, y, yes
--scopes

支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

全局参数
--debug

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

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

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

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

--subscription

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

--verbose

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

az reservations reservation list-history

预览

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

所有修订 Reservation的列表。

az reservations reservation list-history --reservation-id
                                         --reservation-order-id
                                         [--max-items]
                                         [--next-token]

示例

获取预留的历史记录。

az reservations reservation list-history --reservation-id 50000000-aaaa-bbbb-cccc-100000000002 --reservation-order-id 10000000-aaaa-bbbb-cccc-100000000005

必需参数

--reservation-id

预留项的 ID。

--reservation-order-id

预留的订单 ID。

可选参数

--max-items

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

--next-token

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

全局参数
--debug

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

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

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

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

--subscription

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

--verbose

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

az reservations reservation merge

预览

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

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

az reservations reservation merge --reservation-order-id
                                  [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                  [--sources]

示例

合并预留

az reservations reservation merge --reservation-order-id 10000000-aaaa-bbbb-cccc-100000000005 --sources "['/providers/Microsoft.Capacity/reservationOrders/10000000-aaaa-bbbb-cccc-100000000005/reservations/30000000-aaaa-bbbb-cccc-100000000002','/providers/Microsoft.Capacity/reservationOrders/10000000-aaaa-bbbb-cccc-100000000005/reservations/30000000-aaaa-bbbb-cccc-100000000004']"

必需参数

--reservation-order-id

预留的订单 ID。

可选参数

--no-wait

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

接受的值: 0, 1, f, false, n, no, t, true, y, yes
--sources

资源 ID 的格式应为 /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId} 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

全局参数
--debug

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

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

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

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

--subscription

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

--verbose

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

az reservations reservation show

预览

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

获取特定 Reservation 详细信息。

az reservations reservation show --reservation-id
                                 --reservation-order-id
                                 [--expand]

示例

获取预留详细信息

az reservations reservation show --reservation-id 40000000-aaaa-bbbb-cccc-100000000001 --reservation-order-id 10000000-aaaa-bbbb-cccc-200000000001

必需参数

--reservation-id

预留项的 ID。

--reservation-order-id

预留的订单 ID。

可选参数

--expand

此查询支持的值是 renewProperties。

全局参数
--debug

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

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

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

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

--subscription

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

--verbose

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

az reservations reservation split

预览

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

将一个 Reservation 拆分为具有指定数量分布的两 Reservation个 s。

az reservations reservation split --reservation-order-id
                                  [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                  [--quantities]
                                  [--reservation-id]

示例

拆分预留

az reservations reservation split --quantities "[2,8]" --reservation-id /providers/Microsoft.Capacity/reservationOrders/30000000-aaaa-bbbb-cccc-100000000004/reservations/40000000-aaaa-bbbb-cccc-100000000001 --reservation-order-id 30000000-aaaa-bbbb-cccc-100000000004

必需参数

--reservation-order-id

预留的订单 ID。

可选参数

--no-wait

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

接受的值: 0, 1, f, false, n, no, t, true, y, yes
--quantities

要创建的新预留中的数量列表。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--reservation-id

要拆分的预留的资源 ID。 资源 ID 的格式应为 /providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/reservations/{reservationId}。

全局参数
--debug

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

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

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

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

--subscription

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

--verbose

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

az reservations reservation unarchive

预览

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

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

az reservations reservation unarchive --reservation-id
                                      --reservation-order-id

示例

取消存档预留

az reservations reservation unarchive --reservation-order-id 40000000-aaaa-bbbb-cccc-20000000000 --reservation-id 50000000-aaaa-bbbb-cccc-200000000000

必需参数

--reservation-id

预留项的 ID。

--reservation-order-id

预留的订单 ID。

全局参数
--debug

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

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

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

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

--subscription

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

--verbose

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

az reservations reservation update

预览

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

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

az reservations reservation update --reservation-id
                                   --reservation-order-id
                                   [--applied-scope-property]
                                   [--applied-scope-type {ManagementGroup, Shared, Single}]
                                   [--applied-scopes]
                                   [--instance-flexibility {Off, On}]
                                   [--name]
                                   [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                   [--renew {0, 1, f, false, n, no, t, true, y, yes}]
                                   [--renewal-properties]

示例

将预留设置为共享范围

az reservations reservation update --applied-scope-type Shared --reservation-id 10000000-aaaa-bbbb-cccc-200000000001 --reservation-order-id 50000000-aaaa-bbbb-cccc-200000000005

设置预留续订

az reservations reservation update --reservation-id 10000000-aaaa-bbbb-cccc-200000000001 --reservation-order-id 50000000-aaaa-bbbb-cccc-200000000005 --renew true

将预留设置为单个范围

az reservations reservation update --reservation-id 10000000-aaaa-bbbb-cccc-200000000001 --reservation-order-id 50000000-aaaa-bbbb-cccc-200000000005 --applied-scope-type Single --applied-scopes ['/subscriptions/50000000-aaaa-bbbb-cccc-200000000009']

将预留设置为单范围资源组

az reservations reservation update --reservation-id 10000000-aaaa-bbbb-cccc-200000000001 --reservation-order-id 50000000-aaaa-bbbb-cccc-200000000005 --applied-scope-type Single --applied-scopes ['/subscriptions/50000000-aaaa-bbbb-cccc-200000000009/resourceGroups/mock_resource_group_name']

将预留设置为管理组范围

az reservations reservation update --reservation-id 10000000-aaaa-bbbb-cccc-200000000001 --reservation-order-id 50000000-aaaa-bbbb-cccc-200000000005 --applied-scope-type ManagementGroup --applied-scope-property '{management-group-id:/providers/Microsoft.Management/managementGroups/mock_management_group_name,tenant-id:50000000-aaaa-bbbb-cccc-200000000008}'

必需参数

--reservation-id

预留项的 ID。

--reservation-order-id

预留的订单 ID。

可选参数

--applied-scope-property

特定于应用的范围类型的属性。 如果不适用,则不需要。 如果 AppliedScopeType 是 ManagementGroup 支持速记语法、json-file 和 yaml-file,则需要提供 tenantId 和 managementGroupId。 请尝试“??” 以显示更多内容。

--applied-scope-type

应用的作用域的类型。

接受的值: ManagementGroup, Shared, Single
--applied-scopes

将应用权益的订阅列表。 请勿指定 AppliedScopeType 是否为 Shared。 支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

--instance-flexibility

打开此项会将预留折扣应用到同一 VM 大小组中的其他 VM。 仅指定 VirtualMachines 保留资源类型。

接受的值: Off, On
--name

预留的名称。

--no-wait

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

接受的值: 0, 1, f, false, n, no, t, true, y, yes
--renew

如果设置为 true,则会在到期日期时间自动购买新预留。

接受的值: 0, 1, f, false, n, no, t, true, y, yes
默认值: False
--renewal-properties

续订购买属性支持速记语法、json-file 和 yaml-file。 请尝试“??” 以显示更多内容。

全局参数
--debug

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

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

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

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

--subscription

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

--verbose

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

az reservations reservation wait

预览

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

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

az reservations reservation wait --reservation-id
                                 --reservation-order-id
                                 [--created]
                                 [--custom]
                                 [--deleted]
                                 [--exists]
                                 [--expand]
                                 [--interval]
                                 [--timeout]
                                 [--updated]

必需参数

--reservation-id

预留项的 ID。

--reservation-order-id

预留的订单 ID。

可选参数

--created

等待在“Succeeded”中使用“provisioningState”创建。

默认值: False
--custom

等待条件满足自定义 JMESPath 查询。 例如 provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running']。

--deleted

等到删除为止。

默认值: False
--exists

等待资源存在。

默认值: False
--expand

此查询支持的值是 renewProperties。

--interval

轮询间隔(以秒为单位)。

默认值: 30
--timeout

最大等待(以秒为单位)。

默认值: 3600
--updated

等到 provisioningState 更新为“Succeeded”。

默认值: False
全局参数
--debug

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

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

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

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

--subscription

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

--verbose

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