Application User Role Controller Resource

GET /roles

Return list of roles.

Request Parameters
name type description
direction query
filter query
nameLike query
orderBy query
page query
size query
Response Body
media type data type description
application/json array of AppUserRoleListRecord (JSON) list of roles

Example

Request
GET /roles
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
[ {
  "guid" : "...",
  "name" : "...",
  "description" : "...",
  "deletable" : true
} ]
                
              

POST /roles

Create a new role.

Request Body
media type data type description
application/json AppUserRoleRequest (JSON) specify data for new role
Response Body
media type data type description
application/json AppUserRoleDetails (JSON) details of newly created user

Example

Request
POST /roles
Content-Type: application/json
Accept: application/json

                
{
  "guid" : "...",
  "name" : "...",
  "description" : "...",
  "deletable" : true,
  "privileges" : [ "STORAGE_INFRASTRUCTURE_READ", "MGMT_PASSWORD_CHANGE" ],
  "privilegeContexts" : [ {
    "type" : "CLOUD_USER",
    "instanceGuid" : "...",
    "instanceUuid" : "...",
    "instanceName" : "..."
  }, {
    "type" : "APP_CMD_EXEC_CONFIG",
    "instanceGuid" : "...",
    "instanceUuid" : "...",
    "instanceName" : "..."
  } ],
  "isRootAccess" : true
}
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
{
  "guid" : "...",
  "name" : "...",
  "description" : "...",
  "deletable" : true,
  "privileges" : [ "STORAGE_INFRASTRUCTURE_WRITE", "VE_INSTANCE_MOUNT_TASK_REGISTER" ],
  "isRootAccess" : true,
  "privilegeContexts" : [ {
    "type" : "APP_CMD_EXEC_CONFIG",
    "instanceGuid" : "...",
    "instanceUuid" : "...",
    "instanceName" : "..."
  }, {
    "type" : "STORAGE",
    "instanceGuid" : "...",
    "instanceUuid" : "...",
    "instanceName" : "..."
  } ]
}
                
              

DELETE /roles/{guid}

Remove role.

Request Parameters
name type description
guid path specify local unique identifier for role (use by vProtect)

Example

Request
DELETE /roles/{guid}
Content-Type: */*

                
...
                
              
Response
HTTP/1.1 204 No Content

              

GET /roles/{guid}

Get a single role.

Request Parameters
name type description
guid path specify local unique identifier for role (use by vProtect)
Response Body
media type data type description
application/json AppUserRoleDetails (JSON) a single role details

Example

Request
GET /roles/{guid}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "guid" : "...",
  "name" : "...",
  "description" : "...",
  "deletable" : true,
  "privileges" : [ "OS_BACKUP_SLA_READ", "OS_REPORTING_SEND_EMAIL" ],
  "isRootAccess" : true,
  "privilegeContexts" : [ {
    "type" : "HYPERVISOR_MANAGER",
    "instanceGuid" : "...",
    "instanceUuid" : "...",
    "instanceName" : "..."
  }, {
    "type" : "APPLICATION",
    "instanceGuid" : "...",
    "instanceUuid" : "...",
    "instanceName" : "..."
  } ]
}
                
              

PUT /roles/{guid}

Change role details.

Request Parameters
name type description
guid path
Request Body
media type data type description
application/json AppUserRoleRequest (JSON) specify role details to update
Response Body
media type data type description
application/json AppUserRoleDetails (JSON) updated details of role

Example

Request
PUT /roles/{guid}
Content-Type: application/json
Accept: application/json

                
{
  "guid" : "...",
  "name" : "...",
  "description" : "...",
  "deletable" : true,
  "privileges" : [ "VE_BACKUP_SLA_WRITE", "OS_INSTANCE_WRITE" ],
  "privilegeContexts" : [ {
    "type" : "DATA_CENTER",
    "instanceGuid" : "...",
    "instanceUuid" : "...",
    "instanceName" : "..."
  }, {
    "type" : "DATA_CENTER",
    "instanceGuid" : "...",
    "instanceUuid" : "...",
    "instanceName" : "..."
  } ],
  "isRootAccess" : true
}
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
{
  "guid" : "...",
  "name" : "...",
  "description" : "...",
  "deletable" : true,
  "privileges" : [ "VE_INFRASTRUCTURE_WRITE", "APP_REPORTING_VIEW" ],
  "isRootAccess" : true,
  "privilegeContexts" : [ {
    "type" : "ROOT",
    "instanceGuid" : "...",
    "instanceUuid" : "...",
    "instanceName" : "..."
  }, {
    "type" : "STORAGE_POOL",
    "instanceGuid" : "...",
    "instanceUuid" : "...",
    "instanceName" : "..."
  } ]
}
                
              

POST /roles/{guid}/clone

Request Parameters
name type description
guid path
Request Body
media type data type
application/json CloneDTO (JSON)
Response Body
media type data type description
application/json AppUserRoleDetails (JSON)

Example

Request
POST /roles/{guid}/clone
Content-Type: application/json
Accept: application/json

                
{
  "name" : "..."
}
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
{
  "guid" : "...",
  "name" : "...",
  "description" : "...",
  "deletable" : true,
  "privileges" : [ "TASK_WRITE", "APP_REPORTING_VIEW" ],
  "isRootAccess" : true,
  "privilegeContexts" : [ {
    "type" : "CLOUD_TEAM",
    "instanceGuid" : "...",
    "instanceUuid" : "...",
    "instanceName" : "..."
  }, {
    "type" : "STORAGE",
    "instanceGuid" : "...",
    "instanceUuid" : "...",
    "instanceName" : "..."
  } ]
}
                
              

PUT /roles/{guid}/contexts/add

Add context to role

Request Parameters
name type description
guid path specify role guid
Request Body
media type data type description
application/json PrivilegeContextRequest (JSON) specify privilege request to be added to role
Response Body
media type data type description
application/json AppUserRoleDetails (JSON) updated details of role

Example

Request
PUT /roles/{guid}/contexts/add
Content-Type: application/json
Accept: application/json

                
{
  "type" : "OS_AGENT",
  "instanceGuid" : "...",
  "instanceUuid" : "...",
  "instanceName" : "..."
}
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
{
  "guid" : "...",
  "name" : "...",
  "description" : "...",
  "deletable" : true,
  "privileges" : [ "VE_RECOVERYPLAN_SLA_READ", "STORAGE_INSTANCE_EXPORT_TASK_REGISTER" ],
  "isRootAccess" : true,
  "privilegeContexts" : [ {
    "type" : "VIRTUAL_ENVIRONMENT",
    "instanceGuid" : "...",
    "instanceUuid" : "...",
    "instanceName" : "..."
  }, {
    "type" : "VIRTUAL_ENVIRONMENT",
    "instanceGuid" : "...",
    "instanceUuid" : "...",
    "instanceName" : "..."
  } ]
}
                
              

PUT /roles/{guid}/contexts/remove

Remove context from role.

Request Parameters
name type description
guid path specify role
Request Body
media type data type description
application/json StringDTO (JSON) specify context to remove from role
Response Body
media type data type description
application/json AppUserRoleDetails (JSON) updated details of role

Example

Request
PUT /roles/{guid}/contexts/remove
Content-Type: application/json
Accept: application/json

                
{
  "value" : "..."
}
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
{
  "guid" : "...",
  "name" : "...",
  "description" : "...",
  "deletable" : true,
  "privileges" : [ "VE_BACKUP_SLA_WRITE", "STORAGE_REPORTING_VIEW" ],
  "isRootAccess" : true,
  "privilegeContexts" : [ {
    "type" : "STORAGE_POOL",
    "instanceGuid" : "...",
    "instanceUuid" : "...",
    "instanceName" : "..."
  }, {
    "type" : "STORAGE_PROVIDER",
    "instanceGuid" : "...",
    "instanceUuid" : "...",
    "instanceName" : "..."
  } ]
}
                
              

PUT /roles/{guid}/privileges/add

Add context to role

Request Parameters
name type description
guid path specify role guid
Request Body
media type data type description
application/json StringDTO (JSON) specify dto with privilege to add to role
Response Body
media type data type description
application/json AppUserRoleDetails (JSON) updated details of role

Example

Request
PUT /roles/{guid}/privileges/add
Content-Type: application/json
Accept: application/json

                
{
  "value" : "..."
}
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
{
  "guid" : "...",
  "name" : "...",
  "description" : "...",
  "deletable" : true,
  "privileges" : [ "OS_INSTANCE_IMPORT_TASK_REGISTER", "STORAGE_INSTANCE_RESTORE_TO_NODE_TASK_REGISTER" ],
  "isRootAccess" : true,
  "privilegeContexts" : [ {
    "type" : "CLOUD_SERVICE_PROVIDER",
    "instanceGuid" : "...",
    "instanceUuid" : "...",
    "instanceName" : "..."
  }, {
    "type" : "STORAGE_POOL",
    "instanceGuid" : "...",
    "instanceUuid" : "...",
    "instanceName" : "..."
  } ]
}
                
              

PUT /roles/{guid}/privileges/remove

Add context to role

Request Parameters
name type description
guid path specify role guid
Request Body
media type data type description
application/json StringDTO (JSON) specify dto with privilege to remove from role
Response Body
media type data type description
application/json AppUserRoleDetails (JSON) updated details of role

Example

Request
PUT /roles/{guid}/privileges/remove
Content-Type: application/json
Accept: application/json

                
{
  "value" : "..."
}
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
{
  "guid" : "...",
  "name" : "...",
  "description" : "...",
  "deletable" : true,
  "privileges" : [ "OS_BACKUP_SLA_READ", "OS_INSTANCE_EXPORT_TASK_REGISTER" ],
  "isRootAccess" : true,
  "privilegeContexts" : [ {
    "type" : "APPLICATION",
    "instanceGuid" : "...",
    "instanceUuid" : "...",
    "instanceName" : "..."
  }, {
    "type" : "CLOUD_GROUP",
    "instanceGuid" : "...",
    "instanceUuid" : "...",
    "instanceName" : "..."
  } ]
}