Package org.jclouds.openstack.cinder.v1.extensions

Examples of org.jclouds.openstack.cinder.v1.extensions.AvailabilityZoneApi


   public void testListAndGetVolumeTypes() {
      Set<? extends VolumeType> volumeTypes = volumeTypeApi.list().toSet();
      assertNotNull(volumeTypes);

      for (VolumeType vt : volumeTypes) {
         VolumeType details = volumeTypeApi.get(vt.getId());
         assertNotNull(details);
      }
   }
View Full Code Here


   public void testListAndGetVolumeTypes() {
      Set<? extends VolumeType> volumeTypes = volumeTypeApi.list().toSet();
      assertNotNull(volumeTypes);

      for (VolumeType vt : volumeTypes) {
         VolumeType details = volumeTypeApi.get(vt.getId());
         assertNotNull(details);
      }
   }
View Full Code Here

            responseWithKeystoneAccess,
            authenticatedGET().endpoint(endpoint).build(),
            HttpResponse.builder().statusCode(200).payload(payloadFromResource("/volume_type_get.json")).build()
      ).getVolumeTypeApiForZone("RegionOne");

      VolumeType type = api.get("1");
      assertEquals(type, testVolumeType());
   }
View Full Code Here

            responseWithKeystoneAccess,
            authenticatedGET().endpoint(endpoint).build(),
            HttpResponse.builder().statusCode(200).payload(payloadFromResource("/volume_type_get.json")).build()
      ).getVolumeTypeApiForZone("RegionOne");

      VolumeType type = api.get("1");
      assertEquals(type, testVolumeType());
   }
View Full Code Here

@Test(groups = "unit", testName = "AvailabilityZoneApiExpectTest")
public class AvailabilityZoneApiExpectTest extends BaseCinderApiExpectTest {

   public void testListAvailabilityZones() throws Exception {
      URI endpoint = URI.create("http://172.16.0.1:8776/v1/50cdb4c60374463198695d9f798fa34d/os-availability-zone");
      AvailabilityZoneApi api = requestsSendResponses(
            keystoneAuthWithUsernameAndPasswordAndTenantName,
            responseWithKeystoneAccess,
            authenticatedGET().endpoint(endpoint).build(),
            HttpResponse.builder().statusCode(200).payload(payloadFromResource("/availability_zones_list.json")).build()
      ).getAvailabilityZoneApi("RegionOne");

      AvailabilityZone availabilityZoneActual = Iterables.getFirst(api.list(), null);
      AvailabilityZone availabilityZoneExpected = getTestAvailabilityZone();

      assertNotNull(availabilityZoneActual);
      assertEquals(availabilityZoneActual, availabilityZoneExpected);
   }
View Full Code Here

      assertEquals(availabilityZoneActual, availabilityZoneExpected);
   }

   public void testListAvailabilityZonesFail() throws Exception {
      URI endpoint = URI.create("http://172.16.0.1:8776/v1/50cdb4c60374463198695d9f798fa34d/os-availability-zone");
      AvailabilityZoneApi api = requestsSendResponses(
            keystoneAuthWithUsernameAndPasswordAndTenantName,
            responseWithKeystoneAccess,
            authenticatedGET().endpoint(endpoint).build(),
            HttpResponse.builder().statusCode(404).build()
      ).getAvailabilityZoneApi("RegionOne");

      Set<? extends AvailabilityZone> availabilityZones = api.list().toSet();
      assertTrue(availabilityZones.isEmpty());
   }
View Full Code Here

                  .payload(payloadFromResourceWithContentType("/snapshot_create.json", MediaType.APPLICATION_JSON))
                  .build(),
            HttpResponse.builder().statusCode(200).payload(payloadFromResource("/snapshot_create_response.json")).build()
      ).getSnapshotApiForZone("RegionOne");
     
      CreateSnapshotOptions options = CreateSnapshotOptions.Builder
            .name("jclouds-test-snapshot")
            .description("jclouds test snapshot")
            .force();

      Snapshot snapshot = api.create("ea6f70ef-2784-40b9-9d14-d7f33c507c3f", options);
View Full Code Here

                  .payload(payloadFromResourceWithContentType("/snapshot_create.json", MediaType.APPLICATION_JSON))
                  .build(),
            HttpResponse.builder().statusCode(404).build()
      ).getSnapshotApiForZone("RegionOne");
     
      CreateSnapshotOptions options = CreateSnapshotOptions.Builder
            .name("jclouds-test-snapshot")
            .description("jclouds test snapshot")
            .force();

      api.create("ea6f70ef-2784-40b9-9d14-d7f33c507c3f", options);
View Full Code Here

                  .statusCode(400)
                  .payload("{\"badRequest\": {\"message\": \"Invalid volume: must be available\", \"code\": 400}}")
                  .build()
      ).getSnapshotApiForZone("RegionOne");
     
      CreateSnapshotOptions options = CreateSnapshotOptions.Builder
            .name("jclouds-test-snapshot")
            .description("jclouds test snapshot")
            .force();

      api.create("ea6f70ef-2784-40b9-9d14-d7f33c507c3f", options);
View Full Code Here

                  .payload(payloadFromResourceWithContentType("/snapshot_create.json", MediaType.APPLICATION_JSON))
                  .build(),
            HttpResponse.builder().statusCode(401).build()
      ).getSnapshotApiForZone("RegionOne");

      CreateSnapshotOptions options = CreateSnapshotOptions.Builder
            .name("jclouds-test-snapshot")
            .description("jclouds test snapshot")
            .force();

      api.create("ea6f70ef-2784-40b9-9d14-d7f33c507c3f", options);
View Full Code Here

TOP

Related Classes of org.jclouds.openstack.cinder.v1.extensions.AvailabilityZoneApi

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.