Skip to content

Commit d05eb42

Browse files
authored
[Az.ElasticSan]Set parameters BaseSizeTib and ExtendedBaseSizeTib for New-AzElasticSan to be optional (#27659)
1 parent 1b8d1a1 commit d05eb42

File tree

16 files changed

+890
-132
lines changed

16 files changed

+890
-132
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0 (the ""License"");
3+
// you may not use this file except in compliance with the License.
4+
// You may obtain a copy of the License at
5+
// http://www.apache.org/licenses/LICENSE-2.0
6+
// Unless required by applicable law or agreed to in writing, software
7+
// distributed under the License is distributed on an ""AS IS"" BASIS,
8+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
// See the License for the specific language governing permissions and
10+
// limitations under the License.
11+
// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
12+
// is regenerated.
13+
14+
using System;
15+
using System.Reflection;
16+
using System.Runtime.CompilerServices;
17+
using System.Runtime.InteropServices;
18+
19+
[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")]
20+
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
21+
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
22+
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - ElasticSan")]
23+
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.2.1")]
24+
[assembly: System.Reflection.AssemblyVersionAttribute("1.2.1")]
25+
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
26+
[assembly: System.CLSCompliantAttribute(false)]

src/ElasticSan/ElasticSan.Autorest/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ directive:
138138
- where:
139139
subject: ^PrivateEndpointConnection$|^PrivateLinkResource$
140140
hide: true
141+
- where:
142+
verb: ^New$
143+
subject: ^ElasticSan$
144+
hide: true
141145
- where:
142146
verb: ^New$|^Update$
143147
subject: ^VolumeGroup$
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
2+
# ----------------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
14+
# is regenerated.
15+
# ----------------------------------------------------------------------------------
16+
17+
<#
18+
.Synopsis
19+
create ElasticSan.
20+
.Description
21+
create ElasticSan.
22+
.Example
23+
New-AzElasticSan -ResourceGroupName myresourcegroup -Name myelasticsan -BaseSizeTib 1 -ExtendedCapacitySizeTib 6 -Location eastus -SkuName 'Premium_LRS' -Tag @{tag1="value1";tag2="value2"}
24+
25+
.Inputs
26+
Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity
27+
.Outputs
28+
Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSan
29+
.Notes
30+
COMPLEX PARAMETER PROPERTIES
31+
32+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
33+
34+
INPUTOBJECT <IElasticSanIdentity>: Identity Parameter
35+
[ElasticSanName <String>]: The name of the ElasticSan.
36+
[Id <String>]: Resource identity path
37+
[PrivateEndpointConnectionName <String>]: The name of the Private Endpoint connection.
38+
[ResourceGroupName <String>]: The name of the resource group. The name is case insensitive.
39+
[SnapshotName <String>]: The name of the volume snapshot within the given volume group.
40+
[SubscriptionId <String>]: The ID of the target subscription.
41+
[VolumeGroupName <String>]: The name of the VolumeGroup.
42+
[VolumeName <String>]: The name of the Volume.
43+
.Link
44+
https://learn.microsoft.com/powershell/module/az.elasticsan/new-azelasticsan
45+
#>
46+
function New-AzElasticSan {
47+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSan])]
48+
[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
49+
param(
50+
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
51+
[Alias('ElasticSanName')]
52+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Path')]
53+
[System.String]
54+
# The name of the ElasticSan.
55+
${Name},
56+
57+
[Parameter(ParameterSetName='CreateExpanded', Mandatory)]
58+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Path')]
59+
[System.String]
60+
# The name of the resource group.
61+
# The name is case insensitive.
62+
${ResourceGroupName},
63+
64+
[Parameter(ParameterSetName='CreateExpanded')]
65+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Path')]
66+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
67+
[System.String]
68+
# The ID of the target subscription.
69+
${SubscriptionId},
70+
71+
[Parameter(ParameterSetName='CreateViaIdentityExpanded', Mandatory, ValueFromPipeline)]
72+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Path')]
73+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.IElasticSanIdentity]
74+
# Identity Parameter
75+
${InputObject},
76+
77+
[Parameter(Mandatory)]
78+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')]
79+
[System.String]
80+
# The geo-location where the resource lives
81+
${Location},
82+
83+
[Parameter(Mandatory)]
84+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Premium_LRS", "Premium_ZRS")]
85+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')]
86+
[System.String]
87+
# The sku name.
88+
${SkuName},
89+
90+
[Parameter()]
91+
[AllowEmptyCollection()]
92+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')]
93+
[System.String[]]
94+
# Logical zone for Elastic San resource; example: ["1"].
95+
${AvailabilityZone},
96+
97+
[Parameter()]
98+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')]
99+
[System.Int64]
100+
# Base size of the Elastic San appliance in TiB. Default vaule is 20.
101+
${BaseSizeTiB},
102+
103+
[Parameter()]
104+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')]
105+
[System.Int64]
106+
# Extended size of the Elastic San appliance in TiB. Default vaule is 0.
107+
${ExtendedCapacitySizeTiB},
108+
109+
[Parameter()]
110+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Enabled", "Disabled")]
111+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')]
112+
[System.String]
113+
# Allow or disallow public network access to ElasticSan.
114+
# Value is optional but if passed in, must be 'Enabled' or 'Disabled'.
115+
${PublicNetworkAccess},
116+
117+
[Parameter()]
118+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.PSArgumentCompleterAttribute("Premium")]
119+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')]
120+
[System.String]
121+
# The sku tier.
122+
${SkuTier},
123+
124+
[Parameter()]
125+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Body')]
126+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.ITrackedResourceTags]))]
127+
[System.Collections.Hashtable]
128+
# Resource tags.
129+
${Tag},
130+
131+
[Parameter()]
132+
[Alias('AzureRMContext', 'AzureCredential')]
133+
[ValidateNotNull()]
134+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Azure')]
135+
[System.Management.Automation.PSObject]
136+
# The DefaultProfile parameter is not functional.
137+
# Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
138+
${DefaultProfile},
139+
140+
[Parameter()]
141+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')]
142+
[System.Management.Automation.SwitchParameter]
143+
# Run the command as a job
144+
${AsJob},
145+
146+
[Parameter(DontShow)]
147+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')]
148+
[System.Management.Automation.SwitchParameter]
149+
# Wait for .NET debugger to attach
150+
${Break},
151+
152+
[Parameter(DontShow)]
153+
[ValidateNotNull()]
154+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')]
155+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SendAsyncStep[]]
156+
# SendAsync Pipeline Steps to be appended to the front of the pipeline
157+
${HttpPipelineAppend},
158+
159+
[Parameter(DontShow)]
160+
[ValidateNotNull()]
161+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')]
162+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Runtime.SendAsyncStep[]]
163+
# SendAsync Pipeline Steps to be prepended to the front of the pipeline
164+
${HttpPipelinePrepend},
165+
166+
[Parameter()]
167+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')]
168+
[System.Management.Automation.SwitchParameter]
169+
# Run the command asynchronously
170+
${NoWait},
171+
172+
[Parameter(DontShow)]
173+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')]
174+
[System.Uri]
175+
# The URI for the proxy server to use
176+
${Proxy},
177+
178+
[Parameter(DontShow)]
179+
[ValidateNotNull()]
180+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')]
181+
[System.Management.Automation.PSCredential]
182+
# Credentials for a proxy server to use for the remote call
183+
${ProxyCredential},
184+
185+
[Parameter(DontShow)]
186+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Category('Runtime')]
187+
[System.Management.Automation.SwitchParameter]
188+
# Use the default credentials for the proxy
189+
${ProxyUseDefaultCredentials}
190+
)
191+
192+
process {
193+
if ($PSBoundParameters.ContainsKey('BaseSizeTiB') -eq $false) {
194+
$PSBoundParameters.BaseSizeTiB = 20
195+
}
196+
197+
if ($PSBoundParameters.ContainsKey("ExtendedCapacitySizeTiB") -eq $false) {
198+
$PSBoundParameters.ExtendedCapacitySizeTiB = 0
199+
}
200+
201+
Az.ElasticSan.internal\New-AzElasticSan @PSBoundParameters
202+
}
203+
}

src/ElasticSan/ElasticSan.Autorest/custom/autogen-model-cmdlets/New-AzElasticSanVirtualNetworkRuleObject.ps1

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.VirtualNetworkRule
2626
https://learn.microsoft.com/powershell/module/Az.ElasticSan/new-azelasticsanvirtualnetworkruleobject
2727
#>
2828
function New-AzElasticSanVirtualNetworkRuleObject {
29+
[Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.ModelCmdletAttribute()]
2930
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.VirtualNetworkRule')]
3031
[CmdletBinding(PositionalBinding=$false)]
3132
Param(

src/ElasticSan/ElasticSan.Autorest/docs/Az.ElasticSan.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
Module Name: Az.ElasticSan
3-
Module Guid: ed90c36c-f150-4ad2-96ae-57e0ebb0a376
3+
Module Guid: 4ec5915a-3898-41f7-a00b-29a4da49fc64
44
Download Help Link: https://learn.microsoft.com/powershell/module/az.elasticsan
55
Help Version: 1.0.0.0
66
Locale: en-US

src/ElasticSan/ElasticSan.Autorest/docs/New-AzElasticSan.md

+43-9
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ create ElasticSan.
1414

1515
### CreateExpanded (Default)
1616
```
17-
New-AzElasticSan -Name <String> -ResourceGroupName <String> -BaseSizeTiB <Int64>
18-
-ExtendedCapacitySizeTiB <Int64> -Location <String> -SkuName <String> [-SubscriptionId <String>]
19-
[-AvailabilityZone <String[]>] [-PublicNetworkAccess <String>] [-SkuTier <String>] [-Tag <Hashtable>]
17+
New-AzElasticSan -Name <String> -ResourceGroupName <String> -Location <String> -SkuName <String>
18+
[-SubscriptionId <String>] [-AvailabilityZone <String[]>] [-BaseSizeTiB <Int64>]
19+
[-ExtendedCapacitySizeTiB <Int64>] [-PublicNetworkAccess <String>] [-SkuTier <String>] [-Tag <Hashtable>]
2020
[-DefaultProfile <PSObject>] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [<CommonParameters>]
2121
```
2222

2323
### CreateViaIdentityExpanded
2424
```
25-
New-AzElasticSan -InputObject <IElasticSanIdentity> -BaseSizeTiB <Int64> -ExtendedCapacitySizeTiB <Int64>
26-
-Location <String> -SkuName <String> [-AvailabilityZone <String[]>] [-PublicNetworkAccess <String>]
27-
[-SkuTier <String>] [-Tag <Hashtable>] [-DefaultProfile <PSObject>] [-AsJob] [-NoWait] [-Confirm] [-WhatIf]
28-
[<CommonParameters>]
25+
New-AzElasticSan -InputObject <IElasticSanIdentity> -Location <String> -SkuName <String>
26+
[-AvailabilityZone <String[]>] [-BaseSizeTiB <Int64>] [-ExtendedCapacitySizeTiB <Int64>]
27+
[-PublicNetworkAccess <String>] [-SkuTier <String>] [-Tag <Hashtable>] [-DefaultProfile <PSObject>] [-AsJob]
28+
[-NoWait] [-Confirm] [-WhatIf] [<CommonParameters>]
2929
```
3030

3131
## DESCRIPTION
@@ -65,6 +65,38 @@ VolumeGroupCount : 0
6565

6666
This command creates an Elastic SAN.
6767

68+
### Example 2: Create an Elastic SAN with default base size and extended capacity size
69+
```powershell
70+
New-AzElasticSan -ResourceGroupName myresourcegroup -Name myelasticsan -Location eastus -SkuName 'Premium_LRS' -Tag @{tag1="value1";tag2="value2"}
71+
```
72+
73+
```output
74+
AvailabilityZone :
75+
BaseSizeTiB : 1
76+
ExtendedCapacitySizeTiB : 6
77+
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myresourcegroup/providers/Microsoft.ElasticSan/elasticSans/myelasticsan
78+
Location : eastus
79+
Name : myelasticsan
80+
ProvisioningState : Succeeded
81+
SkuName : Premium_LRS
82+
SkuTier :
83+
SystemDataCreatedAt : 9/19/2022 9:47:26 AM
84+
SystemDataCreatedBy : yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
85+
SystemDataCreatedByType : Application
86+
SystemDataLastModifiedAt : 9/19/2022 9:47:26 AM
87+
SystemDataLastModifiedBy : yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
88+
SystemDataLastModifiedByType : Application
89+
Tag : Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.Api20211120Preview.ResourceTags
90+
TotalIops : 5000
91+
TotalMBps : 80
92+
TotalSizeTiB : 20
93+
TotalVolumeSizeGiB : 0
94+
Type : Microsoft.ElasticSan/ElasticSans
95+
VolumeGroupCount : 0
96+
```
97+
98+
This command creates an Elastic SAN.
99+
68100
## PARAMETERS
69101

70102
### -AsJob
@@ -99,13 +131,14 @@ Accept wildcard characters: False
99131
100132
### -BaseSizeTiB
101133
Base size of the Elastic San appliance in TiB.
134+
Default vaule is 20.
102135
103136
```yaml
104137
Type: System.Int64
105138
Parameter Sets: (All)
106139
Aliases:
107140

108-
Required: True
141+
Required: False
109142
Position: Named
110143
Default value: None
111144
Accept pipeline input: False
@@ -130,13 +163,14 @@ Accept wildcard characters: False
130163
131164
### -ExtendedCapacitySizeTiB
132165
Extended size of the Elastic San appliance in TiB.
166+
Default vaule is 0.
133167
134168
```yaml
135169
Type: System.Int64
136170
Parameter Sets: (All)
137171
Aliases:
138172

139-
Required: True
173+
Required: False
140174
Position: Named
141175
Default value: None
142176
Accept pipeline input: False

src/ElasticSan/ElasticSan.Autorest/examples/New-AzElasticSan.md

+32
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,35 @@ VolumeGroupCount : 0
2929
```
3030

3131
This command creates an Elastic SAN.
32+
33+
### Example 2: Create an Elastic SAN with default base size and extended capacity size
34+
```powershell
35+
New-AzElasticSan -ResourceGroupName myresourcegroup -Name myelasticsan -Location eastus -SkuName 'Premium_LRS' -Tag @{tag1="value1";tag2="value2"}
36+
```
37+
38+
```output
39+
AvailabilityZone :
40+
BaseSizeTiB : 1
41+
ExtendedCapacitySizeTiB : 6
42+
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myresourcegroup/providers/Microsoft.ElasticSan/elasticSans/myelasticsan
43+
Location : eastus
44+
Name : myelasticsan
45+
ProvisioningState : Succeeded
46+
SkuName : Premium_LRS
47+
SkuTier :
48+
SystemDataCreatedAt : 9/19/2022 9:47:26 AM
49+
SystemDataCreatedBy : yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
50+
SystemDataCreatedByType : Application
51+
SystemDataLastModifiedAt : 9/19/2022 9:47:26 AM
52+
SystemDataLastModifiedBy : yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
53+
SystemDataLastModifiedByType : Application
54+
Tag : Microsoft.Azure.PowerShell.Cmdlets.ElasticSan.Models.Api20211120Preview.ResourceTags
55+
TotalIops : 5000
56+
TotalMBps : 80
57+
TotalSizeTiB : 20
58+
TotalVolumeSizeGiB : 0
59+
Type : Microsoft.ElasticSan/ElasticSans
60+
VolumeGroupCount : 0
61+
```
62+
63+
This command creates an Elastic SAN.
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"generate_Id": "bd00aa02-2b74-4559-82fc-0b854faa8a46"
2+
"generate_Id": "2466eb96-584f-4674-a521-1833df15998d"
33
}

0 commit comments

Comments
 (0)