use of com.yahoo.config.provision.RegionName in project vespa by vespa-engine.
the class LbServicesProducerTest method testConfigAliasesWithRotations.
@Test
public void testConfigAliasesWithRotations() throws IOException, SAXException {
Map<TenantName, Map<ApplicationId, ApplicationInfo>> testModel = createTestModel(new DeployState.Builder().rotations(rotations));
RegionName regionName = RegionName.from("us-east-1");
LbServicesConfig conf = getLbServicesConfig(new Zone(Environment.prod, regionName), testModel);
final LbServicesConfig.Tenants.Applications.Hosts.Services services = conf.tenants("foo").applications("foo:prod:" + regionName.value() + ":default").hosts("foo.foo.yahoo.com").services("qrserver");
assertThat(services.servicealiases().size(), is(1));
assertThat(services.endpointaliases().size(), is(4));
assertThat(services.servicealiases(0), is("service1"));
assertThat(services.endpointaliases(0), is("foo1.bar1.com"));
assertThat(services.endpointaliases(1), is("foo2.bar2.com"));
assertThat(services.endpointaliases(2), is(rotation1));
assertThat(services.endpointaliases(3), is(rotation2));
}
use of com.yahoo.config.provision.RegionName in project vespa by vespa-engine.
the class ZoneApiHandler method defaultRegion.
private HttpResponse defaultRegion(HttpRequest request, Environment environment) {
RegionName region = zoneRegistry.getDefaultRegion(environment).orElseThrow(() -> new IllegalArgumentException("No default region for environment: " + environment));
Slime slime = new Slime();
Cursor root = slime.setObject();
root.setString("name", region.value());
root.setString("url", request.getUri().resolve("/zone/v2/environment/").resolve(environment.value() + "/").resolve("region/").resolve(region.value()).toString());
return new SlimeJsonResponse(slime);
}
Aggregations