Skip to content

Commit

Permalink
[nspcc-dev#190] status: Add OBJECT_ALREADY_REMOVED code
Browse files Browse the repository at this point in the history
Add `OBJECT_ALREADY_REMOVED` value to `Object` enumeration. Return this
status from object GET/HEAD/RANGE operations.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
  • Loading branch information
Leonard Lyubich committed Feb 21, 2022
1 parent 3ee8fd9 commit 9d7e61c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
12 changes: 9 additions & 3 deletions object/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ service ObjectService {
// - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT):
// object not found in container;
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION):
// provided session token has expired.
// provided session token has expired;
// - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT):
// the requested object has been marked as deleted.
rpc Get(GetRequest) returns (stream GetResponse);

// Put the object into container. Request uses gRPC stream. First message
Expand Down Expand Up @@ -93,7 +95,9 @@ service ObjectService {
// - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT):
// object not found in container;
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION):
// provided session token has expired.
// provided session token has expired;
// - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT):
// the requested object has been marked as deleted.
rpc Head(HeadRequest) returns (HeadResponse);

// Search objects in container. Search query allows to match by Object
Expand Down Expand Up @@ -128,7 +132,9 @@ service ObjectService {
// - **OBJECT_NOT_FOUND** (2049, SECTION_OBJECT):
// object not found in container;
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION):
// provided session token has expired.
// provided session token has expired;
// - **OBJECT_ALREADY_REMOVED** (2052, SECTION_OBJECT):
// the requested object has been marked as deleted.
rpc GetRange(GetRangeRequest) returns (stream GetRangeResponse);

// Returns homomorphic or regular hash of object's payload range after
Expand Down
3 changes: 3 additions & 0 deletions status/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ enum Object {

// [**2051**] Locking an object with a non-REGULAR type rejected.
LOCK_NON_REGULAR_OBJECT = 3;

// [**2052**] Object has been marked deleted.
OBJECT_ALREADY_REMOVED = 4;
}

// Section of statuses for container-related operations.
Expand Down

0 comments on commit 9d7e61c

Please sign in to comment.