Skip to content

Commit 7f00acf

Browse files
committed
Changed parameters BaseSizeTiB and ExtendedCapacitySizeTiB in cmdlet New-AzElasticSan to be optional.
1 parent 27c0fc9 commit 7f00acf

File tree

14 files changed

+783
-132
lines changed

14 files changed

+783
-132
lines changed
Lines changed: 26 additions & 0 deletions
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

Lines changed: 4 additions & 0 deletions
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$
Lines changed: 203 additions & 0 deletions
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.
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.
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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: 38f3220e-77d7-4a44-9ccf-208e91aec7c5
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

Lines changed: 9 additions & 9 deletions
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
@@ -105,7 +105,7 @@ Type: System.Int64
105105
Parameter Sets: (All)
106106
Aliases:
107107

108-
Required: True
108+
Required: False
109109
Position: Named
110110
Default value: None
111111
Accept pipeline input: False
@@ -136,7 +136,7 @@ Type: System.Int64
136136
Parameter Sets: (All)
137137
Aliases:
138138

139-
Required: True
139+
Required: False
140140
Position: Named
141141
Default value: None
142142
Accept pipeline input: False
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"generate_Id": "bd00aa02-2b74-4559-82fc-0b854faa8a46"
2+
"generate_Id": "25b65b4f-6f9d-4339-baf7-c7eb45b9dc0a"
33
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Resources
2+
This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `..\custom` folder.
3+
4+
## Info
5+
- Modifiable: yes
6+
- Generated: no
7+
- Committed: yes
8+
- Packaged: no
9+
10+
## Purpose
11+
Use this folder to put anything you want to keep around as part of the repository for the module, but is not something that is required for the module. For example, development files, packaged builds, or additional information. This is only intended to be used in repositories where the module's output directory is cleaned, but tangential resources for the module want to remain intact.

0 commit comments

Comments
 (0)