Skip to content

Commit 29c89c6

Browse files
committed
migrate workloads sapVirtualInstance to autorest v4
1 parent 098c011 commit 29c89c6

9 files changed

+76
-158
lines changed

src/Workloads/SapVirtualInstance.Autorest/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
2121
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
2222
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - SapVirtualInstance")]
23-
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0")]
24-
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0")]
23+
[assembly: System.Reflection.AssemblyFileVersionAttribute("0.1.0.0")]
24+
[assembly: System.Reflection.AssemblyVersionAttribute("0.1.0.0")]
2525
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
26-
[assembly: System.CLSCompliantAttribute(false)]
26+
[assembly: System.CLSCompliantAttribute(false)]

src/Workloads/SapVirtualInstance.Autorest/README.md

Lines changed: 35 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -44,39 +44,33 @@ root-module-name: $(prefix).Workloads
4444
title: SapVirtualInstance
4545
subject-prefix: Workloads
4646
namespace: Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance
47-
resourcegroup-append: true
48-
identity-correction-for-post: true
49-
nested-object-to-string: true
50-
#add-api-version-in-model-namespace: true
5147
inlining-threshold: 100
5248

53-
# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
54-
use-extension:
55-
"@autorest/powershell": "3.x"
56-
5749
directive:
58-
- where:
59-
verb: New
60-
subject: ^SapApplicationServerInstance$
61-
remove: true
62-
63-
- where:
64-
verb: Stop
65-
subject: ^SapApplicationServerInstance$
66-
variant: ^Stop$|^StopViaIdentity$
67-
remove: true
68-
69-
- where:
70-
verb: Update
71-
subject: ^SapApplicationServerInstance$
72-
variant: ^Update$|^UpdateViaIdentity$
50+
# #|^CreateViaJsonString$|^CreateViaJsonFilePath$
51+
# - where:
52+
# verb: New
53+
# subject: ^SapVirtualInstance$
54+
# variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^CreateExpanded$
55+
# remove: true
56+
57+
# - where:
58+
# verb: New
59+
# subject: ^SapVirtualInstance$
60+
# variant: ^CreateViaJsonString$|^CreateViaJsonFilePath$
61+
# set:
62+
# operation-name: SapVirtualInstancesCreateViaJsonAlt
63+
64+
- where:
65+
variant: ^(Stop|Update)(?!.*?(Expanded|JsonFilePath|JsonString))
7366
remove: true
7467

7568
- where:
76-
verb: Remove
77-
subject: ^SapApplicationServerInstance$
69+
verb: New|Remove
70+
subject: ^SapApplicationServerInstance$|^SapCentralServerInstance$|^SapDatabaseInstance$
7871
remove: true
7972

73+
#SapApplicationInstance
8074
- where:
8175
subject: SapApplicationServerInstance
8276
set:
@@ -89,28 +83,6 @@ directive:
8983
parameter-name: Name
9084

9185
# SapCentralInstance
92-
- where:
93-
verb: New
94-
subject: ^SapCentralServerInstance$
95-
remove: true
96-
97-
- where:
98-
verb: Stop
99-
subject: ^SapCentralServerInstance$
100-
variant: ^Stop$|^StopViaIdentity$
101-
remove: true
102-
103-
- where:
104-
verb: Update
105-
subject: ^SapCentralServerInstance$
106-
variant: ^Update$|^UpdateViaIdentity$
107-
remove: true
108-
109-
- where:
110-
verb: Remove
111-
subject: ^SapCentralServerInstance$
112-
remove: true
113-
11486
- where:
11587
subject: SapCentralServerInstance
11688
parameter-name: CentralInstanceName
@@ -124,58 +96,24 @@ directive:
12496
subject: SapCentralInstance
12597

12698
# SapDatabaseInstance
127-
- where:
128-
verb: New
129-
subject: ^SapDatabaseInstance$
130-
remove: true
131-
132-
- where:
133-
verb: Stop
134-
subject: ^SapDatabaseInstance$
135-
variant: ^Stop$|^StopViaIdentity$
136-
remove: true
137-
138-
- where:
139-
verb: Update
140-
subject: ^SapDatabaseInstance$
141-
variant: ^Update$|^UpdateViaIdentity$
142-
remove: true
143-
144-
- where:
145-
verb: Remove
146-
subject: ^SapDatabaseInstance$
147-
remove: true
148-
14999
- where:
150100
subject: SapDatabaseInstance
151101
parameter-name: DatabaseInstanceName
152102
set:
153103
parameter-name: Name
154104

155105
# SapVirtualInstance
156-
- where:
157-
verb: New
158-
subject: ^SapVirtualInstance$
159-
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$
160-
remove: true
161-
162-
- where:
163-
verb: New
164-
subject: ^SapVirtualInstance$
165-
variant: ^CreateExpanded$
166-
hide: true
167-
168-
- where:
169-
verb: Stop
170-
subject: ^SapVirtualInstance$
171-
variant: ^Stop$|^StopViaIdentity$
172-
remove: true
106+
# - where:
107+
# verb: New
108+
# subject: ^SapVirtualInstance$
109+
# variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^CreateExpanded$
110+
# remove: true
173111

174-
- where:
175-
verb: Update
176-
subject: ^SapVirtualInstance$
177-
variant: ^Update$|^UpdateViaIdentity$
178-
remove: true
112+
# - where:
113+
# subject: ^SapVirtualInstance$
114+
# variant: ^CreateViaJsonString$
115+
# set:
116+
# operation-name: SapVirtualInstancesCreateViaJsonAlt
179117

180118
- where:
181119
subject: ^SapVirtualInstance$
@@ -430,43 +368,22 @@ directive:
430368
# Result shoule be in SingleServerRecommendationResult and ThreeTierRecommendationResult
431369
- from: source-file-csharp
432370
where: $
433-
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api20231001Preview.ISapSizingRecommendationResult Property', 'public Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api20240901.ISapSizingRecommendationResult Property');
371+
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.ISapSizingRecommendationResult Property', 'public Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.ISapSizingRecommendationResult Property');
434372

435373
# remove System Data in module Monitor, ProviderInstance, SapApplicationServerInstance, SapCentralServerInstance, SapDatabaseInstance, SapLandscapeMonitor, SapVirtualInstance
436374
- from: SapApplicationServerInstance.cs
437375
where: $
438-
transform: $ = $.replace('public Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api30.ISystemData SystemData', 'internal Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api50.ISystemData SystemData');
376+
transform: $ = $.replace('public Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.ISystemData SystemData', 'internal Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.ISystemData SystemData');
439377
- from: SapCentralServerInstance.cs
440378
where: $
441-
transform: $ = $.replace('public Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api30.ISystemData SystemData', 'internal Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api50.ISystemData SystemData');
379+
transform: $ = $.replace('public Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.ISystemData SystemData', 'internal Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.ISystemData SystemData');
442380
- from: SapDatabaseInstance.cs
443381
where: $
444-
transform: $ = $.replace('public Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api30.ISystemData SystemData', 'internal Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api50.ISystemData SystemData');
382+
transform: $ = $.replace('public Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.ISystemData SystemData', 'internal Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.ISystemData SystemData');
445383
- from: SapLandscapeMonitor.cs
446384
where: $
447-
transform: $ = $.replace('public Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api30.ISystemData SystemData', 'internal Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api50.ISystemData SystemData');
385+
transform: $ = $.replace('public Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.ISystemData SystemData', 'internal Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.ISystemData SystemData');
448386
- from: SapVirtualInstance.cs
449387
where: $
450-
transform: $ = $.replace('public Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api30.ISystemData SystemData', 'internal Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.Api50.ISystemData SystemData');
451-
452-
- where:
453-
verb: Get|Start|Stop|Update
454-
subject: SapApplicationInstance|SapCentralInstance|SapDatabaseInstance|SapVirtualInstance
455-
set:
456-
preview-announcement:
457-
preview-message: "*****************************************************************************************\\r\\n* This cmdlet will undergo a breaking change in Az v15.0.0, to be released on November 19th 2025. *\\r\\n* At least one change applies to this cmdlet. *\\r\\n* See all possible breaking changes at https://go.microsoft.com/fwlink/?linkid=2333486 *\\r\\n**************************************************************************************************"
458-
459-
- where:
460-
verb: Invoke
461-
subject: SapDiskConfiguration|SapSizingRecommendation|SapSupportedSku
462-
set:
463-
preview-announcement:
464-
preview-message: "*****************************************************************************************\\r\\n* This cmdlet will undergo a breaking change in Az v15.0.0, to be released on November 19th 2025. *\\r\\n* At least one change applies to this cmdlet. *\\r\\n* See all possible breaking changes at https://go.microsoft.com/fwlink/?linkid=2333486 *\\r\\n**************************************************************************************************"
465-
466-
- where:
467-
verb: New
468-
subject: SapVirtualInstance
469-
set:
470-
preview-announcement:
471-
preview-message: "*****************************************************************************************\\r\\n* This cmdlet will undergo a breaking change in Az v15.0.0, to be released on November 19th 2025. *\\r\\n* At least one change applies to this cmdlet. *\\r\\n* See all possible breaking changes at https://go.microsoft.com/fwlink/?linkid=2333486 *\\r\\n**************************************************************************************************"
388+
transform: $ = $.replace('public Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.ISystemData SystemData', 'internal Microsoft.Azure.PowerShell.Cmdlets.Workloads.Models.ISystemData SystemData');
472389
```

src/Workloads/SapVirtualInstance.Autorest/custom/InvokeAzWorkloadsSapSizingRecommendation_InvokeExpanded.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ public partial class InvokeAzWorkloadsSapSizingRecommendation_InvokeExpanded : g
1919
{
2020
/// <summary>a delegate that is called when the remote service returns 200 (OK).</summary>
2121
/// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param>
22-
/// <param name="response">the body result as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.Api20240901.ISapSizingRecommendationResult">Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.Api20240901.ISapSizingRecommendationResult</see>
22+
/// <param name="response">the body result as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.ISapSizingRecommendationResult">Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.ISapSizingRecommendationResult</see>
2323
/// from the remote call</param>
2424
/// <returns>
2525
/// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the method is completed.
2626
/// </returns>
27-
partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.Api20240901.ISapSizingRecommendationResult> response, ref global::System.Threading.Tasks.Task<bool> returnNow)
27+
partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.ISapSizingRecommendationResult> response, ref global::System.Threading.Tasks.Task<bool> returnNow)
2828
{
2929
// onOk - response for 200 / application/json
30-
// should be Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.Api20240901.ISapSizingRecommendationResult
30+
// should be Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.ISapSizingRecommendationResult
3131
WriteObject(response.Result);
3232
returnNow = global::System.Threading.Tasks.Task.FromResult(true);
3333
}

src/Workloads/SapVirtualInstance.Autorest/custom/InvokeAzWorkloadsSapSizingRecommendation_InvokeViaIdentityExpanded.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ public partial class InvokeAzWorkloadsSapSizingRecommendation_InvokeViaIdentityE
1919
{
2020
/// <summary>a delegate that is called when the remote service returns 200 (OK).</summary>
2121
/// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param>
22-
/// <param name="response">the body result as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.Api20240901.ISapSizingRecommendationResult">Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.Api20240901.ISapSizingRecommendationResult</see>
22+
/// <param name="response">the body result as a <see cref="Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.ISapSizingRecommendationResult">Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.ISapSizingRecommendationResult</see>
2323
/// from the remote call</param>
2424
/// <returns>
2525
/// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the method is completed.
2626
/// </returns>
27-
partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.Api20240901.ISapSizingRecommendationResult> response, ref global::System.Threading.Tasks.Task<bool> returnNow)
27+
partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.ISapSizingRecommendationResult> response, ref global::System.Threading.Tasks.Task<bool> returnNow)
2828
{
2929
// onOk - response for 200 / application/json
30-
// (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.Api20240901.ISapSizingRecommendationResult
30+
// (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.ISapSizingRecommendationResult
3131
WriteObject(response.Result);
3232
returnNow = global::System.Threading.Tasks.Task.FromResult(true);
3333
}

src/Workloads/SapVirtualInstance.Autorest/custom/New-AzWorkloadsSapVirtualInstance/New-AzWorkloadsSapVirtualInstance_CreateWithDiscovery.ps1

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Creates a Virtual Instance for SAP solutions (VIS) resource
2525
{{ Add code here }}
2626
2727
.Outputs
28-
Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.Api20240901.ISapVirtualInstance
28+
Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.ISapVirtualInstance
2929
.Notes
3030
COMPLEX PARAMETER PROPERTIES
3131
@@ -37,12 +37,7 @@ CONFIGURATION <ISapConfiguration>: Defines if the SAP system is being created us
3737
https://learn.microsoft.com/powershell/module/az.workloads/new-azworkloadssapvirtualinstance
3838
#>
3939
function New-AzWorkloadsSapVirtualInstance {
40-
[Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Runtime.PreviewMessage("**********************************************************************************************`n
41-
* This cmdlet will undergo a breaking change in Az v15.0.0, to be released on November 19th 2025. *`n
42-
* At least one change applies to this cmdlet. *`n
43-
* See all possible breaking changes at https://go.microsoft.com/fwlink/?linkid=2333486 *`n
44-
***************************************************************************************************")]
45-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.Api20240901.ISapVirtualInstance])]
40+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.ISapVirtualInstance])]
4641
[Alias('New-AzVIS')]
4742
[CmdletBinding(DefaultParameterSetName='CreateWithDiscovery', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
4843
param(
@@ -120,14 +115,14 @@ function New-AzWorkloadsSapVirtualInstance {
120115

121116
[Parameter()]
122117
[Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Category('Body')]
123-
[Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.Api50.ITrackedResourceTags]))]
118+
[Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.ITrackedResourceTags]))]
124119
[System.Collections.Hashtable]
125120
# Resource tags.
126121
${Tag},
127122

128123
[Parameter()]
129124
[Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Category('Body')]
130-
[Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.Api50.IUserAssignedIdentities]))]
125+
[Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.IUserAssignedIdentities]))]
131126
[System.Collections.Hashtable]
132127
# User assigned identities dictionary
133128
${UserAssignedIdentity},
@@ -194,7 +189,7 @@ function New-AzWorkloadsSapVirtualInstance {
194189
process {
195190
try {
196191
$configuration = [Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Support.SapConfigurationType]::Discovery
197-
$discoveryConfiguration = [Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.Api20240901.DiscoveryConfiguration]::new();
192+
$discoveryConfiguration = [Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.DiscoveryConfiguration]::new();
198193
$discoveryConfiguration.ConfigurationType = $configuration
199194
$discoveryConfiguration.CentralServerVMId = $CentralServerVmId
200195
$null = $PSBoundParameters.Remove('CentralServerVmId')

0 commit comments

Comments
 (0)