Apache Mesos
v1_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_V1_CLIENT_HPP__
18 #define __CSI_V1_CLIENT_HPP__
19 
20 #include <mesos/csi/v1.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 v1 {
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  createSnapshot(CreateSnapshotRequest request);
76 
78  deleteSnapshot(DeleteSnapshotRequest request);
79 
81  listSnapshots(ListSnapshotsRequest request);
82 
84  controllerExpandVolume(ControllerExpandVolumeRequest request);
85 
87  nodeStageVolume(NodeStageVolumeRequest request);
88 
90  nodeUnstageVolume(NodeUnstageVolumeRequest request);
91 
93  nodePublishVolume(NodePublishVolumeRequest request);
94 
96  nodeUnpublishVolume(NodeUnpublishVolumeRequest request);
97 
99  nodeGetVolumeStats(NodeGetVolumeStatsRequest request);
100 
102  nodeExpandVolume(NodeExpandVolumeRequest request);
103 
105  nodeGetCapabilities(NodeGetCapabilitiesRequest request);
106 
108  nodeGetInfo(NodeGetInfoRequest request);
109 
110 private:
113 };
114 
115 } // namespace v1 {
116 } // namespace csi {
117 } // namespace mesos {
118 
119 #endif // __CSI_V1_CLIENT_HPP__
process::Future< RPCResult< ListVolumesResponse > > listVolumes(ListVolumesRequest request)
process::Future< RPCResult< GetPluginInfoResponse > > getPluginInfo(GetPluginInfoRequest request)
process::Future< RPCResult< ProbeResponse > > probe(ProbeRequest request)
process::Future< RPCResult< GetPluginCapabilitiesResponse > > getPluginCapabilities(GetPluginCapabilitiesRequest request)
process::Future< RPCResult< NodeStageVolumeResponse > > nodeStageVolume(NodeStageVolumeRequest 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< RPCResult< NodeGetCapabilitiesResponse > > nodeGetCapabilities(NodeGetCapabilitiesRequest request)
Definition: check.hpp:33
process::Future< RPCResult< DeleteVolumeResponse > > deleteVolume(DeleteVolumeRequest request)
process::Future< RPCResult< NodeUnpublishVolumeResponse > > nodeUnpublishVolume(NodeUnpublishVolumeRequest request)
process::Future< RPCResult< ControllerPublishVolumeResponse > > controllerPublishVolume(ControllerPublishVolumeRequest request)
process::Future< RPCResult< DeleteSnapshotResponse > > deleteSnapshot(DeleteSnapshotRequest request)
A copyable interface to manage a connection to a gRPC server.
Definition: grpc.hpp:112
Definition: v0.hpp:49
process::Future< RPCResult< CreateVolumeResponse > > createVolume(CreateVolumeRequest request)
Client(const process::grpc::client::Connection &_connection, const process::grpc::client::Runtime &_runtime)
Definition: v1_client.hpp:38
Definition: v1_client.hpp:35
process::Future< RPCResult< NodeUnstageVolumeResponse > > nodeUnstageVolume(NodeUnstageVolumeRequest request)
process::Future< RPCResult< ControllerUnpublishVolumeResponse > > controllerUnpublishVolume(ControllerUnpublishVolumeRequest request)
process::Future< RPCResult< ListSnapshotsResponse > > listSnapshots(ListSnapshotsRequest 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< NodeExpandVolumeResponse > > nodeExpandVolume(NodeExpandVolumeRequest request)
process::Future< RPCResult< ControllerGetCapabilitiesResponse > > controllerGetCapabilities(ControllerGetCapabilitiesRequest request)
process::Future< RPCResult< NodeGetVolumeStatsResponse > > nodeGetVolumeStats(NodeGetVolumeStatsRequest request)
process::Future< RPCResult< CreateSnapshotResponse > > createSnapshot(CreateSnapshotRequest request)
process::Future< RPCResult< ControllerExpandVolumeResponse > > controllerExpandVolume(ControllerExpandVolumeRequest request)
process::Future< RPCResult< ValidateVolumeCapabilitiesResponse > > validateVolumeCapabilities(ValidateVolumeCapabilitiesRequest request)
process::Future< RPCResult< GetCapacityResponse > > getCapacity(GetCapacityRequest request)
process::Future< RPCResult< NodeGetInfoResponse > > nodeGetInfo(NodeGetInfoRequest request)
Definition: future.hpp:58
process::Future< RPCResult< NodePublishVolumeResponse > > nodePublishVolume(NodePublishVolumeRequest request)