use of com.yahoo.vespa.hosted.controller.proxy.ProxyRequest in project vespa by vespa-engine.
the class ZoneApiHandler method proxy.
private HttpResponse proxy(HttpRequest request) {
Path path = new Path(request.getUri().getPath());
if (!path.matches("/zone/v2/{environment}/{region}/{*}")) {
return notFound(path);
}
ZoneId zoneId = ZoneId.from(path.get("environment"), path.get("region"));
if (!zoneRegistry.hasZone(zoneId)) {
throw new IllegalArgumentException("No such zone: " + zoneId.value());
}
try {
return proxy.handle(new ProxyRequest(request, "/zone/v2/"));
} catch (ProxyException | IOException e) {
throw new RuntimeException(e);
}
}
Aggregations