public void handler() throws OpsException, IOException {
}
@Override
protected void addChildren() throws OpsException {
MemcacheServer model = OpsContext.get().getInstance(MemcacheServer.class);
InstanceBuilder instance = InstanceBuilder.build(model.dnsName, this, model.getTags());
// TODO: Memory _really_ needs to be configurable here!
instance.publicPorts.add(MEMCACHE_PORT);
instance.minimumMemoryMb = 1024;
instance.hostPolicy.allowRunInContainer = true;
addChild(instance);
instance.addChild(PackageDependency.build("memcached"));
MemcacheTemplateModel template = injected(MemcacheTemplateModel.class);
instance.addChild(TemplatedFile.build(template, new File("/etc/memcached.conf")));
// Collectd not restarting correctly (doesn't appear to be hostname problems??)
// instance.addChild(CollectdCollector.build());
{
PublicEndpoint endpoint = injected(PublicEndpoint.class);
// endpoint.network = null;
endpoint.publicPort = MEMCACHE_PORT;
endpoint.backendPort = MEMCACHE_PORT;
endpoint.dnsName = model.dnsName;
endpoint.tagItem = model.getKey();
endpoint.parentItem = model.getKey();
instance.addChild(endpoint);
}
instance.addChild(ManagedService.build("memcached"));