From 97d3dc92ba527b7cf77ec0c69201ea0789e4fc92 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 19 Sep 2020 12:12:11 -0700 Subject: [PATCH] Updated Volume Server API (markdown) --- Volume-Server-API.md | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/Volume-Server-API.md b/Volume-Server-API.md index aa4dc24..de4acd5 100644 --- a/Volume-Server-API.md +++ b/Volume-Server-API.md @@ -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