About
This api will return quota information about a storage to json data format. The output is typically used, free, and total contents.
About Api options
The options available in this api are described below:
Option name | Type | Default Value | Required | Description |
---|---|---|---|---|
path | string | This value indicates the address and path of a storage. The storage can be local or remote. For example, it can be local path like / which represents the root path in the Unix-based operating system or C:\ in Windows-based operating system. | ||
full | bool | false | This value display full numbers instead of human-readable |
Calling About 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/about | 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": "/", "full": false }' http://localhost:5860/storage/about
Invoke-RestMethod -Method Post -ContentType 'application/json' -Body '{ "path": "C:/", "full": false }' -Uri 'http://localhost:5860/storage/about'
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": {
"total": "1.03 TiB",
"free": "182.23 GiB",
"used": "870.26 GiB"
},
"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.
data
part will have a value only when succeeded
is true. If succeeded
is false, this field will be null.
The information including in the result for this api is described as follows:
total: Total size available.
free: Total space available to this user.
used: Total size used.
All sizes are in number of bytes unless you set the full option to the true
.