RESTful knowledge exchange
Post Reply
joshima
Enthusiast
Posts: 25
Liked: 1 time
Joined: May 30, 2023 12:58 pm
Contact:

get html reports with rest api, possible?

Post by joshima »

Hey guys,

Is it possible to use the REST Api to generate the same HTML reports for backup jobs as you can do on the veeam user interface?

thank you

best regards
oleg.feoktistov
Veeam Software
Posts: 1960
Liked: 650 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: get html reports with rest api, possible?

Post by oleg.feoktistov »

Hi,

If you mean triggering report generation that would be an equivalent of a button in the UI, then it's not possible now. But you can certainly gather some info on the job runs and generate html report on the client side.

The endpoints to start would be /sessions and /jobs.

Most of the stats on read and processed data are not available through VBR REST yet though.

Best regards,
Oleg
joshima
Enthusiast
Posts: 25
Liked: 1 time
Joined: May 30, 2023 12:58 pm
Contact:

Re: get html reports with rest api, possible?

Post by joshima »

hey thank you for your response thats exactly what I needed. But I get http error 404 when executing my script do I need to configure the rest api for all functionatily or?
joshima
Enthusiast
Posts: 25
Liked: 1 time
Joined: May 30, 2023 12:58 pm
Contact:

Re: get html reports with rest api, possible?

Post by joshima »

oleg.feoktistov wrote: Jun 12, 2024 1:08 pm Hi,

If you mean triggering report generation that would be an equivalent of a button in the UI, then it's not possible now. But you can certainly gather some info on the job runs and generate html report on the client side.

The endpoints to start would be /sessions and /jobs.

Most of the stats on read and processed data are not available through VBR REST yet though.

Best regards,
Oleg
hey thank you for your response thats exactly what I needed. But I get http error 404 when executing my script do I need to configure the rest api for all functionatily or?
oleg.feoktistov
Veeam Software
Posts: 1960
Liked: 650 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: get html reports with rest api, possible?

Post by oleg.feoktistov »

Depends on your script. But 404 code usually means VBR cannot find the particular endpoint you are calling. Could you please share your script here omitting any private data? I'll have a look. Thanks!
joshima
Enthusiast
Posts: 25
Liked: 1 time
Joined: May 30, 2023 12:58 pm
Contact:

Re: get html reports with rest api, possible?

Post by joshima »

hey,

I make a post request for auth token afterwards get request on this url https://enterprisemanagerhost:9398/api/v1/sessions
joshima
Enthusiast
Posts: 25
Liked: 1 time
Joined: May 30, 2023 12:58 pm
Contact:

Re: get html reports with rest api, possible?

Post by joshima »

oleg.feoktistov wrote: Jun 14, 2024 1:34 pm Depends on your script. But 404 code usually means VBR cannot find the particular endpoint you are calling. Could you please share your script here omitting any private data? I'll have a look. Thanks!
hey,

I make a post request for auth token afterwards get request on this url https://enterprisemanagerhost:9398/api/v1/sessions

thank you so much
joshima
Enthusiast
Posts: 25
Liked: 1 time
Joined: May 30, 2023 12:58 pm
Contact:

Re: get html reports with rest api, possible?

Post by joshima »

oleg.feoktistov wrote: Jun 14, 2024 1:34 pm Depends on your script. But 404 code usually means VBR cannot find the particular endpoint you are calling. Could you please share your script here omitting any private data? I'll have a look. Thanks!

Code: Select all

 headers = {"X-RestSvcSessionId":session}
    # headers = {"x-api-version": "1.1-rev1", "Authorization": session}
    logger.info("Starting data retrieval process")
    try:
        logger.info(f"Contacting API at {apiurl}")
        # response=req.get(apiurl+'/reports/summary/job_statistics', headers=headers, verify=False)
        response=req.get(apiurl+'/v1/sessions', headers=headers, verify=False)
oleg.feoktistov
Veeam Software
Posts: 1960
Liked: 650 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: get html reports with rest api, possible?

Post by oleg.feoktistov »

Hi,

Apologies, there must have been a misunderstanding. For some reason, I automatically thought that you are using VBR REST API, my bad. I see now that you are referring to EM REST API. In that case, you could start with GET /jobs?format=Entity and GET /backupSessions?format=Entity and filter required data on client side. GET /reports/summary/job_statistics wouldn't contain all the info you could need for an HTML report.

Best regards,
Oleg
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest