RESTful knowledge exchange
Post Reply
Aravind
Novice
Posts: 6
Liked: never
Joined: Mar 16, 2023 6:51 am
Full Name: Aravind
Contact:

Api for getting backup job name, backup job description, ci name

Post by Aravind »

Hi
Using REST API we need to get the backup job name, backup job description, ci name (server that is being backed up), state, severity, creation time & end time.
By using sessions api we are getting like this-
{
      "sessionType": "ConfigurationBackup",
      "state": "Stopped",
      "id": "65803d57-eeab-4d20-9f08-bbfc4aacd1d5",
      "name": "Backup Configuration Job",
      "activityId": "99d1bf3d-e2e0-4bec-b2b3-820c0b87d212",
      "creationTime": "2023-03-17T10:00:01.707+05:30",
      "endTime": "2023-03-17T10:00:14.957+05:30",
      "progressPercent": 100,
      "result": {
        "result": "Warning",
        "message": "Skipping credentials backup because encryption is disabled. This will complicate the restore process significantly. Enable configuration backup encryption to stop receiving this warning.",
        "isCanceled": false
      },
      "resourceId": null,
      "resourceReference": null,
      "parentSessionId": null,
      "usn": 0
    }

But here we are not getting backup job name, backup description, ci name.
And there is no common id in session api, backups and backup job api to club the responses.
Glad to receive some help here.
chris.arceneaux
VeeaMVP
Posts: 668
Liked: 359 times
Joined: Jun 24, 2019 1:39 pm
Full Name: Chris Arceneaux
Location: Georgia, USA
Contact:

Re: Api for getting backup job name, backup job description, ci name

Post by chris.arceneaux » 1 person likes this post

Hi Aravind,

It just so happens your example shows a configuration backup which is not a typical backup job. Here's a sample response for a typical job. Note the sessionType:

Code: Select all

{
      "sessionType": "Job",
      "state": "Stopped",
      "id": "43158432-0ca0-4a12-a9f4-4e46b874a650",
      "name": "automation",
      "activityId": "9c378cd8-de1e-44dd-bef4-b868d205aef0",
      "creationTime": "2023-04-05T01:30:02.133-04:00",
      "endTime": "2023-04-05T01:32:29.53-04:00",
      "progressPercent": 100,
      "result": {
            "result": "Success",
            "message": "Success",
            "isCanceled": false
      },
      "resourceId": "51a6f94d-64e3-49f3-b4c3-6322955d7436",
      "resourceReference": "/api/v1/backups/51a6f94d-64e3-49f3-b4c3-6322955d7436",
      "parentSessionId": null,
      "usn": 0
}
The backup job name is the name parameter.

Backup job description is only available within the backup job settings itself which is accessible here:

GET /api/v1/jobs

Objects protected during the backup session (CI name) can be found here:

GET /api/v1/backups/{id}/objects

Tying it all together, you can link the session to the job using the job name. Within the session results, use the resourceId or resourceReference to find the objects protected during that session.
Aravind
Novice
Posts: 6
Liked: never
Joined: Mar 16, 2023 6:51 am
Full Name: Aravind
Contact:

Re: Api for getting backup job name, backup job description, ci name

Post by Aravind »

Hi Chris
We are doing file level backup of a windows server and storing it in windows vm where the veeam software is installed.
These are the responses for GET /api/v1/jobs and GET /api/v1/backups/{id}/objects in my case
For GET /api/v1/jobs (It is empty idk why)
{
"data": [],
"pagination": {
"total": 0,
"count": 0,
"skip": 0,
"limit": 200
}
}

For GET /api/v1/backups/{id}/objects
{
"data": [
{
"platformName": "WindowsPhysical",
"id": "d18a3af4-d10e-4872-b395-b66f1d790752",
"name": "NTPFWIN01.ntmgmt.com",
"type": "Directory",
"platformId": "00000000-0000-0000-0000-000000000000",
"restorePointsCount": 12
}
],
"pagination": {
"total": 1,
"count": 1,
"skip": 0,
"limit": 1
}
}

But there are no common fileds in order to link the jobname and sessions api response.
Waiting for your reply on this.
chris.arceneaux
VeeaMVP
Posts: 668
Liked: 359 times
Joined: Jun 24, 2019 1:39 pm
Full Name: Chris Arceneaux
Location: Georgia, USA
Contact:

Re: Api for getting backup job name, backup job description, ci name

Post by chris.arceneaux »

Please note that in the current version, the REST API supports only jobs of the Backup type that include only VMware vSphere objects of the following types: VirtualMachine, vCenterServer, Datacenter, Cluster, Host, ResourcePool, Folder, Template, Tag, Datastore and DatastoreCluster. Objects with tags combination (or Multitag) are not supported.

Reference documentation

With this in mind, you'll need to leverage Veeam PowerShell cmdlets for this use case.
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests