Skip to content

Commit

Permalink
[nspcc-dev#150] *: Write status-related docs
Browse files Browse the repository at this point in the history
Signed-off-by: Leonard Lyubich <[email protected]>
  • Loading branch information
Leonard Lyubich committed Nov 12, 2021
1 parent d9f1225 commit 8a7afb9
Show file tree
Hide file tree
Showing 16 changed files with 423 additions and 6 deletions.
5 changes: 5 additions & 0 deletions accounting/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ import "session/types.proto";
// accounts are possible, if both use the same token type.
service AccountingService {
// Returns the amount of funds in GAS token for the requested NeoFS account.
//
// Statuses:
// - **OK** (0, [SECTION_SUCCESS](status.md#neo.fs.v2.status.Success)):
// balance was read successfully;
// - [Common failures](status.md#neo.fs.v2.status.CommonFail).
rpc Balance (BalanceRequest) returns (BalanceResponse);
}

Expand Down
35 changes: 35 additions & 0 deletions container/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,65 @@ service ContainerService {
// response immediately. After a new block is issued in sidechain, request is
// verified by Inner Ring nodes. After one more block in sidechain, container
// is added into smart contract storage.
//
// Statuses:
// - **OK** (0, [SECTION_SUCCESS](status.md#neo.fs.v2.status.Success)):
// request to save the container has been sent to the sidechain;
// - [Common failures](status.md#neo.fs.v2.status.CommonFail).
rpc Put(PutRequest) returns (PutResponse);

// `Delete` invokes `Container` smart contract's `Delete` method and returns
// response immediately. After a new block is issued in sidechain, request is
// verified by Inner Ring nodes. After one more block in sidechain, container
// is added into smart contract storage.
//
// Statuses:
// - **OK** (0, [SECTION_SUCCESS](status.md#neo.fs.v2.status.Success)):
// request to remove the container has been sent to the sidechain;
// - [Common failures](status.md#neo.fs.v2.status.CommonFail).
rpc Delete(DeleteRequest) returns (DeleteResponse);

// Returns container structure from `Container` smart contract storage.
//
// Statuses:
// - **OK** (0, [SECTION_SUCCESS](status.md#neo.fs.v2.status.Success)):
// container read successfully;
// - [Common failures](status.md#neo.fs.v2.status.CommonFail).
rpc Get(GetRequest) returns (GetResponse);

// Returns all owner's containers from 'Container` smart contract' storage.
//
// Statuses:
// - **OK** (0, [SECTION_SUCCESS](status.md#neo.fs.v2.status.Success)):
// container list read successfully;
// - [Common failures](status.md#neo.fs.v2.status.CommonFail).
rpc List(ListRequest) returns (ListResponse);

// Invokes 'SetEACL' method of 'Container` smart contract and returns response
// immediately. After one more block in sidechain, Extended ACL changes are
// added into smart contract storage.
//
// Statuses:
// - **OK** (0, [SECTION_SUCCESS](status.md#neo.fs.v2.status.Success)):
// request to save container eACL has been sent to the sidechain;
// - [Common failures](status.md#neo.fs.v2.status.CommonFail).
rpc SetExtendedACL(SetExtendedACLRequest) returns (SetExtendedACLResponse);

// Returns Extended ACL table and signature from `Container` smart contract
// storage.
//
// Statuses:
// - **OK** (0, [SECTION_SUCCESS](status.md#neo.fs.v2.status.Success)):
// container eACL read successfully;
// - [Common failures](status.md#neo.fs.v2.status.CommonFail).
rpc GetExtendedACL(GetExtendedACLRequest) returns (GetExtendedACLResponse);

// Announce container used space values for P2P synchronization.
//
// Statuses:
// - **OK** (0, [SECTION_SUCCESS](status.md#neo.fs.v2.status.Success)):
// estimation of used space was announced successfully;
// - [Common failures](status.md#neo.fs.v2.status.CommonFail).
rpc AnnounceUsedSpace(AnnounceUsedSpaceRequest) returns (AnnounceUsedSpaceResponse);
}

Expand Down
10 changes: 10 additions & 0 deletions netmap/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,19 @@ service NetmapService {
// want to get recent information directly, or to talk to the node not yet
// present in `Network Map` to find out what API version can be used for
// further communication. Can also be used to check if node is up and running.
//
// Statuses:
// - **OK** (0, [SECTION_SUCCESS](status.md#neo.fs.v2.status.Success)):
// information about the server was read successfully;
// - [Common failures](status.md#neo.fs.v2.status.CommonFail).
rpc LocalNodeInfo (LocalNodeInfoRequest) returns (LocalNodeInfoResponse);

// Read recent information about the NeoFS network.
//
// Statuses:
// - **OK** (0, [SECTION_SUCCESS](status.md#neo.fs.v2.status.Success)):
// information about the current network state was read successfully;
// - [Common failures](status.md#neo.fs.v2.status.CommonFail).
rpc NetworkInfo (NetworkInfoRequest) returns (NetworkInfoResponse);
}

Expand Down
35 changes: 35 additions & 0 deletions object/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ service ObjectService {
// messages, except the first one, carry payload chunks. Requested object can
// be restored by concatenation of object message payload and all chunks
// keeping receiving order.
//
// Statuses:
// * **OK** (0, [SECTION_SUCCESS](status.md#neo.fs.v2.status.Success)):
// object was successfully read;
// * [Common failures](status.md#neo.fs.v2.status.CommonFail).
rpc Get(GetRequest) returns (stream GetResponse);

// Put the object into container. Request uses gRPC stream. First message
Expand All @@ -26,32 +31,62 @@ service ObjectService {
// session package). Chunk messages are considered by server as a part of an
// object payload. All messages, except first one, SHOULD be payload chunks.
// Chunk messages SHOULD be sent in direct order of fragmentation.
//
// Statuses:
// * **OK** (0, [SECTION_SUCCESS](status.md#neo.fs.v2.status.Success)):
// object was successfully saved in container;
// * [Common failures](status.md#neo.fs.v2.status.CommonFail).
rpc Put(stream PutRequest) returns (PutResponse);

// Delete the object from a container. There is no immediate removal
// guarantee. Object will be marked for removal and deleted eventually.
//
// Statuses:
// * **OK** (0, [SECTION_SUCCESS](status.md#neo.fs.v2.status.Success)):
// object was successfully marked to be removed from container;
// * [Common failures](status.md#neo.fs.v2.status.CommonFail).
rpc Delete(DeleteRequest) returns (DeleteResponse);

// Returns the object Headers without data payload. By default full header is
// returned. If `main_only` request field is set, the short header with only
// the very minimal information would be returned instead.
//
// Statuses:
// * **OK** (0, [SECTION_SUCCESS](status.md#neo.fs.v2.status.Success)):
// object head was successfully read;
// * [Common failures](status.md#neo.fs.v2.status.CommonFail).
rpc Head(HeadRequest) returns (HeadResponse);

// Search objects in container. Search query allows to match by Object
// Header's filed values. Please see the corresponding NeoFS Technical
// Specification section for more details.
//
// Statuses:
// * **OK** (0, [SECTION_SUCCESS](status.md#neo.fs.v2.status.Success)):
// objects was selected successfully;
// * [Common failures](status.md#neo.fs.v2.status.CommonFail).
rpc Search(SearchRequest) returns (stream SearchResponse);

// Get byte range of data payload. Range is set as an (offset, length) tuple.
// Like in `Get` method, the response uses gRPC stream. Requested range can be
// restored by concatenation of all received payload chunks keeping receiving
// order.
//
// Statuses:
// * **OK** (0, [SECTION_SUCCESS](status.md#neo.fs.v2.status.Success)):
// data range of the object payload was read successfully;
// * [Common failures](status.md#neo.fs.v2.status.CommonFail).
rpc GetRange(GetRangeRequest) returns (stream GetRangeResponse);

// Returns homomorphic or regular hash of object's payload range after
// applying XOR operation with the provided `salt`. Ranges are set of (offset,
// length) tuples. Hashes order in response corresponds to ranges order in
// request. Note that hash is calculated for XORed data.
//
// Statuses:
// - **OK** (0, [SECTION_SUCCESS](status.md#neo.fs.v2.status.Success)):
// data range of the object payload was hashed successfully;
// - [Common failures](status.md#neo.fs.v2.status.CommonFail).
rpc GetRangeHash(GetRangeHashRequest) returns (GetRangeHashResponse);
}

Expand Down
5 changes: 5 additions & 0 deletions proto-docs/accounting.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ rpc Balance(BalanceRequest) returns (BalanceResponse);

Returns the amount of funds in GAS token for the requested NeoFS account.

Statuses:
- **OK** (0, [SECTION_SUCCESS](status.md#neo.fs.v2.status.Success)):
balance was read successfully;
- [Common failures](status.md#neo.fs.v2.status.CommonFail).

| Name | Input | Output |
| ---- | ----- | ------ |
| Balance | [BalanceRequest](#neo.fs.v2.accounting.BalanceRequest) | [BalanceResponse](#neo.fs.v2.accounting.BalanceResponse) |
Expand Down
1 change: 1 addition & 0 deletions proto-docs/acl.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ Enumeration of possible sources of Headers to apply filters.
| HEADER_UNSPECIFIED | 0 | Unspecified header, default value. |
| REQUEST | 1 | Filter request headers |
| OBJECT | 2 | Filter object headers |
| SERVICE | 3 | Filter service headers. These are not processed by NeoFS nodes and exist for service use only. |



Expand Down
35 changes: 35 additions & 0 deletions proto-docs/container.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ response immediately. After a new block is issued in sidechain, request is
verified by Inner Ring nodes. After one more block in sidechain, container
is added into smart contract storage.

Statuses:
- **OK** (0, [SECTION_SUCCESS](status.md#neo.fs.v2.status.Success)):
request to save the container has been sent to the sidechain;
- [Common failures](status.md#neo.fs.v2.status.CommonFail).

| Name | Input | Output |
| ---- | ----- | ------ |
| Put | [PutRequest](#neo.fs.v2.container.PutRequest) | [PutResponse](#neo.fs.v2.container.PutResponse) |
Expand All @@ -94,20 +99,35 @@ response immediately. After a new block is issued in sidechain, request is
verified by Inner Ring nodes. After one more block in sidechain, container
is added into smart contract storage.

Statuses:
- **OK** (0, [SECTION_SUCCESS](status.md#neo.fs.v2.status.Success)):
request to remove the container has been sent to the sidechain;
- [Common failures](status.md#neo.fs.v2.status.CommonFail).

| Name | Input | Output |
| ---- | ----- | ------ |
| Delete | [DeleteRequest](#neo.fs.v2.container.DeleteRequest) | [DeleteResponse](#neo.fs.v2.container.DeleteResponse) |
#### Method Get

Returns container structure from `Container` smart contract storage.

Statuses:
- **OK** (0, [SECTION_SUCCESS](status.md#neo.fs.v2.status.Success)):
container read successfully;
- [Common failures](status.md#neo.fs.v2.status.CommonFail).

| Name | Input | Output |
| ---- | ----- | ------ |
| Get | [GetRequest](#neo.fs.v2.container.GetRequest) | [GetResponse](#neo.fs.v2.container.GetResponse) |
#### Method List

Returns all owner's containers from 'Container` smart contract' storage.

Statuses:
- **OK** (0, [SECTION_SUCCESS](status.md#neo.fs.v2.status.Success)):
container list read successfully;
- [Common failures](status.md#neo.fs.v2.status.CommonFail).

| Name | Input | Output |
| ---- | ----- | ------ |
| List | [ListRequest](#neo.fs.v2.container.ListRequest) | [ListResponse](#neo.fs.v2.container.ListResponse) |
Expand All @@ -117,6 +137,11 @@ Invokes 'SetEACL' method of 'Container` smart contract and returns response
immediately. After one more block in sidechain, Extended ACL changes are
added into smart contract storage.

Statuses:
- **OK** (0, [SECTION_SUCCESS](status.md#neo.fs.v2.status.Success)):
request to save container eACL has been sent to the sidechain;
- [Common failures](status.md#neo.fs.v2.status.CommonFail).

| Name | Input | Output |
| ---- | ----- | ------ |
| SetExtendedACL | [SetExtendedACLRequest](#neo.fs.v2.container.SetExtendedACLRequest) | [SetExtendedACLResponse](#neo.fs.v2.container.SetExtendedACLResponse) |
Expand All @@ -125,13 +150,23 @@ added into smart contract storage.
Returns Extended ACL table and signature from `Container` smart contract
storage.

Statuses:
- **OK** (0, [SECTION_SUCCESS](status.md#neo.fs.v2.status.Success)):
container eACL read successfully;
- [Common failures](status.md#neo.fs.v2.status.CommonFail).

| Name | Input | Output |
| ---- | ----- | ------ |
| GetExtendedACL | [GetExtendedACLRequest](#neo.fs.v2.container.GetExtendedACLRequest) | [GetExtendedACLResponse](#neo.fs.v2.container.GetExtendedACLResponse) |
#### Method AnnounceUsedSpace

Announce container used space values for P2P synchronization.

Statuses:
- **OK** (0, [SECTION_SUCCESS](status.md#neo.fs.v2.status.Success)):
estimation of used space was announced successfully;
- [Common failures](status.md#neo.fs.v2.status.CommonFail).

| Name | Input | Output |
| ---- | ----- | ------ |
| AnnounceUsedSpace | [AnnounceUsedSpaceRequest](#neo.fs.v2.container.AnnounceUsedSpaceRequest) | [AnnounceUsedSpaceResponse](#neo.fs.v2.container.AnnounceUsedSpaceResponse) |
Expand Down
37 changes: 37 additions & 0 deletions proto-docs/netmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

- Messages
- [Filter](#neo.fs.v2.netmap.Filter)
- [NetworkConfig](#neo.fs.v2.netmap.NetworkConfig)
- [NetworkConfig.Parameter](#neo.fs.v2.netmap.NetworkConfig.Parameter)
- [NetworkInfo](#neo.fs.v2.netmap.NetworkInfo)
- [NodeInfo](#neo.fs.v2.netmap.NodeInfo)
- [NodeInfo.Attribute](#neo.fs.v2.netmap.NodeInfo.Attribute)
Expand Down Expand Up @@ -64,13 +66,23 @@ want to get recent information directly, or to talk to the node not yet
present in `Network Map` to find out what API version can be used for
further communication. Can also be used to check if node is up and running.

Statuses:
- **OK** (0, [SECTION_SUCCESS](status.md#neo.fs.v2.status.Success)):
information about the server was read successfully;
- [Common failures](status.md#neo.fs.v2.status.CommonFail).

| Name | Input | Output |
| ---- | ----- | ------ |
| LocalNodeInfo | [LocalNodeInfoRequest](#neo.fs.v2.netmap.LocalNodeInfoRequest) | [LocalNodeInfoResponse](#neo.fs.v2.netmap.LocalNodeInfoResponse) |
#### Method NetworkInfo

Read recent information about the NeoFS network.

Statuses:
- **OK** (0, [SECTION_SUCCESS](status.md#neo.fs.v2.status.Success)):
information about the current network state was read successfully;
- [Common failures](status.md#neo.fs.v2.status.CommonFail).

| Name | Input | Output |
| ---- | ----- | ------ |
| NetworkInfo | [NetworkInfoRequest](#neo.fs.v2.netmap.NetworkInfoRequest) | [NetworkInfoResponse](#neo.fs.v2.netmap.NetworkInfoResponse) |
Expand Down Expand Up @@ -197,6 +209,29 @@ results, that will satisfy filter's conditions.
| filters | [Filter](#neo.fs.v2.netmap.Filter) | repeated | List of inner filters. Top level operation will be applied to the whole list. |


<a name="neo.fs.v2.netmap.NetworkConfig"></a>

### Message NetworkConfig
NeoFS network configuration


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| parameters | [NetworkConfig.Parameter](#neo.fs.v2.netmap.NetworkConfig.Parameter) | repeated | List of parameter values. |


<a name="neo.fs.v2.netmap.NetworkConfig.Parameter"></a>

### Message NetworkConfig.Parameter
Single configuration parameter.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| key | [bytes](#bytes) | | Parameter key. UTF-8 encoded string. |
| value | [bytes](#bytes) | | Parameter value. |


<a name="neo.fs.v2.netmap.NetworkInfo"></a>

### Message NetworkInfo
Expand All @@ -207,6 +242,8 @@ Information about NeoFS network
| ----- | ---- | ----- | ----------- |
| current_epoch | [uint64](#uint64) | | Number of the current epoch in the NeoFS network. |
| magic_number | [uint64](#uint64) | | Magic number of the sidechain of the NeoFS network. |
| ms_per_block | [int64](#int64) | | MillisecondsPerBlock network parameter of the sidechain of the NeoFS network. |
| network_config | [NetworkConfig](#neo.fs.v2.netmap.NetworkConfig) | | NeoFS network configuration. |


<a name="neo.fs.v2.netmap.NodeInfo"></a>
Expand Down
Loading

0 comments on commit 8a7afb9

Please sign in to comment.