REST API knowledge exchange
Post Reply
dsharma
Lurker
Posts: 2
Liked: never
Joined: Jul 02, 2020 6:34 pm
Full Name: Deepak Sharma
Contact:

Detailed information of "job_statistics" request

Post by dsharma »

Hello all,

I am working on an internal portal of my company to show all the alerts and notifications on a single platform and we are also showing the Veeam alerts. I am using API's to achieve the same. However while running "/reports/summary/job_statistics". This gives me the following information.

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<JobStatisticsReportFrame xmlns="http://www.veeam.com/ent/v1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <RunningJobs>0</RunningJobs>
    <ScheduledJobs>21</ScheduledJobs>
    <ScheduledBackupJobs>21</ScheduledBackupJobs>
    <ScheduledReplicaJobs>0</ScheduledReplicaJobs>
    <TotalJobRuns>22</TotalJobRuns>
    <SuccessfulJobRuns>13</SuccessfulJobRuns>
    <WarningsJobRuns>1</WarningsJobRuns>
    <FailedJobRuns>8</FailedJobRuns>
    <MaxJobDuration>14400</MaxJobDuration>
    <MaxBackupJobDuration>14400</MaxBackupJobDuration>
    <MaxReplicaJobDuration>0</MaxReplicaJobDuration>
    <MaxDurationBackupJobName>PRODUCTION: SVT TOFS01, Once Per Day - 6pm</MaxDurationBackupJobName>
    <MaxDurationReplicaJobName/>
    <BackupJobStatusReportLink>Workspace/ViewReport.aspx?definition=7962844d-db6c-4d29-8b6e-4e0f7db0785f&amp;ShowParams=1</BackupJobStatusReportLink>
</JobStatisticsReportFrame>
I am interested in seeing the details of <WarningsJobRuns> and <FailedJobRuns> but I cannot find the relevant API request URLs. Can anyone please help.

Thanks,
DS
oleg.feoktistov
Veeam Software
Posts: 2006
Liked: 666 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Detailed information of "job_statistics" request

Post by oleg.feoktistov »

Hi,

You could use /querySvc endpoint to construct precise queries for such cases.

<WarningsJobRuns>:

Code: Select all

/api/query?type=BackupJobSession&filter=result==warning&format=Entities&sortAsc=name&pageSize=15&page=1
<FailedJobRuns>:

Code: Select all

/api/query?type=BackupJobSession&filter=result==failed&format=Entities&sortAsc=name&pageSize=15&page=1
Best regards,
Oleg
dsharma
Lurker
Posts: 2
Liked: never
Joined: Jul 02, 2020 6:34 pm
Full Name: Deepak Sharma
Contact:

Re: Detailed information of "job_statistics" request

Post by dsharma »

Hi Oleg,

Thanks for your quick response.
I tried what you advised but I am getting "Access Denied" error. I tried it by passing basic authentication with Uid and pwd but same result.
Any ideas please.

Regards,
DS
oleg.feoktistov
Veeam Software
Posts: 2006
Liked: 666 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Detailed information of "job_statistics" request

Post by oleg.feoktistov »

Hi,

Are you using Enterprise Manager with Enterprise Plus license?
Enterprise Plus license is required for REST to work correctly.
Also, make sure the account you access REST with have enough privileges.
The list of roles can be found here.

Thanks,
Oleg
neerajkhosla
Novice
Posts: 4
Liked: 1 time
Joined: Feb 20, 2022 9:32 am
Full Name: Neeraj Khosla
Contact:

Re: Detailed information of "job_statistics" request

Post by neerajkhosla »

Hi Oleg

I have another question here. I can see the following information contained in the response of job_statistics api.

Code: Select all

    <BackupJobStatusReportLink>Workspace/ViewReport.aspx?definition=7962844d-db6c-4d29-8b6e-4e0f7db0785f&amp;ShowParams=1</BackupJobStatusReportLink>
ViewReport.aspx seems to be a web page and it can be accessed through the browser. But how to construct the complete URL of this link, so that it can be accessed ? Or there is some other way to access it.

Thanks in advance.
Neeraj
oleg.feoktistov
Veeam Software
Posts: 2006
Liked: 666 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Detailed information of "job_statistics" request

Post by oleg.feoktistov »

Hi,

It looks like this is a service parameter, which cannot be consumed with REST API. Otherwise, it would make more sense to just put a whole link there. Can I offer you to have a look at excel report on job statuses mentioned here in Note section? It's not a precise analogue, but may have something interesting to offer.

Thanks,
Oleg
neerajkhosla
Novice
Posts: 4
Liked: 1 time
Joined: Feb 20, 2022 9:32 am
Full Name: Neeraj Khosla
Contact:

Re: Detailed information of "job_statistics" request

Post by neerajkhosla »

Hi Oleg

Thanks for the reply. Actually, my intention was to access the following report somehow using code, and without any manual intervention. I want to prepare different reports based on this data. Please check the link below.

https://prnt.sc/_OC9l3VwcA7l
oleg.feoktistov
Veeam Software
Posts: 2006
Liked: 666 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Detailed information of "job_statistics" request

Post by oleg.feoktistov »

We don't have any specific API call to download this report, but you can try Mimic report from our github community repo. It is coded in Powershell and generates the same data you are looking for. Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest