2020-01-30 11:41:24 +00:00
|
|
|
syntax = "proto3";
|
2020-08-05 22:20:53 +00:00
|
|
|
|
2020-08-12 21:43:51 +00:00
|
|
|
package neo.fs.v2.container;
|
2020-08-05 22:20:53 +00:00
|
|
|
|
2023-03-07 08:50:02 +00:00
|
|
|
option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/container/grpc;container";
|
2021-03-10 10:54:06 +00:00
|
|
|
option csharp_namespace = "Neo.FileStorage.API.Container";
|
2020-01-30 11:41:24 +00:00
|
|
|
|
2020-07-31 14:18:50 +00:00
|
|
|
import "acl/types.proto";
|
2020-01-30 11:41:24 +00:00
|
|
|
import "container/types.proto";
|
2020-08-05 15:07:56 +00:00
|
|
|
import "refs/types.proto";
|
2020-08-19 14:00:23 +00:00
|
|
|
import "session/types.proto";
|
2020-01-30 11:41:24 +00:00
|
|
|
|
2020-10-14 16:57:36 +00:00
|
|
|
// `ContainerService` provides API to interact with `Container` smart contract
|
|
|
|
// in NeoFS sidechain via other NeoFS nodes. All of those actions can be done
|
|
|
|
// equivalently by directly issuing transactions and RPC calls to sidechain
|
|
|
|
// nodes.
|
2020-08-12 21:43:51 +00:00
|
|
|
service ContainerService {
|
2020-10-14 16:57:36 +00:00
|
|
|
// `Put` invokes `Container` smart contract's `Put` method and returns
|
|
|
|
// response immediately. After a new block is issued in sidechain, request is
|
2024-02-28 15:53:04 +00:00
|
|
|
// verified by Inner Ring nodes. After one more block in sidechain, the
|
|
|
|
// container is added into smart contract storage.
|
2021-11-12 16:10:39 +00:00
|
|
|
//
|
|
|
|
// Statuses:
|
2022-02-21 16:00:08 +00:00
|
|
|
// - **OK** (0, SECTION_SUCCESS): \
|
|
|
|
// request to save the container has been sent to the sidechain;
|
2024-03-05 09:36:58 +00:00
|
|
|
// - Common failures (SECTION_FAILURE_COMMON);
|
|
|
|
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
2024-07-25 15:19:02 +00:00
|
|
|
// container create access denied.
|
2020-08-11 09:03:50 +00:00
|
|
|
rpc Put(PutRequest) returns (PutResponse);
|
|
|
|
|
2020-10-14 16:57:36 +00:00
|
|
|
// `Delete` invokes `Container` smart contract's `Delete` method and returns
|
|
|
|
// response immediately. After a new block is issued in sidechain, request is
|
2024-02-28 15:53:04 +00:00
|
|
|
// verified by Inner Ring nodes. After one more block in sidechain, the
|
|
|
|
// container is added into smart contract storage.
|
2021-11-12 16:10:39 +00:00
|
|
|
//
|
|
|
|
// Statuses:
|
2022-02-21 16:00:08 +00:00
|
|
|
// - **OK** (0, SECTION_SUCCESS): \
|
|
|
|
// request to remove the container has been sent to the sidechain;
|
2024-03-05 09:36:58 +00:00
|
|
|
// - Common failures (SECTION_FAILURE_COMMON);
|
|
|
|
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
2024-07-25 15:19:02 +00:00
|
|
|
// container delete access denied.
|
2020-08-11 09:03:50 +00:00
|
|
|
rpc Delete(DeleteRequest) returns (DeleteResponse);
|
|
|
|
|
2020-10-14 16:57:36 +00:00
|
|
|
// Returns container structure from `Container` smart contract storage.
|
2021-11-12 16:10:39 +00:00
|
|
|
//
|
|
|
|
// Statuses:
|
2022-02-21 16:00:08 +00:00
|
|
|
// - **OK** (0, SECTION_SUCCESS): \
|
|
|
|
// container has been successfully read;
|
2022-02-21 15:49:33 +00:00
|
|
|
// - Common failures (SECTION_FAILURE_COMMON);
|
2022-02-21 16:00:08 +00:00
|
|
|
// - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \
|
2024-03-05 09:36:58 +00:00
|
|
|
// requested container not found;
|
|
|
|
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
2024-07-25 15:19:02 +00:00
|
|
|
// access to container is denied.
|
2020-08-11 09:03:50 +00:00
|
|
|
rpc Get(GetRequest) returns (GetResponse);
|
|
|
|
|
2020-10-14 16:57:36 +00:00
|
|
|
// Returns all owner's containers from 'Container` smart contract' storage.
|
2021-11-12 16:10:39 +00:00
|
|
|
//
|
|
|
|
// Statuses:
|
2022-02-21 16:00:08 +00:00
|
|
|
// - **OK** (0, SECTION_SUCCESS): \
|
|
|
|
// container list has been successfully read;
|
2024-03-05 09:36:58 +00:00
|
|
|
// - Common failures (SECTION_FAILURE_COMMON);
|
|
|
|
// - **CONTAINER_ACCESS_DENIED** (3074, SECTION_CONTAINER): \
|
2024-07-25 15:19:02 +00:00
|
|
|
// container list access denied.
|
2020-08-11 09:03:50 +00:00
|
|
|
rpc List(ListRequest) returns (ListResponse);
|
2020-01-30 11:41:24 +00:00
|
|
|
}
|
|
|
|
|
2020-08-12 21:43:51 +00:00
|
|
|
// New NeoFS Container creation request
|
2020-01-30 11:41:24 +00:00
|
|
|
message PutRequest {
|
2020-10-14 16:57:36 +00:00
|
|
|
// Container creation request has container structure's signature as a
|
|
|
|
// separate field. It's not stored in sidechain, just verified on container
|
|
|
|
// creation by `Container` smart contract. `ContainerID` is a SHA256 hash of
|
|
|
|
// the stable-marshalled container strucutre, hence there is no need for
|
|
|
|
// additional signature checks.
|
2020-08-11 08:47:04 +00:00
|
|
|
message Body {
|
2020-10-14 16:57:36 +00:00
|
|
|
// Container structure to register in NeoFS
|
2020-08-11 08:47:04 +00:00
|
|
|
container.Container container = 1;
|
2020-08-05 22:20:53 +00:00
|
|
|
|
2022-02-21 08:54:46 +00:00
|
|
|
// Signature of a stable-marshalled container according to RFC-6979.
|
2022-03-02 09:30:05 +00:00
|
|
|
neo.fs.v2.refs.SignatureRFC6979 signature = 2;
|
2020-08-11 08:47:04 +00:00
|
|
|
}
|
|
|
|
// Body of container put request message.
|
|
|
|
Body body = 1;
|
|
|
|
|
|
|
|
// Carries request meta information. Header data is used only to regulate
|
|
|
|
// message transport and does not affect request execution.
|
2020-08-19 14:00:23 +00:00
|
|
|
neo.fs.v2.session.RequestMetaHeader meta_header = 2;
|
2020-08-11 08:47:04 +00:00
|
|
|
|
|
|
|
// Carries request verification information. This header is used to
|
2020-10-14 16:57:36 +00:00
|
|
|
// authenticate the nodes of the message route and check the correctness of
|
|
|
|
// transmission.
|
2020-08-19 14:00:23 +00:00
|
|
|
neo.fs.v2.session.RequestVerificationHeader verify_header = 3;
|
2020-01-30 11:41:24 +00:00
|
|
|
}
|
|
|
|
|
2020-08-12 21:43:51 +00:00
|
|
|
// New NeoFS Container creation response
|
2020-01-30 11:41:24 +00:00
|
|
|
message PutResponse {
|
2020-10-14 16:57:36 +00:00
|
|
|
// Container put response body contains information about the newly registered
|
|
|
|
// container as seen by `Container` smart contract. `ContainerID` can be
|
|
|
|
// calculated beforehand from the container structure and compared to the one
|
2022-04-13 06:21:33 +00:00
|
|
|
// returned here to make sure everything has been done as expected.
|
2020-08-11 08:47:04 +00:00
|
|
|
message Body {
|
2020-10-14 16:57:36 +00:00
|
|
|
// Unique identifier of the newly created container
|
2020-08-12 21:43:51 +00:00
|
|
|
neo.fs.v2.refs.ContainerID container_id = 1;
|
2020-08-11 08:47:04 +00:00
|
|
|
}
|
|
|
|
// Body of container put response message.
|
|
|
|
Body body = 1;
|
|
|
|
|
|
|
|
// Carries response meta information. Header data is used only to regulate
|
|
|
|
// message transport and does not affect request execution.
|
2020-08-19 14:00:23 +00:00
|
|
|
neo.fs.v2.session.ResponseMetaHeader meta_header = 2;
|
2020-08-11 08:47:04 +00:00
|
|
|
|
|
|
|
// Carries response verification information. This header is used to
|
2020-10-14 16:57:36 +00:00
|
|
|
// authenticate the nodes of the message route and check the correctness of
|
|
|
|
// transmission.
|
2020-08-19 14:00:23 +00:00
|
|
|
neo.fs.v2.session.ResponseVerificationHeader verify_header = 3;
|
2020-01-30 11:41:24 +00:00
|
|
|
}
|
|
|
|
|
2020-08-12 21:43:51 +00:00
|
|
|
// Container removal request
|
2020-01-30 11:41:24 +00:00
|
|
|
message DeleteRequest {
|
2022-04-13 06:21:33 +00:00
|
|
|
// Container removal request body has signed `ContainerID` as a proof of
|
|
|
|
// the container owner's intent. The signature will be verified by `Container`
|
2020-10-14 16:57:36 +00:00
|
|
|
// smart contract, so signing algorithm must be supported by NeoVM.
|
2020-08-11 08:47:04 +00:00
|
|
|
message Body {
|
2020-10-14 16:57:36 +00:00
|
|
|
// Identifier of the container to delete from NeoFS
|
2020-08-12 21:43:51 +00:00
|
|
|
neo.fs.v2.refs.ContainerID container_id = 1;
|
2020-08-11 08:47:04 +00:00
|
|
|
|
2024-02-28 15:53:04 +00:00
|
|
|
// `ContainerID` signed with the container owner's key according to
|
|
|
|
// RFC-6979.
|
2022-03-02 09:30:05 +00:00
|
|
|
neo.fs.v2.refs.SignatureRFC6979 signature = 2;
|
2020-08-11 08:47:04 +00:00
|
|
|
}
|
|
|
|
// Body of container delete request message.
|
|
|
|
Body body = 1;
|
2020-08-05 22:20:53 +00:00
|
|
|
|
2020-08-11 08:47:04 +00:00
|
|
|
// Carries request meta information. Header data is used only to regulate
|
|
|
|
// message transport and does not affect request execution.
|
2020-08-19 14:00:23 +00:00
|
|
|
neo.fs.v2.session.RequestMetaHeader meta_header = 2;
|
2020-08-11 08:47:04 +00:00
|
|
|
|
|
|
|
// Carries request verification information. This header is used to
|
2020-10-14 16:57:36 +00:00
|
|
|
// authenticate the nodes of the message route and check the correctness of
|
|
|
|
// transmission.
|
2020-08-19 14:00:23 +00:00
|
|
|
neo.fs.v2.session.RequestVerificationHeader verify_header = 3;
|
2020-01-30 11:41:24 +00:00
|
|
|
}
|
|
|
|
|
2020-10-14 16:57:36 +00:00
|
|
|
// `DeleteResponse` has an empty body because delete operation is asynchronous
|
|
|
|
// and done via consensus in Inner Ring nodes.
|
2020-08-11 08:47:04 +00:00
|
|
|
message DeleteResponse {
|
2020-10-14 16:57:36 +00:00
|
|
|
// `DeleteResponse` has an empty body because delete operation is asynchronous
|
|
|
|
// and done via consensus in Inner Ring nodes.
|
2020-08-11 08:47:04 +00:00
|
|
|
message Body {}
|
|
|
|
// Body of container delete response message.
|
|
|
|
Body body = 1;
|
|
|
|
|
|
|
|
// Carries response meta information. Header data is used only to regulate
|
|
|
|
// message transport and does not affect request execution.
|
2020-08-19 14:00:23 +00:00
|
|
|
neo.fs.v2.session.ResponseMetaHeader meta_header = 2;
|
2020-08-11 08:47:04 +00:00
|
|
|
|
|
|
|
// Carries response verification information. This header is used to
|
2020-10-14 16:57:36 +00:00
|
|
|
// authenticate the nodes of the message route and check the correctness of
|
|
|
|
// transmission.
|
2020-08-19 14:00:23 +00:00
|
|
|
neo.fs.v2.session.ResponseVerificationHeader verify_header = 3;
|
2020-08-11 08:47:04 +00:00
|
|
|
}
|
2020-01-30 11:41:24 +00:00
|
|
|
|
2020-08-12 21:43:51 +00:00
|
|
|
// Get container structure
|
2020-01-30 11:41:24 +00:00
|
|
|
message GetRequest {
|
2020-10-14 16:57:36 +00:00
|
|
|
// Get container structure request body.
|
2020-08-11 08:47:04 +00:00
|
|
|
message Body {
|
2020-10-14 16:57:36 +00:00
|
|
|
// Identifier of the container to get
|
2020-08-12 21:43:51 +00:00
|
|
|
neo.fs.v2.refs.ContainerID container_id = 1;
|
2020-08-11 08:47:04 +00:00
|
|
|
}
|
|
|
|
// Body of container get request message.
|
|
|
|
Body body = 1;
|
|
|
|
|
|
|
|
// Carries request meta information. Header data is used only to regulate
|
|
|
|
// message transport and does not affect request execution.
|
2020-08-19 14:00:23 +00:00
|
|
|
neo.fs.v2.session.RequestMetaHeader meta_header = 2;
|
2020-08-11 08:47:04 +00:00
|
|
|
|
|
|
|
// Carries request verification information. This header is used to
|
2020-10-14 16:57:36 +00:00
|
|
|
// authenticate the nodes of the message route and check the correctness of
|
|
|
|
// transmission.
|
2020-08-19 14:00:23 +00:00
|
|
|
neo.fs.v2.session.RequestVerificationHeader verify_header = 3;
|
2020-01-30 11:41:24 +00:00
|
|
|
}
|
|
|
|
|
2020-08-12 21:43:51 +00:00
|
|
|
// Get container structure
|
2020-01-30 11:41:24 +00:00
|
|
|
message GetResponse {
|
2020-10-14 16:57:36 +00:00
|
|
|
// Get container response body does not have container structure signature. It
|
2022-04-13 06:21:33 +00:00
|
|
|
// has been already verified upon container creation.
|
2020-08-11 08:47:04 +00:00
|
|
|
message Body {
|
2020-10-14 16:57:36 +00:00
|
|
|
// Requested container structure
|
2020-08-12 21:43:51 +00:00
|
|
|
Container container = 1;
|
2021-05-24 11:21:22 +00:00
|
|
|
|
2022-02-21 08:54:46 +00:00
|
|
|
// Signature of a stable-marshalled container according to RFC-6979.
|
2022-03-02 09:30:05 +00:00
|
|
|
neo.fs.v2.refs.SignatureRFC6979 signature = 2;
|
2021-05-24 11:21:22 +00:00
|
|
|
|
2022-04-13 06:21:33 +00:00
|
|
|
// Session token if the container has been created within the session
|
2021-05-24 11:21:22 +00:00
|
|
|
neo.fs.v2.session.SessionToken session_token = 3;
|
2020-08-11 08:47:04 +00:00
|
|
|
}
|
|
|
|
// Body of container get response message.
|
|
|
|
Body body = 1;
|
|
|
|
|
|
|
|
// Carries response meta information. Header data is used only to regulate
|
|
|
|
// message transport and does not affect request execution.
|
2020-08-19 14:00:23 +00:00
|
|
|
neo.fs.v2.session.ResponseMetaHeader meta_header = 2;
|
2020-08-11 08:47:04 +00:00
|
|
|
|
|
|
|
// Carries response verification information. This header is used to
|
2020-10-14 16:57:36 +00:00
|
|
|
// authenticate the nodes of the message route and check the correctness of
|
|
|
|
// transmission.
|
2020-08-19 14:00:23 +00:00
|
|
|
neo.fs.v2.session.ResponseVerificationHeader verify_header = 3;
|
2020-01-30 11:41:24 +00:00
|
|
|
}
|
|
|
|
|
2020-08-12 21:43:51 +00:00
|
|
|
// List containers
|
2020-01-30 11:41:24 +00:00
|
|
|
message ListRequest {
|
2020-10-14 16:57:36 +00:00
|
|
|
// List containers request body.
|
2020-08-11 08:47:04 +00:00
|
|
|
message Body {
|
2020-10-14 16:57:36 +00:00
|
|
|
// Identifier of the container owner
|
2020-08-12 21:43:51 +00:00
|
|
|
neo.fs.v2.refs.OwnerID owner_id = 1;
|
2020-08-11 08:47:04 +00:00
|
|
|
}
|
2020-10-14 16:57:36 +00:00
|
|
|
// Body of list containers request message
|
2020-08-11 08:47:04 +00:00
|
|
|
Body body = 1;
|
|
|
|
|
|
|
|
// Carries request meta information. Header data is used only to regulate
|
|
|
|
// message transport and does not affect request execution.
|
2020-08-19 14:00:23 +00:00
|
|
|
neo.fs.v2.session.RequestMetaHeader meta_header = 2;
|
2020-08-11 08:47:04 +00:00
|
|
|
|
|
|
|
// Carries request verification information. This header is used to
|
2020-10-14 16:57:36 +00:00
|
|
|
// authenticate the nodes of the message route and check the correctness of
|
|
|
|
// transmission.
|
2020-08-19 14:00:23 +00:00
|
|
|
neo.fs.v2.session.RequestVerificationHeader verify_header = 3;
|
2020-01-30 11:41:24 +00:00
|
|
|
}
|
|
|
|
|
2020-08-12 21:43:51 +00:00
|
|
|
// List containers
|
2020-01-30 11:41:24 +00:00
|
|
|
message ListResponse {
|
2020-10-14 16:57:36 +00:00
|
|
|
// List containers response body.
|
2020-08-11 08:47:04 +00:00
|
|
|
message Body {
|
2020-10-14 16:57:36 +00:00
|
|
|
// List of `ContainerID`s belonging to the requested `OwnerID`
|
2020-08-11 08:47:04 +00:00
|
|
|
repeated refs.ContainerID container_ids = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Body of list containers response message.
|
|
|
|
Body body = 1;
|
|
|
|
|
|
|
|
// Carries response meta information. Header data is used only to regulate
|
|
|
|
// message transport and does not affect request execution.
|
2020-08-19 14:00:23 +00:00
|
|
|
neo.fs.v2.session.ResponseMetaHeader meta_header = 2;
|
2020-08-11 08:47:04 +00:00
|
|
|
|
|
|
|
// Carries response verification information. This header is used to
|
2020-10-14 16:57:36 +00:00
|
|
|
// authenticate the nodes of the message route and check the correctness of
|
|
|
|
// transmission.
|
2020-08-19 14:00:23 +00:00
|
|
|
neo.fs.v2.session.ResponseVerificationHeader verify_header = 3;
|
2020-01-30 11:41:24 +00:00
|
|
|
}
|