RESTful knowledge exchange
Post Reply
SmithJohn
Enthusiast
Posts: 47
Liked: never
Joined: Jan 31, 2013 3:36 am
Full Name: charles
Contact:

veeam provide api to enterprise manger or to b&r ?

Post by SmithJohn »

Hi,

I would like to ask 2 questions:
1) would veeam 7 provide restful api to the veeam B&R or only to the enterprise manger
2)if it only provide api to enterprise manger, would it able to support all the functions include 1)create job 2) start backup 3)restore
tsightler
VP, Product Management
Posts: 6009
Liked: 2843 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

Re: veeam provide api to enterprise manger or to b&r ?

Post by tsightler »

The RESTful API in V7 is layered on top of Enterprise Manager and exposes all functions of EM. You can create jobs by using the "Clone Job" function with the general idea being to create a master template job that you can clone and then edit the VMs included, VSS/Indexing options, etc. Full VM restore and FLR of indexed Windows guests is available via the API just like EM.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: veeam provide api to enterprise manger or to b&r ?

Post by veremin »

More information regarding RESTFul API can be found in the corresponding User Guide; so, kindly take a look. Thanks.
SmithJohn
Enthusiast
Posts: 47
Liked: never
Joined: Jan 31, 2013 3:36 am
Full Name: charles
Contact:

Re: veeam provide api to enterprise manger or to b&r ?

Post by SmithJohn »

As mentioned, I am developing a backup and restore portal by the API
I would like to know the VM ID in the backup guide is the UUID from VMware?
Could the schedule backup be set in the "edit" option ?

For restore, is the below api enough ?
(POST) /vmRestorePoints/{ID}?action=restore (Ref. P.184)
Vitaliy S.
VP, Product Management
Posts: 27055
Liked: 2710 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: veeam provide api to enterprise manger or to b&r ?

Post by Vitaliy S. »

Hi Charles,
SmithJohn wrote:I would like to know the VM ID in the backup guide is the UUID from VMware?
For object identification we are using IDs from HierrchyObjRef. See page 329 of the UG for more details.
SmithJohn wrote:Could the schedule backup be set in the "edit" option ?
Yes, you can set the desired scheduling options using PUT command.
SmithJohn wrote:For restore, is the below api enough ?
(POST) /vmRestorePoints/{ID}?action=restore (Ref. P.184)
The User Guide provides basic information on the restore procedure, to see full specification of the VM restore operation, please take a look at RestAPI.xsd. You can find the XSD file in the installation folder for Veeam Backup Enterprise Manager:

Code: Select all

%Program Files%\Veeam\Backup and Replication\Enterprise Manager\schemas\RestAPI.xsd.
Hope this helps!
SmithJohn
Enthusiast
Posts: 47
Liked: never
Joined: Jan 31, 2013 3:36 am
Full Name: charles
Contact:

Re: veeam provide api to enterprise manger or to b&r ?

Post by SmithJohn »

sorry. I still don't understand how to get the job ID and the vm ID.
and could I use the following command (POST) /jobs/{ID}?action=edit (Ref. P.92) for edit job and its schedule.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: veeam provide api to enterprise manger or to b&r ?

Post by veremin »

Hi, Charles.
and the vm ID.
I believe, you should utilize the /lookupSvc in order to get a reference to an object in the Virtual infrastructure. The resulting reference, gotten via /lookupSvc, will contain a virtual machine identifier: be it MorefID in case of VMware environment, or VM ID in case of Hyper-V one.

You can use the example given at page 300, changing variables (VM names, host ID) in accordance with your environment.
job ID
If you want to list all jobs created on backup server that are managed by a given Enterprise Manager, you will have to send the following HTTP request (p.80):

Code: Select all

GET http://<Enterprise-Manager>:9399/api/jobs 
Among other listed parameters you will see the job UID.

Thanks.
SmithJohn
Enthusiast
Posts: 47
Liked: never
Joined: Jan 31, 2013 3:36 am
Full Name: charles
Contact:

Re: veeam provide api to enterprise manger or to b&r ?

Post by SmithJohn »

Thanks. Now I could get the job ID through the api.
But I still need to use api to edit the job ( as to change the VM to be backup). May I know what would be the VM id( which is the VM found in vCenter). Could I use the UUID from VMware?
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: veeam provide api to enterprise manger or to b&r ?

Post by veremin »

As far as I know, VM id in case of VMware environment is represented by VM MorefID. Though, to be on the safe side I’d recommend running /lookupSvc call in order to get VM reference that contains the VM ID. Thanks.
abqstu
Influencer
Posts: 11
Liked: never
Joined: Aug 27, 2013 11:37 am
Contact:

Re: veeam provide api to enterprise manger or to b&r ?

Post by abqstu »

tsightler wrote:You can create jobs by using the "Clone Job" function with the general idea being to create a master template job that you can clone and then edit the VMs included
Is a template job different to a normal job ? If so, how do you create one ?
I'd like to create a template with no VMs added to it, but the Backup & Replication GUI won't allow me to create a job with no VMs.
Vitaliy S.
VP, Product Management
Posts: 27055
Liked: 2710 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: veeam provide api to enterprise manger or to b&r ?

Post by Vitaliy S. »

Cloned job has the same configuration and VMs added, but by default this job is disabled.
abqstu wrote:I'd like to create a template with no VMs added to it, but the Backup & Replication GUI won't allow me to create a job with no VMs.
Yes, that's expected. Any job should have at least one VM added, so please create any temp VM and add it to the job to create a master job template.
tsightler
VP, Product Management
Posts: 6009
Liked: 2843 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

Re: veeam provide api to enterprise manger or to b&r ?

Post by tsightler »

A job only needs a single object, so I usually suggest simply creating an empty folder and including that in the job. Then when you create new jobs from this you can always delete the folder once additional backup objects have been added.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests