Add PutSingle RPC #31
|
@ -231,6 +231,38 @@ service ObjectService {
|
||||||
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
|
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
|
||||||
// provided session token has expired.
|
// provided session token has expired.
|
||||||
ale64bit marked this conversation as resolved
Outdated
|
|||||||
rpc GetRangeHash(GetRangeHashRequest) returns (GetRangeHashResponse);
|
rpc GetRangeHash(GetRangeHashRequest) returns (GetRangeHashResponse);
|
||||||
dstepanov-yadro
commented
PayloadHash is also required. PayloadSize is required for streaming Put, because we need to check planned and actual size, so PutSinle doesn't require this field i think. PayloadHash is also required.
PayloadSize is required for streaming Put, because we need to check planned and actual size, so PutSinle doesn't require this field i think.
fyrchik
commented
I believe it requires -- this is a part of correctly formed object. I believe it requires -- this is a part of correctly formed object.
dstepanov-yadro
commented
Ok, added Payload len to required Ok, added Payload len to required
|
|||||||
|
|
||||||
ale64bit marked this conversation as resolved
Outdated
ale64bit
commented
nit: not sure what kind of rules we have, but I would rather use nit: not sure what kind of rules we have, but I would rather use `MUST` instead of `SHOULD` for these things. `SHOULD` sounds like it's optional.
dstepanov-yadro
commented
fixed fixed
|
|||||||
|
// Put the prepared object into container.
|
||||||
|
// `ContainerID`, `ObjectID`, `OwnerID`, `PayloadHash` and `PayloadLength` of an object MUST be set.
|
||||||
|
//
|
||||||
|
// Extended headers can change `Put` behaviour:
|
||||||
|
// * [ __SYSTEM__NETMAP_EPOCH \
|
||||||
|
// (`__NEOFS__NETMAP_EPOCH` is deprecated) \
|
||||||
ale64bit marked this conversation as resolved
Outdated
ale64bit
commented
s/requsted/requested s/requsted/requested
dstepanov-yadro
commented
fixed fixed
|
|||||||
|
// Will use the requested version of Network Map for object placement
|
||||||
|
// calculation.
|
||||||
|
//
|
||||||
|
// Please refer to detailed `XHeader` description.
|
||||||
|
//
|
||||||
|
// Statuses:
|
||||||
|
// - **OK** (0, SECTION_SUCCESS): \
|
||||||
|
// object has been successfully saved in the container;
|
||||||
|
// - Common failures (SECTION_FAILURE_COMMON);
|
||||||
|
// - **ACCESS_DENIED** (2048, SECTION_OBJECT): \
|
||||||
|
// write access to the container is denied;
|
||||||
|
// - **LOCKED** (2050, SECTION_OBJECT): \
|
||||||
|
// placement of an object of type TOMBSTONE that includes at least one locked
|
||||||
|
// object is prohibited;
|
||||||
|
// - **LOCK_NON_REGULAR_OBJECT** (2051, SECTION_OBJECT): \
|
||||||
|
// placement of an object of type LOCK that includes at least one object of
|
||||||
|
// type other than REGULAR is prohibited;
|
||||||
|
// - **CONTAINER_NOT_FOUND** (3072, SECTION_CONTAINER): \
|
||||||
|
// object storage container not found;
|
||||||
|
// - **TOKEN_NOT_FOUND** (4096, SECTION_SESSION): \
|
||||||
|
// (for trusted object preparation) session private key does not exist or has
|
||||||
|
// been deleted;
|
||||||
alexvanin marked this conversation as resolved
Outdated
alexvanin
commented
Token failure codes are not relevant now. Token failure codes are not relevant now.
dstepanov-yadro
commented
frostfs-node checks session token for every request: https://git.frostfs.info/TrueCloudLab/frostfs-node/src/branch/master/pkg/services/object/acl/v2/service.go#L243 frostfs-node checks session token for every request: https://git.frostfs.info/TrueCloudLab/frostfs-node/src/branch/master/pkg/services/object/acl/v2/service.go#L243
|
|||||||
|
// - **TOKEN_EXPIRED** (4097, SECTION_SESSION): \
|
||||||
|
// provided session token has expired.
|
||||||
|
rpc PutSingle(PutSingleRequest) returns (PutSingleResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
// GET object request
|
// GET object request
|
||||||
|
@ -709,3 +741,48 @@ message GetRangeHashResponse {
|
||||||
// transmission.
|
// transmission.
|
||||||
neo.fs.v2.session.ResponseVerificationHeader verify_header = 3;
|
neo.fs.v2.session.ResponseVerificationHeader verify_header = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
ale64bit
commented
many of these comments seem superfluous. They don't add any valuable info to the declaration itself. many of these comments seem superfluous. They don't add any valuable info to the declaration itself.
dstepanov-yadro
commented
Well, i think, this is a tradition. And traditions should be respected. Well, i think, this is a tradition. And traditions should be respected.
fyrchik
commented
The comments could be useful for doc generation. The comments could be useful for doc generation.
Agree with @dstepanov-yadro , let's preserve the style.
Could make alterations altogether in a separate task.
|
|||||||
|
// Object PUT Single request
|
||||||
|
message PutSingleRequest {
|
||||||
|
// PUT Single request body
|
||||||
|
message Body {
|
||||||
|
// Prepared object with payload.
|
||||||
fyrchik
commented
So, basically, So, basically, `Object` + `copies_number`?
Why do we have 4 separate fields instead of an `Object`?
dstepanov-yadro
commented
fixed fixed
|
|||||||
|
Object object = 1;
|
||||||
|
// Number of copies of the object to store within the RPC call. By default,
|
||||||
|
// object is processed according to the container's placement policy.
|
||||||
|
// Every number is treated as a minimal number of
|
||||||
|
// nodes in a corresponding placement vector that must store an object
|
||||||
|
// to complete the request successfully. The length MUST equal the placement
|
||||||
|
// vectors number, otherwise request is considered malformed.
|
||||||
|
repeated uint32 copies_number = 2;
|
||||||
|
}
|
||||||
|
// Body of put single object request message.
|
||||||
|
Body body = 1;
|
||||||
|
|
||||||
|
// Carries request meta information. Header data is used only to regulate
|
||||||
|
// message transport and does not affect request execution.
|
||||||
|
neo.fs.v2.session.RequestMetaHeader meta_header = 2;
|
||||||
|
|
||||||
|
// Carries request verification information. This header is used to
|
||||||
|
// authenticate the nodes of the message route and check the correctness of
|
||||||
|
// transmission.
|
||||||
|
neo.fs.v2.session.RequestVerificationHeader verify_header = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Object PUT Single response
|
||||||
|
message PutSingleResponse {
|
||||||
|
// PUT Single Object response body
|
||||||
dstepanov-yadro
commented
PutSingle requires object id passed in the request. So there is nothing to return, but PutSingle requires object id passed in the request. So there is nothing to return, but `Body` is defined like in other models.
|
|||||||
|
message Body {
|
||||||
|
}
|
||||||
|
// Body of put single object response message.
|
||||||
|
Body body = 1;
|
||||||
|
|
||||||
|
// Carries response meta information. Header data is used only to regulate
|
||||||
|
// message transport and does not affect request execution.
|
||||||
|
neo.fs.v2.session.ResponseMetaHeader meta_header = 2;
|
||||||
|
|
||||||
|
// Carries response verification information. This header is used to
|
||||||
|
// authenticate the nodes of the message route and check the correctness of
|
||||||
|
// transmission.
|
||||||
|
neo.fs.v2.session.ResponseVerificationHeader verify_header = 3;
|
||||||
|
}
|
This is a bit misleading; the RPC is unary.
fixed