Adding Object Storage Repository
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
Example
In this example, you will add a Microsoft Azure Blob storage. You have a backup server backupserver01. You need to add an Azure storage account that has access to the Azure cloud service, create the Repository01 folder, and map the new repository to the folder.
To add a Microsoft Azure object storage repository, take the following steps:
- Add a Microsoft Azure storage account required for connection to the object storage repository.
Request Example
Request POST https://backupserver01:9419/api/v1/cloudcredentials
Request Header x-api-version:1.2-rev0 Authorization: Bearer YSEoaL6H9EEyJpnrJ9WhLtzbrrBBYWqMQFDBQuLnp13qGQX6MjNfZ_wriPIRHQrbY-8dYtsWcRZQczIHVuSqbnVb00m-yOihPZZHQ48aP1VcgUtgnYTvtAO3WRJ1cJ8VaIXzsVYKIGrLa1Lm41LsjpMiiPZytkqIUUiphhlXn7Vm10xlTzQUe0TU3HmXK-KD2MiB6qBImaISkEjgCmyIsurSN2mHi1Qo8VlZadnhkBd3v6nD5GEb8Gh4Zw7YAv5klmrnM0iBu7xhev2hVMZvKHGXvGshI3gS24-hIWbSsBGarVnRLSiUzor6QExTGShSa7pIeJWsAtJXLF5a3oSUooUv_YMYe8d5iZEouUuirrw
Request Body { "description": "Account for Azure Blob storage", "type": "AzureStorage", "tag": "AzureStandardAccount", "account": "sheiladcory", "sharedKey": "uYck+aed0GG8rqJHgrMWUO7g+G7U4X/l+9PgDpEz1ma0GgmH0t1MvKBxsDjAa61RW92bnYZ2PL1T+AStz8v/vQ==" } |
In response, you receive a model of the created Azure storage account with its ID. Save the ID, you will require it later.
Response Example
Response 201
Response Body { "account": "sheiladcory", "tag": "AzureStandardAccount", "type": "AzureStorage", "id": "d70f5a50-7af9-4255-aedc-570d044d00c0", "description": "Account for Azure Blob storage" } |
- Choose a location (cloud containers and folders) that you want to map to the new Azure Blob object storage repository. Record folder names and container names.
- To browse existing folders, send the POST HTTP request to the /cloudBrowser path. For details, see Get Cloud Hierarchy.
Request Example
Request POST https://backupserver01:9419/api/v1/cloudBrowser
Request Header x-api-version:1.2-rev0 Authorization: Bearer YSEoaL6H9EEyJpnrJ9WhLtzbrrBBYWqMQFDBQuLnp13qGQX6MjNfZ_wriPIRHQrbY-8dYtsWcRZQczIHVuSqbnVb00m-yOihPZZHQ48aP1VcgUtgnYTvtAO3WRJ1cJ8VaIXzsVYKIGrLa1Lm41LsjpMiiPZytkqIUUiphhlXn7Vm10xlTzQUe0TU3HmXK-KD2MiB6qBImaISkEjgCmyIsurSN2mHi1Qo8VlZadnhkBd3v6nD5GEb8Gh4Zw7YAv5klmrnM0iBu7xhev2hVMZvKHGXvGshI3gS24-hIWbSsBGarVnRLSiUzor6QExTGShSa7pIeJWsAtJXLF5a3oSUooUv_YMYe8d5iZEouUuirrw
Request Body { "credentialsId" : "56651dee-2384-4481-9488-b2bc14e69b03", "serviceType" : "AzureBlob", "regionType" : "Global", "folderType" : "backup" } |
In response, you receive a collection of cloud containers and their folders.
Response Example
Response 200
Response Body { "regionType": "Global", "hostId": "6745a759-2205-4cd2-b172-8ec8f7e60ef8", "containers": [ { "name": "container01", "folders": [ "2323" ] }, { "name": "container02", "folders": [ "1", "2" ] }, … ], "serviceType": "AzureBlob", "credentialsId": "56651dee-2384-4481-9488-b2bc14e69b03" } |
- To create a new folder, send the POST HTTP request to the /cloudBrowser/newFolder path. Note Veeam Backup & Replication REST API does not create new containers, you can create a folder inside an existing container only. For details, see New Folder.
Request Example
Request POST https://backupserver01:9419/api/v1/cloudBrowser/newFolder
Request Header x-api-version:1.2-rev0 Authorization: Bearer YSEoaL6H9EEyJpnrJ9WhLtzbrrBBYWqMQFDBQuLnp13qGQX6MjNfZ_wriPIRHQrbY-8dYtsWcRZQczIHVuSqbnVb00m-yOihPZZHQ48aP1VcgUtgnYTvtAO3WRJ1cJ8VaIXzsVYKIGrLa1Lm41LsjpMiiPZytkqIUUiphhlXn7Vm10xlTzQUe0TU3HmXK-KD2MiB6qBImaISkEjgCmyIsurSN2mHi1Qo8VlZadnhkBd3v6nD5GEb8Gh4Zw7YAv5klmrnM0iBu7xhev2hVMZvKHGXvGshI3gS24-hIWbSsBGarVnRLSiUzor6QExTGShSa7pIeJWsAtJXLF5a3oSUooUv_YMYe8d5iZEouUuirrw
Request Body { "credentialsId" : "56651dee-2384-4481-9488-b2bc14e69b03", "serviceType" : "AzureBlob", "newFolderName" : "Repository01", "regionType" : "Global", "containerName" : "container01", "folderType" : "backup" } |
In response, you receive the 201 code and an empty response body.
Response Example
Response 201
Response Body {} |
- To add a new Azure Blob storage repository, send the POST HTTP request to the backupInfrastructure/repositories path. For details, see Add Repository.
In the request body among other parameters, specify the following parameters obtained in the previous steps:
- ID of the created Azure storage account
- Location (names of the container and the new folder) you want to map to the object storage repository
Request Example
Request POST https://backupserver01:9419/api/v1/backupInfrastructure/repositories
Request Header x-api-version:1.2-rev0 Authorization: Bearer YSEoaL6H9EEyJpnrJ9WhLtzbrrBBYWqMQFDBQuLnp13qGQX6MjNfZ_wriPIRHQrbY-8dYtsWcRZQczIHVuSqbnVb00m-yOihPZZHQ48aP1VcgUtgnYTvtAO3WRJ1cJ8VaIXzsVYKIGrLa1Lm41LsjpMiiPZytkqIUUiphhlXn7Vm10xlTzQUe0TU3HmXK-KD2MiB6qBImaISkEjgCmyIsurSN2mHi1Qo8VlZadnhkBd3v6nD5GEb8Gh4Zw7YAv5klmrnM0iBu7xhev2hVMZvKHGXvGshI3gS24-hIWbSsBGarVnRLSiUzor6QExTGShSa7pIeJWsAtJXLF5a3oSUooUv_YMYe8d5iZEouUuirrw
Request Body { "type": "AzureBlob", "name": "Azure Blob Storage", "description": "Created by Sheila D. Cory", "tag": "6745a759-01", "enabletasklimit" : false, "maxtaskcount" : -1, "account": { "regiontype": "Global", "credentialsid": "56651dee-2384-4481-9488-b2bc14e69b03", "connectionsettings": { "connectiontype": "SelectedGateway", "gatewayserverids": [ "6745a759-2205-4cd2-b172-8ec8f7e60ef8" ] } }, "container": { "containername": "container01", "foldername": "Repository01", "storageconsumptionlimit": { "consumptionlimitkind": "TB", "isenabled": true, "consumptionlimitcount": 10 } }, "mountserver": { "mountserverid": "6c19c18f-adb8-494d-af15-e94a4cf23d93", "writecachefolder": "D:\\programdata\\veeam\\backup\\", "vpowernfsenabled": false, "vpowernfsportsettings": { "mountport": 1058, "vpowernfsport": 1058 } } } |
In response, you receive an infrastructure session. Within the session, the object storage repository is added to your backup infrastructure. To check the progress, track the session state.
Response Example
Response 200
Response Body { "sessionType": "Infrastructure", "state": "Working", "id": "fa5c423e-9d55-45b0-8478-58fe93f8a177", "name": "Infrastructure Item Saving", "activityId": "fa5c423e-9d55-45b0-8478-58fe93f8a177", "creationTime": "2023-01-19T13:19:42.241193-08:00", "endTime": null, "progressPercent": 0, "result": null, "resourceId": null, "resourceReference": null, "parentSessionId": null, "usn": 0 } |