az reservations

注意

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

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

Azure 保留。

命令

名稱 Description 類型 狀態
az reservations calculate-exchange

計算沒有原則錯誤時交換 Reservations 的價格。

擴充 預覽版
az reservations catalog

保留目錄。

擴充 預覽版
az reservations catalog show

取得可用保留的目錄。

擴充 預覽版
az reservations exchange

傳回一或多個 Reservations 以換取一或多個 Reservation 購買。

擴充 預覽版
az reservations list

列出使用者目前租使用者中可存取的保留。

擴充 預覽版
az reservations reservation

保留。

擴充 預覽版
az reservations reservation-order

保留訂單。

擴充 預覽版
az reservations reservation-order-id

Reservations reservation-order-id。

擴充 預覽版
az reservations reservation-order-id list

Reservation列出套用至此訂用帳戶或此訂用帳戶下的資源群組適用的 。

擴充 預覽版
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 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 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}]"

選擇性參數

--no-wait

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

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

在此交換中傳回的保留清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 「??」 以顯示更多。

--ris-to-purchase

在此交換中購買的保留清單。 支援速記語法、json-file 和 yaml-file。 請嘗試 「??」 以顯示更多。

--sp-to-purchase

在此交換中購買的節省方案清單。 支援速記語法、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 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

選擇性參數

--no-wait

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

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

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

選擇性參數

--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 提供權杖值。

--next-token

標記,指定要開始分頁的位置。 這是先前截斷回應中的權杖值。

--orderby

可用來依保留屬性排序次序。

--selected-state

選取的布建狀態。

全域參數
--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 來取得完整偵錯記錄。