use of com.yahoo.vespa.config.ConfigKey in project vespa by vespa-engine.
the class UpstreamConfigSubscriber method subscribe.
void subscribe() {
subscriber = new GenericConfigSubscriber(requesterPool);
ConfigKey<?> key = config.getKey();
handle = subscriber.subscribe(new ConfigKey<RawConfig>(key.getName(), key.getConfigId(), key.getNamespace()), config.getDefContent(), configSourceSet, timingValues);
}
use of com.yahoo.vespa.config.ConfigKey in project vespa by vespa-engine.
the class SuperModelControllerTest method test_unknown_config_definition.
@Test(expected = UnknownConfigDefinitionException.class)
public void test_unknown_config_definition() {
String md5 = "asdfasf";
Request request = JRTClientConfigRequestV3.createWithParams(new ConfigKey<>("foo", "id", "bar", md5, null), DefContent.fromList(Collections.emptyList()), "fromHost", md5, 1, 1, Trace.createDummy(), CompressionType.UNCOMPRESSED, Optional.empty()).getRequest();
JRTServerConfigRequestV3 v3Request = JRTServerConfigRequestV3.createFromRequest(request);
handler.resolveConfig(v3Request);
}
use of com.yahoo.vespa.config.ConfigKey in project vespa by vespa-engine.
the class HttpListConfigsRequest method createFromNamedListRequestSimpleAppId.
private static HttpListConfigsRequest createFromNamedListRequestSimpleAppId(HttpRequest req, BindingMatch<?> bm) {
TenantName tenant = TenantName.from(bm.group(2));
ApplicationName application = ApplicationName.from(bm.group(3));
String conf = bm.group(4);
String cId;
String cName;
String cNamespace;
if (bm.groupCount() >= 6) {
cId = bm.group(5);
} else {
cId = "";
}
Tuple2<String, String> nns = HttpConfigRequest.nameAndNamespace(conf);
cName = nns.first;
cNamespace = nns.second;
ConfigKey<?> key = new ConfigKey<>(cName, cId, cNamespace);
return new HttpListConfigsRequest(key, new ApplicationId.Builder().tenant(tenant).applicationName(application).build(), req.getBooleanProperty(HttpConfigRequests.RECURSIVE_QUERY_PROPERTY), false);
}
use of com.yahoo.vespa.config.ConfigKey in project vespa by vespa-engine.
the class HttpListConfigsRequest method createFromNamedListRequestFullAppId.
private static HttpListConfigsRequest createFromNamedListRequestFullAppId(HttpRequest req, BindingMatch<?> bm) {
String tenant = bm.group(2);
String application = bm.group(3);
String environment = bm.group(4);
String region = bm.group(5);
String instance = bm.group(6);
String conf = bm.group(7);
String cId;
String cName;
String cNamespace;
if (bm.groupCount() >= 9) {
cId = bm.group(8);
} else {
cId = "";
}
Tuple2<String, String> nns = HttpConfigRequest.nameAndNamespace(conf);
cName = nns.first;
cNamespace = nns.second;
ConfigKey<?> key = new ConfigKey<>(cName, cId, cNamespace);
ApplicationId appId = new ApplicationId.Builder().tenant(tenant).applicationName(application).instanceName(instance).build();
return new HttpListConfigsRequest(key, appId, req.getBooleanProperty(HttpConfigRequests.RECURSIVE_QUERY_PROPERTY), true);
}
use of com.yahoo.vespa.config.ConfigKey in project vespa by vespa-engine.
the class HttpListNamedConfigsHandler method handleGET.
@Override
public HttpResponse handleGET(HttpRequest req) {
HttpListConfigsRequest listReq = HttpListConfigsRequest.createFromNamedListRequest(req);
RequestHandler requestHandler = HttpConfigRequests.getRequestHandler(tenants, listReq);
ApplicationId appId = listReq.getApplicationId();
HttpConfigRequest.validateRequestKey(listReq.getKey(), requestHandler, appId);
Set<ConfigKey<?>> configs = requestHandler.listNamedConfigs(appId, Optional.empty(), listReq.getKey(), listReq.isRecursive());
String urlBase = HttpListConfigsHandler.getUrlBase(req, listReq, appId, zone);
Set<ConfigKey<?>> allConfigs = requestHandler.allConfigsProduced(appId, Optional.empty());
return new HttpListConfigsHandler.ListConfigsResponse(configs, allConfigs, urlBase, listReq.isRecursive());
}
Aggregations