| 264 | |
| 265 | |
| 266 | Future<Bytes> VolumeManagerProcess::getCapacity( |
| 267 | const CSIVolume::VolumeCapability& capability, |
| 268 | const Map<string, string>& parameters) |
| 269 | { |
| 270 | if (!controllerCapabilities->getCapacity) { |
| 271 | return Bytes(0); |
| 272 | } |
| 273 | |
| 274 | GetCapacityRequest request; |
| 275 | *request.add_volume_capabilities() = evolve(capability); |
| 276 | *request.mutable_parameters() = parameters; |
| 277 | |
| 278 | return call(CONTROLLER_SERVICE, &Client::getCapacity, std::move(request)) |
| 279 | .then([](const GetCapacityResponse& response) { |
| 280 | return Bytes(response.available_capacity()); |
| 281 | }); |
| 282 | } |
| 283 | |
| 284 | |
| 285 | Future<VolumeInfo> VolumeManagerProcess::createVolume( |