Hello Team
I was trying to get the running jobs for a specific VM. I have below code but it is returning zero results.
function Get-CVVMJobStatus {
param (
$VMName
)
$vmGuid = ($Global:CVVMData.vmStatusInfoList | Where-Object name -eq $VMName).strGUID
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Accept", "application/json")
$headers.Add("Authtoken", $Global:cvToken)
$URI = "http://xxxx/webconsole/api/v2/vsa/vm/$vmGuid/Jobs?completedJobLookupTime=3600&jobTypeList=backup&showAgedJobs=true&backupLevel=Full,Incremental"
$response = Invoke-RestMethod $URI -Method 'GET' -Headers $headers
$JobsData
return $response
}
Best answer by Carl Manzi
View original