RESTful knowledge exchange
Post Reply
afokkema
Service Provider
Posts: 24
Liked: 3 times
Joined: Feb 13, 2009 2:00 pm
Full Name: Arne Fokkema
Location: Netherlands
Contact:

Backup API Job relation missing in VEM API

Post by afokkema »

We're trying to get information about jobs and their resulting backups from the VEM API. However we are facing some difficulties tying everything together. This is mainly because of missing links between entities which are not being provided by the VEM API.

In this particular example we are trying to determine which job is related to what backup.

The optimal route would be:
1. Asking the query service for all backups it knows about (/api/query?type=Backup call).
2. For each backup returned look up the link to the backup job. If you need just the id of the backup job a single API call for all the backups would suffice.

However the API output does not provide information about that relation.

We have ventured into getting the information the other way around:

1. Getting all the backup jobs the query service knows about.
2. Iterate through the jobs and query the query service for backups related to that specific job uid (using the JobUid filter on the /api/query?type=Backup call). For every backup returned it means that it is related to that job.
3. Query the query service for all backups without a filter. Every backup not included in the output of the previous step is considered an orphaned backup.

This works but due to the nature of the API this is very slow/inefficient and on top of that very expensive for the Enterprise Manager SQL service.

By digging into the underlying VEM database it looks like the information is already available: the dbo.Rest.BackupsView view already provides the required information job_name and job_id. The Enterprise Manager application however filters this away.


Can you look into this and expose this job_id field through the /query?type=Backup REST API call? If needed some example code can be provided.
oleg.feoktistov
Veeam Software
Posts: 1912
Liked: 635 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Backup API Job relation missing in VEM API

Post by oleg.feoktistov » 1 person likes this post

Hi Arne,

You've made a good point. It would make sense to have a direct link to a job in backup model (maybe even in conjunction with JobUID). Consider your request noted. Can't guarantee any ETA on that, but the fact that it is already exposed in VEM DB helps a lot.

Thanks,
Oleg
chris.arceneaux
VeeaMVP
Posts: 667
Liked: 358 times
Joined: Jun 24, 2019 1:39 pm
Full Name: Chris Arceneaux
Location: Georgia, USA
Contact:

Re: Backup API Job relation missing in VEM API

Post by chris.arceneaux »

In the meantime, here's a workaround that can be used:
  1. Retrieve all backups jobs
  2. Query backups using filter to exclude backups related to all known backup jobs using UIDs from previous API call:
    • Example: /api/query?format=Entities&type=Backup&filter=(JobUid!="urn:veeam:Job:e31409b0-7c33-4ddb-97f8-be498edd170d";JobUid!="urn:veeam:Job:2d3053b0-68d0-4acb-8386-1d81b7df87d7")
  3. Backups returned from step #2 can be validated as to whether they are orphaned.
afokkema
Service Provider
Posts: 24
Liked: 3 times
Joined: Feb 13, 2009 2:00 pm
Full Name: Arne Fokkema
Location: Netherlands
Contact:

Re: Backup API Job relation missing in VEM API

Post by afokkema » 1 person likes this post

Thanks!

The supplied workaround was already in place but it takes a while to process 4K jobs and it's resource-heavy for the server running VEM. So we build another workaround using the Veeam Enterprise manager API and Veeam VBR API together and this solution is running ok for the moment.

We do prefer to collect the data from the VEM API if possible.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests