# Storage Controller Resource

The API allows you to list, view and edit storage.

### GET /storages

Returns list of storage filtered by specified query parameters.

Request Parameters
name | type | description | constraints | multivalued
--- | --- | --- | --- | ---
backupStatus | query |  | "IS_PROTECTED" or "NOT_PROTECTED" or "NO_SCHEDULE" | yes
direction | query |  |  | no
filter | query |  |  | no
nameLike | query |  |  | no
nodeConfig | query |  |  | no
orderBy | query |  |  | no
page | query |  |  | no
size | query |  |  | no
snapshot-mgmt-policy | query |  |  | no
storage-policy | query |  |  | yes
storage-pool | query |  |  | no
storage-provider | query |  |  | no
storage-provider-type | query |  | "AFS" or "CEPH_RBD" or "DEFAULT" or "FILE_SYSTEM" or "NUTANIX_VG" or "NUTANIX_VG_V4" | yes
uuid | query |  |  | no

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

#### Example

##### Request

    GET /storages
    Content-Type: */*
    Accept: application/json

    ...

##### Response

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

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

### POST /storages

Create a storage.

Request Body
media type | data type | description
--- | --- | ---
application/json | StorageRequest (JSON) | specify details for new storage

Response Body
media type | data type | description
--- | --- | ---
application/json | StorageDetails (JSON) | details of newly created storage

#### Example

##### Request

    POST /storages
    Content-Type: application/json
    Accept: application/json

    { }

##### Response

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

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

### DELETE /storages/all-non-present

Remove all virtual machines that are not present and without any backup.

#### Example

##### Request

    DELETE /storages/all-non-present
    Content-Type: */*

    ...

##### Response

    HTTP/1.1 204 No Content

### POST /storages/assign-backup-policy

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

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

#### Example

##### Request

    POST /storages/assign-backup-policy
    Content-Type: application/json

    { }

##### Response

    HTTP/1.1 201 Created

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

#### Example

##### Request

    GET /storages/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 /storages/detailed

Returns detailed list of storage by specified query parameters.

Request Parameters
name | type | description | constraints | multivalued
--- | --- | --- | --- | ---
backupStatus | query |  | "IS_PROTECTED" or "NOT_PROTECTED" or "NO_SCHEDULE" | yes
direction | query |  |  | no
filter | query |  |  | no
nameLike | query |  |  | no
nodeConfig | query |  |  | no
orderBy | query |  |  | no
page | query |  |  | no
size | query |  |  | no
snapshot-mgmt-policy | query |  |  | no
storage-policy | query |  |  | yes
storage-pool | query |  |  | no
storage-provider | query |  |  | no
storage-provider-type | query |  | "AFS" or "CEPH_RBD" or "DEFAULT" or "FILE_SYSTEM" or "NUTANIX_VG" or "NUTANIX_VG_V4" | yes
uuid | query |  |  | no

Response Body
media type | data type | description
--- | --- | ---
application/json | array of StorageDetails (JSON) | detailed list of storage filtered by specified query parameters

#### Example

##### Request

    GET /storages/detailed
    Content-Type: */*
    Accept: application/json

    ...

##### Response

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

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

### GET /storages/for-backup-policy

Request Parameters
name | type | description | constraints
--- | --- | --- | ---
backup-policy | query |  |
direction | query |  |
filter | query |  |
nameLike | query |  |
orderBy | query |  |
page | query |  |
size | query |  |
storage-provider-type | query |  | "AFS" or "CEPH_RBD" or "DEFAULT" or "FILE_SYSTEM" or "NUTANIX_VG" or "NUTANIX_VG_V4"

Response Body
media type | data type | description
--- | --- | ---
application/json | array of BackupPolicyViewStorageListRecordDto (JSON) |

#### Example

##### Request

    GET /storages/for-backup-policy
    Content-Type: */*
    Accept: application/json

    ...

##### Response

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

    [ { } ]

### GET /storages/rbac-contexts

Returns list of storage 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 RbacContextListRecord (JSON) | list of storage filtered by specified query parameters

#### Example

##### Request

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

    ...

##### Response

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

    [ { } ]

### GET /storages/v2

Returns list of storage filtered by specified query parameters.

Request Parameters
name | type | description | constraints | multivalued
--- | --- | --- | --- | ---
backupStatus | query |  | "IS_PROTECTED" or "NOT_PROTECTED" or "NO_SCHEDULE" | yes
direction | query |  |  | no
filter | query |  |  | no
nameLike | query |  |  | no
nodeConfig | query |  |  | no
orderBy | query |  |  | no
page | query |  |  | no
size | query |  |  | no
snapshot-mgmt-policy | query |  |  | no
storage-policy | query |  |  | yes
storage-pool | query |  |  | no
storage-provider | query |  |  | no
storage-provider-type | query |  | "AFS" or "CEPH_RBD" or "DEFAULT" or "FILE_SYSTEM" or "NUTANIX_VG" or "NUTANIX_VG_V4" | yes
uuid | query |  |  | no

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

#### Example

##### Request

    GET /storages/v2
    Content-Type: */*
    Accept: application/json

    ...

##### Response

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

    [ { } ]

### DELETE /storages/{guid}

Remove storage.

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

#### Example

##### Request

    DELETE /storages/{guid}
    Content-Type: */*

    ...

##### Response

    HTTP/1.1 204 No Content

### GET /storages/{guid}

Get a single storage details.

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

Response Body
media type | data type | description
--- | --- | ---
application/json | StorageDetails (JSON) | a signle storage details

#### Example

##### Request

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

    ...

##### Response

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

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

### PUT /storages/{guid}

Change storage details.

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

Request Body
media type | data type | description
--- | --- | ---
application/json | StorageUpdateRequest (JSON) | specify storage details to update

Response Body
media type | data type | description
--- | --- | ---
application/json | StorageDetails (JSON) | updated details of storage

#### Example

##### Request

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

    { }

##### Response

    HTTP/1.1 204 No Content
    Content-Type: application/json

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

### POST /storages/for-backup-policy/specified

Request Body
media type | data type
--- | ---
application/json | BackupPolicyStorageListByGuidsRequest (JSON)

Response Body
media type | data type | description
--- | --- | ---
application/json | array of BackupPolicyViewStorageListRecordDto (JSON) |

#### Example

##### Request

    POST /storages/for-backup-policy/specified
    Content-Type: application/json
    Accept: application/json

    { }

##### Response

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

    [ { } ]

### PUT /storages/{guid}/settings

Change storage settings.

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

Request Body
media type | data type | description
--- | --- | ---
application/json | StorageSettingsUpdateRequest (JSON) | specify storage details for update

Response Body
media type | data type | description
--- | --- | ---
application/json | StorageDetails (JSON) | updated details for storage

#### Example

##### Request

    PUT /storages/{guid}/settings
    Content-Type: application/json
    Accept: application/json

    { }

##### Response

    HTTP/1.1 204 No Content
    Content-Type: application/json

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