Skip to content

Commit ad252cc

Browse files
committed
update custom code
1 parent 29c89c6 commit ad252cc

File tree

36 files changed

+1328
-544
lines changed

36 files changed

+1328
-544
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("0.1.0.0")]
24-
[assembly: System.Reflection.AssemblyVersionAttribute("0.1.0.0")]
23+
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0")]
24+
[assembly: System.Reflection.AssemblyVersionAttribute("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: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,6 @@ namespace: Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance
4747
inlining-threshold: 100
4848

4949
directive:
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-
6450
- where:
6551
variant: ^(Stop|Update)(?!.*?(Expanded|JsonFilePath|JsonString))
6652
remove: true
@@ -103,17 +89,17 @@ directive:
10389
parameter-name: Name
10490

10591
# SapVirtualInstance
106-
# - where:
107-
# verb: New
108-
# subject: ^SapVirtualInstance$
109-
# variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^CreateExpanded$
110-
# remove: true
111-
112-
# - where:
113-
# subject: ^SapVirtualInstance$
114-
# variant: ^CreateViaJsonString$
115-
# set:
116-
# operation-name: SapVirtualInstancesCreateViaJsonAlt
92+
- where:
93+
verb: New
94+
subject: ^SapVirtualInstance$
95+
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$
96+
remove: true
97+
98+
- where:
99+
verb: New
100+
subject: ^SapVirtualInstance$
101+
variant: ^CreateExpanded$
102+
hide: true
117103

118104
- where:
119105
subject: ^SapVirtualInstance$

src/Workloads/SapVirtualInstance.Autorest/UX/Microsoft.Workloads/sapVirtualInstances-applicationInstances.json

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -47,49 +47,6 @@
4747
]
4848
}
4949
]
50-
},
51-
{
52-
"name": "Start-AzWorkloadsSapApplicationInstance",
53-
"description": "Starts the SAP Application Server Instance.",
54-
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}/start",
55-
"help": {
56-
"learnMore": {
57-
"url": "https://learn.microsoft.com/powershell/module/az.workloads/start-azworkloadssapapplicationinstance"
58-
},
59-
"parameterSets": [
60-
{
61-
"parameters": [
62-
"-Name <String>",
63-
"-ResourceGroupName <String>",
64-
"-SapVirtualInstanceName <String>",
65-
"[-SubscriptionId <String>]"
66-
]
67-
}
68-
]
69-
},
70-
"examples": [
71-
{
72-
"description": "Starts the SAP Application Server Instance.",
73-
"parameters": [
74-
{
75-
"name": "-Name",
76-
"value": "[Path.applicationInstanceName]"
77-
},
78-
{
79-
"name": "-ResourceGroupName",
80-
"value": "[Path.resourceGroupName]"
81-
},
82-
{
83-
"name": "-SapVirtualInstanceName",
84-
"value": "[Path.sapVirtualInstanceName]"
85-
},
86-
{
87-
"name": "-SubscriptionId",
88-
"value": "[Path.subscriptionId]"
89-
}
90-
]
91-
}
92-
]
9350
}
9451
]
9552
}

src/Workloads/SapVirtualInstance.Autorest/UX/Microsoft.Workloads/sapVirtualInstances-centralInstances.json

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -47,49 +47,6 @@
4747
]
4848
}
4949
]
50-
},
51-
{
52-
"name": "Start-AzWorkloadsSapCentralInstance",
53-
"description": "Starts the SAP Central Services Instance.",
54-
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}/start",
55-
"help": {
56-
"learnMore": {
57-
"url": "https://learn.microsoft.com/powershell/module/az.workloads/start-azworkloadssapcentralinstance"
58-
},
59-
"parameterSets": [
60-
{
61-
"parameters": [
62-
"-Name <String>",
63-
"-ResourceGroupName <String>",
64-
"-SapVirtualInstanceName <String>",
65-
"[-SubscriptionId <String>]"
66-
]
67-
}
68-
]
69-
},
70-
"examples": [
71-
{
72-
"description": "Starts the SAP Central Services Instance.",
73-
"parameters": [
74-
{
75-
"name": "-Name",
76-
"value": "[Path.centralInstanceName]"
77-
},
78-
{
79-
"name": "-ResourceGroupName",
80-
"value": "[Path.resourceGroupName]"
81-
},
82-
{
83-
"name": "-SapVirtualInstanceName",
84-
"value": "[Path.sapVirtualInstanceName]"
85-
},
86-
{
87-
"name": "-SubscriptionId",
88-
"value": "[Path.subscriptionId]"
89-
}
90-
]
91-
}
92-
]
9350
}
9451
]
9552
}

src/Workloads/SapVirtualInstance.Autorest/UX/Microsoft.Workloads/sapVirtualInstances-databaseInstances.json

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -47,49 +47,6 @@
4747
]
4848
}
4949
]
50-
},
51-
{
52-
"name": "Start-AzWorkloadsSapDatabaseInstance",
53-
"description": "Starts the database instance of the SAP system.",
54-
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}/start",
55-
"help": {
56-
"learnMore": {
57-
"url": "https://learn.microsoft.com/powershell/module/az.workloads/start-azworkloadssapdatabaseinstance"
58-
},
59-
"parameterSets": [
60-
{
61-
"parameters": [
62-
"-Name <String>",
63-
"-ResourceGroupName <String>",
64-
"-SapVirtualInstanceName <String>",
65-
"[-SubscriptionId <String>]"
66-
]
67-
}
68-
]
69-
},
70-
"examples": [
71-
{
72-
"description": "Starts the database instance of the SAP system.",
73-
"parameters": [
74-
{
75-
"name": "-Name",
76-
"value": "[Path.databaseInstanceName]"
77-
},
78-
{
79-
"name": "-ResourceGroupName",
80-
"value": "[Path.resourceGroupName]"
81-
},
82-
{
83-
"name": "-SapVirtualInstanceName",
84-
"value": "[Path.sapVirtualInstanceName]"
85-
},
86-
{
87-
"name": "-SubscriptionId",
88-
"value": "[Path.subscriptionId]"
89-
}
90-
]
91-
}
92-
]
9350
}
9451
]
9552
}

src/Workloads/SapVirtualInstance.Autorest/UX/Microsoft.Workloads/sapVirtualInstances.json

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -80,44 +80,6 @@
8080
]
8181
}
8282
]
83-
},
84-
{
85-
"name": "Start-AzWorkloadsSapVirtualInstance",
86-
"description": "Starts the SAP application, that is the Central Services instance and Application server instances.",
87-
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/start",
88-
"help": {
89-
"learnMore": {
90-
"url": "https://learn.microsoft.com/powershell/module/az.workloads/start-azworkloadssapvirtualinstance"
91-
},
92-
"parameterSets": [
93-
{
94-
"parameters": [
95-
"-Name <String>",
96-
"-ResourceGroupName <String>",
97-
"[-SubscriptionId <String>]"
98-
]
99-
}
100-
]
101-
},
102-
"examples": [
103-
{
104-
"description": "Starts the SAP application, that is the Central Services instance and Application server instances.",
105-
"parameters": [
106-
{
107-
"name": "-Name",
108-
"value": "[Path.sapVirtualInstanceName]"
109-
},
110-
{
111-
"name": "-ResourceGroupName",
112-
"value": "[Path.resourceGroupName]"
113-
},
114-
{
115-
"name": "-SubscriptionId",
116-
"value": "[Path.subscriptionId]"
117-
}
118-
]
119-
}
120-
]
12183
}
12284
]
12385
}

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

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ function New-AzWorkloadsSapVirtualInstance {
7575
${ManagedRgStorageAccountName},
7676

7777
[Parameter(Mandatory)]
78-
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Support.SapEnvironmentType])]
78+
[Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.PSArgumentCompleterAttribute("NonProd", "Prod")]
7979
[Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Category('Body')]
80-
[Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Support.SapEnvironmentType]
80+
[System.String]
8181
# Defines the environment type - Production/Non Production.
8282
${Environment},
8383

@@ -88,18 +88,17 @@ function New-AzWorkloadsSapVirtualInstance {
8888
${Location},
8989

9090
[Parameter(Mandatory)]
91-
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Support.SapProductType])]
91+
[Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.PSArgumentCompleterAttribute("ECC", "S4HANA", "Other")]
9292
[Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Category('Body')]
93-
[Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Support.SapProductType]
93+
[System.String]
9494
# Defines the SAP Product type.
9595
${SapProduct},
9696

9797
[Parameter()]
98-
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Support.ManagedServiceIdentityType])]
9998
[Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Category('Body')]
100-
[Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Support.ManagedServiceIdentityType]
101-
# Type of manage identity
102-
${IdentityType},
99+
[System.Management.Automation.SwitchParameter]
100+
# Determines whether to enable a system-assigned identity for the resource.
101+
${EnableSystemAssignedIdentity},
103102

104103
[Parameter()]
105104
[Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Category('Body')]
@@ -119,12 +118,13 @@ function New-AzWorkloadsSapVirtualInstance {
119118
[System.Collections.Hashtable]
120119
# Resource tags.
121120
${Tag},
122-
121+
123122
[Parameter()]
123+
[AllowEmptyCollection()]
124124
[Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Category('Body')]
125-
[Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.IUserAssignedIdentities]))]
126-
[System.Collections.Hashtable]
127-
# User assigned identities dictionary
125+
[System.String[]]
126+
# The array of user assigned identities associated with the resource.
127+
# The elements in array will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.'
128128
${UserAssignedIdentity},
129129

130130
[Parameter()]
@@ -188,9 +188,7 @@ function New-AzWorkloadsSapVirtualInstance {
188188
)
189189
process {
190190
try {
191-
$configuration = [Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Support.SapConfigurationType]::Discovery
192191
$discoveryConfiguration = [Microsoft.Azure.PowerShell.Cmdlets.Workloads.SapVirtualInstance.Models.DiscoveryConfiguration]::new();
193-
$discoveryConfiguration.ConfigurationType = $configuration
194192
$discoveryConfiguration.CentralServerVMId = $CentralServerVmId
195193
$null = $PSBoundParameters.Remove('CentralServerVmId')
196194
if($PSBoundParameters.ContainsKey('ManagedRgStorageAccountName')) {

0 commit comments

Comments
 (0)