Package org.platformlayer.service.network.v1

Examples of org.platformlayer.service.network.v1.NetworkConnection


  @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);
    Tag uniqueTag = UniqueTag.build(nginxService, nginxBackend);
    networkConnection.getTags().add(uniqueTag);

    String id = nginxBackend.getId();
    if (Strings.isNullOrEmpty(id)) {
      id = "nginx";
    }
View Full Code Here


    poller.item = item;
    return poller.waitForState();
  }

  public NetworkConnection openFirewall(ItemBase item, int port) throws OpsException, IOException {
    NetworkConnection firewallRule = new NetworkConnection();
    firewallRule.setSourceCidr("0.0.0.0/0");
    firewallRule.setDestItem(item.getKey());
    firewallRule.setPort(port);

    String id = item.getId() + "-global";
    firewallRule = putItem(id, firewallRule);

    waitForHealthy(firewallRule);
View Full Code Here

TOP

Related Classes of org.platformlayer.service.network.v1.NetworkConnection

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.