2021-10-04 11:29:21 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package neo.fs.v2.status;
|
|
|
|
|
|
|
|
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/status/grpc;status";
|
|
|
|
option csharp_namespace = "Neo.FileStorage.API.Status";
|
|
|
|
|
2021-11-12 16:10:39 +00:00
|
|
|
// Declares the general format of the status returns of the NeoFS RPC protocol.
|
|
|
|
// Status is present in all response messages. Each RPC of NeoFS protocol
|
|
|
|
// describes the possible outcomes and details of the operation.
|
|
|
|
//
|
|
|
|
// Each status is assigned a one-to-one numeric code. Any unique result of an
|
|
|
|
// operation in NeoFS is unambiguously associated with the code value.
|
|
|
|
//
|
|
|
|
// Numerical set of codes is split into 1024-element sections. An enumeration
|
|
|
|
// is defined for each section. Values can be referred to in the following ways:
|
|
|
|
//
|
|
|
|
// * numerical value ranging from 0 to 4,294,967,295 (global code);
|
|
|
|
//
|
|
|
|
// * values from enumeration (local code). The formula for the ratio of the
|
|
|
|
// local code (`L`) of a defined section (`S`) to the global one (`G`):
|
|
|
|
// `G = 1024 * S + L`.
|
|
|
|
//
|
|
|
|
// All outcomes are divided into successful and failed, which corresponds
|
|
|
|
// to the success or failure of the operation. The definition of success
|
|
|
|
// follows from the semantics of RPC and the description of its purpose.
|
|
|
|
// The server must not attach code that is the opposite of outcome type.
|
|
|
|
//
|
|
|
|
// See the set of return codes in the description for calls.
|
|
|
|
//
|
|
|
|
// Each status can carry developer-facing error message. It should be human
|
|
|
|
// readable text in English. The server should not transmit (and the client
|
|
|
|
// should not expect) useful information in the message. Field `details`
|
|
|
|
// should make the return more detailed.
|
2021-10-04 11:29:21 +00:00
|
|
|
message Status {
|
2021-11-12 16:10:39 +00:00
|
|
|
// The status code
|
2021-10-04 11:29:21 +00:00
|
|
|
uint32 code = 1;
|
|
|
|
|
2021-11-12 16:10:39 +00:00
|
|
|
// Developer-facing error message
|
2021-10-04 11:29:21 +00:00
|
|
|
string message = 2;
|
|
|
|
|
2021-11-12 16:10:39 +00:00
|
|
|
// Return detail. It contains additional information that can be used to
|
|
|
|
// analyze the response. Each code defines a set of details that can be
|
|
|
|
// attached to a status. Client should not handle details that are not
|
|
|
|
// covered by the code.
|
2021-10-04 11:29:21 +00:00
|
|
|
message Detail {
|
2021-11-12 16:10:39 +00:00
|
|
|
// Detail ID. The identifier is required to determine the binary format
|
|
|
|
// of the detail and how to decode it.
|
2021-10-04 11:29:21 +00:00
|
|
|
uint32 id = 1;
|
|
|
|
|
2021-11-12 16:10:39 +00:00
|
|
|
// Binary status detail. Must follow the format associated with ID.
|
|
|
|
// The possibility of missing a value must be explicitly allowed.
|
2021-10-04 11:29:21 +00:00
|
|
|
bytes value = 2;
|
|
|
|
}
|
|
|
|
|
2021-11-12 16:10:39 +00:00
|
|
|
// Data detailing the outcome of the operation. Must be unique by ID.
|
2021-10-04 11:29:21 +00:00
|
|
|
repeated Detail details = 3;
|
|
|
|
}
|
2021-10-04 11:40:56 +00:00
|
|
|
|
2021-11-12 16:10:39 +00:00
|
|
|
// Section identifiers.
|
|
|
|
enum Section {
|
|
|
|
// Successful return codes.
|
|
|
|
SECTION_SUCCESS = 0;
|
|
|
|
|
|
|
|
// Failure codes regardless of the operation.
|
|
|
|
SECTION_FAILURE_COMMON = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Section of NeoFS successful return codes.
|
2021-10-04 11:40:56 +00:00
|
|
|
enum Success {
|
2021-11-12 16:10:39 +00:00
|
|
|
// [**0**] Default success. Not detailed.
|
|
|
|
// If the server cannot match successful outcome to the code, it should
|
|
|
|
// use this code.
|
2021-10-04 11:40:56 +00:00
|
|
|
OK = 0;
|
|
|
|
}
|
2021-10-04 11:41:31 +00:00
|
|
|
|
2021-11-12 16:10:39 +00:00
|
|
|
// Section of failed statuses independent of the operation.
|
2021-10-04 11:41:31 +00:00
|
|
|
enum CommonFail {
|
2021-11-12 16:10:39 +00:00
|
|
|
// [**1024**] Internal server error, default failure. Not detailed.
|
|
|
|
// If the server cannot match failed outcome to the code, it should
|
|
|
|
// use this code.
|
2021-10-04 11:41:31 +00:00
|
|
|
INTERNAL = 0;
|
2022-01-10 12:42:41 +00:00
|
|
|
|
|
|
|
// [**1025**] Wrong magic of the NeoFS network. Not detailed.
|
|
|
|
WRONG_MAGIC_NUMBER = 1;
|
2021-10-04 11:41:31 +00:00
|
|
|
}
|