Κοινή χρήση μέσω


az reservations

Note

This reference is part of the reservation extension for the Azure CLI (version 2.50.0 or higher). The extension will automatically install the first time you run an az reservations command. Learn more about extensions.

This command group is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Azure Reservations.

Commands

Name Description Type Status
az reservations calculate-exchange

Calculates price for exchanging Reservations if there are no policy errors.

Extension Preview
az reservations catalog

Reservations catalog.

Extension Preview
az reservations catalog show

Get catalog of available reservation.

Extension Preview
az reservations exchange

Returns one or more Reservations in exchange for one or more Reservation purchases.

Extension Preview
az reservations list

List the reservations that the user has access to in the current tenant.

Extension Preview
az reservations reservation

Reservations reservation.

Extension Preview
az reservations reservation-order

Reservations reservation-order.

Extension Preview
az reservations reservation-order-id

Reservations reservation-order-id.

Extension Preview
az reservations reservation-order-id list

List applicable Reservations that are applied to this subscription or a resource group under this subscription.

Extension Preview
az reservations reservation-order calculate

Calculate price for placing a ReservationOrder.

Extension Preview
az reservations reservation-order calculate-refund

Calculate price for returning Reservations if there are no policy errors.

Extension Preview
az reservations reservation-order change-directory

Change directory (tenant) of ReservationOrder and all Reservation under it to specified tenant id.

Extension Preview
az reservations reservation-order list

List of all the ReservationOrders that the user has access to in the current tenant.

Extension Preview
az reservations reservation-order purchase

Create ReservationOrder and create resource under the specified URI.

Extension Preview
az reservations reservation-order return

Return a reservation.

Extension Preview
az reservations reservation-order show

Get the details of the ReservationOrder.

Extension Preview
az reservations reservation-order wait

Place the CLI in a waiting state until a condition is met.

Extension Preview
az reservations reservation archive

Archiving a Reservation which is in cancelled/expired state and move it to Archived state.

Extension Preview
az reservations reservation list

List Reservations within a single ReservationOrder.

Extension Preview
az reservations reservation list-available-scope

List Available Scopes for Reservation.

Extension Preview
az reservations reservation list-history

List of all the revisions for the Reservation.

Extension Preview
az reservations reservation merge

Merge the specified Reservations into a new Reservation. The two Reservations being merged must have same properties.

Extension Preview
az reservations reservation show

Get specific Reservation details.

Extension Preview
az reservations reservation split

Split a Reservation into two Reservations with specified quantity distribution.

Extension Preview
az reservations reservation unarchive

Unarchiving a Reservation moves it to the state it was before archiving.

Extension Preview
az reservations reservation update

Update the applied scopes, renewal, name, instance-flexibility of the Reservation.

Extension Preview
az reservations reservation wait

Place the CLI in a waiting state until a condition is met.

Extension Preview

az reservations calculate-exchange

Preview

Command group 'reservations' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Calculates price for exchanging Reservations if there are no policy errors.

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]

Examples

Calculate exchange

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}]"

Optional Parameters

--no-wait

Do not wait for the long-running operation to finish.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--ris-to-exchange

List of reservations that are being returned in this exchange. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--ris-to-purchase

List of reservations that are being purchased in this exchange. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--sp-to-purchase

List of savings plans that are being purchased in this exchange. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az reservations exchange

Preview

Command group 'reservations' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Returns one or more Reservations in exchange for one or more Reservation purchases.

az reservations exchange [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                         [--session-id]

Examples

Exchange reservations

az reservations exchange --session-id 40000000-aaaa-bbbb-cccc-200000000012

Optional Parameters

--no-wait

Do not wait for the long-running operation to finish.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--session-id

SessionId that was returned by CalculateExchange API.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az reservations list

Preview

Command group 'reservations' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

List the reservations that the user has access to in the current tenant.

az reservations list [--filter]
                     [--max-items]
                     [--next-token]
                     [--orderby]
                     [--selected-state]

Examples

List reservations under the current tenant

az reservations list

List reservation which has "Failed" state under the current tenant

az reservations list --selected-state "Failed"

List all "VirtualMachines" reservations under the current tenant

az az reservations list --filter "properties/reservedResourceType eq 'VirtualMachines'"

List reservation and order the result by quantity in descending order

az reservations list --orderby 'properties/quantity desc'

Optional Parameters

--filter

May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does not currently support 'ne', 'gt', 'le', 'ge', or 'not'. Reservation properties include sku/name, properties/{appliedScopeType, archived, displayName, displayProvisioningState, effectiveDateTime, expiryDate, provisioningState, quantity, renew, reservedResourceType, term, userFriendlyAppliedScopeType, userFriendlyRenewState}.

--max-items

Total number of items to return in the command's output. If the total number of items available is more than the value specified, a token is provided in the command's output. To resume pagination, provide the token value in --next-token argument of a subsequent command.

--next-token

Token to specify where to start paginating. This is the token value from a previously truncated response.

--orderby

May be used to sort order by reservation properties.

--selected-state

The selected provisioning state.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.