17 #ifndef __CSI_V0_UTILS_HPP__ 18 #define __CSI_V0_UTILS_HPP__ 20 #include <google/protobuf/message.h> 40 template <
typename Iterable>
43 foreach (
const auto& capability, capabilities) {
44 if (capability.has_service() &&
45 PluginCapability::Service::Type_IsValid(
46 capability.service().type())) {
47 switch (capability.service().type()) {
57 case google::protobuf::kint32min:
58 case google::protobuf::kint32max:
73 template <
typename Iterable>
76 foreach (
const auto& capability, capabilities) {
77 if (capability.has_rpc() &&
78 ControllerServiceCapability::RPC::Type_IsValid(
79 capability.rpc().type())) {
80 switch (capability.rpc().type()) {
83 case ControllerServiceCapability::RPC::CREATE_DELETE_VOLUME:
84 createDeleteVolume =
true;
86 case ControllerServiceCapability::RPC::PUBLISH_UNPUBLISH_VOLUME:
87 publishUnpublishVolume =
true;
89 case ControllerServiceCapability::RPC::LIST_VOLUMES:
92 case ControllerServiceCapability::RPC::GET_CAPACITY:
99 case google::protobuf::kint32min:
100 case google::protobuf::kint32max:
107 bool createDeleteVolume =
false;
108 bool publishUnpublishVolume =
false;
109 bool listVolumes =
false;
110 bool getCapacity =
false;
118 template <
typename Iterable>
121 foreach (
const auto& capability, capabilities) {
122 if (capability.has_rpc() &&
123 NodeServiceCapability::RPC::Type_IsValid(capability.rpc().type())) {
124 switch (capability.rpc().type()) {
127 case NodeServiceCapability::RPC::STAGE_UNSTAGE_VOLUME:
128 stageUnstageVolume =
true;
134 case google::protobuf::kint32min:
135 case google::protobuf::kint32max:
142 bool stageUnstageVolume =
false;
147 CSIVolume::VolumeCapability
devolve(
const VolumeCapability& capability);
149 google::protobuf::RepeatedPtrField<CSIVolume::VolumeCapability>
devolve(
150 const google::protobuf::RepeatedPtrField<VolumeCapability>& capabilities);
154 VolumeCapability
evolve(
const CSIVolume::VolumeCapability& capability);
156 google::protobuf::RepeatedPtrField<VolumeCapability>
evolve(
157 const google::protobuf::RepeatedPtrField<CSIVolume::VolumeCapability>&
164 #endif // __CSI_V0_UTILS_HPP__ Definition: v0_utils.hpp:69
constexpr Service CONTROLLER_SERVICE
Definition: service_manager.hpp:40
PluginCapabilities()=default
Volume::Source::CSIVolume CSIVolume
Definition: v0_utils.hpp:33
Definition: v0_utils.hpp:36
const int UNKNOWN
Definition: diagnosis.hpp:39
#define UNREACHABLE()
Definition: unreachable.hpp:22
CSIVolume::VolumeCapability devolve(const VolumeCapability &capability)
ControllerCapabilities(const Iterable &capabilities)
Definition: v0_utils.hpp:74
bool controllerService
Definition: v0_utils.hpp:65
Definition: v0_utils.hpp:114
PluginCapabilities(const Iterable &capabilities)
Definition: v0_utils.hpp:41
VolumeCapability evolve(const CSIVolume::VolumeCapability &capability)
NodeCapabilities(const Iterable &capabilities)
Definition: v0_utils.hpp:119