exports/New-CVArray.ps1


# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ----------------------------------------------------------------------------------

<#
.Synopsis
Creating a Storage Array
.Description
Creating a Storage Array
.Example
PS C:\> {{ Add code here }}
 
{{ Add output here }}
.Example
PS C:\> {{ Add code here }}
 
{{ Add output here }}
 
.Outputs
Commvault.Powershell.Models.IGenericResp
.Notes
COMPLEX PARAMETER PROPERTIES
 
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.
 
ACCESSNODES <IArrayAccessNodes[]>: MAs that can access the array
  [DisplayName <String>]: The display name of the corresponding Media Agent
  [Id <Int64?>]: Id of the MediaAgent
  [Name <String>]: Name of the MediaAgent
  [Pruning <Boolean?>]: Enable/Disable pruning of snapshots on the selected Media Agent
 
SNAPCONFIGURATIONS <IArrayConfigsBasic[]>: Configurations related to a snap engine
  MasterConfigId <Int64>: This is the masterConfigId, which is available for each vendor's configs
  Name <String>: This is the name of the config which is displayed on the Command Center Console
  Type <Int64>: Type of the config value. type can accept 7 values [1,2,8,10,12,13,14], 1: boolean, 2: integer, 8: text, 10: array[string] are common configs, the rest three are special keys, 12 is for password type key for NetApp E-Series and HPE Nimble, 13 is Private Key for GCP, 14 is a config to select type of Disk for GCP
  [Value <String>]: Takes a single value for all types except 10 and for type 14 it holds the id of the selected value from values
  [Values <IIdName[]>]: Values to be entered. for type 10 and 14. For HPE 3PAR StoreServ, pass MA Id in name field to configure that MA as remote snap MA.
    [Id <Int64?>]:
    [Name <String>]:
.Link
https://docs.microsoft.com/en-us/powershell/module/commvaultpowershell/new-cvarray
#>

function New-CVArray {
[OutputType([Commvault.Powershell.Models.IGenericResp])]
[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
    [Parameter()]
    [Commvault.Powershell.Category('Body')]
    [Commvault.Powershell.Models.IArrayAccessNodes[]]
    # MAs that can access the array
    # To construct, see NOTES section for ACCESSNODES properties and create a hash table.
    ${AccessNodes},

    [Parameter()]
    [Commvault.Powershell.Category('Body')]
    [System.String]
    # Base 64 encoded Password to access the array
    ${CredentialPassword},

    [Parameter()]
    [Commvault.Powershell.Category('Body')]
    [System.String]
    # Username to access the array
    ${CredentialUserName},

    [Parameter()]
    [Commvault.Powershell.Category('Body')]
    [System.String]
    # Host Name of the array
    ${GeneralControlHost},

    [Parameter()]
    [Commvault.Powershell.Category('Body')]
    [System.String]
    # Description of the array
    ${GeneralDescription},

    [Parameter()]
    [Commvault.Powershell.Category('Body')]
    [System.String]
    # Name of the array
    ${GeneralName},

    [Parameter()]
    [Commvault.Powershell.Category('Body')]
    [System.String]
    # .
    ${GeneralSnapVendor},

    [Parameter()]
    [Commvault.Powershell.Category('Body')]
    [System.Int64]
    # .
    ${SavedCredentialId},

    [Parameter()]
    [Commvault.Powershell.Category('Body')]
    [System.String]
    # .
    ${SavedCredentialName},

    [Parameter()]
    [Commvault.Powershell.Category('Body')]
    [Commvault.Powershell.Models.IArrayConfigsBasic[]]
    # Configurations related to a snap engine
    # To construct, see NOTES section for SNAPCONFIGURATIONS properties and create a hash table.
    ${SnapConfigurations},

    [Parameter(DontShow)]
    [Commvault.Powershell.Category('Runtime')]
    [System.Management.Automation.SwitchParameter]
    # Wait for .NET debugger to attach
    ${Break},

    [Parameter(DontShow)]
    [ValidateNotNull()]
    [Commvault.Powershell.Category('Runtime')]
    [Commvault.Powershell.Runtime.SendAsyncStep[]]
    # SendAsync Pipeline Steps to be appended to the front of the pipeline
    ${HttpPipelineAppend},

    [Parameter(DontShow)]
    [ValidateNotNull()]
    [Commvault.Powershell.Category('Runtime')]
    [Commvault.Powershell.Runtime.SendAsyncStep[]]
    # SendAsync Pipeline Steps to be prepended to the front of the pipeline
    ${HttpPipelinePrepend},

    [Parameter(DontShow)]
    [Commvault.Powershell.Category('Runtime')]
    [System.Uri]
    # The URI for the proxy server to use
    ${Proxy},

    [Parameter(DontShow)]
    [ValidateNotNull()]
    [Commvault.Powershell.Category('Runtime')]
    [System.Management.Automation.PSCredential]
    # Credentials for a proxy server to use for the remote call
    ${ProxyCredential},

    [Parameter(DontShow)]
    [Commvault.Powershell.Category('Runtime')]
    [System.Management.Automation.SwitchParameter]
    # Use the default credentials for the proxy
    ${ProxyUseDefaultCredentials}
)

begin {
    try {
        $outBuffer = $null
        if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {
            $PSBoundParameters['OutBuffer'] = 1
        }
        $parameterSet = $PSCmdlet.ParameterSetName
        $mapping = @{
            CreateExpanded = 'CommvaultPowershell.private\New-CVArray_CreateExpanded';
        }
        $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
        $scriptCmd = {& $wrappedCmd @PSBoundParameters}
        $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
        $steppablePipeline.Begin($PSCmdlet)
    } catch {
        throw
    }
}

process {
    try {
        $steppablePipeline.Process($_)
    } catch {
        throw
    }
}

end {
    try {
        $steppablePipeline.End()
    } catch {
        throw
    }
}
}