REST API knowledge exchange
Post Reply
syellayi
Novice
Posts: 5
Liked: never
Joined: Feb 02, 2023 9:49 am
Full Name: Swaroop Yellayi
Contact:

API for VEM Backup Status of Individual Server

Post by syellayi »

Hi,

We are trying to get the result of individual server backup status(example: Success/Failure) using REST API. However, we tried below REST APIs and we get multiple API links in the response.

Example:

API 1- (backups): https://xyz.com:1234/api/backups/ (Response below)

Code: Select all

{
            "Links": [
                {
                    "Rel": "Up",
                    "Href": "https://xyz.com:1234/api/backupServers/f8c72d42-1307-48af-a4d4-37ca42ad0fef",
                    "Name": "xyz.com",
                    "Type": "BackupServerReference"
                },
                {
                    "Rel": "Up",
                    "Href": "https://xyz.com:1234/api/repositories/bb46742a-3bea-43a3-83bc-7fb330071630",
                    "Name": "Scale-out Backup Repository",
                    "Type": "RepositoryReference"
                },
                {
                    "Rel": "Alternate",
                    "Href": "https://xyz.com:1234/api/backups/52ac6f4e-5f13-405a-8c54-fe7411b99e82?format=Entity",
                    "Name": "Daily Backup to HDD -IN-GGN002 LA00008B",
                    "Type": "Backup"
                },
                {
                    "Rel": "Down",
                    "Href": "https://xyz.com:1234/api/backups/52ac6f4e-5f13-405a-8c54-fe7411b99e82/restorePoints",
                    "Name": null,
                    "Type": "RestorePointReferenceList"
                },
                {
                    "Rel": "Down",
                    "Href": "https://xyz.com:1234/api/backups/52ac6f4e-5f13-405a-8c54-fe7411b99e82/backupFiles",
                    "Name": null,
                    "Type": "BackupFileReferenceList"
                }
            ],
            "UID": "urn:veeam:Backup:52ac6f4e-5f13-405a-8c54-fe7411b99e82",
            "Name": "Daily Backup to HDD -IN-GGN002 LA00008B",
            "Href": "https://xyz.com:1234/api/backups/52ac6f4e-5f13-405a-8c54-fe7411b99e82",
            "Type": "BackupReference"
        }
        
________________________________________________________________________________________________________________
API 2 - (backups{ID}): https://xyz.com:1234/api/backups/52ac6f ... 7411b99e82 (Response below)

Code: Select all

{
    "Links": [
        {
            "Rel": "Up",
            "Href": "https://xyz.com:1234/api/backupServers/f8c72d42-1307-48af-a4d4-37ca42ad0fef",
            "Name": "XYZ.com",
            "Type": "BackupServerReference"
        },
        {
            "Rel": "Up",
            "Href": "https://xyz.com:1234/api/repositories/bb46742a-3bea-43a3-83bc-7fb330071630",
            "Name": "Scale-out Backup Repository",
            "Type": "RepositoryReference"
        },
        {
            "Rel": "Alternate",
            "Href": "https://xyz.com:1234/api/backups/52ac6f4e-5f13-405a-8c54-fe7411b99e82?format=Entity",
            "Name": "Daily Backup to HDD -IN-GGN002 LA00008B",
            "Type": "Backup"
        },
        {
            "Rel": "Down",
            "Href": "https://xyz.com:1234/api/backups/52ac6f4e-5f13-405a-8c54-fe7411b99e82/restorePoints",
            "Name": null,
            "Type": "RestorePointReferenceList"
        },
        {
            "Rel": "Down",
            "Href": "https://xyz.com:1234/api/backups/52ac6f4e-5f13-405a-8c54-fe7411b99e82/backupFiles",
            "Name": null,
            "Type": "BackupFileReferenceList"
        }
    ],
    "UID": "urn:veeam:Backup:52ac6f4e-5f13-405a-8c54-fe7411b99e82",
    "Name": "Daily Backup to HDD -IN-GGN002 LA00008B",
    "Href": "https://xyz.com:1234/api/backups/52ac6f4e-5f13-405a-8c54-fe7411b99e82",
    "Type": "BackupReference"
}
__________________________________________________________________________________________________________________
Concern over here is, we aren’t able to narrow down to the correct API where we can get individual server VEM backup status e.g., (success/failure).

Could you please help me to get the correct API where I can get just the Individual server VEM backup status only.

Thanking you with Anticipation.

Regards
Swaroop Yellayi
ronnmartin61
Veeam Software
Posts: 526
Liked: 182 times
Joined: Mar 07, 2016 3:55 pm
Full Name: Ronn Martin
Contact:

Re: API for VEM Backup Status of Individual Server

Post by ronnmartin61 »

I believe you'd need to drill into the backup tasks to make this sort of determination for a given VM something like -

Code: Select all

https://vemsvr:9398/api/query?type=BackupTaskSession&format=Entities&filter=VmDisplayName=="myVMName"&sortDesc=CreationTime
syellayi
Novice
Posts: 5
Liked: never
Joined: Feb 02, 2023 9:49 am
Full Name: Swaroop Yellayi
Contact:

Re: API for VEM Backup Status of Individual Server

Post by syellayi »

Hello Team,

Thanks for your response. Your approach helped us.

Question : What is the query parameter for "Location" and how to get the results of the backup for last 24hrs ? We tried looking into the official documentation,
however, we couldn't find the relevant query parameters to achieve the asked question.

Example:
Location: scale-out*
Last Success: 14hrs/24hrs

Regards
Swaroop Yellayi
oleg.feoktistov
Veeam Software
Posts: 2010
Liked: 669 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: API for VEM Backup Status of Individual Server

Post by oleg.feoktistov » 1 person likes this post

Hi Swaroop,

I guess you'd need to implement some querying and filtering on client's side to achive that:

1. CreationTime adn EndTime parameters for BackupTaskSession query don't support expressions like >= or <=, so you need to query them all by other filters and then choose the ones with the desired CreationTime & EndTime.

2. There is no direct link between a task session and a repository created restore point resides on. But you can get it in few steps:
  • In BackupTaskSession query result follow the link of VmRestorePoint type.
  • In VmRestorePoint object follow the link of RestorePointReference type.
  • In RestorePointReference object choose the link of BackupReference type.
  • Finally, in BackupReference object see the link of RepositoryReference type. You can get repository id and name right from that link. No need to follow it.
So with some tweaks and querying from client's side you can have it reflected in the format you need.

Best regards,
Oleg
syellayi
Novice
Posts: 5
Liked: never
Joined: Feb 02, 2023 9:49 am
Full Name: Swaroop Yellayi
Contact:

Re: API for VEM Backup Status of Individual Server

Post by syellayi »

Hello Team,

Thanks for your response.

I followed your provided steps.

Question : In BackupTaskSession query result, few of responses contains VmRestorePoint type and in few of responses doesn't contains VmRestorePoint type. Could you please guide on it to find the location in such scenario.

Regards
Swaroop Yellayi
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest