2020-12-01 15:32:03 +00:00
|
|
|
# HTTP Protocol gateway
|
|
|
|
|
2022-12-21 11:59:19 +00:00
|
|
|
Protocol Gateway to access data in FrostFS using HTTP protocol.
|
2020-12-01 15:32:03 +00:00
|
|
|
|
2023-06-07 09:48:03 +00:00
|
|
|
Source code and more information can be found in [project's repository](https://git.frostfs.info/TrueCloudLab/frostfs-http-gw)
|
2020-12-01 15:32:03 +00:00
|
|
|
|
|
|
|
## .env settings
|
|
|
|
|
2021-05-24 16:04:38 +00:00
|
|
|
### HTTP_GW_VERSION=0.15.1
|
2020-12-01 15:32:03 +00:00
|
|
|
|
|
|
|
Image version label to use for containers.
|
|
|
|
|
2022-12-21 11:59:19 +00:00
|
|
|
If you want to use locally built image, just set its label here. Instead of
|
2020-12-01 15:32:03 +00:00
|
|
|
pulling from DockerHub, the local image will be used.
|
|
|
|
|
2022-12-21 11:59:19 +00:00
|
|
|
### HTTP_GW_IMAGE=truecloudlab/frostfs-http-gw
|
2020-12-01 15:32:03 +00:00
|
|
|
|
|
|
|
Image label prefix to use for containers.
|
|
|
|
|
|
|
|
## Usage example
|
|
|
|
|
|
|
|
- Create a new container
|
|
|
|
```
|
2022-12-21 11:59:19 +00:00
|
|
|
$ frostfs-cli --rpc-endpoint s01.frostfs.devenv:8080 \
|
2024-07-08 07:34:28 +00:00
|
|
|
--wallet wallets/wallet.key \
|
|
|
|
container create --basic-acl private --await \
|
2020-12-01 15:32:03 +00:00
|
|
|
--policy "REP 1 SELECT 1 FROM *"
|
|
|
|
container ID: 4LfREK1cetL4PUji5fqj9SgRTSmaC5jExEDK9HKCDjdP
|
|
|
|
awaiting...
|
|
|
|
container has been persisted on sidechain
|
|
|
|
|
|
|
|
```
|
|
|
|
- Put an object into the newly created container
|
|
|
|
```
|
2022-12-21 11:59:19 +00:00
|
|
|
$ frostfs-cli --rpc-endpoint s01.frostfs.devenv:8080 \
|
2024-07-08 07:34:28 +00:00
|
|
|
--wallet wallets/wallet.key \
|
2020-12-01 15:32:03 +00:00
|
|
|
object put --file /tmp/backup.jpeg \
|
|
|
|
--cid 4LfREK1cetL4PUji5fqj9SgRTSmaC5jExEDK9HKCDjdP
|
|
|
|
[/tmp/backup.jpeg] Object successfully stored
|
|
|
|
ID: 6EPpYqSFMGWrNLvYE9mNnut1CPKuPBKyi1ixHakzqsSB
|
|
|
|
CID: 4LfREK1cetL4PUji5fqj9SgRTSmaC5jExEDK9HKCDjdP
|
|
|
|
```
|
2022-12-21 11:59:19 +00:00
|
|
|
- Call `curl -sSI -XGET http://http.frostfs.devenv/get/<cid>/<oid>`
|
2020-12-01 15:32:03 +00:00
|
|
|
```
|
2022-12-21 11:59:19 +00:00
|
|
|
$ curl -sSI -XGET http://http.frostfs.devenv/get/4LfREK1cetL4PUji5fqj9SgRTSmaC5jExEDK9HKCDjdP/6EPpYqSFMGWrNLvYE9mNnut1CPKuPBKyi1ixHakzqsSB
|
2020-12-01 15:32:03 +00:00
|
|
|
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
|
|
|
|
```
|