# Upload

## Upload - Install

Install a given application

**POST**

```
https://api-server-host-name/configapi/Uploads/{pool_UUID}/{logpoint_identifier}/install
```

### Parameters

| Field             | Label in UI | Type   | Description                                                                                 |
| ----------------- | ----------: | ------ | ------------------------------------------------------------------------------------------- |
| application\_type |           - | String | Type of the application to install. can be either 'application' or 'patch'. Mandatory Field |
| file\_location    |           - | String | Location of the file to install. can be either 'private' or 'public'. Mandatory Field       |
| file\_name        |        File | String | Name of the file to install. Mandatory Field                                                |

### Request Example

```json
{
    "data": {
        "application_type": "Application",
        "file_location": "private",
        "file_name": "test_1.0.0.pak"
    }
}
```

### Success Response

```json
{
    "status": "Success",
    "message": "/monitorapi/v1/{pool_UUID}/{logpoint_identifier}/orders/{request_id}"
}
```

## Upload - List

List all files in private storage

**GET**

```
https://api-server-host-name/configapi/Uploads/{pool_UUID}/list
```

### Success Response

```json
[
    "test_1.0.0.pak"
]
```

## Upload - ListPublic

List all files in public storage

**GET**

```
https://api-server-host-name/configapi/Uploads/list
```

### Success Response

```json
[
    "test_1.0.0.pak"
]
```

## Upload - TrashPrivate

Delete the file with given name from private storage

**DELETE**

```
https://api-server-host-name/configapi/Uploads/{pool_UUID}/{file_name}
```

### Parameters

| Field      | Label in UI | Type   | Description                         |
| ---------- | ----------: | ------ | ----------------------------------- |
| file\_name |             | String | File to be deleted. Mandatory Field |

### Success Response

```json
{
    "status": "Success",
    "message": "test_1.0.0.pak successfully deleted"
}
```

## Upload - TrashPublic

Delete the file with given name from public storage

**DELETE**

```
https://api-server-host-name/configapi/Uploads/{file_name}
```

### Parameters

| Field      | Label in UI | Type   | Description                         |
| ---------- | ----------: | ------ | ----------------------------------- |
| file\_name |             | String | File to be deleted. Mandatory Field |

### Success Response

```json
{
    "status": "Success",
    "message": "test_1.0.0.pak successfully deleted"
}
```

## Upload - Upload

Upload files to private storage

**POST**

```
https://api-server-host-name/configapi/Uploads/{pool_UUID}
```

### Header

| Field             | Label in UI | Description                                                                                                                                                                           |
| ----------------- | ----------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| file\_name        |             | Name of the file to be uploaded. The file name must be in the format name\_version.pak.                                                                                               |
| Content-Type      |             | application/octet-stream                                                                                                                                                              |
| replace\_existing |             | Set the value of this parameter as 'true' to replace the existing file with the same name with the new file. Default value is 'false'. Value can be 'true' or 'false'. Optional field |

### Parameters

| Field | Label in UI | Type      | Description                           |
| ----- | ----------: | --------- | ------------------------------------- |
| file  |           - | \[Object] | (Pak) to be uploaded. Mandatory Field |

### Success Response

```json
{
    "status": "Success",
    "message": "test_1.0.0.pak successfully uploaded in private storage. "
}
```

## Upload - UploadPublic files

Upload files to public storage

**POST**

```
https://api-server-host-name/configapi/Uploads/PublicUpload
```

### Header

| Field             | Label in UI | Description                                                                                                                                                                           |
| ----------------- | ----------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| file\_name        |             | Name of the file to be uploaded. The file name must be in the format name\_version.pak.                                                                                               |
| Content-Type      |             | application/octet-stream                                                                                                                                                              |
| replace\_existing |             | Set the value of this parameter as 'true' to replace the existing file with the same name with the new file. Default value is 'false'. Value can be 'true' or 'false'. Optional field |

### Parameters

| Field | Label in UI | Type      | Description                           |
| ----- | ----------: | --------- | ------------------------------------- |
| file  |           - | \[Object] | (Pak) to be uploaded. Mandatory Field |

### Success Response

```json
{
    "status": "Success",
    "message": "test_1.0.0.pak successfully uploaded in public storage. "
}
```
