gpt4 book ai didi

org.jclouds.cloudstack.domain.Zone.getId()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 05:53:31 27 4
gpt4 key购买 nike

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

Zone.getId介绍

暂无

代码示例

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

@Override
  public int compareTo(Zone o) {
   return id.compareTo(o.getId());
  }
}

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

@Override
  public int compareTo(Zone o) {
   return id.compareTo(o.getId());
  }
}

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

@Override
  public int compareTo(Zone o) {
   return id.compareTo(o.getId());
  }
}

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

@Override
 public Map<String, Set<String>> apply(CloudStackClient client) {
   checkNotNull(client, "client");
   Builder<String, Set<String>> builder = ImmutableMap.builder();
   for (Zone zone : client.getZoneClient().listZones()) {
    builder.put(zone.getId(), client.getHypervisorClient().listHypervisorsInZone(zone.getId()));
   }
   return builder.build();
 }
}

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

@Override
 public Map<String, Set<String>> apply(CloudStackClient client) {
   checkNotNull(client, "client");
   Builder<String, Set<String>> builder = ImmutableMap.builder();
   for (Zone zone : client.getZoneClient().listZones()) {
    builder.put(zone.getId(), client.getHypervisorClient().listHypervisorsInZone(zone.getId()));
   }
   return builder.build();
 }
}

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

@Override
 public Map<String, Set<String>> apply(CloudStackApi client) {
   checkNotNull(client, "client");
   Builder<String, Set<String>> builder = ImmutableMap.builder();
   for (Zone zone : client.getZoneApi().listZones()) {
    builder.put(zone.getId(), client.getHypervisorApi().listHypervisorsInZone(zone.getId()));
   }
   return builder.build();
 }
}

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

@Override
public Location apply(Zone zone) {
 return new LocationBuilder().scope(LocationScope.ZONE).metadata(ImmutableMap.<String, Object> of())
   .description(zone.getName()).id(zone.getId())
    .parent(Iterables.getOnlyElement(provider.get())).build();
}

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

@Override
public Location apply(Zone zone) {
 return new LocationBuilder().scope(LocationScope.ZONE).metadata(ImmutableMap.<String, Object> of())
   .description(zone.getName()).id(zone.getId())
    .parent(Iterables.getOnlyElement(provider.get())).build();
}

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

@BeforeMethod(groups = "live")
public void setZoneId() {
 Set<Zone> zones = client.getZoneClient().listZones();
 assertNotNull(zones);
 assertFalse(zones.isEmpty());
 zoneId = Iterables.get(zones, 0).getId();
}

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

@Override
public Location apply(Zone zone) {
 return new LocationBuilder().scope(LocationScope.ZONE).metadata(ImmutableMap.<String, Object> of())
   .description(zone.getName()).id(zone.getId())
    .parent(Iterables.getOnlyElement(provider.get())).build();
}

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

@BeforeMethod(groups = "live")
public void setZoneId() {
 Set<Zone> zones = client.getZoneApi().listZones();
 assertNotNull(zones);
 assertFalse(zones.isEmpty());
 zoneId = Iterables.get(zones, 0).getId();
}

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

@BeforeMethod(groups = "live")
public void setZoneId() {
 Set<Zone> zones = client.getZoneApi().listZones();
 assertNotNull(zones);
 assertFalse(zones.isEmpty());
 zoneId = Iterables.get(zones, 0).getId();
}

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

public void testListHypervisors() throws Exception {
 Set<String> response = client.getHypervisorClient().listHypervisors();
 assert null != response;
 assertTrue(response.size() >= 0);
 for (Zone zone : client.getZoneClient().listZones()) {
   Set<String> zoneHype = client.getHypervisorClient().listHypervisorsInZone(zone.getId());
   assert response.containsAll(zoneHype);
 }
}

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

@Test
public void testCreatePod() {
 skipIfNotGlobalAdmin();
 zone = globalAdminClient.getZoneClient().createZone(prefix + "-zone", NetworkType.BASIC, "8.8.8.8", "10.10.10.10");
 pod = globalAdminClient.getPodClient().createPod(prefix + "-pod", zone.getId(), "172.20.0.1", "172.20.0.250", "172.20.0.254", "255.255.255.0",
 CreatePodOptions.Builder.allocationState(AllocationState.ENABLED));
 assertNotNull(pod);
 assertEquals(pod.getName(), prefix + "-pod");
 assertEquals(pod.getZoneId(), zone.getId());
 assertEquals(pod.getZoneName(), prefix + "-zone");
 assertEquals(pod.getStartIp(), "172.20.0.1");
 assertEquals(pod.getEndIp(), "172.20.0.250");
 assertEquals(pod.getGateway(), "172.20.0.254");
 assertEquals(pod.getNetmask(), "255.255.255.0");
 assertEquals(pod.getAllocationState(), AllocationState.ENABLED);
}

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

public void testListHypervisors() throws Exception {
 Set<String> response = client.getHypervisorApi().listHypervisors();
 assert null != response;
 assertTrue(response.size() > 0);
 for (Zone zone : client.getZoneApi().listZones()) {
   Set<String> zoneHype = client.getHypervisorApi().listHypervisorsInZone(zone.getId());
   assert response.containsAll(zoneHype);
 }
}

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

@Test
public void testCreateVMWithoutSecurityGroupAssignsDefault() throws Exception {
 skipIfSecurityGroupsNotSupported();
 String defaultTemplate = template != null ? template.getImageId() : null;
 VirtualMachine newVm = VirtualMachineClientLiveTest.createVirtualMachineWithOptionsInZone(DeployVirtualMachineOptions.NONE,
    zone.getId(), defaultTemplateOrPreferredInZone(defaultTemplate, client, zone.getId()), client,
    jobComplete, virtualMachineRunning);
 try {
   VirtualMachine runningVm = client.getVirtualMachineClient().getVirtualMachine(newVm.getId());
   assertEquals(1, runningVm.getSecurityGroups().size());
   assertEquals(Iterables.getOnlyElement(runningVm.getSecurityGroups()).getName(), "default");
 } finally {
   assertTrue(jobComplete.apply(client.getVirtualMachineClient().destroyVirtualMachine(newVm.getId())));
 }
}

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

@Override
  public Template getNodeTemplate() {
   return view.getComputeService().templateBuilder().locationId(zone.getId()).build();
  }
}

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

@Test(dependsOnMethods = "testCreateIngress")
public void testCreateVMInSecurityGroup() throws Exception {
 skipIfSecurityGroupsNotSupported();
 String defaultTemplate = template != null ? template.getImageId() : null;
 vm = VirtualMachineClientLiveTest.createVirtualMachineWithSecurityGroupInZone(zone.getId(),
    defaultTemplateOrPreferredInZone(defaultTemplate, client, zone.getId()), group.getId(), client,
    jobComplete, virtualMachineRunning);
 if (vm.getPassword() != null && loginCredentials.getOptionalPassword() == null)
   loginCredentials = loginCredentials.toBuilder().password(vm.getPassword()).build();
 // ingress port 22
 checkSSH(HostAndPort.fromParts(vm.getIPAddress(), 22));
 // ingress icmp disabled as this is platform dependent and may actually
 // just try tcp port 7
 // assert InetAddress.getByName(vm.getIPAddress()).isReachable(1000) : vm;
}

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

@AfterGroups(groups = "live")
  @Override
  protected void tearDownContext() {
   if (pod != null) {
     globalAdminClient.getPodClient().deletePod(pod.getId());
     pod = null;
   }
   if (zone != null) {
     globalAdminClient.getZoneClient().deleteZone(zone.getId());
     zone = null;
   }
   super.tearDownContext();
  }
}

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

@AfterGroups(groups = "live")
  @Override
  protected void tearDownContext() {
   if (pod != null) {
     globalAdminClient.getPodClient().deletePod(pod.getId());
     pod = null;
   }
   if (zone != null) {
     globalAdminClient.getZoneApi().deleteZone(zone.getId());
     zone = null;
   }
   super.tearDownContext();
  }
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com