Skip to content

Storage Gateway

Storage Gateway lets you:

  • Connect your storage to one or more MASV Portals and have files automatically delivered to it.
  • Use the MASV Web App with Team members to access specific file locations on connected storage without requiring them to have direct or remote access to the storage.

Setup guide

If you are looking for an end-to-end setup guide, see How to integrate storage devices with MASV.

Prerequisites

Setting up a Storage Gateway requires MASV Agent to be installed on the server that provides storage.

To install the MASV Agent, choose one of the following:

Tip

If you're running the MASV Agent with Docker, you must execute masv or curl commands within the container. See our Docker setup guide for more details.

Managing connections

Add a connection

masv gateway add \
--id "<your-key>" \
--secret '<your-secret>' \
--name "<your-connection-name>" \
--root-path "<your-shared-folder>" \
--permissions "<your-permissions>" \
--uid <your-uid> \
--gid <your-gid>

Parameters

Name Type Required Description
id String Yes ID of the existing Storage Device Integration
name String Yes Connection name—use something descriptive and easy to recognize
permissions String Yes Determines the file permissions afforded to this connection. Valid values: r, w
root-path String Yes This folder and everything within it will become remotely accessible. Must be an absolute path.
secret String Yes Unique secret key required to register this connection with the MASV API
gid Integer No Custom group id override. When downloading files on linux, will be used to assign ownership of the downloaded file. Not supported on windows systems or read-only connections
uid Integer No Custom user id override. When downloading files on linux, will be used to assign ownership of the downloaded file. Not supported on windows systems or read-only connections

Tip

Linux native installations will run the background system service as root. If users want downloaded files to belong to a specific user, they should specify a gid and uid override to assign ownership of these files.

curl -X POST -H "Content-Type: application/json" http://localhost:8080/api/v1/storage_gateway/register -d '{
  "id": "<your-key>",
  "secret": "<your-secret>",
  "name": "<your-connection-name>",
  "root_path": "<your-shared-folder>",
  "permissions": "<your-permissions>",
  "user_id": <your_uid>,
  "group_id": <your_gid>,
}'

Parameters

Name Type Required Description
id String Yes ID of the existing Storage Device Integration
name String Yes Connection name—use something descriptive and easy to recognize
permissions String Yes Determines the file permissions afforded to this connection. Valid values: r, w
root-path String Yes This folder and everything within it will become remotely accessible. Must be an absolute path.
secret String Yes Unique secret key required to register this connection with the MASV API
group_id Integer No Custom group id override. When downloading files on linux, will be used to assign ownership of the downloaded file. Not supported on windows systems or read-only connections
user_id Integer No Custom user id override. When downloading files on linux, will be used to assign ownership of the downloaded file. Not supported on windows systems or read-only connections

Tip

Linux native installations will run the background system service as root. If users want downloaded files to belong to a specific user, they should specify a group_id and user_id override to assign ownership of these files.

List connections

You can list your registered connections with:

masv gateway ls
curl -X GET http://localhost:8080/api/v1/storage_gateway/list

Remove a connection

You can remove a connection from the MASV Agent using the following:

masv gateway rm CONNECTION_ID
curl -X POST -H "Content-Type: application/json" http://localhost:8080/api/v1/storage_gateway/unregister -d '{
  "id": "CONNECTION_ID",
}'

Tip

Removing a connection disconnects it from the MASV Agent—it does not delete the Storage Device Integration from your MASV account.

Updating a connection

You can update an existing connection using the following:

masv gateway update id \
--root-path "<new-root-path>" \
--uid <new-uid> \
--gid <new-gid>

Parameters

Name Type Required Description
id String Yes ID of the existing Storage Device Integration
root-path String No This folder and everything within it will become remotely accessible. Must be an absolute path.
gid Integer No Custom group id override. When downloading files on linux, will be used to assign ownership of the downloaded file. Provide a value of -1 to remove
uid Integer No Custom user id override. When downloading files on linux, will be used to assign ownership of the downloaded file. Provide a value of -1 to remove
curl -X POST -H "Content-Type: application/json" http://localhost:8080/api/v1/storage_gateway/update -d '{
  "id": "<existing-connection-id>",
  "root_path": "<new-root-path>",
  "user_id": <new-user-id>,
  "group_id": <new-group-id>,
}'

Parameters

Name Type Required Description
id String Yes ID of the existing Storage Device Integration
root_path String No This folder and everything within it will become remotely accessible. Must be an absolute path.
group_id Integer No Custom group id override. When downloading files on linux, will be used to assign ownership of the downloaded file. Provide a value of -1 to remove the override
user_id Integer No Custom user id override. When downloading files on linux, will be used to assign ownership of the downloaded file. Provide a value of -1 to remove the override