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