Public/Storage.ps1
Function Get-NmeAzureFilesAutoScaleConfig { <# .SYNOPSIS Get Azure Files autoscale. .DESCRIPTION Get Azure Files autoscale. This function calls the /api/v1/storage/azure-files/{subscriptionId}/{resourceGroup}/{accountName}/{shareName}/auto-scale endpoint of the NME REST API, using the get method. .PARAMETER SubscriptionId The id (guid) of the subscription where this storage resides .PARAMETER ResourceGroup The Azure resource group where the storage resides .PARAMETER AccountName Storage account name .PARAMETER ShareName File share name #> [CmdletBinding()] Param( [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)][string]$SubscriptionId, [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)][string]$ResourceGroup, [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)][string]$AccountName, [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)][string]$ShareName ) Set-NmeAuthHeaders Try { $Result = Invoke-RestMethod "$script:NmeUri/api/v1/storage/azure-files/$SubscriptionId/$ResourceGroup/$AccountName/$ShareName/auto-scale$Querystring" -Method get -Headers $script:AuthHeaders -ContentType 'application/json' $Result.PSObject.TypeNames.Insert(0, 'NmeAzureFilesAutoscaleConfig') $Result | Add-Member -NotePropertyName 'subscriptionId' -NotePropertyValue $subscriptionId -erroraction 'SilentlyContinue' $Result | Add-Member -NotePropertyName 'resourceGroup' -NotePropertyValue $resourceGroup -erroraction 'SilentlyContinue' $Result | Add-Member -NotePropertyName 'accountName' -NotePropertyValue $accountName -erroraction 'SilentlyContinue' $Result | Add-Member -NotePropertyName 'shareName' -NotePropertyValue $shareName -erroraction 'SilentlyContinue' $Result | CapProps } Catch { $message = ParseErrorForResponseBody($_) write-error ($message | out-string) } } Function Set-NmeAzureFilesAutoScaleConfig { <# .SYNOPSIS Update Azure Files autoscale. .DESCRIPTION Update Azure Files autoscale. This function calls the /api/v1/storage/azure-files/{subscriptionId}/{resourceGroup}/{accountName}/{shareName}/auto-scale endpoint of the NME REST API, using the put method. .PARAMETER SubscriptionId The id (guid) of the subscription where this storage resides .PARAMETER ResourceGroup The Azure resource group where the storage resides .PARAMETER AccountName Storage account name .PARAMETER ShareName File share name .PARAMETER NmeAzureFilesAutoscaleConfig Requires an NmeAzureFilesAutoscaleConfig object, as generated by the New-NmeAzureFilesAutoscaleConfig command. #> [CmdletBinding()] Param( [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)][string]$SubscriptionId, [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)][string]$ResourceGroup, [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)][string]$AccountName, [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)][string]$ShareName, [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$True)][ValidateScript({if ($_.PSObject.TypeNames -contains "NmeAzureFilesAutoscaleConfig"){$true} else{throw " is not a NmeAzureFilesAutoscaleConfig object."}})]$NmeAzureFilesAutoscaleConfig ) Set-NmeAuthHeaders Try { $json = $NmeAzureFilesAutoscaleConfig | ConvertTo-Json -Depth 20 Write-Debug 'json:' Write-Debug $json $Result = Invoke-RestMethod "$script:NmeUri/api/v1/storage/azure-files/$SubscriptionId/$ResourceGroup/$AccountName/$ShareName/auto-scale$QueryString" -Method put -Headers $script:AuthHeaders -ContentType 'application/json' -body $json Write-Verbose ($result | out-string) $Result.PSObject.TypeNames.Insert(0, 'NmeResponseWithJob') $Result | Add-Member -NotePropertyName 'subscriptionId' -NotePropertyValue $subscriptionId -erroraction 'SilentlyContinue' $Result | Add-Member -NotePropertyName 'resourceGroup' -NotePropertyValue $resourceGroup -erroraction 'SilentlyContinue' $Result | Add-Member -NotePropertyName 'accountName' -NotePropertyValue $accountName -erroraction 'SilentlyContinue' $Result | Add-Member -NotePropertyName 'shareName' -NotePropertyValue $shareName -erroraction 'SilentlyContinue' $Result | CapProps } Catch { $message = ParseErrorForResponseBody($_) write-error ($message | out-string) } } Function Update-NmeAzureFilesAutoScaleConfig { <# .SYNOPSIS Enable or disable Azure Files autoscale. .DESCRIPTION Enable or disable Azure Files autoscale. This function calls the /api/v1/storage/azure-files/{subscriptionId}/{resourceGroup}/{accountName}/{shareName}/auto-scale endpoint of the NME REST API, using the patch method. .PARAMETER SubscriptionId The id (guid) of the subscription where this storage resides .PARAMETER ResourceGroup The Azure resource group where the storage resides .PARAMETER AccountName Storage account name .PARAMETER ShareName File share name .PARAMETER NmeAzureFilesAutoscaleConfig Requires an NmeAzureFilesAutoscaleConfig object, as generated by the New-NmeAzureFilesAutoscaleConfig command. #> [CmdletBinding()] Param( [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)][string]$SubscriptionId, [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)][string]$ResourceGroup, [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)][string]$AccountName, [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)][string]$ShareName, [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$True)][ValidateScript({if ($_.PSObject.TypeNames -contains "NmeAzureFilesAutoscaleConfig"){$true} else{throw " is not a NmeAzureFilesAutoscaleConfig object."}})]$NmeAzureFilesAutoscaleConfig ) Set-NmeAuthHeaders Try { $json = $NmeAzureFilesAutoscaleConfig | ConvertTo-Json -Depth 20 Write-Debug 'json:' Write-Debug $json $Result = Invoke-RestMethod "$script:NmeUri/api/v1/storage/azure-files/$SubscriptionId/$ResourceGroup/$AccountName/$ShareName/auto-scale$QueryString" -Method patch -Headers $script:AuthHeaders -ContentType 'application/json' -body $json Write-Verbose ($result | out-string) $Result.PSObject.TypeNames.Insert(0, 'NmeResponseWithJob') $Result | Add-Member -NotePropertyName 'subscriptionId' -NotePropertyValue $subscriptionId -erroraction 'SilentlyContinue' $Result | Add-Member -NotePropertyName 'resourceGroup' -NotePropertyValue $resourceGroup -erroraction 'SilentlyContinue' $Result | Add-Member -NotePropertyName 'accountName' -NotePropertyValue $accountName -erroraction 'SilentlyContinue' $Result | Add-Member -NotePropertyName 'shareName' -NotePropertyValue $shareName -erroraction 'SilentlyContinue' $Result | CapProps } Catch { $message = ParseErrorForResponseBody($_) write-error ($message | out-string) } } Function Get-NmeNetAppFilesAutoScaleConfig { <# .SYNOPSIS Get Net App Files autoscale. .DESCRIPTION Get Net App Files autoscale. This function calls the /api/v1/storage/netapp-files/{subscriptionId}/{resourceGroupName}/{accountName}/{poolName}/{volumeName}/auto-scale endpoint of the NME REST API, using the get method. .PARAMETER SubscriptionId The id (guid) of the subscription where this storage resides .PARAMETER ResourceGroupName Resource group name .PARAMETER AccountName Storage account name .PARAMETER PoolName NetApp Files capacity pool name .PARAMETER VolumeName NetApp volume name #> [CmdletBinding()] Param( [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)][string]$SubscriptionId, [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)][string]$ResourceGroupName, [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)][string]$AccountName, [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)][string]$PoolName, [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)][string]$VolumeName ) Set-NmeAuthHeaders Try { $Result = Invoke-RestMethod "$script:NmeUri/api/v1/storage/netapp-files/$SubscriptionId/$ResourceGroupName/$AccountName/$PoolName/$VolumeName/auto-scale$Querystring" -Method get -Headers $script:AuthHeaders -ContentType 'application/json' $Result.PSObject.TypeNames.Insert(0, 'NmeNetAppFilesAutoscaleConfig') $Result | Add-Member -NotePropertyName 'subscriptionId' -NotePropertyValue $subscriptionId -erroraction 'SilentlyContinue' $Result | Add-Member -NotePropertyName 'resourceGroupName' -NotePropertyValue $resourceGroupName -erroraction 'SilentlyContinue' $Result | Add-Member -NotePropertyName 'accountName' -NotePropertyValue $accountName -erroraction 'SilentlyContinue' $Result | Add-Member -NotePropertyName 'poolName' -NotePropertyValue $poolName -erroraction 'SilentlyContinue' $Result | Add-Member -NotePropertyName 'volumeName' -NotePropertyValue $volumeName -erroraction 'SilentlyContinue' $Result | CapProps } Catch { $message = ParseErrorForResponseBody($_) write-error ($message | out-string) } } Function Set-NmeNetAppFilesAutoScaleConfig { <# .SYNOPSIS Update Net App Files autoscale. .DESCRIPTION Update Net App Files autoscale. This function calls the /api/v1/storage/netapp-files/{subscriptionId}/{resourceGroupName}/{accountName}/{poolName}/{volumeName}/auto-scale endpoint of the NME REST API, using the put method. .PARAMETER SubscriptionId The id (guid) of the subscription where this storage resides .PARAMETER ResourceGroupName Resource group name .PARAMETER AccountName Storage account name .PARAMETER PoolName NetApp Files capacity pool name .PARAMETER VolumeName NetApp volume name .PARAMETER NmeNetAppFilesAutoscaleConfig Requires an NmeNetAppFilesAutoscaleConfig object, as generated by the New-NmeNetAppFilesAutoscaleConfig command. #> [CmdletBinding()] Param( [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)][string]$SubscriptionId, [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)][string]$ResourceGroupName, [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)][string]$AccountName, [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)][string]$PoolName, [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)][string]$VolumeName, [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$True)][ValidateScript({if ($_.PSObject.TypeNames -contains "NmeNetAppFilesAutoscaleConfig"){$true} else{throw " is not a NmeNetAppFilesAutoscaleConfig object."}})]$NmeNetAppFilesAutoscaleConfig ) Set-NmeAuthHeaders Try { $json = $NmeNetAppFilesAutoscaleConfig | ConvertTo-Json -Depth 20 Write-Debug 'json:' Write-Debug $json $Result = Invoke-RestMethod "$script:NmeUri/api/v1/storage/netapp-files/$SubscriptionId/$ResourceGroupName/$AccountName/$PoolName/$VolumeName/auto-scale$QueryString" -Method put -Headers $script:AuthHeaders -ContentType 'application/json' -body $json Write-Verbose ($result | out-string) $Result.PSObject.TypeNames.Insert(0, 'NmeResponseWithJob') $Result | Add-Member -NotePropertyName 'subscriptionId' -NotePropertyValue $subscriptionId -erroraction 'SilentlyContinue' $Result | Add-Member -NotePropertyName 'resourceGroupName' -NotePropertyValue $resourceGroupName -erroraction 'SilentlyContinue' $Result | Add-Member -NotePropertyName 'accountName' -NotePropertyValue $accountName -erroraction 'SilentlyContinue' $Result | Add-Member -NotePropertyName 'poolName' -NotePropertyValue $poolName -erroraction 'SilentlyContinue' $Result | Add-Member -NotePropertyName 'volumeName' -NotePropertyValue $volumeName -erroraction 'SilentlyContinue' $Result | CapProps } Catch { $message = ParseErrorForResponseBody($_) write-error ($message | out-string) } } Function Update-NmeNetAppFilesAutoScaleConfig { <# .SYNOPSIS Enable or disable Net App Files autoscale. .DESCRIPTION Enable or disable Net App Files autoscale. This function calls the /api/v1/storage/netapp-files/{subscriptionId}/{resourceGroupName}/{accountName}/{poolName}/{volumeName}/auto-scale endpoint of the NME REST API, using the patch method. .PARAMETER SubscriptionId The id (guid) of the subscription where this storage resides .PARAMETER ResourceGroupName Resource group name .PARAMETER AccountName Storage account name .PARAMETER PoolName NetApp Files capacity pool name .PARAMETER VolumeName NetApp volume name .PARAMETER NmeNetAppFilesAutoscaleConfig Requires an NmeNetAppFilesAutoscaleConfig object, as generated by the New-NmeNetAppFilesAutoscaleConfig command. #> [CmdletBinding()] Param( [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)][string]$SubscriptionId, [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)][string]$ResourceGroupName, [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)][string]$AccountName, [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)][string]$PoolName, [Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)][string]$VolumeName, [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$True)][ValidateScript({if ($_.PSObject.TypeNames -contains "NmeNetAppFilesAutoscaleConfig"){$true} else{throw " is not a NmeNetAppFilesAutoscaleConfig object."}})]$NmeNetAppFilesAutoscaleConfig ) Set-NmeAuthHeaders Try { $json = $NmeNetAppFilesAutoscaleConfig | ConvertTo-Json -Depth 20 Write-Debug 'json:' Write-Debug $json $Result = Invoke-RestMethod "$script:NmeUri/api/v1/storage/netapp-files/$SubscriptionId/$ResourceGroupName/$AccountName/$PoolName/$VolumeName/auto-scale$QueryString" -Method patch -Headers $script:AuthHeaders -ContentType 'application/json' -body $json Write-Verbose ($result | out-string) $Result.PSObject.TypeNames.Insert(0, 'NmeResponseWithJob') $Result | Add-Member -NotePropertyName 'subscriptionId' -NotePropertyValue $subscriptionId -erroraction 'SilentlyContinue' $Result | Add-Member -NotePropertyName 'resourceGroupName' -NotePropertyValue $resourceGroupName -erroraction 'SilentlyContinue' $Result | Add-Member -NotePropertyName 'accountName' -NotePropertyValue $accountName -erroraction 'SilentlyContinue' $Result | Add-Member -NotePropertyName 'poolName' -NotePropertyValue $poolName -erroraction 'SilentlyContinue' $Result | Add-Member -NotePropertyName 'volumeName' -NotePropertyValue $volumeName -erroraction 'SilentlyContinue' $Result | CapProps } Catch { $message = ParseErrorForResponseBody($_) write-error ($message | out-string) } } |