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

53
Public/GpfsNfsExport.ps1 Normal file
View file

@ -0,0 +1,53 @@
function Get-GpfsNfsExport {
[CmdletBinding(DefaultParameterSetName = 'All')]
param(
[Parameter(Mandatory, ParameterSetName = 'ById', Position = 0)]
[string]$ExportId
)
if ($PSCmdlet.ParameterSetName -eq 'ById') {
Invoke-GpfsApiRequest -Method GET -Endpoint "nfs/exports/$ExportId"
}
else {
Invoke-GpfsApiRequest -Method GET -Endpoint 'nfs/exports'
}
}
function New-GpfsNfsExport {
[CmdletBinding(SupportsShouldProcess)]
param(
[Parameter(Mandatory)]
[hashtable]$Settings
)
if ($PSCmdlet.ShouldProcess('NFS export', 'Create')) {
Invoke-GpfsApiRequest -Method POST -Endpoint 'nfs/exports' -Body $Settings
}
}
function Set-GpfsNfsExport {
[CmdletBinding(SupportsShouldProcess)]
param(
[Parameter(Mandatory, Position = 0)]
[string]$ExportId,
[Parameter(Mandatory)]
[hashtable]$Settings
)
if ($PSCmdlet.ShouldProcess($ExportId, 'Update NFS export')) {
Invoke-GpfsApiRequest -Method PUT -Endpoint "nfs/exports/$ExportId" -Body $Settings
}
}
function Remove-GpfsNfsExport {
[CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'High')]
param(
[Parameter(Mandatory, Position = 0)]
[string]$ExportId
)
if ($PSCmdlet.ShouldProcess($ExportId, 'Remove NFS export')) {
Invoke-GpfsApiRequest -Method DELETE -Endpoint "nfs/exports/$ExportId"
}
}