# Cloud Site Controller Resource

The API allows you to list and view cloud sites.

### GET /cloud-sites

Returns list of cloud sites filtered by specified query parameters.

Request Parameters
name | type | description | default | 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
team | query |  |  |  | no
with-childs | query |  |  | boolean | no
with-teams | query |  | false | boolean | no

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

#### Example

##### Request

    GET /cloud-sites
    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-sites/assign-backup-policy

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

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

#### Example

##### Request

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

    { }

##### Response

    HTTP/1.1 201 Created

### GET /cloud-sites/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 CloudSiteListResponseDto (JSON) | list of protected entities for backup cleanup

#### Example

##### Request

    GET /cloud-sites/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
    } ]

### POST /cloud-sites/children-map

Returns map of cloud site children for specified site guids.

Request Parameters
name | type | description | default | constraints
--- | --- | --- | --- | ---
only-present | query | specify this query parameter if only present subsites should be listed (default: true) | true | boolean

Request Body
media type | data type | description
--- | --- | ---
application/json | array of NameAndGuid (JSON) | specify list of local unique identifiers for cloud sites (use by vProtect)

Response Body
media type | data type | description
--- | --- | ---
application/json | map of array of CloudSiteListResponseDto (JSON) | map of cloud site children for specified site guids.

#### Example

##### Request

    POST /cloud-sites/children-map
    Content-Type: application/json
    Accept: application/json

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

##### Response

    HTTP/1.1 201 Created
    Content-Type: application/json

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

### GET /cloud-sites/rbac-contexts

Returns list of cloud sites 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 sites filtered by specified query parameters

#### Example

##### Request

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

    ...

##### Response

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

    [ { } ]

### POST /cloud-sites/subsites

Returns list of cloud subsites for specified site guids.

Request Parameters
name | type | description | default | constraints
--- | --- | --- | --- | ---
only-present | query | specify this query parameter if only present subsites should be listed (default: true) | true | boolean

Request Body
media type | data type | description
--- | --- | ---
application/json | array of NameAndGuid (JSON) | specify list of local unique identifiers for cloud sites (use by vProtect)

Response Body
media type | data type | description
--- | --- | ---
application/json | array of CloudSiteListResponseDto (JSON) | list of cloud subsites for specified site guids.

#### Example

##### Request

    POST /cloud-sites/subsites
    Content-Type: application/json
    Accept: application/json

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

##### Response

    HTTP/1.1 201 Created
    Content-Type: application/json

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

### POST /cloud-sites/subsites-map

Returns map of cloud subsites for specified site guids.

Request Parameters
name | type | description | default | constraints
--- | --- | --- | --- | ---
only-present | query | specify this query parameter if only present subsites should be listed (default: true) | true | boolean

Request Body
media type | data type | description
--- | --- | ---
application/json | array of NameAndGuid (JSON) | specify list of local unique identifiers for cloud sites (use by vProtect)

Response Body
media type | data type | description
--- | --- | ---
application/json | map of array of CloudSiteListResponseDto (JSON) | map of cloud subsites for specified site guids.

#### Example

##### Request

    POST /cloud-sites/subsites-map
    Content-Type: application/json
    Accept: application/json

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

##### Response

    HTTP/1.1 201 Created
    Content-Type: application/json

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

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

Get a single cloud site.

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

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

#### Example

##### Request

    GET /cloud-sites/{guid}
    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-sites/{guid}/children

Returns list of cloud site children for specified site guid.

Request Parameters
name | type | description | default | constraints
--- | --- | --- | --- | ---
guid | path | specify local unique identifier for cloud site (use by vProtect) |  |
only-present | query | specify this query parameter if only present subsites should be listed (default: true) | true | boolean

Response Body
media type | data type | description
--- | --- | ---
application/json | array of CloudSiteListResponseDto (JSON) | list of cloud site children for specified site guid.

#### Example

##### Request

    GET /cloud-sites/{guid}/children
    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-sites/{guid}/subsites

Returns list of cloud subsites for specified site guid.

Request Parameters
name | type | description | default | constraints
--- | --- | --- | --- | ---
guid | path | specify local unique identifier for cloud site (use by vProtect) |  |
only-present | query | specify this query parameter if only present subsites should be listed (default: true) | true | boolean

Response Body
media type | data type | description
--- | --- | ---
application/json | array of CloudSiteListResponseDto (JSON) | list of cloud subsites for specified site guid.

#### Example

##### Request

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

    ...

##### Response

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

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