Edit

Share via


Invoke-AzReservationReturn

Return a reservation and get refund information.

Syntax

PostExpanded (Default)

Invoke-AzReservationReturn
    -ReservationOrderId <String>
    -ReservationToReturnQuantity <Int32>
    -ReservationToReturnReservationId <String>
    -ReturnReason <String>
    -Scope <String>
    -SessionId <String>
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

PostViaJsonFilePath

Invoke-AzReservationReturn
    -ReservationOrderId <String>
    -JsonFilePath <String>
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

PostViaJsonString

Invoke-AzReservationReturn
    -ReservationOrderId <String>
    -JsonString <String>
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

PostViaIdentityExpanded

Invoke-AzReservationReturn
    -InputObject <IReservationsIdentity>
    -ReservationToReturnQuantity <Int32>
    -ReservationToReturnReservationId <String>
    -ReturnReason <String>
    -Scope <String>
    -SessionId <String>
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Return a reservation and get refund information.

Examples

Example 1: Return a reservation using the session ID obtained from calculateRefund command.

$orderId = "50000000-aaaa-bbbb-cccc-100000000003"
$fullyQualifiedId = "/providers/microsoft.capacity/reservationOrders/50000000-aaaa-bbbb-cccc-100000000003/reservations/30000000-aaaa-bbbb-cccc-100000000003"
$fullyQualifiedOrderId = "/providers/microsoft.capacity/reservationOrders/50000000-aaaa-bbbb-cccc-100000000003"

Invoke-AzReservationCalculateRefund -ReservationOrderId $orderId -ReservationToReturnQuantity 1 -ReservationToReturnReservationId $fullyQualifiedId  -Id $fullyQualifiedOrderId -Scope "Reservation"
ReservationOrderId                   DisplayName            Term State     Quantity Reservations
------------------                   -----------            ---- -----     -------- ------------
179ef21b-90ec-4fe4-9423-f794b856dfee VM_RI_08-20-2021_15-47 P3Y  Succeeded 1        {{…

Proceed reservations return with session ID obtained from Invoke-AzReservationCalculateRefund.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InputObject

Identity Parameter

Parameter properties

Type:IReservationsIdentity
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

PostViaIdentityExpanded
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-JsonFilePath

Path of Json file supplied to the Post operation

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

PostViaJsonFilePath
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-JsonString

Json string supplied to the Post operation

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

PostViaJsonString
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ReservationOrderId

Order Id of the reservation

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

PostExpanded
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
PostViaJsonFilePath
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
PostViaJsonString
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ReservationToReturnQuantity

Quantity to be returned. Must be greater than zero.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

PostExpanded
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
PostViaIdentityExpanded
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ReservationToReturnReservationId

Fully qualified identifier of the reservation being returned

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

PostExpanded
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
PostViaIdentityExpanded
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ReturnReason

The reason of returning the reservation

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

PostExpanded
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
PostViaIdentityExpanded
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Scope

The scope of this return, e.g. Reservation.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

PostExpanded
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
PostViaIdentityExpanded
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SessionId

The session id obtained from Invoke-AzReservationCalculateRefund..

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

PostExpanded
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
PostViaIdentityExpanded
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

IReservationsIdentity

Outputs

IReservationOrderResponse