S3
S3 filesystems are only accessible via HTTP their configured mountpoint. Use the POST
or PUT
method with the path to that file to (over-)write a file. The body of the request contains the contents of the file. No particular encoding or Content-Type
is required. The file can then be downloaded from the same path.
This filesystem is practical rarely changing data (e.g. VOD) for long term storage.
curl http://127.0.0.1:8080/awsfs/path/to/a/file.txt -X PUT -d @somefile.txt
The returned Content-Type
is based solely on the file extension. For a list of known mime-types and their extensions see storage.mime_types in the configuration.
Access protection
It is strongly recommended to enable a username/password (HTTP Basic-Auth) protection for any PUT/POST
and DELETE
operations on /memfs. GET
operations are not protected.
By default HTTP Basic-Auth is not enabled.
API
The contents of the S3 filesystem mounted on /awsfs
are also accessible via the API in the same way as described above, but with the same protection as the API (see API-Security configuration) for all operations. It is also possible to list all files that are currently in the filesystem.
Create, Update
Example:
echo 'test' > example.txt && \
curl http://127.0.0.1:8080/api/v3/fs/aws/example.txt \
-d @example.txt \
-X PUT
After the successful upload the file is available at /awsfs/example.txt
and /api/v3/fs/aws/example.txt
.
Description:
Writes or overwrites a file on a filesystem
Name of the filesystem
Path to file
PUT /v3/fs/{name}/{path} HTTP/1.1
Host: api
Authorization: YOUR_API_KEY
Content-Type: application/data
Accept: */*
Content-Length: 3
[
1
]
text
Read
List all files
Listing all currently stored files is done by calling /api/v3/fs/aws
. It also accepts the query parameters pattern
, sort
(name,
size,
or lastmod
) and order
(asc
or desc
). If none of the parameters are given, all files will be listed sorted by their last modification time in ascending order.
With the pattern
parameter you can filter the list based on a glob pattern, with the addition of the **
placeholder to include multiple subdirectories, e.g. listing all .ts
file in the root directory has the pattern /*.ts
, listing all .ts
file in the whole filesystem has the pattern /**.ts
.
Example:
curl "http://127.0.0.1:8080/api/v3/fs/aws?sort=name&order=asc" \
-X GET
Description:
List all files on a filesystem. The listing can be ordered by name, size, or date of last modification in ascending or descending order.
Name of the filesystem
glob pattern for file names
none, name, size, lastmod
asc, desc
GET /v3/fs/{name} HTTP/1.1
Host: api
Authorization: YOUR_API_KEY
Accept: */*
OK
[
{
"last_modified": 1,
"name": "text",
"size_bytes": 1
}
]
Download a file
For downloading a file you have to specify the complete path and filename. The Content-Type
will always be application/data
.
Example:
curl http://127.0.0.1:8080/api/v3/fs/aws/example.txt \
-X GET
Description:
Fetch a file from a filesystem
Name of the filesystem
Path to file
GET /v3/fs/{name}/{path} HTTP/1.1
Host: api
Authorization: YOUR_API_KEY
Accept: */*
text
Delete
For deleting a file you have to specify the complete path and filename.
Example:
curl http://127.0.0.1:8080/api/v3/fs/aws/example.txt \
-X DELETE
Description:
Remove a file from a filesystem
Name of the filesystem
Path to file
DELETE /v3/fs/{name}/{path} HTTP/1.1
Host: api
Authorization: YOUR_API_KEY
Accept: */*
text
Configuration
S3Last updated
Was this helpful?