Help Center
Choose product document...
Veeam Backup & Replication 9.5
RESTful API Reference

(POST) /security/accounts?action=rebuildScope

Rebuilds a restore scope for user accounts added to Veeam Backup Enterprise Manager.

Veeam Backup Enterprise Manager periodically rescans the virtual infrastructure to get the latest data about the virtual infrastructure hierarchy and rebuild the restore scope for user accounts. The rescan procedure is performed automatically once a day. You can start the rebuild scope operation manually when you need to perform rescan. For example, you can perform this operation in case new VMs have been created and you want to immediately include them to the restore scope for some users.

Request

To rebuild a restore scope for a user account, you need to send the POST HTTP request to the URL of the /security/accounts?action=rebuildScope resource.

HTTP Request

POST http://<Enterprise-Manager>:9399/api/security/accounts?action=rebuildScope

Request Header

The request contains the following headers:

Header

Required

Description

X-RestSvcSessionId

True

The request requires authorization. In the header, the client must send a session ID copied from the server reply to the request creating a new logon session. To learn more, see Authentication and Security.

Request Body

In the request body, the client must send parameters of the restore scope rebuild process. The body of the request must conform to the XML Schema Definition of Veeam Backup Enterprise Manager RESTful API.

The request body must contain one of the following elements:

Element

Type

Description

Modifiable

Min/Max Occurrence

RebuildAll

Rebuilds a restore scope for all user accounts added to Veeam Backup Enterprise Manager.

No

RebuildUnprocessed

Rebuilds a restore scope for user accounts whose restore scope has been changed since the previous scope rebuild operation. This may be helpful if a restore scope was changed for some users but was not automatically refreshed for some reason.

No

RebuildForCurrentUser

Rebuilds a restore scope for the user account that is currently logged on to Veeam Backup Enterprise Manager. This may be helpful if some newly created VMs and backups are not yet displayed to a user right after the new logon session is created.

No

For example:

<?xml version="1.0" encoding="utf-8"?>
<RebuildScopeJobSpec xmlns="http://www.veeam.com/ent/v1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <RebuildUnprocessed/>
</RebuildScopeJobSpec>

Query Parameters

None.

Response

The server returns the following response to the client.

Response Codes

A successfully completed operation returns response code 201 Created.

Response Headers

The response to this request contains the following headers. The response may also include additional standard HTTP headers.

Header

Description

Content-length

The length of the response body.

Content-type

The media type and syntax of the request body message: application/xml.

Response Body

In the response body, Veeam Backup Enterprise Manager returns an ID of the task that has been created to perform the requested action, and the task state. You can check the operation results by sending the GET HTTP request to the URL of the task resource.

Additionally, Veeam Backup Enterprise Manager returns a link to the task deletion operation. You can send the GET HTTP request to the URL in the link to stop the task execution.

Example

The example below rebuilds the restore scope for all users currently added to Veeam Backup Enterprise Manager.

Request:

POST http://localhost:9399/api/security/accounts?action=rebuildScope

 

Request Header:

X-RestSvcSessionId   NDRjZmJkYmUtNWE5NS00MTU2LTg4NjctOTFmMDY5YjdjMmNj

 

Request Body:

<?xml version="1.0" encoding="utf-8"?>
<RebuildScopeJobSpec xmlns="http://www.veeam.com/ent/v1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <RebuildUnprocessed/>
</RebuildScopeJobSpec>

 

Response:

201 Created

 

Response Body:

<Task xmlns="http://www.veeam.com/ent/v1.0" Type="Task" Href="http://localhost:9399/api/tasks/task-1">
 <Links>
   <Link Rel="Delete" Type="Task" Href="http://localhost:9399/api/tasks/task-1" />
 </Links>
 <TaskId>task-1</TaskId>
 <State>Finished</State>
 <Operation>StartRebuildScope</Operation>
 <Result Success="true" />
</Task>

 

Veeam Large Logo

User Guide for VMware vSphere

User Guide for Microsoft Hyper-V

Enterprise Manager User Guide

Veeam Cloud Connect Guide

Veeam Backup Explorers User Guide

PowerShell Reference

RESTful API Reference

Veeam Backup FREE Edition User Guide

Veeam Backup for Microsoft Office 365

Veeam ONE Documentation

Veeam Endpoint Backup Documentation

Veeam Management Pack Documentation