|
| 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 | +Creates an AzStorageContainer endpoint resource, which represents a data transfer source or destination. |
| 20 | +.Description |
| 21 | +Creates an AzStorageContainer endpoint resource, which represents a data transfer source or destination. |
| 22 | +.Example |
| 23 | +New-AzStorageMoverAzStorageContainerEndpoint -Name myendpointName -ResourceGroupName myResourceGroup -BlobContainerName myContainer -StorageMoverName myStorageMover -StorageAccountResourceId myAccountResourceId |
| 24 | +
|
| 25 | +.Inputs |
| 26 | +Microsoft.Azure.PowerShell.Cmdlets.StorageMover.Models.Api20220701Preview.IEndpoint |
| 27 | +.Inputs |
| 28 | +Microsoft.Azure.PowerShell.Cmdlets.StorageMover.Models.IStorageMoverIdentity |
| 29 | +.Outputs |
| 30 | +Microsoft.Azure.PowerShell.Cmdlets.StorageMover.Models.Api20220701Preview.IEndpoint |
| 31 | +.Notes |
| 32 | +COMPLEX PARAMETER PROPERTIES |
| 33 | +
|
| 34 | +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. |
| 35 | +
|
| 36 | +.Link |
| 37 | +https://docs.microsoft.com/powershell/module/az.storagemover/new-azstoragemoverendpoint |
| 38 | +#> |
| 39 | +function New-AzStorageMoverAzStorageContainerEndpoint { |
| 40 | + [OutputType([Microsoft.Azure.PowerShell.Cmdlets.StorageMover.Models.Api20220701Preview.IEndpoint])] |
| 41 | + [CmdletBinding(DefaultParameterSetName = 'CreateExpanded', PositionalBinding =$false, SupportsShouldProcess, ConfirmImpact = 'Medium')] |
| 42 | + param( |
| 43 | + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] |
| 44 | + [Alias('EndpointName')] |
| 45 | + [Microsoft.Azure.PowerShell.Cmdlets.StorageMover.Category('Path')] |
| 46 | + [System.String] |
| 47 | + # The name of the endpoint resource. |
| 48 | + ${Name}, |
| 49 | + |
| 50 | + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] |
| 51 | + [Microsoft.Azure.PowerShell.Cmdlets.StorageMover.Category('Path')] |
| 52 | + [System.String] |
| 53 | + # The name of the resource group. |
| 54 | + # The name is case insensitive. |
| 55 | + ${ResourceGroupName}, |
| 56 | + |
| 57 | + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] |
| 58 | + [Microsoft.Azure.PowerShell.Cmdlets.StorageMover.Category('Path')] |
| 59 | + [System.String] |
| 60 | + # The name of the Storage Mover resource. |
| 61 | + ${StorageMoverName}, |
| 62 | + |
| 63 | + [Parameter(ParameterSetName = 'CreateExpanded')] |
| 64 | + [Parameter(Mandatory, HelpMessage="The name of the Storage blob container that is the target destination.")] |
| 65 | + [string] |
| 66 | + ${BlobContainerName}, |
| 67 | + |
| 68 | + [Parameter(ParameterSetName = 'CreateExpanded')] |
| 69 | + [Parameter(Mandatory, HelpMessage="The Azure Resource ID of the storage account that is the target destination.")] |
| 70 | + [string] |
| 71 | + ${StorageAccountResourceId}, |
| 72 | + |
| 73 | + [Parameter(ParameterSetName = 'CreateExpanded')] |
| 74 | + [Parameter(HelpMessage="A description for the endpoint.")] |
| 75 | + [string] |
| 76 | + ${Description}, |
| 77 | + |
| 78 | + [Parameter(ParameterSetName='CreateExpanded')] |
| 79 | + [Microsoft.Azure.PowerShell.Cmdlets.StorageMover.Category('Path')] |
| 80 | + [Microsoft.Azure.PowerShell.Cmdlets.StorageMover.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] |
| 81 | + [System.String] |
| 82 | + # The ID of the target subscription. |
| 83 | + ${SubscriptionId}, |
| 84 | + |
| 85 | + [Parameter()] |
| 86 | + [Alias('AzureRMContext', 'AzureCredential')] |
| 87 | + [ValidateNotNull()] |
| 88 | + [Microsoft.Azure.PowerShell.Cmdlets.StorageMover.Category('Azure')] |
| 89 | + [System.Management.Automation.PSObject] |
| 90 | + # The credentials, account, tenant, and subscription used for communication with Azure. |
| 91 | + ${DefaultProfile}, |
| 92 | + |
| 93 | + [Parameter(DontShow)] |
| 94 | + [Microsoft.Azure.PowerShell.Cmdlets.StorageMover.Category('Runtime')] |
| 95 | + [System.Management.Automation.SwitchParameter] |
| 96 | + # Wait for .NET debugger to attach |
| 97 | + ${Break}, |
| 98 | + |
| 99 | + [Parameter(DontShow)] |
| 100 | + [ValidateNotNull()] |
| 101 | + [Microsoft.Azure.PowerShell.Cmdlets.StorageMover.Category('Runtime')] |
| 102 | + [Microsoft.Azure.PowerShell.Cmdlets.StorageMover.Runtime.SendAsyncStep[]] |
| 103 | + # SendAsync Pipeline Steps to be appended to the front of the pipeline |
| 104 | + ${HttpPipelineAppend}, |
| 105 | + |
| 106 | + [Parameter(DontShow)] |
| 107 | + [ValidateNotNull()] |
| 108 | + [Microsoft.Azure.PowerShell.Cmdlets.StorageMover.Category('Runtime')] |
| 109 | + [Microsoft.Azure.PowerShell.Cmdlets.StorageMover.Runtime.SendAsyncStep[]] |
| 110 | + # SendAsync Pipeline Steps to be prepended to the front of the pipeline |
| 111 | + ${HttpPipelinePrepend}, |
| 112 | + |
| 113 | + [Parameter(DontShow)] |
| 114 | + [Microsoft.Azure.PowerShell.Cmdlets.StorageMover.Category('Runtime')] |
| 115 | + [System.Uri] |
| 116 | + # The URI for the proxy server to use |
| 117 | + ${Proxy}, |
| 118 | + |
| 119 | + [Parameter(DontShow)] |
| 120 | + [ValidateNotNull()] |
| 121 | + [Microsoft.Azure.PowerShell.Cmdlets.StorageMover.Category('Runtime')] |
| 122 | + [System.Management.Automation.PSCredential] |
| 123 | + # Credentials for a proxy server to use for the remote call |
| 124 | + ${ProxyCredential}, |
| 125 | + |
| 126 | + [Parameter(DontShow)] |
| 127 | + [Microsoft.Azure.PowerShell.Cmdlets.StorageMover.Category('Runtime')] |
| 128 | + [System.Management.Automation.SwitchParameter] |
| 129 | + # Use the default credentials for the proxy |
| 130 | + ${ProxyUseDefaultCredentials} |
| 131 | + ) |
| 132 | + |
| 133 | + process { |
| 134 | + $Properties = [Microsoft.Azure.PowerShell.Cmdlets.StorageMover.Models.Api20220701Preview.AzureStorageBlobContainerEndpointProperties]::New() |
| 135 | + |
| 136 | + if ($PSBoundParameters.ContainsKey('BlobContainerName')) { |
| 137 | + $Properties.BlobContainerName = $BlobContainerName |
| 138 | + $null = $PSBoundParameters.Remove("BlobContainerName") |
| 139 | + } |
| 140 | + if ($PSBoundParameters.ContainsKey('StorageAccountResourceId')) { |
| 141 | + $Properties.StorageAccountResourceId = $StorageAccountResourceId |
| 142 | + $null = $PSBoundParameters.Remove("StorageAccountResourceId") |
| 143 | + } |
| 144 | + if ($PSBoundParameters.ContainsKey('Description')) { |
| 145 | + $Properties.Description = $Description |
| 146 | + $null = $PSBoundParameters.Remove("Description") |
| 147 | + } |
| 148 | + |
| 149 | + $Properties.EndpointType = "AzureStorageBlobContainer" |
| 150 | + $PSBoundParameters.Add("Property", $Properties) |
| 151 | + |
| 152 | + Az.StorageMover.internal\New-AzStorageMoverEndpoint @PSBoundParameters |
| 153 | + } |
| 154 | +} |
0 commit comments