use of org.openstack.service.nginx.model.NginxFrontend in project platformlayer by platformlayer.
the class NginxFrontendDns method buildItemTemplate.
@Override
protected DnsRecord buildItemTemplate() throws OpsException {
// TODO: Idempotency etc
// Machine machine = OpsContext.get().getInstance(Machine.class);
NginxService nginxService = OpsContext.get().getInstance(NginxService.class);
NginxFrontend nginxFrontend = OpsContext.get().getInstance(NginxFrontend.class);
Machine machine = instanceHelpers.getMachine(nginxService);
String address = machine.getNetworkPoint().getBestAddress(NetworkPoint.forPublicInternet());
DnsRecord record = new DnsRecord();
record.setDnsName(nginxFrontend.hostname);
record.getAddress().add(address);
Tag parentTag = Tag.buildParentTag(nginxFrontend.getKey());
record.getTags().add(parentTag);
Tag uniqueTag = UniqueTag.build(nginxService, nginxFrontend);
record.getTags().add(uniqueTag);
record.key = PlatformLayerKey.fromId(nginxFrontend.hostname);
return record;
}
use of org.openstack.service.nginx.model.NginxFrontend in project platformlayer by platformlayer.
the class SiteTemplateData method buildTemplateModel.
@Override
public void buildTemplateModel(Map<String, Object> model) throws OpsException {
NginxFrontend nginxFrontend = getNginxFrontend();
model.put("uniqueKey", getUniqueKey());
model.put("hostname", getHostname());
model.put("httpPort", httpPort);
model.put("httpsPort", httpsPort);
model.put("useSsl", false);
List<NginxBackend> backends = getBackends(nginxFrontend.hostname);
List<BackendModel> resolvedBackends = resolveBackends(backends);
model.put("backends", resolvedBackends);
}
Aggregations