This is an archive version of the document. To get the most up-to-date information, see the current version.

(POST) /security/accounts/{ID}/scopes

In this article

    Assigns a restore scope to the account having the specified ID. The account is added to Veeam Backup Enterprise Manager and has a specific security role.

    Request

    To assign a restore scope to the account having the specified ID, you need to send the POST HTTP request to the URL of the /security/accounts/{ID}/scopes resource.

    HTTP Request

    POST http://<Enterprise-Manager>:9399/api/security/accounts/{ID}/scopes

    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. 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 accessible by the user.

    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 VMs resource pool node in the request body. As a result, Veeam Backup Enterprise Manager will allow the user to restore data from all VMs residing in the VMs resource pool.

    The body of the request must conform to the XML Schema Definition of Veeam Backup Enterprise Manager RESTful API.

    The request body must contain the following elements:

    Element

    Type

    Description

    Modifiable

    Min/Max Occurrence

    HierarchyObjRef

    HierarchyObjRefType

    Reference to the object in the virtual infrastructure hierarchy. The reference can be constructed manually or obtained with the lookup service.

    Yes

    0/1

    ObjectName

    String

    Name of the object in the virtual infrastructure hierarchy, for example: VM01.

    Yes

    0/1

    For example:

    <?xml version="1.0" encoding="utf-8"?>
    <HierarchyScopeCreateSpec 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">
     <HierarchyScopeItem>
       <HierarchyObjRef>urn:VMware:Vm:a2b0c55d-829a-4efe-bd95-125ee77ba9dd.vm-7870</HierarchyObjRef>
       <ObjectName>VM01</ObjectName>
     </HierarchyScopeItem>
    </HierarchyScopeCreateSpec>

    Query Parameters

    None.

    Response

    The server returns the following response to the client.

    Response Codes

    A successfully completed operation returns response code 202 Accepted.

    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

    None.

    Example

    The example below assigns the restore scope to the account having ID fd4befd6-70c6-4b2f-a068-d1d9a61905a3. The restore scope includes only one VM: SQLSRV having MoRef vm-15309.

    Request:

    POST http://localhost:9399/api/security/accounts/fd4befd6-70c6-4b2f-a068-d1d9a61905a3/scopes

     

    Request Header:

    X-RestSvcSessionId   NDRjZmJkYmUtNWE5NS00MTU2LTg4NjctOTFmMDY5YjdjMmNj

     

    Request Body:

    <?xml version="1.0" encoding="utf-8"?>
    <HierarchyScopeCreateSpec 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">
     <HierarchyScopeItem>
       <HierarchyObjRef>urn:VMware:Vm:a2b0c55d-829a-4efe-bd95-125ee77ba9dd.vm-15309</HierarchyObjRef>
       <ObjectName>SQLSRV</ObjectName>
     </HierarchyScopeItem>
    </HierarchyScopeCreateSpec>

     

    Response:

    201 Created

     

    Response Body:

    None