File Repository Rest API
Continuous Testing allows you to upload files to the cloud. These can later be used by different features from the relative URL and download files that were created by cloud commands so that they can work with files not hosted locally.
info
- The role of the user performing the Rest Operation is specified by the Authorization header.
- This supports Authorization with Access Key only or Admin authorization.
- For a detailed example see How To Execute Rest API.
Get File Information
Get the information about the specified file.
GET /api/v1/files/<fileId>
Response
Response Status: 200 OK
{
"status": "SUCCESS",
"data": {
"id": 516,
"uniqueName": "f3",
"description": null,
"extension": "png",
"size": 2649,
"uploadedBySystem": false,
"uploadTime": "2021-05-02T12:16:01.943Z",
"lastUpdate": "2021-05-02T12:16:01.943Z",
"uploadedUser": "admin",
"lastUpdatedUser": "admin",
"projectName": "Default"
},
"code": "OK"
}
Get File Information
Get a collection about multiple files information.
GET /api/v1/files
Parameters
Name | Type | Mandatory | Description |
---|---|---|---|
project_id | String | No | Available for a Cloud Administrator only. If the project and unique_name are not specified, it returns the information about all files in all the projects. |
project_name | String | No | Available for a Cloud Administrator only. Can be used instead of the project ID. |
unique_name | String | No | If empty, return all the information about all the files in the project (all the projects if admin and project aren't specified). Otherwise, return information only about the specified file. |
Response
Response Status: 200 OK
{
"status": "SUCCESS",
"data": [
{
"id": 517,
"uniqueName": "microsoftStore.png",
"description": null,
"extension": "png",
"size": 26278,
"uploadedBySystem": false,
"uploadTime": "2021-05-02T17:58:33.888Z",
"lastUpdate": "2021-05-02T17:58:33.888Z",
"uploadedUser": "admin",
"lastUpdatedUser": "admin",
"projectName": "Default"
},
{
"id": 518,
"uniqueName": "experitest-logo.png",
"description": null,
"extension": "png",
"size": 2649,
"uploadedBySystem": false,
"uploadTime": "2021-05-02T17:58:38.533Z",
"lastUpdate": "2021-05-02T17:58:38.533Z",
"uploadedUser": "admin",
"lastUpdatedUser": "admin",
"projectName": "Default"
},
{
"id": 516,
"uniqueName": "f3",
"description": null,
"extension": "png",
"size": 2649,
"uploadedBySystem": false,
"uploadTime": "2021-05-02T12:16:01.943Z",
"lastUpdate": "2021-05-02T12:16:01.943Z",
"uploadedUser": "admin",
"lastUpdatedUser": "admin",
"projectName": "Default"
}
],
"code": "OK"
}}
Download File Content
Download a file from the repository.
GET /api/v1/files/<fileId>/download
Remove File
Remove a file from the repository.
DELETE /api/v1/files/<fileId>
Response
Response Status: 200 OK
{
"status": "SUCCESS",
"code": "OK"
}
Update File
Update a file in the repository.
POST /api/v1/files/<fileId>
Parameters
Name | Type | Mandatory | Description |
---|---|---|---|
file | MultipartFile | No | File to update |
description | String | No | File description (length < 255 Characters) |
unique_name | String | No | Unique name (unique per project) that will be the way to work with the file (like a unique name in applications). |
Response
Response Status: 200 OK
{
"status": "SUCCESS",
"data": null,
"code": "OK"
}
Upload File
Upload a new file to the repository.
Return Value - File ID (generated by the system)
POST /api/v1/files
Parameters
Name | Type | Mandatory | Description |
---|---|---|---|
file | MultipartFile | Yes | File to store |
description | String | No | File description (length < 255 Characters) |
unique_name | String | No | File unique name -unique per project- that will be the way to work with the file (like a unique name in applications). If the name is not specified, it will be the original file name. |
project_id | String | No | Available for cloud admin only, if the project is not specified, it will be uploaded to the Default project. |
project_name | String | No | Available for cloud admin only if project id not specified. |
Response
Response Status: 200 OK
{
"status": "SUCCESS",
"data": 516,
"message": "file f3 uploaded with id 516",
"code": "OK"
}