Package org.jclouds.openstack.quantum.v1_0.domain

Examples of org.jclouds.openstack.quantum.v1_0.domain.Attachment$Builder


               "standard", 0, false, Sets.<Attachment> newLinkedHashSet()));
      expected.add(new Volume(defaultRegion, "vol-4282672b", 800, "snap-536d1b3a",
              "us-east-1a", Volume.Status.IN_USE, dateService
              .iso8601DateParse("2008-05-07T11:51:50.000Z"),
              "standard", 0, false,
              Sets.<Attachment> newHashSet(new Attachment(defaultRegion, "vol-4282672b", "i-6058a509",
                      "/dev/sdh", Attachment.Status.ATTACHED, dateService
                      .iso8601DateParse("2008-05-07T12:51:50.000Z")))));

      DescribeVolumesResponseHandler handler = injector
               .getInstance(DescribeVolumesResponseHandler.class);
View Full Code Here


public class AttachmentHandlerTest extends BaseEC2HandlerTest {
   public void testApplyInputStream() {
      DateService dateService = injector.getInstance(DateService.class);
      InputStream is = getClass().getResourceAsStream("/attach.xml");

      Attachment expected = new Attachment(defaultRegion, "vol-4d826724", "i-6058a509", "/dev/sdh",
            Attachment.Status.ATTACHING, dateService.iso8601DateParse("2008-05-07T11:51:50.000Z"));

      AttachmentHandler handler = injector.getInstance(AttachmentHandler.class);
      addDefaultRegionToHandler(handler);
      Attachment result = factory.create(handler).parse(is);

      assertEquals(result, expected);
   }
View Full Code Here

            keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
            authenticatedGET().endpoint(endpoint + "/tenants/3456/networks/16dba3bc-f3fa-4775-afdc-237e12c72f6a/ports/77777/attachment").build(),
            HttpResponse.builder().statusCode(200).payload(payloadFromResourceWithContentType("/attachment.json", APPLICATION_JSON)).build())
            .getPortApiForZoneAndNetwork("region-a.geo-1", "16dba3bc-f3fa-4775-afdc-237e12c72f6a");

      Attachment attachment = api.showAttachment("77777");
      assertEquals(attachment, Attachment.builder().id("jclouds-live-test").build());
   }
View Full Code Here

            assertEquals(checkme.getState(), Port.State.DOWN);
         }
        
         assertTrue(portApi.plugAttachment(port.getId(), "jclouds-live-test"));

         Attachment attachment = portApi.showAttachment(port.getId());
         portDetails = portApi.getDetails(portRef.getId());

         for(Attachment checkme : ImmutableList.of(attachment, portDetails.getAttachment())) {
            assertNotNull(checkme);
            assertEquals(checkme.getId(), "jclouds-live-test");
View Full Code Here

         Reference port = portApi.create();
         assertNotNull(port);

         assertTrue(portApi.plugAttachment(port.getId(), "jclouds-live-test"));

         Attachment attachment = portApi.showAttachment(port.getId());
         PortDetails portDetails = portApi.getDetails(port.getId());

         for(Attachment checkme : ImmutableList.of(attachment, portDetails.getAttachment())) {
            assertNotNull(checkme);
            assertEquals(checkme.getId(), "jclouds-live-test");
View Full Code Here

            keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
            authenticatedGET().endpoint(endpoint + "/tenants/3456/networks/16dba3bc-f3fa-4775-afdc-237e12c72f6a").build(),
            HttpResponse.builder().statusCode(200).payload(payloadFromResourceWithContentType("/network.json", APPLICATION_JSON)).build())
            .getNetworkApiForZone("region-a.geo-1");

      Network net = api.get("16dba3bc-f3fa-4775-afdc-237e12c72f6a");
      assertEquals(net, new ParseNetworkTest().expected());
   }
View Full Code Here

      for (String zoneId : api.getConfiguredZones()) {
         NetworkApi netApi = api.getNetworkApiForZone(zoneId);
         Reference net = netApi.create("jclouds-test");
         assertNotNull(net);

         Network network = netApi.get(net.getId());
         NetworkDetails details = netApi.getDetails(net.getId());
        
         for(Network checkme : ImmutableList.of(network, details)) {
            assertEquals(checkme.getId(), net.getId());
            assertEquals(checkme.getName(), "jclouds-test");
View Full Code Here

            keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
            authenticatedGET().endpoint(endpoint + "/tenants/3456/networks/16dba3bc-f3fa-4775-afdc-237e12c72f6a/detail").build(),
            HttpResponse.builder().statusCode(200).payload(payloadFromResourceWithContentType("/network_details.json", APPLICATION_JSON)).build())
            .getNetworkApiForZone("region-a.geo-1");

      NetworkDetails net = api.getDetails("16dba3bc-f3fa-4775-afdc-237e12c72f6a");
      assertEquals(net, new ParseNetworkDetailsTest().expected());
   }
View Full Code Here

         Reference portRef = portApi.create();
         assertNotNull(portRef);
        
         Port port = portApi.get(portRef.getId());
         PortDetails portDetails = portApi.getDetails(portRef.getId());
         NetworkDetails networkDetails = netApi.getDetails(net.getId());

         assertEquals(port.getState(), portDetails.getState());

         for(Port checkme : ImmutableList.of(port, portDetails, Iterables.getOnlyElement(networkDetails.getPorts()))) {
            assertEquals(checkme.getId(), portRef.getId());
         }

         assertTrue(portApi.updateState(portRef.getId(), Port.State.DOWN));
        
View Full Code Here

         NetworkApi netApi = api.getNetworkApiForZone(zoneId);
         Reference net = netApi.create("jclouds-test");
         assertNotNull(net);

         Network network = netApi.get(net.getId());
         NetworkDetails details = netApi.getDetails(net.getId());
        
         for(Network checkme : ImmutableList.of(network, details)) {
            assertEquals(checkme.getId(), net.getId());
            assertEquals(checkme.getName(), "jclouds-test");
         }
        
         assertTrue(details.getPorts().isEmpty());

         assertTrue(netApi.rename(net.getId(), "jclouds-live-test"));
        
         // Grab the updated metadata
         network = netApi.get(net.getId());
         details = netApi.getDetails(net.getId());

         for(Network checkme : ImmutableList.of(network, details)) {
            assertEquals(checkme.getId(), net.getId());
            assertEquals(checkme.getName(), "jclouds-live-test");
         }

         assertTrue(details.getPorts().isEmpty());

         Reference net2 = netApi.create("jclouds-test2");
         assertNotNull(net2);
       
         assertTrue(netApi.delete(net.getId()));
View Full Code Here

TOP

Related Classes of org.jclouds.openstack.quantum.v1_0.domain.Attachment$Builder

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.