RESTful knowledge exchange
Post Reply
manoj98
Novice
Posts: 3
Liked: never
Joined: Mar 19, 2024 8:42 am
Full Name: Manoj Kumar Motupalli
Contact:

Not able to schedule backup job to run automatically using REST API

Post by manoj98 »

Hi,

i am unable to schedule a backup job to run automatically in Veeam B&R using REST API. I am using the below JSON code to create a backup job with 'runAutomatically' set to true under schedule. Though the backup job is getting created, scheduling is not getting enabled and in response am seeing 'runAutomatically' as false even i am setting it as true in request body. Can you please correct me if i am doing something wrong JSON ? Can you please guide me to Schedule a Veeam B&R backup job to run Automatically using REST API.
NOTE: As per Request samples in the API create job section, i have also tried removing "runAutomatically" and having 'isEnabled' set to true under schedule, but that didn't help.


REST API reference i followed: https://helpcenter.veeam.com/docs/backu ... /CreateJob

Veeam B&R version: 12.1.0.2131

JSON Request Body

Code: Select all

{
    "type": "Backup",
    "name": "schedulebackupgo10",
    "description": "Created by manoj using golang",
    "virtualMachines": {
      "includes": [
        {
          "platform": "VMware",
          "hostName": "h22-2.lab.archivas.com",
          "name": "cloudera_host-1",
          "type": "VirtualMachine",
          "objectId": "98"
        }
      ]
    },
    "storage": {
      "backupRepositoryId": "475db3b7-94de-4d6f-a847-bf8d2762382a",
      "backupProxies": {
        "autoSelectEnabled": true,
        "proxyIds": []
      },
      "retentionPolicy": {
        "type": "RestorePoints",
        "quantity": 12
      },
      "gfsPolicy": {
        "isEnabled": false,
        "weekly": {
          "desiredTime": "sunday",
          "isEnabled": false,
          "keepForNumberOfWeeks": 1
        },
        "monthly": {
          "desiredTime": "First",
          "isEnabled": false,
          "keepForNumberOfMonths": 1
        },
        "yearly": {
          "desiredTime": "January",
          "isEnabled": false,
          "keepForNumberOfYears": 1
        }
      },
      "advancedSettings": {
        "backupModeType": "Incremental",
        "activeFulls": {
          "isEnabled": true,
          "weekly": {
            "isEnabled": true,
            "days": [
              "sunday",
              "monday",
              "friday"
            ]
          }
        },
        "storageData": {
          "compressionLevel": "Optimal",
          "storageOptimization": "WANTarget",
          "inlineDataDedupEnabled": true,
          "excludeSwapFileBlocks": true,
          "excludeDeletedFileBlocks": true,
          "encryption": {
            "isEnabled": false,
            "passwordId": "00000000-0000-0000-0000-000000000000"
          }
        }
      },
      "schedule": {
        "runAutomatically": true,  
          "daily": {
          "dailyKind": "Everyday",
          "isEnabled": true,
          "localTime": "4:00",
          "days": [
            "sunday",
            "monday",
            "tuesday",
            "wednesday",
            "thursday",
            "friday",
            "saturday"
          ]
        },
        "monthly": {
          "dayOfWeek": "saturday",
          "dayNumberInMonth": "Fourth",
          "isEnabled": true,
          "localTime": "9:00",
          "dayOfMonth": 1,
          "months": [
            "January",
            "February",
            "March",
            "April",
            "May",
            "June",
            "July",
            "August",
            "September",
            "October",
            "November",
            "December"
          ]
        },
        "periodically": {
          "periodicallyKind": "Hours",
          "isEnabled": true,
          "frequency": 1,
          "backupWindow": {
            "days": [
              {
                "day": "sunday",
                "hours": "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"
              },
              {
                "day": "monday",
                "hours": "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"
              },
              {
                "day": "tuesday",
                "hours": "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"
              },
              {
                "day": "wednesday",
                "hours": "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"
              },
              {
                "day": "thursday",
                "hours": "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"
              },
              {
                "day": "friday",
                "hours": "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"
              },
              {
                "day": "saturday",
                "hours": "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"
              }
            ]
          },
          "startTimeWithinAnHour": 0
        },
        "continuously": {
          "isEnabled": false,
          "backupWindow": {
            "days": [
              {
                "day": "sunday",
                "hours": "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"
              },
              {
                "day": "monday",
                "hours": "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"
              },
              {
                "day": "tuesday",
                "hours": "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"
              },
              {
                "day": "wednesday",
                "hours": "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"
              },
              {
                "day": "thursday",
                "hours": "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"
              },
              {
                "day": "friday",
                "hours": "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"
              },
              {
                "day": "saturday",
                "hours": "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"
              }
            ]
          }
        },
        "afterThisJob": {
          "isEnabled": false,
          "jobName": null
        },
        "retry": {
          "isEnabled": true,
          "retryCount": 3,
          "awaitMinutes": 10
        },
        "backupWindow": {
          "isEnabled": false,
          "backupWindow": {
            "days": [
              {
                "day": "sunday",
                "hours": "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"
              },
              {
                "day": "monday",
                "hours": "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"
              },
              {
                "day": "tuesday",
                "hours": "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"
              },
              {
                "day": "wednesday",
                "hours": "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"
              },
              {
                "day": "thursday",
                "hours": "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"
              },
              {
                "day": "friday",
                "hours": "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"
              },
              {
                "day": "saturday",
                "hours": "1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"
              }
            ]
          }
        }
      }
    }
  }	 

JSON response am getting

Code: Select all

{"isHighPriority":false,"virtualMachines":{"includes":[{"type":"VirtualMachine","hostName":"h22-2.lab.archivas.com","name":"cloudera_host-1","objectId":"98","urn":null,"platform":"VMware","size":"13.2 GB"}],"excludes":{"vms":[],"disks":[{"disksToProcess":"AllDisks","vmObject":{"type":"VirtualMachine","hostName":"h22-2.lab.archivas.com","name":"cloudera_host-1","objectId":"98","urn":null,"platform":"VMware","size":"13.2 GB"},"disks":[],"removeFromVMConfiguration":true}],"templates":{"isEnabled":true,"excludeFromIncremental":true}}},"storage":{"backupRepositoryId":"475db3b7-94de-4d6f-a847-bf8d2762382a","backupProxies":{"autoSelectEnabled":true,"proxyIds":[]},"retentionPolicy":{"type":"RestorePoints","quantity":12},"gfsPolicy":{"isEnabled":false,"weekly":{"desiredTime":"sunday","isEnabled":false,"keepForNumberOfWeeks":1},"monthly":{"desiredTime":"First","isEnabled":false,"keepForNumberOfMonths":1},"yearly":{"desiredTime":"January","isEnabled":false,"keepForNumberOfYears":1}},"advancedSettings":{"backupModeType":"Incremental","synthenticFulls":{"isEnabled":false,"weekly":{"isEnabled":true,"days":["sunday","thursday","monday","friday","tuesday","saturday","wednesday"]},"monthly":{"dayOfWeek":"monday","dayNumberInMonth":"First","isEnabled":false,"dayOfMonths":1,"months":["January","February","March","April","May","June","July","August","September","October","November","December"]}},"activeFulls":{"isEnabled":true,"weekly":{"isEnabled":true,"days":["sunday","monday","friday"]},"monthly":{"dayOfWeek":"monday","dayNumberInMonth":"First","isEnabled":false,"dayOfMonths":1,"months":["January","February","March","April","May","June","July","August","September","October","November","December"]}},"backupHealth":{"isEnabled":false,"weekly":{"isEnabled":false,"days":["friday"]},"monthly":{"dayOfWeek":"friday","dayNumberInMonth":"Last","isEnabled":true,"dayOfMonths":1,"months":["January","February","March","April","May","June","July","August","September","October","November","December"]}},"fullBackupMaintenance":{"RemoveData":{"isEnabled":false,"afterDays":14},"defragmentAndCompact":{"isEnabled":false,"weekly":{"isEnabled":false,"days":["saturday"]},"monthly":{"dayOfWeek":"saturday","dayNumberInMonth":"Last","isEnabled":true,"dayOfMonths":1,"months":["January","February","March","April","May","June","July","August","September","October","November","December"]}}},"storageData":{"compressionLevel":"Optimal","storageOptimization":"WANTarget","inlineDataDedupEnabled":true,"excludeSwapFileBlocks":true,"excludeDeletedFileBlocks":true,"encryption":{"encryptionType":"ByUserPassword","isEnabled":false,"encryptionPasswordId":null,"encryptionPasswordUniqueId":null,"kmsServerId":null}},"notifications":{"sendSNMPNotifications":false,"emailNotifications":{"notificationType":null,"isEnabled":false,"recipients":[],"customNotificationSettings":null},"vmAttribute":{"isEnabled":false,"notes":"Notes","appendToExistingValue":true}},"vSphere":{"enableVMWareToolsQuiescence":false,"changedBlockTracking":{"isEnabled":true,"enableCBTautomatically":true,"resetCBTonActiveFull":true}},"storageIntegration":{"isEnabled":true,"processedVmsLimitEnabled":false,"processedVmsCount":10,"failoverToStandardBackup":false},"scripts":{"periodicityType":"BackupSessions","preCommand":{"isEnabled":false,"command":""},"postCommand":{"isEnabled":false,"command":""},"runScriptEvery":1,"dayOfWeek":["saturday"]}}},"guestProcessing":{"appAwareProcessing":{"isEnabled":false,"appSettings":[]},"guestFSIndexing":{"isEnabled":false,"indexingSettings":[]},"guestInteractionProxies":{"autoSelectEnabled":true,"proxyIds":[]},"guestCredentials":{"credentialsType":"Linux","credentialsId":"00000000-0000-0000-0000-000000000000","credentialsPerMachine":[]}},"schedule":{"runAutomatically":false,"daily":{"dailyKind":"Everyday","isEnabled":true,"localTime":"22:00","days":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"]},"monthly":{"dayOfWeek":"saturday","dayNumberInMonth":"Fourth","isEnabled":false,"localTime":"22:00","dayOfMonth":null,"months":["January","February","March","April","May","June","July","August","September","October","November","December"]},"periodically":{"periodicallyKind":"Hours","isEnabled":false,"frequency":1,"backupWindow":{"days":[{"day":"sunday","hours":"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"},{"day":"monday","hours":"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"},{"day":"tuesday","hours":"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"},{"day":"wednesday","hours":"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"},{"day":"thursday","hours":"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"},{"day":"friday","hours":"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"},{"day":"saturday","hours":"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"}]},"startTimeWithinAnHour":0},"continuously":{"isEnabled":false,"backupWindow":{"days":[{"day":"sunday","hours":"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"},{"day":"monday","hours":"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"},{"day":"tuesday","hours":"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"},{"day":"wednesday","hours":"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"},{"day":"thursday","hours":"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"},{"day":"friday","hours":"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"},{"day":"saturday","hours":"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"}]}},"afterThisJob":{"isEnabled":false,"jobName":null},"retry":{"isEnabled":true,"retryCount":3,"awaitMinutes":10},"backupWindow":{"isEnabled":false,"backupWindow":{"days":[{"day":"sunday","hours":"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"},{"day":"monday","hours":"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"},{"day":"tuesday","hours":"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"},{"day":"wednesday","hours":"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"},{"day":"thursday","hours":"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"},{"day":"friday","hours":"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"},{"day":"saturday","hours":"1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"}]}}},"type":"Backup","id":"17b4f68a-8067-4a8c-8b1f-96f1b7c41bfe","name":"schedulebackupgo10","description":"Created by manoj using golang","isDisabled":false}
manoj98
Novice
Posts: 3
Liked: never
Joined: Mar 19, 2024 8:42 am
Full Name: Manoj Kumar Motupalli
Contact:

Re: Not able to schedule backup job to run automatically using REST API

Post by manoj98 »

Able to schedule a backup job to run automatically. There was some syntax issue in Request JSON.

Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests