Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[[--DO-NOT-MERGE--]] Mock ups for fake, experimental alpha APIs. #365

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
216 changes: 214 additions & 2 deletions csi.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,45 @@ import "google/protobuf/wrappers.proto";

option go_package = "csi";

extend google.protobuf.EnumOptions {
// Indicates that this enum is OPTIONAL and part of an experimental
// API that may be deprecated and eventually removed between minor
// releases.
bool alpha_enum = 1060;
}
extend google.protobuf.EnumValueOptions {
// Indicates that this enum value is OPTIONAL and part of an
// experimental API that may be deprecated and eventually removed
// between minor releases.
bool alpha_enum_value = 1060;
}
extend google.protobuf.FieldOptions {
// Indicates that a field MAY contain information that is sensitive
// and MUST be treated as such (e.g. not logged).
bool csi_secret = 1059;

// Indicates that this field is OPTIONAL and part of an experimental
// API that may be deprecated and eventually removed between minor
// releases.
bool alpha_field = 1060;
}
extend google.protobuf.MessageOptions {
// Indicates that this message is OPTIONAL and part of an experimental
// API that may be deprecated and eventually removed between minor
// releases.
bool alpha_message = 1060;
}
extend google.protobuf.MethodOptions {
// Indicates that this method is OPTIONAL and part of an experimental
// API that may be deprecated and eventually removed between minor
// releases.
bool alpha_method = 1060;
}
extend google.protobuf.ServiceOptions {
// Indicates that this service is OPTIONAL and part of an experimental
// API that may be deprecated and eventually removed between minor
// releases.
bool alpha_service = 1060;
}
service Identity {
rpc GetPluginInfo(GetPluginInfoRequest)
Expand Down Expand Up @@ -60,6 +95,11 @@ service Controller {

rpc ControllerExpandVolume (ControllerExpandVolumeRequest)
returns (ControllerExpandVolumeResponse) {}

rpc ControllerTapeRotation (ControllerTapeRotationRequest)
returns (ControllerTapeRotationResponse) {
option (alpha_method) = true;
}
}

service Node {
Expand All @@ -78,17 +118,29 @@ service Node {
rpc NodeGetVolumeStats (NodeGetVolumeStatsRequest)
returns (NodeGetVolumeStatsResponse) {}


rpc NodeExpandVolume(NodeExpandVolumeRequest)
returns (NodeExpandVolumeResponse) {}


rpc NodeGetCapabilities (NodeGetCapabilitiesRequest)
returns (NodeGetCapabilitiesResponse) {}

rpc NodeGetInfo (NodeGetInfoRequest)
returns (NodeGetInfoResponse) {}
}

service ObjectStore {
option (alpha_service) = true;

rpc ObjectStoreRead(ObjectStoreReadRequest)
returns (ObjectStoreReadResponse) {
option (alpha_method) = true;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's arguable that marking the method as alpha is redundant because the entire service is already alpha.

}

rpc ObjectStoreWrite(ObjectStoreWriteRequest)
returns (ObjectStoreWriteResponse) {
option (alpha_method) = true;
}
}
message GetPluginInfoRequest {
// Intentionally empty.
}
Expand Down Expand Up @@ -191,10 +243,29 @@ message PluginCapability {
Type type = 1;
}

message AlphaFeature {
enum Type {
UNKNOWN = 0;

// 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
}

oneof type {
// Service that the plugin supports.
Service service = 1;
VolumeExpansion volume_expansion = 2;

// AlphaFeature indicates that an experimental feature is offered by
// the plugin.
AlphaFeature alpha_feature = 3;
}
}
message ProbeRequest {
Expand Down Expand Up @@ -478,6 +549,32 @@ message Volume {
// Indicates a volume accessible from both "zone" "Z2" and "zone" "Z3"
// in the "region" "R1".
repeated Topology accessible_topology = 5;

// Lineage represent the entities and or processes that have
// influenced the data of this volume.
// Plugins that report volumes with this field set MUST also report a
// VOLUME_LINEAGE plugin capability.
// This is an OPTIONAL field.
repeated Provenance lineage = 6 [(alpha_field) = true];
}

// Provenance represents the origin of some storage object.
message Provenance {
option (alpha_message) = true;

message Identity {
enum Type {
UNKNOWN = 0;
X509 = 1;
}

Type type = 1; // REQUIRED
bytes value = 2; // REQUIRED
}

repeated Identity identity = 1; // REQUIRED
.google.protobuf.Timestamp data_changed_at = 2; // OPTIONAL
.google.protobuf.Timestamp metadata_changed_at = 3; // OPTIONAL
}

message TopologyRequirement {
Expand Down Expand Up @@ -889,9 +986,25 @@ message ControllerServiceCapability {
Type type = 1;
}

message AlphaFeature {
enum Type {
UNKNOWN = 0;

// Indicates that the controller service supports the
// ControllerTapeRotation API.
TAPE_ROTATION = 1;
}

Type type = 1; // REQUIRED
}

oneof type {
// RPC that the controller supports.
RPC rpc = 1;

// AlphaFeature indicates that an experimental feature is offered by
// the controller service.
AlphaFeature alpha_feature = 2;
}
}
message CreateSnapshotRequest {
Expand Down Expand Up @@ -1048,6 +1161,39 @@ message ControllerExpandVolumeResponse {
// is REQUIRED.
bool node_expansion_required = 2;
}
message ControllerTapeRotationRequest {
option (alpha_message) = true;

message UpdateStrategy {
// https://en.wikipedia.org/wiki/Backup_rotation_scheme#Schemes
enum Scheme {
UNKNOWN = 0;
FIFO = 1;
GFS = 2;// Grandfather-father-son
SIX_TAPE = 3; // 5 weekday differentials; 1 weekday full backup
TOWER_OF_HANOI = 4; // pretty complicated
}

Scheme scheme = 1; // REQURIED
}

// action is OPTIONAL; failure to specify an action is interpreted as
// a read-only request, and SHOULD generate a non-error response.
oneof action {
UpdateStrategy update_strategy = 1;
bool rotate_now = 2;
}
}

// All response fields are OPTIONAL.
message ControllerTapeRotationResponse {
option (alpha_message) = true;

.google.protobuf.Timestamp last_rotation_success = 1;
.google.protobuf.Timestamp last_rotation_failure = 2;
int32 successive_failures = 3; // failures since last success
.google.protobuf.Timestamp next_rotation_time = 4;
}
message NodeStageVolumeRequest {
// The ID of the volume to publish. This field is REQUIRED.
string volume_id = 1;
Expand Down Expand Up @@ -1196,6 +1342,9 @@ message VolumeUsage {
UNKNOWN = 0;
BYTES = 1;
INODES = 2;

// All "up" quarks are considered "used".
QUARKS = 3 [(alpha_enum_value) = true];
}
// The available capacity in specified Unit. This field is OPTIONAL.
// The value of this field MUST NOT be negative.
Expand Down Expand Up @@ -1239,9 +1388,25 @@ message NodeServiceCapability {
Type type = 1;
}

message AlphaFeature {
enum Type {
UNKNOWN = 0;

// Indicates that volume usage may be specified in units of quark.
// See https://en.wikipedia.org/wiki/Quark
VOLUME_USAGE_UNIT_QUARKS = 1;
}

Type type = 1; // REQUIRED
}

oneof type {
// RPC that the controller supports.
RPC rpc = 1;

// AlphaFeature indicates that an experimental feature is offered by
// the node service.
AlphaFeature alpha_feature = 2;
}
}
message NodeGetInfoRequest {
Expand Down Expand Up @@ -1304,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