Examples of NetworkConnection


Examples of org.jclouds.vcloud.domain.NetworkConnection

   protected boolean connected;
   protected String MACAddress;
   protected IpAddressAllocationMode ipAddressAllocationMode;

   public NetworkConnection getResult() {
      NetworkConnection connection = new NetworkConnection(network, networkConnectionIndex, ipAddress,
               externalIpAddress, connected, MACAddress, ipAddressAllocationMode);
      this.network = null;
      this.networkConnectionIndex = -1;
      this.ipAddress = null;
      this.externalIpAddress = null;
View Full Code Here

Examples of org.jclouds.vcloud.domain.NetworkConnection

      Vm vm = get(vApp.getChildren(), 0);

      NetworkConnectionSection net = vm.getNetworkConnectionSection();
      checkArgument(net.getConnections().size() > 0, "no connections on vm %s", vm);

      NetworkConnection toConnect = findWithPoolAllocationOrFirst(net);

      if (ipAllocationMode == null)
         ipAllocationMode = toConnect.getIpAddressAllocationMode();

      // make sure that we are in fact allocating ips
      if (ipAllocationMode == IpAddressAllocationMode.NONE)
         ipAllocationMode = IpAddressAllocationMode.POOL;

      if (toConnect.isConnected() && toConnect.getIpAddressAllocationMode() == ipAllocationMode
               && toConnect.getNetwork().equals(networkToConnect.getName())) {
         // then we don't need to change the network settings, and can save a call
      } else {
         Builder builder = net.toBuilder();
         builder.connections(ImmutableSet.of(toConnect.toBuilder().network(networkToConnect.getName()).connected(true)
                  .ipAddressAllocationMode(ipAllocationMode).build()));
         logger.trace(">> updating networkConnection vm(%s)", vm.getName());

         waitForTask(client.getVmApi().updateNetworkConnectionOfVm(builder.build(), vm.getHref()));
         logger.trace("<< updated networkConnection vm(%s)", vm.getName());
View Full Code Here

Examples of org.jclouds.vcloud.domain.NetworkConnection

      Vm vm = get(vApp.getChildren(), 0);

      NetworkConnectionSection net = vm.getNetworkConnectionSection();
      checkArgument(net.getConnections().size() > 0, "no connections on vm %s", vm);

      NetworkConnection toConnect = findWithPoolAllocationOrFirst(net);

      if (ipAllocationMode == null)
         ipAllocationMode = toConnect.getIpAddressAllocationMode();

      // make sure that we are in fact allocating ips
      if (ipAllocationMode == IpAddressAllocationMode.NONE)
         ipAllocationMode = IpAddressAllocationMode.POOL;

      if (toConnect.isConnected() && toConnect.getIpAddressAllocationMode() == ipAllocationMode
               && toConnect.getNetwork().equals(networkToConnect.getName())) {
         // then we don't need to change the network settings, and can save a call
      } else {
         Builder builder = net.toBuilder();
         builder.connections(ImmutableSet.of(toConnect.toBuilder().network(networkToConnect.getName()).connected(true)
                  .ipAddressAllocationMode(ipAllocationMode).build()));
         logger.trace(">> updating networkConnection vm(%s)", vm.getName());

         waitForTask(client.getVmClient().updateNetworkConnectionOfVm(builder.build(), vm.getHref()));
         logger.trace("<< updated networkConnection vm(%s)", vm.getName());
View Full Code Here

Examples of org.jclouds.vcloud.domain.NetworkConnection

public class NetworkConnectionHandlerTest extends BaseHandlerTest {

   public void testDefault() throws UnknownHostException {
      InputStream is = getClass().getResourceAsStream("/networkconnection.xml");

      NetworkConnection result = factory.create(injector.getInstance(NetworkConnectionHandler.class)).parse(is);

      checkNetworkConnection(result);

   }
View Full Code Here

Examples of org.jclouds.vcloud.domain.NetworkConnection

   protected boolean connected;
   protected String MACAddress;
   protected IpAddressAllocationMode ipAddressAllocationMode;

   public NetworkConnection getResult() {
      NetworkConnection connection = new NetworkConnection(network, networkConnectionIndex, ipAddress,
               externalIpAddress, connected, MACAddress, ipAddressAllocationMode);
      this.network = null;
      this.networkConnectionIndex = -1;
      this.ipAddress = null;
      this.externalIpAddress = null;
View Full Code Here

Examples of org.jclouds.vcloud.domain.NetworkConnection

public class NetworkConnectionHandlerTest extends BaseHandlerTest {

   public void testDefault() throws UnknownHostException {
      InputStream is = getClass().getResourceAsStream("/networkconnection.xml");

      NetworkConnection result = factory.create(injector.getInstance(NetworkConnectionHandler.class)).parse(is);

      checkNetworkConnection(result);

   }
View Full Code Here

Examples of org.jclouds.vcloud.domain.NetworkConnection

   protected boolean connected;
   protected String MACAddress;
   protected IpAddressAllocationMode ipAddressAllocationMode;

   public NetworkConnection getResult() {
      NetworkConnection connection = new NetworkConnection(network, networkConnectionIndex, ipAddress,
               externalIpAddress, connected, MACAddress, ipAddressAllocationMode);
      this.network = null;
      this.networkConnectionIndex = -1;
      this.ipAddress = null;
      this.externalIpAddress = null;
View Full Code Here

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

  public void handler() {
  }

  @Override
  protected void addChildren() throws OpsException {
    NetworkConnection model = ops.getInstance(NetworkConnection.class);

    Protocol protocol = null;
    if (model.protocol != null) {
      protocol = EnumUtils.valueOfCaseInsensitive(Protocol.class, model.protocol);
    }
View Full Code Here

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

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

    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
Copyright © 2018 www.massapi.com. 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.