Skip to content

Commit d1fe31b

Browse files
committed
Use repeated usage for representing volume stats
1 parent 5ef505f commit d1fe31b

File tree

3 files changed

+405
-385
lines changed

3 files changed

+405
-385
lines changed

csi.proto

Lines changed: 23 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,49 +1027,36 @@ message NodeGetVolumeStatsRequest {
10271027
// The ID of the volume. This field is REQUIRED.
10281028
string volume_id = 1;
10291029

1030-
// The path at which the volume was published. It MUST be an absolute
1031-
// path in the root filesystem of the process serving this request.
1030+
// It can be any valid path where volume was previously published.
1031+
// It MUST be an absolute path in the root filesystem of
1032+
// the process serving this request.
10321033
// This is a REQUIRED field.
1033-
string target_path = 2;
1034+
string volume_path = 2;
10341035
}
10351036

10361037
message NodeGetVolumeStatsResponse {
1037-
// The used capacity in bytes. This field is OPTIONAL.
1038-
// The value of this field MUST NOT be negative.
1039-
// For volumes that share a filesystem with the host (e.g hostpath)
1040-
// this is used space on the underlying storage by specified
1041-
// shared path or directory.
1042-
int64 used_capacity = 1;
1043-
1044-
// The available capacity in bytes. This field is OPTIONAL.
1045-
// For volumes that share a filesystem with the host (e.g hostpath)
1046-
// this is available space on the underlying storage and is
1047-
// shared with the host processes and other volumes.
1048-
// The value of this field MUST NOT be negative.
1049-
int64 available_capacity = 2;
1038+
repeated VolumeUsage usage = 1;
1039+
}
10501040

1051-
// The total capacity in bytes. This field is REQUIRED.
1052-
// For volumes that share a file system with the host (e.g hostpath)
1053-
// this is the total size of underlying storage and it MAY
1054-
// not be equal to used_capacity + available_capacity because
1055-
// filesystem is shared.
1041+
message VolumeUsage {
1042+
enum Unit {
1043+
BYTES = 0;
1044+
INODES = 1;
1045+
}
1046+
// The available capacity in specified Unit. This field is OPTIONAL.
10561047
// The value of this field MUST NOT be negative.
1057-
int64 total_capacity = 3;
1048+
int64 available = 1;
10581049

1059-
// The number of inodes used by the volume.
1060-
// This field is OPTIONAL.
1050+
// The total capacity in specified Unit. This field is REQUIRED.
10611051
// The value of this field MUST NOT be negative.
1062-
int64 used_inodes = 4;
1052+
int64 total = 2;
10631053

1064-
// The total number of inodes on the underlying filesystem.
1065-
// This field is OPTIONAL
1054+
// The used capacity in specified Unit. This field is OPTIONAL.
10661055
// The value of this field MUST NOT be negative.
1067-
int64 total_inodes = 5;
1056+
int64 used = 3;
10681057

1069-
// The total number of free inodes on the underlying filesystem.
1070-
// This field is OPTIONAL.
1071-
// The value of this field MUST NOT be negative.
1072-
int64 available_inodes = 6;
1058+
// The units that represent this value
1059+
Unit unit = 4;
10731060
}
10741061
message NodeGetIdRequest {
10751062
// Intentionally empty.
@@ -1097,6 +1084,10 @@ message NodeServiceCapability {
10971084
enum Type {
10981085
UNKNOWN = 0;
10991086
STAGE_UNSTAGE_VOLUME = 1;
1087+
// If Plugin implements GET_VOLUME_STATS capability
1088+
// then it MUST implement NodeGetVolumeStats RPC
1089+
// call for fetching volume stats
1090+
GET_VOLUME_STATS = 2;
11001091
}
11011092

11021093
Type type = 1;

0 commit comments

Comments
 (0)