REST API knowledge exchange
Post Reply
Stef4o
Novice
Posts: 3
Liked: never
Joined: Feb 25, 2020 9:51 am
Full Name: Stefano

Backup export via restful API

Post by Stef4o »

Hi, I'm new to Veeam and I'm trying to obtain a backup export (full + incremental backups). I know it's possible from the Administrator console but, I wonder if a Restful API call is available and how it works.

Thank you in advance.

Stefano
benyoung
Veeam Software
Posts: 149
Liked: 47 times
Joined: May 25, 2016 3:29 am
Full Name: Ben Young
Contact:

Re: Backup export via restful API

Post by benyoung » 1 person likes this post

Off the top of my head there is not a direct way to do this via the Restful interface. You can get a list of backup files and could then wrap some additional code once you have those file names to go grab/zip/move/do whatever you intend at this point

Or you could use the powershell cmdlet Export-VBRBackup

https://helpcenter.veeam.com/docs/backu ... ml?ver=100
veremin
Product Manager
Posts: 20397
Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Backup export via restful API

Post by veremin » 1 person likes this post

Can you describe the use case a bit? Actually, you can simply copy paste backup chain to whatever location you want to and use it however you like. Thanks!
benyoung
Veeam Software
Posts: 149
Liked: 47 times
Joined: May 25, 2016 3:29 am
Full Name: Ben Young
Contact:

Re: Backup export via restful API

Post by benyoung »

Would have thought that was the easiest, easily driven programmatically all the way by getting the backup files via the EM api and then handling the rest
Stef4o
Novice
Posts: 3
Liked: never
Joined: Feb 25, 2020 9:51 am
Full Name: Stefano

Re: Backup export via restful API

Post by Stef4o »

Thank you all for quick replies.

Briefly, the use case:
I'm developing a service web application which monitors a series of remote machines collecting environmental data. Due the fact the software onboard is in continuous developement is mandatory having the machines under backup.
As additional service I'd like to give the opportunity to restore remotely one or more machine, even if the network configuration doesn't permit installing a managed Veeam Agent.

So in my immagination I thought about a web service for downloading backup files locally the machine and then feeding the Agent, to restore up to the point chosen by the local operator.
In this idea no remote Veeam Administrator is needed, also lowering the maintenance costs.

Executing a powershell script from a web call wasn't my primary option.
Furthermore, having the full path to the backup files isn't enough, because the Backup Repository is not directly accessible by my web application.
Is there any other option?
jhoughes
Veeam Vanguard
Posts: 282
Liked: 113 times
Joined: Apr 20, 2017 4:19 pm
Full Name: Joe Houghes
Location: Castle Rock, CO
Contact:

Re: Backup export via restful API

Post by jhoughes » 3 people like this post

There are some things to be clarified from your original question and then explanation, are these VMs or systems running agents? You ask about shipping an entire backup chain, but then performing "restore up to the point chosen by the local operator".

This could be done either with a restore of a VM to a particular restore point, or restoring individual files/directories to a VM or agent if you need a more granular restore.

This is already native to the Enterprise Manager UI, so users could access that via the product with "no remote Veeam administrator" needed as you said. Doing this via the UI will also allow for the use of RBAC via vSphere permissions, thus allowing for easier & more granular access restrictions. In my mind, this is the best available option for what you are trying to do.

If you want to code this via the API, here are some steps to help you down that path.

The easiest method for a VM is just to restore to a prior restore point:
https://helpcenter.veeam.com/docs/backu ... ml?ver=100

If you need to perform a file/directory restore, you'll need some additional steps. If these are agents, they would need to be in server mode to perform 1-click file restore.

If these are VMs, you could have users leverage the restore method for a given file path, which will restore either a file or directory to either the original location, or allow for a local download from wherever they are accessing the Enterprise Manager UI.

Otherwise, you could wrap this into your web app to handle these calls. You will need to get the VM restore points to select one, mount it, and the traverse the file tree to a path to select for restore. The URI for this method essentially shows you what you will need to do:

For a VM:
https://helpcenter.veeam.com/docs/backu ... ml?ver=100

For an agent:

https://helpcenter.veeam.com/docs/backu ... ml?ver=100

You may need to list out multiple directories as options for restore within your web app, then call the restore method multiple times.

Hope this helps.
Husband, Father, Solutions Architect, Geek | @DenverVMUG & @DenverPSUG leader | International Speaker | Veeam Vanguard | vExpert (PRO) | Cisco Champion
benyoung
Veeam Software
Posts: 149
Liked: 47 times
Joined: May 25, 2016 3:29 am
Full Name: Ben Young
Contact:

Re: Backup export via restful API

Post by benyoung » 1 person likes this post

I guess the biggest clarification here is "backup files" - it sounds from your latest post you mean files within the operating system, i.e c:\Data\Records.db as opposed to the backup chain of the machine that Veeam creates when it performs a backup?

For guest files as Joe describes the mount can be traversed, here is what I built for our multi-tenant platform allowing customers to self-service restore either into Guest or Download

Quick demo (starts at the correct time) : https://youtu.be/2R3TbalwFv8?t=185
Stef4o
Novice
Posts: 3
Liked: never
Joined: Feb 25, 2020 9:51 am
Full Name: Stefano

Re: Backup export via restful API

Post by Stef4o »

Thank you very much for your replies, I apologize for my poor explanation, but it's not easy condensing a software project like this in a few words...
I must admit I didn't consider your point of view, so thank you again for your suggestions, I'll give them a try.
I think we could hibernate this post for a while ;)
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests