Assigning a Restore Scope
Using Veeam Backup Enterprise Manager RESTful API, you assign a restore scope to an account having the Restore Operators role in Veeam Backup Enterprise Manager.
A restore scope can be assigned to a user account that belongs to the Portal Operators group in Veeam Backup Enterprise Manager. The restore scope is specified as a branch in the virtual infrastructure hierarchy. The client defines the upper node in the branch and all child nodes of the defined node become available to the user for restore.
For example, if you want to allow the user to restore data from all VMs in the VMs resource pool, you need to send the parameters of the resource pool node when assigning a restore scope. As a result, Veeam Backup Enterprise Manager will allow the user to restore data from all VMs residing in the VMs resource pool.
Prerequisites
Make sure you are logged on to Veeam Backup Enterprise Manager under the user account to which the Portal Administrator role is assigned. Otherwise you will not be able to change configuration settings in Veeam Backup Enterprise Manager.
Procedure
- After you access Veeam Backup Enterprise Manager RESTful API and create a new logon session, examine the representation of the logon session that the server has returned:
Request: POST http://localhost:9399/api/sessionMngr/
Request Header: Authorization: Basic QWRtaW5pc3RyYXRvcjpUcmVzc3Bhc3Mx
Response: 201 Created
Response Header: X-RestSvcSessionId: NDRjZmJkYmUtNWE5NS00MTU2LTg4NjctOTFmMDY5YjdjMmNj
Response Body: <LogonSession xmlns="http://www.veeam.com/ent/v1.0" Type="LogonSession" Href="http://localhost:9399/api/logonSessions/3b68b200-0a74-4543-b7b2-301fae3ea507"> |
- Find the link for the /security resource:
- From the link, retrieve the URL for the /security resource. The URL is specified in the Href element. Send the GET HTTP request to the retrieved URL. The server will return a representation of the security resource that provides access to Veeam Backup Enterprise Manager security settings and allows you to manage roles used in Veeam Backup Enterprise Manager:
Request: GET http://localhost:9399/api/security
Request Header: X-RestSvcSessionId: NDRjZmJkYmUtNWE5NS00MTU2LTg4NjctOTFmMDY5YjdjMmNj
Response: 200 Success
Response Body: <EnterpriseSecuritySettings xmlns="http://www.veeam.com/ent/v1.0" Href="http://localhost:9399/api/security"> |
- Examine the received resource representation and find a link to the /accounts resource.
<Link Rel="Down" Type="EnterpriseAccountReferenceList" Href="http://localhost:9399/api/security/accounts" /> |
- Retrieve the URL for the /accounts resource and send the GET HTTP request to the retrieved URL. The server will return a list of all accounts that have a specific role in Veeam Backup Enterprise Manager.
Request: GET http://localhost:9399/api/security/accounts
Request Header: X-RestSvcSessionId: NDRjZmJkYmUtNWE5NS00MTU2LTg4NjctOTFmMDY5YjdjMmNj
Response: 200 Success
Response Body: <EntityReferences xmlns="http://www.veeam.com/ent/v1.0"> |
- Find a link to the entity representation of the necessary account resource and send the GET HTTP request to it.
Request: GET http://localhost:9399/api/security/accounts/129ccafb-d740-4a5a-b602-b02acfec1ec5?format=Entity
Request Header: X-RestSvcSessionId: NDRjZmJkYmUtNWE5NS00MTU2LTg4NjctOTFmMDY5YjdjMmNj
Response: 200 Success
Response Body: <EnterpriseAccount xmlns="http://www.veeam.com/ent/v1.0" Type="EnterpriseAccount" Href="http://localhost:9399/api/security/accounts/129ccafb-d740-4a5a-b602-b02acfec1ec5?format=Entity" Name="localhost\Administrator" UID="urn:veeam:EnterpriseAccount:129ccafb-d740-4a5a-b602-b02acfec1ec5"> |
- Examine the received resource representation and find a link to the scope creation action. Send the POST HTTP request to the URL in the link.
The request requires a body. In the body of the request, you must provide a reference to the hierarchy object, or node in the virtual infrastructure, and the object name. For example, if you want to assign a resource pool as a restore scope, you must provide a reference to the resource pool object in the request body.
The reference to the hierarchy object can be constructed manually or obtained using the lookup service.
Request: POST http://localhost:9399/api/security/accounts/129ccafb-d740-4a5a-b602-b02acfec1ec5/scopes
Request Header: X-RestSvcSessionId: NDRjZmJkYmUtNWE5NS00MTU2LTg4NjctOTFmMDY5YjdjMmNj
Request Body: <?xml version="1.0" encoding="utf-8"?>
Response: 201 Created
Response Body: None |
- To check if the restore scope has been successfully assigned or not, send the GET HTTP request to the URL of the /security/accounts/{ID}/scopes resource:
Request: GET http://localhost:9399/api/security/accounts/129ccafb-d740-4a5a-b602-b02acfec1ec5/scopes
Request Header: X-RestSvcSessionId: NDRjZmJkYmUtNWE5NS00MTU2LTg4NjctOTFmMDY5YjdjMmNj
Response: 200 Success
Response Body: <EnterpriseAccountHierarchyScopes xmlns="http://www.veeam.com/ent/v1.0"> |
Result
The restore scope is assigned to the selected account having the Restore Operators role.