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

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

本文整理了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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  1. public void ensureVmHasAllocationModeOrPooled(VApp vApp, @Nullable IpAddressAllocationMode ipAllocationMode) {
  2. Network networkToConnect = find(vApp.getNetworkSection().getNetworks(), not(networkWithNoIpAllocation));
  3. Vm vm = get(vApp.getChildren(), 0);
  4. NetworkConnectionSection net = vm.getNetworkConnectionSection();
  5. checkArgument(net.getConnections().size() > 0, "no connections on vm %s", vm);
  6. NetworkConnection toConnect = findWithPoolAllocationOrFirst(net);
  7. if (ipAllocationMode == null)
  8. ipAllocationMode = toConnect.getIpAddressAllocationMode();
  9. // make sure that we are in fact allocating ips
  10. if (ipAllocationMode == IpAddressAllocationMode.NONE)
  11. ipAllocationMode = IpAddressAllocationMode.POOL;
  12. if (toConnect.isConnected() && toConnect.getIpAddressAllocationMode() == ipAllocationMode
  13. && toConnect.getNetwork().equals(networkToConnect.getName())) {
  14. // then we don't need to change the network settings, and can save a call
  15. } else {
  16. Builder builder = net.toBuilder();
  17. builder.connections(ImmutableSet.of(toConnect.toBuilder().network(networkToConnect.getName()).connected(true)
  18. .ipAddressAllocationMode(ipAllocationMode).build()));
  19. logger.trace(">> updating networkConnection vm(%s)", vm.getName());
  20. waitForTask(client.getVmApi().updateNetworkConnectionOfVm(builder.build(), vm.getHref()));
  21. logger.trace("<< updated networkConnection vm(%s)", vm.getName());
  22. }
  23. }

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

  1. public void ensureVmHasAllocationModeOrPooled(VApp vApp, @Nullable IpAddressAllocationMode ipAllocationMode) {
  2. Network networkToConnect = find(vApp.getNetworkSection().getNetworks(), not(networkWithNoIpAllocation));
  3. Vm vm = get(vApp.getChildren(), 0);
  4. NetworkConnectionSection net = vm.getNetworkConnectionSection();
  5. checkArgument(net.getConnections().size() > 0, "no connections on vm %s", vm);
  6. NetworkConnection toConnect = findWithPoolAllocationOrFirst(net);
  7. if (ipAllocationMode == null)
  8. ipAllocationMode = toConnect.getIpAddressAllocationMode();
  9. // make sure that we are in fact allocating ips
  10. if (ipAllocationMode == IpAddressAllocationMode.NONE)
  11. ipAllocationMode = IpAddressAllocationMode.POOL;
  12. if (toConnect.isConnected() && toConnect.getIpAddressAllocationMode() == ipAllocationMode
  13. && toConnect.getNetwork().equals(networkToConnect.getName())) {
  14. // then we don't need to change the network settings, and can save a call
  15. } else {
  16. Builder builder = net.toBuilder();
  17. builder.connections(ImmutableSet.of(toConnect.toBuilder().network(networkToConnect.getName()).connected(true)
  18. .ipAddressAllocationMode(ipAllocationMode).build()));
  19. logger.trace(">> updating networkConnection vm(%s)", vm.getName());
  20. waitForTask(client.getVmClient().updateNetworkConnectionOfVm(builder.build(), vm.getHref()));
  21. logger.trace("<< updated networkConnection vm(%s)", vm.getName());
  22. }
  23. }

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

  1. public void ensureVmHasAllocationModeOrPooled(VApp vApp, @Nullable IpAddressAllocationMode ipAllocationMode) {
  2. Network networkToConnect = find(vApp.getNetworkSection().getNetworks(), not(networkWithNoIpAllocation));
  3. Vm vm = get(vApp.getChildren(), 0);
  4. NetworkConnectionSection net = vm.getNetworkConnectionSection();
  5. checkArgument(net.getConnections().size() > 0, "no connections on vm %s", vm);
  6. NetworkConnection toConnect = findWithPoolAllocationOrFirst(net);
  7. if (ipAllocationMode == null)
  8. ipAllocationMode = toConnect.getIpAddressAllocationMode();
  9. // make sure that we are in fact allocating ips
  10. if (ipAllocationMode == IpAddressAllocationMode.NONE)
  11. ipAllocationMode = IpAddressAllocationMode.POOL;
  12. if (toConnect.isConnected() && toConnect.getIpAddressAllocationMode() == ipAllocationMode
  13. && toConnect.getNetwork().equals(networkToConnect.getName())) {
  14. // then we don't need to change the network settings, and can save a call
  15. } else {
  16. Builder builder = net.toBuilder();
  17. builder.connections(ImmutableSet.of(toConnect.toBuilder().network(networkToConnect.getName()).connected(true)
  18. .ipAddressAllocationMode(ipAllocationMode).build()));
  19. logger.trace(">> updating networkConnection vm(%s)", vm.getName());
  20. waitForTask(client.getVmApi().updateNetworkConnectionOfVm(builder.build(), vm.getHref()));
  21. logger.trace("<< updated networkConnection vm(%s)", vm.getName());
  22. }
  23. }

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

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

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

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

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

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

相关文章