Apache Mesos
client.hpp
Go to the documentation of this file.
1 // Licensed to the Apache Software Foundation (ASF) under one
2 // or more contributor license agreements. See the NOTICE file
3 // distributed with this work for additional information
4 // regarding copyright ownership. The ASF licenses this file
5 // to you under the Apache License, Version 2.0 (the
6 // "License"); you may not use this file except in compliance
7 // with the License. You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 
17 #ifndef __CSI_CLIENT_HPP__
18 #define __CSI_CLIENT_HPP__
19 
20 #include <csi/spec.hpp>
21 
22 #include <process/grpc.hpp>
23 
24 #include "csi/rpc.hpp"
25 
26 namespace mesos {
27 namespace csi {
28 namespace v0 {
29 
30 class Client
31 {
32 public:
34  const process::grpc::client::Runtime& _runtime)
35  : connection(_connection), runtime(_runtime) {}
36 
37  template <RPC rpc>
40 
41 private:
44 };
45 
46 
47 template <>
49 Client::call<GET_PLUGIN_INFO>(
50  GetPluginInfoRequest request);
51 
52 
53 template <>
55 Client::call<GET_PLUGIN_CAPABILITIES>(
56  GetPluginCapabilitiesRequest request);
57 
58 
59 template <>
61 Client::call<PROBE>(
62  ProbeRequest request);
63 
64 
65 template <>
67 Client::call<CREATE_VOLUME>(
68  CreateVolumeRequest request);
69 
70 
71 template <>
73 Client::call<DELETE_VOLUME>(
74  DeleteVolumeRequest request);
75 
76 
77 template <>
79 Client::call<CONTROLLER_PUBLISH_VOLUME>(
80  ControllerPublishVolumeRequest request);
81 
82 
83 template <>
85 Client::call<CONTROLLER_UNPUBLISH_VOLUME>(
86  ControllerUnpublishVolumeRequest request);
87 
88 
89 template <>
91 Client::call<VALIDATE_VOLUME_CAPABILITIES>(
92  ValidateVolumeCapabilitiesRequest request);
93 
94 
95 template <>
97 Client::call<LIST_VOLUMES>(
98  ListVolumesRequest request);
99 
100 
101 template <>
103 Client::call<GET_CAPACITY>(
104  GetCapacityRequest request);
105 
106 
107 template <>
109 Client::call<CONTROLLER_GET_CAPABILITIES>(
110  ControllerGetCapabilitiesRequest request);
111 
112 
113 template <>
115 Client::call<NODE_STAGE_VOLUME>(
116  NodeStageVolumeRequest request);
117 
118 
119 template <>
121 Client::call<NODE_UNSTAGE_VOLUME>(
122  NodeUnstageVolumeRequest request);
123 
124 
125 template <>
127 Client::call<NODE_PUBLISH_VOLUME>(
128  NodePublishVolumeRequest request);
129 
130 
131 template <>
133 Client::call<NODE_UNPUBLISH_VOLUME>(
134  NodeUnpublishVolumeRequest request);
135 
136 
137 template <>
139 Client::call<NODE_GET_ID>(
140  NodeGetIdRequest request);
141 
142 
143 template <>
145 Client::call<NODE_GET_CAPABILITIES>(
146  NodeGetCapabilitiesRequest request);
147 
148 } // namespace v0 {
149 } // namespace csi {
150 } // namespace mesos {
151 
152 #endif // __CSI_CLIENT_HPP__
Future< Response > request(const Request &request, bool streamedResponse=false)
Asynchronously sends an HTTP request to the process and returns the HTTP response once the entire res...
A copyable interface to manage a connection to a gRPC server.
Definition: grpc.hpp:99
Definition: utils.hpp:37
process::Future< typename RPCTraits< rpc >::response_type > call(typename RPCTraits< rpc >::request_type request)
A copyable interface to manage an internal runtime process for asynchronous gRPC calls.
Definition: grpc.hpp:127
Definition: spec.hpp:30
Definition: rpc.hpp:56
Client(const process::grpc::client::Connection &_connection, const process::grpc::client::Runtime &_runtime)
Definition: client.hpp:33
Definition: client.hpp:30
Definition: future.hpp:58