List
This api will list of entities regarding specific path.
List Api options
The options available in this api are described below:
Option name | Type | Default Value | Required | Description |
---|---|---|---|---|
Path | string | The storage path from which the entities list are to be retrieved | ||
Kind | string | FileAndDirectory | Kind of entity. Valid values are File, Directory, and FileAndDirectory | |
Include | string | Include entities matching pattern | ||
Exclude | string | Exclude entities matching pattern | ||
MinAge | string | Filter entities older than this in second or suffix ms | s | m | h | d | w | M | y | ||
MaxAge | string | Filter entities younger than this in second or suffix ms | s | m | h | d | w | M | y | ||
MinSize | string | Filter entities bigger than this in KiB or suffix B | K | M | G | T | P | ||
MaxSize | string | Filter entities smaller than this in KiB or suffix B | K | M | G | T | P | ||
Full | bool | false | Full numbers instead of human-readable | |
Sorting | string | Sorting entities based on field name and ascending and descending. Like Property ASC, Property2 DESC | ||
CaseSensitive | bool | false | Ignore or apply case sensitive in filters | |
Recurse | bool | false | Apply recursion on filtering entities in the specified path | |
Hashing | bool | false | Display hashing content in response data | |
MaxResults | long | 0 | The maximum number of results to return (0 meaning showing all entities) | |
ShowMetadata | bool | false | Display entities metadata in response data |
Calling List Api
For calling this api, the following details are required to apply:
The options and parameters introduced in the previous section must be included as json data in the request body part.
URL | Method | ContentType | Body |
---|---|---|---|
http://localhost:5860/storage/list | POST | application/json |
|
Now, if we want to have these details in the form of an http api call, open a new terminal and enter the following command:
First of all make sure flowsynx is running.
- HTTP API (Bash)
- HTTP API (PowerShell)
curl -X POST -H "Content-Type: application/json" -d '{ "path": "/test/", "kind": "", "include": "", "exclude": "", "minAge": "", "maxAge": "", "minSize": "", "maxSize": "", "full": true, "caseSensitive": false, "recurse": true, "sorting": "kind asc", "hashing": false, "maxResults": 0, "showMetadata": false }' http://localhost:5860/storage/list
Invoke-RestMethod -Method Post -ContentType 'application/json' -Body '{ "path": "C:/test/", "kind": "", "include": "", "exclude": "", "minAge": "", "maxAge": "", "minSize": "", "maxSize": "", "full": true, "caseSensitive": false, "recurse": true, "sorting": "kind asc", "hashing": false, "maxResults": 0, "showMetadata": false }' -Uri 'http://localhost:5860/storage/list'
Also you can use Http Api test clients
to test this api. Anyway, after executing this api, a result like below will be obtained.
{
"data": [
{
"id": "19C7DA5067E52CFB2B53D249ACC4B68F",
"kind": "file",
"name": "image01.jpg",
"path": "/test/image01.exe",
"size": "34304",
"contentType": "application/octet-stream",
"modifiedTime": "2024-05-15T20:45:06+00:00",
"md5": null,
"metadata": null
},
.
.
.
],
"messages": [],
"succeeded": true
}
The answer is divided into three data
, messages
, and succeeded
parts.
succeeded
indicates the status of the execution of this api which is boolean value and can be true or false.
messages
also indicates the list of possible messages that are returned with the response.
data
contains the data to be returned.