Initial commit

This commit is contained in:
Laurence Horrocks-Barlow 2026-05-19 00:35:27 +01:00
commit 6bf433c9a9
20 changed files with 1162 additions and 0 deletions

65
Public/GpfsPool.ps1 Normal file
View file

@ -0,0 +1,65 @@
function Get-GpfsPool {
[CmdletBinding(DefaultParameterSetName = 'All')]
param(
[Parameter(Mandatory, Position = 0)]
[string]$FilesystemName,
[Parameter(Mandatory, ParameterSetName = 'ByName', Position = 1)]
[string]$PoolName
)
if ($PSCmdlet.ParameterSetName -eq 'ByName') {
Invoke-GpfsApiRequest -Method GET -Endpoint "filesystems/$FilesystemName/pools/$PoolName"
}
else {
Invoke-GpfsApiRequest -Method GET -Endpoint "filesystems/$FilesystemName/pools"
}
}
function New-GpfsPool {
[CmdletBinding(SupportsShouldProcess)]
param(
[Parameter(Mandatory, Position = 0)]
[string]$FilesystemName,
[Parameter(Mandatory)]
[hashtable]$Settings
)
if ($PSCmdlet.ShouldProcess($FilesystemName, 'Create pool')) {
Invoke-GpfsApiRequest -Method POST -Endpoint "filesystems/$FilesystemName/pools" -Body $Settings
}
}
function Set-GpfsPool {
[CmdletBinding(SupportsShouldProcess)]
param(
[Parameter(Mandatory, Position = 0)]
[string]$FilesystemName,
[Parameter(Mandatory, Position = 1)]
[string]$PoolName,
[Parameter(Mandatory)]
[hashtable]$Settings
)
if ($PSCmdlet.ShouldProcess($PoolName, 'Update pool')) {
Invoke-GpfsApiRequest -Method PUT -Endpoint "filesystems/$FilesystemName/pools/$PoolName" -Body $Settings
}
}
function Remove-GpfsPool {
[CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'High')]
param(
[Parameter(Mandatory, Position = 0)]
[string]$FilesystemName,
[Parameter(Mandatory, Position = 1)]
[string]$PoolName
)
if ($PSCmdlet.ShouldProcess($PoolName, 'Remove pool')) {
Invoke-GpfsApiRequest -Method DELETE -Endpoint "filesystems/$FilesystemName/pools/$PoolName"
}
}