rubrikinc / rubrik-powershell-sdk

The Rubrik Security Cloud SDK
https://www.powershellgallery.com/packages/RubrikSecurityCloud
MIT License
7 stars 8 forks source link

Get AsyncRequestStatus... #60

Open Bryan-Meier opened 5 months ago

Bryan-Meier commented 5 months ago

Hello,

Does anyone have any idea how to get the status a of a job that was executed via a createOnDemandMssqlBackup mutuation? I can't for the life of me figure out how this query or example isn't riddled throughout the documentation but I can't seem to find anything on it.

This goes to different issue which I will post separately... I never needed to figure this out when using the CDM Powershell module because the similar cmdlet in that module allowed us to supply a flag to wait for the job completion. This isn't included in the new RSC cmdlet, so it's on the user/customer to come up with their own wait logic.

guirava commented 4 months ago

Thanks for reporting this - Engineering is still working on it, we will circle back.

SahFari commented 3 months ago

https://github.com/rubrikinc/rubrik-powershell-sdk/issues/61

My work-around

$Status = Get-RscEventSeries -List | Where-Object {$_.ObjectId -eq $RscMssqlDatabaseID} | Select-Object LastActivityStatus, ObjectType, ObjectId, ActivitySeriesId, Fid

do { $Status = Get-RscEventSeries -List | Where-Object {$_.ObjectId -eq $RscMssqlDatabaseID} | Select-Object LastActivityStatus, ObjectType, ObjectId, ActivitySeriesId, Fid $Status.LastActivityStatus

} until ( $Status.LastActivityStatus -eq 'SUCCESS' -or $Status.LastActivityStatus -eq "FAILURE")

SahFari commented 1 month ago

-WaitForCompletion works after upgrade to Rubrik cmdlet (9.0.1)

$Database_ids | ForEach-Object{

    $backupjob = New-RubrikSnapshot -id $ -SLA $Sla -Confirm:$false

    Get-RubrikRequest -id $backup_job.id -Type mssql -WaitForCompletion #-Verbose

}