# OS Download Controller Resource

The API allows you to create, list and delete os downloads

### GET /os-download

Retrieves list of os downloads

Request Parameters
name | type | description | constraints
--- | --- | --- | ---
backup | query |  |
direction | query |  |
filter | query |  |
finished-mount | query |  | boolean
mode | query |  | "AUTO" or "CLOUD_DOWNLOAD" or "CLOUD_PST_DOWNLOAD" or "INSTANT_RESTORE" or "ISCSI" or "MANUAL" or "OS_DOWNLOAD"
nameLike | query |  |
node | query |  |
orderBy | query |  |
page | query |  |
project-uuid | query |  |
protected-entity | query |  |
protected-entity-type | query |  | "APP" or "CLOUD" or "CLOUD_GROUP" or "CLOUD_SITE" or "CLOUD_TEAMS" or "CLOUD_USER" or "OS" or "OS_AGENT" or "STORAGE" or "VM"
size | query |  |

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

#### Example

##### Request

    GET /os-download
    Content-Type: */*
    Accept: application/json

    ...

##### Response

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

    [ {
      "guid" : "f8f73bf9-2445-4bce-a7dd-753be3b40a67",
      "mode" : {
        "name" : "ENUM_NAME",
        "description" : "Enum description"
      }
    } ]

### POST /os-download

Creates os download for list of protected objects

Request Body
media type | data type | description
--- | --- | ---
application/json | CreateOSDownloadRequest (JSON) | create os download request

Response Body
media type | data type | description
--- | --- | ---
application/json | TaskDetails (JSON) | download details

#### Example

##### Request

    POST /os-download
    Content-Type: application/json
    Accept: application/json

    { }

##### Response

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

    {
      "guid" : "f8f73bf9-2445-4bce-a7dd-753be3b40a67",
      "type" : {
        "name" : "ENUM_NAME",
        "description" : "Enum description"
      },
      "state" : {
        "name" : "ENUM_NAME",
        "description" : "Enum description"
      },
      "windowStart" : 1451649601000,
      "windowEnd" : 1451677502000,
      "creationTime" : 1451649601000,
      "finishTime" : 1451677502000,
      "progress" : 66.5,
      "priority" : 50,
      "backupType" : {
        "name" : "ENUM_NAME",
        "description" : "Enum description"
      }
    }

### DELETE /os-download/{guid}

Deletes os download

Request Parameters
name | type | description
--- | --- | ---
guid | path | guid of the cloud download to delete

Response Body
media type | data type | description
--- | --- | ---
application/json | TaskDetails (JSON) |

#### Example

##### Request

    DELETE /os-download/{guid}
    Content-Type: */*
    Accept: application/json

    ...

##### Response

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

    {
      "guid" : "f8f73bf9-2445-4bce-a7dd-753be3b40a67",
      "type" : {
        "name" : "ENUM_NAME",
        "description" : "Enum description"
      },
      "state" : {
        "name" : "ENUM_NAME",
        "description" : "Enum description"
      },
      "windowStart" : 1451649601000,
      "windowEnd" : 1451677502000,
      "creationTime" : 1451649601000,
      "finishTime" : 1451677502000,
      "progress" : 66.5,
      "priority" : 50,
      "backupType" : {
        "name" : "ENUM_NAME",
        "description" : "Enum description"
      }
    }

### GET /os-download/{guid}

Retrieves os download

Request Parameters
name | type | description
--- | --- | ---
guid | path | guid of the os download to retrieve

Response Body
media type | data type | description
--- | --- | ---
application/octet-stream | object |

#### Example

##### Request

    GET /os-download/{guid}
    Content-Type: */*
    Accept: application/octet-stream

    ...

##### Response

    HTTP/1.1 200 OK
    Content-Type: application/octet-stream

    ...

### PUT /os-download/{guid}

Updates os download status

Request Parameters
name | type | description
--- | --- | ---
guid | path |

Request Body
media type | data type | description
--- | --- | ---
application/json | UpdateDownloadRequest (JSON) | update os download request

Response Body
media type | data type | description
--- | --- | ---
application/json | MountedBackupDetails (JSON) | download details

#### Example

##### Request

    PUT /os-download/{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",
      "mode" : {
        "name" : "ENUM_NAME",
        "description" : "Enum description"
      }
    }