Initial commit
This commit is contained in:
commit
6bf433c9a9
20 changed files with 1162 additions and 0 deletions
41
Public/GpfsNode.ps1
Normal file
41
Public/GpfsNode.ps1
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
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"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue