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

feat(clone): new parameter to identify deleted snapshot having active clones #75

Merged
merged 1 commit into from
Jul 28, 2023
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
9 changes: 9 additions & 0 deletions protobuf/v1/replica.proto
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,18 @@ message ListReplicasResponse {
repeated Replica replicas = 1; // list of the replicas
}

/// ReplicaType enum is used to filter replica in listreplica response.
enum ReplicaType {
AllReplicas = 0; // Default value, to return all the replicas including snapshots and clones
AllReplicasExceptSnapshots = 1; // Return replicas and snapshot clones, without snapshots
OnlySnapshotClones = 2; // Returns only snapshot clones
OnlyReplicas = 3; // Returns only replicas
}

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
google.protobuf.StringValue uuid = 3; // list the replica with the uuid if provided
google.protobuf.StringValue pooluuid = 4; // list the replicas on the provided pool, by uuid
ReplicaType replicatype = 5; // list replica based on ReplicaType value
}
12 changes: 12 additions & 0 deletions protobuf/v1/snapshot.proto
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,23 @@ message SnapshotInfo {
bool valid_snapshot = 12; // true: valid, false: invalid (missing one/more snapshotdescriptor field i.e. txn_id, entity_id, source_uuid
bool ready_as_source = 13; // ready for usage, i,e source for another volume.
uint64 referenced_bytes = 14; // amount of bytes referenced by all successor snapshots.
bool discarded_snapshot = 15; // true: snapshot is marked as discarded. false: Valid Snapshot
}

/// SnapshotQueryType enum is used to filter snapshots in listsnapshot response.
enum SnapshotQueryType {
AllSnapshots = 0; // Default value, to return all the snapshots
AllSnapshotsExceptDiscardedSnapshots = 1; // Returns all snapshots except discarded snapshots
OnlyDiscardedSnapshots = 2; // Returns only discarded snapshots
OnlyInvalidSnapshots = 3; // Returns only invalid snapshots
OnlyUsableSnapshots = 4; // Returns only usable snapshots
}

/// Request parameters to list snapshot.
message ListSnapshotsRequest {
optional string source_uuid = 1; // source uuid from which snapshot is taken
optional string snapshot_uuid = 2; // snapshot uuid for which the detail can be listed
SnapshotQueryType snapshot_query_type = 3; // list snapshot based on SnapshotQueryType value
}

/// List Snapshot Response.
Expand Down
5 changes: 3 additions & 2 deletions src/v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ pub mod replica {
replica_rpc_client::ReplicaRpcClient,
replica_rpc_server::{ReplicaRpc, ReplicaRpcServer},
CreateReplicaRequest, DestroyReplicaRequest, ListReplicaOptions, ListReplicasResponse,
Replica, ReplicaSpaceUsage, ShareReplicaRequest, SnapshotInfo, UnshareReplicaRequest,
Replica, ReplicaSpaceUsage, ReplicaType, ShareReplicaRequest, SnapshotInfo,
UnshareReplicaRequest,
};
}
pub mod snapshot {
Expand All @@ -57,7 +58,7 @@ pub mod snapshot {
DestroySnapshotRequest, ListSnapshotCloneRequest, ListSnapshotCloneResponse,
ListSnapshotsRequest, ListSnapshotsResponse, Nexus, NexusCreateSnapshotReplicaDescriptor,
NexusCreateSnapshotReplicaStatus, NexusCreateSnapshotRequest, NexusCreateSnapshotResponse,
Replica, SnapshotInfo,
Replica, SnapshotInfo, SnapshotQueryType,
};
}
pub mod registration {
Expand Down
Loading