|
| 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 | +} |
0 commit comments