Skip to content

Commit

Permalink
Write a design proposal for volume capacity
Browse files Browse the repository at this point in the history
Use repeated usage for representing volume stats
  • Loading branch information
gnufied authored and jieyu committed Aug 1, 2018
1 parent f7a67e7 commit aeca98c
Show file tree
Hide file tree
Showing 3 changed files with 611 additions and 258 deletions.
45 changes: 45 additions & 0 deletions csi.proto
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ service Node {
rpc NodeUnpublishVolume (NodeUnpublishVolumeRequest)
returns (NodeUnpublishVolumeResponse) {}

rpc NodeGetVolumeStats (NodeGetVolumeStatsRequest)
returns (NodeGetVolumeStatsResponse) {}

// NodeGetId is being deprecated in favor of NodeGetInfo and will be
// removed in CSI 1.0. Existing drivers, however, may depend on this
// RPC call and hence this RPC call MUST be implemented by the CSI
Expand Down Expand Up @@ -1020,6 +1023,44 @@ message NodeUnpublishVolumeRequest {
message NodeUnpublishVolumeResponse {
// Intentionally empty.
}
message NodeGetVolumeStatsRequest {
// The ID of the volume. This field is REQUIRED.
string volume_id = 1;

// It can be any valid path where volume was previously
// staged or published.
// It MUST be an absolute path in the root filesystem of
// the process serving this request.
// This is a REQUIRED field.
string volume_path = 2;
}

message NodeGetVolumeStatsResponse {
// This field is OPTIONAL.
repeated VolumeUsage usage = 1;
}

message VolumeUsage {
enum Unit {
UNKNOWN = 0;
BYTES = 1;
INODES = 2;
}
// The available capacity in specified Unit. This field is OPTIONAL.
// The value of this field MUST NOT be negative.
int64 available = 1;

// The total capacity in specified Unit. This field is REQUIRED.
// The value of this field MUST NOT be negative.
int64 total = 2;

// The used capacity in specified Unit. This field is OPTIONAL.
// The value of this field MUST NOT be negative.
int64 used = 3;

// Units by which values are measured. This field is REQUIRED.
Unit unit = 4;
}
message NodeGetIdRequest {
// Intentionally empty.
}
Expand All @@ -1046,6 +1087,10 @@ message NodeServiceCapability {
enum Type {
UNKNOWN = 0;
STAGE_UNSTAGE_VOLUME = 1;
// If Plugin implements GET_VOLUME_STATS capability
// then it MUST implement NodeGetVolumeStats RPC
// call for fetching volume statistics.
GET_VOLUME_STATS = 2;
}

Type type = 1;
Expand Down
Loading

0 comments on commit aeca98c

Please sign in to comment.