From 144ab1e1e0e132838ac86701e46fa08ee1b27ee8 Mon Sep 17 00:00:00 2001 From: Roman Perekhod <2403905@gmail.com> Date: Wed, 24 Jul 2024 14:13:39 +0200 Subject: [PATCH] add code 'too early' (#230) --- cs3/gateway/v1beta1/gateway_api.proto | 4 +++- cs3/rpc/v1beta1/code.proto | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/cs3/gateway/v1beta1/gateway_api.proto b/cs3/gateway/v1beta1/gateway_api.proto index ab824fd..23f4ad7 100644 --- a/cs3/gateway/v1beta1/gateway_api.proto +++ b/cs3/gateway/v1beta1/gateway_api.proto @@ -108,6 +108,7 @@ service GatewayAPI { // then the entire directory is deleted recursively. // If a resource specifies a reference or symlink type, only the reference is removed (not the target). // MUST return CODE_NOT_FOUND if the reference does not exist. + // MUST return CODE_TOO_EARLY if some are not finished job over resource is still in process. rpc Delete(cs3.storage.provider.v1beta1.DeleteRequest) returns (cs3.storage.provider.v1beta1.DeleteResponse); // Returns the path reference for // the provided resource id reference. @@ -145,7 +146,8 @@ service GatewayAPI { rpc ListRecycle(cs3.storage.provider.v1beta1.ListRecycleRequest) returns (cs3.storage.provider.v1beta1.ListRecycleResponse); // Moves a resource from one reference to another. // MUST return CODE_NOT_FOUND if any of the references do not exist. - // MUST return CODE_FAILED_PRECONDITION if the source reference + // MUST return CODE_FAILED_PRECONDITION if the source reference. + // MUST return CODE_TOO_EARLY if some are not finished job over resource is still in process. // cannot be moved to the destination reference. rpc Move(cs3.storage.provider.v1beta1.MoveRequest) returns (cs3.storage.provider.v1beta1.MoveResponse); // Permanently removes a recycle item from the recycle. diff --git a/cs3/rpc/v1beta1/code.proto b/cs3/rpc/v1beta1/code.proto index b48da5b..8c08a32 100644 --- a/cs3/rpc/v1beta1/code.proto +++ b/cs3/rpc/v1beta1/code.proto @@ -183,7 +183,6 @@ enum Code { // Redirects the operation to another location. // Used in a Status reponse with a reference to the target URI. CODE_REDIRECTION = 18; - // // The operation could not be performed because there is not enough // storage available. This can be because of lack of real storage // space or because of the exceeding of a quota associated to a @@ -191,11 +190,16 @@ enum Code { // // HTTP Mapping: 507 Insufficient Storage CODE_INSUFFICIENT_STORAGE = 19; - // // The ability to lock a resource is specific to some WebDAV servers. // The HTTP 423 Locked error response code indicates that either // the resources tentatively targeted by is locked, meaning it can't be accessed. // // HTTP Mapping: 423 Locked CODE_LOCKED = 20; + // The server returns the response status code to indicate that it has received + // the request but is not going to process it because an asynchronous job + // that has been started is still being processed and the result can not yet be provided. + // + // HTTP Mapping: 425 Too Early + CODE_TOO_EARLY = 21; }