Updated Filer Server API (markdown)

harry huang 2022-02-18 23:01:34 +08:00
parent e88dc33d2e
commit 58a1493642

@ -39,6 +39,10 @@ You can append to any HTTP API with &pretty=y to see a formatted json output.
| header: `Content-Type` | used for auto compression | empty |
| header: `Content-Disposition` | used as response content-disposition | empty |
| prefixed header: `Seaweed-` | example: `Seaweed-name1: value1`. Returned as `Seaweed-Name1: value1` in GET/HEAD response header. | empty |
| GET Parameter | Description | Default |
| ---- | -- | -- |
| metadata| get file metadata | empty |
### notice
* It is recommended to add retries when writing to Filer.
* `AutoChunking` is not supported for method `PUT`. If the file length is greater than 256MB, only the leading 256MB in the `PUT` request will be saved.
@ -61,7 +65,6 @@ Examples:
> curl -T test.yaml http://localhost:8888/test.yaml?op=append # append to an file by PUT
{"name":"test.yaml","size":866}
> curl -H "Accept: application/json" "http://localhost:8888/javascript/?pretty=y" # list all files under /javascript/
curl -H "Accept: application/json" "http://localhost:8888/javascript/?pretty=y"
{
"Path": "/javascript",
"Entries": [
@ -118,6 +121,46 @@ curl -H "Accept: application/json" "http://localhost:8888/javascript/?pretty=y"
"LastFileName": "jquery-sparklines",
"ShouldDisplayLoadMore": false
}
# get file metadata
> curl 'http://localhost:8888/test01.py?metadata&pretty=yes'
{
"FullPath": "/test01.py",
"Mtime": "2022-01-09T19:11:18+08:00",
"Crtime": "2022-01-09T19:11:18+08:00",
"Mode": 432,
"Uid": 1001,
"Gid": 1001,
"Mime": "text/x-python",
"Replication": "",
"Collection": "",
"TtlSec": 0,
"DiskType": "",
"UserName": "",
"GroupNames": null,
"SymlinkTarget": "",
"Md5": "px6as5eP7tF5YcgAv5m60Q==",
"FileSize": 1992,
"Extended": null,
"chunks": [
{
"file_id": "17,04fbb55507b515",
"size": 1992,
"mtime": 1641726678984876713,
"e_tag": "px6as5eP7tF5YcgAv5m60Q==",
"fid": {
"volume_id": 17,
"file_key": 326581,
"cookie": 1426568469
},
"is_compressed": true
}
],
"HardLinkId": null,
"HardLinkCounter": 0,
"Content": null,
"Remote": null,
"Quota": 0
}
```
### GET files