diff --git a/apis/io-engine/protobuf/v1/common.proto b/apis/io-engine/protobuf/v1/common.proto index 3f0d3d5..fc6d804 100644 --- a/apis/io-engine/protobuf/v1/common.proto +++ b/apis/io-engine/protobuf/v1/common.proto @@ -7,3 +7,8 @@ enum ShareProtocol { NVMF = 1; // NVMe over Fabrics (TCP) ISCSI = 2; // iSCSI } + +message ResizeContext { + uint64 requested_size = 1; + uint32 status_code = 2; +} diff --git a/apis/io-engine/protobuf/v1/replica.proto b/apis/io-engine/protobuf/v1/replica.proto index 65598d3..3bb71fe 100644 --- a/apis/io-engine/protobuf/v1/replica.proto +++ b/apis/io-engine/protobuf/v1/replica.proto @@ -15,6 +15,7 @@ service ReplicaRpc { rpc ListReplicas (ListReplicaOptions) returns (ListReplicasResponse) {} rpc ShareReplica (ShareReplicaRequest) returns (Replica) {} rpc UnshareReplica (UnshareReplicaRequest) returns (Replica) {} + rpc ResizeReplica (ResizeReplicaRequest) returns (ResizeReplicaResponse) {} } // Replica space usage @@ -78,11 +79,24 @@ message UnshareReplicaRequest { string uuid = 1; // uuid of the replica } +// Resize(expand or shrink) a replica. Only valid for normal lvol +// replicas, and not lvols that are a snapshot. +message ResizeReplicaRequest { + string uuid = 1; // uuid of the replica. + uint64 requested_size = 2; // indicates the requested new size of replica. +} + // List of replicas and their properties. message ListReplicasResponse { repeated Replica replicas = 1; // list of the replicas } +// Response containing updated replica information and result. +message ResizeReplicaResponse { + Replica replica = 1; // replica requested for resize. + ResizeContext resize_ctx = 2; // context info for resize operation. +} + message ListReplicaOptions { google.protobuf.StringValue name = 1; // list the replica with the name if provided google.protobuf.StringValue poolname = 2; // list the replicas on the provided pool, by name diff --git a/apis/io-engine/src/v1.rs b/apis/io-engine/src/v1.rs index b051731..76f5691 100644 --- a/apis/io-engine/src/v1.rs +++ b/apis/io-engine/src/v1.rs @@ -18,7 +18,7 @@ mod pb { } pub mod common { - pub use super::pb::ShareProtocol; + pub use super::pb::{ResizeContext, ShareProtocol}; } /// v1 version of bdev grpc API @@ -55,7 +55,8 @@ pub mod replica { replica_rpc_client::ReplicaRpcClient, replica_rpc_server::{ReplicaRpc, ReplicaRpcServer}, CreateReplicaRequest, DestroyReplicaRequest, ListReplicaOptions, ListReplicasResponse, - Replica, ReplicaSpaceUsage, ShareReplicaRequest, SnapshotInfo, UnshareReplicaRequest, + Replica, ReplicaSpaceUsage, ResizeReplicaRequest, ResizeReplicaResponse, + ShareReplicaRequest, SnapshotInfo, UnshareReplicaRequest, }; } pub mod snapshot {