1#[allow(clippy::derive_partial_eq_without_eq)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct GetPluginInfoRequest {}
5#[allow(clippy::derive_partial_eq_without_eq)]
6#[derive(Clone, PartialEq, ::prost::Message)]
7pub struct GetPluginInfoResponse {
8 #[prost(string, tag = "1")]
16 pub name: ::prost::alloc::string::String,
17 #[prost(string, tag = "2")]
19 pub vendor_version: ::prost::alloc::string::String,
20 #[prost(map = "string, string", tag = "3")]
22 pub manifest: ::std::collections::HashMap<
23 ::prost::alloc::string::String,
24 ::prost::alloc::string::String,
25 >,
26}
27#[allow(clippy::derive_partial_eq_without_eq)]
29#[derive(Clone, PartialEq, ::prost::Message)]
30pub struct GetPluginCapabilitiesRequest {}
31#[allow(clippy::derive_partial_eq_without_eq)]
32#[derive(Clone, PartialEq, ::prost::Message)]
33pub struct GetPluginCapabilitiesResponse {
34 #[prost(message, repeated, tag = "1")]
37 pub capabilities: ::prost::alloc::vec::Vec<PluginCapability>,
38}
39#[allow(clippy::derive_partial_eq_without_eq)]
41#[derive(Clone, PartialEq, ::prost::Message)]
42pub struct PluginCapability {
43 #[prost(oneof = "plugin_capability::Type", tags = "1, 2")]
44 pub r#type: ::core::option::Option<plugin_capability::Type>,
45}
46pub mod plugin_capability {
48 #[allow(clippy::derive_partial_eq_without_eq)]
49 #[derive(Clone, PartialEq, ::prost::Message)]
50 pub struct Service {
51 #[prost(enumeration = "service::Type", tag = "1")]
52 pub r#type: i32,
53 }
54 pub mod service {
56 #[derive(
57 Clone,
58 Copy,
59 Debug,
60 PartialEq,
61 Eq,
62 Hash,
63 PartialOrd,
64 Ord,
65 ::prost::Enumeration
66 )]
67 #[repr(i32)]
68 pub enum Type {
69 Unknown = 0,
70 ControllerService = 1,
79 VolumeAccessibilityConstraints = 2,
86 GroupControllerService = 3,
94 }
95 impl Type {
96 pub fn as_str_name(&self) -> &'static str {
101 match self {
102 Type::Unknown => "UNKNOWN",
103 Type::ControllerService => "CONTROLLER_SERVICE",
104 Type::VolumeAccessibilityConstraints => {
105 "VOLUME_ACCESSIBILITY_CONSTRAINTS"
106 }
107 Type::GroupControllerService => "GROUP_CONTROLLER_SERVICE",
108 }
109 }
110 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
112 match value {
113 "UNKNOWN" => Some(Self::Unknown),
114 "CONTROLLER_SERVICE" => Some(Self::ControllerService),
115 "VOLUME_ACCESSIBILITY_CONSTRAINTS" => {
116 Some(Self::VolumeAccessibilityConstraints)
117 }
118 "GROUP_CONTROLLER_SERVICE" => Some(Self::GroupControllerService),
119 _ => None,
120 }
121 }
122 }
123 }
124 #[allow(clippy::derive_partial_eq_without_eq)]
125 #[derive(Clone, PartialEq, ::prost::Message)]
126 pub struct VolumeExpansion {
127 #[prost(enumeration = "volume_expansion::Type", tag = "1")]
128 pub r#type: i32,
129 }
130 pub mod volume_expansion {
132 #[derive(
133 Clone,
134 Copy,
135 Debug,
136 PartialEq,
137 Eq,
138 Hash,
139 PartialOrd,
140 Ord,
141 ::prost::Enumeration
142 )]
143 #[repr(i32)]
144 pub enum Type {
145 Unknown = 0,
146 Online = 1,
170 Offline = 2,
183 }
184 impl Type {
185 pub fn as_str_name(&self) -> &'static str {
190 match self {
191 Type::Unknown => "UNKNOWN",
192 Type::Online => "ONLINE",
193 Type::Offline => "OFFLINE",
194 }
195 }
196 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
198 match value {
199 "UNKNOWN" => Some(Self::Unknown),
200 "ONLINE" => Some(Self::Online),
201 "OFFLINE" => Some(Self::Offline),
202 _ => None,
203 }
204 }
205 }
206 }
207 #[allow(clippy::derive_partial_eq_without_eq)]
208 #[derive(Clone, PartialEq, ::prost::Oneof)]
209 pub enum Type {
210 #[prost(message, tag = "1")]
212 Service(Service),
213 #[prost(message, tag = "2")]
214 VolumeExpansion(VolumeExpansion),
215 }
216}
217#[allow(clippy::derive_partial_eq_without_eq)]
219#[derive(Clone, PartialEq, ::prost::Message)]
220pub struct ProbeRequest {}
221#[allow(clippy::derive_partial_eq_without_eq)]
222#[derive(Clone, PartialEq, ::prost::Message)]
223pub struct ProbeResponse {
224 #[prost(message, optional, tag = "1")]
245 pub ready: ::core::option::Option<bool>,
246}
247#[allow(clippy::derive_partial_eq_without_eq)]
248#[derive(Clone, PartialEq, ::prost::Message)]
249pub struct CreateVolumeRequest {
250 #[prost(string, tag = "1")]
277 pub name: ::prost::alloc::string::String,
278 #[prost(message, optional, tag = "2")]
285 pub capacity_range: ::core::option::Option<CapacityRange>,
286 #[prost(message, repeated, tag = "3")]
301 pub volume_capabilities: ::prost::alloc::vec::Vec<VolumeCapability>,
302 #[prost(map = "string, string", tag = "4")]
307 pub parameters: ::std::collections::HashMap<
308 ::prost::alloc::string::String,
309 ::prost::alloc::string::String,
310 >,
311 #[prost(map = "string, string", tag = "5")]
315 pub secrets: ::std::collections::HashMap<
316 ::prost::alloc::string::String,
317 ::prost::alloc::string::String,
318 >,
319 #[prost(message, optional, tag = "6")]
322 pub volume_content_source: ::core::option::Option<VolumeContentSource>,
323 #[prost(message, optional, tag = "7")]
335 pub accessibility_requirements: ::core::option::Option<TopologyRequirement>,
336 #[prost(map = "string, string", tag = "8")]
341 pub mutable_parameters: ::std::collections::HashMap<
342 ::prost::alloc::string::String,
343 ::prost::alloc::string::String,
344 >,
345}
346#[allow(clippy::derive_partial_eq_without_eq)]
349#[derive(Clone, PartialEq, ::prost::Message)]
350pub struct VolumeContentSource {
351 #[prost(oneof = "volume_content_source::Type", tags = "1, 2")]
352 pub r#type: ::core::option::Option<volume_content_source::Type>,
353}
354pub mod volume_content_source {
356 #[allow(clippy::derive_partial_eq_without_eq)]
357 #[derive(Clone, PartialEq, ::prost::Message)]
358 pub struct SnapshotSource {
359 #[prost(string, tag = "1")]
364 pub snapshot_id: ::prost::alloc::string::String,
365 }
366 #[allow(clippy::derive_partial_eq_without_eq)]
367 #[derive(Clone, PartialEq, ::prost::Message)]
368 pub struct VolumeSource {
369 #[prost(string, tag = "1")]
373 pub volume_id: ::prost::alloc::string::String,
374 }
375 #[allow(clippy::derive_partial_eq_without_eq)]
376 #[derive(Clone, PartialEq, ::prost::Oneof)]
377 pub enum Type {
378 #[prost(message, tag = "1")]
379 Snapshot(SnapshotSource),
380 #[prost(message, tag = "2")]
381 Volume(VolumeSource),
382 }
383}
384#[allow(clippy::derive_partial_eq_without_eq)]
385#[derive(Clone, PartialEq, ::prost::Message)]
386pub struct CreateVolumeResponse {
387 #[prost(message, optional, tag = "1")]
391 pub volume: ::core::option::Option<Volume>,
392}
393#[allow(clippy::derive_partial_eq_without_eq)]
395#[derive(Clone, PartialEq, ::prost::Message)]
396pub struct VolumeCapability {
397 #[prost(message, optional, tag = "3")]
399 pub access_mode: ::core::option::Option<volume_capability::AccessMode>,
400 #[prost(oneof = "volume_capability::AccessType", tags = "1, 2")]
403 pub access_type: ::core::option::Option<volume_capability::AccessType>,
404}
405pub mod volume_capability {
407 #[allow(clippy::derive_partial_eq_without_eq)]
411 #[derive(Clone, PartialEq, ::prost::Message)]
412 pub struct BlockVolume {}
413 #[allow(clippy::derive_partial_eq_without_eq)]
415 #[derive(Clone, PartialEq, ::prost::Message)]
416 pub struct MountVolume {
417 #[prost(string, tag = "1")]
420 pub fs_type: ::prost::alloc::string::String,
421 #[prost(string, repeated, tag = "2")]
427 pub mount_flags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
428 #[prost(string, tag = "3")]
440 pub volume_mount_group: ::prost::alloc::string::String,
441 }
442 #[allow(clippy::derive_partial_eq_without_eq)]
444 #[derive(Clone, PartialEq, ::prost::Message)]
445 pub struct AccessMode {
446 #[prost(enumeration = "access_mode::Mode", tag = "1")]
448 pub mode: i32,
449 }
450 pub mod access_mode {
452 #[derive(
453 Clone,
454 Copy,
455 Debug,
456 PartialEq,
457 Eq,
458 Hash,
459 PartialOrd,
460 Ord,
461 ::prost::Enumeration
462 )]
463 #[repr(i32)]
464 pub enum Mode {
465 Unknown = 0,
466 SingleNodeWriter = 1,
469 SingleNodeReaderOnly = 2,
472 MultiNodeReaderOnly = 3,
474 MultiNodeSingleWriter = 4,
477 MultiNodeMultiWriter = 5,
480 SingleNodeSingleWriter = 6,
485 SingleNodeMultiWriter = 7,
490 }
491 impl Mode {
492 pub fn as_str_name(&self) -> &'static str {
497 match self {
498 Mode::Unknown => "UNKNOWN",
499 Mode::SingleNodeWriter => "SINGLE_NODE_WRITER",
500 Mode::SingleNodeReaderOnly => "SINGLE_NODE_READER_ONLY",
501 Mode::MultiNodeReaderOnly => "MULTI_NODE_READER_ONLY",
502 Mode::MultiNodeSingleWriter => "MULTI_NODE_SINGLE_WRITER",
503 Mode::MultiNodeMultiWriter => "MULTI_NODE_MULTI_WRITER",
504 Mode::SingleNodeSingleWriter => "SINGLE_NODE_SINGLE_WRITER",
505 Mode::SingleNodeMultiWriter => "SINGLE_NODE_MULTI_WRITER",
506 }
507 }
508 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
510 match value {
511 "UNKNOWN" => Some(Self::Unknown),
512 "SINGLE_NODE_WRITER" => Some(Self::SingleNodeWriter),
513 "SINGLE_NODE_READER_ONLY" => Some(Self::SingleNodeReaderOnly),
514 "MULTI_NODE_READER_ONLY" => Some(Self::MultiNodeReaderOnly),
515 "MULTI_NODE_SINGLE_WRITER" => Some(Self::MultiNodeSingleWriter),
516 "MULTI_NODE_MULTI_WRITER" => Some(Self::MultiNodeMultiWriter),
517 "SINGLE_NODE_SINGLE_WRITER" => Some(Self::SingleNodeSingleWriter),
518 "SINGLE_NODE_MULTI_WRITER" => Some(Self::SingleNodeMultiWriter),
519 _ => None,
520 }
521 }
522 }
523 }
524 #[allow(clippy::derive_partial_eq_without_eq)]
527 #[derive(Clone, PartialEq, ::prost::Oneof)]
528 pub enum AccessType {
529 #[prost(message, tag = "1")]
530 Block(BlockVolume),
531 #[prost(message, tag = "2")]
532 Mount(MountVolume),
533 }
534}
535#[allow(clippy::derive_partial_eq_without_eq)]
539#[derive(Clone, PartialEq, ::prost::Message)]
540pub struct CapacityRange {
541 #[prost(int64, tag = "1")]
545 pub required_bytes: i64,
546 #[prost(int64, tag = "2")]
550 pub limit_bytes: i64,
551}
552#[allow(clippy::derive_partial_eq_without_eq)]
554#[derive(Clone, PartialEq, ::prost::Message)]
555pub struct Volume {
556 #[prost(int64, tag = "1")]
561 pub capacity_bytes: i64,
562 #[prost(string, tag = "2")]
571 pub volume_id: ::prost::alloc::string::String,
572 #[prost(map = "string, string", tag = "3")]
588 pub volume_context: ::std::collections::HashMap<
589 ::prost::alloc::string::String,
590 ::prost::alloc::string::String,
591 >,
592 #[prost(message, optional, tag = "4")]
596 pub content_source: ::core::option::Option<VolumeContentSource>,
597 #[prost(message, repeated, tag = "5")]
623 pub accessible_topology: ::prost::alloc::vec::Vec<Topology>,
624}
625#[allow(clippy::derive_partial_eq_without_eq)]
626#[derive(Clone, PartialEq, ::prost::Message)]
627pub struct TopologyRequirement {
628 #[prost(message, repeated, tag = "1")]
685 pub requisite: ::prost::alloc::vec::Vec<Topology>,
686 #[prost(message, repeated, tag = "2")]
756 pub preferred: ::prost::alloc::vec::Vec<Topology>,
757}
758#[allow(clippy::derive_partial_eq_without_eq)]
788#[derive(Clone, PartialEq, ::prost::Message)]
789pub struct Topology {
790 #[prost(map = "string, string", tag = "1")]
791 pub segments: ::std::collections::HashMap<
792 ::prost::alloc::string::String,
793 ::prost::alloc::string::String,
794 >,
795}
796#[allow(clippy::derive_partial_eq_without_eq)]
797#[derive(Clone, PartialEq, ::prost::Message)]
798pub struct DeleteVolumeRequest {
799 #[prost(string, tag = "1")]
802 pub volume_id: ::prost::alloc::string::String,
803 #[prost(map = "string, string", tag = "2")]
807 pub secrets: ::std::collections::HashMap<
808 ::prost::alloc::string::String,
809 ::prost::alloc::string::String,
810 >,
811}
812#[allow(clippy::derive_partial_eq_without_eq)]
814#[derive(Clone, PartialEq, ::prost::Message)]
815pub struct DeleteVolumeResponse {}
816#[allow(clippy::derive_partial_eq_without_eq)]
817#[derive(Clone, PartialEq, ::prost::Message)]
818pub struct ControllerPublishVolumeRequest {
819 #[prost(string, tag = "1")]
822 pub volume_id: ::prost::alloc::string::String,
823 #[prost(string, tag = "2")]
826 pub node_id: ::prost::alloc::string::String,
827 #[prost(message, optional, tag = "3")]
832 pub volume_capability: ::core::option::Option<VolumeCapability>,
833 #[prost(bool, tag = "4")]
838 pub readonly: bool,
839 #[prost(map = "string, string", tag = "5")]
843 pub secrets: ::std::collections::HashMap<
844 ::prost::alloc::string::String,
845 ::prost::alloc::string::String,
846 >,
847 #[prost(map = "string, string", tag = "6")]
852 pub volume_context: ::std::collections::HashMap<
853 ::prost::alloc::string::String,
854 ::prost::alloc::string::String,
855 >,
856}
857#[allow(clippy::derive_partial_eq_without_eq)]
858#[derive(Clone, PartialEq, ::prost::Message)]
859pub struct ControllerPublishVolumeResponse {
860 #[prost(map = "string, string", tag = "1")]
874 pub publish_context: ::std::collections::HashMap<
875 ::prost::alloc::string::String,
876 ::prost::alloc::string::String,
877 >,
878}
879#[allow(clippy::derive_partial_eq_without_eq)]
880#[derive(Clone, PartialEq, ::prost::Message)]
881pub struct ControllerUnpublishVolumeRequest {
882 #[prost(string, tag = "1")]
884 pub volume_id: ::prost::alloc::string::String,
885 #[prost(string, tag = "2")]
891 pub node_id: ::prost::alloc::string::String,
892 #[prost(map = "string, string", tag = "3")]
898 pub secrets: ::std::collections::HashMap<
899 ::prost::alloc::string::String,
900 ::prost::alloc::string::String,
901 >,
902}
903#[allow(clippy::derive_partial_eq_without_eq)]
905#[derive(Clone, PartialEq, ::prost::Message)]
906pub struct ControllerUnpublishVolumeResponse {}
907#[allow(clippy::derive_partial_eq_without_eq)]
908#[derive(Clone, PartialEq, ::prost::Message)]
909pub struct ValidateVolumeCapabilitiesRequest {
910 #[prost(string, tag = "1")]
912 pub volume_id: ::prost::alloc::string::String,
913 #[prost(map = "string, string", tag = "2")]
918 pub volume_context: ::std::collections::HashMap<
919 ::prost::alloc::string::String,
920 ::prost::alloc::string::String,
921 >,
922 #[prost(message, repeated, tag = "3")]
926 pub volume_capabilities: ::prost::alloc::vec::Vec<VolumeCapability>,
927 #[prost(map = "string, string", tag = "4")]
930 pub parameters: ::std::collections::HashMap<
931 ::prost::alloc::string::String,
932 ::prost::alloc::string::String,
933 >,
934 #[prost(map = "string, string", tag = "5")]
938 pub secrets: ::std::collections::HashMap<
939 ::prost::alloc::string::String,
940 ::prost::alloc::string::String,
941 >,
942 #[prost(map = "string, string", tag = "6")]
945 pub mutable_parameters: ::std::collections::HashMap<
946 ::prost::alloc::string::String,
947 ::prost::alloc::string::String,
948 >,
949}
950#[allow(clippy::derive_partial_eq_without_eq)]
951#[derive(Clone, PartialEq, ::prost::Message)]
952pub struct ValidateVolumeCapabilitiesResponse {
953 #[prost(message, optional, tag = "1")]
962 pub confirmed: ::core::option::Option<
963 validate_volume_capabilities_response::Confirmed,
964 >,
965 #[prost(string, tag = "2")]
969 pub message: ::prost::alloc::string::String,
970}
971pub mod validate_volume_capabilities_response {
973 #[allow(clippy::derive_partial_eq_without_eq)]
974 #[derive(Clone, PartialEq, ::prost::Message)]
975 pub struct Confirmed {
976 #[prost(map = "string, string", tag = "1")]
979 pub volume_context: ::std::collections::HashMap<
980 ::prost::alloc::string::String,
981 ::prost::alloc::string::String,
982 >,
983 #[prost(message, repeated, tag = "2")]
986 pub volume_capabilities: ::prost::alloc::vec::Vec<super::VolumeCapability>,
987 #[prost(map = "string, string", tag = "3")]
990 pub parameters: ::std::collections::HashMap<
991 ::prost::alloc::string::String,
992 ::prost::alloc::string::String,
993 >,
994 #[prost(map = "string, string", tag = "4")]
997 pub mutable_parameters: ::std::collections::HashMap<
998 ::prost::alloc::string::String,
999 ::prost::alloc::string::String,
1000 >,
1001 }
1002}
1003#[allow(clippy::derive_partial_eq_without_eq)]
1004#[derive(Clone, PartialEq, ::prost::Message)]
1005pub struct ListVolumesRequest {
1006 #[prost(int32, tag = "1")]
1015 pub max_entries: i32,
1016 #[prost(string, tag = "2")]
1021 pub starting_token: ::prost::alloc::string::String,
1022}
1023#[allow(clippy::derive_partial_eq_without_eq)]
1024#[derive(Clone, PartialEq, ::prost::Message)]
1025pub struct ListVolumesResponse {
1026 #[prost(message, repeated, tag = "1")]
1027 pub entries: ::prost::alloc::vec::Vec<list_volumes_response::Entry>,
1028 #[prost(string, tag = "2")]
1035 pub next_token: ::prost::alloc::string::String,
1036}
1037pub mod list_volumes_response {
1039 #[allow(clippy::derive_partial_eq_without_eq)]
1040 #[derive(Clone, PartialEq, ::prost::Message)]
1041 pub struct VolumeStatus {
1042 #[prost(string, repeated, tag = "1")]
1053 pub published_node_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1054 #[prost(message, optional, tag = "2")]
1059 pub volume_condition: ::core::option::Option<super::VolumeCondition>,
1060 }
1061 #[allow(clippy::derive_partial_eq_without_eq)]
1062 #[derive(Clone, PartialEq, ::prost::Message)]
1063 pub struct Entry {
1064 #[prost(message, optional, tag = "1")]
1066 pub volume: ::core::option::Option<super::Volume>,
1067 #[prost(message, optional, tag = "2")]
1071 pub status: ::core::option::Option<VolumeStatus>,
1072 }
1073}
1074#[allow(clippy::derive_partial_eq_without_eq)]
1075#[derive(Clone, PartialEq, ::prost::Message)]
1076pub struct ControllerGetVolumeRequest {
1077 #[prost(string, tag = "1")]
1080 pub volume_id: ::prost::alloc::string::String,
1081}
1082#[allow(clippy::derive_partial_eq_without_eq)]
1083#[derive(Clone, PartialEq, ::prost::Message)]
1084pub struct ControllerGetVolumeResponse {
1085 #[prost(message, optional, tag = "1")]
1087 pub volume: ::core::option::Option<Volume>,
1088 #[prost(message, optional, tag = "2")]
1090 pub status: ::core::option::Option<controller_get_volume_response::VolumeStatus>,
1091}
1092pub mod controller_get_volume_response {
1094 #[allow(clippy::derive_partial_eq_without_eq)]
1095 #[derive(Clone, PartialEq, ::prost::Message)]
1096 pub struct VolumeStatus {
1097 #[prost(string, repeated, tag = "1")]
1105 pub published_node_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1106 #[prost(message, optional, tag = "2")]
1111 pub volume_condition: ::core::option::Option<super::VolumeCondition>,
1112 }
1113}
1114#[allow(clippy::derive_partial_eq_without_eq)]
1115#[derive(Clone, PartialEq, ::prost::Message)]
1116pub struct ControllerModifyVolumeRequest {
1117 #[prost(string, tag = "1")]
1120 pub volume_id: ::prost::alloc::string::String,
1121 #[prost(map = "string, string", tag = "2")]
1125 pub secrets: ::std::collections::HashMap<
1126 ::prost::alloc::string::String,
1127 ::prost::alloc::string::String,
1128 >,
1129 #[prost(map = "string, string", tag = "3")]
1138 pub mutable_parameters: ::std::collections::HashMap<
1139 ::prost::alloc::string::String,
1140 ::prost::alloc::string::String,
1141 >,
1142}
1143#[allow(clippy::derive_partial_eq_without_eq)]
1144#[derive(Clone, PartialEq, ::prost::Message)]
1145pub struct ControllerModifyVolumeResponse {}
1146#[allow(clippy::derive_partial_eq_without_eq)]
1147#[derive(Clone, PartialEq, ::prost::Message)]
1148pub struct GetCapacityRequest {
1149 #[prost(message, repeated, tag = "1")]
1155 pub volume_capabilities: ::prost::alloc::vec::Vec<VolumeCapability>,
1156 #[prost(map = "string, string", tag = "2")]
1161 pub parameters: ::std::collections::HashMap<
1162 ::prost::alloc::string::String,
1163 ::prost::alloc::string::String,
1164 >,
1165 #[prost(message, optional, tag = "3")]
1172 pub accessible_topology: ::core::option::Option<Topology>,
1173}
1174#[allow(clippy::derive_partial_eq_without_eq)]
1175#[derive(Clone, PartialEq, ::prost::Message)]
1176pub struct GetCapacityResponse {
1177 #[prost(int64, tag = "1")]
1184 pub available_capacity: i64,
1185 #[prost(message, optional, tag = "2")]
1201 pub maximum_volume_size: ::core::option::Option<i64>,
1202 #[prost(message, optional, tag = "3")]
1218 pub minimum_volume_size: ::core::option::Option<i64>,
1219}
1220#[allow(clippy::derive_partial_eq_without_eq)]
1222#[derive(Clone, PartialEq, ::prost::Message)]
1223pub struct ControllerGetCapabilitiesRequest {}
1224#[allow(clippy::derive_partial_eq_without_eq)]
1225#[derive(Clone, PartialEq, ::prost::Message)]
1226pub struct ControllerGetCapabilitiesResponse {
1227 #[prost(message, repeated, tag = "1")]
1230 pub capabilities: ::prost::alloc::vec::Vec<ControllerServiceCapability>,
1231}
1232#[allow(clippy::derive_partial_eq_without_eq)]
1234#[derive(Clone, PartialEq, ::prost::Message)]
1235pub struct ControllerServiceCapability {
1236 #[prost(oneof = "controller_service_capability::Type", tags = "1")]
1237 pub r#type: ::core::option::Option<controller_service_capability::Type>,
1238}
1239pub mod controller_service_capability {
1241 #[allow(clippy::derive_partial_eq_without_eq)]
1242 #[derive(Clone, PartialEq, ::prost::Message)]
1243 pub struct Rpc {
1244 #[prost(enumeration = "rpc::Type", tag = "1")]
1245 pub r#type: i32,
1246 }
1247 pub mod rpc {
1249 #[derive(
1250 Clone,
1251 Copy,
1252 Debug,
1253 PartialEq,
1254 Eq,
1255 Hash,
1256 PartialOrd,
1257 Ord,
1258 ::prost::Enumeration
1259 )]
1260 #[repr(i32)]
1261 pub enum Type {
1262 Unknown = 0,
1263 CreateDeleteVolume = 1,
1264 PublishUnpublishVolume = 2,
1265 ListVolumes = 3,
1266 GetCapacity = 4,
1267 CreateDeleteSnapshot = 5,
1272 ListSnapshots = 6,
1273 CloneVolume = 7,
1278 PublishReadonly = 8,
1281 ExpandVolume = 9,
1283 ListVolumesPublishedNodes = 10,
1288 VolumeCondition = 11,
1300 GetVolume = 12,
1304 SingleNodeMultiWriter = 13,
1313 ModifyVolume = 14,
1316 }
1317 impl Type {
1318 pub fn as_str_name(&self) -> &'static str {
1323 match self {
1324 Type::Unknown => "UNKNOWN",
1325 Type::CreateDeleteVolume => "CREATE_DELETE_VOLUME",
1326 Type::PublishUnpublishVolume => "PUBLISH_UNPUBLISH_VOLUME",
1327 Type::ListVolumes => "LIST_VOLUMES",
1328 Type::GetCapacity => "GET_CAPACITY",
1329 Type::CreateDeleteSnapshot => "CREATE_DELETE_SNAPSHOT",
1330 Type::ListSnapshots => "LIST_SNAPSHOTS",
1331 Type::CloneVolume => "CLONE_VOLUME",
1332 Type::PublishReadonly => "PUBLISH_READONLY",
1333 Type::ExpandVolume => "EXPAND_VOLUME",
1334 Type::ListVolumesPublishedNodes => "LIST_VOLUMES_PUBLISHED_NODES",
1335 Type::VolumeCondition => "VOLUME_CONDITION",
1336 Type::GetVolume => "GET_VOLUME",
1337 Type::SingleNodeMultiWriter => "SINGLE_NODE_MULTI_WRITER",
1338 Type::ModifyVolume => "MODIFY_VOLUME",
1339 }
1340 }
1341 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1343 match value {
1344 "UNKNOWN" => Some(Self::Unknown),
1345 "CREATE_DELETE_VOLUME" => Some(Self::CreateDeleteVolume),
1346 "PUBLISH_UNPUBLISH_VOLUME" => Some(Self::PublishUnpublishVolume),
1347 "LIST_VOLUMES" => Some(Self::ListVolumes),
1348 "GET_CAPACITY" => Some(Self::GetCapacity),
1349 "CREATE_DELETE_SNAPSHOT" => Some(Self::CreateDeleteSnapshot),
1350 "LIST_SNAPSHOTS" => Some(Self::ListSnapshots),
1351 "CLONE_VOLUME" => Some(Self::CloneVolume),
1352 "PUBLISH_READONLY" => Some(Self::PublishReadonly),
1353 "EXPAND_VOLUME" => Some(Self::ExpandVolume),
1354 "LIST_VOLUMES_PUBLISHED_NODES" => {
1355 Some(Self::ListVolumesPublishedNodes)
1356 }
1357 "VOLUME_CONDITION" => Some(Self::VolumeCondition),
1358 "GET_VOLUME" => Some(Self::GetVolume),
1359 "SINGLE_NODE_MULTI_WRITER" => Some(Self::SingleNodeMultiWriter),
1360 "MODIFY_VOLUME" => Some(Self::ModifyVolume),
1361 _ => None,
1362 }
1363 }
1364 }
1365 }
1366 #[allow(clippy::derive_partial_eq_without_eq)]
1367 #[derive(Clone, PartialEq, ::prost::Oneof)]
1368 pub enum Type {
1369 #[prost(message, tag = "1")]
1371 Rpc(Rpc),
1372 }
1373}
1374#[allow(clippy::derive_partial_eq_without_eq)]
1375#[derive(Clone, PartialEq, ::prost::Message)]
1376pub struct CreateSnapshotRequest {
1377 #[prost(string, tag = "1")]
1380 pub source_volume_id: ::prost::alloc::string::String,
1381 #[prost(string, tag = "2")]
1388 pub name: ::prost::alloc::string::String,
1389 #[prost(map = "string, string", tag = "3")]
1393 pub secrets: ::std::collections::HashMap<
1394 ::prost::alloc::string::String,
1395 ::prost::alloc::string::String,
1396 >,
1397 #[prost(map = "string, string", tag = "4")]
1408 pub parameters: ::std::collections::HashMap<
1409 ::prost::alloc::string::String,
1410 ::prost::alloc::string::String,
1411 >,
1412}
1413#[allow(clippy::derive_partial_eq_without_eq)]
1414#[derive(Clone, PartialEq, ::prost::Message)]
1415pub struct CreateSnapshotResponse {
1416 #[prost(message, optional, tag = "1")]
1420 pub snapshot: ::core::option::Option<Snapshot>,
1421}
1422#[allow(clippy::derive_partial_eq_without_eq)]
1424#[derive(Clone, PartialEq, ::prost::Message)]
1425pub struct Snapshot {
1426 #[prost(int64, tag = "1")]
1434 pub size_bytes: i64,
1435 #[prost(string, tag = "2")]
1445 pub snapshot_id: ::prost::alloc::string::String,
1446 #[prost(string, tag = "3")]
1450 pub source_volume_id: ::prost::alloc::string::String,
1451 #[prost(message, optional, tag = "4")]
1454 pub creation_time: ::core::option::Option<::prost_types::Timestamp>,
1455 #[prost(bool, tag = "5")]
1459 pub ready_to_use: bool,
1460 #[prost(string, tag = "6")]
1474 pub group_snapshot_id: ::prost::alloc::string::String,
1475}
1476#[allow(clippy::derive_partial_eq_without_eq)]
1477#[derive(Clone, PartialEq, ::prost::Message)]
1478pub struct DeleteSnapshotRequest {
1479 #[prost(string, tag = "1")]
1482 pub snapshot_id: ::prost::alloc::string::String,
1483 #[prost(map = "string, string", tag = "2")]
1487 pub secrets: ::std::collections::HashMap<
1488 ::prost::alloc::string::String,
1489 ::prost::alloc::string::String,
1490 >,
1491}
1492#[allow(clippy::derive_partial_eq_without_eq)]
1493#[derive(Clone, PartialEq, ::prost::Message)]
1494pub struct DeleteSnapshotResponse {}
1495#[allow(clippy::derive_partial_eq_without_eq)]
1498#[derive(Clone, PartialEq, ::prost::Message)]
1499pub struct ListSnapshotsRequest {
1500 #[prost(int32, tag = "1")]
1509 pub max_entries: i32,
1510 #[prost(string, tag = "2")]
1515 pub starting_token: ::prost::alloc::string::String,
1516 #[prost(string, tag = "3")]
1519 pub source_volume_id: ::prost::alloc::string::String,
1520 #[prost(string, tag = "4")]
1526 pub snapshot_id: ::prost::alloc::string::String,
1527 #[prost(map = "string, string", tag = "5")]
1531 pub secrets: ::std::collections::HashMap<
1532 ::prost::alloc::string::String,
1533 ::prost::alloc::string::String,
1534 >,
1535}
1536#[allow(clippy::derive_partial_eq_without_eq)]
1537#[derive(Clone, PartialEq, ::prost::Message)]
1538pub struct ListSnapshotsResponse {
1539 #[prost(message, repeated, tag = "1")]
1540 pub entries: ::prost::alloc::vec::Vec<list_snapshots_response::Entry>,
1541 #[prost(string, tag = "2")]
1548 pub next_token: ::prost::alloc::string::String,
1549}
1550pub mod list_snapshots_response {
1552 #[allow(clippy::derive_partial_eq_without_eq)]
1553 #[derive(Clone, PartialEq, ::prost::Message)]
1554 pub struct Entry {
1555 #[prost(message, optional, tag = "1")]
1556 pub snapshot: ::core::option::Option<super::Snapshot>,
1557 }
1558}
1559#[allow(clippy::derive_partial_eq_without_eq)]
1560#[derive(Clone, PartialEq, ::prost::Message)]
1561pub struct ControllerExpandVolumeRequest {
1562 #[prost(string, tag = "1")]
1564 pub volume_id: ::prost::alloc::string::String,
1565 #[prost(message, optional, tag = "2")]
1568 pub capacity_range: ::core::option::Option<CapacityRange>,
1569 #[prost(map = "string, string", tag = "3")]
1572 pub secrets: ::std::collections::HashMap<
1573 ::prost::alloc::string::String,
1574 ::prost::alloc::string::String,
1575 >,
1576 #[prost(message, optional, tag = "4")]
1584 pub volume_capability: ::core::option::Option<VolumeCapability>,
1585}
1586#[allow(clippy::derive_partial_eq_without_eq)]
1587#[derive(Clone, PartialEq, ::prost::Message)]
1588pub struct ControllerExpandVolumeResponse {
1589 #[prost(int64, tag = "1")]
1591 pub capacity_bytes: i64,
1592 #[prost(bool, tag = "2")]
1596 pub node_expansion_required: bool,
1597}
1598#[allow(clippy::derive_partial_eq_without_eq)]
1599#[derive(Clone, PartialEq, ::prost::Message)]
1600pub struct NodeStageVolumeRequest {
1601 #[prost(string, tag = "1")]
1603 pub volume_id: ::prost::alloc::string::String,
1604 #[prost(map = "string, string", tag = "2")]
1610 pub publish_context: ::std::collections::HashMap<
1611 ::prost::alloc::string::String,
1612 ::prost::alloc::string::String,
1613 >,
1614 #[prost(string, tag = "3")]
1628 pub staging_target_path: ::prost::alloc::string::String,
1629 #[prost(message, optional, tag = "4")]
1634 pub volume_capability: ::core::option::Option<VolumeCapability>,
1635 #[prost(map = "string, string", tag = "5")]
1639 pub secrets: ::std::collections::HashMap<
1640 ::prost::alloc::string::String,
1641 ::prost::alloc::string::String,
1642 >,
1643 #[prost(map = "string, string", tag = "6")]
1648 pub volume_context: ::std::collections::HashMap<
1649 ::prost::alloc::string::String,
1650 ::prost::alloc::string::String,
1651 >,
1652}
1653#[allow(clippy::derive_partial_eq_without_eq)]
1655#[derive(Clone, PartialEq, ::prost::Message)]
1656pub struct NodeStageVolumeResponse {}
1657#[allow(clippy::derive_partial_eq_without_eq)]
1658#[derive(Clone, PartialEq, ::prost::Message)]
1659pub struct NodeUnstageVolumeRequest {
1660 #[prost(string, tag = "1")]
1662 pub volume_id: ::prost::alloc::string::String,
1663 #[prost(string, tag = "2")]
1671 pub staging_target_path: ::prost::alloc::string::String,
1672}
1673#[allow(clippy::derive_partial_eq_without_eq)]
1675#[derive(Clone, PartialEq, ::prost::Message)]
1676pub struct NodeUnstageVolumeResponse {}
1677#[allow(clippy::derive_partial_eq_without_eq)]
1678#[derive(Clone, PartialEq, ::prost::Message)]
1679pub struct NodePublishVolumeRequest {
1680 #[prost(string, tag = "1")]
1682 pub volume_id: ::prost::alloc::string::String,
1683 #[prost(map = "string, string", tag = "2")]
1689 pub publish_context: ::std::collections::HashMap<
1690 ::prost::alloc::string::String,
1691 ::prost::alloc::string::String,
1692 >,
1693 #[prost(string, tag = "3")]
1704 pub staging_target_path: ::prost::alloc::string::String,
1705 #[prost(string, tag = "4")]
1722 pub target_path: ::prost::alloc::string::String,
1723 #[prost(message, optional, tag = "5")]
1728 pub volume_capability: ::core::option::Option<VolumeCapability>,
1729 #[prost(bool, tag = "6")]
1732 pub readonly: bool,
1733 #[prost(map = "string, string", tag = "7")]
1737 pub secrets: ::std::collections::HashMap<
1738 ::prost::alloc::string::String,
1739 ::prost::alloc::string::String,
1740 >,
1741 #[prost(map = "string, string", tag = "8")]
1746 pub volume_context: ::std::collections::HashMap<
1747 ::prost::alloc::string::String,
1748 ::prost::alloc::string::String,
1749 >,
1750}
1751#[allow(clippy::derive_partial_eq_without_eq)]
1753#[derive(Clone, PartialEq, ::prost::Message)]
1754pub struct NodePublishVolumeResponse {}
1755#[allow(clippy::derive_partial_eq_without_eq)]
1756#[derive(Clone, PartialEq, ::prost::Message)]
1757pub struct NodeUnpublishVolumeRequest {
1758 #[prost(string, tag = "1")]
1760 pub volume_id: ::prost::alloc::string::String,
1761 #[prost(string, tag = "2")]
1770 pub target_path: ::prost::alloc::string::String,
1771}
1772#[allow(clippy::derive_partial_eq_without_eq)]
1774#[derive(Clone, PartialEq, ::prost::Message)]
1775pub struct NodeUnpublishVolumeResponse {}
1776#[allow(clippy::derive_partial_eq_without_eq)]
1777#[derive(Clone, PartialEq, ::prost::Message)]
1778pub struct NodeGetVolumeStatsRequest {
1779 #[prost(string, tag = "1")]
1781 pub volume_id: ::prost::alloc::string::String,
1782 #[prost(string, tag = "2")]
1792 pub volume_path: ::prost::alloc::string::String,
1793 #[prost(string, tag = "3")]
1803 pub staging_target_path: ::prost::alloc::string::String,
1804}
1805#[allow(clippy::derive_partial_eq_without_eq)]
1806#[derive(Clone, PartialEq, ::prost::Message)]
1807pub struct NodeGetVolumeStatsResponse {
1808 #[prost(message, repeated, tag = "1")]
1810 pub usage: ::prost::alloc::vec::Vec<VolumeUsage>,
1811 #[prost(message, optional, tag = "2")]
1816 pub volume_condition: ::core::option::Option<VolumeCondition>,
1817}
1818#[allow(clippy::derive_partial_eq_without_eq)]
1819#[derive(Clone, PartialEq, ::prost::Message)]
1820pub struct VolumeUsage {
1821 #[prost(int64, tag = "1")]
1824 pub available: i64,
1825 #[prost(int64, tag = "2")]
1828 pub total: i64,
1829 #[prost(int64, tag = "3")]
1832 pub used: i64,
1833 #[prost(enumeration = "volume_usage::Unit", tag = "4")]
1835 pub unit: i32,
1836}
1837pub mod volume_usage {
1839 #[derive(
1840 Clone,
1841 Copy,
1842 Debug,
1843 PartialEq,
1844 Eq,
1845 Hash,
1846 PartialOrd,
1847 Ord,
1848 ::prost::Enumeration
1849 )]
1850 #[repr(i32)]
1851 pub enum Unit {
1852 Unknown = 0,
1853 Bytes = 1,
1854 Inodes = 2,
1855 }
1856 impl Unit {
1857 pub fn as_str_name(&self) -> &'static str {
1862 match self {
1863 Unit::Unknown => "UNKNOWN",
1864 Unit::Bytes => "BYTES",
1865 Unit::Inodes => "INODES",
1866 }
1867 }
1868 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1870 match value {
1871 "UNKNOWN" => Some(Self::Unknown),
1872 "BYTES" => Some(Self::Bytes),
1873 "INODES" => Some(Self::Inodes),
1874 _ => None,
1875 }
1876 }
1877 }
1878}
1879#[allow(clippy::derive_partial_eq_without_eq)]
1881#[derive(Clone, PartialEq, ::prost::Message)]
1882pub struct VolumeCondition {
1883 #[prost(bool, tag = "1")]
1887 pub abnormal: bool,
1888 #[prost(string, tag = "2")]
1891 pub message: ::prost::alloc::string::String,
1892}
1893#[allow(clippy::derive_partial_eq_without_eq)]
1895#[derive(Clone, PartialEq, ::prost::Message)]
1896pub struct NodeGetCapabilitiesRequest {}
1897#[allow(clippy::derive_partial_eq_without_eq)]
1898#[derive(Clone, PartialEq, ::prost::Message)]
1899pub struct NodeGetCapabilitiesResponse {
1900 #[prost(message, repeated, tag = "1")]
1903 pub capabilities: ::prost::alloc::vec::Vec<NodeServiceCapability>,
1904}
1905#[allow(clippy::derive_partial_eq_without_eq)]
1907#[derive(Clone, PartialEq, ::prost::Message)]
1908pub struct NodeServiceCapability {
1909 #[prost(oneof = "node_service_capability::Type", tags = "1")]
1910 pub r#type: ::core::option::Option<node_service_capability::Type>,
1911}
1912pub mod node_service_capability {
1914 #[allow(clippy::derive_partial_eq_without_eq)]
1915 #[derive(Clone, PartialEq, ::prost::Message)]
1916 pub struct Rpc {
1917 #[prost(enumeration = "rpc::Type", tag = "1")]
1918 pub r#type: i32,
1919 }
1920 pub mod rpc {
1922 #[derive(
1923 Clone,
1924 Copy,
1925 Debug,
1926 PartialEq,
1927 Eq,
1928 Hash,
1929 PartialOrd,
1930 Ord,
1931 ::prost::Enumeration
1932 )]
1933 #[repr(i32)]
1934 pub enum Type {
1935 Unknown = 0,
1936 StageUnstageVolume = 1,
1937 GetVolumeStats = 2,
1941 ExpandVolume = 3,
1943 VolumeCondition = 4,
1955 SingleNodeMultiWriter = 5,
1965 VolumeMountGroup = 6,
1969 }
1970 impl Type {
1971 pub fn as_str_name(&self) -> &'static str {
1976 match self {
1977 Type::Unknown => "UNKNOWN",
1978 Type::StageUnstageVolume => "STAGE_UNSTAGE_VOLUME",
1979 Type::GetVolumeStats => "GET_VOLUME_STATS",
1980 Type::ExpandVolume => "EXPAND_VOLUME",
1981 Type::VolumeCondition => "VOLUME_CONDITION",
1982 Type::SingleNodeMultiWriter => "SINGLE_NODE_MULTI_WRITER",
1983 Type::VolumeMountGroup => "VOLUME_MOUNT_GROUP",
1984 }
1985 }
1986 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1988 match value {
1989 "UNKNOWN" => Some(Self::Unknown),
1990 "STAGE_UNSTAGE_VOLUME" => Some(Self::StageUnstageVolume),
1991 "GET_VOLUME_STATS" => Some(Self::GetVolumeStats),
1992 "EXPAND_VOLUME" => Some(Self::ExpandVolume),
1993 "VOLUME_CONDITION" => Some(Self::VolumeCondition),
1994 "SINGLE_NODE_MULTI_WRITER" => Some(Self::SingleNodeMultiWriter),
1995 "VOLUME_MOUNT_GROUP" => Some(Self::VolumeMountGroup),
1996 _ => None,
1997 }
1998 }
1999 }
2000 }
2001 #[allow(clippy::derive_partial_eq_without_eq)]
2002 #[derive(Clone, PartialEq, ::prost::Oneof)]
2003 pub enum Type {
2004 #[prost(message, tag = "1")]
2006 Rpc(Rpc),
2007 }
2008}
2009#[allow(clippy::derive_partial_eq_without_eq)]
2010#[derive(Clone, PartialEq, ::prost::Message)]
2011pub struct NodeGetInfoRequest {}
2012#[allow(clippy::derive_partial_eq_without_eq)]
2013#[derive(Clone, PartialEq, ::prost::Message)]
2014pub struct NodeGetInfoResponse {
2015 #[prost(string, tag = "1")]
2028 pub node_id: ::prost::alloc::string::String,
2029 #[prost(int64, tag = "2")]
2035 pub max_volumes_per_node: i64,
2036 #[prost(message, optional, tag = "3")]
2054 pub accessible_topology: ::core::option::Option<Topology>,
2055}
2056#[allow(clippy::derive_partial_eq_without_eq)]
2057#[derive(Clone, PartialEq, ::prost::Message)]
2058pub struct NodeExpandVolumeRequest {
2059 #[prost(string, tag = "1")]
2061 pub volume_id: ::prost::alloc::string::String,
2062 #[prost(string, tag = "2")]
2068 pub volume_path: ::prost::alloc::string::String,
2069 #[prost(message, optional, tag = "3")]
2076 pub capacity_range: ::core::option::Option<CapacityRange>,
2077 #[prost(string, tag = "4")]
2087 pub staging_target_path: ::prost::alloc::string::String,
2088 #[prost(message, optional, tag = "5")]
2098 pub volume_capability: ::core::option::Option<VolumeCapability>,
2099 #[prost(map = "string, string", tag = "6")]
2103 pub secrets: ::std::collections::HashMap<
2104 ::prost::alloc::string::String,
2105 ::prost::alloc::string::String,
2106 >,
2107}
2108#[allow(clippy::derive_partial_eq_without_eq)]
2109#[derive(Clone, PartialEq, ::prost::Message)]
2110pub struct NodeExpandVolumeResponse {
2111 #[prost(int64, tag = "1")]
2113 pub capacity_bytes: i64,
2114}
2115#[allow(clippy::derive_partial_eq_without_eq)]
2116#[derive(Clone, PartialEq, ::prost::Message)]
2117pub struct GroupControllerGetCapabilitiesRequest {}
2118#[allow(clippy::derive_partial_eq_without_eq)]
2119#[derive(Clone, PartialEq, ::prost::Message)]
2120pub struct GroupControllerGetCapabilitiesResponse {
2121 #[prost(message, repeated, tag = "1")]
2124 pub capabilities: ::prost::alloc::vec::Vec<GroupControllerServiceCapability>,
2125}
2126#[allow(clippy::derive_partial_eq_without_eq)]
2128#[derive(Clone, PartialEq, ::prost::Message)]
2129pub struct GroupControllerServiceCapability {
2130 #[prost(oneof = "group_controller_service_capability::Type", tags = "1")]
2131 pub r#type: ::core::option::Option<group_controller_service_capability::Type>,
2132}
2133pub mod group_controller_service_capability {
2135 #[allow(clippy::derive_partial_eq_without_eq)]
2136 #[derive(Clone, PartialEq, ::prost::Message)]
2137 pub struct Rpc {
2138 #[prost(enumeration = "rpc::Type", tag = "1")]
2139 pub r#type: i32,
2140 }
2141 pub mod rpc {
2143 #[derive(
2144 Clone,
2145 Copy,
2146 Debug,
2147 PartialEq,
2148 Eq,
2149 Hash,
2150 PartialOrd,
2151 Ord,
2152 ::prost::Enumeration
2153 )]
2154 #[repr(i32)]
2155 pub enum Type {
2156 Unknown = 0,
2157 CreateDeleteGetVolumeGroupSnapshot = 1,
2161 }
2162 impl Type {
2163 pub fn as_str_name(&self) -> &'static str {
2168 match self {
2169 Type::Unknown => "UNKNOWN",
2170 Type::CreateDeleteGetVolumeGroupSnapshot => {
2171 "CREATE_DELETE_GET_VOLUME_GROUP_SNAPSHOT"
2172 }
2173 }
2174 }
2175 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2177 match value {
2178 "UNKNOWN" => Some(Self::Unknown),
2179 "CREATE_DELETE_GET_VOLUME_GROUP_SNAPSHOT" => {
2180 Some(Self::CreateDeleteGetVolumeGroupSnapshot)
2181 }
2182 _ => None,
2183 }
2184 }
2185 }
2186 }
2187 #[allow(clippy::derive_partial_eq_without_eq)]
2188 #[derive(Clone, PartialEq, ::prost::Oneof)]
2189 pub enum Type {
2190 #[prost(message, tag = "1")]
2192 Rpc(Rpc),
2193 }
2194}
2195#[allow(clippy::derive_partial_eq_without_eq)]
2196#[derive(Clone, PartialEq, ::prost::Message)]
2197pub struct CreateVolumeGroupSnapshotRequest {
2198 #[prost(string, tag = "1")]
2205 pub name: ::prost::alloc::string::String,
2206 #[prost(string, repeated, tag = "2")]
2209 pub source_volume_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2210 #[prost(map = "string, string", tag = "3")]
2217 pub secrets: ::std::collections::HashMap<
2218 ::prost::alloc::string::String,
2219 ::prost::alloc::string::String,
2220 >,
2221 #[prost(map = "string, string", tag = "4")]
2225 pub parameters: ::std::collections::HashMap<
2226 ::prost::alloc::string::String,
2227 ::prost::alloc::string::String,
2228 >,
2229}
2230#[allow(clippy::derive_partial_eq_without_eq)]
2231#[derive(Clone, PartialEq, ::prost::Message)]
2232pub struct CreateVolumeGroupSnapshotResponse {
2233 #[prost(message, optional, tag = "1")]
2236 pub group_snapshot: ::core::option::Option<VolumeGroupSnapshot>,
2237}
2238#[allow(clippy::derive_partial_eq_without_eq)]
2239#[derive(Clone, PartialEq, ::prost::Message)]
2240pub struct VolumeGroupSnapshot {
2241 #[prost(string, tag = "1")]
2251 pub group_snapshot_id: ::prost::alloc::string::String,
2252 #[prost(message, repeated, tag = "2")]
2255 pub snapshots: ::prost::alloc::vec::Vec<Snapshot>,
2256 #[prost(message, optional, tag = "3")]
2259 pub creation_time: ::core::option::Option<::prost_types::Timestamp>,
2260 #[prost(bool, tag = "4")]
2270 pub ready_to_use: bool,
2271}
2272#[allow(clippy::derive_partial_eq_without_eq)]
2273#[derive(Clone, PartialEq, ::prost::Message)]
2274pub struct DeleteVolumeGroupSnapshotRequest {
2275 #[prost(string, tag = "1")]
2278 pub group_snapshot_id: ::prost::alloc::string::String,
2279 #[prost(string, repeated, tag = "2")]
2289 pub snapshot_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2290 #[prost(map = "string, string", tag = "3")]
2297 pub secrets: ::std::collections::HashMap<
2298 ::prost::alloc::string::String,
2299 ::prost::alloc::string::String,
2300 >,
2301}
2302#[allow(clippy::derive_partial_eq_without_eq)]
2303#[derive(Clone, PartialEq, ::prost::Message)]
2304pub struct DeleteVolumeGroupSnapshotResponse {}
2305#[allow(clippy::derive_partial_eq_without_eq)]
2306#[derive(Clone, PartialEq, ::prost::Message)]
2307pub struct GetVolumeGroupSnapshotRequest {
2308 #[prost(string, tag = "1")]
2312 pub group_snapshot_id: ::prost::alloc::string::String,
2313 #[prost(string, repeated, tag = "2")]
2323 pub snapshot_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2324 #[prost(map = "string, string", tag = "3")]
2331 pub secrets: ::std::collections::HashMap<
2332 ::prost::alloc::string::String,
2333 ::prost::alloc::string::String,
2334 >,
2335}
2336#[allow(clippy::derive_partial_eq_without_eq)]
2337#[derive(Clone, PartialEq, ::prost::Message)]
2338pub struct GetVolumeGroupSnapshotResponse {
2339 #[prost(message, optional, tag = "1")]
2341 pub group_snapshot: ::core::option::Option<VolumeGroupSnapshot>,
2342}
2343pub mod identity_client {
2345 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
2346 use tonic::codegen::*;
2347 use tonic::codegen::http::Uri;
2348 #[derive(Debug, Clone)]
2349 pub struct IdentityClient<T> {
2350 inner: tonic::client::Grpc<T>,
2351 }
2352 impl<T> IdentityClient<T>
2353 where
2354 T: tonic::client::GrpcService<tonic::body::BoxBody>,
2355 T::Error: Into<StdError>,
2356 T::ResponseBody: Body<Data = Bytes> + Send + 'static,
2357 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
2358 {
2359 pub fn new(inner: T) -> Self {
2360 let inner = tonic::client::Grpc::new(inner);
2361 Self { inner }
2362 }
2363 pub fn with_origin(inner: T, origin: Uri) -> Self {
2364 let inner = tonic::client::Grpc::with_origin(inner, origin);
2365 Self { inner }
2366 }
2367 pub fn with_interceptor<F>(
2368 inner: T,
2369 interceptor: F,
2370 ) -> IdentityClient<InterceptedService<T, F>>
2371 where
2372 F: tonic::service::Interceptor,
2373 T::ResponseBody: Default,
2374 T: tonic::codegen::Service<
2375 http::Request<tonic::body::BoxBody>,
2376 Response = http::Response<
2377 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
2378 >,
2379 >,
2380 <T as tonic::codegen::Service<
2381 http::Request<tonic::body::BoxBody>,
2382 >>::Error: Into<StdError> + Send + Sync,
2383 {
2384 IdentityClient::new(InterceptedService::new(inner, interceptor))
2385 }
2386 #[must_use]
2391 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2392 self.inner = self.inner.send_compressed(encoding);
2393 self
2394 }
2395 #[must_use]
2397 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2398 self.inner = self.inner.accept_compressed(encoding);
2399 self
2400 }
2401 #[must_use]
2405 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2406 self.inner = self.inner.max_decoding_message_size(limit);
2407 self
2408 }
2409 #[must_use]
2413 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2414 self.inner = self.inner.max_encoding_message_size(limit);
2415 self
2416 }
2417 pub async fn get_plugin_info(
2418 &mut self,
2419 request: impl tonic::IntoRequest<super::GetPluginInfoRequest>,
2420 ) -> std::result::Result<
2421 tonic::Response<super::GetPluginInfoResponse>,
2422 tonic::Status,
2423 > {
2424 self.inner
2425 .ready()
2426 .await
2427 .map_err(|e| {
2428 tonic::Status::new(
2429 tonic::Code::Unknown,
2430 format!("Service was not ready: {}", e.into()),
2431 )
2432 })?;
2433 let codec = tonic::codec::ProstCodec::default();
2434 let path = http::uri::PathAndQuery::from_static(
2435 "/csi.v1.Identity/GetPluginInfo",
2436 );
2437 let mut req = request.into_request();
2438 req.extensions_mut()
2439 .insert(GrpcMethod::new("csi.v1.Identity", "GetPluginInfo"));
2440 self.inner.unary(req, path, codec).await
2441 }
2442 pub async fn get_plugin_capabilities(
2443 &mut self,
2444 request: impl tonic::IntoRequest<super::GetPluginCapabilitiesRequest>,
2445 ) -> std::result::Result<
2446 tonic::Response<super::GetPluginCapabilitiesResponse>,
2447 tonic::Status,
2448 > {
2449 self.inner
2450 .ready()
2451 .await
2452 .map_err(|e| {
2453 tonic::Status::new(
2454 tonic::Code::Unknown,
2455 format!("Service was not ready: {}", e.into()),
2456 )
2457 })?;
2458 let codec = tonic::codec::ProstCodec::default();
2459 let path = http::uri::PathAndQuery::from_static(
2460 "/csi.v1.Identity/GetPluginCapabilities",
2461 );
2462 let mut req = request.into_request();
2463 req.extensions_mut()
2464 .insert(GrpcMethod::new("csi.v1.Identity", "GetPluginCapabilities"));
2465 self.inner.unary(req, path, codec).await
2466 }
2467 pub async fn probe(
2468 &mut self,
2469 request: impl tonic::IntoRequest<super::ProbeRequest>,
2470 ) -> std::result::Result<tonic::Response<super::ProbeResponse>, tonic::Status> {
2471 self.inner
2472 .ready()
2473 .await
2474 .map_err(|e| {
2475 tonic::Status::new(
2476 tonic::Code::Unknown,
2477 format!("Service was not ready: {}", e.into()),
2478 )
2479 })?;
2480 let codec = tonic::codec::ProstCodec::default();
2481 let path = http::uri::PathAndQuery::from_static("/csi.v1.Identity/Probe");
2482 let mut req = request.into_request();
2483 req.extensions_mut().insert(GrpcMethod::new("csi.v1.Identity", "Probe"));
2484 self.inner.unary(req, path, codec).await
2485 }
2486 }
2487}
2488pub mod controller_client {
2490 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
2491 use tonic::codegen::*;
2492 use tonic::codegen::http::Uri;
2493 #[derive(Debug, Clone)]
2494 pub struct ControllerClient<T> {
2495 inner: tonic::client::Grpc<T>,
2496 }
2497 impl<T> ControllerClient<T>
2498 where
2499 T: tonic::client::GrpcService<tonic::body::BoxBody>,
2500 T::Error: Into<StdError>,
2501 T::ResponseBody: Body<Data = Bytes> + Send + 'static,
2502 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
2503 {
2504 pub fn new(inner: T) -> Self {
2505 let inner = tonic::client::Grpc::new(inner);
2506 Self { inner }
2507 }
2508 pub fn with_origin(inner: T, origin: Uri) -> Self {
2509 let inner = tonic::client::Grpc::with_origin(inner, origin);
2510 Self { inner }
2511 }
2512 pub fn with_interceptor<F>(
2513 inner: T,
2514 interceptor: F,
2515 ) -> ControllerClient<InterceptedService<T, F>>
2516 where
2517 F: tonic::service::Interceptor,
2518 T::ResponseBody: Default,
2519 T: tonic::codegen::Service<
2520 http::Request<tonic::body::BoxBody>,
2521 Response = http::Response<
2522 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
2523 >,
2524 >,
2525 <T as tonic::codegen::Service<
2526 http::Request<tonic::body::BoxBody>,
2527 >>::Error: Into<StdError> + Send + Sync,
2528 {
2529 ControllerClient::new(InterceptedService::new(inner, interceptor))
2530 }
2531 #[must_use]
2536 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2537 self.inner = self.inner.send_compressed(encoding);
2538 self
2539 }
2540 #[must_use]
2542 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2543 self.inner = self.inner.accept_compressed(encoding);
2544 self
2545 }
2546 #[must_use]
2550 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2551 self.inner = self.inner.max_decoding_message_size(limit);
2552 self
2553 }
2554 #[must_use]
2558 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2559 self.inner = self.inner.max_encoding_message_size(limit);
2560 self
2561 }
2562 pub async fn create_volume(
2563 &mut self,
2564 request: impl tonic::IntoRequest<super::CreateVolumeRequest>,
2565 ) -> std::result::Result<
2566 tonic::Response<super::CreateVolumeResponse>,
2567 tonic::Status,
2568 > {
2569 self.inner
2570 .ready()
2571 .await
2572 .map_err(|e| {
2573 tonic::Status::new(
2574 tonic::Code::Unknown,
2575 format!("Service was not ready: {}", e.into()),
2576 )
2577 })?;
2578 let codec = tonic::codec::ProstCodec::default();
2579 let path = http::uri::PathAndQuery::from_static(
2580 "/csi.v1.Controller/CreateVolume",
2581 );
2582 let mut req = request.into_request();
2583 req.extensions_mut()
2584 .insert(GrpcMethod::new("csi.v1.Controller", "CreateVolume"));
2585 self.inner.unary(req, path, codec).await
2586 }
2587 pub async fn delete_volume(
2588 &mut self,
2589 request: impl tonic::IntoRequest<super::DeleteVolumeRequest>,
2590 ) -> std::result::Result<
2591 tonic::Response<super::DeleteVolumeResponse>,
2592 tonic::Status,
2593 > {
2594 self.inner
2595 .ready()
2596 .await
2597 .map_err(|e| {
2598 tonic::Status::new(
2599 tonic::Code::Unknown,
2600 format!("Service was not ready: {}", e.into()),
2601 )
2602 })?;
2603 let codec = tonic::codec::ProstCodec::default();
2604 let path = http::uri::PathAndQuery::from_static(
2605 "/csi.v1.Controller/DeleteVolume",
2606 );
2607 let mut req = request.into_request();
2608 req.extensions_mut()
2609 .insert(GrpcMethod::new("csi.v1.Controller", "DeleteVolume"));
2610 self.inner.unary(req, path, codec).await
2611 }
2612 pub async fn controller_publish_volume(
2613 &mut self,
2614 request: impl tonic::IntoRequest<super::ControllerPublishVolumeRequest>,
2615 ) -> std::result::Result<
2616 tonic::Response<super::ControllerPublishVolumeResponse>,
2617 tonic::Status,
2618 > {
2619 self.inner
2620 .ready()
2621 .await
2622 .map_err(|e| {
2623 tonic::Status::new(
2624 tonic::Code::Unknown,
2625 format!("Service was not ready: {}", e.into()),
2626 )
2627 })?;
2628 let codec = tonic::codec::ProstCodec::default();
2629 let path = http::uri::PathAndQuery::from_static(
2630 "/csi.v1.Controller/ControllerPublishVolume",
2631 );
2632 let mut req = request.into_request();
2633 req.extensions_mut()
2634 .insert(GrpcMethod::new("csi.v1.Controller", "ControllerPublishVolume"));
2635 self.inner.unary(req, path, codec).await
2636 }
2637 pub async fn controller_unpublish_volume(
2638 &mut self,
2639 request: impl tonic::IntoRequest<super::ControllerUnpublishVolumeRequest>,
2640 ) -> std::result::Result<
2641 tonic::Response<super::ControllerUnpublishVolumeResponse>,
2642 tonic::Status,
2643 > {
2644 self.inner
2645 .ready()
2646 .await
2647 .map_err(|e| {
2648 tonic::Status::new(
2649 tonic::Code::Unknown,
2650 format!("Service was not ready: {}", e.into()),
2651 )
2652 })?;
2653 let codec = tonic::codec::ProstCodec::default();
2654 let path = http::uri::PathAndQuery::from_static(
2655 "/csi.v1.Controller/ControllerUnpublishVolume",
2656 );
2657 let mut req = request.into_request();
2658 req.extensions_mut()
2659 .insert(
2660 GrpcMethod::new("csi.v1.Controller", "ControllerUnpublishVolume"),
2661 );
2662 self.inner.unary(req, path, codec).await
2663 }
2664 pub async fn validate_volume_capabilities(
2665 &mut self,
2666 request: impl tonic::IntoRequest<super::ValidateVolumeCapabilitiesRequest>,
2667 ) -> std::result::Result<
2668 tonic::Response<super::ValidateVolumeCapabilitiesResponse>,
2669 tonic::Status,
2670 > {
2671 self.inner
2672 .ready()
2673 .await
2674 .map_err(|e| {
2675 tonic::Status::new(
2676 tonic::Code::Unknown,
2677 format!("Service was not ready: {}", e.into()),
2678 )
2679 })?;
2680 let codec = tonic::codec::ProstCodec::default();
2681 let path = http::uri::PathAndQuery::from_static(
2682 "/csi.v1.Controller/ValidateVolumeCapabilities",
2683 );
2684 let mut req = request.into_request();
2685 req.extensions_mut()
2686 .insert(
2687 GrpcMethod::new("csi.v1.Controller", "ValidateVolumeCapabilities"),
2688 );
2689 self.inner.unary(req, path, codec).await
2690 }
2691 pub async fn list_volumes(
2692 &mut self,
2693 request: impl tonic::IntoRequest<super::ListVolumesRequest>,
2694 ) -> std::result::Result<
2695 tonic::Response<super::ListVolumesResponse>,
2696 tonic::Status,
2697 > {
2698 self.inner
2699 .ready()
2700 .await
2701 .map_err(|e| {
2702 tonic::Status::new(
2703 tonic::Code::Unknown,
2704 format!("Service was not ready: {}", e.into()),
2705 )
2706 })?;
2707 let codec = tonic::codec::ProstCodec::default();
2708 let path = http::uri::PathAndQuery::from_static(
2709 "/csi.v1.Controller/ListVolumes",
2710 );
2711 let mut req = request.into_request();
2712 req.extensions_mut()
2713 .insert(GrpcMethod::new("csi.v1.Controller", "ListVolumes"));
2714 self.inner.unary(req, path, codec).await
2715 }
2716 pub async fn get_capacity(
2717 &mut self,
2718 request: impl tonic::IntoRequest<super::GetCapacityRequest>,
2719 ) -> std::result::Result<
2720 tonic::Response<super::GetCapacityResponse>,
2721 tonic::Status,
2722 > {
2723 self.inner
2724 .ready()
2725 .await
2726 .map_err(|e| {
2727 tonic::Status::new(
2728 tonic::Code::Unknown,
2729 format!("Service was not ready: {}", e.into()),
2730 )
2731 })?;
2732 let codec = tonic::codec::ProstCodec::default();
2733 let path = http::uri::PathAndQuery::from_static(
2734 "/csi.v1.Controller/GetCapacity",
2735 );
2736 let mut req = request.into_request();
2737 req.extensions_mut()
2738 .insert(GrpcMethod::new("csi.v1.Controller", "GetCapacity"));
2739 self.inner.unary(req, path, codec).await
2740 }
2741 pub async fn controller_get_capabilities(
2742 &mut self,
2743 request: impl tonic::IntoRequest<super::ControllerGetCapabilitiesRequest>,
2744 ) -> std::result::Result<
2745 tonic::Response<super::ControllerGetCapabilitiesResponse>,
2746 tonic::Status,
2747 > {
2748 self.inner
2749 .ready()
2750 .await
2751 .map_err(|e| {
2752 tonic::Status::new(
2753 tonic::Code::Unknown,
2754 format!("Service was not ready: {}", e.into()),
2755 )
2756 })?;
2757 let codec = tonic::codec::ProstCodec::default();
2758 let path = http::uri::PathAndQuery::from_static(
2759 "/csi.v1.Controller/ControllerGetCapabilities",
2760 );
2761 let mut req = request.into_request();
2762 req.extensions_mut()
2763 .insert(
2764 GrpcMethod::new("csi.v1.Controller", "ControllerGetCapabilities"),
2765 );
2766 self.inner.unary(req, path, codec).await
2767 }
2768 pub async fn create_snapshot(
2769 &mut self,
2770 request: impl tonic::IntoRequest<super::CreateSnapshotRequest>,
2771 ) -> std::result::Result<
2772 tonic::Response<super::CreateSnapshotResponse>,
2773 tonic::Status,
2774 > {
2775 self.inner
2776 .ready()
2777 .await
2778 .map_err(|e| {
2779 tonic::Status::new(
2780 tonic::Code::Unknown,
2781 format!("Service was not ready: {}", e.into()),
2782 )
2783 })?;
2784 let codec = tonic::codec::ProstCodec::default();
2785 let path = http::uri::PathAndQuery::from_static(
2786 "/csi.v1.Controller/CreateSnapshot",
2787 );
2788 let mut req = request.into_request();
2789 req.extensions_mut()
2790 .insert(GrpcMethod::new("csi.v1.Controller", "CreateSnapshot"));
2791 self.inner.unary(req, path, codec).await
2792 }
2793 pub async fn delete_snapshot(
2794 &mut self,
2795 request: impl tonic::IntoRequest<super::DeleteSnapshotRequest>,
2796 ) -> std::result::Result<
2797 tonic::Response<super::DeleteSnapshotResponse>,
2798 tonic::Status,
2799 > {
2800 self.inner
2801 .ready()
2802 .await
2803 .map_err(|e| {
2804 tonic::Status::new(
2805 tonic::Code::Unknown,
2806 format!("Service was not ready: {}", e.into()),
2807 )
2808 })?;
2809 let codec = tonic::codec::ProstCodec::default();
2810 let path = http::uri::PathAndQuery::from_static(
2811 "/csi.v1.Controller/DeleteSnapshot",
2812 );
2813 let mut req = request.into_request();
2814 req.extensions_mut()
2815 .insert(GrpcMethod::new("csi.v1.Controller", "DeleteSnapshot"));
2816 self.inner.unary(req, path, codec).await
2817 }
2818 pub async fn list_snapshots(
2819 &mut self,
2820 request: impl tonic::IntoRequest<super::ListSnapshotsRequest>,
2821 ) -> std::result::Result<
2822 tonic::Response<super::ListSnapshotsResponse>,
2823 tonic::Status,
2824 > {
2825 self.inner
2826 .ready()
2827 .await
2828 .map_err(|e| {
2829 tonic::Status::new(
2830 tonic::Code::Unknown,
2831 format!("Service was not ready: {}", e.into()),
2832 )
2833 })?;
2834 let codec = tonic::codec::ProstCodec::default();
2835 let path = http::uri::PathAndQuery::from_static(
2836 "/csi.v1.Controller/ListSnapshots",
2837 );
2838 let mut req = request.into_request();
2839 req.extensions_mut()
2840 .insert(GrpcMethod::new("csi.v1.Controller", "ListSnapshots"));
2841 self.inner.unary(req, path, codec).await
2842 }
2843 pub async fn controller_expand_volume(
2844 &mut self,
2845 request: impl tonic::IntoRequest<super::ControllerExpandVolumeRequest>,
2846 ) -> std::result::Result<
2847 tonic::Response<super::ControllerExpandVolumeResponse>,
2848 tonic::Status,
2849 > {
2850 self.inner
2851 .ready()
2852 .await
2853 .map_err(|e| {
2854 tonic::Status::new(
2855 tonic::Code::Unknown,
2856 format!("Service was not ready: {}", e.into()),
2857 )
2858 })?;
2859 let codec = tonic::codec::ProstCodec::default();
2860 let path = http::uri::PathAndQuery::from_static(
2861 "/csi.v1.Controller/ControllerExpandVolume",
2862 );
2863 let mut req = request.into_request();
2864 req.extensions_mut()
2865 .insert(GrpcMethod::new("csi.v1.Controller", "ControllerExpandVolume"));
2866 self.inner.unary(req, path, codec).await
2867 }
2868 pub async fn controller_get_volume(
2869 &mut self,
2870 request: impl tonic::IntoRequest<super::ControllerGetVolumeRequest>,
2871 ) -> std::result::Result<
2872 tonic::Response<super::ControllerGetVolumeResponse>,
2873 tonic::Status,
2874 > {
2875 self.inner
2876 .ready()
2877 .await
2878 .map_err(|e| {
2879 tonic::Status::new(
2880 tonic::Code::Unknown,
2881 format!("Service was not ready: {}", e.into()),
2882 )
2883 })?;
2884 let codec = tonic::codec::ProstCodec::default();
2885 let path = http::uri::PathAndQuery::from_static(
2886 "/csi.v1.Controller/ControllerGetVolume",
2887 );
2888 let mut req = request.into_request();
2889 req.extensions_mut()
2890 .insert(GrpcMethod::new("csi.v1.Controller", "ControllerGetVolume"));
2891 self.inner.unary(req, path, codec).await
2892 }
2893 pub async fn controller_modify_volume(
2894 &mut self,
2895 request: impl tonic::IntoRequest<super::ControllerModifyVolumeRequest>,
2896 ) -> std::result::Result<
2897 tonic::Response<super::ControllerModifyVolumeResponse>,
2898 tonic::Status,
2899 > {
2900 self.inner
2901 .ready()
2902 .await
2903 .map_err(|e| {
2904 tonic::Status::new(
2905 tonic::Code::Unknown,
2906 format!("Service was not ready: {}", e.into()),
2907 )
2908 })?;
2909 let codec = tonic::codec::ProstCodec::default();
2910 let path = http::uri::PathAndQuery::from_static(
2911 "/csi.v1.Controller/ControllerModifyVolume",
2912 );
2913 let mut req = request.into_request();
2914 req.extensions_mut()
2915 .insert(GrpcMethod::new("csi.v1.Controller", "ControllerModifyVolume"));
2916 self.inner.unary(req, path, codec).await
2917 }
2918 }
2919}
2920pub mod group_controller_client {
2922 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
2923 use tonic::codegen::*;
2924 use tonic::codegen::http::Uri;
2925 #[derive(Debug, Clone)]
2926 pub struct GroupControllerClient<T> {
2927 inner: tonic::client::Grpc<T>,
2928 }
2929 impl<T> GroupControllerClient<T>
2930 where
2931 T: tonic::client::GrpcService<tonic::body::BoxBody>,
2932 T::Error: Into<StdError>,
2933 T::ResponseBody: Body<Data = Bytes> + Send + 'static,
2934 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
2935 {
2936 pub fn new(inner: T) -> Self {
2937 let inner = tonic::client::Grpc::new(inner);
2938 Self { inner }
2939 }
2940 pub fn with_origin(inner: T, origin: Uri) -> Self {
2941 let inner = tonic::client::Grpc::with_origin(inner, origin);
2942 Self { inner }
2943 }
2944 pub fn with_interceptor<F>(
2945 inner: T,
2946 interceptor: F,
2947 ) -> GroupControllerClient<InterceptedService<T, F>>
2948 where
2949 F: tonic::service::Interceptor,
2950 T::ResponseBody: Default,
2951 T: tonic::codegen::Service<
2952 http::Request<tonic::body::BoxBody>,
2953 Response = http::Response<
2954 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
2955 >,
2956 >,
2957 <T as tonic::codegen::Service<
2958 http::Request<tonic::body::BoxBody>,
2959 >>::Error: Into<StdError> + Send + Sync,
2960 {
2961 GroupControllerClient::new(InterceptedService::new(inner, interceptor))
2962 }
2963 #[must_use]
2968 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2969 self.inner = self.inner.send_compressed(encoding);
2970 self
2971 }
2972 #[must_use]
2974 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2975 self.inner = self.inner.accept_compressed(encoding);
2976 self
2977 }
2978 #[must_use]
2982 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2983 self.inner = self.inner.max_decoding_message_size(limit);
2984 self
2985 }
2986 #[must_use]
2990 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2991 self.inner = self.inner.max_encoding_message_size(limit);
2992 self
2993 }
2994 pub async fn group_controller_get_capabilities(
2995 &mut self,
2996 request: impl tonic::IntoRequest<
2997 super::GroupControllerGetCapabilitiesRequest,
2998 >,
2999 ) -> std::result::Result<
3000 tonic::Response<super::GroupControllerGetCapabilitiesResponse>,
3001 tonic::Status,
3002 > {
3003 self.inner
3004 .ready()
3005 .await
3006 .map_err(|e| {
3007 tonic::Status::new(
3008 tonic::Code::Unknown,
3009 format!("Service was not ready: {}", e.into()),
3010 )
3011 })?;
3012 let codec = tonic::codec::ProstCodec::default();
3013 let path = http::uri::PathAndQuery::from_static(
3014 "/csi.v1.GroupController/GroupControllerGetCapabilities",
3015 );
3016 let mut req = request.into_request();
3017 req.extensions_mut()
3018 .insert(
3019 GrpcMethod::new(
3020 "csi.v1.GroupController",
3021 "GroupControllerGetCapabilities",
3022 ),
3023 );
3024 self.inner.unary(req, path, codec).await
3025 }
3026 pub async fn create_volume_group_snapshot(
3027 &mut self,
3028 request: impl tonic::IntoRequest<super::CreateVolumeGroupSnapshotRequest>,
3029 ) -> std::result::Result<
3030 tonic::Response<super::CreateVolumeGroupSnapshotResponse>,
3031 tonic::Status,
3032 > {
3033 self.inner
3034 .ready()
3035 .await
3036 .map_err(|e| {
3037 tonic::Status::new(
3038 tonic::Code::Unknown,
3039 format!("Service was not ready: {}", e.into()),
3040 )
3041 })?;
3042 let codec = tonic::codec::ProstCodec::default();
3043 let path = http::uri::PathAndQuery::from_static(
3044 "/csi.v1.GroupController/CreateVolumeGroupSnapshot",
3045 );
3046 let mut req = request.into_request();
3047 req.extensions_mut()
3048 .insert(
3049 GrpcMethod::new(
3050 "csi.v1.GroupController",
3051 "CreateVolumeGroupSnapshot",
3052 ),
3053 );
3054 self.inner.unary(req, path, codec).await
3055 }
3056 pub async fn delete_volume_group_snapshot(
3057 &mut self,
3058 request: impl tonic::IntoRequest<super::DeleteVolumeGroupSnapshotRequest>,
3059 ) -> std::result::Result<
3060 tonic::Response<super::DeleteVolumeGroupSnapshotResponse>,
3061 tonic::Status,
3062 > {
3063 self.inner
3064 .ready()
3065 .await
3066 .map_err(|e| {
3067 tonic::Status::new(
3068 tonic::Code::Unknown,
3069 format!("Service was not ready: {}", e.into()),
3070 )
3071 })?;
3072 let codec = tonic::codec::ProstCodec::default();
3073 let path = http::uri::PathAndQuery::from_static(
3074 "/csi.v1.GroupController/DeleteVolumeGroupSnapshot",
3075 );
3076 let mut req = request.into_request();
3077 req.extensions_mut()
3078 .insert(
3079 GrpcMethod::new(
3080 "csi.v1.GroupController",
3081 "DeleteVolumeGroupSnapshot",
3082 ),
3083 );
3084 self.inner.unary(req, path, codec).await
3085 }
3086 pub async fn get_volume_group_snapshot(
3087 &mut self,
3088 request: impl tonic::IntoRequest<super::GetVolumeGroupSnapshotRequest>,
3089 ) -> std::result::Result<
3090 tonic::Response<super::GetVolumeGroupSnapshotResponse>,
3091 tonic::Status,
3092 > {
3093 self.inner
3094 .ready()
3095 .await
3096 .map_err(|e| {
3097 tonic::Status::new(
3098 tonic::Code::Unknown,
3099 format!("Service was not ready: {}", e.into()),
3100 )
3101 })?;
3102 let codec = tonic::codec::ProstCodec::default();
3103 let path = http::uri::PathAndQuery::from_static(
3104 "/csi.v1.GroupController/GetVolumeGroupSnapshot",
3105 );
3106 let mut req = request.into_request();
3107 req.extensions_mut()
3108 .insert(
3109 GrpcMethod::new("csi.v1.GroupController", "GetVolumeGroupSnapshot"),
3110 );
3111 self.inner.unary(req, path, codec).await
3112 }
3113 }
3114}
3115pub mod node_client {
3117 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
3118 use tonic::codegen::*;
3119 use tonic::codegen::http::Uri;
3120 #[derive(Debug, Clone)]
3121 pub struct NodeClient<T> {
3122 inner: tonic::client::Grpc<T>,
3123 }
3124 impl<T> NodeClient<T>
3125 where
3126 T: tonic::client::GrpcService<tonic::body::BoxBody>,
3127 T::Error: Into<StdError>,
3128 T::ResponseBody: Body<Data = Bytes> + Send + 'static,
3129 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
3130 {
3131 pub fn new(inner: T) -> Self {
3132 let inner = tonic::client::Grpc::new(inner);
3133 Self { inner }
3134 }
3135 pub fn with_origin(inner: T, origin: Uri) -> Self {
3136 let inner = tonic::client::Grpc::with_origin(inner, origin);
3137 Self { inner }
3138 }
3139 pub fn with_interceptor<F>(
3140 inner: T,
3141 interceptor: F,
3142 ) -> NodeClient<InterceptedService<T, F>>
3143 where
3144 F: tonic::service::Interceptor,
3145 T::ResponseBody: Default,
3146 T: tonic::codegen::Service<
3147 http::Request<tonic::body::BoxBody>,
3148 Response = http::Response<
3149 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
3150 >,
3151 >,
3152 <T as tonic::codegen::Service<
3153 http::Request<tonic::body::BoxBody>,
3154 >>::Error: Into<StdError> + Send + Sync,
3155 {
3156 NodeClient::new(InterceptedService::new(inner, interceptor))
3157 }
3158 #[must_use]
3163 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3164 self.inner = self.inner.send_compressed(encoding);
3165 self
3166 }
3167 #[must_use]
3169 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3170 self.inner = self.inner.accept_compressed(encoding);
3171 self
3172 }
3173 #[must_use]
3177 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3178 self.inner = self.inner.max_decoding_message_size(limit);
3179 self
3180 }
3181 #[must_use]
3185 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3186 self.inner = self.inner.max_encoding_message_size(limit);
3187 self
3188 }
3189 pub async fn node_stage_volume(
3190 &mut self,
3191 request: impl tonic::IntoRequest<super::NodeStageVolumeRequest>,
3192 ) -> std::result::Result<
3193 tonic::Response<super::NodeStageVolumeResponse>,
3194 tonic::Status,
3195 > {
3196 self.inner
3197 .ready()
3198 .await
3199 .map_err(|e| {
3200 tonic::Status::new(
3201 tonic::Code::Unknown,
3202 format!("Service was not ready: {}", e.into()),
3203 )
3204 })?;
3205 let codec = tonic::codec::ProstCodec::default();
3206 let path = http::uri::PathAndQuery::from_static(
3207 "/csi.v1.Node/NodeStageVolume",
3208 );
3209 let mut req = request.into_request();
3210 req.extensions_mut()
3211 .insert(GrpcMethod::new("csi.v1.Node", "NodeStageVolume"));
3212 self.inner.unary(req, path, codec).await
3213 }
3214 pub async fn node_unstage_volume(
3215 &mut self,
3216 request: impl tonic::IntoRequest<super::NodeUnstageVolumeRequest>,
3217 ) -> std::result::Result<
3218 tonic::Response<super::NodeUnstageVolumeResponse>,
3219 tonic::Status,
3220 > {
3221 self.inner
3222 .ready()
3223 .await
3224 .map_err(|e| {
3225 tonic::Status::new(
3226 tonic::Code::Unknown,
3227 format!("Service was not ready: {}", e.into()),
3228 )
3229 })?;
3230 let codec = tonic::codec::ProstCodec::default();
3231 let path = http::uri::PathAndQuery::from_static(
3232 "/csi.v1.Node/NodeUnstageVolume",
3233 );
3234 let mut req = request.into_request();
3235 req.extensions_mut()
3236 .insert(GrpcMethod::new("csi.v1.Node", "NodeUnstageVolume"));
3237 self.inner.unary(req, path, codec).await
3238 }
3239 pub async fn node_publish_volume(
3240 &mut self,
3241 request: impl tonic::IntoRequest<super::NodePublishVolumeRequest>,
3242 ) -> std::result::Result<
3243 tonic::Response<super::NodePublishVolumeResponse>,
3244 tonic::Status,
3245 > {
3246 self.inner
3247 .ready()
3248 .await
3249 .map_err(|e| {
3250 tonic::Status::new(
3251 tonic::Code::Unknown,
3252 format!("Service was not ready: {}", e.into()),
3253 )
3254 })?;
3255 let codec = tonic::codec::ProstCodec::default();
3256 let path = http::uri::PathAndQuery::from_static(
3257 "/csi.v1.Node/NodePublishVolume",
3258 );
3259 let mut req = request.into_request();
3260 req.extensions_mut()
3261 .insert(GrpcMethod::new("csi.v1.Node", "NodePublishVolume"));
3262 self.inner.unary(req, path, codec).await
3263 }
3264 pub async fn node_unpublish_volume(
3265 &mut self,
3266 request: impl tonic::IntoRequest<super::NodeUnpublishVolumeRequest>,
3267 ) -> std::result::Result<
3268 tonic::Response<super::NodeUnpublishVolumeResponse>,
3269 tonic::Status,
3270 > {
3271 self.inner
3272 .ready()
3273 .await
3274 .map_err(|e| {
3275 tonic::Status::new(
3276 tonic::Code::Unknown,
3277 format!("Service was not ready: {}", e.into()),
3278 )
3279 })?;
3280 let codec = tonic::codec::ProstCodec::default();
3281 let path = http::uri::PathAndQuery::from_static(
3282 "/csi.v1.Node/NodeUnpublishVolume",
3283 );
3284 let mut req = request.into_request();
3285 req.extensions_mut()
3286 .insert(GrpcMethod::new("csi.v1.Node", "NodeUnpublishVolume"));
3287 self.inner.unary(req, path, codec).await
3288 }
3289 pub async fn node_get_volume_stats(
3290 &mut self,
3291 request: impl tonic::IntoRequest<super::NodeGetVolumeStatsRequest>,
3292 ) -> std::result::Result<
3293 tonic::Response<super::NodeGetVolumeStatsResponse>,
3294 tonic::Status,
3295 > {
3296 self.inner
3297 .ready()
3298 .await
3299 .map_err(|e| {
3300 tonic::Status::new(
3301 tonic::Code::Unknown,
3302 format!("Service was not ready: {}", e.into()),
3303 )
3304 })?;
3305 let codec = tonic::codec::ProstCodec::default();
3306 let path = http::uri::PathAndQuery::from_static(
3307 "/csi.v1.Node/NodeGetVolumeStats",
3308 );
3309 let mut req = request.into_request();
3310 req.extensions_mut()
3311 .insert(GrpcMethod::new("csi.v1.Node", "NodeGetVolumeStats"));
3312 self.inner.unary(req, path, codec).await
3313 }
3314 pub async fn node_expand_volume(
3315 &mut self,
3316 request: impl tonic::IntoRequest<super::NodeExpandVolumeRequest>,
3317 ) -> std::result::Result<
3318 tonic::Response<super::NodeExpandVolumeResponse>,
3319 tonic::Status,
3320 > {
3321 self.inner
3322 .ready()
3323 .await
3324 .map_err(|e| {
3325 tonic::Status::new(
3326 tonic::Code::Unknown,
3327 format!("Service was not ready: {}", e.into()),
3328 )
3329 })?;
3330 let codec = tonic::codec::ProstCodec::default();
3331 let path = http::uri::PathAndQuery::from_static(
3332 "/csi.v1.Node/NodeExpandVolume",
3333 );
3334 let mut req = request.into_request();
3335 req.extensions_mut()
3336 .insert(GrpcMethod::new("csi.v1.Node", "NodeExpandVolume"));
3337 self.inner.unary(req, path, codec).await
3338 }
3339 pub async fn node_get_capabilities(
3340 &mut self,
3341 request: impl tonic::IntoRequest<super::NodeGetCapabilitiesRequest>,
3342 ) -> std::result::Result<
3343 tonic::Response<super::NodeGetCapabilitiesResponse>,
3344 tonic::Status,
3345 > {
3346 self.inner
3347 .ready()
3348 .await
3349 .map_err(|e| {
3350 tonic::Status::new(
3351 tonic::Code::Unknown,
3352 format!("Service was not ready: {}", e.into()),
3353 )
3354 })?;
3355 let codec = tonic::codec::ProstCodec::default();
3356 let path = http::uri::PathAndQuery::from_static(
3357 "/csi.v1.Node/NodeGetCapabilities",
3358 );
3359 let mut req = request.into_request();
3360 req.extensions_mut()
3361 .insert(GrpcMethod::new("csi.v1.Node", "NodeGetCapabilities"));
3362 self.inner.unary(req, path, codec).await
3363 }
3364 pub async fn node_get_info(
3365 &mut self,
3366 request: impl tonic::IntoRequest<super::NodeGetInfoRequest>,
3367 ) -> std::result::Result<
3368 tonic::Response<super::NodeGetInfoResponse>,
3369 tonic::Status,
3370 > {
3371 self.inner
3372 .ready()
3373 .await
3374 .map_err(|e| {
3375 tonic::Status::new(
3376 tonic::Code::Unknown,
3377 format!("Service was not ready: {}", e.into()),
3378 )
3379 })?;
3380 let codec = tonic::codec::ProstCodec::default();
3381 let path = http::uri::PathAndQuery::from_static("/csi.v1.Node/NodeGetInfo");
3382 let mut req = request.into_request();
3383 req.extensions_mut().insert(GrpcMethod::new("csi.v1.Node", "NodeGetInfo"));
3384 self.inner.unary(req, path, codec).await
3385 }
3386 }
3387}
3388pub mod identity_server {
3390 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
3391 use tonic::codegen::*;
3392 #[async_trait]
3394 pub trait Identity: Send + Sync + 'static {
3395 async fn get_plugin_info(
3396 &self,
3397 request: tonic::Request<super::GetPluginInfoRequest>,
3398 ) -> std::result::Result<
3399 tonic::Response<super::GetPluginInfoResponse>,
3400 tonic::Status,
3401 >;
3402 async fn get_plugin_capabilities(
3403 &self,
3404 request: tonic::Request<super::GetPluginCapabilitiesRequest>,
3405 ) -> std::result::Result<
3406 tonic::Response<super::GetPluginCapabilitiesResponse>,
3407 tonic::Status,
3408 >;
3409 async fn probe(
3410 &self,
3411 request: tonic::Request<super::ProbeRequest>,
3412 ) -> std::result::Result<tonic::Response<super::ProbeResponse>, tonic::Status>;
3413 }
3414 #[derive(Debug)]
3415 pub struct IdentityServer<T: Identity> {
3416 inner: _Inner<T>,
3417 accept_compression_encodings: EnabledCompressionEncodings,
3418 send_compression_encodings: EnabledCompressionEncodings,
3419 max_decoding_message_size: Option<usize>,
3420 max_encoding_message_size: Option<usize>,
3421 }
3422 struct _Inner<T>(Arc<T>);
3423 impl<T: Identity> IdentityServer<T> {
3424 pub fn new(inner: T) -> Self {
3425 Self::from_arc(Arc::new(inner))
3426 }
3427 pub fn from_arc(inner: Arc<T>) -> Self {
3428 let inner = _Inner(inner);
3429 Self {
3430 inner,
3431 accept_compression_encodings: Default::default(),
3432 send_compression_encodings: Default::default(),
3433 max_decoding_message_size: None,
3434 max_encoding_message_size: None,
3435 }
3436 }
3437 pub fn with_interceptor<F>(
3438 inner: T,
3439 interceptor: F,
3440 ) -> InterceptedService<Self, F>
3441 where
3442 F: tonic::service::Interceptor,
3443 {
3444 InterceptedService::new(Self::new(inner), interceptor)
3445 }
3446 #[must_use]
3448 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3449 self.accept_compression_encodings.enable(encoding);
3450 self
3451 }
3452 #[must_use]
3454 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3455 self.send_compression_encodings.enable(encoding);
3456 self
3457 }
3458 #[must_use]
3462 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3463 self.max_decoding_message_size = Some(limit);
3464 self
3465 }
3466 #[must_use]
3470 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3471 self.max_encoding_message_size = Some(limit);
3472 self
3473 }
3474 }
3475 impl<T, B> tonic::codegen::Service<http::Request<B>> for IdentityServer<T>
3476 where
3477 T: Identity,
3478 B: Body + Send + 'static,
3479 B::Error: Into<StdError> + Send + 'static,
3480 {
3481 type Response = http::Response<tonic::body::BoxBody>;
3482 type Error = std::convert::Infallible;
3483 type Future = BoxFuture<Self::Response, Self::Error>;
3484 fn poll_ready(
3485 &mut self,
3486 _cx: &mut Context<'_>,
3487 ) -> Poll<std::result::Result<(), Self::Error>> {
3488 Poll::Ready(Ok(()))
3489 }
3490 fn call(&mut self, req: http::Request<B>) -> Self::Future {
3491 let inner = self.inner.clone();
3492 match req.uri().path() {
3493 "/csi.v1.Identity/GetPluginInfo" => {
3494 #[allow(non_camel_case_types)]
3495 struct GetPluginInfoSvc<T: Identity>(pub Arc<T>);
3496 impl<
3497 T: Identity,
3498 > tonic::server::UnaryService<super::GetPluginInfoRequest>
3499 for GetPluginInfoSvc<T> {
3500 type Response = super::GetPluginInfoResponse;
3501 type Future = BoxFuture<
3502 tonic::Response<Self::Response>,
3503 tonic::Status,
3504 >;
3505 fn call(
3506 &mut self,
3507 request: tonic::Request<super::GetPluginInfoRequest>,
3508 ) -> Self::Future {
3509 let inner = Arc::clone(&self.0);
3510 let fut = async move {
3511 <T as Identity>::get_plugin_info(&inner, request).await
3512 };
3513 Box::pin(fut)
3514 }
3515 }
3516 let accept_compression_encodings = self.accept_compression_encodings;
3517 let send_compression_encodings = self.send_compression_encodings;
3518 let max_decoding_message_size = self.max_decoding_message_size;
3519 let max_encoding_message_size = self.max_encoding_message_size;
3520 let inner = self.inner.clone();
3521 let fut = async move {
3522 let inner = inner.0;
3523 let method = GetPluginInfoSvc(inner);
3524 let codec = tonic::codec::ProstCodec::default();
3525 let mut grpc = tonic::server::Grpc::new(codec)
3526 .apply_compression_config(
3527 accept_compression_encodings,
3528 send_compression_encodings,
3529 )
3530 .apply_max_message_size_config(
3531 max_decoding_message_size,
3532 max_encoding_message_size,
3533 );
3534 let res = grpc.unary(method, req).await;
3535 Ok(res)
3536 };
3537 Box::pin(fut)
3538 }
3539 "/csi.v1.Identity/GetPluginCapabilities" => {
3540 #[allow(non_camel_case_types)]
3541 struct GetPluginCapabilitiesSvc<T: Identity>(pub Arc<T>);
3542 impl<
3543 T: Identity,
3544 > tonic::server::UnaryService<super::GetPluginCapabilitiesRequest>
3545 for GetPluginCapabilitiesSvc<T> {
3546 type Response = super::GetPluginCapabilitiesResponse;
3547 type Future = BoxFuture<
3548 tonic::Response<Self::Response>,
3549 tonic::Status,
3550 >;
3551 fn call(
3552 &mut self,
3553 request: tonic::Request<super::GetPluginCapabilitiesRequest>,
3554 ) -> Self::Future {
3555 let inner = Arc::clone(&self.0);
3556 let fut = async move {
3557 <T as Identity>::get_plugin_capabilities(&inner, request)
3558 .await
3559 };
3560 Box::pin(fut)
3561 }
3562 }
3563 let accept_compression_encodings = self.accept_compression_encodings;
3564 let send_compression_encodings = self.send_compression_encodings;
3565 let max_decoding_message_size = self.max_decoding_message_size;
3566 let max_encoding_message_size = self.max_encoding_message_size;
3567 let inner = self.inner.clone();
3568 let fut = async move {
3569 let inner = inner.0;
3570 let method = GetPluginCapabilitiesSvc(inner);
3571 let codec = tonic::codec::ProstCodec::default();
3572 let mut grpc = tonic::server::Grpc::new(codec)
3573 .apply_compression_config(
3574 accept_compression_encodings,
3575 send_compression_encodings,
3576 )
3577 .apply_max_message_size_config(
3578 max_decoding_message_size,
3579 max_encoding_message_size,
3580 );
3581 let res = grpc.unary(method, req).await;
3582 Ok(res)
3583 };
3584 Box::pin(fut)
3585 }
3586 "/csi.v1.Identity/Probe" => {
3587 #[allow(non_camel_case_types)]
3588 struct ProbeSvc<T: Identity>(pub Arc<T>);
3589 impl<T: Identity> tonic::server::UnaryService<super::ProbeRequest>
3590 for ProbeSvc<T> {
3591 type Response = super::ProbeResponse;
3592 type Future = BoxFuture<
3593 tonic::Response<Self::Response>,
3594 tonic::Status,
3595 >;
3596 fn call(
3597 &mut self,
3598 request: tonic::Request<super::ProbeRequest>,
3599 ) -> Self::Future {
3600 let inner = Arc::clone(&self.0);
3601 let fut = async move {
3602 <T as Identity>::probe(&inner, request).await
3603 };
3604 Box::pin(fut)
3605 }
3606 }
3607 let accept_compression_encodings = self.accept_compression_encodings;
3608 let send_compression_encodings = self.send_compression_encodings;
3609 let max_decoding_message_size = self.max_decoding_message_size;
3610 let max_encoding_message_size = self.max_encoding_message_size;
3611 let inner = self.inner.clone();
3612 let fut = async move {
3613 let inner = inner.0;
3614 let method = ProbeSvc(inner);
3615 let codec = tonic::codec::ProstCodec::default();
3616 let mut grpc = tonic::server::Grpc::new(codec)
3617 .apply_compression_config(
3618 accept_compression_encodings,
3619 send_compression_encodings,
3620 )
3621 .apply_max_message_size_config(
3622 max_decoding_message_size,
3623 max_encoding_message_size,
3624 );
3625 let res = grpc.unary(method, req).await;
3626 Ok(res)
3627 };
3628 Box::pin(fut)
3629 }
3630 _ => {
3631 Box::pin(async move {
3632 Ok(
3633 http::Response::builder()
3634 .status(200)
3635 .header("grpc-status", "12")
3636 .header("content-type", "application/grpc")
3637 .body(empty_body())
3638 .unwrap(),
3639 )
3640 })
3641 }
3642 }
3643 }
3644 }
3645 impl<T: Identity> Clone for IdentityServer<T> {
3646 fn clone(&self) -> Self {
3647 let inner = self.inner.clone();
3648 Self {
3649 inner,
3650 accept_compression_encodings: self.accept_compression_encodings,
3651 send_compression_encodings: self.send_compression_encodings,
3652 max_decoding_message_size: self.max_decoding_message_size,
3653 max_encoding_message_size: self.max_encoding_message_size,
3654 }
3655 }
3656 }
3657 impl<T: Identity> Clone for _Inner<T> {
3658 fn clone(&self) -> Self {
3659 Self(Arc::clone(&self.0))
3660 }
3661 }
3662 impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
3663 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3664 write!(f, "{:?}", self.0)
3665 }
3666 }
3667 impl<T: Identity> tonic::server::NamedService for IdentityServer<T> {
3668 const NAME: &'static str = "csi.v1.Identity";
3669 }
3670}
3671pub mod controller_server {
3673 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
3674 use tonic::codegen::*;
3675 #[async_trait]
3677 pub trait Controller: Send + Sync + 'static {
3678 async fn create_volume(
3679 &self,
3680 request: tonic::Request<super::CreateVolumeRequest>,
3681 ) -> std::result::Result<
3682 tonic::Response<super::CreateVolumeResponse>,
3683 tonic::Status,
3684 >;
3685 async fn delete_volume(
3686 &self,
3687 request: tonic::Request<super::DeleteVolumeRequest>,
3688 ) -> std::result::Result<
3689 tonic::Response<super::DeleteVolumeResponse>,
3690 tonic::Status,
3691 >;
3692 async fn controller_publish_volume(
3693 &self,
3694 request: tonic::Request<super::ControllerPublishVolumeRequest>,
3695 ) -> std::result::Result<
3696 tonic::Response<super::ControllerPublishVolumeResponse>,
3697 tonic::Status,
3698 >;
3699 async fn controller_unpublish_volume(
3700 &self,
3701 request: tonic::Request<super::ControllerUnpublishVolumeRequest>,
3702 ) -> std::result::Result<
3703 tonic::Response<super::ControllerUnpublishVolumeResponse>,
3704 tonic::Status,
3705 >;
3706 async fn validate_volume_capabilities(
3707 &self,
3708 request: tonic::Request<super::ValidateVolumeCapabilitiesRequest>,
3709 ) -> std::result::Result<
3710 tonic::Response<super::ValidateVolumeCapabilitiesResponse>,
3711 tonic::Status,
3712 >;
3713 async fn list_volumes(
3714 &self,
3715 request: tonic::Request<super::ListVolumesRequest>,
3716 ) -> std::result::Result<
3717 tonic::Response<super::ListVolumesResponse>,
3718 tonic::Status,
3719 >;
3720 async fn get_capacity(
3721 &self,
3722 request: tonic::Request<super::GetCapacityRequest>,
3723 ) -> std::result::Result<
3724 tonic::Response<super::GetCapacityResponse>,
3725 tonic::Status,
3726 >;
3727 async fn controller_get_capabilities(
3728 &self,
3729 request: tonic::Request<super::ControllerGetCapabilitiesRequest>,
3730 ) -> std::result::Result<
3731 tonic::Response<super::ControllerGetCapabilitiesResponse>,
3732 tonic::Status,
3733 >;
3734 async fn create_snapshot(
3735 &self,
3736 request: tonic::Request<super::CreateSnapshotRequest>,
3737 ) -> std::result::Result<
3738 tonic::Response<super::CreateSnapshotResponse>,
3739 tonic::Status,
3740 >;
3741 async fn delete_snapshot(
3742 &self,
3743 request: tonic::Request<super::DeleteSnapshotRequest>,
3744 ) -> std::result::Result<
3745 tonic::Response<super::DeleteSnapshotResponse>,
3746 tonic::Status,
3747 >;
3748 async fn list_snapshots(
3749 &self,
3750 request: tonic::Request<super::ListSnapshotsRequest>,
3751 ) -> std::result::Result<
3752 tonic::Response<super::ListSnapshotsResponse>,
3753 tonic::Status,
3754 >;
3755 async fn controller_expand_volume(
3756 &self,
3757 request: tonic::Request<super::ControllerExpandVolumeRequest>,
3758 ) -> std::result::Result<
3759 tonic::Response<super::ControllerExpandVolumeResponse>,
3760 tonic::Status,
3761 >;
3762 async fn controller_get_volume(
3763 &self,
3764 request: tonic::Request<super::ControllerGetVolumeRequest>,
3765 ) -> std::result::Result<
3766 tonic::Response<super::ControllerGetVolumeResponse>,
3767 tonic::Status,
3768 >;
3769 async fn controller_modify_volume(
3770 &self,
3771 request: tonic::Request<super::ControllerModifyVolumeRequest>,
3772 ) -> std::result::Result<
3773 tonic::Response<super::ControllerModifyVolumeResponse>,
3774 tonic::Status,
3775 >;
3776 }
3777 #[derive(Debug)]
3778 pub struct ControllerServer<T: Controller> {
3779 inner: _Inner<T>,
3780 accept_compression_encodings: EnabledCompressionEncodings,
3781 send_compression_encodings: EnabledCompressionEncodings,
3782 max_decoding_message_size: Option<usize>,
3783 max_encoding_message_size: Option<usize>,
3784 }
3785 struct _Inner<T>(Arc<T>);
3786 impl<T: Controller> ControllerServer<T> {
3787 pub fn new(inner: T) -> Self {
3788 Self::from_arc(Arc::new(inner))
3789 }
3790 pub fn from_arc(inner: Arc<T>) -> Self {
3791 let inner = _Inner(inner);
3792 Self {
3793 inner,
3794 accept_compression_encodings: Default::default(),
3795 send_compression_encodings: Default::default(),
3796 max_decoding_message_size: None,
3797 max_encoding_message_size: None,
3798 }
3799 }
3800 pub fn with_interceptor<F>(
3801 inner: T,
3802 interceptor: F,
3803 ) -> InterceptedService<Self, F>
3804 where
3805 F: tonic::service::Interceptor,
3806 {
3807 InterceptedService::new(Self::new(inner), interceptor)
3808 }
3809 #[must_use]
3811 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3812 self.accept_compression_encodings.enable(encoding);
3813 self
3814 }
3815 #[must_use]
3817 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3818 self.send_compression_encodings.enable(encoding);
3819 self
3820 }
3821 #[must_use]
3825 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3826 self.max_decoding_message_size = Some(limit);
3827 self
3828 }
3829 #[must_use]
3833 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3834 self.max_encoding_message_size = Some(limit);
3835 self
3836 }
3837 }
3838 impl<T, B> tonic::codegen::Service<http::Request<B>> for ControllerServer<T>
3839 where
3840 T: Controller,
3841 B: Body + Send + 'static,
3842 B::Error: Into<StdError> + Send + 'static,
3843 {
3844 type Response = http::Response<tonic::body::BoxBody>;
3845 type Error = std::convert::Infallible;
3846 type Future = BoxFuture<Self::Response, Self::Error>;
3847 fn poll_ready(
3848 &mut self,
3849 _cx: &mut Context<'_>,
3850 ) -> Poll<std::result::Result<(), Self::Error>> {
3851 Poll::Ready(Ok(()))
3852 }
3853 fn call(&mut self, req: http::Request<B>) -> Self::Future {
3854 let inner = self.inner.clone();
3855 match req.uri().path() {
3856 "/csi.v1.Controller/CreateVolume" => {
3857 #[allow(non_camel_case_types)]
3858 struct CreateVolumeSvc<T: Controller>(pub Arc<T>);
3859 impl<
3860 T: Controller,
3861 > tonic::server::UnaryService<super::CreateVolumeRequest>
3862 for CreateVolumeSvc<T> {
3863 type Response = super::CreateVolumeResponse;
3864 type Future = BoxFuture<
3865 tonic::Response<Self::Response>,
3866 tonic::Status,
3867 >;
3868 fn call(
3869 &mut self,
3870 request: tonic::Request<super::CreateVolumeRequest>,
3871 ) -> Self::Future {
3872 let inner = Arc::clone(&self.0);
3873 let fut = async move {
3874 <T as Controller>::create_volume(&inner, request).await
3875 };
3876 Box::pin(fut)
3877 }
3878 }
3879 let accept_compression_encodings = self.accept_compression_encodings;
3880 let send_compression_encodings = self.send_compression_encodings;
3881 let max_decoding_message_size = self.max_decoding_message_size;
3882 let max_encoding_message_size = self.max_encoding_message_size;
3883 let inner = self.inner.clone();
3884 let fut = async move {
3885 let inner = inner.0;
3886 let method = CreateVolumeSvc(inner);
3887 let codec = tonic::codec::ProstCodec::default();
3888 let mut grpc = tonic::server::Grpc::new(codec)
3889 .apply_compression_config(
3890 accept_compression_encodings,
3891 send_compression_encodings,
3892 )
3893 .apply_max_message_size_config(
3894 max_decoding_message_size,
3895 max_encoding_message_size,
3896 );
3897 let res = grpc.unary(method, req).await;
3898 Ok(res)
3899 };
3900 Box::pin(fut)
3901 }
3902 "/csi.v1.Controller/DeleteVolume" => {
3903 #[allow(non_camel_case_types)]
3904 struct DeleteVolumeSvc<T: Controller>(pub Arc<T>);
3905 impl<
3906 T: Controller,
3907 > tonic::server::UnaryService<super::DeleteVolumeRequest>
3908 for DeleteVolumeSvc<T> {
3909 type Response = super::DeleteVolumeResponse;
3910 type Future = BoxFuture<
3911 tonic::Response<Self::Response>,
3912 tonic::Status,
3913 >;
3914 fn call(
3915 &mut self,
3916 request: tonic::Request<super::DeleteVolumeRequest>,
3917 ) -> Self::Future {
3918 let inner = Arc::clone(&self.0);
3919 let fut = async move {
3920 <T as Controller>::delete_volume(&inner, request).await
3921 };
3922 Box::pin(fut)
3923 }
3924 }
3925 let accept_compression_encodings = self.accept_compression_encodings;
3926 let send_compression_encodings = self.send_compression_encodings;
3927 let max_decoding_message_size = self.max_decoding_message_size;
3928 let max_encoding_message_size = self.max_encoding_message_size;
3929 let inner = self.inner.clone();
3930 let fut = async move {
3931 let inner = inner.0;
3932 let method = DeleteVolumeSvc(inner);
3933 let codec = tonic::codec::ProstCodec::default();
3934 let mut grpc = tonic::server::Grpc::new(codec)
3935 .apply_compression_config(
3936 accept_compression_encodings,
3937 send_compression_encodings,
3938 )
3939 .apply_max_message_size_config(
3940 max_decoding_message_size,
3941 max_encoding_message_size,
3942 );
3943 let res = grpc.unary(method, req).await;
3944 Ok(res)
3945 };
3946 Box::pin(fut)
3947 }
3948 "/csi.v1.Controller/ControllerPublishVolume" => {
3949 #[allow(non_camel_case_types)]
3950 struct ControllerPublishVolumeSvc<T: Controller>(pub Arc<T>);
3951 impl<
3952 T: Controller,
3953 > tonic::server::UnaryService<super::ControllerPublishVolumeRequest>
3954 for ControllerPublishVolumeSvc<T> {
3955 type Response = super::ControllerPublishVolumeResponse;
3956 type Future = BoxFuture<
3957 tonic::Response<Self::Response>,
3958 tonic::Status,
3959 >;
3960 fn call(
3961 &mut self,
3962 request: tonic::Request<
3963 super::ControllerPublishVolumeRequest,
3964 >,
3965 ) -> Self::Future {
3966 let inner = Arc::clone(&self.0);
3967 let fut = async move {
3968 <T as Controller>::controller_publish_volume(
3969 &inner,
3970 request,
3971 )
3972 .await
3973 };
3974 Box::pin(fut)
3975 }
3976 }
3977 let accept_compression_encodings = self.accept_compression_encodings;
3978 let send_compression_encodings = self.send_compression_encodings;
3979 let max_decoding_message_size = self.max_decoding_message_size;
3980 let max_encoding_message_size = self.max_encoding_message_size;
3981 let inner = self.inner.clone();
3982 let fut = async move {
3983 let inner = inner.0;
3984 let method = ControllerPublishVolumeSvc(inner);
3985 let codec = tonic::codec::ProstCodec::default();
3986 let mut grpc = tonic::server::Grpc::new(codec)
3987 .apply_compression_config(
3988 accept_compression_encodings,
3989 send_compression_encodings,
3990 )
3991 .apply_max_message_size_config(
3992 max_decoding_message_size,
3993 max_encoding_message_size,
3994 );
3995 let res = grpc.unary(method, req).await;
3996 Ok(res)
3997 };
3998 Box::pin(fut)
3999 }
4000 "/csi.v1.Controller/ControllerUnpublishVolume" => {
4001 #[allow(non_camel_case_types)]
4002 struct ControllerUnpublishVolumeSvc<T: Controller>(pub Arc<T>);
4003 impl<
4004 T: Controller,
4005 > tonic::server::UnaryService<
4006 super::ControllerUnpublishVolumeRequest,
4007 > for ControllerUnpublishVolumeSvc<T> {
4008 type Response = super::ControllerUnpublishVolumeResponse;
4009 type Future = BoxFuture<
4010 tonic::Response<Self::Response>,
4011 tonic::Status,
4012 >;
4013 fn call(
4014 &mut self,
4015 request: tonic::Request<
4016 super::ControllerUnpublishVolumeRequest,
4017 >,
4018 ) -> Self::Future {
4019 let inner = Arc::clone(&self.0);
4020 let fut = async move {
4021 <T as Controller>::controller_unpublish_volume(
4022 &inner,
4023 request,
4024 )
4025 .await
4026 };
4027 Box::pin(fut)
4028 }
4029 }
4030 let accept_compression_encodings = self.accept_compression_encodings;
4031 let send_compression_encodings = self.send_compression_encodings;
4032 let max_decoding_message_size = self.max_decoding_message_size;
4033 let max_encoding_message_size = self.max_encoding_message_size;
4034 let inner = self.inner.clone();
4035 let fut = async move {
4036 let inner = inner.0;
4037 let method = ControllerUnpublishVolumeSvc(inner);
4038 let codec = tonic::codec::ProstCodec::default();
4039 let mut grpc = tonic::server::Grpc::new(codec)
4040 .apply_compression_config(
4041 accept_compression_encodings,
4042 send_compression_encodings,
4043 )
4044 .apply_max_message_size_config(
4045 max_decoding_message_size,
4046 max_encoding_message_size,
4047 );
4048 let res = grpc.unary(method, req).await;
4049 Ok(res)
4050 };
4051 Box::pin(fut)
4052 }
4053 "/csi.v1.Controller/ValidateVolumeCapabilities" => {
4054 #[allow(non_camel_case_types)]
4055 struct ValidateVolumeCapabilitiesSvc<T: Controller>(pub Arc<T>);
4056 impl<
4057 T: Controller,
4058 > tonic::server::UnaryService<
4059 super::ValidateVolumeCapabilitiesRequest,
4060 > for ValidateVolumeCapabilitiesSvc<T> {
4061 type Response = super::ValidateVolumeCapabilitiesResponse;
4062 type Future = BoxFuture<
4063 tonic::Response<Self::Response>,
4064 tonic::Status,
4065 >;
4066 fn call(
4067 &mut self,
4068 request: tonic::Request<
4069 super::ValidateVolumeCapabilitiesRequest,
4070 >,
4071 ) -> Self::Future {
4072 let inner = Arc::clone(&self.0);
4073 let fut = async move {
4074 <T as Controller>::validate_volume_capabilities(
4075 &inner,
4076 request,
4077 )
4078 .await
4079 };
4080 Box::pin(fut)
4081 }
4082 }
4083 let accept_compression_encodings = self.accept_compression_encodings;
4084 let send_compression_encodings = self.send_compression_encodings;
4085 let max_decoding_message_size = self.max_decoding_message_size;
4086 let max_encoding_message_size = self.max_encoding_message_size;
4087 let inner = self.inner.clone();
4088 let fut = async move {
4089 let inner = inner.0;
4090 let method = ValidateVolumeCapabilitiesSvc(inner);
4091 let codec = tonic::codec::ProstCodec::default();
4092 let mut grpc = tonic::server::Grpc::new(codec)
4093 .apply_compression_config(
4094 accept_compression_encodings,
4095 send_compression_encodings,
4096 )
4097 .apply_max_message_size_config(
4098 max_decoding_message_size,
4099 max_encoding_message_size,
4100 );
4101 let res = grpc.unary(method, req).await;
4102 Ok(res)
4103 };
4104 Box::pin(fut)
4105 }
4106 "/csi.v1.Controller/ListVolumes" => {
4107 #[allow(non_camel_case_types)]
4108 struct ListVolumesSvc<T: Controller>(pub Arc<T>);
4109 impl<
4110 T: Controller,
4111 > tonic::server::UnaryService<super::ListVolumesRequest>
4112 for ListVolumesSvc<T> {
4113 type Response = super::ListVolumesResponse;
4114 type Future = BoxFuture<
4115 tonic::Response<Self::Response>,
4116 tonic::Status,
4117 >;
4118 fn call(
4119 &mut self,
4120 request: tonic::Request<super::ListVolumesRequest>,
4121 ) -> Self::Future {
4122 let inner = Arc::clone(&self.0);
4123 let fut = async move {
4124 <T as Controller>::list_volumes(&inner, request).await
4125 };
4126 Box::pin(fut)
4127 }
4128 }
4129 let accept_compression_encodings = self.accept_compression_encodings;
4130 let send_compression_encodings = self.send_compression_encodings;
4131 let max_decoding_message_size = self.max_decoding_message_size;
4132 let max_encoding_message_size = self.max_encoding_message_size;
4133 let inner = self.inner.clone();
4134 let fut = async move {
4135 let inner = inner.0;
4136 let method = ListVolumesSvc(inner);
4137 let codec = tonic::codec::ProstCodec::default();
4138 let mut grpc = tonic::server::Grpc::new(codec)
4139 .apply_compression_config(
4140 accept_compression_encodings,
4141 send_compression_encodings,
4142 )
4143 .apply_max_message_size_config(
4144 max_decoding_message_size,
4145 max_encoding_message_size,
4146 );
4147 let res = grpc.unary(method, req).await;
4148 Ok(res)
4149 };
4150 Box::pin(fut)
4151 }
4152 "/csi.v1.Controller/GetCapacity" => {
4153 #[allow(non_camel_case_types)]
4154 struct GetCapacitySvc<T: Controller>(pub Arc<T>);
4155 impl<
4156 T: Controller,
4157 > tonic::server::UnaryService<super::GetCapacityRequest>
4158 for GetCapacitySvc<T> {
4159 type Response = super::GetCapacityResponse;
4160 type Future = BoxFuture<
4161 tonic::Response<Self::Response>,
4162 tonic::Status,
4163 >;
4164 fn call(
4165 &mut self,
4166 request: tonic::Request<super::GetCapacityRequest>,
4167 ) -> Self::Future {
4168 let inner = Arc::clone(&self.0);
4169 let fut = async move {
4170 <T as Controller>::get_capacity(&inner, request).await
4171 };
4172 Box::pin(fut)
4173 }
4174 }
4175 let accept_compression_encodings = self.accept_compression_encodings;
4176 let send_compression_encodings = self.send_compression_encodings;
4177 let max_decoding_message_size = self.max_decoding_message_size;
4178 let max_encoding_message_size = self.max_encoding_message_size;
4179 let inner = self.inner.clone();
4180 let fut = async move {
4181 let inner = inner.0;
4182 let method = GetCapacitySvc(inner);
4183 let codec = tonic::codec::ProstCodec::default();
4184 let mut grpc = tonic::server::Grpc::new(codec)
4185 .apply_compression_config(
4186 accept_compression_encodings,
4187 send_compression_encodings,
4188 )
4189 .apply_max_message_size_config(
4190 max_decoding_message_size,
4191 max_encoding_message_size,
4192 );
4193 let res = grpc.unary(method, req).await;
4194 Ok(res)
4195 };
4196 Box::pin(fut)
4197 }
4198 "/csi.v1.Controller/ControllerGetCapabilities" => {
4199 #[allow(non_camel_case_types)]
4200 struct ControllerGetCapabilitiesSvc<T: Controller>(pub Arc<T>);
4201 impl<
4202 T: Controller,
4203 > tonic::server::UnaryService<
4204 super::ControllerGetCapabilitiesRequest,
4205 > for ControllerGetCapabilitiesSvc<T> {
4206 type Response = super::ControllerGetCapabilitiesResponse;
4207 type Future = BoxFuture<
4208 tonic::Response<Self::Response>,
4209 tonic::Status,
4210 >;
4211 fn call(
4212 &mut self,
4213 request: tonic::Request<
4214 super::ControllerGetCapabilitiesRequest,
4215 >,
4216 ) -> Self::Future {
4217 let inner = Arc::clone(&self.0);
4218 let fut = async move {
4219 <T as Controller>::controller_get_capabilities(
4220 &inner,
4221 request,
4222 )
4223 .await
4224 };
4225 Box::pin(fut)
4226 }
4227 }
4228 let accept_compression_encodings = self.accept_compression_encodings;
4229 let send_compression_encodings = self.send_compression_encodings;
4230 let max_decoding_message_size = self.max_decoding_message_size;
4231 let max_encoding_message_size = self.max_encoding_message_size;
4232 let inner = self.inner.clone();
4233 let fut = async move {
4234 let inner = inner.0;
4235 let method = ControllerGetCapabilitiesSvc(inner);
4236 let codec = tonic::codec::ProstCodec::default();
4237 let mut grpc = tonic::server::Grpc::new(codec)
4238 .apply_compression_config(
4239 accept_compression_encodings,
4240 send_compression_encodings,
4241 )
4242 .apply_max_message_size_config(
4243 max_decoding_message_size,
4244 max_encoding_message_size,
4245 );
4246 let res = grpc.unary(method, req).await;
4247 Ok(res)
4248 };
4249 Box::pin(fut)
4250 }
4251 "/csi.v1.Controller/CreateSnapshot" => {
4252 #[allow(non_camel_case_types)]
4253 struct CreateSnapshotSvc<T: Controller>(pub Arc<T>);
4254 impl<
4255 T: Controller,
4256 > tonic::server::UnaryService<super::CreateSnapshotRequest>
4257 for CreateSnapshotSvc<T> {
4258 type Response = super::CreateSnapshotResponse;
4259 type Future = BoxFuture<
4260 tonic::Response<Self::Response>,
4261 tonic::Status,
4262 >;
4263 fn call(
4264 &mut self,
4265 request: tonic::Request<super::CreateSnapshotRequest>,
4266 ) -> Self::Future {
4267 let inner = Arc::clone(&self.0);
4268 let fut = async move {
4269 <T as Controller>::create_snapshot(&inner, request).await
4270 };
4271 Box::pin(fut)
4272 }
4273 }
4274 let accept_compression_encodings = self.accept_compression_encodings;
4275 let send_compression_encodings = self.send_compression_encodings;
4276 let max_decoding_message_size = self.max_decoding_message_size;
4277 let max_encoding_message_size = self.max_encoding_message_size;
4278 let inner = self.inner.clone();
4279 let fut = async move {
4280 let inner = inner.0;
4281 let method = CreateSnapshotSvc(inner);
4282 let codec = tonic::codec::ProstCodec::default();
4283 let mut grpc = tonic::server::Grpc::new(codec)
4284 .apply_compression_config(
4285 accept_compression_encodings,
4286 send_compression_encodings,
4287 )
4288 .apply_max_message_size_config(
4289 max_decoding_message_size,
4290 max_encoding_message_size,
4291 );
4292 let res = grpc.unary(method, req).await;
4293 Ok(res)
4294 };
4295 Box::pin(fut)
4296 }
4297 "/csi.v1.Controller/DeleteSnapshot" => {
4298 #[allow(non_camel_case_types)]
4299 struct DeleteSnapshotSvc<T: Controller>(pub Arc<T>);
4300 impl<
4301 T: Controller,
4302 > tonic::server::UnaryService<super::DeleteSnapshotRequest>
4303 for DeleteSnapshotSvc<T> {
4304 type Response = super::DeleteSnapshotResponse;
4305 type Future = BoxFuture<
4306 tonic::Response<Self::Response>,
4307 tonic::Status,
4308 >;
4309 fn call(
4310 &mut self,
4311 request: tonic::Request<super::DeleteSnapshotRequest>,
4312 ) -> Self::Future {
4313 let inner = Arc::clone(&self.0);
4314 let fut = async move {
4315 <T as Controller>::delete_snapshot(&inner, request).await
4316 };
4317 Box::pin(fut)
4318 }
4319 }
4320 let accept_compression_encodings = self.accept_compression_encodings;
4321 let send_compression_encodings = self.send_compression_encodings;
4322 let max_decoding_message_size = self.max_decoding_message_size;
4323 let max_encoding_message_size = self.max_encoding_message_size;
4324 let inner = self.inner.clone();
4325 let fut = async move {
4326 let inner = inner.0;
4327 let method = DeleteSnapshotSvc(inner);
4328 let codec = tonic::codec::ProstCodec::default();
4329 let mut grpc = tonic::server::Grpc::new(codec)
4330 .apply_compression_config(
4331 accept_compression_encodings,
4332 send_compression_encodings,
4333 )
4334 .apply_max_message_size_config(
4335 max_decoding_message_size,
4336 max_encoding_message_size,
4337 );
4338 let res = grpc.unary(method, req).await;
4339 Ok(res)
4340 };
4341 Box::pin(fut)
4342 }
4343 "/csi.v1.Controller/ListSnapshots" => {
4344 #[allow(non_camel_case_types)]
4345 struct ListSnapshotsSvc<T: Controller>(pub Arc<T>);
4346 impl<
4347 T: Controller,
4348 > tonic::server::UnaryService<super::ListSnapshotsRequest>
4349 for ListSnapshotsSvc<T> {
4350 type Response = super::ListSnapshotsResponse;
4351 type Future = BoxFuture<
4352 tonic::Response<Self::Response>,
4353 tonic::Status,
4354 >;
4355 fn call(
4356 &mut self,
4357 request: tonic::Request<super::ListSnapshotsRequest>,
4358 ) -> Self::Future {
4359 let inner = Arc::clone(&self.0);
4360 let fut = async move {
4361 <T as Controller>::list_snapshots(&inner, request).await
4362 };
4363 Box::pin(fut)
4364 }
4365 }
4366 let accept_compression_encodings = self.accept_compression_encodings;
4367 let send_compression_encodings = self.send_compression_encodings;
4368 let max_decoding_message_size = self.max_decoding_message_size;
4369 let max_encoding_message_size = self.max_encoding_message_size;
4370 let inner = self.inner.clone();
4371 let fut = async move {
4372 let inner = inner.0;
4373 let method = ListSnapshotsSvc(inner);
4374 let codec = tonic::codec::ProstCodec::default();
4375 let mut grpc = tonic::server::Grpc::new(codec)
4376 .apply_compression_config(
4377 accept_compression_encodings,
4378 send_compression_encodings,
4379 )
4380 .apply_max_message_size_config(
4381 max_decoding_message_size,
4382 max_encoding_message_size,
4383 );
4384 let res = grpc.unary(method, req).await;
4385 Ok(res)
4386 };
4387 Box::pin(fut)
4388 }
4389 "/csi.v1.Controller/ControllerExpandVolume" => {
4390 #[allow(non_camel_case_types)]
4391 struct ControllerExpandVolumeSvc<T: Controller>(pub Arc<T>);
4392 impl<
4393 T: Controller,
4394 > tonic::server::UnaryService<super::ControllerExpandVolumeRequest>
4395 for ControllerExpandVolumeSvc<T> {
4396 type Response = super::ControllerExpandVolumeResponse;
4397 type Future = BoxFuture<
4398 tonic::Response<Self::Response>,
4399 tonic::Status,
4400 >;
4401 fn call(
4402 &mut self,
4403 request: tonic::Request<super::ControllerExpandVolumeRequest>,
4404 ) -> Self::Future {
4405 let inner = Arc::clone(&self.0);
4406 let fut = async move {
4407 <T as Controller>::controller_expand_volume(&inner, request)
4408 .await
4409 };
4410 Box::pin(fut)
4411 }
4412 }
4413 let accept_compression_encodings = self.accept_compression_encodings;
4414 let send_compression_encodings = self.send_compression_encodings;
4415 let max_decoding_message_size = self.max_decoding_message_size;
4416 let max_encoding_message_size = self.max_encoding_message_size;
4417 let inner = self.inner.clone();
4418 let fut = async move {
4419 let inner = inner.0;
4420 let method = ControllerExpandVolumeSvc(inner);
4421 let codec = tonic::codec::ProstCodec::default();
4422 let mut grpc = tonic::server::Grpc::new(codec)
4423 .apply_compression_config(
4424 accept_compression_encodings,
4425 send_compression_encodings,
4426 )
4427 .apply_max_message_size_config(
4428 max_decoding_message_size,
4429 max_encoding_message_size,
4430 );
4431 let res = grpc.unary(method, req).await;
4432 Ok(res)
4433 };
4434 Box::pin(fut)
4435 }
4436 "/csi.v1.Controller/ControllerGetVolume" => {
4437 #[allow(non_camel_case_types)]
4438 struct ControllerGetVolumeSvc<T: Controller>(pub Arc<T>);
4439 impl<
4440 T: Controller,
4441 > tonic::server::UnaryService<super::ControllerGetVolumeRequest>
4442 for ControllerGetVolumeSvc<T> {
4443 type Response = super::ControllerGetVolumeResponse;
4444 type Future = BoxFuture<
4445 tonic::Response<Self::Response>,
4446 tonic::Status,
4447 >;
4448 fn call(
4449 &mut self,
4450 request: tonic::Request<super::ControllerGetVolumeRequest>,
4451 ) -> Self::Future {
4452 let inner = Arc::clone(&self.0);
4453 let fut = async move {
4454 <T as Controller>::controller_get_volume(&inner, request)
4455 .await
4456 };
4457 Box::pin(fut)
4458 }
4459 }
4460 let accept_compression_encodings = self.accept_compression_encodings;
4461 let send_compression_encodings = self.send_compression_encodings;
4462 let max_decoding_message_size = self.max_decoding_message_size;
4463 let max_encoding_message_size = self.max_encoding_message_size;
4464 let inner = self.inner.clone();
4465 let fut = async move {
4466 let inner = inner.0;
4467 let method = ControllerGetVolumeSvc(inner);
4468 let codec = tonic::codec::ProstCodec::default();
4469 let mut grpc = tonic::server::Grpc::new(codec)
4470 .apply_compression_config(
4471 accept_compression_encodings,
4472 send_compression_encodings,
4473 )
4474 .apply_max_message_size_config(
4475 max_decoding_message_size,
4476 max_encoding_message_size,
4477 );
4478 let res = grpc.unary(method, req).await;
4479 Ok(res)
4480 };
4481 Box::pin(fut)
4482 }
4483 "/csi.v1.Controller/ControllerModifyVolume" => {
4484 #[allow(non_camel_case_types)]
4485 struct ControllerModifyVolumeSvc<T: Controller>(pub Arc<T>);
4486 impl<
4487 T: Controller,
4488 > tonic::server::UnaryService<super::ControllerModifyVolumeRequest>
4489 for ControllerModifyVolumeSvc<T> {
4490 type Response = super::ControllerModifyVolumeResponse;
4491 type Future = BoxFuture<
4492 tonic::Response<Self::Response>,
4493 tonic::Status,
4494 >;
4495 fn call(
4496 &mut self,
4497 request: tonic::Request<super::ControllerModifyVolumeRequest>,
4498 ) -> Self::Future {
4499 let inner = Arc::clone(&self.0);
4500 let fut = async move {
4501 <T as Controller>::controller_modify_volume(&inner, request)
4502 .await
4503 };
4504 Box::pin(fut)
4505 }
4506 }
4507 let accept_compression_encodings = self.accept_compression_encodings;
4508 let send_compression_encodings = self.send_compression_encodings;
4509 let max_decoding_message_size = self.max_decoding_message_size;
4510 let max_encoding_message_size = self.max_encoding_message_size;
4511 let inner = self.inner.clone();
4512 let fut = async move {
4513 let inner = inner.0;
4514 let method = ControllerModifyVolumeSvc(inner);
4515 let codec = tonic::codec::ProstCodec::default();
4516 let mut grpc = tonic::server::Grpc::new(codec)
4517 .apply_compression_config(
4518 accept_compression_encodings,
4519 send_compression_encodings,
4520 )
4521 .apply_max_message_size_config(
4522 max_decoding_message_size,
4523 max_encoding_message_size,
4524 );
4525 let res = grpc.unary(method, req).await;
4526 Ok(res)
4527 };
4528 Box::pin(fut)
4529 }
4530 _ => {
4531 Box::pin(async move {
4532 Ok(
4533 http::Response::builder()
4534 .status(200)
4535 .header("grpc-status", "12")
4536 .header("content-type", "application/grpc")
4537 .body(empty_body())
4538 .unwrap(),
4539 )
4540 })
4541 }
4542 }
4543 }
4544 }
4545 impl<T: Controller> Clone for ControllerServer<T> {
4546 fn clone(&self) -> Self {
4547 let inner = self.inner.clone();
4548 Self {
4549 inner,
4550 accept_compression_encodings: self.accept_compression_encodings,
4551 send_compression_encodings: self.send_compression_encodings,
4552 max_decoding_message_size: self.max_decoding_message_size,
4553 max_encoding_message_size: self.max_encoding_message_size,
4554 }
4555 }
4556 }
4557 impl<T: Controller> Clone for _Inner<T> {
4558 fn clone(&self) -> Self {
4559 Self(Arc::clone(&self.0))
4560 }
4561 }
4562 impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
4563 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4564 write!(f, "{:?}", self.0)
4565 }
4566 }
4567 impl<T: Controller> tonic::server::NamedService for ControllerServer<T> {
4568 const NAME: &'static str = "csi.v1.Controller";
4569 }
4570}
4571pub mod group_controller_server {
4573 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
4574 use tonic::codegen::*;
4575 #[async_trait]
4577 pub trait GroupController: Send + Sync + 'static {
4578 async fn group_controller_get_capabilities(
4579 &self,
4580 request: tonic::Request<super::GroupControllerGetCapabilitiesRequest>,
4581 ) -> std::result::Result<
4582 tonic::Response<super::GroupControllerGetCapabilitiesResponse>,
4583 tonic::Status,
4584 >;
4585 async fn create_volume_group_snapshot(
4586 &self,
4587 request: tonic::Request<super::CreateVolumeGroupSnapshotRequest>,
4588 ) -> std::result::Result<
4589 tonic::Response<super::CreateVolumeGroupSnapshotResponse>,
4590 tonic::Status,
4591 >;
4592 async fn delete_volume_group_snapshot(
4593 &self,
4594 request: tonic::Request<super::DeleteVolumeGroupSnapshotRequest>,
4595 ) -> std::result::Result<
4596 tonic::Response<super::DeleteVolumeGroupSnapshotResponse>,
4597 tonic::Status,
4598 >;
4599 async fn get_volume_group_snapshot(
4600 &self,
4601 request: tonic::Request<super::GetVolumeGroupSnapshotRequest>,
4602 ) -> std::result::Result<
4603 tonic::Response<super::GetVolumeGroupSnapshotResponse>,
4604 tonic::Status,
4605 >;
4606 }
4607 #[derive(Debug)]
4608 pub struct GroupControllerServer<T: GroupController> {
4609 inner: _Inner<T>,
4610 accept_compression_encodings: EnabledCompressionEncodings,
4611 send_compression_encodings: EnabledCompressionEncodings,
4612 max_decoding_message_size: Option<usize>,
4613 max_encoding_message_size: Option<usize>,
4614 }
4615 struct _Inner<T>(Arc<T>);
4616 impl<T: GroupController> GroupControllerServer<T> {
4617 pub fn new(inner: T) -> Self {
4618 Self::from_arc(Arc::new(inner))
4619 }
4620 pub fn from_arc(inner: Arc<T>) -> Self {
4621 let inner = _Inner(inner);
4622 Self {
4623 inner,
4624 accept_compression_encodings: Default::default(),
4625 send_compression_encodings: Default::default(),
4626 max_decoding_message_size: None,
4627 max_encoding_message_size: None,
4628 }
4629 }
4630 pub fn with_interceptor<F>(
4631 inner: T,
4632 interceptor: F,
4633 ) -> InterceptedService<Self, F>
4634 where
4635 F: tonic::service::Interceptor,
4636 {
4637 InterceptedService::new(Self::new(inner), interceptor)
4638 }
4639 #[must_use]
4641 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4642 self.accept_compression_encodings.enable(encoding);
4643 self
4644 }
4645 #[must_use]
4647 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4648 self.send_compression_encodings.enable(encoding);
4649 self
4650 }
4651 #[must_use]
4655 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4656 self.max_decoding_message_size = Some(limit);
4657 self
4658 }
4659 #[must_use]
4663 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4664 self.max_encoding_message_size = Some(limit);
4665 self
4666 }
4667 }
4668 impl<T, B> tonic::codegen::Service<http::Request<B>> for GroupControllerServer<T>
4669 where
4670 T: GroupController,
4671 B: Body + Send + 'static,
4672 B::Error: Into<StdError> + Send + 'static,
4673 {
4674 type Response = http::Response<tonic::body::BoxBody>;
4675 type Error = std::convert::Infallible;
4676 type Future = BoxFuture<Self::Response, Self::Error>;
4677 fn poll_ready(
4678 &mut self,
4679 _cx: &mut Context<'_>,
4680 ) -> Poll<std::result::Result<(), Self::Error>> {
4681 Poll::Ready(Ok(()))
4682 }
4683 fn call(&mut self, req: http::Request<B>) -> Self::Future {
4684 let inner = self.inner.clone();
4685 match req.uri().path() {
4686 "/csi.v1.GroupController/GroupControllerGetCapabilities" => {
4687 #[allow(non_camel_case_types)]
4688 struct GroupControllerGetCapabilitiesSvc<T: GroupController>(
4689 pub Arc<T>,
4690 );
4691 impl<
4692 T: GroupController,
4693 > tonic::server::UnaryService<
4694 super::GroupControllerGetCapabilitiesRequest,
4695 > for GroupControllerGetCapabilitiesSvc<T> {
4696 type Response = super::GroupControllerGetCapabilitiesResponse;
4697 type Future = BoxFuture<
4698 tonic::Response<Self::Response>,
4699 tonic::Status,
4700 >;
4701 fn call(
4702 &mut self,
4703 request: tonic::Request<
4704 super::GroupControllerGetCapabilitiesRequest,
4705 >,
4706 ) -> Self::Future {
4707 let inner = Arc::clone(&self.0);
4708 let fut = async move {
4709 <T as GroupController>::group_controller_get_capabilities(
4710 &inner,
4711 request,
4712 )
4713 .await
4714 };
4715 Box::pin(fut)
4716 }
4717 }
4718 let accept_compression_encodings = self.accept_compression_encodings;
4719 let send_compression_encodings = self.send_compression_encodings;
4720 let max_decoding_message_size = self.max_decoding_message_size;
4721 let max_encoding_message_size = self.max_encoding_message_size;
4722 let inner = self.inner.clone();
4723 let fut = async move {
4724 let inner = inner.0;
4725 let method = GroupControllerGetCapabilitiesSvc(inner);
4726 let codec = tonic::codec::ProstCodec::default();
4727 let mut grpc = tonic::server::Grpc::new(codec)
4728 .apply_compression_config(
4729 accept_compression_encodings,
4730 send_compression_encodings,
4731 )
4732 .apply_max_message_size_config(
4733 max_decoding_message_size,
4734 max_encoding_message_size,
4735 );
4736 let res = grpc.unary(method, req).await;
4737 Ok(res)
4738 };
4739 Box::pin(fut)
4740 }
4741 "/csi.v1.GroupController/CreateVolumeGroupSnapshot" => {
4742 #[allow(non_camel_case_types)]
4743 struct CreateVolumeGroupSnapshotSvc<T: GroupController>(pub Arc<T>);
4744 impl<
4745 T: GroupController,
4746 > tonic::server::UnaryService<
4747 super::CreateVolumeGroupSnapshotRequest,
4748 > for CreateVolumeGroupSnapshotSvc<T> {
4749 type Response = super::CreateVolumeGroupSnapshotResponse;
4750 type Future = BoxFuture<
4751 tonic::Response<Self::Response>,
4752 tonic::Status,
4753 >;
4754 fn call(
4755 &mut self,
4756 request: tonic::Request<
4757 super::CreateVolumeGroupSnapshotRequest,
4758 >,
4759 ) -> Self::Future {
4760 let inner = Arc::clone(&self.0);
4761 let fut = async move {
4762 <T as GroupController>::create_volume_group_snapshot(
4763 &inner,
4764 request,
4765 )
4766 .await
4767 };
4768 Box::pin(fut)
4769 }
4770 }
4771 let accept_compression_encodings = self.accept_compression_encodings;
4772 let send_compression_encodings = self.send_compression_encodings;
4773 let max_decoding_message_size = self.max_decoding_message_size;
4774 let max_encoding_message_size = self.max_encoding_message_size;
4775 let inner = self.inner.clone();
4776 let fut = async move {
4777 let inner = inner.0;
4778 let method = CreateVolumeGroupSnapshotSvc(inner);
4779 let codec = tonic::codec::ProstCodec::default();
4780 let mut grpc = tonic::server::Grpc::new(codec)
4781 .apply_compression_config(
4782 accept_compression_encodings,
4783 send_compression_encodings,
4784 )
4785 .apply_max_message_size_config(
4786 max_decoding_message_size,
4787 max_encoding_message_size,
4788 );
4789 let res = grpc.unary(method, req).await;
4790 Ok(res)
4791 };
4792 Box::pin(fut)
4793 }
4794 "/csi.v1.GroupController/DeleteVolumeGroupSnapshot" => {
4795 #[allow(non_camel_case_types)]
4796 struct DeleteVolumeGroupSnapshotSvc<T: GroupController>(pub Arc<T>);
4797 impl<
4798 T: GroupController,
4799 > tonic::server::UnaryService<
4800 super::DeleteVolumeGroupSnapshotRequest,
4801 > for DeleteVolumeGroupSnapshotSvc<T> {
4802 type Response = super::DeleteVolumeGroupSnapshotResponse;
4803 type Future = BoxFuture<
4804 tonic::Response<Self::Response>,
4805 tonic::Status,
4806 >;
4807 fn call(
4808 &mut self,
4809 request: tonic::Request<
4810 super::DeleteVolumeGroupSnapshotRequest,
4811 >,
4812 ) -> Self::Future {
4813 let inner = Arc::clone(&self.0);
4814 let fut = async move {
4815 <T as GroupController>::delete_volume_group_snapshot(
4816 &inner,
4817 request,
4818 )
4819 .await
4820 };
4821 Box::pin(fut)
4822 }
4823 }
4824 let accept_compression_encodings = self.accept_compression_encodings;
4825 let send_compression_encodings = self.send_compression_encodings;
4826 let max_decoding_message_size = self.max_decoding_message_size;
4827 let max_encoding_message_size = self.max_encoding_message_size;
4828 let inner = self.inner.clone();
4829 let fut = async move {
4830 let inner = inner.0;
4831 let method = DeleteVolumeGroupSnapshotSvc(inner);
4832 let codec = tonic::codec::ProstCodec::default();
4833 let mut grpc = tonic::server::Grpc::new(codec)
4834 .apply_compression_config(
4835 accept_compression_encodings,
4836 send_compression_encodings,
4837 )
4838 .apply_max_message_size_config(
4839 max_decoding_message_size,
4840 max_encoding_message_size,
4841 );
4842 let res = grpc.unary(method, req).await;
4843 Ok(res)
4844 };
4845 Box::pin(fut)
4846 }
4847 "/csi.v1.GroupController/GetVolumeGroupSnapshot" => {
4848 #[allow(non_camel_case_types)]
4849 struct GetVolumeGroupSnapshotSvc<T: GroupController>(pub Arc<T>);
4850 impl<
4851 T: GroupController,
4852 > tonic::server::UnaryService<super::GetVolumeGroupSnapshotRequest>
4853 for GetVolumeGroupSnapshotSvc<T> {
4854 type Response = super::GetVolumeGroupSnapshotResponse;
4855 type Future = BoxFuture<
4856 tonic::Response<Self::Response>,
4857 tonic::Status,
4858 >;
4859 fn call(
4860 &mut self,
4861 request: tonic::Request<super::GetVolumeGroupSnapshotRequest>,
4862 ) -> Self::Future {
4863 let inner = Arc::clone(&self.0);
4864 let fut = async move {
4865 <T as GroupController>::get_volume_group_snapshot(
4866 &inner,
4867 request,
4868 )
4869 .await
4870 };
4871 Box::pin(fut)
4872 }
4873 }
4874 let accept_compression_encodings = self.accept_compression_encodings;
4875 let send_compression_encodings = self.send_compression_encodings;
4876 let max_decoding_message_size = self.max_decoding_message_size;
4877 let max_encoding_message_size = self.max_encoding_message_size;
4878 let inner = self.inner.clone();
4879 let fut = async move {
4880 let inner = inner.0;
4881 let method = GetVolumeGroupSnapshotSvc(inner);
4882 let codec = tonic::codec::ProstCodec::default();
4883 let mut grpc = tonic::server::Grpc::new(codec)
4884 .apply_compression_config(
4885 accept_compression_encodings,
4886 send_compression_encodings,
4887 )
4888 .apply_max_message_size_config(
4889 max_decoding_message_size,
4890 max_encoding_message_size,
4891 );
4892 let res = grpc.unary(method, req).await;
4893 Ok(res)
4894 };
4895 Box::pin(fut)
4896 }
4897 _ => {
4898 Box::pin(async move {
4899 Ok(
4900 http::Response::builder()
4901 .status(200)
4902 .header("grpc-status", "12")
4903 .header("content-type", "application/grpc")
4904 .body(empty_body())
4905 .unwrap(),
4906 )
4907 })
4908 }
4909 }
4910 }
4911 }
4912 impl<T: GroupController> Clone for GroupControllerServer<T> {
4913 fn clone(&self) -> Self {
4914 let inner = self.inner.clone();
4915 Self {
4916 inner,
4917 accept_compression_encodings: self.accept_compression_encodings,
4918 send_compression_encodings: self.send_compression_encodings,
4919 max_decoding_message_size: self.max_decoding_message_size,
4920 max_encoding_message_size: self.max_encoding_message_size,
4921 }
4922 }
4923 }
4924 impl<T: GroupController> Clone for _Inner<T> {
4925 fn clone(&self) -> Self {
4926 Self(Arc::clone(&self.0))
4927 }
4928 }
4929 impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
4930 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4931 write!(f, "{:?}", self.0)
4932 }
4933 }
4934 impl<T: GroupController> tonic::server::NamedService for GroupControllerServer<T> {
4935 const NAME: &'static str = "csi.v1.GroupController";
4936 }
4937}
4938pub mod node_server {
4940 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
4941 use tonic::codegen::*;
4942 #[async_trait]
4944 pub trait Node: Send + Sync + 'static {
4945 async fn node_stage_volume(
4946 &self,
4947 request: tonic::Request<super::NodeStageVolumeRequest>,
4948 ) -> std::result::Result<
4949 tonic::Response<super::NodeStageVolumeResponse>,
4950 tonic::Status,
4951 >;
4952 async fn node_unstage_volume(
4953 &self,
4954 request: tonic::Request<super::NodeUnstageVolumeRequest>,
4955 ) -> std::result::Result<
4956 tonic::Response<super::NodeUnstageVolumeResponse>,
4957 tonic::Status,
4958 >;
4959 async fn node_publish_volume(
4960 &self,
4961 request: tonic::Request<super::NodePublishVolumeRequest>,
4962 ) -> std::result::Result<
4963 tonic::Response<super::NodePublishVolumeResponse>,
4964 tonic::Status,
4965 >;
4966 async fn node_unpublish_volume(
4967 &self,
4968 request: tonic::Request<super::NodeUnpublishVolumeRequest>,
4969 ) -> std::result::Result<
4970 tonic::Response<super::NodeUnpublishVolumeResponse>,
4971 tonic::Status,
4972 >;
4973 async fn node_get_volume_stats(
4974 &self,
4975 request: tonic::Request<super::NodeGetVolumeStatsRequest>,
4976 ) -> std::result::Result<
4977 tonic::Response<super::NodeGetVolumeStatsResponse>,
4978 tonic::Status,
4979 >;
4980 async fn node_expand_volume(
4981 &self,
4982 request: tonic::Request<super::NodeExpandVolumeRequest>,
4983 ) -> std::result::Result<
4984 tonic::Response<super::NodeExpandVolumeResponse>,
4985 tonic::Status,
4986 >;
4987 async fn node_get_capabilities(
4988 &self,
4989 request: tonic::Request<super::NodeGetCapabilitiesRequest>,
4990 ) -> std::result::Result<
4991 tonic::Response<super::NodeGetCapabilitiesResponse>,
4992 tonic::Status,
4993 >;
4994 async fn node_get_info(
4995 &self,
4996 request: tonic::Request<super::NodeGetInfoRequest>,
4997 ) -> std::result::Result<
4998 tonic::Response<super::NodeGetInfoResponse>,
4999 tonic::Status,
5000 >;
5001 }
5002 #[derive(Debug)]
5003 pub struct NodeServer<T: Node> {
5004 inner: _Inner<T>,
5005 accept_compression_encodings: EnabledCompressionEncodings,
5006 send_compression_encodings: EnabledCompressionEncodings,
5007 max_decoding_message_size: Option<usize>,
5008 max_encoding_message_size: Option<usize>,
5009 }
5010 struct _Inner<T>(Arc<T>);
5011 impl<T: Node> NodeServer<T> {
5012 pub fn new(inner: T) -> Self {
5013 Self::from_arc(Arc::new(inner))
5014 }
5015 pub fn from_arc(inner: Arc<T>) -> Self {
5016 let inner = _Inner(inner);
5017 Self {
5018 inner,
5019 accept_compression_encodings: Default::default(),
5020 send_compression_encodings: Default::default(),
5021 max_decoding_message_size: None,
5022 max_encoding_message_size: None,
5023 }
5024 }
5025 pub fn with_interceptor<F>(
5026 inner: T,
5027 interceptor: F,
5028 ) -> InterceptedService<Self, F>
5029 where
5030 F: tonic::service::Interceptor,
5031 {
5032 InterceptedService::new(Self::new(inner), interceptor)
5033 }
5034 #[must_use]
5036 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5037 self.accept_compression_encodings.enable(encoding);
5038 self
5039 }
5040 #[must_use]
5042 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5043 self.send_compression_encodings.enable(encoding);
5044 self
5045 }
5046 #[must_use]
5050 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5051 self.max_decoding_message_size = Some(limit);
5052 self
5053 }
5054 #[must_use]
5058 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5059 self.max_encoding_message_size = Some(limit);
5060 self
5061 }
5062 }
5063 impl<T, B> tonic::codegen::Service<http::Request<B>> for NodeServer<T>
5064 where
5065 T: Node,
5066 B: Body + Send + 'static,
5067 B::Error: Into<StdError> + Send + 'static,
5068 {
5069 type Response = http::Response<tonic::body::BoxBody>;
5070 type Error = std::convert::Infallible;
5071 type Future = BoxFuture<Self::Response, Self::Error>;
5072 fn poll_ready(
5073 &mut self,
5074 _cx: &mut Context<'_>,
5075 ) -> Poll<std::result::Result<(), Self::Error>> {
5076 Poll::Ready(Ok(()))
5077 }
5078 fn call(&mut self, req: http::Request<B>) -> Self::Future {
5079 let inner = self.inner.clone();
5080 match req.uri().path() {
5081 "/csi.v1.Node/NodeStageVolume" => {
5082 #[allow(non_camel_case_types)]
5083 struct NodeStageVolumeSvc<T: Node>(pub Arc<T>);
5084 impl<
5085 T: Node,
5086 > tonic::server::UnaryService<super::NodeStageVolumeRequest>
5087 for NodeStageVolumeSvc<T> {
5088 type Response = super::NodeStageVolumeResponse;
5089 type Future = BoxFuture<
5090 tonic::Response<Self::Response>,
5091 tonic::Status,
5092 >;
5093 fn call(
5094 &mut self,
5095 request: tonic::Request<super::NodeStageVolumeRequest>,
5096 ) -> Self::Future {
5097 let inner = Arc::clone(&self.0);
5098 let fut = async move {
5099 <T as Node>::node_stage_volume(&inner, request).await
5100 };
5101 Box::pin(fut)
5102 }
5103 }
5104 let accept_compression_encodings = self.accept_compression_encodings;
5105 let send_compression_encodings = self.send_compression_encodings;
5106 let max_decoding_message_size = self.max_decoding_message_size;
5107 let max_encoding_message_size = self.max_encoding_message_size;
5108 let inner = self.inner.clone();
5109 let fut = async move {
5110 let inner = inner.0;
5111 let method = NodeStageVolumeSvc(inner);
5112 let codec = tonic::codec::ProstCodec::default();
5113 let mut grpc = tonic::server::Grpc::new(codec)
5114 .apply_compression_config(
5115 accept_compression_encodings,
5116 send_compression_encodings,
5117 )
5118 .apply_max_message_size_config(
5119 max_decoding_message_size,
5120 max_encoding_message_size,
5121 );
5122 let res = grpc.unary(method, req).await;
5123 Ok(res)
5124 };
5125 Box::pin(fut)
5126 }
5127 "/csi.v1.Node/NodeUnstageVolume" => {
5128 #[allow(non_camel_case_types)]
5129 struct NodeUnstageVolumeSvc<T: Node>(pub Arc<T>);
5130 impl<
5131 T: Node,
5132 > tonic::server::UnaryService<super::NodeUnstageVolumeRequest>
5133 for NodeUnstageVolumeSvc<T> {
5134 type Response = super::NodeUnstageVolumeResponse;
5135 type Future = BoxFuture<
5136 tonic::Response<Self::Response>,
5137 tonic::Status,
5138 >;
5139 fn call(
5140 &mut self,
5141 request: tonic::Request<super::NodeUnstageVolumeRequest>,
5142 ) -> Self::Future {
5143 let inner = Arc::clone(&self.0);
5144 let fut = async move {
5145 <T as Node>::node_unstage_volume(&inner, request).await
5146 };
5147 Box::pin(fut)
5148 }
5149 }
5150 let accept_compression_encodings = self.accept_compression_encodings;
5151 let send_compression_encodings = self.send_compression_encodings;
5152 let max_decoding_message_size = self.max_decoding_message_size;
5153 let max_encoding_message_size = self.max_encoding_message_size;
5154 let inner = self.inner.clone();
5155 let fut = async move {
5156 let inner = inner.0;
5157 let method = NodeUnstageVolumeSvc(inner);
5158 let codec = tonic::codec::ProstCodec::default();
5159 let mut grpc = tonic::server::Grpc::new(codec)
5160 .apply_compression_config(
5161 accept_compression_encodings,
5162 send_compression_encodings,
5163 )
5164 .apply_max_message_size_config(
5165 max_decoding_message_size,
5166 max_encoding_message_size,
5167 );
5168 let res = grpc.unary(method, req).await;
5169 Ok(res)
5170 };
5171 Box::pin(fut)
5172 }
5173 "/csi.v1.Node/NodePublishVolume" => {
5174 #[allow(non_camel_case_types)]
5175 struct NodePublishVolumeSvc<T: Node>(pub Arc<T>);
5176 impl<
5177 T: Node,
5178 > tonic::server::UnaryService<super::NodePublishVolumeRequest>
5179 for NodePublishVolumeSvc<T> {
5180 type Response = super::NodePublishVolumeResponse;
5181 type Future = BoxFuture<
5182 tonic::Response<Self::Response>,
5183 tonic::Status,
5184 >;
5185 fn call(
5186 &mut self,
5187 request: tonic::Request<super::NodePublishVolumeRequest>,
5188 ) -> Self::Future {
5189 let inner = Arc::clone(&self.0);
5190 let fut = async move {
5191 <T as Node>::node_publish_volume(&inner, request).await
5192 };
5193 Box::pin(fut)
5194 }
5195 }
5196 let accept_compression_encodings = self.accept_compression_encodings;
5197 let send_compression_encodings = self.send_compression_encodings;
5198 let max_decoding_message_size = self.max_decoding_message_size;
5199 let max_encoding_message_size = self.max_encoding_message_size;
5200 let inner = self.inner.clone();
5201 let fut = async move {
5202 let inner = inner.0;
5203 let method = NodePublishVolumeSvc(inner);
5204 let codec = tonic::codec::ProstCodec::default();
5205 let mut grpc = tonic::server::Grpc::new(codec)
5206 .apply_compression_config(
5207 accept_compression_encodings,
5208 send_compression_encodings,
5209 )
5210 .apply_max_message_size_config(
5211 max_decoding_message_size,
5212 max_encoding_message_size,
5213 );
5214 let res = grpc.unary(method, req).await;
5215 Ok(res)
5216 };
5217 Box::pin(fut)
5218 }
5219 "/csi.v1.Node/NodeUnpublishVolume" => {
5220 #[allow(non_camel_case_types)]
5221 struct NodeUnpublishVolumeSvc<T: Node>(pub Arc<T>);
5222 impl<
5223 T: Node,
5224 > tonic::server::UnaryService<super::NodeUnpublishVolumeRequest>
5225 for NodeUnpublishVolumeSvc<T> {
5226 type Response = super::NodeUnpublishVolumeResponse;
5227 type Future = BoxFuture<
5228 tonic::Response<Self::Response>,
5229 tonic::Status,
5230 >;
5231 fn call(
5232 &mut self,
5233 request: tonic::Request<super::NodeUnpublishVolumeRequest>,
5234 ) -> Self::Future {
5235 let inner = Arc::clone(&self.0);
5236 let fut = async move {
5237 <T as Node>::node_unpublish_volume(&inner, request).await
5238 };
5239 Box::pin(fut)
5240 }
5241 }
5242 let accept_compression_encodings = self.accept_compression_encodings;
5243 let send_compression_encodings = self.send_compression_encodings;
5244 let max_decoding_message_size = self.max_decoding_message_size;
5245 let max_encoding_message_size = self.max_encoding_message_size;
5246 let inner = self.inner.clone();
5247 let fut = async move {
5248 let inner = inner.0;
5249 let method = NodeUnpublishVolumeSvc(inner);
5250 let codec = tonic::codec::ProstCodec::default();
5251 let mut grpc = tonic::server::Grpc::new(codec)
5252 .apply_compression_config(
5253 accept_compression_encodings,
5254 send_compression_encodings,
5255 )
5256 .apply_max_message_size_config(
5257 max_decoding_message_size,
5258 max_encoding_message_size,
5259 );
5260 let res = grpc.unary(method, req).await;
5261 Ok(res)
5262 };
5263 Box::pin(fut)
5264 }
5265 "/csi.v1.Node/NodeGetVolumeStats" => {
5266 #[allow(non_camel_case_types)]
5267 struct NodeGetVolumeStatsSvc<T: Node>(pub Arc<T>);
5268 impl<
5269 T: Node,
5270 > tonic::server::UnaryService<super::NodeGetVolumeStatsRequest>
5271 for NodeGetVolumeStatsSvc<T> {
5272 type Response = super::NodeGetVolumeStatsResponse;
5273 type Future = BoxFuture<
5274 tonic::Response<Self::Response>,
5275 tonic::Status,
5276 >;
5277 fn call(
5278 &mut self,
5279 request: tonic::Request<super::NodeGetVolumeStatsRequest>,
5280 ) -> Self::Future {
5281 let inner = Arc::clone(&self.0);
5282 let fut = async move {
5283 <T as Node>::node_get_volume_stats(&inner, request).await
5284 };
5285 Box::pin(fut)
5286 }
5287 }
5288 let accept_compression_encodings = self.accept_compression_encodings;
5289 let send_compression_encodings = self.send_compression_encodings;
5290 let max_decoding_message_size = self.max_decoding_message_size;
5291 let max_encoding_message_size = self.max_encoding_message_size;
5292 let inner = self.inner.clone();
5293 let fut = async move {
5294 let inner = inner.0;
5295 let method = NodeGetVolumeStatsSvc(inner);
5296 let codec = tonic::codec::ProstCodec::default();
5297 let mut grpc = tonic::server::Grpc::new(codec)
5298 .apply_compression_config(
5299 accept_compression_encodings,
5300 send_compression_encodings,
5301 )
5302 .apply_max_message_size_config(
5303 max_decoding_message_size,
5304 max_encoding_message_size,
5305 );
5306 let res = grpc.unary(method, req).await;
5307 Ok(res)
5308 };
5309 Box::pin(fut)
5310 }
5311 "/csi.v1.Node/NodeExpandVolume" => {
5312 #[allow(non_camel_case_types)]
5313 struct NodeExpandVolumeSvc<T: Node>(pub Arc<T>);
5314 impl<
5315 T: Node,
5316 > tonic::server::UnaryService<super::NodeExpandVolumeRequest>
5317 for NodeExpandVolumeSvc<T> {
5318 type Response = super::NodeExpandVolumeResponse;
5319 type Future = BoxFuture<
5320 tonic::Response<Self::Response>,
5321 tonic::Status,
5322 >;
5323 fn call(
5324 &mut self,
5325 request: tonic::Request<super::NodeExpandVolumeRequest>,
5326 ) -> Self::Future {
5327 let inner = Arc::clone(&self.0);
5328 let fut = async move {
5329 <T as Node>::node_expand_volume(&inner, request).await
5330 };
5331 Box::pin(fut)
5332 }
5333 }
5334 let accept_compression_encodings = self.accept_compression_encodings;
5335 let send_compression_encodings = self.send_compression_encodings;
5336 let max_decoding_message_size = self.max_decoding_message_size;
5337 let max_encoding_message_size = self.max_encoding_message_size;
5338 let inner = self.inner.clone();
5339 let fut = async move {
5340 let inner = inner.0;
5341 let method = NodeExpandVolumeSvc(inner);
5342 let codec = tonic::codec::ProstCodec::default();
5343 let mut grpc = tonic::server::Grpc::new(codec)
5344 .apply_compression_config(
5345 accept_compression_encodings,
5346 send_compression_encodings,
5347 )
5348 .apply_max_message_size_config(
5349 max_decoding_message_size,
5350 max_encoding_message_size,
5351 );
5352 let res = grpc.unary(method, req).await;
5353 Ok(res)
5354 };
5355 Box::pin(fut)
5356 }
5357 "/csi.v1.Node/NodeGetCapabilities" => {
5358 #[allow(non_camel_case_types)]
5359 struct NodeGetCapabilitiesSvc<T: Node>(pub Arc<T>);
5360 impl<
5361 T: Node,
5362 > tonic::server::UnaryService<super::NodeGetCapabilitiesRequest>
5363 for NodeGetCapabilitiesSvc<T> {
5364 type Response = super::NodeGetCapabilitiesResponse;
5365 type Future = BoxFuture<
5366 tonic::Response<Self::Response>,
5367 tonic::Status,
5368 >;
5369 fn call(
5370 &mut self,
5371 request: tonic::Request<super::NodeGetCapabilitiesRequest>,
5372 ) -> Self::Future {
5373 let inner = Arc::clone(&self.0);
5374 let fut = async move {
5375 <T as Node>::node_get_capabilities(&inner, request).await
5376 };
5377 Box::pin(fut)
5378 }
5379 }
5380 let accept_compression_encodings = self.accept_compression_encodings;
5381 let send_compression_encodings = self.send_compression_encodings;
5382 let max_decoding_message_size = self.max_decoding_message_size;
5383 let max_encoding_message_size = self.max_encoding_message_size;
5384 let inner = self.inner.clone();
5385 let fut = async move {
5386 let inner = inner.0;
5387 let method = NodeGetCapabilitiesSvc(inner);
5388 let codec = tonic::codec::ProstCodec::default();
5389 let mut grpc = tonic::server::Grpc::new(codec)
5390 .apply_compression_config(
5391 accept_compression_encodings,
5392 send_compression_encodings,
5393 )
5394 .apply_max_message_size_config(
5395 max_decoding_message_size,
5396 max_encoding_message_size,
5397 );
5398 let res = grpc.unary(method, req).await;
5399 Ok(res)
5400 };
5401 Box::pin(fut)
5402 }
5403 "/csi.v1.Node/NodeGetInfo" => {
5404 #[allow(non_camel_case_types)]
5405 struct NodeGetInfoSvc<T: Node>(pub Arc<T>);
5406 impl<T: Node> tonic::server::UnaryService<super::NodeGetInfoRequest>
5407 for NodeGetInfoSvc<T> {
5408 type Response = super::NodeGetInfoResponse;
5409 type Future = BoxFuture<
5410 tonic::Response<Self::Response>,
5411 tonic::Status,
5412 >;
5413 fn call(
5414 &mut self,
5415 request: tonic::Request<super::NodeGetInfoRequest>,
5416 ) -> Self::Future {
5417 let inner = Arc::clone(&self.0);
5418 let fut = async move {
5419 <T as Node>::node_get_info(&inner, request).await
5420 };
5421 Box::pin(fut)
5422 }
5423 }
5424 let accept_compression_encodings = self.accept_compression_encodings;
5425 let send_compression_encodings = self.send_compression_encodings;
5426 let max_decoding_message_size = self.max_decoding_message_size;
5427 let max_encoding_message_size = self.max_encoding_message_size;
5428 let inner = self.inner.clone();
5429 let fut = async move {
5430 let inner = inner.0;
5431 let method = NodeGetInfoSvc(inner);
5432 let codec = tonic::codec::ProstCodec::default();
5433 let mut grpc = tonic::server::Grpc::new(codec)
5434 .apply_compression_config(
5435 accept_compression_encodings,
5436 send_compression_encodings,
5437 )
5438 .apply_max_message_size_config(
5439 max_decoding_message_size,
5440 max_encoding_message_size,
5441 );
5442 let res = grpc.unary(method, req).await;
5443 Ok(res)
5444 };
5445 Box::pin(fut)
5446 }
5447 _ => {
5448 Box::pin(async move {
5449 Ok(
5450 http::Response::builder()
5451 .status(200)
5452 .header("grpc-status", "12")
5453 .header("content-type", "application/grpc")
5454 .body(empty_body())
5455 .unwrap(),
5456 )
5457 })
5458 }
5459 }
5460 }
5461 }
5462 impl<T: Node> Clone for NodeServer<T> {
5463 fn clone(&self) -> Self {
5464 let inner = self.inner.clone();
5465 Self {
5466 inner,
5467 accept_compression_encodings: self.accept_compression_encodings,
5468 send_compression_encodings: self.send_compression_encodings,
5469 max_decoding_message_size: self.max_decoding_message_size,
5470 max_encoding_message_size: self.max_encoding_message_size,
5471 }
5472 }
5473 }
5474 impl<T: Node> Clone for _Inner<T> {
5475 fn clone(&self) -> Self {
5476 Self(Arc::clone(&self.0))
5477 }
5478 }
5479 impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
5480 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5481 write!(f, "{:?}", self.0)
5482 }
5483 }
5484 impl<T: Node> tonic::server::NamedService for NodeServer<T> {
5485 const NAME: &'static str = "csi.v1.Node";
5486 }
5487}