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 <string>
21 
22 #include <csi/spec.hpp>
23 
24 #include <process/grpc.hpp>
25 
26 namespace mesos {
27 namespace csi {
28 namespace v0 {
29 
30 class Client
31 {
32 public:
33  Client(const process::grpc::Channel& _channel,
34  const process::grpc::client::Runtime& _runtime)
35  : channel(_channel), runtime(_runtime) {}
36 
37  // RPCs for the Identity service.
39  GetPluginInfo(const GetPluginInfoRequest& request);
40 
42  GetPluginCapabilities(const GetPluginCapabilitiesRequest& request);
43 
45  Probe(const ProbeRequest& request);
46 
47  // RPCs for the Controller service.
49  CreateVolume(const CreateVolumeRequest& request);
50 
52  DeleteVolume(const DeleteVolumeRequest& request);
53 
55  ControllerPublishVolume(const ControllerPublishVolumeRequest& request);
56 
58  ControllerUnpublishVolume(const ControllerUnpublishVolumeRequest& request);
59 
62  const ValidateVolumeCapabilitiesRequest& request);
63 
65  ListVolumes(const ListVolumesRequest& request);
66 
68  GetCapacity(const GetCapacityRequest& request);
69 
71  ControllerGetCapabilities(const ControllerGetCapabilitiesRequest& request);
72 
73  // RPCs for the Node service.
75  NodeStageVolume(const NodeStageVolumeRequest& request);
76 
78  NodeUnstageVolume(const NodeUnstageVolumeRequest& request);
79 
81  NodePublishVolume(const NodePublishVolumeRequest& request);
82 
84  NodeUnpublishVolume(const NodeUnpublishVolumeRequest& request);
85 
87  NodeGetId(const NodeGetIdRequest& request);
88 
90  NodeGetCapabilities(const NodeGetCapabilitiesRequest& request);
91 
92 private:
93  process::grpc::Channel channel;
95 };
96 
97 } // namespace v0 {
98 } // namespace csi {
99 } // namespace mesos {
100 
101 #endif // __CSI_CLIENT_HPP__
process::Future< ControllerUnpublishVolumeResponse > ControllerUnpublishVolume(const ControllerUnpublishVolumeRequest &request)
process::Future< NodeStageVolumeResponse > NodeStageVolume(const NodeStageVolumeRequest &request)
process::Future< DeleteVolumeResponse > DeleteVolume(const DeleteVolumeRequest &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...
process::Future< CreateVolumeResponse > CreateVolume(const CreateVolumeRequest &request)
process::Future< NodeUnstageVolumeResponse > NodeUnstageVolume(const NodeUnstageVolumeRequest &request)
process::Future< GetPluginCapabilitiesResponse > GetPluginCapabilities(const GetPluginCapabilitiesRequest &request)
process::Future< ValidateVolumeCapabilitiesResponse > ValidateVolumeCapabilities(const ValidateVolumeCapabilitiesRequest &request)
process::Future< NodeGetCapabilitiesResponse > NodeGetCapabilities(const NodeGetCapabilitiesRequest &request)
process::Future< NodePublishVolumeResponse > NodePublishVolume(const NodePublishVolumeRequest &request)
Definition: utils.hpp:37
process::Future< NodeGetIdResponse > NodeGetId(const NodeGetIdRequest &request)
process::Future< ProbeResponse > Probe(const ProbeRequest &request)
process::Future< GetCapacityResponse > GetCapacity(const GetCapacityRequest &request)
A copyable interface to manage an internal gRPC runtime instance for asynchronous gRPC calls...
Definition: grpc.hpp:107
Definition: spec.hpp:30
process::Future< GetPluginInfoResponse > GetPluginInfo(const GetPluginInfoRequest &request)
process::Future< ControllerGetCapabilitiesResponse > ControllerGetCapabilities(const ControllerGetCapabilitiesRequest &request)
Client(const process::grpc::Channel &_channel, const process::grpc::client::Runtime &_runtime)
Definition: client.hpp:33
process::Future< NodeUnpublishVolumeResponse > NodeUnpublishVolume(const NodeUnpublishVolumeRequest &request)
A copyable interface to manage a connection to a gRPC server.
Definition: grpc.hpp:59
process::Future< ControllerPublishVolumeResponse > ControllerPublishVolume(const ControllerPublishVolumeRequest &request)
process::Future< ListVolumesResponse > ListVolumes(const ListVolumesRequest &request)
Definition: client.hpp:30
Definition: future.hpp:57