Updated Volume Server API (markdown)

Chris Lu 2020-09-19 12:12:11 -07:00
parent 3967defc1d
commit 97d3dc92ba

@ -1,6 +1,27 @@
You can append to any HTTP API with &pretty=y to see a formatted json output.
## Volume Server
## Volume Server Reads
GET/HEAD operations are direction http requests to file ids, e.g., `http://127.0.0.1:8080/3,01637037d6`.
| Parameter | Description | Default |
| ---- | -- | -- |
| readDeleted | if "true", possibly read a deleted file. Does not work if volume server is restarted or the volume is compacted. | false |
| width | if the stored file has ".png", ".jpg", ".jpeg", ".gif", apply resizing | empty |
| height | if the stored file has ".png", ".jpg", ".jpeg", ".gif", apply resizing | empty |
| mode | if resizing, "fit", or "fill". Or just resizing, unless width==height, which default to thumbnail mode | empty |
| Header | Description | Default |
| ---- | -- | -- |
| Authorization | Json Web Token for reads issued by master | empty |
| Range | for http range request, support multiple ranges | empty |
| If-Modified-Since | format "Mon, 02 Jan 2006 15:04:05 GMT", if not modified, return StatusNotModified 304 | empty |
| If-None-Match | if matches the ETag, return StatusNotModified 304 | empty |
| Accept-Encoding: zstd | compress response by zstd | empty |
| Accept-Encoding: gzip | compress response by gzip | empty |
## Volume Server Writes
### Upload File
@ -11,6 +32,23 @@ curl -F file=@/home/chris/myphoto.jpg http://127.0.0.1:8080/3,01637037d6
The size returned is the size stored on SeaweedFS, sometimes the file is automatically gzipped based on the mime type.
| URL Parameter | Description | Default |
| ---- | -- | -- |
| fsync | if "true", the writes will incur an fsync operation | false |
| type | if "replicate", this is a replicated request, so the writes will not be replicated to other volume servers | empty |
| ts | modification timestamp in epoch seconds | empty |
| cm | content is a chunk manifest file | empty |
| Header | Description | Default |
| ---- | -- | -- |
| Content-Encoding: gzip|the uploaded content is already compressed to gzip | empty |
| Content-Encoding: zstd|the uploaded content is already compressed to zstd | empty |
| Content-Type | use the specified content type | "application/octet-stream" |
| Content-MD5 | verify the uploaded content by MD5 | empty |
| Authorization | Json Web Token for writes issued by master | empty |
### Upload File Directly
```bash