From d5ad9f6df55de6112de1f8aad35bfc9c8da86804 Mon Sep 17 00:00:00 2001 From: Stanislav Bogatyrev Date: Tue, 1 Dec 2020 18:32:03 +0300 Subject: [PATCH] Add protocol gateway docs Brief descriptions for http and s3 protocol gateways. Signed-off-by: Stanislav Bogatyrev --- README.md | 3 ++- docs/http_gate.md | 57 +++++++++++++++++++++++++++++++++++++++++++++++ docs/s3_gate.md | 18 +++++++++++++++ 3 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 docs/http_gate.md create mode 100644 docs/s3_gate.md diff --git a/README.md b/README.md index 238c6f4..fb4dffd 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,8 @@ Tools to set up local NeoFS network and Neo 3 privnet. Devenv, for short. $ make up ``` When all services are up, you need to make GAS deposit for test wallet to be -able to pay for NeoFS operations. Test wallet is located in `wallet/wallet.json`. +able to pay for NeoFS operations. Test wallet is located in `wallet/wallet.json` +with the corresponding key in `wallet/wallet.key` ``` $ make prepare.ir diff --git a/docs/http_gate.md b/docs/http_gate.md new file mode 100644 index 0000000..b262c5a --- /dev/null +++ b/docs/http_gate.md @@ -0,0 +1,57 @@ +# HTTP Protocol gateway + +Protocol Gateway to access data in NeoFS using HTTP protocol. + +Source code and more information can be found in [project's GitHub repository](https://github.com/nspcc-dev/neofs-http-gate) + +## .env settings + +### HTTP_GW_VERSION=0.12.0 + +Image version label to use for containers. + +If you want to use locally built image, just set it's label here. Instead of +pulling from DockerHub, the local image will be used. + +### HTTP_GW_IMAGE=nspccdev/neofs-http-gate + +Image label prefix to use for containers. + +## Usage example + +- Create a new container +``` +$ neofs-cli --rpc-endpoint s01.neofs.devenv:8080 \ + --key wallets/wallet.key \ + container create --basic-acl readonly --await \ + --policy "REP 1 SELECT 1 FROM *" +container ID: 4LfREK1cetL4PUji5fqj9SgRTSmaC5jExEDK9HKCDjdP +awaiting... +container has been persisted on sidechain + +``` +- Put an object into the newly created container +``` +$ neofs-cli --rpc-endpoint s01.neofs.devenv:8080 \ + --key wallets/wallet.key \ + object put --file /tmp/backup.jpeg \ + --cid 4LfREK1cetL4PUji5fqj9SgRTSmaC5jExEDK9HKCDjdP +[/tmp/backup.jpeg] Object successfully stored + ID: 6EPpYqSFMGWrNLvYE9mNnut1CPKuPBKyi1ixHakzqsSB + CID: 4LfREK1cetL4PUji5fqj9SgRTSmaC5jExEDK9HKCDjdP +``` +- Call `curl -sSI -XGET http://http.neofs.devenv/get//` +``` +$ curl -sSI -XGET http://http.neofs.devenv/get/4LfREK1cetL4PUji5fqj9SgRTSmaC5jExEDK9HKCDjdP/6EPpYqSFMGWrNLvYE9mNnut1CPKuPBKyi1ixHakzqsSB +HTTP/1.1 200 OK +Date: Thu, 03 Dec 2020 10:34:26 GMT +Content-Type: image/jpeg +Content-Length: 144017 +x-object-id: 6EPpYqSFMGWrNLvYE9mNnut1CPKuPBKyi1ixHakzqsSB +x-owner-id: NTrezR3C4X8aMLVg7vozt5wguyNfFhwuFx +x-container-id: 4LfREK1cetL4PUji5fqj9SgRTSmaC5jExEDK9HKCDjdP +x-FileName: backup.jpeg +x-Timestamp: 1606983284 +Last-Modified: Thu, 03 Dec 2020 08:14:44 UTC +Content-Disposition: inline; filename=backup.jpeg +``` diff --git a/docs/s3_gate.md b/docs/s3_gate.md new file mode 100644 index 0000000..7362546 --- /dev/null +++ b/docs/s3_gate.md @@ -0,0 +1,18 @@ +# S3 Protocol gateway + +Protocol Gateway to access data in NeoFS using AWS S3 protocol + +Source code and more information can be found in [project's GitHub repository](https://github.com/nspcc-dev/neofs-s3-gate) + +## .env settings + +### S3_GW_VERSION=0.12.0 + +Image version label to use for containers. + +If you want to use locally built image, just set it's label here. Instead of +pulling from DockerHub, the local image will be used. + +### S3_GW_IMAGE=nspccdev/neofs-s3-gate + +Image label prefix to use for containers.