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 <process/grpc.hpp>
23 
24 #include <csi/spec.hpp>
25 
26 namespace mesos {
27 namespace csi {
28 
29 class Client
30 {
31 public:
32  Client(const std::string& uri,
33  const process::grpc::client::Runtime& _runtime)
34  : channel(uri),
35  runtime(_runtime) {}
36 
37  // RPCs for the Identity service.
39  GetSupportedVersions(const GetSupportedVersionsRequest& request);
40 
42  GetPluginInfo(const GetPluginInfoRequest& request);
43 
44  // RPCs for the Controller service.
46  CreateVolume(const CreateVolumeRequest& request);
47 
49  DeleteVolume(const DeleteVolumeRequest& request);
50 
52  ControllerPublishVolume(const ControllerPublishVolumeRequest& request);
53 
55  ControllerUnpublishVolume(const ControllerUnpublishVolumeRequest& request);
56 
59  const ValidateVolumeCapabilitiesRequest& request);
60 
62  ListVolumes(const ListVolumesRequest& request);
63 
65  GetCapacity(const GetCapacityRequest& request);
66 
68  ControllerProbe(const ControllerProbeRequest& request);
69 
71  ControllerGetCapabilities(const ControllerGetCapabilitiesRequest& request);
72 
73  // RPCs for the Node service.
75  NodePublishVolume(const NodePublishVolumeRequest& request);
76 
78  NodeUnpublishVolume(const NodeUnpublishVolumeRequest& request);
79 
81  GetNodeID(const GetNodeIDRequest& request);
82 
84  NodeProbe(const NodeProbeRequest& request);
85 
87  NodeGetCapabilities(const NodeGetCapabilitiesRequest& request);
88 
89 private:
90  process::grpc::Channel channel;
92 };
93 
94 } // namespace csi {
95 } // namespace mesos {
96 
97 #endif // __CSI_CLIENT_HPP__
process::Future< ListVolumesResponse > ListVolumes(const ListVolumesRequest &request)
process::Future< ValidateVolumeCapabilitiesResponse > ValidateVolumeCapabilities(const ValidateVolumeCapabilitiesRequest &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< ControllerPublishVolumeResponse > ControllerPublishVolume(const ControllerPublishVolumeRequest &request)
process::Future< GetSupportedVersionsResponse > GetSupportedVersions(const GetSupportedVersionsRequest &request)
process::Future< GetCapacityResponse > GetCapacity(const GetCapacityRequest &request)
process::Future< CreateVolumeResponse > CreateVolume(const CreateVolumeRequest &request)
process::Future< GetNodeIDResponse > GetNodeID(const GetNodeIDRequest &request)
process::Future< GetPluginInfoResponse > GetPluginInfo(const GetPluginInfoRequest &request)
Definition: client.hpp:29
process::Future< ControllerGetCapabilitiesResponse > ControllerGetCapabilities(const ControllerGetCapabilitiesRequest &request)
process::Future< NodeProbeResponse > NodeProbe(const NodeProbeRequest &request)
A copyable interface to manage an internal gRPC runtime instance for asynchronous gRPC calls...
Definition: grpc.hpp:104
process::Future< NodeGetCapabilitiesResponse > NodeGetCapabilities(const NodeGetCapabilitiesRequest &request)
process::Future< NodePublishVolumeResponse > NodePublishVolume(const NodePublishVolumeRequest &request)
process::Future< DeleteVolumeResponse > DeleteVolume(const DeleteVolumeRequest &request)
A copyable interface to manage a connection to a gRPC server.
Definition: grpc.hpp:59
process::Future< NodeUnpublishVolumeResponse > NodeUnpublishVolume(const NodeUnpublishVolumeRequest &request)
process::Future< ControllerProbeResponse > ControllerProbe(const ControllerProbeRequest &request)
Client(const std::string &uri, const process::grpc::client::Runtime &_runtime)
Definition: client.hpp:32
process::Future< ControllerUnpublishVolumeResponse > ControllerUnpublishVolume(const ControllerUnpublishVolumeRequest &request)
Definition: future.hpp:57