- About Veeam Backup & Replication REST API
- Overview
- How To
- Changelog
- Login
- Service
- Services
- Credentials
- getGet All Credentials
- postAdd Credentials Record
- getGet Credentials Record
- putEdit Credentials Record
- delRemove Credentials Record
- postChange Password
- postChange Linux Private Key
- postChange Linux Root Password
- getGet All Cloud Credentials
- postAdd Cloud Credentials Record
- postGet Verification Code
- postRegister Azure AD Application
- getGet Cloud Credentials Record
- putEdit Cloud Credentials Record
- delRemove Cloud Credentials Record
- postChange Secret Key
- postChange Certificate
- getGet All Helper Appliances
- postAdd or Edit Helper Appliance
- getGet Helper Appliance
- delRemove Helper Appliance
- Encryption
- Connection
- Cloud Browser
- Inventory Browser
- Traffic Rules
- General Options
- Configuration Backup
- Managed Servers
- Repositories
- getGet All Repositories
- postAdd Repository
- getGet All Repository States
- getGet Repository
- putEdit Repository
- delRemove Repository
- getGet All Scale-Out Backup Repositories
- postAdd Scale-Out Backup Repository
- getGet Scale-Out Backup Repository
- putEdit Scale-Out Backup Repository
- delRemove Scale-Out Backup Repository
- postEnable Sealed Mode
- postDisable Sealed Mode
- postEnable Maintenance Mode
- postDisable Maintenance Mode
- Proxies
- Jobs
- Backups
- Backup Objects
- Object Restore Points
- Restore
- Sessions
- Agents
- Automation
- postImport Jobs
- postExport Jobs
- postImport Credentials
- postExport Credentials
- postImport Cloud Credentials
- postExport Cloud Credentials
- postImport Proxies
- postExport Proxies
- postImport Servers
- postExport Servers
- postImport Repositories
- postExport Repositories
- postImport Encryption Passwords
- postExport Encryption Passwords
- getGet All Automation Sessions
- getGet Automation Session
- getGet Automation Session Logs
- postStop Automation Session
This section contains quick start guides on how to perform complex scenarios with Veeam Backup & Replication REST API.
You can perform mass deployment of your backup infrastructure by using the Automation section of the REST API. The section includes methods that let you import and export resources in the JSON format. You can use these methods, for example, to set up your backup infrastructure from a JSON specification or to migrate your infrastructure from one backup server to another.
The Automation section includes dedicated methods for individual resources, so you can export and import resources granularly.
Exported resources do not include IDs. All credentials are exported with empty passwords, passphrases and private keys. Before you export resources that contain sensitive data, you can mark them by using tag parameters.
As soon as you can import an entire collection of resources with one HTTP request, you may need to check the progress of the import operation. In response to your request, you receive a session. Within this session, Veeam Backup & Replication adds the specified objects to the backup infrastructure. To check the import progress, you can track the session state. For more information, see Tracking Import Operation.
To set up backup infrastructure using the automation methods, you must import resources in the following order:
- Credentials and encryption passwords
- Managed servers
- Backup repositories
- Backup proxies
- Backup jobs
In this example, you will migrate backup infrastructure from one backup server to another. You have a backup server backupserver01 where a VMware vSphere infrastructure is deployed. It includes managed Microsoft Windows and Linux servers, backup repositories and backup proxies, and configured backup jobs. You need to migrate the infrastructure to another backup server backupserver02.
To migrate backup infrastructure from backupserver01 to backupserver02, take the following steps:
To log in to backupserver01 and backupserver02, send the HTTP POST requests to the
/api/oauth2/token
paths. In response, you receive access and refresh tokens.
For more information, see Requesting Authorization.Export credentials records from backupserver01 with the Export Credentials request.
In response, you receive an array of credentials records. Each record contains empty values of sensitive parameters: passwords, passphrases and private keys.Import the credentials to backupserver02 with the Import Credentials request. In the request body, specify the imported credentials. Fill in passwords, passphrases and private keys manually.
Export servers managed by backupserver01 with the Export Servers request.
In response, you receive an array of servers. The array does not include backupserver01 itself — the server where Veeam Backup & Replication is installed.Import managed servers to backupserver02 with the Import Servers request. In the request body, specify the array of servers exported from backupserver01.
In response, you receive an automation session. Within the session, the specified servers are added to the backupserver02 infrastructure. For more information on tracking the session state, see Tracking Import Operation.Export backup repositories from backupserver01 with the Export Repositories request. In response, you receive an array of backup repositories.
Import backup repositories to backupserver02 with the Import Repositories request. In the request body, specify the repositories exported from backupserver01.
In response, you receive an automation session. Within the session, the specified backup repositories are added to the backupserver02 infrastructure. For more information on tracking the session state, see Tracking Import Operation.If you use backup proxies and encryption keys in your backup jobs, migrate them similarly.
Export backup jobs from backupserver01 with the Export Jobs request. In response, you receive an array of jobs.
Import backup jobs to backupserver02 with the Import Jobs request. In the request body, specify the jobs imported from backupserver01.
In response you receive an automation session. Within the session, the specified backup jobs are created on backupserver02. For more information on tracking the session state, see Tracking Import Operation.
When you perform an import operation, you send the POST HTTP request. In response, you receive a session of the Automation type. Within this session, Veeam Backup & Replication adds new objects (for example, credentials, managed servers or backup jobs) to the infrastructure of the backup server. To check the import progress, track the session state. If the import fails, you can view debug logs for detailed information on each object.
For example, you import credentials records. In response, you receive an automation session. To track the session state, run the Get Automation Session request.
If some of the credentials records are not imported, you can view debug logs for detailed information on each record. To do this, send the Get Automation Session request.
With Veeam Backup & Replication REST API, you can add the following types of object storage repositories:
- Microsoft Azure Blob storage, Microsoft Azure Archive storage, and Microsoft Azure Data Box storage
- Amazon S3 storage, Amazon S3 Glacier storage, and AWS Snowball Edge storage
- Google Cloud storage
- S3 compatible storage
- IBM Cloud storage
- Wasabi Cloud storage
To add an object storage repository, take the following steps:
Add a cloud credentials record required for connection to the object storage repository. For details, see Add Cloud Credentials Record.
In response, you receive a model of the created cloud credentials record with its ID. Save the ID, you will require it later.
Choose a location (cloud container and folder) that you want to map to new object storage repository. Save folder names and container names.
- To browse existing folders, send the Get Cloud Hierarchy request.
- To create a new folder, send the New Folder request. Note Veeam Backup & Replication REST API does not create new containers, you can create a folder inside an existing container only.
Add a new object storage repository with the Add Repository requests.
In the request body among other parameters, specify the following parameters obtained in the previous steps:
- Cloud credentials required for connection to the object storage repository.
- Cloud location you want to map to the object storage repository.