- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.jclouds.cloudstack.features.ZoneClient.listZones()
方法的一些代码示例,展示了ZoneClient.listZones()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoneClient.listZones()
方法的具体详情如下:
包路径:org.jclouds.cloudstack.features.ZoneClient
类名称:ZoneClient
方法名:listZones
[英]Lists zones
[中]列出区域
代码示例来源:origin: jclouds/legacy-jclouds
@Override
public Iterable<Zone> listLocations() {
// TODO: we may need to filter these
return client.getZoneClient().listZones();
}
代码示例来源:origin: org.jclouds.api/cloudstack
@Override
public Iterable<Zone> listLocations() {
// TODO: we may need to filter these
return client.getZoneClient().listZones();
}
代码示例来源:origin: org.apache.provisionr/provisionr-cloudstack
@Override
public Object doExecuteWithContext(CloudStackClient client, PrintStream out) throws Exception {
out.printf("CloudStack zones for provider %s\n", getProvider().getId());
for (Zone zone : client.getZoneClient().listZones()) {
out.printf("---\n%s\n", zone.toString());
}
out.println();
return null;
}
}
代码示例来源: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.apache.provisionr/provisionr-cloudstack
public static boolean hasSecurityGroupEnabled(final CloudStackClient cloudStackClient, final String zoneName) {
Set<Zone> ourZone = Sets.filter(cloudStackClient.getZoneClient().listZones(), new Predicate<Zone>() {
@Override
public boolean apply(Zone input) {
return input.getName().equals(zoneName);
}
});
return Iterables.getOnlyElement(ourZone).isSecurityGroupsEnabled();
}
}
代码示例来源: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: 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: jclouds/legacy-jclouds
@BeforeGroups(groups = "live")
public void setupContext() {
super.setupContext();
try {
zone = find(client.getZoneClient().listZones(), ZonePredicates.supportsAdvancedNetworks());
networksSupported = true;
} catch (NoSuchElementException e) {
}
}
代码示例来源: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
public void testRegisterISO() throws Exception {
Optional<OSType> guestOSTypeOptional = Iterables.tryFind(client.getGuestOSClient().listOSTypes(), Predicates.notNull());
Optional<Zone> zoneOptional = Iterables.tryFind(client.getZoneClient().listZones(available(true)), Predicates.notNull());
if(guestOSTypeOptional.isPresent() && zoneOptional.isPresent()) {
String osTypeId = guestOSTypeOptional.get().getId();
String zoneId = zoneOptional.get().getId();
ISO iso = client.getISOClient().registerISO(isoName, "", url, zoneId, RegisterISOOptions.Builder.isPublic(true).osTypeId(osTypeId));
assertNotNull(iso);
assertNotNull(iso.getId());
assertEquals(iso.getName(), isoName);
} else {
String skipMessage = String.format("Cannot register the iso with url: %s", url);
if(zoneOptional.isPresent())
skipMessage += " without a valid zone";
else
skipMessage += " without a valid guest OS type";
throw new SkipException(skipMessage);
}
}
代码示例来源:origin: jclouds/legacy-jclouds
public void testListZonesWhenResponseIs404() {
ZoneClient client = requestSendsResponse(
HttpRequest.builder()
.method("GET")
.endpoint(
URI.create("http://localhost:8080/client/api?response=json&" +
"command=listZones&listAll=true&apiKey=identity&signature=8iHCtck0qfxFTqJ8reyAObRf31I%3D"))
.addHeader("Accept", "application/json")
.build(),
HttpResponse.builder()
.statusCode(404)
.build());
assertEquals(client.listZones(), ImmutableSet.of());
}
代码示例来源:origin: jclouds/legacy-jclouds
public void testListZones() throws Exception {
Set<Zone> response = client.getZoneClient().listZones();
assert null != response;
long zoneCount = response.size();
assertTrue(zoneCount >= 0);
for (Zone zone : response) {
Zone newDetails = Iterables.getOnlyElement(client.getZoneClient().listZones(
ListZonesOptions.Builder.id(zone.getId())));
assertEquals(zone, newDetails);
代码示例来源:origin: jclouds/legacy-jclouds
@Test(enabled = true)
public void testRegisterTemplate() throws Exception {
Zone zone = Iterables.getFirst(client.getZoneClient().listZones(), null);
assertNotNull(zone);
Iterable<Network> networks = client.getNetworkClient().listNetworks(ListNetworksOptions.Builder.zoneId(zone.getId()).isDefault(true));
代码示例来源:origin: jclouds/legacy-jclouds
@Test(enabled = true)
public void testCreateTemplate() throws Exception {
Zone zone = Iterables.getFirst(client.getZoneClient().listZones(), null);
assertNotNull(zone);
Iterable<Network> networks = client.getNetworkClient().listNetworks(ListNetworksOptions.Builder.zoneId(zone.getId()).isDefault(true));
networks = Iterables.filter(networks, new Predicate<Network>() {
@Override
public boolean apply(Network network) {
return network != null && network.getState().equals("Implemented");
}
});
assertTrue(Iterables.size(networks) >= 1);
Network network = Iterables.get(networks, 0);
assertNotNull(network);
// Create a VM and stop it
String defaultTemplate = template != null ? template.getImageId() : null;
vmForCreation = VirtualMachineClientLiveTest.createVirtualMachineInNetwork(network, defaultTemplate, client, jobComplete, virtualMachineRunning);
assertTrue(jobComplete.apply(client.getVirtualMachineClient().stopVirtualMachine(vmForCreation.getId())), vmForCreation.toString());
// Work out the VM's volume
Set<Volume> volumes = client.getVolumeClient().listVolumes(ListVolumesOptions.Builder.virtualMachineId(vmForCreation.getId()));
assertEquals(volumes.size(), 1);
Volume volume = Iterables.getOnlyElement(volumes);
// Create a template
CreateTemplateOptions options = CreateTemplateOptions.Builder.volumeId(volume.getId());
AsyncCreateResponse response = client.getTemplateClient().createTemplate(TemplateMetadata.builder().name(prefix+"-createTemplate").osTypeId(vmForCreation.getGuestOSId()).displayText("jclouds live testCreateTemplate").build(), options);
assertTrue(jobComplete.apply(response.getJobId()), vmForCreation.toString());
createdTemplate = client.getTemplateClient().getTemplateInZone(response.getId(), vmForCreation.getZoneId());
// Assertions
assertNotNull(createdTemplate);
}
代码示例来源:origin: jclouds/legacy-jclouds
public static VirtualMachine createVirtualMachine(CloudStackClient client, String defaultTemplate,
Predicate<String> jobComplete, Predicate<VirtualMachine> virtualMachineRunning) {
Set<Network> networks = client.getNetworkClient().listNetworks(isDefault(true));
if (networks.size() > 0) {
Network network = get(filter(networks, new Predicate<Network>() {
@Override
public boolean apply(Network network) {
return network != null && network.getState().equals("Implemented");
}
}), 0);
return createVirtualMachineInNetwork(network,
defaultTemplateOrPreferredInZone(defaultTemplate, client, network.getZoneId()), client, jobComplete,
virtualMachineRunning);
} else {
String zoneId = find(client.getZoneClient().listZones(), new Predicate<Zone>() {
@Override
public boolean apply(Zone arg0) {
return arg0.isSecurityGroupsEnabled();
}
}).getId();
return createVirtualMachineWithSecurityGroupInZone(zoneId,
defaultTemplateOrPreferredInZone(defaultTemplate, client, zoneId),
get(client.getSecurityGroupClient().listSecurityGroups(), 0).getId(), client, jobComplete,
virtualMachineRunning);
}
}
代码示例来源:origin: jclouds/legacy-jclouds
@Test
public void testCreateDestroySecurityGroup() {
try {
zone = Iterables.find(client.getZoneClient().listZones(), new Predicate<Zone>() {
@Override
public boolean apply(Zone arg0) {
return arg0.isSecurityGroupsEnabled();
}
});
securityGroupsSupported = true;
for (SecurityGroup securityGroup : client.getSecurityGroupClient().listSecurityGroups(
ListSecurityGroupsOptions.Builder.named(prefix))) {
for (IngressRule rule : securityGroup.getIngressRules())
assertTrue(jobComplete.apply(client.getSecurityGroupClient().revokeIngressRule(rule.getId())), rule.toString());
client.getSecurityGroupClient().deleteSecurityGroup(securityGroup.getId());
}
group = client.getSecurityGroupClient().createSecurityGroup(prefix);
assertEquals(group.getName(), prefix);
checkGroup(group);
try {
client.getSecurityGroupClient().createSecurityGroup(prefix);
fail("Expected IllegalStateException");
} catch (IllegalStateException e) {
}
} catch (NoSuchElementException e) {
e.printStackTrace();
}
}
代码示例来源:origin: jclouds/legacy-jclouds
skipIfNotGlobalAdmin();
final Zone zone = Iterables.find(client.getZoneClient().listZones(), ZonePredicates.supportsAdvancedNetworks());
final NetworkOffering offering = find(client.getOfferingClient().listNetworkOfferings(),
NetworkOfferingPredicates.supportsGuestVirtualNetworks());
代码示例来源:origin: jclouds/legacy-jclouds
public void testListZonesWhenResponseIs2xx() {
ZoneClient client = requestSendsResponse(
HttpRequest.builder().method("GET")
.endpoint("http://localhost:8080/client/api")
.addQueryParam("response", "json")
.addQueryParam("command", "listZones")
.addQueryParam("listAll", "true")
.addQueryParam("apiKey", "identity")
.addQueryParam("signature", "8iHCtck0qfxFTqJ8reyAObRf31I%3D")
.addHeader("Accept", "application/json")
.build(),
HttpResponse.builder()
.statusCode(200)
.payload(payloadFromResource("/listzonesresponse.json"))
.build());
assertEquals(client.listZones(),
ImmutableSet.of(
Zone.builder()
.id("1")
.name("San Jose 1")
.networkType(NetworkType.ADVANCED)
.securityGroupsEnabled(false).build(),
Zone.builder()
.id("2")
.name("Chicago")
.networkType(NetworkType.ADVANCED)
.securityGroupsEnabled(true).build()));
}
CloudStack SSVM启动条件源码阅读与问题解决方法: 在CloudStack建立zone的时候,经常遇到SSVM不启动,或者根本就没有SSVM的情况,分析CloudStack
CloudStack创建主存储失败(SR已经被使用),删除SR后成功 &nb
CloudStack 环境重新部署: 最近公司项目需求,由于更
CloudStack 安装及使用过程中常见问题汇总 在做工程项
我正在开发一个cloudstack框架模型,以分析Cloudstack与我组织的产品的可行性。 我试图从cloudstack的UI中删除辅助存储,但由于错误“无法删除带有事件模板备份的图像存储!”而失
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭10
本文整理了Java中org.jclouds.cloudstack.domain.Zone类的一些代码示例,展示了Zone类的具体用法。这些代码示例主要来源于Github/Stackoverflow/M
本文整理了Java中org.jclouds.cloudstack.features.ZoneClient类的一些代码示例,展示了ZoneClient类的具体用法。这些代码示例主要来源于Github/S
本文整理了Java中org.jclouds.cloudstack.predicates.ZonePredicates类的一些代码示例,展示了ZonePredicates类的具体用法。这些代码示例主要来
我想将 10-15 个 VMWare 主机部署到 cloudstack。这是我第一次使用任何类型的云。我正在研究安装和架构,我一直坚持使用 VMWare 主机我必须安装 VCenter 服务器,但我不
本文整理了Java中org.apache.cloudstack.api.response.ZoneResponse类的一些代码示例,展示了ZoneResponse类的具体用法。这些代码示例主要来源于G
我正在 ubuntu 上安装 cloudstack,它使用 maven 来解决它的依赖关系。运行命令 mvn -P deps 时出现以下错误 [ERROR] The build could not r
本文整理了Java中org.jclouds.cloudstack.domain.Zone.getDisplayText()方法的一些代码示例,展示了Zone.getDisplayText()的具体用法
本文整理了Java中org.jclouds.cloudstack.domain.Zone.getVLAN()方法的一些代码示例,展示了Zone.getVLAN()的具体用法。这些代码示例主要来源于Gi
本文整理了Java中org.jclouds.cloudstack.domain.Zone.builder()方法的一些代码示例,展示了Zone.builder()的具体用法。这些代码示例主要来源于Gi
本文整理了Java中org.jclouds.cloudstack.domain.Zone.()方法的一些代码示例,展示了Zone.()的具体用法。这些代码示例主要来源于Github/Stackover
本文整理了Java中org.jclouds.cloudstack.domain.Zone.getDescription()方法的一些代码示例,展示了Zone.getDescription()的具体用法
本文整理了Java中org.jclouds.cloudstack.domain.Zone.getName()方法的一些代码示例,展示了Zone.getName()的具体用法。这些代码示例主要来源于Gi
本文整理了Java中org.jclouds.cloudstack.domain.Zone.getGuestCIDRAddress()方法的一些代码示例,展示了Zone.getGuestCIDRAddr
本文整理了Java中org.jclouds.cloudstack.domain.Zone.getDomain()方法的一些代码示例,展示了Zone.getDomain()的具体用法。这些代码示例主要来
我是一名优秀的程序员,十分优秀!