RESTful knowledge exchange
Post Reply
merz
Novice
Posts: 4
Liked: 2 times
Joined: Oct 03, 2013 10:40 am
Full Name: Reto Merz
Contact:

Get Job List ?

Post by merz »

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/ ... d97c8/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/ ... mat=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 ... rtAsc=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&format=entities&sortAsc=name&pageSize=100&page=1" Rel="First"/>
            <Link Href="http://the-host:9399/api/query?type=job&format=entities&sortAsc=name&pageSize=100&page=1" Rel="Last"/>
        </Links>
    </PagingInfo>
</QueryResult>

GET 'http://the-host:9399/api/query?type=job ... 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
veremin
Product Manager
Posts: 20271
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get Job List ?

Post by veremin »

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.
merz
Novice
Posts: 4
Liked: 2 times
Joined: Oct 03, 2013 10:40 am
Full Name: Reto Merz
Contact:

Re: Get Job List ?

Post by merz »

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
veremin
Product Manager
Posts: 20271
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get Job List ?

Post by veremin »

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

Code: Select all

http://the-host:9399/api/jobs 
Thanks.
merz
Novice
Posts: 4
Liked: 2 times
Joined: Oct 03, 2013 10:40 am
Full Name: Reto Merz
Contact:

Re: Get Job List ?

Post by merz »

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.
tsightler
VP, Product Management
Posts: 6011
Liked: 2843 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

Re: Get Job List ?

Post by tsightler »

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.
nefes
Veeam Software
Posts: 643
Liked: 162 times
Joined: Dec 10, 2012 8:44 am
Full Name: Nikita Efes
Contact:

Re: Get Job List ?

Post by nefes »

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.
merz
Novice
Posts: 4
Liked: 2 times
Joined: Oct 03, 2013 10:40 am
Full Name: Reto Merz
Contact:

Re: Get Job List ?

Post by merz » 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 ;)
bbbjohn
Lurker
Posts: 2
Liked: never
Joined: Apr 27, 2017 3:35 pm
Full Name: John Silvia
Contact:

[MERGED] BackupCopy job

Post by bbbjohn »

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.
veremin
Product Manager
Posts: 20271
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get Job List ?

Post by veremin »

It should have been fixed already. The latest product version definitely supports that.
bbbjohn
Lurker
Posts: 2
Liked: never
Joined: Apr 27, 2017 3:35 pm
Full Name: John Silvia
Contact:

Re: Get Job List ?

Post by bbbjohn »

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
veremin
Product Manager
Posts: 20271
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Get Job List ?

Post by veremin »

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.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests