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

add proto and service for volume replication #205

Merged
merged 2 commits into from
Aug 22, 2022
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
1,091 changes: 1,091 additions & 0 deletions internal/proto/replication.pb.go

Large diffs are not rendered by default.

176 changes: 176 additions & 0 deletions internal/proto/replication.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
syntax = "proto3";
package proto;

option go_package = "github.com/csi-addons/kubernetes-csi-addons/internal/proto";

// Replication holds the RPC menthod for allowing the communication between
// the CSIAddons controller and the sidecar for replication operation.
service Replication {
// EnableVolumeReplication RPC call to enable the volume replication.
rpc EnableVolumeReplication (EnableVolumeReplicationRequest)
returns (EnableVolumeReplicationResponse) {}
// DisableVolumeReplication RPC call to disable the volume replication.
rpc DisableVolumeReplication (DisableVolumeReplicationRequest)
returns (DisableVolumeReplicationResponse) {}
// PromoteVolume RPC call to promote the volume.
rpc PromoteVolume (PromoteVolumeRequest)
returns (PromoteVolumeResponse) {}
// DemoteVolume RPC call to demote the volume.
rpc DemoteVolume (DemoteVolumeRequest)
returns (DemoteVolumeResponse) {}
// ResyncVolume RPC call to resync the volume.
rpc ResyncVolume (ResyncVolumeRequest)
returns (ResyncVolumeResponse) {}
}
// EnableVolumeReplicationRequest holds the required information to enable
// replication on a volume.
message EnableVolumeReplicationRequest {
// The identifier for this volume, generated by the plugin during
// CreateVolume CSI RPC call.
// This field is REQUIRED.
// This field MUST contain enough information to uniquely identify
// this specific volume vs all other volumes supported by this plugin.
// This field SHALL be used by the CO in subsequent calls to refer to
// this volume.
string volume_id = 1;
// The identifier for the replication.
// This field is OPTIONAL.
// This field MUST contain enough information, together with volume_id,
// to uniquely identify this specific replication
// vs all other replications supported by this plugin.
string replication_id = 2;
// Plugin specific parameters passed in as opaque key-value pairs.
map<string, string> parameters = 3;
// Secrets required by the driver to complete the request.
string secret_name = 4;
string secret_namespace = 5;
}

// EnableVolumeReplicationResponse holds the information to send when
// replication is successfully enabled on a volume.
message EnableVolumeReplicationResponse {
}
// DisableVolumeReplicationRequest holds the required information to disable
// replication on a volume.
message DisableVolumeReplicationRequest {
// The identifier for this volume, generated by the plugin during
// CreateVolume CSI RPC call.
// This field is REQUIRED.
// This field MUST contain enough information to uniquely identify
// this specific volume vs all other volumes supported by this plugin.
// This field SHALL be used by the CO in subsequent calls to refer to
// this volume.
string volume_id = 1;
// The identifier for the replication.
// This field is OPTIONAL.
// This field MUST contain enough information, together with volume_id,
// to uniquely identify this specific replication
// vs all other replications supported by this plugin.
string replication_id = 2;
// Plugin specific parameters passed in as opaque key-value pairs.
map<string, string> parameters = 3;
// Secrets required by the driver to complete the request.
string secret_name = 4;
string secret_namespace = 5;
}

// DisableVolumeReplicationResponse holds the information to send when
// replication is successfully disabled on a volume.
message DisableVolumeReplicationResponse {
}
// PromoteVolumeRequest holds the required information to promote volume as a
// primary on local cluster.
message PromoteVolumeRequest {
// The identifier for this volume, generated by the plugin during
// CreateVolume CSI RPC call.
// This field is REQUIRED.
// This field MUST contain enough information to uniquely identify
// this specific volume vs all other volumes supported by this plugin.
// This field SHALL be used by the CO in subsequent calls to refer to
// this volume.
string volume_id = 1;
// The identifier for the replication.
// This field is OPTIONAL.
// This field MUST contain enough information, together with volume_id,
// to uniquely identify this specific replication
// vs all other replications supported by this plugin.
string replication_id = 2;
// This field is optional.
// Default value is false, force option to Promote the volume.
bool force = 3;
// Plugin specific parameters passed in as opaque key-value pairs.
map<string, string> parameters = 4;
// Secrets required by the driver to complete the request.
string secret_name = 5;
string secret_namespace = 6;
}

// PromoteVolumeResponse holds the information to send when
// volume is successfully promoted.
message PromoteVolumeResponse{
}
// DemoteVolumeRequest holds the required information to demote volume on local
// cluster.
message DemoteVolumeRequest {
// The identifier for this volume, generated by the plugin during
// CreateVolume CSI RPC call.
// This field is REQUIRED.
// This field MUST contain enough information to uniquely identify
// this specific volume vs all other volumes supported by this plugin.
// This field SHALL be used by the CO in subsequent calls to refer to
// this volume.
string volume_id = 1;
// The identifier for the replication.
// This field is OPTIONAL.
// This field MUST contain enough information, together with volume_id,
// to uniquely identify this specific replication
// vs all other replications supported by this plugin.
string replication_id = 2;
// This field is optional.
// Default value is false, force option to Demote the volume.
bool force = 3;
// Plugin specific parameters passed in as opaque key-value pairs.
map<string, string> parameters = 4;
// Secrets required by the driver to complete the request.
string secret_name = 5;
string secret_namespace = 6;
}

// DemoteVolumeResponse holds the information to send when
// volume is successfully demoted.
message DemoteVolumeResponse{
}
// ResyncVolumeRequest holds the required information to resync volume.
message ResyncVolumeRequest {
// The identifier for this volume, generated by the plugin during
// CreateVolume CSI RPC call.
// This field is REQUIRED.
// This field MUST contain enough information to uniquely identify
// this specific volume vs all other volumes supported by this plugin.
// This field SHALL be used by the CO in subsequent calls to refer to
// this volume.
string volume_id = 1;
// The identifier for the replication.
// This field is OPTIONAL.
// This field MUST contain enough information, together with volume_id,
// to uniquely identify this specific replication
// vs all other replications supported by this plugin.
string replication_id = 2;
// This field is optional.
// Default value is false, force option to Resync the volume.
bool force = 3;
// Plugin specific parameters passed in as opaque key-value pairs.
map<string, string> parameters = 4;
// Secrets required by the driver to complete the request.
string secret_name = 5;
string secret_namespace = 6;
}

// ResyncVolumeResponse holds the information to send when
// volume is successfully resynced.
message ResyncVolumeResponse{
// Indicates that the volume is ready to use.
// The default value is false.
// This field is REQUIRED.
bool ready = 1;
}
Loading