org.jclouds.ovf.Network.getName()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(199)

本文整理了Java中org.jclouds.ovf.Network.getName()方法的一些代码示例,展示了Network.getName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Network.getName()方法的具体详情如下:
包路径:org.jclouds.ovf.Network
类名称:Network
方法名:getName

Network.getName介绍

暂无

代码示例

代码示例来源:origin: jclouds/legacy-jclouds

@Override
public boolean apply(Network input) {
  return "none".equals(input.getName());
}

代码示例来源:origin: org.apache.jclouds.api/vcloud

@Override
public boolean apply(Network input) {
  return "none".equals(input.getName());
}

代码示例来源:origin: io.cloudsoft.jclouds.api/vcloud

@Override
public boolean apply(Network input) {
  return "none".equals(input.getName());
}

代码示例来源:origin: jclouds/legacy-jclouds

@Override
  public String apply(VAppTemplate vAppTemplate) {
   checkArgument(vAppTemplate != null, "vAppTemplate was null!");
   Set<Network> networks = vAppTemplate.getNetworkSection().getNetworks();
   checkArgument(networks.size() > 0, "no networks found in vAppTemplate %s", vAppTemplate);
   if (networks.size() > 1)
     logger.warn("multiple networks found for %s, choosing first from: %s", vAppTemplate.getName(), networks);
   return get(networks, 0).getName();
  }
}

代码示例来源:origin: io.cloudsoft.jclouds.api/vcloud

@Override
  public String apply(VAppTemplate vAppTemplate) {
   checkArgument(vAppTemplate != null, "vAppTemplate was null!");
   Set<Network> networks = vAppTemplate.getNetworkSection().getNetworks();
   checkArgument(networks.size() > 0, "no networks found in vAppTemplate %s", vAppTemplate);
   if (networks.size() > 1)
     logger.warn("multiple networks found for %s, choosing first from: %s", vAppTemplate.getName(), networks);
   return get(networks, 0).getName();
  }
}

代码示例来源:origin: org.apache.jclouds.api/vcloud

@Override
  public String apply(VAppTemplate vAppTemplate) {
   checkArgument(vAppTemplate != null, "vAppTemplate was null!");
   Set<Network> networks = vAppTemplate.getNetworkSection().getNetworks();
   checkArgument(networks.size() > 0, "no networks found in vAppTemplate %s", vAppTemplate);
   if (networks.size() > 1)
     logger.warn("multiple networks found for %s, choosing first from: %s", vAppTemplate.getName(), networks);
   return get(networks, 0).getName();
  }
}

代码示例来源:origin: jclouds/legacy-jclouds

public Builder fromNetwork(Network in) {
   return name(in.getName()).description(in.getDescription());
 }
}

代码示例来源:origin: io.cloudsoft.jclouds/jclouds-compute

public Builder fromNetwork(Network in) {
   return name(in.getName()).description(in.getDescription());
 }
}

代码示例来源:origin: apache/jclouds

public Builder fromNetwork(Network in) {
   return name(in.getName()).description(in.getDescription());
 }
}

代码示例来源:origin: org.apache.jclouds/jclouds-compute

public Builder fromNetwork(Network in) {
   return name(in.getName()).description(in.getDescription());
 }
}

代码示例来源:origin: org.apache.jclouds.api/vcloud

public void ensureVmHasAllocationModeOrPooled(VApp vApp, @Nullable IpAddressAllocationMode ipAllocationMode) {
 Network networkToConnect = find(vApp.getNetworkSection().getNetworks(), not(networkWithNoIpAllocation));
 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());
 }
}

代码示例来源:origin: jclouds/legacy-jclouds

public void ensureVmHasAllocationModeOrPooled(VApp vApp, @Nullable IpAddressAllocationMode ipAllocationMode) {
 Network networkToConnect = find(vApp.getNetworkSection().getNetworks(), not(networkWithNoIpAllocation));
 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());
 }
}

代码示例来源:origin: io.cloudsoft.jclouds.api/vcloud

public void ensureVmHasAllocationModeOrPooled(VApp vApp, @Nullable IpAddressAllocationMode ipAllocationMode) {
 Network networkToConnect = find(vApp.getNetworkSection().getNetworks(), not(networkWithNoIpAllocation));
 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());
 }
}

代码示例来源:origin: jclouds/legacy-jclouds

config = config.toBuilder().networkName(networkToConnect.getName()).build();

代码示例来源:origin: io.cloudsoft.jclouds.api/vcloud

config = config.toBuilder().networkName(networkToConnect.getName()).build();

代码示例来源:origin: org.apache.jclouds.api/vcloud

config = config.toBuilder().networkName(networkToConnect.getName()).build();

相关文章