Skip to content

Implementing discussed 0.2.0 CSI spec changes #182

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

Merged
merged 1 commit into from
Feb 8, 2018
Merged
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
52 changes: 30 additions & 22 deletions csi.proto
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ service Node {
rpc NodeUnpublishVolume (NodeUnpublishVolumeRequest)
returns (NodeUnpublishVolumeResponse) {}

rpc GetNodeID (GetNodeIDRequest)
returns (GetNodeIDResponse) {}
rpc NodeGetId (NodeGetIdRequest)
returns (NodeGetIdResponse) {}

rpc NodeProbe (NodeProbeRequest)
returns (NodeProbeResponse) {}
Expand All @@ -70,9 +70,12 @@ message GetSupportedVersionsResponse {
// Specifies a version in Semantic Version 2.0 format.
// (http://semver.org/spec/v2.0.0.html)
message Version {
uint32 major = 1; // This field is REQUIRED.
uint32 minor = 2; // This field is REQUIRED.
uint32 patch = 3; // This field is REQUIRED.
// The value of this field MUST NOT be negative.
int32 major = 1; // This field is REQUIRED.
// The value of this field MUST NOT be negative.
int32 minor = 2; // This field is REQUIRED.
// The value of this field MUST NOT be negative.
int32 patch = 3; // This field is REQUIRED.
}
////////
////////
Expand Down Expand Up @@ -158,7 +161,7 @@ message CreateVolumeResponse {
// Contains all attributes of the newly created volume that are
// relevant to the CO along with information required by the Plugin
// to uniquely identify the volume. This field is REQUIRED.
VolumeInfo volume_info = 1;
Volume volume = 1;
}

// Specify a capability of a volume.
Expand Down Expand Up @@ -228,19 +231,22 @@ message VolumeCapability {
message CapacityRange {
// Volume must be at least this big. This field is OPTIONAL.
// A value of 0 is equal to an unspecified field value.
uint64 required_bytes = 1;
// The value of this field MUST NOT be negative.
int64 required_bytes = 1;

Choose a reason for hiding this comment

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

Do we want to get rid of the use of underscores while we're at it? Granted that's mostly my own pedantic annoyance :) and it would be a separate patch but just asking.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @j-griffith,

Please leave the underscores. The tell language generators how to camel case things.


// Volume must not be bigger than this. This field is OPTIONAL.
// A value of 0 is equal to an unspecified field value.
uint64 limit_bytes = 2;
// The value of this field MUST NOT be negative.
int64 limit_bytes = 2;
}

// The information about a provisioned volume.
message VolumeInfo {
message Volume {
// The capacity of the volume in bytes. This field is OPTIONAL. If not
// set (value of 0), it indicates that the capacity of the volume is
// unknown (e.g., NFS share).
uint64 capacity_bytes = 1;
// The value of this field MUST NOT be negative.
int64 capacity_bytes = 1;

// Contains identity information for the created volume. This field is
// REQUIRED. The identity information will be used by the CO in
Expand Down Expand Up @@ -293,7 +299,7 @@ message ControllerPublishVolumeRequest {
string volume_id = 2;

// The ID of the node. This field is REQUIRED. The CO SHALL set this
// field to match the node ID returned by `GetNodeID`.
// field to match the node ID returned by `NodeGetId`.
string node_id = 3;

// The capability of the volume the CO expects the volume to have.
Expand All @@ -318,7 +324,7 @@ message ControllerPublishVolumeRequest {
map<string, string> controller_publish_credentials = 6;

// Attributes of the volume to be used on a node. This field is
// OPTIONAL and MUST match the attributes of the VolumeInfo identified
// OPTIONAL and MUST match the attributes of the Volume identified
// by `volume_id`.
map<string,string> volume_attributes = 7;
}
Expand All @@ -327,7 +333,7 @@ message ControllerPublishVolumeResponse {
// The SP specific information that will be passed to the Plugin in
// the subsequent `NodePublishVolume` call for the given volume.
// This information is opaque to the CO. This field is OPTIONAL.
map<string, string> publish_volume_info = 1;
map<string, string> publish_info = 1;
}
////////
////////
Expand All @@ -339,7 +345,7 @@ message ControllerUnpublishVolumeRequest {
string volume_id = 2;

// The ID of the node. This field is OPTIONAL. The CO SHOULD set this
// field to match the node ID returned by `GetNodeID` or leave it
// field to match the node ID returned by `NodeGetId` or leave it
// unset. If the value is set, the SP MUST unpublish the volume from
// the specified node. If the value is unset, the SP MUST unpublish
// the volume from all nodes it is published to.
Expand Down Expand Up @@ -375,7 +381,7 @@ message ValidateVolumeCapabilitiesRequest {
repeated VolumeCapability volume_capabilities = 3;

// Attributes of the volume to check. This field is OPTIONAL and MUST
// match the attributes of the VolumeInfo identified by `volume_id`.
// match the attributes of the Volume identified by `volume_id`.
map<string,string> volume_attributes = 4;
}

Expand All @@ -402,7 +408,8 @@ message ListVolumesRequest {
// in the subsequent `ListVolumes` call. This field is OPTIONAL. If
// not specified (zero value), it means there is no restriction on the
// number of entries that can be returned.
uint32 max_entries = 2;
// The value of this field MUST NOT be negative.
int32 max_entries = 2;

// A token to specify where to start paginating. Set this field to
// `next_token` returned by a previous `ListVolumes` call to get the
Expand All @@ -413,7 +420,7 @@ message ListVolumesRequest {

message ListVolumesResponse {
message Entry {
VolumeInfo volume_info = 1;
Volume volume = 1;
}

repeated Entry entries = 1;
Expand Down Expand Up @@ -452,7 +459,8 @@ message GetCapacityResponse {
// specified in the request, the Plugin SHALL take those into
// consideration when calculating the available capacity of the
// storage. This field is REQUIRED.
uint64 available_capacity = 1;
// The value of this field MUST NOT be negative.
int64 available_capacity = 1;
}
////////
////////
Expand Down Expand Up @@ -508,7 +516,7 @@ message NodePublishVolumeRequest {
// has `PUBLISH_UNPUBLISH_VOLUME` controller capability, and SHALL be
// left unset if the corresponding Controller Plugin does not have
// this capability. This is an OPTIONAL field.
map<string, string> publish_volume_info = 3;
map<string, string> publish_info = 3;

// The path to which the volume will be published. It MUST be an
// absolute path in the root filesystem of the process serving this
Expand Down Expand Up @@ -540,7 +548,7 @@ message NodePublishVolumeRequest {
map<string, string> node_publish_credentials = 7;

// Attributes of the volume to publish. This field is OPTIONAL and
// MUST match the attributes of the VolumeInfo identified by
// MUST match the attributes of the Volume identified by
// `volume_id`.
map<string,string> volume_attributes = 8;
}
Expand Down Expand Up @@ -577,12 +585,12 @@ message NodeUnpublishVolumeRequest {
message NodeUnpublishVolumeResponse {}
////////
////////
message GetNodeIDRequest {
message NodeGetIdRequest {
// The API version assumed by the CO. This is a REQUIRED field.
Version version = 1;
}

message GetNodeIDResponse {
message NodeGetIdResponse {
// The ID of the node as understood by the SP which SHALL be used by
// CO in subsequent `ControllerPublishVolume`.
// This is a REQUIRED field.
Expand Down
Loading