Package org.jclouds.openstack.neutron.v2_0.functions

Examples of org.jclouds.openstack.neutron.v2_0.functions.ParsePortDetails


         authenticatedGET().endpoint(endpoint + "/routers/12345/add_router_interface").method("PUT")
            .payload(payloadFromStringWithContentType("{\"subnet_id\":\"1234567890\"}", MediaType.APPLICATION_JSON)).build(),
         HttpResponse.builder().statusCode(200).payload(payloadFromStringWithContentType("{\"subnet_id\":\"1234567890\",\"port_id\":\"987654321\"}", MediaType.APPLICATION_JSON)).build())
         .getRouterExtensionForZone(ZONE).get();

      RouterInterface routerInterface = api.addInterfaceForSubnet("12345", "1234567890");
      assertEquals(routerInterface, RouterInterface.builder().subnetId("1234567890").portId("987654321").build());
   }
View Full Code Here


         authenticatedGET().endpoint(endpoint + "/routers/12345/add_router_interface").method("PUT")
            .payload(payloadFromStringWithContentType("{\"port_id\":\"987654321\"}", MediaType.APPLICATION_JSON)).build(),
         HttpResponse.builder().statusCode(200).payload(payloadFromStringWithContentType("{\"subnet_id\":\"1234567890\",\"port_id\":\"987654321\"}", MediaType.APPLICATION_JSON)).build())
         .getRouterExtensionForZone(ZONE).get();

      RouterInterface routerInterface = api.addInterfaceForPort("12345", "987654321");
      assertEquals(routerInterface, RouterInterface.builder().subnetId("1234567890").portId("987654321").build());
   }
View Full Code Here

         authenticatedGET().endpoint(endpoint + "/routers/12345/add_router_interface").method("PUT")
            .payload(payloadFromStringWithContentType("{\"subnet_id\":\"1234567890\"}", MediaType.APPLICATION_JSON)).build(),
         HttpResponse.builder().statusCode(200).payload(payloadFromStringWithContentType("{\"subnet_id\":\"1234567890\",\"port_id\":\"987654321\"}", MediaType.APPLICATION_JSON)).build())
         .getRouterExtensionForZone(ZONE).get();

      RouterInterface routerInterface = api.addInterfaceForSubnet("12345", "1234567890");
      assertEquals(routerInterface, RouterInterface.builder().subnetId("1234567890").portId("987654321").build());
   }
View Full Code Here

         authenticatedGET().endpoint(endpoint + "/routers/12345/add_router_interface").method("PUT")
            .payload(payloadFromStringWithContentType("{\"port_id\":\"987654321\"}", MediaType.APPLICATION_JSON)).build(),
         HttpResponse.builder().statusCode(200).payload(payloadFromStringWithContentType("{\"subnet_id\":\"1234567890\",\"port_id\":\"987654321\"}", MediaType.APPLICATION_JSON)).build())
         .getRouterExtensionForZone(ZONE).get();

      RouterInterface routerInterface = api.addInterfaceForPort("12345", "987654321");
      assertEquals(routerInterface, RouterInterface.builder().subnetId("1234567890").portId("987654321").build());
   }
View Full Code Here

         assertNotNull(subnet2);

         Router router = routerApi.create(CreateRouterOptions.builder().name("jclouds-router-test").build());
         assertNotNull(router);

         RouterInterface routerInterface = routerApi.addInterfaceForSubnet(router.getId(), subnet.getId());
         assertNotNull(routerInterface);

         RouterInterface routerInterface2 = routerApi.addInterfaceForSubnet(router.getId(), subnet2.getId());
         assertNotNull(routerInterface2);

         assertTrue(routerApi.removeInterfaceForSubnet(router.getId(), subnet.getId()));
         assertTrue(routerApi.removeInterfaceForSubnet(router.getId(), subnet2.getId()));
         assertTrue(routerApi.delete(router.getId()));
View Full Code Here

         assertNotNull(port2);

         Router router = routerApi.create(CreateRouterOptions.builder().name("jclouds-router-test").build());
         assertNotNull(router);

         RouterInterface routerInterface = routerApi.addInterfaceForPort(router.getId(), port.getId());
         assertNotNull(routerInterface);

         RouterInterface routerInterface2 = routerApi.addInterfaceForPort(router.getId(), port2.getId());
         assertNotNull(routerInterface2);

         assertTrue(routerApi.removeInterfaceForPort(router.getId(), port.getId()));
         assertTrue(routerApi.removeInterfaceForPort(router.getId(), port2.getId()));
         assertTrue(routerApi.delete(router.getId()));
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_0.functions.ParsePortDetails

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.