Package org.jclouds.openstack.neutron.v2.domain

Examples of org.jclouds.openstack.neutron.v2.domain.Subnet$CreateBuilder


      server.enqueue(addCommonHeaders(
            new MockResponse().setResponseCode(404)));

      try {
         NeutronApi neutronApi = api(server.getUrl("/").toString(), "openstack-neutron", overrides);
         RouterApi api = neutronApi.getRouterExtensionApi("RegionOne").get();

         boolean result = api.removeInterfaceForPort("12345", "portid");

         /*
          * Check request
          */
         assertAuthentication(server);
View Full Code Here


   }

   @Override
   protected Function<Object, IterableWithMarker<Network>> markerToNextForArg0(Optional<Object> arg0) {
      String region = arg0.isPresent() ? arg0.get().toString() : null;
      final NetworkApi networkApi = api.getNetworkApi(region);
      return new Function<Object, IterableWithMarker<Network>>() {

         @SuppressWarnings("unchecked")
         @Override
         public IterableWithMarker<Network> apply(Object input) {
            PaginationOptions paginationOptions = PaginationOptions.class.cast(input);
            return IterableWithMarker.class.cast(networkApi.list(paginationOptions));
         }

         @Override
         public String toString() {
            return "listNetworks()";
View Full Code Here

   }

   @Override
   protected Function<Object, IterableWithMarker<Port>> markerToNextForArg0(Optional<Object> arg0) {
      String region = arg0.isPresent() ? arg0.get().toString() : null;
      final PortApi portApi = api.getPortApi(region);
      return new Function<Object, IterableWithMarker<Port>>() {

         @SuppressWarnings("unchecked")
         @Override
         public IterableWithMarker<Port> apply(Object input) {
            PaginationOptions paginationOptions = PaginationOptions.class.cast(input);
            return IterableWithMarker.class.cast(portApi.list(paginationOptions));
         }

         @Override
         public String toString() {
            return "listPortsInDetail()";
View Full Code Here

   }

   @Override
   protected Function<Object, IterableWithMarker<Subnet>> markerToNextForArg0(Optional<Object> arg0) {
      String region = arg0.isPresent() ? arg0.get().toString() : null;
      final SubnetApi subnetApi = api.getSubnetApi(region);
      return new Function<Object, IterableWithMarker<Subnet>>() {

         @SuppressWarnings("unchecked")
         @Override
         public IterableWithMarker<Subnet> apply(Object input) {
            PaginationOptions paginationOptions = PaginationOptions.class.cast(input);
            return IterableWithMarker.class.cast(subnetApi.list(paginationOptions));
         }

         @Override
         public String toString() {
            return "listSubnets()";
View Full Code Here

         for (Subnet subnet : subnets) {
            assertNotNull(subnet.getNetworkId());
            assertTrue(references.contains(ReferenceWithName.builder().id(subnet.getId()).tenantId(subnet.getTenantId()).name(subnet.getName()).build()));

            Subnet retrievedSubnet = api.getSubnetApiForZone(zone).get(subnet.getId());
            assertEquals(retrievedSubnet, subnet);
         }
      }
   }
View Full Code Here

            AllocationPool.builder().start("a3:bc00::50").end("a3:bc00::90").build()
         );
         Set<HostRoute> hostRoutes = ImmutableSet.of(
            HostRoute.builder().destinationCidr("a3:bc00::/48").nextHop("a3:bc00::0004").build()
         );
         Subnet subnet = subnetApi.create(networkId, 6, "a3:bc00::/48", CreateSubnetOptions.builder().allocationPools(allocationPools).hostRoutes(hostRoutes).build());
         assertNotNull(subnet);

         Subnet retrievedSubnet = subnetApi.get(subnet.getId());

         assertEquals(retrievedSubnet.getId(), subnet.getId());
         assertEquals(retrievedSubnet.getCidr(), "a3:bc00::/48");
         assertTrue(retrievedSubnet.getDnsNameServers().isEmpty());
         assertEquals(retrievedSubnet.getAllocationPools().size(), 2);
         assertEquals(retrievedSubnet.getHostRoutes().size(), 1);
         assertTrue(subnetApi.update(retrievedSubnet.getId(), UpdateSubnetOptions.builder().name("jclouds-live-test-update").build()));

         retrievedSubnet = subnetApi.get(retrievedSubnet.getId());

         assertEquals(retrievedSubnet.getId(), subnet.getId());
         assertEquals(retrievedSubnet.getName(), "jclouds-live-test-update");
         assertTrue(retrievedSubnet.getDnsNameServers().isEmpty());

         Subnet subnet2 = subnetApi.create(networkId, 6, "a3:bd01::/48");
         assertNotNull(subnet2);

         assertTrue(subnetApi.delete(subnet.getId()));
         assertTrue(subnetApi.delete(subnet2.getId()));
         assertTrue(networkApi.delete(networkId));
      }
   }
View Full Code Here

         for (Subnet subnet : subnets) {
            assertNotNull(subnet.getNetworkId());
            assertTrue(references.contains(ReferenceWithName.builder().id(subnet.getId()).tenantId(subnet.getTenantId()).name(subnet.getName()).build()));

            Subnet retrievedSubnet = api.getSubnetApiForZone(zone).get(subnet.getId());
            assertEquals(retrievedSubnet, subnet);
         }
      }
   }
View Full Code Here

            AllocationPool.builder().start("a3:bc00::50").end("a3:bc00::90").build()
         );
         Set<HostRoute> hostRoutes = ImmutableSet.of(
            HostRoute.builder().destinationCidr("a3:bc00::/48").nextHop("a3:bc00::0004").build()
         );
         Subnet subnet = subnetApi.create(networkId, 6, "a3:bc00::/48", CreateSubnetOptions.builder().allocationPools(allocationPools).hostRoutes(hostRoutes).build());
         assertNotNull(subnet);

         Subnet retrievedSubnet = subnetApi.get(subnet.getId());

         assertEquals(retrievedSubnet.getId(), subnet.getId());
         assertEquals(retrievedSubnet.getCidr(), "a3:bc00::/48");
         assertTrue(retrievedSubnet.getDnsNameServers().isEmpty());
         assertEquals(retrievedSubnet.getAllocationPools().size(), 2);
         assertEquals(retrievedSubnet.getHostRoutes().size(), 1);
         assertTrue(subnetApi.update(retrievedSubnet.getId(), UpdateSubnetOptions.builder().name("jclouds-live-test-update").build()));

         retrievedSubnet = subnetApi.get(retrievedSubnet.getId());

         assertEquals(retrievedSubnet.getId(), subnet.getId());
         assertEquals(retrievedSubnet.getName(), "jclouds-live-test-update");
         assertTrue(retrievedSubnet.getDnsNameServers().isEmpty());

         Subnet subnet2 = subnetApi.create(networkId, 6, "a3:bd01::/48");
         assertNotNull(subnet2);

         assertTrue(subnetApi.delete(subnet.getId()));
         assertTrue(subnetApi.delete(subnet2.getId()));
         assertTrue(networkApi.delete(networkId));
      }
   }
View Full Code Here

         for (Subnet subnet : subnets) {
            assertNotNull(subnet.getNetworkId());
            assertTrue(references.contains(ReferenceWithName.builder().id(subnet.getId()).tenantId(subnet.getTenantId()).name(subnet.getName()).build()));

            Subnet retrievedSubnet = api.getSubnetApiForZone(zone).get(subnet.getId());
            assertEquals(retrievedSubnet, subnet);
         }
      }
   }
View Full Code Here

            AllocationPool.builder().start("a3:bc00::50").end("a3:bc00::90").build()
         );
         Set<HostRoute> hostRoutes = ImmutableSet.of(
            HostRoute.builder().destinationCidr("a3:bc00::/48").nextHop("a3:bc00::0004").build()
         );
         Subnet subnet = subnetApi.create(networkId, 6, "a3:bc00::/48", CreateSubnetOptions.builder().allocationPools(allocationPools).hostRoutes(hostRoutes).build());
         assertNotNull(subnet);

         Subnet retrievedSubnet = subnetApi.get(subnet.getId());

         assertEquals(retrievedSubnet.getId(), subnet.getId());
         assertEquals(retrievedSubnet.getCidr(), "a3:bc00::/48");
         assertTrue(retrievedSubnet.getDnsNameServers().isEmpty());
         assertEquals(retrievedSubnet.getAllocationPools().size(), 2);
         assertEquals(retrievedSubnet.getHostRoutes().size(), 1);
         assertTrue(subnetApi.update(retrievedSubnet.getId(), UpdateSubnetOptions.builder().name("jclouds-live-test-update").build()));

         retrievedSubnet = subnetApi.get(retrievedSubnet.getId());

         assertEquals(retrievedSubnet.getId(), subnet.getId());
         assertEquals(retrievedSubnet.getName(), "jclouds-live-test-update");
         assertTrue(retrievedSubnet.getDnsNameServers().isEmpty());

         Subnet subnet2 = subnetApi.create(networkId, 6, "a3:bd01::/48");
         assertNotNull(subnet2);

         assertTrue(subnetApi.delete(subnet.getId()));
         assertTrue(subnetApi.delete(subnet2.getId()));
         assertTrue(networkApi.delete(networkId));
      }
   }
View Full Code Here

TOP

Related Classes of org.jclouds.openstack.neutron.v2.domain.Subnet$CreateBuilder

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.