> For the complete documentation index, see [llms.txt](https://aegion-dynamic.gitbook.io/nimbus/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aegion-dynamic.gitbook.io/nimbus/server-side-development/core-api/files.md).

# Files

## files <a href="#nimbus-data-fabric-openapi-3-0-files" id="nimbus-data-fabric-openapi-3-0-files"></a>

Operations about files

[Find out more](http://docs.aegiondynamic.com/nimbus/)

### updateNimbusFile

> Code samples

```python
import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.put('http://localhost:8080/api/v1/file', headers = headers)

print(r.json())

```

`PUT /file`

*Update an existing file*

Update an existing file by Id

> Body parameter

```json
{
  "createdAt": "2000-01-23T04:56:07.000Z",
  "fileName": "fileName",
  "metadata": {},
  "fileSize": 6,
  "fileURI": "fileURI",
  "id": 0
}
```

#### Parameters <a href="#updatenimbusfile-parameters" id="updatenimbusfile-parameters"></a>

| Name | In   | Type | Required | Description                          |
| ---- | ---- | ---- | -------- | ------------------------------------ |
| body | body | File | true     | Update an existent file in the store |

> Example responses

> 200 Response

```json
{
  "createdAt": "2000-01-23T04:56:07.000Z",
  "fileName": "fileName",
  "metadata": {},
  "fileSize": 6,
  "fileURI": "fileURI",
  "id": 0
}
```

#### Responses <a href="#updatenimbusfile-responses" id="updatenimbusfile-responses"></a>

| Status | Meaning                                                                  | Description          | Schema |
| ------ | ------------------------------------------------------------------------ | -------------------- | ------ |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)                  | Successful operation | File   |
| 400    | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)         | Invalid ID supplied  | None   |
| 404    | [Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)           | File not found       | None   |
| 422    | [Unprocessable Entity](https://tools.ietf.org/html/rfc2518#section-10.3) | Validation exception | None   |

To perform this operation, you must be authenticated by means of one of the following methods: nimbus\_auth ( Scopes: write:files read:files )

### addNimbusFile

> Code samples

```python
import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('http://localhost:8080/api/v1/file', headers = headers)

print(r.json())

```

`POST /file`

*Add a new file to the store*

Add a new file to the store

> Body parameter

```json
{
  "createdAt": "2000-01-23T04:56:07.000Z",
  "fileName": "fileName",
  "metadata": {},
  "fileSize": 6,
  "fileURI": "fileURI",
  "id": 0
}
```

#### Parameters <a href="#addnimbusfile-parameters" id="addnimbusfile-parameters"></a>

| Name | In   | Type | Required | Description                    |
| ---- | ---- | ---- | -------- | ------------------------------ |
| body | body | File | true     | Create a new file in the store |

> Example responses

> 200 Response

```json
{
  "createdAt": "2000-01-23T04:56:07.000Z",
  "fileName": "fileName",
  "metadata": {},
  "fileSize": 6,
  "fileURI": "fileURI",
  "id": 0
}
```

#### Responses <a href="#addnimbusfile-responses" id="addnimbusfile-responses"></a>

| Status | Meaning                                                                  | Description          | Schema |
| ------ | ------------------------------------------------------------------------ | -------------------- | ------ |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)                  | Successful operation | File   |
| 400    | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)         | Invalid input        | None   |
| 422    | [Unprocessable Entity](https://tools.ietf.org/html/rfc2518#section-10.3) | Validation exception | None   |

To perform this operation, you must be authenticated by means of one of the following methods: nimbus\_auth ( Scopes: write:files read:files )

### findNimbusFilesByStatus

> Code samples

```python
import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('http://localhost:8080/api/v1/file/findByStatus', headers = headers)

print(r.json())

```

`GET /file/findByStatus`

*Finds Files by status*

Multiple status values can be provided with comma separated strings

#### Parameters <a href="#findnimbusfilesbystatus-parameters" id="findnimbusfilesbystatus-parameters"></a>

| Name   | In    | Type   | Required | Description                                         |
| ------ | ----- | ------ | -------- | --------------------------------------------------- |
| status | query | string | false    | Status values that need to be considered for filter |

**Enumerated Values**

| Parameter | Value     |
| --------- | --------- |
| status    | available |
| status    | pending   |
| status    | sold      |

> Example responses

> 200 Response

```json
[
  {
    "createdAt": "2000-01-23T04:56:07.000Z",
    "fileName": "fileName",
    "metadata": {},
    "fileSize": 6,
    "fileURI": "fileURI",
    "id": 0
  }
]
```

#### Responses <a href="#findnimbusfilesbystatus-responses" id="findnimbusfilesbystatus-responses"></a>

| Status | Meaning                                                          | Description          | Schema |
| ------ | ---------------------------------------------------------------- | -------------------- | ------ |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)          | successful operation | Inline |
| 400    | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | Invalid status value | None   |

#### Response Schema <a href="#findnimbusfilesbystatus-responseschema" id="findnimbusfilesbystatus-responseschema"></a>

Status Code **200**

| Name        | Type              | Required | Restrictions | Description                                              |
| ----------- | ----------------- | -------- | ------------ | -------------------------------------------------------- |
| *anonymous* | \[File]           | false    | none         | none                                                     |
| » id        | integer           | false    | none         | Unique id of the file object                             |
| » fileName  | string            | false    | none         | Name of file                                             |
| » fileURI   | string¦null       | false    | none         | URI of the file                                          |
| » fileSize  | integer           | false    | none         | Size of the file in bytes                                |
| » createdAt | string(date-time) | false    | none         | Time when the file object was created                    |
| » metadata  | object¦null       | false    | none         | Optional metadata associated with the file (JSON format) |

To perform this operation, you must be authenticated by means of one of the following methods: nimbus\_auth ( Scopes: write:files read:files )

### findNimbusFilesByTags

> Code samples

```python
import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('http://localhost:8080/api/v1/file/findByTags', headers = headers)

print(r.json())

```

`GET /file/findByTags`

*Finds Files by tags*

Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.

#### Parameters <a href="#findnimbusfilesbytags-parameters" id="findnimbusfilesbytags-parameters"></a>

| Name | In    | Type           | Required | Description       |
| ---- | ----- | -------------- | -------- | ----------------- |
| tags | query | array\[string] | false    | Tags to filter by |

> Example responses

> 200 Response

```json
[
  {
    "createdAt": "2000-01-23T04:56:07.000Z",
    "fileName": "fileName",
    "metadata": {},
    "fileSize": 6,
    "fileURI": "fileURI",
    "id": 0
  }
]
```

#### Responses <a href="#findnimbusfilesbytags-responses" id="findnimbusfilesbytags-responses"></a>

| Status | Meaning                                                          | Description          | Schema |
| ------ | ---------------------------------------------------------------- | -------------------- | ------ |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)          | successful operation | Inline |
| 400    | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | Invalid tag value    | None   |

#### Response Schema <a href="#findnimbusfilesbytags-responseschema" id="findnimbusfilesbytags-responseschema"></a>

Status Code **200**

| Name        | Type              | Required | Restrictions | Description                                              |
| ----------- | ----------------- | -------- | ------------ | -------------------------------------------------------- |
| *anonymous* | \[File]           | false    | none         | none                                                     |
| » id        | integer           | false    | none         | Unique id of the file object                             |
| » fileName  | string            | false    | none         | Name of file                                             |
| » fileURI   | string¦null       | false    | none         | URI of the file                                          |
| » fileSize  | integer           | false    | none         | Size of the file in bytes                                |
| » createdAt | string(date-time) | false    | none         | Time when the file object was created                    |
| » metadata  | object¦null       | false    | none         | Optional metadata associated with the file (JSON format) |

To perform this operation, you must be authenticated by means of one of the following methods: nimbus\_auth ( Scopes: write:files read:files )

### getNimbusFileById

> Code samples

```python
import requests
headers = {
  'Accept': 'application/json',
  'api_key': 'API_KEY'
}

r = requests.get('http://localhost:8080/api/v1/file/{fileId}', headers = headers)

print(r.json())

```

`GET /file/{fileId}`

*Find file by ID*

Returns a single file

#### Parameters <a href="#getnimbusfilebyid-parameters" id="getnimbusfilebyid-parameters"></a>

| Name   | In   | Type           | Required | Description          |
| ------ | ---- | -------------- | -------- | -------------------- |
| fileId | path | integer(int64) | true     | ID of file to return |

> Example responses

> 200 Response

```json
{
  "createdAt": "2000-01-23T04:56:07.000Z",
  "fileName": "fileName",
  "metadata": {},
  "fileSize": 6,
  "fileURI": "fileURI",
  "id": 0
}
```

#### Responses <a href="#getnimbusfilebyid-responses" id="getnimbusfilebyid-responses"></a>

| Status | Meaning                                                          | Description          | Schema |
| ------ | ---------------------------------------------------------------- | -------------------- | ------ |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)          | successful operation | File   |
| 400    | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | Invalid ID supplied  | None   |
| 404    | [Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)   | File not found       | None   |

To perform this operation, you must be authenticated by means of one of the following methods: api\_key, nimbus\_auth ( Scopes: write:files read:files )

### uploadNimbusbusFile

> Code samples

```python
import requests
headers = {
  'Content-Type': 'application/octet-stream',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('http://localhost:8080/api/v1/file/{fileId}/uploadImage', headers = headers)

print(r.json())

```

`POST /file/{fileId}/uploadImage`

*uploads an image*

> Body parameter

```yaml
string

```

#### Parameters <a href="#uploadnimbusbusfile-parameters" id="uploadnimbusbusfile-parameters"></a>

| Name               | In    | Type           | Required | Description          |
| ------------------ | ----- | -------------- | -------- | -------------------- |
| fileId             | path  | integer(int64) | true     | ID of file to update |
| additionalMetadata | query | string         | false    | Additional Metadata  |
| body               | body  | string(binary) | false    | none                 |

> Example responses

> 200 Response

```json
{
  "code": 0,
  "type": "type",
  "message": "message"
}
```

#### Responses <a href="#uploadnimbusbusfile-responses" id="uploadnimbusbusfile-responses"></a>

| Status | Meaning                                                 | Description          | Schema      |
| ------ | ------------------------------------------------------- | -------------------- | ----------- |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | successful operation | ApiResponse |

To perform this operation, you must be authenticated by means of one of the following methods: nimbus\_auth ( Scopes: write:files read:files )

## &#x20;<a href="#nimbus-data-fabric-openapi-3-0-compute" id="nimbus-data-fabric-openapi-3-0-compute"></a>

## file <a href="#nimbus-data-fabric-openapi-3-0-file" id="nimbus-data-fabric-openapi-3-0-file"></a>

### updateNimbusFileWithForm

> Code samples

```python
import requests
headers = {
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('http://localhost:8080/api/v1/file/{fileId}', headers = headers)

print(r.json())

```

`POST /file/{fileId}`

*Updates a file in the store with form data*

#### Parameters <a href="#updatenimbusfilewithform-parameters" id="updatenimbusfilewithform-parameters"></a>

| Name   | In    | Type           | Required | Description                             |
| ------ | ----- | -------------- | -------- | --------------------------------------- |
| fileId | path  | integer(int64) | true     | ID of file that needs to be updated     |
| name   | query | string         | false    | Name of file that needs to be updated   |
| status | query | string         | false    | Status of file that needs to be updated |

#### Responses <a href="#updatenimbusfilewithform-responses" id="updatenimbusfilewithform-responses"></a>

| Status | Meaning                                                          | Description   | Schema |
| ------ | ---------------------------------------------------------------- | ------------- | ------ |
| 400    | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | Invalid input | None   |

To perform this operation, you must be authenticated by means of one of the following methods: nimbus\_auth ( Scopes: write:files read:files )

### deleteNimbusFile

> Code samples

```python
import requests
headers = {
  'api_key': 'string',
  'Authorization': 'Bearer {access-token}'
}

r = requests.delete('http://localhost:8080/api/v1/file/{fileId}', headers = headers)

print(r.json())

```

`DELETE /file/{fileId}`

*Deletes a file*

delete a file

#### Parameters <a href="#deletenimbusfile-parameters" id="deletenimbusfile-parameters"></a>

| Name     | In     | Type           | Required | Description       |
| -------- | ------ | -------------- | -------- | ----------------- |
| api\_key | header | string         | false    | none              |
| fileId   | path   | integer(int64) | true     | File id to delete |

#### Responses <a href="#deletenimbusfile-responses" id="deletenimbusfile-responses"></a>

| Status | Meaning                                                          | Description        | Schema |
| ------ | ---------------------------------------------------------------- | ------------------ | ------ |
| 400    | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | Invalid file value | None   |

To perform this operation, you must be authenticated by means of one of the following methods: nimbus\_auth ( Scopes: write:files read:files )
