41 lines
1.1 KiB
PowerShell
41 lines
1.1 KiB
PowerShell
function Get-GpfsNode {
|
|
[CmdletBinding(DefaultParameterSetName = 'All')]
|
|
param(
|
|
[Parameter(Mandatory, ParameterSetName = 'ByName', Position = 0)]
|
|
[string]$NodeName
|
|
)
|
|
|
|
if ($PSCmdlet.ParameterSetName -eq 'ByName') {
|
|
Invoke-GpfsApiRequest -Method GET -Endpoint "nodes/$NodeName"
|
|
}
|
|
else {
|
|
Invoke-GpfsApiRequest -Method GET -Endpoint 'nodes'
|
|
}
|
|
}
|
|
|
|
function Set-GpfsNode {
|
|
[CmdletBinding(SupportsShouldProcess)]
|
|
param(
|
|
[Parameter(Mandatory, Position = 0)]
|
|
[string]$NodeName,
|
|
|
|
[Parameter(Mandatory)]
|
|
[hashtable]$Settings
|
|
)
|
|
|
|
if ($PSCmdlet.ShouldProcess($NodeName, 'Update node')) {
|
|
Invoke-GpfsApiRequest -Method PUT -Endpoint "nodes/$NodeName" -Body $Settings
|
|
}
|
|
}
|
|
|
|
function Remove-GpfsNode {
|
|
[CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'High')]
|
|
param(
|
|
[Parameter(Mandatory, Position = 0)]
|
|
[string]$NodeName
|
|
)
|
|
|
|
if ($PSCmdlet.ShouldProcess($NodeName, 'Remove node')) {
|
|
Invoke-GpfsApiRequest -Method DELETE -Endpoint "nodes/$NodeName"
|
|
}
|
|
}
|