Skip to content

Commit 2571bd3

Browse files
authored
Merge pull request #169 from davidz627/feature/MountDevice
NodeStageVolume/NodeUnstageVolume
2 parents 8b8a2ef + 068ae27 commit 2571bd3

File tree

3 files changed

+732
-174
lines changed

3 files changed

+732
-174
lines changed

csi.proto

Lines changed: 99 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ service Controller {
4444
}
4545

4646
service Node {
47+
rpc NodeStageVolume (NodeStageVolumeRequest)
48+
returns (NodeStageVolumeResponse) {}
49+
50+
rpc NodeUnstageVolume (NodeUnstageVolumeRequest)
51+
returns (NodeUnstageVolumeResponse) {}
52+
4753
rpc NodePublishVolume (NodePublishVolumeRequest)
4854
returns (NodePublishVolumeResponse) {}
4955

@@ -371,7 +377,8 @@ message ControllerPublishVolumeRequest {
371377

372378
message ControllerPublishVolumeResponse {
373379
// The SP specific information that will be passed to the Plugin in
374-
// the subsequent `NodePublishVolume` call for the given volume.
380+
// the subsequent `NodeStageVolume` or `NodePublishVolume` calls
381+
// for the given volume.
375382
// This information is opaque to the CO. This field is OPTIONAL.
376383
map<string, string> publish_info = 1;
377384
}
@@ -544,6 +551,82 @@ message ControllerServiceCapability {
544551
}
545552
////////
546553
////////
554+
message NodeStageVolumeRequest {
555+
// The API version assumed by the CO. This is a REQUIRED field.
556+
Version version = 1;
557+
558+
// The ID of the volume to publish. This field is REQUIRED.
559+
string volume_id = 2;
560+
561+
// The CO SHALL set this field to the value returned by
562+
// `ControllerPublishVolume` if the corresponding Controller Plugin
563+
// has `PUBLISH_UNPUBLISH_VOLUME` controller capability, and SHALL be
564+
// left unset if the corresponding Controller Plugin does not have
565+
// this capability. This is an OPTIONAL field.
566+
map<string, string> publish_info = 3;
567+
568+
// The path to which the volume will be published. It MUST be an
569+
// absolute path in the root filesystem of the process serving this
570+
// request. The CO SHALL ensure that there is only one
571+
// staging_target_path per volume.
572+
// This is a REQUIRED field.
573+
string staging_target_path = 4;
574+
575+
// The capability of the volume the CO expects the volume to have.
576+
// This is a REQUIRED field.
577+
VolumeCapability volume_capability = 5;
578+
579+
// Credentials used by Node plugin to authenticate/authorize node
580+
// stage request.
581+
// This field contains credential data, for example username and
582+
// password. Each key must consist of alphanumeric characters, '-',
583+
// '_' or '.'. Each value MUST contain a valid string. An SP MAY
584+
// choose to accept binary (non-string) data by using a binary-to-text
585+
// encoding scheme, like base64. An SP SHALL advertise the
586+
// requirements for credentials in documentation. COs SHALL permit
587+
// passing through the required credentials. This information is
588+
// sensitive and MUST be treated as such (not logged, etc.) by the CO.
589+
// This field is OPTIONAL.
590+
map<string, string> node_stage_credentials = 6;
591+
592+
// Attributes of the volume to publish. This field is OPTIONAL and
593+
// MUST match the attributes of the VolumeInfo identified by
594+
// `volume_id`.
595+
map<string,string> volume_attributes = 7;
596+
}
597+
598+
message NodeStageVolumeResponse {}
599+
////////
600+
////////
601+
message NodeUnstageVolumeRequest {
602+
// The API version assumed by the CO. This is a REQUIRED field.
603+
Version version = 1;
604+
605+
// The ID of the volume. This field is REQUIRED.
606+
string volume_id = 2;
607+
608+
// The path at which the volume was published. It MUST be an absolute
609+
// path in the root filesystem of the process serving this request.
610+
// This is a REQUIRED field.
611+
string staging_target_path = 3;
612+
613+
// Credentials used by Node plugin to authenticate/authorize node
614+
// unstage request.
615+
// This field contains credential data, for example username and
616+
// password. Each key must consist of alphanumeric characters, '-',
617+
// '_' or '.'. Each value MUST contain a valid string. An SP MAY
618+
// choose to accept binary (non-string) data by using a binary-to-text
619+
// encoding scheme, like base64. An SP SHALL advertise the
620+
// requirements for credentials in documentation. COs SHALL permit
621+
// passing through the required credentials. This information is
622+
// sensitive and MUST be treated as such (not logged, etc.) by the CO.
623+
// This field is OPTIONAL.
624+
map<string, string> node_unstage_credentials = 4;
625+
}
626+
627+
message NodeUnstageVolumeResponse {}
628+
////////
629+
////////
547630
message NodePublishVolumeRequest {
548631
// The API version assumed by the CO. This is a REQUIRED field.
549632
Version version = 1;
@@ -558,21 +641,29 @@ message NodePublishVolumeRequest {
558641
// this capability. This is an OPTIONAL field.
559642
map<string, string> publish_info = 3;
560643

644+
// The path to which the device was mounted by `NodeStageVolume`.
645+
// It MUST be an absolute path in the root filesystem of the process
646+
// serving this request.
647+
// It MUST be set if the Node Plugin implements the
648+
// `STAGE_UNSTAGE_VOLUME` node capability.
649+
// This is an OPTIONAL field.
650+
string staging_target_path = 4;
651+
561652
// The path to which the volume will be published. It MUST be an
562653
// absolute path in the root filesystem of the process serving this
563654
// request. The CO SHALL ensure uniqueness of target_path per volume.
564655
// The CO SHALL ensure that the path exists, and that the process
565656
// serving the request has `read` and `write` permissions to the path.
566657
// This is a REQUIRED field.
567-
string target_path = 4;
658+
string target_path = 5;
568659

569660
// The capability of the volume the CO expects the volume to have.
570661
// This is a REQUIRED field.
571-
VolumeCapability volume_capability = 5;
662+
VolumeCapability volume_capability = 6;
572663

573664
// Whether to publish the volume in readonly mode. This field is
574665
// REQUIRED.
575-
bool readonly = 6;
666+
bool readonly = 7;
576667

577668
// Credentials used by Node plugin to authenticate/authorize node
578669
// publish request.
@@ -585,12 +676,13 @@ message NodePublishVolumeRequest {
585676
// passing through the required credentials. This information is
586677
// sensitive and MUST be treated as such (not logged, etc.) by the CO.
587678
// This field is OPTIONAL.
588-
map<string, string> node_publish_credentials = 7;
679+
map<string, string> node_publish_credentials = 8;
680+
589681

590682
// Attributes of the volume to publish. This field is OPTIONAL and
591683
// MUST match the attributes of the Volume identified by
592684
// `volume_id`.
593-
map<string,string> volume_attributes = 8;
685+
map<string,string> volume_attributes = 9;
594686
}
595687

596688
message NodePublishVolumeResponse {}
@@ -662,6 +754,7 @@ message NodeServiceCapability {
662754
message RPC {
663755
enum Type {
664756
UNKNOWN = 0;
757+
STAGE_UNSTAGE_VOLUME = 1;
665758
}
666759

667760
Type type = 1;

0 commit comments

Comments
 (0)