共用方式為


az reservations reservation-order

注意

此參考是 Azure CLI 保留延伸模組的一部分 (2.50.0 版或更高版本)。 擴充功能會在您第一次執行 az reservations reservation-order 命令時自動安裝。 深入了解擴充功能。

命令群組 'reservations' 處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

保留訂單。

命令

名稱 Description 類型 狀態
az reservations reservation-order calculate

計算放置 ReservationOrder 的價格。

擴充 預覽版
az reservations reservation-order calculate-refund

如果沒有原則錯誤,則計算傳回 Reservations 的價格。

擴充 預覽版
az reservations reservation-order change-directory

將 和 的 Reservation 目錄 (tenant) ReservationOrder 變更為指定的租使用者識別碼。

擴充 預覽版
az reservations reservation-order list

使用者有權在目前租使用者中存取的所有 ReservationOrder 清單。

擴充 預覽版
az reservations reservation-order purchase

ReservationOrder 指定的 URI 下建立和建立資源。

擴充 預覽版
az reservations reservation-order return

傳回保留。

擴充 預覽版
az reservations reservation-order show

取得 的詳細資料 ReservationOrder

擴充 預覽版
az reservations reservation-order wait

將 CLI 置於等候狀態,直到符合條件為止。

擴充 預覽版

az reservations reservation-order calculate

預覽

命令群組 'reservations' 處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

計算放置 ReservationOrder 的價格。

az reservations reservation-order calculate [--applied-scope]
                                            [--applied-scope-property]
                                            [--applied-scope-type {ManagementGroup, Shared, Single}]
                                            [--billing-plan {Monthly, Upfront}]
                                            [--billing-scope]
                                            [--display-name]
                                            [--instance-flexibility {Off, On}]
                                            [--location]
                                            [--quantity]
                                            [--renew {0, 1, f, false, n, no, t, true, y, yes}]
                                            [--reserved-resource-type {AVS, AppService, AzureDataExplorer, AzureFiles, BlockBlob, CosmosDb, DataFactory, Databricks, DedicatedHost, ManagedDisk, MariaDb, MySql, NetAppStorage, PostgreSql, RedHat, RedHatOsa, RedisCache, SapHana, SqlAzureHybridBenefit, SqlDataWarehouse, SqlDatabases, SqlEdge, SuseLinux, VMwareCloudSimple, VirtualMachineSoftware, VirtualMachines}]
                                            [--review-date-time]
                                            [--sku]
                                            [--term {P1Y, P3Y, P5Y}]

範例

計算價格

az reservations reservation-order calculate --applied-scope-type Shared --billing-scope 50000000-aaaa-bbbb-cccc-100000000002 --display-name name1 --quantity 1 --reserved-resource-type VirtualMachines --sku Standard_B1s --term P1Y --billing-plan Monthly --location eastus

選擇性參數

--applied-scope

將會套用權益的訂用帳戶。 如果 --applied-scope-type 為 Single,則為必要專案。 請勿指定 --applied-scope-type 是否為 Shared。 支援速記語法、json-file 和 yaml-file。 請嘗試 「??」 以顯示更多。

--applied-scope-property

套用範圍類型的特定屬性。 如果不適用,則不需要。 如果 AppliedScopeType 是 ManagementGroup 支援速記語法、json-file 和 yaml-file,則需要提供 tenantId 和 managementGroupId。 請嘗試 「??」 以顯示更多。

--applied-scope-type

套用範圍的類型。

接受的值: ManagementGroup, Shared, Single
--billing-plan

代表計費方案。

接受的值: Monthly, Upfront
--billing-scope

將針對購買保留付費的訂用帳戶。

--display-name

保留的易記名稱。

--instance-flexibility

開啟此選項會將保留折扣套用至相同 VM 大小群組中的其他 VM。 只指定 VirtualMachines 保留的資源類型。

接受的值: Off, On
--location

保留資源所在的 Azure 區域。

--quantity

屬於保留一部分的 SKU 數量。

--renew

將此設定為 true 會自動在到期日時間購買新的保留。

接受的值: 0, 1, f, false, n, no, t, true, y, yes
預設值: False
--reserved-resource-type

正在保留的資源類型。

接受的值: AVS, AppService, AzureDataExplorer, AzureFiles, BlockBlob, CosmosDb, DataFactory, Databricks, DedicatedHost, ManagedDisk, MariaDb, MySql, NetAppStorage, PostgreSql, RedHat, RedHatOsa, RedisCache, SapHana, SqlAzureHybridBenefit, SqlDataWarehouse, SqlDatabases, SqlEdge, SuseLinux, VMwareCloudSimple, VirtualMachineSoftware, VirtualMachines
--review-date-time

這是需要檢閱 Azure 混合式權益的日期時間。

--sku

購買的 Sku 名稱。

--term

代表保留的字詞。

接受的值: P1Y, P3Y, P5Y
全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID 帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az reservations reservation-order calculate-refund

預覽

命令群組 'reservations' 處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

如果沒有原則錯誤,則計算傳回 Reservations 的價格。

az reservations reservation-order calculate-refund --reservation-order-id
                                                   [--id]
                                                   [--quantity]
                                                   [--reservation-id]
                                                   [--scope]

範例

計算退款

az reservations reservation-order calculate-refund --reservation-order-id 0000000-aaaa-bbbb-cccc-20000000001 --id /providers/microsoft.capacity/reservationOrders/0000000-aaaa-bbbb-cccc-20000000001 --scope Reservation --quantity 1 --reservation-id /providers/microsoft.capacity/reservationOrders/0000000-aaaa-bbbb-cccc-20000000001/reservations/50000000-aaaa-bbbb-cccc-200000000000

必要參數

--reservation-order-id

保留的訂單識別碼。

選擇性參數

--id

傳回之保留訂單的完整識別碼。

--quantity

要傳回的數量。 必須大於零。

--reservation-id

傳回保留的完整識別碼。

--scope

退款的範圍,例如保留。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID 帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az reservations reservation-order change-directory

預覽

命令群組 'reservations' 處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

將 和 的 Reservation 目錄 (tenant) ReservationOrder 變更為指定的租使用者識別碼。

az reservations reservation-order change-directory --reservation-order-id
                                                   [--destination-tenant-id]

範例

將保留訂單變更為另一個租使用者

az reservations reservation-order change-directory --reservation-order-id 50000000-aaaa-bbbb-cccc-200000000000 --destination-tenant-id 10000000-aaaa-bbbb-cccc-200000000011

必要參數

--reservation-order-id

保留的訂單識別碼。

選擇性參數

--destination-tenant-id

要轉移保留訂單的租使用者識別碼 GUID。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID 帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az reservations reservation-order list

預覽

命令群組 'reservations' 處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

使用者有權在目前租使用者中存取的所有 ReservationOrder 清單。

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

範例

使用者有權在目前租使用者中存取的所有保留訂單清單。

az reservations reservation-order list

選擇性參數

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

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID 帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az reservations reservation-order purchase

預覽

命令群組 'reservations' 處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

ReservationOrder 指定的 URI 下建立和建立資源。

az reservations reservation-order purchase --reservation-order-id
                                           [--applied-scope]
                                           [--applied-scope-property]
                                           [--applied-scope-type {ManagementGroup, Shared, Single}]
                                           [--billing-plan {Monthly, Upfront}]
                                           [--billing-scope]
                                           [--display-name]
                                           [--instance-flexibility {Off, On}]
                                           [--location]
                                           [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                           [--quantity]
                                           [--renew {0, 1, f, false, n, no, t, true, y, yes}]
                                           [--reserved-resource-type {AVS, AppService, AzureDataExplorer, AzureFiles, BlockBlob, CosmosDb, DataFactory, Databricks, DedicatedHost, ManagedDisk, MariaDb, MySql, NetAppStorage, PostgreSql, RedHat, RedHatOsa, RedisCache, SapHana, SqlAzureHybridBenefit, SqlDataWarehouse, SqlDatabases, SqlEdge, SuseLinux, VMwareCloudSimple, VirtualMachineSoftware, VirtualMachines}]
                                           [--review-date-time]
                                           [--sku]
                                           [--term {P1Y, P3Y, P5Y}]

範例

購買單一範圍保留

az reservations reservation-order purchase --reservation-order-id 40000000-aaaa-bbbb-cccc-200000000005 --applied-scope-type Single --billing-scope 50000000-aaaa-bbbb-cccc-200000000005 --reserved-resource-type VirtualMachines --display-name name1 --quantity 1 --sku Standard_B1s --term P1Y --billing-plan Monthly --location eastus --applied-scope 50000000-aaaa-bbbb-cccc-200000000010

使用資源群組保留購買單一範圍

az reservations reservation-order purchase --reservation-order-id 40000000-aaaa-bbbb-cccc-200000000005 --applied-scope-type Single --billing-scope 50000000-aaaa-bbbb-cccc-200000000005 --reserved-resource-type VirtualMachines --display-name testername1 --quantity 1 --sku Standard_B1s --term P1Y --billing-plan Monthly --location eastus --applied-scope '/subscriptions/50000000-aaaa-bbbb-cccc-200000000005/resourceGroups/rg1' --instance-flexibility Off

必要參數

--reservation-order-id

保留的訂單識別碼。

選擇性參數

--applied-scope

將會套用權益的訂用帳戶。 如果 --applied-scope-type 為 Single,則為必要專案。 請勿指定 --applied-scope-type 是否為 Shared。 支援速記語法、json-file 和 yaml-file。 請嘗試 「??」 以顯示更多。

--applied-scope-property

套用範圍類型的特定屬性。 如果不適用,則不需要。 如果 AppliedScopeType 是 ManagementGroup 支援速記語法、json-file 和 yaml-file,則需要提供 tenantId 和 managementGroupId。 請嘗試 「??」 以顯示更多。

--applied-scope-type

套用範圍的類型。

接受的值: ManagementGroup, Shared, Single
--billing-plan

代表計費方案。

接受的值: Monthly, Upfront
--billing-scope

將針對購買保留付費的訂用帳戶。

--display-name

保留的易記名稱。

--instance-flexibility

開啟此選項會將保留折扣套用至相同 VM 大小群組中的其他 VM。 只指定 VirtualMachines 保留的資源類型。

接受的值: Off, On
--location

保留資源所在的 Azure 區域。

--no-wait

請勿等候長時間執行的作業完成。

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

屬於保留一部分的 SKU 數量。

--renew

將此設定為 true 會自動在到期日時間購買新的保留。

接受的值: 0, 1, f, false, n, no, t, true, y, yes
預設值: False
--reserved-resource-type

正在保留的資源類型。

接受的值: AVS, AppService, AzureDataExplorer, AzureFiles, BlockBlob, CosmosDb, DataFactory, Databricks, DedicatedHost, ManagedDisk, MariaDb, MySql, NetAppStorage, PostgreSql, RedHat, RedHatOsa, RedisCache, SapHana, SqlAzureHybridBenefit, SqlDataWarehouse, SqlDatabases, SqlEdge, SuseLinux, VMwareCloudSimple, VirtualMachineSoftware, VirtualMachines
--review-date-time

這是需要檢閱 Azure 混合式權益的日期時間。

--sku

購買的 Sku 名稱。

--term

代表保留的字詞。

接受的值: P1Y, P3Y, P5Y
全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID 帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az reservations reservation-order return

預覽

命令群組 'reservations' 處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

傳回保留。

az reservations reservation-order return --reservation-order-id
                                         [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                         [--quantity]
                                         [--reservation-id]
                                         [--return-reason]
                                         [--scope]
                                         [--session-id]

範例

傳回保留

az reservations reservation-order return --reservation-order-id 50000000-aaaa-bbbb-cccc-200000000000 --return-reason mockReason --scope Reservation --quantity 1 --reservation-id /providers/microsoft.capacity/reservationOrders/50000000-aaaa-bbbb-cccc-200000000000/reservations/30000000-aaaa-bbbb-cccc-200000000011 --session-id 40000000-aaaa-bbbb-cccc-200000000020

必要參數

--reservation-order-id

保留的訂單識別碼。

選擇性參數

--no-wait

請勿等候長時間執行的作業完成。

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

要傳回的數量。 必須大於零。

--reservation-id

傳回保留的完整識別碼。

--return-reason

傳回保留的原因。

--scope

退款的範圍,例如保留。

--session-id

CalculateRefund API 所傳回的 SessionId。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID 帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az reservations reservation-order show

預覽

命令群組 'reservations' 處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

取得 的詳細資料 ReservationOrder

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

範例

取得保留訂單的詳細資料

az reservations reservation-order show --reservation-order-id 50000000-aaaa-bbbb-cccc-200000000005

必要參數

--reservation-order-id

保留的訂單識別碼。

選擇性參數

--expand

可用來展開 planInformation。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID 帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az reservations reservation-order wait

預覽

命令群組 'reservations' 處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

將 CLI 置於等候狀態,直到符合條件為止。

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

必要參數

--reservation-order-id

保留的訂單識別碼。

選擇性參數

--created

請等候在 'Succeeded' 使用 'provisioningState' 建立。

預設值: False
--custom

等到條件符合自訂 JMESPath 查詢為止。 例如 provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running']。

--deleted

等到刪除為止。

預設值: False
--exists

等候資源存在。

預設值: False
--expand

可用來展開 planInformation。

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

訂用帳戶的名稱或識別碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID 帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。