From dc472509404e32b5c463e7b3425ad82db6f4b02b Mon Sep 17 00:00:00 2001 From: azure-powershell-bot <65331932+azure-powershell-bot@users.noreply.github.com> Date: Tue, 14 Mar 2023 03:12:50 +0000 Subject: [PATCH 1/2] Move Reservations to main --- src/Reservations/Az.Reservations.psd1 | 2 +- src/Reservations/README.md | 13 ++++ src/Reservations/Reservations.sln | 70 +++++++++---------- .../examples/Invoke-AzReservationReturn.md | 40 +---------- .../exports/Get-AzReservation.ps1 | 22 +++--- .../exports/ProxyCmdletDefinitions.ps1 | 22 +++--- src/Reservations/generate-info.json | 2 +- .../cmdlets/GetAzReservation_List1.cs | 21 +++++- src/Reservations/help/Get-AzReservation.md | 55 ++++++--------- .../help/Invoke-AzReservationReturn.md | 40 +---------- 10 files changed, 110 insertions(+), 177 deletions(-) diff --git a/src/Reservations/Az.Reservations.psd1 b/src/Reservations/Az.Reservations.psd1 index adaf79931134..2414e9ee4b26 100644 --- a/src/Reservations/Az.Reservations.psd1 +++ b/src/Reservations/Az.Reservations.psd1 @@ -3,7 +3,7 @@ # # Generated by: Microsoft Corporation # -# Generated on: 3/13/2023 +# Generated on: 3/14/2023 # @{ diff --git a/src/Reservations/README.md b/src/Reservations/README.md index 2aec5578c655..95a86e99c03c 100644 --- a/src/Reservations/README.md +++ b/src/Reservations/README.md @@ -204,6 +204,13 @@ directive: subject-prefix: Reservation subject: Return hide: true + + ### Hide command parameter + - where: + verb: Get + subject: Reservation + parameter-name: Skiptoken|Take|RefreshSummary + hide: true ### Rename property name - where: @@ -434,6 +441,12 @@ directive: model-name: RefundResponse set: suppress-format: true + + - where: + verb: Get + variant: ^List1(.*) + set: + clientside-pagination: true - no-inline: - Price diff --git a/src/Reservations/Reservations.sln b/src/Reservations/Reservations.sln index 5ee9841c3f43..f0836c3cffae 100644 --- a/src/Reservations/Reservations.sln +++ b/src/Reservations/Reservations.sln @@ -3,19 +3,19 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.31903.59 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Accounts", "..\Accounts\Accounts\Accounts.csproj", "{1177B5F0-C049-4A3F-A470-3670889E8450}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Accounts", "..\Accounts\Accounts\Accounts.csproj", "{14B788BB-1062-41A3-B03C-AF1B2DF2D961}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssemblyLoading", "..\Accounts\AssemblyLoading\AssemblyLoading.csproj", "{6AD85668-D55E-4756-817C-6A2F2126741F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssemblyLoading", "..\Accounts\AssemblyLoading\AssemblyLoading.csproj", "{152F59C4-3EFA-4C9F-89CF-9B09CE32AD40}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication", "..\Accounts\Authentication\Authentication.csproj", "{C19E6B79-6484-4A73-B1DF-26699372E87A}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication", "..\Accounts\Authentication\Authentication.csproj", "{43D81BEF-08CD-484D-916C-8CCB74DCEAD3}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication.ResourceManager", "..\Accounts\Authentication.ResourceManager\Authentication.ResourceManager.csproj", "{259997FB-AB09-499F-AE7C-7A052F8600EF}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authentication.ResourceManager", "..\Accounts\Authentication.ResourceManager\Authentication.ResourceManager.csproj", "{0B9A8D52-FBB5-4F46-BCC6-A2DDFE9ECBE5}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthenticationAssemblyLoadContext", "..\Accounts\AuthenticationAssemblyLoadContext\AuthenticationAssemblyLoadContext.csproj", "{2B01E114-6EC5-4A14-90D1-50A4ADA431EC}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthenticationAssemblyLoadContext", "..\Accounts\AuthenticationAssemblyLoadContext\AuthenticationAssemblyLoadContext.csproj", "{65B22626-3659-48F4-88F3-AC04DD59A2BA}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authenticators", "..\Accounts\Authenticators\Authenticators.csproj", "{7CDBCF71-514C-456C-9522-0788F74D806E}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Authenticators", "..\Accounts\Authenticators\Authenticators.csproj", "{AF527A31-6CD5-4AFF-B55B-88CF539E08A0}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.Reservations", "Az.Reservations.csproj", "{52BEE358-2F42-4573-8DB7-3F12D9E5C8FC}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Az.Reservations", "Az.Reservations.csproj", "{CF21494E-914E-4B33-A201-C148F5220349}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -26,33 +26,33 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {1177B5F0-C049-4A3F-A470-3670889E8450}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1177B5F0-C049-4A3F-A470-3670889E8450}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1177B5F0-C049-4A3F-A470-3670889E8450}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1177B5F0-C049-4A3F-A470-3670889E8450}.Release|Any CPU.Build.0 = Release|Any CPU - {6AD85668-D55E-4756-817C-6A2F2126741F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6AD85668-D55E-4756-817C-6A2F2126741F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6AD85668-D55E-4756-817C-6A2F2126741F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6AD85668-D55E-4756-817C-6A2F2126741F}.Release|Any CPU.Build.0 = Release|Any CPU - {C19E6B79-6484-4A73-B1DF-26699372E87A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C19E6B79-6484-4A73-B1DF-26699372E87A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C19E6B79-6484-4A73-B1DF-26699372E87A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C19E6B79-6484-4A73-B1DF-26699372E87A}.Release|Any CPU.Build.0 = Release|Any CPU - {259997FB-AB09-499F-AE7C-7A052F8600EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {259997FB-AB09-499F-AE7C-7A052F8600EF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {259997FB-AB09-499F-AE7C-7A052F8600EF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {259997FB-AB09-499F-AE7C-7A052F8600EF}.Release|Any CPU.Build.0 = Release|Any CPU - {2B01E114-6EC5-4A14-90D1-50A4ADA431EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2B01E114-6EC5-4A14-90D1-50A4ADA431EC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2B01E114-6EC5-4A14-90D1-50A4ADA431EC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2B01E114-6EC5-4A14-90D1-50A4ADA431EC}.Release|Any CPU.Build.0 = Release|Any CPU - {7CDBCF71-514C-456C-9522-0788F74D806E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7CDBCF71-514C-456C-9522-0788F74D806E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7CDBCF71-514C-456C-9522-0788F74D806E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7CDBCF71-514C-456C-9522-0788F74D806E}.Release|Any CPU.Build.0 = Release|Any CPU - {52BEE358-2F42-4573-8DB7-3F12D9E5C8FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {52BEE358-2F42-4573-8DB7-3F12D9E5C8FC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {52BEE358-2F42-4573-8DB7-3F12D9E5C8FC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {52BEE358-2F42-4573-8DB7-3F12D9E5C8FC}.Release|Any CPU.Build.0 = Release|Any CPU + {14B788BB-1062-41A3-B03C-AF1B2DF2D961}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {14B788BB-1062-41A3-B03C-AF1B2DF2D961}.Debug|Any CPU.Build.0 = Debug|Any CPU + {14B788BB-1062-41A3-B03C-AF1B2DF2D961}.Release|Any CPU.ActiveCfg = Release|Any CPU + {14B788BB-1062-41A3-B03C-AF1B2DF2D961}.Release|Any CPU.Build.0 = Release|Any CPU + {152F59C4-3EFA-4C9F-89CF-9B09CE32AD40}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {152F59C4-3EFA-4C9F-89CF-9B09CE32AD40}.Debug|Any CPU.Build.0 = Debug|Any CPU + {152F59C4-3EFA-4C9F-89CF-9B09CE32AD40}.Release|Any CPU.ActiveCfg = Release|Any CPU + {152F59C4-3EFA-4C9F-89CF-9B09CE32AD40}.Release|Any CPU.Build.0 = Release|Any CPU + {43D81BEF-08CD-484D-916C-8CCB74DCEAD3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {43D81BEF-08CD-484D-916C-8CCB74DCEAD3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {43D81BEF-08CD-484D-916C-8CCB74DCEAD3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {43D81BEF-08CD-484D-916C-8CCB74DCEAD3}.Release|Any CPU.Build.0 = Release|Any CPU + {0B9A8D52-FBB5-4F46-BCC6-A2DDFE9ECBE5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0B9A8D52-FBB5-4F46-BCC6-A2DDFE9ECBE5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0B9A8D52-FBB5-4F46-BCC6-A2DDFE9ECBE5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0B9A8D52-FBB5-4F46-BCC6-A2DDFE9ECBE5}.Release|Any CPU.Build.0 = Release|Any CPU + {65B22626-3659-48F4-88F3-AC04DD59A2BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {65B22626-3659-48F4-88F3-AC04DD59A2BA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {65B22626-3659-48F4-88F3-AC04DD59A2BA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {65B22626-3659-48F4-88F3-AC04DD59A2BA}.Release|Any CPU.Build.0 = Release|Any CPU + {AF527A31-6CD5-4AFF-B55B-88CF539E08A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AF527A31-6CD5-4AFF-B55B-88CF539E08A0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AF527A31-6CD5-4AFF-B55B-88CF539E08A0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AF527A31-6CD5-4AFF-B55B-88CF539E08A0}.Release|Any CPU.Build.0 = Release|Any CPU + {CF21494E-914E-4B33-A201-C148F5220349}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CF21494E-914E-4B33-A201-C148F5220349}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CF21494E-914E-4B33-A201-C148F5220349}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CF21494E-914E-4B33-A201-C148F5220349}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection EndGlobal diff --git a/src/Reservations/examples/Invoke-AzReservationReturn.md b/src/Reservations/examples/Invoke-AzReservationReturn.md index 73cd5eac1eb0..9f356a0c638a 100644 --- a/src/Reservations/examples/Invoke-AzReservationReturn.md +++ b/src/Reservations/examples/Invoke-AzReservationReturn.md @@ -8,42 +8,8 @@ Invoke-AzReservationCalculateRefund -ReservationOrderId $orderId -ReservationToR ``` ```output -BillingInformationBillingCurrencyProratedAmount : { - "currencyCode": "USD", - "amount": 12.9 - } -BillingInformationBillingCurrencyRemainingCommitmentAmount : { - "currencyCode": "USD", - "amount": 18.06 - } -BillingInformationBillingCurrencyTotalPaidAmount : { - "currencyCode": "USD", - "amount": 15.48 - } -BillingInformationBillingPlan : Monthly -BillingInformationCompletedTransaction : 5 -BillingInformationTotalTransaction : 12 -BillingRefundAmount : { - "currencyCode": "USD", - "amount": 2.58 - } -ConsumedRefundsTotal : { - "currencyCode": "USD", - "amount": 368.23 - } -Id : /providers/microsoft.capacity/reservationOrders/50000000-aaaa-bbbb-cccc-100000000003/reservations/30000000-aaaa-bbbb-cccc-100000000003 -Location : -MaxRefundLimit : { - "currencyCode": "USD", - "amount": 50000 - } -PolicyError : {} -PricingRefundAmount : { - "currencyCode": "USD", - "amount": 2.58 - } -Quantity : 1 -ResourceGroupName : -SessionId : 93fe5df2-d888-47c5-b00c-cd0ccb1f29b9 +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. diff --git a/src/Reservations/exports/Get-AzReservation.ps1 b/src/Reservations/exports/Get-AzReservation.ps1 index 97e1b46843fa..f3a5e9c9f977 100644 --- a/src/Reservations/exports/Get-AzReservation.ps1 +++ b/src/Reservations/exports/Get-AzReservation.ps1 @@ -89,12 +89,6 @@ param( # May be used to sort order by reservation properties. ${Orderby}, - [Parameter(ParameterSetName='List1')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Query')] - [System.String] - # To indicate whether to refresh the roll up counts of the reservations group by provisioning states - ${RefreshSummary}, - [Parameter(ParameterSetName='List1')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Query')] [System.String] @@ -102,16 +96,16 @@ param( ${SelectedState}, [Parameter(ParameterSetName='List1')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Query')] - [System.Single] - # The number of reservations to skip from the list before returning results - ${Skiptoken}, + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.UInt64] + # Gets only the first 'n' objects. + ${First}, [Parameter(ParameterSetName='List1')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Query')] - [System.Single] - # To number of reservations to return - ${Take}, + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.UInt64] + # Ignores the first 'n' objects and then gets the remaining objects. + ${Skip}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] diff --git a/src/Reservations/exports/ProxyCmdletDefinitions.ps1 b/src/Reservations/exports/ProxyCmdletDefinitions.ps1 index edd31100483e..962cfa1b1851 100644 --- a/src/Reservations/exports/ProxyCmdletDefinitions.ps1 +++ b/src/Reservations/exports/ProxyCmdletDefinitions.ps1 @@ -1315,12 +1315,6 @@ param( # May be used to sort order by reservation properties. ${Orderby}, - [Parameter(ParameterSetName='List1')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Query')] - [System.String] - # To indicate whether to refresh the roll up counts of the reservations group by provisioning states - ${RefreshSummary}, - [Parameter(ParameterSetName='List1')] [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Query')] [System.String] @@ -1328,16 +1322,16 @@ param( ${SelectedState}, [Parameter(ParameterSetName='List1')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Query')] - [System.Single] - # The number of reservations to skip from the list before returning results - ${Skiptoken}, + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.UInt64] + # Gets only the first 'n' objects. + ${First}, [Parameter(ParameterSetName='List1')] - [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Query')] - [System.Single] - # To number of reservations to return - ${Take}, + [Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category('Body')] + [System.UInt64] + # Ignores the first 'n' objects and then gets the remaining objects. + ${Skip}, [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] diff --git a/src/Reservations/generate-info.json b/src/Reservations/generate-info.json index e38cc9677b33..b3c6ab4f615b 100644 --- a/src/Reservations/generate-info.json +++ b/src/Reservations/generate-info.json @@ -1,5 +1,5 @@ { - "swagger_commit": "ba9f30eed00b61ebb1ceedecd65a8ce82c81609b", + "swagger_commit": "d4dfb3388ab40185cf302512268ad1406f666d64", "node": "v14.15.5", "autorest": "`-- (empty)", "autorest_core": "3.9.4", diff --git a/src/Reservations/generated/cmdlets/GetAzReservation_List1.cs b/src/Reservations/generated/cmdlets/GetAzReservation_List1.cs index dfc90d02e857..8dd384e92d8c 100644 --- a/src/Reservations/generated/cmdlets/GetAzReservation_List1.cs +++ b/src/Reservations/generated/cmdlets/GetAzReservation_List1.cs @@ -15,7 +15,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.Reservations.Cmdlets /// /// [OpenAPI] ListAll=>GET:"/providers/Microsoft.Capacity/reservations" /// - [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzReservation_List1")] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzReservation_List1", SupportsPaging = true)] [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Reservations.Models.Api20221101.IReservationResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Description(@"List the reservations and the roll up counts of reservations group by provisioning states that the user has access to in the current tenant.")] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Generated] @@ -150,6 +150,7 @@ public partial class GetAzReservation_List1 : global::System.Management.Automati Description = @"To indicate whether to refresh the roll up counts of the reservations group by provisioning states", SerializedName = @"refreshSummary", PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotExport] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Query)] public string RefreshSummary { get => this._refreshSummary; set => this._refreshSummary = value; } @@ -178,6 +179,7 @@ public partial class GetAzReservation_List1 : global::System.Management.Automati Description = @"The number of reservations to skip from the list before returning results", SerializedName = @"$skiptoken", PossibleTypes = new [] { typeof(float) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotExport] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Query)] public float Skiptoken { get => this._skiptoken; set => this._skiptoken = value; } @@ -192,6 +194,7 @@ public partial class GetAzReservation_List1 : global::System.Management.Automati Description = @"To number of reservations to return", SerializedName = @"take", PossibleTypes = new [] { typeof(float) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.DoNotExport] [global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Reservations.ParameterCategory.Query)] public float Take { get => this._take; set => this._take = value; } @@ -447,15 +450,27 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // clientside pagination enabled // response should be returning an array of some kind. +Pageable // pageable / value / nextLink var result = await response; - WriteObject(result.Value,true); + if ((ulong)result.Value.Length <= this.PagingParameters.Skip) + { + this.PagingParameters.Skip = this.PagingParameters.Skip - (ulong)result.Value.Length; + } + else + { + ulong toRead = Math.Min(this.PagingParameters.First, (ulong)result.Value.Length - this.PagingParameters.Skip); + var requiredResult = result.Value.SubArray((int)this.PagingParameters.Skip, (int)toRead); + WriteObject(requiredResult, true); + this.PagingParameters.Skip = 0; + this.PagingParameters.First = this.PagingParameters.First <= toRead ? 0 : this.PagingParameters.First - toRead; + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (_nextLink != null && this.PagingParameters.First > 0) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/src/Reservations/help/Get-AzReservation.md b/src/Reservations/help/Get-AzReservation.md index 7a5c581f75c9..2e9b91c52f33 100644 --- a/src/Reservations/help/Get-AzReservation.md +++ b/src/Reservations/help/Get-AzReservation.md @@ -14,8 +14,8 @@ Get specific `Reservation` details. ### List1 (Default) ``` -Get-AzReservation [-Filter ] [-Orderby ] [-RefreshSummary ] [-SelectedState ] - [-Skiptoken ] [-Take ] [-DefaultProfile ] [] +Get-AzReservation [-Filter ] [-Orderby ] [-SelectedState ] [-First ] + [-Skip ] [-DefaultProfile ] [] ``` ### Get @@ -125,6 +125,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -First +Gets only the first 'n' objects. + +```yaml +Type: System.UInt64 +Parameter Sets: List1 +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Id Id of the reservation item @@ -186,21 +201,6 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -RefreshSummary -To indicate whether to refresh the roll up counts of the reservations group by provisioning states - -```yaml -Type: System.String -Parameter Sets: List1 -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -SelectedState The selected provisioning state @@ -216,26 +216,11 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Skiptoken -The number of reservations to skip from the list before returning results - -```yaml -Type: System.Single -Parameter Sets: List1 -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Take -To number of reservations to return +### -Skip +Ignores the first 'n' objects and then gets the remaining objects. ```yaml -Type: System.Single +Type: System.UInt64 Parameter Sets: List1 Aliases: diff --git a/src/Reservations/help/Invoke-AzReservationReturn.md b/src/Reservations/help/Invoke-AzReservationReturn.md index 6db11e40eb60..5fb4c514e555 100644 --- a/src/Reservations/help/Invoke-AzReservationReturn.md +++ b/src/Reservations/help/Invoke-AzReservationReturn.md @@ -53,43 +53,9 @@ Invoke-AzReservationCalculateRefund -ReservationOrderId $orderId -ReservationToR ``` ```output -BillingInformationBillingCurrencyProratedAmount : { - "currencyCode": "USD", - "amount": 12.9 - } -BillingInformationBillingCurrencyRemainingCommitmentAmount : { - "currencyCode": "USD", - "amount": 18.06 - } -BillingInformationBillingCurrencyTotalPaidAmount : { - "currencyCode": "USD", - "amount": 15.48 - } -BillingInformationBillingPlan : Monthly -BillingInformationCompletedTransaction : 5 -BillingInformationTotalTransaction : 12 -BillingRefundAmount : { - "currencyCode": "USD", - "amount": 2.58 - } -ConsumedRefundsTotal : { - "currencyCode": "USD", - "amount": 368.23 - } -Id : /providers/microsoft.capacity/reservationOrders/50000000-aaaa-bbbb-cccc-100000000003/reservations/30000000-aaaa-bbbb-cccc-100000000003 -Location : -MaxRefundLimit : { - "currencyCode": "USD", - "amount": 50000 - } -PolicyError : {} -PricingRefundAmount : { - "currencyCode": "USD", - "amount": 2.58 - } -Quantity : 1 -ResourceGroupName : -SessionId : 93fe5df2-d888-47c5-b00c-cd0ccb1f29b9 +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. From 8ffd94f90824d3123e37d16f83288b72c792c976 Mon Sep 17 00:00:00 2001 From: Yabo Hu Date: Tue, 14 Mar 2023 11:23:05 +0800 Subject: [PATCH 2/2] Update Changelog.md --- src/Reservations/Changelog.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Reservations/Changelog.md b/src/Reservations/Changelog.md index 9038d50df8b7..f2ec607383d6 100644 --- a/src/Reservations/Changelog.md +++ b/src/Reservations/Changelog.md @@ -19,6 +19,8 @@ --> ## Upcoming Release * Added cmdlet `Invoke-AzReservationReturn` +* Removed parameters `RefreshSummary`, `Skiptoken`, `Take` from cmdlet `Get-AzReservation` +* Added parameters `First`, `Skip` for cmdlet `Get-AzReservation` ## Version 0.11.0 * Added new commands to CalculateRefund and Return reservation