Apache Mesos
v0_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_V0_CLIENT_HPP__
18 #define __CSI_V0_CLIENT_HPP__
19 
20 #include <mesos/csi/v0.hpp>
21 
22 #include <process/future.hpp>
23 #include <process/grpc.hpp>
24 
25 #include <stout/try.hpp>
26 
27 namespace mesos {
28 namespace csi {
29 namespace v0 {
30 
31 template <typename Response>
33 
34 
35 class Client
36 {
37 public:
39  const process::grpc::client::Runtime& _runtime)
40  : connection(_connection), runtime(_runtime) {}
41 
43  getPluginInfo(GetPluginInfoRequest request);
44 
46  getPluginCapabilities(GetPluginCapabilitiesRequest request);
47 
48  process::Future<RPCResult<ProbeResponse>> probe(ProbeRequest request);
49 
51  createVolume(CreateVolumeRequest request);
52 
54  deleteVolume(DeleteVolumeRequest request);
55 
57  controllerPublishVolume(ControllerPublishVolumeRequest request);
58 
60  controllerUnpublishVolume(ControllerUnpublishVolumeRequest request);
61 
63  validateVolumeCapabilities(ValidateVolumeCapabilitiesRequest request);
64 
66  listVolumes(ListVolumesRequest request);
67 
69  getCapacity(GetCapacityRequest request);
70 
72  controllerGetCapabilities(ControllerGetCapabilitiesRequest request);
73 
75  nodeStageVolume(NodeStageVolumeRequest request);
76 
78  nodeUnstageVolume(NodeUnstageVolumeRequest request);
79 
81  nodePublishVolume(NodePublishVolumeRequest request);
82 
84  nodeUnpublishVolume(NodeUnpublishVolumeRequest request);
85 
87  nodeGetId(NodeGetIdRequest request);
88 
90  nodeGetCapabilities(NodeGetCapabilitiesRequest request);
91 
92 private:
95 };
96 
97 } // namespace v0 {
98 } // namespace csi {
99 } // namespace mesos {
100 
101 #endif // __CSI_V0_CLIENT_HPP__
process::Future< RPCResult< ControllerPublishVolumeResponse > > controllerPublishVolume(ControllerPublishVolumeRequest request)
process::Future< RPCResult< ControllerGetCapabilitiesResponse > > controllerGetCapabilities(ControllerGetCapabilitiesRequest request)
process::Future< RPCResult< NodeStageVolumeResponse > > nodeStageVolume(NodeStageVolumeRequest request)
process::Future< RPCResult< NodeUnpublishVolumeResponse > > nodeUnpublishVolume(NodeUnpublishVolumeRequest request)
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...
Definition: check.hpp:33
process::Future< RPCResult< ListVolumesResponse > > listVolumes(ListVolumesRequest request)
process::Future< RPCResult< NodeGetIdResponse > > nodeGetId(NodeGetIdRequest request)
process::Future< RPCResult< NodePublishVolumeResponse > > nodePublishVolume(NodePublishVolumeRequest request)
process::Future< RPCResult< GetCapacityResponse > > getCapacity(GetCapacityRequest request)
process::Future< RPCResult< ControllerUnpublishVolumeResponse > > controllerUnpublishVolume(ControllerUnpublishVolumeRequest request)
process::Future< RPCResult< NodeGetCapabilitiesResponse > > nodeGetCapabilities(NodeGetCapabilitiesRequest request)
A copyable interface to manage a connection to a gRPC server.
Definition: grpc.hpp:112
Definition: v0.hpp:49
process::Future< RPCResult< NodeUnstageVolumeResponse > > nodeUnstageVolume(NodeUnstageVolumeRequest request)
process::Future< RPCResult< CreateVolumeResponse > > createVolume(CreateVolumeRequest request)
process::Future< RPCResult< ValidateVolumeCapabilitiesResponse > > validateVolumeCapabilities(ValidateVolumeCapabilitiesRequest request)
A copyable interface to manage an internal runtime process for asynchronous gRPC calls.
Definition: grpc.hpp:157
Definition: agent.hpp:25
process::Future< RPCResult< DeleteVolumeResponse > > deleteVolume(DeleteVolumeRequest request)
process::Future< RPCResult< GetPluginInfoResponse > > getPluginInfo(GetPluginInfoRequest request)
process::Future< RPCResult< ProbeResponse > > probe(ProbeRequest request)
Client(const process::grpc::client::Connection &_connection, const process::grpc::client::Runtime &_runtime)
Definition: v0_client.hpp:38
Definition: v0_client.hpp:35
process::Future< RPCResult< GetPluginCapabilitiesResponse > > getPluginCapabilities(GetPluginCapabilitiesRequest request)
Definition: future.hpp:58