# Cloud User Controller Resource

The API allows you to list and view cloud users.

### GET /cloud-users

Returns list of cloud users filtered by specified query parameters.

Request Parameters
name | type | description | constraints | multivalued
--- | --- | --- | --- | ---
backupStatus | query |  | "IS_PROTECTED" or "NOT_PROTECTED" or "NO_SCHEDULE" | yes
cloud-service-provider | query |  |  | no
direction | query |  |  | no
filter | query |  |  | no
nameLike | query |  |  | no
orderBy | query |  |  | no
page | query |  |  | no
policy | query |  |  | yes
size | query |  |  | no

Response Body
media type | data type | description
--- | --- | ---
application/json | array of CloudUserListResponseDto (JSON) | list of cloud users filtered by specified query parameters

#### Example

##### Request

    GET /cloud-users
    Content-Type: */*
    Accept: application/json

    ...

##### Response

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

    [ {
      "guid" : "f8f73bf9-2445-4bce-a7dd-753be3b40a67",
      "lastBackup" : 1451649601000
    } ]

### POST /cloud-users/assign-backup-policy

Assign users to specified policy (or unassign if policy is null)

Request Body
media type | data type | description
--- | --- | ---
application/json | ProtectedEntityBackupPolicyAssignmentRequestDto (JSON) | containing policy and users info

#### Example

##### Request

    POST /cloud-users/assign-backup-policy
    Content-Type: application/json

    { }

##### Response

    HTTP/1.1 201 Created

### GET /cloud-users/backup-cleanup

Returns list of protected entities for backup cleanup.

Request Parameters
name | type | description | constraints
--- | --- | --- | ---
backup-destination | query |  |
page | query |  | int
size | query |  | int

Response Body
media type | data type | description
--- | --- | ---
application/json | array of CloudUserListResponseDto (JSON) | list of protected entities for backup cleanup

#### Example

##### Request

    GET /cloud-users/backup-cleanup
    Content-Type: */*
    Accept: application/json

    ...

##### Response

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

    [ {
      "guid" : "f8f73bf9-2445-4bce-a7dd-753be3b40a67",
      "lastBackup" : 1451649601000
    } ]

### GET /cloud-users/rbac-contexts

Returns list of cloud users filtered by specified query parameters.

Request Parameters
name | type | description | constraints
--- | --- | --- | ---
app-cmd-exec-config | query |  |
cloud-service-provider | query |  |
cluster | query |  |
data-center | query |  |
direction | query |  |
filter | query |  |
hypervisor | query |  |
hypervisor-manager | query |  |
nameLike | query |  |
orderBy | query |  |
page | query |  |
project | query |  |
size | query |  |
storage-pool | query |  |
storage-provider | query |  |
teams-group | query |  | boolean

Response Body
media type | data type | description
--- | --- | ---
application/json | array of RbacContextListResponseDto (JSON) | list of cloud users filtered by specified query parameters

#### Example

##### Request

    GET /cloud-users/rbac-contexts
    Content-Type: */*
    Accept: application/json

    ...

##### Response

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

    [ { } ]

### GET /cloud-users/{guid}

Get a single cloud user.

Request Parameters
name | type | description
--- | --- | ---
guid | path | specify local unique identifier for cloud user (use by vProtect)

Response Body
media type | data type | description
--- | --- | ---
application/json | CloudUserDetailsResponseDto (JSON) | cloud user details

#### Example

##### Request

    GET /cloud-users/{guid}
    Content-Type: */*
    Accept: application/json

    ...

##### Response

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

    {
      "guid" : "f8f73bf9-2445-4bce-a7dd-753be3b40a67",
      "lastBackup" : 1451649601000
    }