use of com.yahoo.vespa.config.server.http.HttpConfigRequest in project vespa by vespa-engine.
the class HttpGetConfigHandler method handleGET.
@Override
public HttpResponse handleGET(HttpRequest req) {
HttpConfigRequest request = HttpConfigRequest.createFromRequestV2(req);
RequestHandler requestHandler = HttpConfigRequests.getRequestHandler(tenants, request);
HttpConfigRequest.validateRequestKey(request.getConfigKey(), requestHandler, request.getApplicationId());
return HttpConfigResponse.createFromConfig(resolveConfig(request, requestHandler));
}
use of com.yahoo.vespa.config.server.http.HttpConfigRequest in project vespa by vespa-engine.
the class HttpGetConfigHandlerTest method require_that_request_gets_correct_fields_with_full_appid.
@Test
public void require_that_request_gets_correct_fields_with_full_appid() {
String uriLongAppId = "http://yahoo.com:8080/config/v2/tenant/bill/application/sookie/environment/dev/region/bellefleur/instance/sam/foo.bar/myid";
HttpRequest r = HttpRequest.createTestRequest(uriLongAppId, GET);
HttpConfigRequest req = HttpConfigRequest.createFromRequestV2(r);
assertThat(req.getApplicationId().tenant().value(), is("bill"));
assertThat(req.getApplicationId().application().value(), is("sookie"));
assertThat(req.getApplicationId().instance().value(), is("sam"));
}
use of com.yahoo.vespa.config.server.http.HttpConfigRequest in project vespa by vespa-engine.
the class HttpGetConfigHandlerTest method require_that_request_gets_correct_fields_with_short_appid.
@Test
public void require_that_request_gets_correct_fields_with_short_appid() {
String uriShortAppId = "http://yahoo.com:8080/config/v2/tenant/jason/application/alcide/foo.bar/myid";
HttpRequest r = HttpRequest.createTestRequest(uriShortAppId, GET);
HttpConfigRequest req = HttpConfigRequest.createFromRequestV2(r);
assertThat(req.getApplicationId().tenant().value(), is("jason"));
assertThat(req.getApplicationId().application().value(), is("alcide"));
assertThat(req.getApplicationId().instance().value(), is("default"));
}
Aggregations