共用方式為


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

ReservationOrder 的目錄(租使用者)和其下的所有 Reservation 變更為指定的租用戶標識碼。

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