Package org.openstack.service.nginx.model

Examples of org.openstack.service.nginx.model.NginxService


  public void handler() throws OpsException, IOException {
  }

  @Override
  protected void addChildren() throws OpsException {
    NginxService model = OpsContext.get().getInstance(NginxService.class);

    InstanceBuilder instance = InstanceBuilder.build(model.dnsName, this, model.getTags());
    instance.hostPolicy.allowRunInContainer = true;
    instance.publicPorts.add(80);
    instance.publicPorts.add(443);
    addChild(instance);

    instance.addChild(PackageDependency.build("nginx"));

    instance.addChild(NginxServerBootstrap.build());

    // Can't restart collectd
    // instance.addChild(CollectdCollector.build());

    instance.addChild(ManagedService.build("nginx"));

    {
      PublicEndpoint endpoint = injected(PublicEndpoint.class);
      endpoint.publicPort = 80;
      endpoint.backendPort = 80;
      endpoint.dnsName = model.dnsName;

      endpoint.tagItem = model.getKey();
      endpoint.parentItem = model.getKey();

      instance.addChild(endpoint);
    }

    {
      PublicEndpoint endpoint = injected(PublicEndpoint.class);
      endpoint.publicPort = 443;
      endpoint.backendPort = 443;
      endpoint.dnsName = model.dnsName;

      endpoint.tagItem = model.getKey();
      endpoint.parentItem = model.getKey();

      instance.addChild(endpoint);
    }

    addChild(injected(NginxBackendConfiguration.class));
View Full Code Here


  int port = 80;
  Protocol protocol = Protocol.Tcp;

  @Override
  protected ItemBase buildItemTemplate() {
    NginxService nginxService = OpsContext.get().getInstance(NginxService.class);
    NginxBackend nginxBackend = OpsContext.get().getInstance(NginxBackend.class);

    NetworkConnection networkConnection = new NetworkConnection();
    networkConnection.setDestItem(nginxBackend.backend);
    networkConnection.setSourceItem(nginxService.getKey());
    networkConnection.setPort(port);
    networkConnection.setProtocol(protocol.toString());

    Tag parentTag = Tag.buildParentTag(nginxBackend.getKey());
    networkConnection.getTags().add(parentTag);
View Full Code Here

  @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());
View Full Code Here

TOP

Related Classes of org.openstack.service.nginx.model.NginxService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.