Package org.jclouds.openstack.neutron.v2_0.domain

Examples of org.jclouds.openstack.neutron.v2_0.domain.Reference


         authenticatedGET().endpoint(endpoint + "/routers/16dba3bc-f3fa-4775-afdc-237e12c72f6a").build(),
         HttpResponse.builder().statusCode(200).payload(payloadFromResourceWithContentType("/router.json", APPLICATION_JSON)).build())
         .getRouterExtensionForZone(ZONE).get();

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


         authenticatedGET().endpoint(endpoint + "/routers/16dba3bc-f3fa-4775-afdc-237e12c72f6a").build(),
         HttpResponse.builder().statusCode(200).payload(payloadFromResourceWithContentType("/router.json", APPLICATION_JSON)).build())
         .getRouterExtensionForZone(ZONE).get();

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

         authenticatedGET().endpoint(endpoint + "/subnets/624312ff-d14b-4ba3-9834-1c78d23d574d").build(),
         HttpResponse.builder().statusCode(200).payload(payloadFromResourceWithContentType("/subnet.json", APPLICATION_JSON)).build())
         .getSubnetApiForZone(ZONE);

      Subnet subnet = api.get("624312ff-d14b-4ba3-9834-1c78d23d574d");
      assertEquals(subnet, new ParseSubnetTest().expected());
   }
View Full Code Here

            keystoneAuthWithUsernameAndPassword, responseWithKeystoneAccess,
            authenticatedGET().endpoint(endpoint + "/tenants/3456/networks/16dba3bc-f3fa-4775-afdc-237e12c72f6a/ports").method("POST").build(),
            HttpResponse.builder().statusCode(200).payload(payloadFromStringWithContentType("{\"port\":{\"id\":\"12345\"}}", APPLICATION_JSON)).build())
            .getPortApiForZoneAndNetwork("region-a.geo-1", "16dba3bc-f3fa-4775-afdc-237e12c72f6a");

      Reference port = api.create();
      assertEquals(port, Reference.builder().id("12345").build());
   }
View Full Code Here

            authenticatedGET().endpoint(endpoint + "/tenants/3456/networks").method("POST")
                  .payload(payloadFromStringWithContentType("{\"network\":{\"name\":\"another-test\"}}", MediaType.APPLICATION_JSON)).build(),
            HttpResponse.builder().statusCode(200).payload(payloadFromStringWithContentType("{\"network\":{\"id\":\"12345\"}}", APPLICATION_JSON)).build())
            .getNetworkApiForZone("region-a.geo-1");

      Reference net = api.create("another-test");
      assertEquals(net, Reference.builder().id("12345").build());
   }
View Full Code Here

   }

   public void testCreateUpdateAndDeletePort() {
      for (String zoneId : api.getConfiguredZones()) {
         NetworkApi netApi = api.getNetworkApiForZone(zoneId);
         Reference net = netApi.create("jclouds-port-test");
         assertNotNull(net);
         PortApi portApi = api.getPortApiForZoneAndNetwork(zoneId, net.getId());

         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));
        
         port = portApi.get(portRef.getId());
         portDetails = portApi.getDetails(portRef.getId());

         for(Port checkme : ImmutableList.of(port, portDetails)) {
            assertEquals(checkme.getId(), portRef.getId());
            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");
         }
        
         assertTrue(portApi.unplugAttachment(port.getId()));

         assertTrue(portApi.delete(portRef.getId()));
         assertTrue(netApi.delete(net.getId()));
      }
   }
View Full Code Here

   @Test(enabled=false) // assuming attachmentId matters in the wild
   public void testAttachAndDetachPort() {
      for (String zoneId : api.getConfiguredZones()) {
         NetworkApi netApi = api.getNetworkApiForZone(zoneId);
         Reference net = netApi.create("jclouds-attach-test");
         assertNotNull(net);

         PortApi portApi = api.getPortApiForZoneAndNetwork(zoneId, net.getId());

         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");
         }

         assertTrue(portApi.unplugAttachment(port.getId()));

         assertTrue(portApi.delete(port.getId()));
         assertTrue(netApi.delete(net.getId()));
      }
   }
View Full Code Here

   }

   public void testCreateUpdateAndDeleteNetwork() {
      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");
         }
        
         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()));
         assertTrue(netApi.delete(net2.getId()));
      }
   }  
View Full Code Here

  
   @Override
   @BeforeClass(alwaysRun = true)
   public void setupRequiredApis() {
      groupApi = adminContext.getApi().getGroupApi();
      Reference orgRef = null;
     
      // TODO: requisite LDAP settings
//      oldLdapSettings = adminContext.getApi().getAdminOrgApi().getLdapSettings(orgRef.getId());
//      OrgLdapSettings newLdapSettings = oldLdapSettings.toBuilder()
//         .ldapMode(OrgLdapSettings.LdapMode.SYSTEM) 
View Full Code Here

    * @throws VCloudException
    */
   public RecomposeVAppParams addRecomposeParams(VApp vApp, Vm vm) {

      // creating an item element. this item will contain the vm which should be added to the vapp.
      Reference reference = Reference.builder().name(name("vm-")).href(vm.getHref()).type(vm.getType()).build();
      SourcedCompositionItemParam vmItem = SourcedCompositionItemParam.builder().source(reference).build();

      InstantiationParams vmInstantiationParams = null;

      Set<NetworkAssignment> networkAssignments = Sets.newLinkedHashSet();
View Full Code Here

TOP

Related Classes of org.jclouds.openstack.neutron.v2_0.domain.Reference

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.