gpt4 book ai didi

org.jclouds.openstack.nova.v2_0.domain.zonescoped.ZoneState类的使用及代码示例

转载 作者:知者 更新时间:2024-03-17 08:25:31 25 4
gpt4 key购买 nike

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

ZoneState介绍

暂无

代码示例

代码示例来源:origin: io.cloudsoft.jclouds.api/openstack-nova

@Override
public String toString() {
 return string().toString();
}

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

@Test
  public void testListAvailabilityZones() throws Exception {

   Optional<? extends AvailabilityZoneApi> availabilityZoneApi = api.getAvailabilityZoneApi("RegionOne");
   if (availabilityZoneApi.isPresent()) {
     FluentIterable<? extends AvailabilityZone> zones = availabilityZoneApi.get().list();

     for (AvailabilityZone zone : zones) {
      assertNotNull(zone.getName());
      assertTrue(zone.getState().available(), "zone: " + zone.getName() + " is not available.");
     }
   }
  }
}

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

public void testAvailabilityZonesList() throws Exception {
   HttpRequest list = HttpRequest
      .builder()
      .method("GET")
      .endpoint("https://az-1.region-a.geo-1.compute.hpcloudsvc.com/v2/3456/os-availability-zone")
      .addHeader("Accept", "application/json")
      .addHeader("X-Auth-Token", authToken).build();

   HttpResponse listResponse = HttpResponse.builder().statusCode(200)
      .payload(payloadFromResource("/listAvailabilityZones.json")).build();

   NovaApi availabilityZonesApi = requestsSendResponses(keystoneAuthWithUsernameAndPasswordAndTenantName,
      responseWithKeystoneAccess, extensionsOfNovaRequest, extensionsOfNovaResponse, list, listResponse);

   assertEquals(availabilityZonesApi.getConfiguredRegions(), ImmutableSet.of("az-1.region-a.geo-1", "az-2.region-a.geo-1", "az-3.region-a.geo-1"));

   FluentIterable<? extends AvailabilityZone> zones = availabilityZonesApi.getAvailabilityZoneApi("az-1.region-a.geo-1").get().list();

   Optional<? extends AvailabilityZone> zone = zones.first();

   assertTrue(zone.isPresent(), "Couldn't find zone");
   assertEquals(zone.get().getName(), "internal",
      "Expected zone name to be internal but it was: " + zone.get().getName());
   assertTrue(zone.get().getState().available(), "Zone: " + zone.get().getName() + " is not available.");
  }
}

代码示例来源:origin: org.apache.jclouds.api/openstack-nova

@Override
public String toString() {
 return string().toString();
}

代码示例来源:origin: com.amysta.jclouds.api/openstack-nova

@Override
public String toString() {
 return string().toString();
}

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

@Override
public String toString() {
 return string().toString();
}

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