use of com.yahoo.vespa.hosted.controller.api.identifiers.PropertyId in project vespa by vespa-engine.
the class ControllerTester method createTenant.
public TenantId createTenant(String tenantName, String domainName, Long propertyId) {
TenantId id = new TenantId(tenantName);
Optional<Tenant> existing = controller().tenants().tenant(id);
if (existing.isPresent())
return id;
Tenant tenant = Tenant.createAthensTenant(id, createDomain(domainName), new Property("app1Property"), propertyId == null ? Optional.empty() : Optional.of(new PropertyId(propertyId.toString())));
controller().tenants().createAthenzTenant(tenant, TestIdentities.userNToken);
assertNotNull(controller().tenants().tenant(id));
return id;
}
use of com.yahoo.vespa.hosted.controller.api.identifiers.PropertyId in project vespa by vespa-engine.
the class ApplicationApiHandler method properties.
private HttpResponse properties() {
Slime slime = new Slime();
Cursor response = slime.setObject();
Cursor array = response.setArray("properties");
for (Map.Entry<PropertyId, Property> entry : controller.fetchPropertyList().entrySet()) {
Cursor propertyObject = array.addObject();
propertyObject.setString("propertyid", entry.getKey().id());
propertyObject.setString("property", entry.getValue().id());
}
return new SlimeJsonResponse(slime);
}
use of com.yahoo.vespa.hosted.controller.api.identifiers.PropertyId in project vespa by vespa-engine.
the class ContainerControllerTester method createApplication.
public Application createApplication(String athensDomain, String tenant, String application) {
AthenzDomain domain1 = addTenantAthenzDomain(athensDomain, "mytenant");
controller().tenants().createAthenzTenant(Tenant.createAthensTenant(new TenantId(tenant), domain1, new Property("property1"), Optional.of(new PropertyId("1234"))), TestIdentities.userNToken);
ApplicationId app = ApplicationId.from(tenant, application, "default");
return controller().applications().createApplication(app, Optional.of(TestIdentities.userNToken));
}
use of com.yahoo.vespa.hosted.controller.api.identifiers.PropertyId in project vespa by vespa-engine.
the class MemoryEntityService method listProperties.
@Override
public Map<PropertyId, Property> listProperties() {
Map<PropertyId, Property> properties = new HashMap<>();
properties.put(new PropertyId("1234"), new Property("foo"));
properties.put(new PropertyId("4321"), new Property("bar"));
return Collections.unmodifiableMap(properties);
}
use of com.yahoo.vespa.hosted.controller.api.identifiers.PropertyId in project vespa by vespa-engine.
the class ApplicationApiTest method addPropertyData.
private void addPropertyData(MockOrganization organization, String propertyIdValue) {
PropertyId propertyId = new PropertyId(propertyIdValue);
organization.addProperty(propertyId);
organization.setContactsFor(propertyId, Arrays.asList(Collections.singletonList(User.from("alice")), Collections.singletonList(User.from("bob"))));
}
Aggregations