Skip to content

Commit

Permalink
spec: experimental service: ObjectStore.
Browse files Browse the repository at this point in the history
Mock up of an experimental object storage API. Note the use of the
`alpha_service` marker option for the new gRPC service, as well as the
additional `alpha_xxx` markers for the new RPCs and top-level
request/response messages.
  • Loading branch information
James DeFelice committed Apr 4, 2019
1 parent cc6c138 commit 61395aa
Show file tree
Hide file tree
Showing 3 changed files with 1,162 additions and 338 deletions.
64 changes: 64 additions & 0 deletions csi.proto
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,20 @@ service Node {
rpc NodeGetInfo (NodeGetInfoRequest)
returns (NodeGetInfoResponse) {}
}

service ObjectStore {
option (alpha_service) = true;

rpc ObjectStoreRead(ObjectStoreReadRequest)
returns (ObjectStoreReadResponse) {
option (alpha_method) = true;
}

rpc ObjectStoreWrite(ObjectStoreWriteRequest)
returns (ObjectStoreWriteResponse) {
option (alpha_method) = true;
}
}
message GetPluginInfoRequest {
// Intentionally empty.
}
Expand Down Expand Up @@ -236,6 +250,9 @@ message PluginCapability {
// Indicates that the plugin supports data lineage reporting for
// volumes.
VOLUME_LINEAGE = 1;

// Indicates that the plugin supports the object storage service.
OBJECT_STORE = 2;
}

Type type = 1; // REQUIRED
Expand Down Expand Up @@ -1452,3 +1469,50 @@ message NodeExpandVolumeResponse {
// The capacity of the volume in bytes. This field is OPTIONAL.
int64 capacity_bytes = 1;
}
message ObjectStoreReadRequest {
option (alpha_message) = true;

message DataSelector {
message Range {
int64 offset = 1;
int64 length = 2;
}

repeated Range range = 1;
}

string location = 1;
map<string, string> secrets = 2 [(csi_secret) = true];

oneof kind {
bool metadata_only = 3;
DataSelector selector = 4;
}
}

message ObjectStoreReadResponse {
option (alpha_message) = true;

message Segment {
int64 offset = 1;
bytes value = 2;
}

repeated Segment segments = 1;
}
message ObjectStoreWriteRequest {
option (alpha_message) = true;

string location = 1;
map<string, string> secrets = 2 [(csi_secret) = true];

oneof action {
bytes data_append = 3;
bytes data_overwrite = 4;
bool remove = 5;
}
}

message ObjectStoreWriteResponse {
option (alpha_message) = true;
}
Loading

0 comments on commit 61395aa

Please sign in to comment.