53 lines
1.5 KiB
PowerShell
53 lines
1.5 KiB
PowerShell
function Get-GpfsFilesystem {
|
|
[CmdletBinding(DefaultParameterSetName = 'All')]
|
|
param(
|
|
[Parameter(Mandatory, ParameterSetName = 'ByName', Position = 0)]
|
|
[string]$FilesystemName
|
|
)
|
|
|
|
if ($PSCmdlet.ParameterSetName -eq 'ByName') {
|
|
Invoke-GpfsApiRequest -Method GET -Endpoint "filesystems/$FilesystemName"
|
|
}
|
|
else {
|
|
Invoke-GpfsApiRequest -Method GET -Endpoint 'filesystems'
|
|
}
|
|
}
|
|
|
|
function New-GpfsFilesystem {
|
|
[CmdletBinding(SupportsShouldProcess)]
|
|
param(
|
|
[Parameter(Mandatory)]
|
|
[hashtable]$Settings
|
|
)
|
|
|
|
if ($PSCmdlet.ShouldProcess('filesystem', 'Create')) {
|
|
Invoke-GpfsApiRequest -Method POST -Endpoint 'filesystems' -Body $Settings
|
|
}
|
|
}
|
|
|
|
function Set-GpfsFilesystem {
|
|
[CmdletBinding(SupportsShouldProcess)]
|
|
param(
|
|
[Parameter(Mandatory, Position = 0)]
|
|
[string]$FilesystemName,
|
|
|
|
[Parameter(Mandatory)]
|
|
[hashtable]$Settings
|
|
)
|
|
|
|
if ($PSCmdlet.ShouldProcess($FilesystemName, 'Update filesystem')) {
|
|
Invoke-GpfsApiRequest -Method PUT -Endpoint "filesystems/$FilesystemName" -Body $Settings
|
|
}
|
|
}
|
|
|
|
function Remove-GpfsFilesystem {
|
|
[CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'High')]
|
|
param(
|
|
[Parameter(Mandatory, Position = 0)]
|
|
[string]$FilesystemName
|
|
)
|
|
|
|
if ($PSCmdlet.ShouldProcess($FilesystemName, 'Remove filesystem')) {
|
|
Invoke-GpfsApiRequest -Method DELETE -Endpoint "filesystems/$FilesystemName"
|
|
}
|
|
}
|