Adding new VMs to a job

RESTful knowledge exchange

Adding new VMs to a job

Veeam Logoby abqstu » Tue Aug 27, 2013 11:54 am

Can you tell me how I would add a new VM to an existing job.
I've seen the (POST) /jobs/{ID}/includes command but this requires a hierarchyObjRef and hierarchyObjName to be specified. If I was moving a VM from one job to another, then I could get this information from the Includes section of the job's BackupJobInfo, but where would I get this information for a VM that has never been added to a job ?

Stuart
abqstu
Influencer
 
Posts: 11
Liked: never
Joined: Tue Aug 27, 2013 11:37 am

Re: Adding new VMs to a job

Veeam Logoby v.Eremin » Tue Aug 27, 2013 1:00 pm

Hi, Stuart. The type of the HierarchyObjRef element is HierarchyObjRefType. The HierarchyObjRefType object can be either created manually or obtained using /lookupSvc. More detailed information regarding it can be found in the corresponding User Guide (p. 329).

Thanks.
v.Eremin
Veeam Software
 
Posts: 13293
Liked: 973 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Adding new VMs to a job

Veeam Logoby abqstu » Thu Aug 29, 2013 8:59 am

Thanks Vladimir. That's just what I was looking for.
abqstu
Influencer
 
Posts: 11
Liked: never
Joined: Tue Aug 27, 2013 11:37 am

Re: Adding new VMs to a job

Veeam Logoby v.Eremin » Thu Aug 29, 2013 9:12 am

Glad to hear that my input was helpful. Should any additional help be needed, don’t hesitate to let us know. Thanks.
v.Eremin
Veeam Software
 
Posts: 13293
Liked: 973 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Adding new VMs to a job

Veeam Logoby RGrehan83 » Wed Sep 18, 2013 7:03 pm

Hello,

Apologies for hijacking this thread - I have asked this before (relating to v6.5), but could you please advise if it is possible to automate the adding of new vApps or VMs to an existing backup job? Specifically vApps that are named a certain way (i.e a prefix), to avoid having to manually add them to a job each time.

Thanks,

Robert JG
RGrehan83
Novice
 
Posts: 3
Liked: never
Joined: Thu Aug 08, 2013 12:55 pm
Full Name: Robert Grehan

Re: Adding new VMs to a job

Veeam Logoby Vitaliy S. » Thu Sep 19, 2013 10:45 am

Hello Robert,

I'm not great in scripting, but I believe you can use hierarchyRoots to get the list of ESXi servers added to the backup console and then leverage lookupSvc to search for the new VMs/vApps (using the prefix you need) in the hierarchy returned in the first step.

Thank you!
Vitaliy S.
Veeam Software
 
Posts: 19571
Liked: 1104 times
Joined: Mon Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov

[MERGED] : Add VM to JOB

Veeam Logoby sirinech » Fri Apr 11, 2014 7:35 am

Hello,
I want to add a new VM to a job, but I don't know how to get the UID of the VM since it has never been added to a job. I tried to use the lookup but it's not working, is there any other way?
PS:
Request:
Code: Select all
http://localhost/api/lookup?host=urn:veeam:HierarchyRoot:b6bf37f7-6eb4-4d96-872e-111f37c67a48&name=test&type=Vm

Error: 404 Not found (even though the Host and the VM both exist)
sirinech
Influencer
 
Posts: 23
Liked: 1 time
Joined: Fri Mar 21, 2014 3:06 pm
Full Name: sirine chadly

Re: Adding new VMs to a job

Veeam Logoby sirinech » Fri Apr 11, 2014 7:55 am

Hello, how do I use the lookup request looking for a VM if there's no type VM?
sirinech
Influencer
 
Posts: 23
Liked: 1 time
Joined: Fri Mar 21, 2014 3:06 pm
Full Name: sirine chadly

Re: Adding new VMs to a job

Veeam Logoby v.Eremin » Fri Apr 11, 2014 8:57 am

The corresponding request should contain "Get" expression. Is the b6bf37f7-6eb4-4d96-872e-111f37c67a48 host UID? From my perspective, the right version should be similar to the following:

Code: Select all
GET http://localhost:9399/web/#/api/lookup?host=urn%3aveeam%3aHierarchyRoot%b6bf37f7-6eb4-4d96-872e-111f37c67a48&name=test&type=VM


Thanks.
v.Eremin
Veeam Software
 
Posts: 13293
Liked: 973 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Adding new VMs to a job

Veeam Logoby sirinech » Fri Apr 11, 2014 9:06 am

I did use that request but it didn't work . it says not enough parameters
sirinech
Influencer
 
Posts: 23
Liked: 1 time
Joined: Fri Mar 21, 2014 3:06 pm
Full Name: sirine chadly


Return to RESTful API



Who is online

Users browsing this forum: No registered users and 3 guests