Skip to content

Commit

Permalink
Add VolumeGroup and VolumeGroupSnapshot CSI RPCs
Browse files Browse the repository at this point in the history
  • Loading branch information
xing-yang committed Jul 12, 2022
1 parent ad238e5 commit e1048db
Show file tree
Hide file tree
Showing 2 changed files with 843 additions and 0 deletions.
374 changes: 374 additions & 0 deletions csi.proto
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,51 @@ service Controller {
returns (ControllerGetVolumeResponse) {
option (alpha_method) = true;
}

rpc CreateVolumeGroup(CreateVolumeGroupRequest)
returns (CreateVolumeGroupResponse) {
option (alpha_method) = true;
}

rpc CreateVolumeGroupSnapshot(CreateVolumeGroupSnapshotRequest)
returns (CreateVolumeGroupSnapshotResponse) {
option (alpha_method) = true;
}

rpc ModifyVolumeGroup(ModifyVolumeGroupRequest)
returns (ModifyVolumeGroupResponse) {
option (alpha_method) = true;
}

rpc DeleteVolumeGroup(DeleteVolumeGroupRequest)
returns (DeleteVolumeGroupResponse) }
option (alpha_method) = true;
}

rpc DeleteVolumeGroupSnapshot(DeleteVolumeGroupSnapshotRequest)
returns (DeleteVolumeGroupSnapshotResponse) {
option (alpha_method) = true;
}

rpc ListVolumeGroups(ListVolumeGroupsRequest)
returns (ListVolumeGroupsResponse) {
option (alpha_method) = true;
}

rpc ListVolumeGroupSnapshots(ListVolumeGroupSnapshotsRequest)
returns (ListVolumeGroupSnapshotsResponse) {
option (alpha_method) = true;
}

rpc GetVolumeGroup(GetVolumeGroupRequest)
returns (GetVolumeGroupResponse) {
option (alpha_method) = true;
}

rpc GetVolumeGroupSnapshot(GetVolumeGroupSnapshotRequest)
returns (GetVolumeGroupSnapshotResponse) {
option (alpha_method) = true;
}
}

service Node {
Expand Down Expand Up @@ -1008,6 +1053,303 @@ message GetCapacityResponse {
google.protobuf.Int64Value minimum_volume_size = 3
[(alpha_field) = true];
}
message CreateVolumeGroupRequest {
option (alpha_message) = true;

// suggested name for volume group (required for idempotency)
// This field is REQUIRED.
string name = 1;

// params passed from VolumeGroupClass
// This field is OPTIONAL.
map<string, string> parameters = 2;

// Secrets required by plugin to complete volume group creation
// request.
// This field is OPTIONAL. Refer to the `Secrets Requirements`
// section on how to use this field.
map<string, string> secrets = 3 [(csi_secret) = true];

// Phase 2
// If specified, a volume group will be created from the source group
// snapshot.
// This field is OPTIONAL.
// VolumeGroupSnapshot source_volume_group_snapshot = 4;

// Phase 2
// If specified, a volume group will be created from a list of
// existing volumes.
// This field is OPTIONAL.
// repeated string volume_id = 5;
}

message CreateVolumeGroupResponse {
option (alpha_message) = true;

// Contains all attributes of the newly created volume group.
// This field is REQUIRED.
VolumeGroup volume_group = 1;
}

message VolumeGroup {
option (alpha_message) = true;

// The identifier for this volume group, generated by the plugin.
// This field is REQUIRED.
string volume_group_id = 1;

// Opaque static properties of the volume group.
// This field is OPTIONAL.
map<string, string> volume_group_context = 2;

// Underlying volumes in this group. The same definition in CSI
// Volume.
// This field is REQUIRED.
// To support the creation of an empty group, this list can be empty.
// However, this field is not empty in the following cases:
// - Response from ListVolumeGroups or GetVolumeGroup if the
// VolumeGroup is not empty.
// - Response from ModifyVolumeGroup if the VolumeGroup is not
// empty after modification.
// - Phase 2: Create a new volume group from a source group snapshot.
// - Phase 2: Create a new volume group and add a list of existing
// volumes to the group.
repeated .csi.v1.Volume volumes = 3;
}
message DeleteVolumeGroupRequest {
option (alpha_message) = true;

// The ID of the volume group to be deprovisioned.
// This field is REQUIRED.
string volume_group_id = 1;

// Secrets required by plugin to complete volume group deletion
// request.
// This field is OPTIONAL. Refer to the `Secrets Requirements`
// section on how to use this field.
map<string, string> secrets = 2 [(csi_secret) = true];
}

message DeleteVolumeGroupResponse {
option (alpha_message) = true;
// Intentionally empty.
}
message ModifyVolumeGroupRequest {
option (alpha_message) = true;

// The ID of the volume group to be modified.
// This field is REQUIRED.
string volume_group_id = 1;

// Specify volume_ids that will be in the modified volume group.
// This list will be compared with the volume_ids in the existing
// group.
// New ones will be added and missing ones will be removed.
// If no volume_ids are provided, all existing volumes will
// be removed from the group.
// This field is OPTIONAL.
repeated string volume_ids = 3;
}

message ModifyVolumeGroupResponse {
option (alpha_message) = true;

// Contains all attributes of the modified volume group.
// This field is REQUIRED.
VolumeGroup volume_group = 1;
}
message ControllerGetVolumeGroupRequest {
option (alpha_message) = true;

// The ID of the volume group to fetch current volume group
// information for.
// This field is REQUIRED.
string volume_group_id = 1;
}

message ControllerGetVolumeGroupResponse {
option (alpha_message) = true;

// This field is REQUIRED
VolumeGroup volume_group = 1;
}
message ListVolumeGroupsRequest {
option (alpha_message) = true;

// If specified (non-zero value), the Plugin MUST NOT return more
// entries than this number in the response. If the actual number of
// entries is more than this number, the Plugin MUST set `next_token`
// in the response which can be used to get the next page of entries
// in the subsequent `ListVolumeGroups` 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.
// The value of this field MUST NOT be negative.
int32 max_entries = 1;

// A token to specify where to start paginating. Set this field to
// `next_token` returned by a previous `ListVolumeGroups` call to get
// the next page of entries. This field is OPTIONAL.
// An empty string is equal to an unspecified field value.
string starting_token = 2;
}

message ListVolumeGroupsResponse {
option (alpha_message) = true;

message Entry {
// This field is REQUIRED
VolumeGroup volume_group = 1;
}

repeated Entry entries = 1;

// This token allows you to get the next page of entries for
// `ListVolumeGroups` request. If the number of entries is larger than
// `max_entries`, use the `next_token` as a value for the
// `starting_token` field in the next `ListVolumeGroups` request. This
// field is OPTIONAL.
// An empty string is equal to an unspecified field value.
string next_token = 2;
}
message CreateVolumeGroupSnapshotRequest {
option (alpha_message) = true;

// suggested name for a group snapshot (required for idempotent)
// This field is REQUIRED.
string name = 1;

// identifier indicates which volume group is used to take
// group snapshot
// This field is REQUIRED.
string source_volume_group_id = 2;

// volume ids of the volumes in the source group. This field is
// REQUIRED. This is needed because some storage systems does not
// have a group persisted on the storage system until the time to
// take a group snapshot
repeated string volume_ids = 3;

// secrets required for snapshot creation (pulled from
// VolumeSnapshotClass)
// This field is OPTIONAL.
map<string, string> secrets = 4 [(.csi.v1.csi_secret) = true];

// params passed from VolumeSnapshotClass
// This field is OPTIONAL.
map<string, string> parameters = 5;
}

message CreateVolumeGroupSnapshotResponse {
option (alpha_message) = true;

// Contains all attributes of the newly created group snapshot.
// This field is REQUIRED.
VolumeGroupSnapshot group_snapshot = 1;
}

message VolumeGroupSnapshot {
option (alpha_message) = true;

// The identifier for this group snapshot, generated by the plugin.
// This field is REQUIRED.
string group_snapshot_id = 1;

// A list of snapshots created. Snapshot is the same
// definition as Snapshot definition used in CSI.
// This field is OPTIONAL.
repeated .csi.v1.Snapshot snapshots = 2;

// Identity information for the source volume group. Currently, only
// support the case that source is volume group. This field is
// REQUIRED.
string source_volume_group_id = 3;

// Indicates if a list of group snapshots are ready.
// This field is REQUIRED.
bool ready_to_use = 4;

// Timestamp when the point-in-time consistency group snapshot is
// taken.
// This field is REQUIRED.
.google.protobuf.Timestamp creation_time = 5;

// Complete total size of the snapshots in group in bytes. The purpose
// of this field is to give CO guidance on how much space is needed to
// restore volumes from all snapshots in group.
// This field is OPTIONAL.
int64 size_bytes = 6;
}
message DeleteVolumeGroupSnapshotRequest {
option (alpha_message) = true;

// The ID of the group snapshot to be deprovisioned.
// This field is REQUIRED.
string group_snapshot_id = 1;

// Secrets required by plugin to complete group snapshot deletion
// request.
// This field is OPTIONAL. Refer to the `Secrets Requirements`
// section on how to use this field.
map<string, string> secrets = 2 [(csi_secret) = true];
}

message DeleteVolumeGroupSnapshotResponse {
// Intentionally empty.
}
message ControllerGetVolumeGroupSnapshotRequest {
option (alpha_message) = true;

// The ID of the group snapshot to fetch current group snapshot
// information for.
// This field is REQUIRED.
string group_snapshot_id = 1;
}

message ControllerGetVolumeGroupSnapshotResponse {
option (alpha_message) = true;

// This field is REQUIRED
VolumeGroupSnapshot group_snapshot = 1;
}
message ListVolumeGroupSnapshotsRequest {
option (alpha_message) = true;

// If specified (non-zero value), the Plugin MUST NOT return more
// entries than this number in the response. If the actual number of
// entries is more than this number, the Plugin MUST set `next_token`
// in the response which can be used to get the next page of entries
// in the subsequent `ListVolumeGroupSnapshots` 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. The value of this field MUST NOT be negative.
int32 max_entries = 1;

// A token to specify where to start paginating. Set this field to
// `next_token` returned by a previous `ListVolumeGroupSnapshots`
// call to get the next page of entries. This field is OPTIONAL.
// An empty string is equal to an unspecified field value.
string starting_token = 2;
}

message ListVolumeGroupSnapshotsResponse {
option (alpha_message) = true;

message Entry {
// This field is REQUIRED
VolumeGroupSnapshot group_snapshot = 1;
}

repeated Entry entries = 1;

// This token allows you to get the next page of entries for
// `ListVolumeGroupSnapshots` request. If the number of entries is
// larger than `max_entries`, use the `next_token` as a value for the
// `starting_token` field in the next `ListVolumeGroupSnapshots`
// request.
// This field is OPTIONAL.
// An empty string is equal to an unspecified field value.
string next_token = 2;
}
message ControllerGetCapabilitiesRequest {
// Intentionally empty.
}
Expand Down Expand Up @@ -1080,6 +1422,38 @@ message ControllerServiceCapability {
// SINGLE_NODE_SINGLE_WRITER and/or SINGLE_NODE_MULTI_WRITER are
// supported, in order to permit older COs to continue working.
SINGLE_NODE_MULTI_WRITER = 13 [(alpha_enum_value) = true];

// Indicates that the controller plugin supports creating and
// deleting a volume group.
CREATE_DELETE_VOLUME_GROUP = 14 [(alpha_enum_value) = true];

// Indicates that the controller plugin supports adding an
// existing volume to a volume group and removing a volume from
// a volume group without deleting it.
VOLUME_GROUP_ADD_REMOVE_EXISTING_VOLUME = 15
[(alpha_enum_value) = true];

// Indicates whether the controller plugin supports creating a
// volume from an individual volume snapshot if the volume
// snapshot is part of a VolumeGroupSnapshot.
// Use cases: selective restore, advanced recovery, etc.
INDIVIDUAL_SNAPSHOT_RESTORE = 16 [(alpha_enum_value) = true];

// Indicates that the controller plugin supports getting details
// of a volume group.
GET_VOLUME_GROUP = 17 [(alpha_enum_value) = true];

// Indicates that the controller plugin supports getting details
// of a volume group snapshot.
GET_VOLUME_GROUP_SNAPSHOT = 18 [(alpha_enum_value) = true];

// Indicates that the controller plugin supports getting details
// of a list of volume groups.
LIST_VOLUME_GROUPS = 19 [(alpha_enum_value) = true];

// Indicates that the controller plugin supports getting details
// of a list of volume group snapshots.
LIST_VOLUME_GROUP_SNAPSHOTS = 20 [(alpha_enum_value) = true];
}

Type type = 1;
Expand Down
Loading

0 comments on commit e1048db

Please sign in to comment.