@@ -64,6 +64,9 @@ service Node {
64
64
rpc NodeUnpublishVolume (NodeUnpublishVolumeRequest )
65
65
returns (NodeUnpublishVolumeResponse ) {}
66
66
67
+ rpc NodeGetVolumeStats (NodeGetVolumeStatsRequest )
68
+ returns (NodeGetVolumeStatsResponse ) {}
69
+
67
70
// NodeGetId is being deprecated in favor of NodeGetInfo and will be
68
71
// removed in CSI 1.0. Existing drivers, however, may depend on this
69
72
// RPC call and hence this RPC call MUST be implemented by the CSI
@@ -1020,6 +1023,44 @@ message NodeUnpublishVolumeRequest {
1020
1023
message NodeUnpublishVolumeResponse {
1021
1024
// Intentionally empty.
1022
1025
}
1026
+ message NodeGetVolumeStatsRequest {
1027
+ // The ID of the volume. This field is REQUIRED.
1028
+ string volume_id = 1 ;
1029
+
1030
+ // It can be any valid path where volume was previously
1031
+ // staged or published.
1032
+ // It MUST be an absolute path in the root filesystem of
1033
+ // the process serving this request.
1034
+ // This is a REQUIRED field.
1035
+ string volume_path = 2 ;
1036
+ }
1037
+
1038
+ message NodeGetVolumeStatsResponse {
1039
+ // This field is OPTIONAL.
1040
+ repeated VolumeUsage usage = 1 ;
1041
+ }
1042
+
1043
+ message VolumeUsage {
1044
+ enum Unit {
1045
+ UNKNOWN = 0 ;
1046
+ BYTES = 1 ;
1047
+ INODES = 2 ;
1048
+ }
1049
+ // The available capacity in specified Unit. This field is OPTIONAL.
1050
+ // The value of this field MUST NOT be negative.
1051
+ int64 available = 1 ;
1052
+
1053
+ // The total capacity in specified Unit. This field is REQUIRED.
1054
+ // The value of this field MUST NOT be negative.
1055
+ int64 total = 2 ;
1056
+
1057
+ // The used capacity in specified Unit. This field is OPTIONAL.
1058
+ // The value of this field MUST NOT be negative.
1059
+ int64 used = 3 ;
1060
+
1061
+ // Units by which values are measured. This field is REQUIRED.
1062
+ Unit unit = 4 ;
1063
+ }
1023
1064
message NodeGetIdRequest {
1024
1065
// Intentionally empty.
1025
1066
}
@@ -1046,6 +1087,10 @@ message NodeServiceCapability {
1046
1087
enum Type {
1047
1088
UNKNOWN = 0 ;
1048
1089
STAGE_UNSTAGE_VOLUME = 1 ;
1090
+ // If Plugin implements GET_VOLUME_STATS capability
1091
+ // then it MUST implement NodeGetVolumeStats RPC
1092
+ // call for fetching volume statistics.
1093
+ GET_VOLUME_STATS = 2 ;
1049
1094
}
1050
1095
1051
1096
Type type = 1 ;
0 commit comments