Hi @ianm,
Looks like Platform is not included in the response. I’m from Veeam Product Management, so will discuss with the API owners to see if we can add that property to the response on protectedWorkloads/virtualMachines.
In the meantime, you can query https://helpcenter.veeam.com/docs/vac/rest/reference/vspc-rest.html?ver=9#tag/Backup-Server-Jobs/operation/GetBackupServerBackupVmJob
Pass the jobUid parameter from the protectedWorkloads/virtualMachines response to this endpoint, then check the subtype property in the response to get the source platform
Absolutely brilliant. Great to know Product Management is browsing. I’ll have a look at the alternative you suggest. While I have the attention of someone with power, can I ask, oh you’ve already seen the other query, I’ll add a comment there. 🙂 For anyone else reading, the other one was about how to get a list of agent jobs not managed by the VSPC (as in Protected Data → Computers → Managed by Backup Server). Love the VSPC by the way.
Getting it via the JobUid is fine. Actually makes more sense since many protected workloads can have the same JobUid. Interesting question though, what happens if a workload is backed up in different jobs? Does it appear in the list twice? I’ll have to check that.
I haven’t tested it but for this endpoint, I suspect it should be unique list since it’s an aggregate report of all protected workloads.
instanceUid property however is unique identifier for a workload and you can check fast for duplicates on that.
Unfortuantely getting the platform via jobUid doesn’t work as in many cases (at least for me) the jobUid from the protectedWorkloads/virtualMachines endpoint points to a copy job rather than a backup job and so the /infrastructure/backupServers/jobs/backupVmJob endpoint doesn’t return anything. Is this a bug? Should the jobUid be the actual backup job?
No, jobUid should refer to the job that produced the backup files. Backup Copies are a bit unique in that they can home multiple types of backups (VMware, HyperV, Agents, etc)
I don’t have a VSPC server available at the moment to test, but try passing the jobUid returned from above to this endpoint: https://helpcenter.veeam.com/docs/vac/rest/reference/vspc-rest.html?ver=9#tag/Backup-Server-Jobs/operation/GetBackupServerBackupVmJobObjects
Looks like there’s a platform value returned on the BackupVmJobObjects and potentially you can match the machines in the Backup Copy to their original platform this way
I agree it should, but it doesn’t, at least for me. The following Powershell
$workloads=Invoke-RestMethod -Uri "$uri/protectedWorkloads/virtualMachines?limit=10" -Headers $header | select -ExpandProperty data
$workloads | select name,@{n='type';e={ ( Invoke-RestMethod -Uri "$uri/infrastructure/backupServers/jobs/$($_.jobUid)" -Headers $header ).data.type } }
results in:
name type
---- ----
AP71-68Jk BackupVm
AP12-Y8DY BackupVm
AP52-joVH BackupVm
AP35-mBhR BackupVm
AP96-m6Gg SimpleBackupCopy
AP23-51iw SimpleBackupCopy
AP73-tKJ3 SimpleBackupCopy
AP18-Y5BM SimpleBackupCopy
AP93-KfPq SimpleBackupCopy
AP79-2qTb SimpleBackupCopy
As you can see, some of the jobUid’s point to backups and some to copy jobs.
For one of the workloads where jobUid points to a SimpleBackupCopy unsurprisingly /infrastructure/backupServers/jobs/backupVmJobs/{jobUid}/objects returns nothing as there isn’t a backupVmJob with that uid.
Thanks for the suggestion though. Appreciated.
I might be a bit confused as I don’t have ready access to the API, but where is the Type property coming from? From the endpoint spec linked before for getting the job objects, there ought be a Platform property in the response -- Type looks to return the job type itself, but we want to poll the objects within a job returned by the endpoint, no?
Type comes from looking the jobUid up against all backup server jobs (endpoint /infrastructure/backupServers/jobs) rather than just backup jobs.
Veeam Service Provider Console REST API Reference