Get Job List ?

RESTful knowledge exchange

Get Job List ?

Veeam Logoby merz » Thu Oct 03, 2013 11:20 am

Hi,

I'm evaluating the REST API of "Veeam Backup & Replication for VMware and Hyper-V" (version 7.0.0.690).
I have add one backup server in "Backup Enterpise Manager".
I have perform a restart after adding the backup server.
The "Backup Enterpise Manager" web UI (https://my-host:9443) displays the specified jobs and I can start/stop these.

Now I'm try to get this job list with the API, but I have no success.
I use the same user/pw for REST and web-UI.


GET 'http://my-host:9399/api/backupServers' looks correct:
Code: Select all
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<EntityReferences 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">
    <Ref Href="http://the-host:9399/api/backupServers/f7488e56-45c3-4007-b1b4-3740bfad97c8" Name="the-host" Type="BackupServerReference" UID="urn:veeam:BackupServer:f7488e56-45c3-4007-b1b4-3740bfad97c8">
        <Links>
            <Link Href="http://the-host:9399/api/backupServers/f7488e56-45c3-4007-b1b4-3740bfad97c8/jobs" Rel="Down" Type="JobReferenceList"/>
            <Link Href="http://the-host:9399/api/backupServers/f7488e56-45c3-4007-b1b4-3740bfad97c8/repositories" Rel="Down" Type="RepositoryReferenceList"/>
            <Link Href="http://the-host:9399/api/backupServers/f7488e56-45c3-4007-b1b4-3740bfad97c8/credentials" Rel="Down" Type="CredentialsList"/>
            <Link Href="http://the-host:9399/api/backupServers/f7488e56-45c3-4007-b1b4-3740bfad97c8?format=Entity" Name="the-backup-host" Rel="Alternate" Type="BackupServer"/>
        </Links>
    </Ref>
</EntityReferences>



GET 'http://the-host:9399/api/backupServers/f7488e56-45c3-4007-b1b4-3740bfad97c8/jobs' returns no jobs:
Code: Select all
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<EntityReferences 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"/>



GET 'http://the-host:9399/api/backupServers/f7488e56-45c3-4007-b1b4-3740bfad97c8/jobs?format=Entity' returns no jobs:
Code: Select all
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Jobs 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"/>



GET 'http://the-host:9399/api/jobs?format=Entity' returns no jobs:
Code: Select all
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Jobs 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"/>



GET 'http://the-host:9399/api/query?type=job&format=entities&sortAsc=name' returns:
Code: Select all
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<QueryResult 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">
    <Entities>
        <Jobs/>
    </Entities>
    <PagingInfo PageNum="1" PageSize="100" PagesCount="1">
        <Links>
            <Link Href="http://the-host:9399/api/query?type=job&amp;format=entities&amp;sortAsc=name&amp;pageSize=100&amp;page=1" Rel="First"/>
            <Link Href="http://the-host:9399/api/query?type=job&amp;format=entities&amp;sortAsc=name&amp;pageSize=100&amp;page=1" Rel="Last"/>
        </Links>
    </PagingInfo>
</QueryResult>



GET 'http://the-host:9399/api/query?type=job&format=entities&sortAsc=name&pageSize=100&page=1' return no jobs:
Code: Select all
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<QueryResult 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">
    <Entities>
        <Jobs/>
    </Entities>
</QueryResult>


I have no idea what I'm doing wrong.

Thanks
merz
Novice
 
Posts: 4
Liked: 2 times
Joined: Thu Oct 03, 2013 10:40 am
Full Name: Reto Merz

Re: Get Job List ?

Veeam Logoby v.Eremin » Thu Oct 03, 2013 1:09 pm

I’m wondering whether you’ve already tried the following simple API call:

Code: Select all
GET http://the-host:9399/api/jobs


This API call is supposed to return a list of jobs created on all Veeam Backup servers connected to Veeam Backup Enterprise Manager. Thanks.
v.Eremin
Veeam Software
 
Posts: 13279
Liked: 969 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get Job List ?

Veeam Logoby merz » Thu Oct 03, 2013 1:25 pm

Thanks for your reply.

GET 'http://the-host:9399/api/jobs' is also empty:

Code: Select all
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<EntityReferences 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"/>


Edit:
I have a trial licence and here is a web UI screen
Image
merz
Novice
 
Posts: 4
Liked: 2 times
Joined: Thu Oct 03, 2013 10:40 am
Full Name: Reto Merz

Re: Get Job List ?

Veeam Logoby v.Eremin » Thu Oct 03, 2013 1:32 pm

If you open the following URL, will you see any jobs listed there?

Code: Select all
http://the-host:9399/api/jobs


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

Re: Get Job List ?

Veeam Logoby merz » Thu Oct 03, 2013 1:45 pm

You can see the result of 'http://the-host:9399/api/jobs' above (3. post).
When I open this URL with a web browser without login/session-token I get (as expected) error 401.
merz
Novice
 
Posts: 4
Liked: 2 times
Joined: Thu Oct 03, 2013 10:40 am
Full Name: Reto Merz

Re: Get Job List ?

Veeam Logoby tsightler » Thu Oct 03, 2013 2:07 pm

I believe that the API only returns jobs of type "Backup" and "Replication", but your Enterprise Manager show only jobs of type "Backup Copy" and "Copy". I don't know if there's a method to get API to return those job types.
tsightler
Veeam Software
 
Posts: 4769
Liked: 1737 times
Joined: Fri Jun 05, 2009 12:57 pm
Full Name: Tom Sightler

Re: Get Job List ?

Veeam Logoby nefes » Thu Oct 03, 2013 2:11 pm

Actually, current scope of jobs list is limited to Backup and Replica jobs, as Tom already mentioned.
Since you doesn't have any of them, the list is empty.
Could you please clarify a little bit, what scenario do you see for any other job interaction? It will help us to understand if that requires future improvement, or maybe find some workaround for you.
nefes
Veeam Software
 
Posts: 534
Liked: 125 times
Joined: Mon Dec 10, 2012 8:44 am
Full Name: Nikita Efes

Re: Get Job List ?

Veeam Logoby merz » Thu Oct 03, 2013 3:00 pm 2 people like this post

Thank you Vladimir, Tom and Nikita for your help.

It works with a "backup" job.
I'm just evaluating and I think this type of job is okay for us.

It would be nice to see a section "limitations" in the next version of veeam_backup_7_0_web_api.pdf ;)
merz
Novice
 
Posts: 4
Liked: 2 times
Joined: Thu Oct 03, 2013 10:40 am
Full Name: Reto Merz

[MERGED] BackupCopy job

Veeam Logoby bbbjohn » Thu Apr 27, 2017 3:40 pm

Hi - Based on the post below, it appears the API does not return BackupCopy jobs? Can someone confirm this is correct?
restful-api-f30/get-job-list-t18572.html

Both:
(GET) /jobs
(GET) /jobs/{ID}

Thanks.
bbbjohn
Lurker
 
Posts: 2
Liked: never
Joined: Thu Apr 27, 2017 3:35 pm
Full Name: John Silvia

Re: Get Job List ?

Veeam Logoby v.Eremin » Thu Apr 27, 2017 3:57 pm

It should have been fixed already. The latest product version definitely supports that.
v.Eremin
Veeam Software
 
Posts: 13279
Liked: 969 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Get Job List ?

Veeam Logoby bbbjohn » Thu Apr 27, 2017 4:24 pm

Thanks for the quick response.

I did see that the documentation stated that "BackupCopy" was one of the possible values for JobType. However when I get a listing of jobs [(GET) /jobs], none of the BackupCopy jobs are included. In my scenario, there are 16 BackupCopy jobs that are not returned by the get call. All backup and replica jobs (over 200) are returned correctly. I am also able to reproduce this issue on 2 other Enterprise Manager Servers.

If I attempt to get the individual BackupCopy job [GET) /jobs/{ID}], I get a 404 error:
<Error Message="Cannot find job [xxxx]" StatusCode="404" />
All backup and replica jobs return successful 200 code.

Is it possible this is still a limitation?

VEEAM BACKUP ENTERPRISE MANAGER SERVICE
Version:9.5.0.823
bbbjohn
Lurker
 
Posts: 2
Liked: never
Joined: Thu Apr 27, 2017 3:35 pm
Full Name: John Silvia

Re: Get Job List ?

Veeam Logoby v.Eremin » Thu May 11, 2017 6:57 pm

Hmm, can you open a ticket with our support team and share its number here? The described situation does not look expected, as starting from version 9.5 backup copy jobs along with their backups should be visible through RESTful API. Thanks.
v.Eremin
Veeam Software
 
Posts: 13279
Liked: 969 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to RESTful API



Who is online

Users browsing this forum: No registered users and 2 guests