Skip to content

Commit aae8402

Browse files
committed
Updated recovery package Cmdlet
1 parent 4b2cf70 commit aae8402

1 file changed

Lines changed: 24 additions & 4 deletions

File tree

src/StorageGRID-Webscale.psm1

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13209,11 +13209,17 @@ function Global:Start-SgwRecovery {
1320913209

1321013210
## recovery-package ##
1321113211

13212+
# complete as of API 2.2
13213+
1321213214
<#
1321313215
.SYNOPSIS
13214-
Retrieves the log collection procedure status
13216+
Downloads the Recovery Package
1321513217
.DESCRIPTION
13216-
Retrieves the log collection procedure status
13218+
Downloads the Recovery Package
13219+
.PARAMETER Server
13220+
StorageGRID Webscale Management Server object. If not specified, global CurrentSgwServer object will be used.
13221+
.PARAMETER ProfileName
13222+
StorageGRID Profile to use for connection.
1321713223
#>
1321813224
function Global:Get-SgwRecoveryPackage {
1321913225
[CmdletBinding()]
@@ -13222,15 +13228,29 @@ function Global:Get-SgwRecoveryPackage {
1322213228
[parameter(Mandatory = $False,
1322313229
Position = 0,
1322413230
HelpMessage = "StorageGRID Webscale Management Server object. If not specified, global CurrentSgwServer object will be used.")][PSCustomObject]$Server,
13225-
[parameter(Mandatory = $True,
13231+
[parameter(Mandatory = $False,
1322613232
Position = 1,
13233+
HelpMessage = "StorageGRID Profile to use for connection.")][Alias("Profile")][String]$ProfileName,
13234+
[parameter(Mandatory = $True,
13235+
Position = 2,
1322713236
HelpMessage = "StorageGRID Webscale Passphrase.")][String]$Passphrase,
1322813237
[parameter(Mandatory = $True,
13229-
Position = 1,
13238+
Position = 3,
1323013239
HelpMessage = "Path to store log collection in")][System.IO.DirectoryInfo]$Path
1323113240
)
1323213241

1323313242
Begin {
13243+
if (!$ProfileName -and !$Server -and !$CurrentSgwServer.Name) {
13244+
$ProfileName = "default"
13245+
}
13246+
if ($ProfileName) {
13247+
$Profile = Get-SgwProfile -ProfileName $ProfileName
13248+
if (!$Profile.Name) {
13249+
Throw "Profile $ProfileName not found. Create a profile using New-SgwProfile or connect to a StorageGRID Server using Connect-SgwServer"
13250+
}
13251+
$Server = Connect-SgwServer -Name $Profile.Name -Credential $Profile.Credential -AccountId $Profile.AccountId -SkipCertificateCheck:$Profile.SkipCertificateCheck -DisableAutomaticAccessKeyGeneration:$Profile.disalble_automatic_access_key_generation -TemporaryAccessKeyExpirationTime $Profile.temporary_access_key_expiration_time -S3EndpointUrl $Profile.S3EndpointUrl -SwiftEndpointUrl $Profile.SwiftEndpointUrl -Transient
13252+
}
13253+
1323413254
if (!$Server) {
1323513255
$Server = $Global:CurrentSgwServer
1323613256
}

0 commit comments

Comments
 (0)