共用方式為


az reservations reservation

備註

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

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

保留。

命令

名稱 Description 類型 狀態
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

將指定的 Reservation合併至新的 Reservation。 要合併的兩個 Reservation必須具有相同的屬性。

擴充套件 預覽
az reservations reservation show

取得特定 Reservation 詳細數據。

擴充套件 預覽
az reservations reservation split

Reservation 分割成具有指定數量分配的兩個 Reservation

擴充套件 預覽
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

保留項目的識別碼。

--reservation-order-id

保留的訂單標識碼。

全域參數
--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 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

保留的訂單標識碼。

選擇性參數

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

保留項目的識別碼。

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

訂用帳戶的名稱或標識碼。 您可以使用 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

保留項目的識別碼。

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

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

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

az reservations reservation merge

預覽

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

將指定的 Reservation合併至新的 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

保留的訂單標識碼。

選擇性參數

--no-wait

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

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

資源標識符的格式應該是 /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

訂用帳戶的名稱或標識碼。 您可以使用 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

保留項目的識別碼。

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

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

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

az reservations reservation split

預覽

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

Reservation 分割成具有指定數量分配的兩個 Reservation

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

保留的訂單標識碼。

選擇性參數

--no-wait

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

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

要建立之新保留中的數量清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 “??” 以顯示更多。

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

訂用帳戶的名稱或標識碼。 您可以使用 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

保留項目的識別碼。

--reservation-order-id

保留的訂單標識碼。

全域參數
--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 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

保留項目的識別碼。

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

訂用帳戶的名稱或標識碼。 您可以使用 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

保留項目的識別碼。

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

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

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。