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

Examples of org.jclouds.openstack.neutron.v2_0.domain.RouterInterface$Builder


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

         RouterInterface routerInterface = api.addInterfaceForSubnet("12345", "a2f1f29d-571b-4533-907f-5803ab96ead1");

         /*
          * Check request
          */
         assertAuthentication(server);
         assertRequest(server.takeRequest(), "PUT", "/v2.0/routers/12345/add_router_interface", "/router_add_interface_request.json");

         /*
          * Check response
          */
         assertNotNull(routerInterface);
         assertEquals(routerInterface.getSubnetId(), "a2f1f29d-571b-4533-907f-5803ab96ead1");
         assertEquals(routerInterface.getPortId(), "3a44f4e5-1694-493a-a1fb-393881c673a4");
      } finally {
         server.shutdown();
      }
   }
View Full Code Here


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

         RouterInterface routerInterface = api.addInterfaceForSubnet("12345", "a2f1f29d-571b-4533-907f-5803ab96ead1");

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

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

         RouterInterface routerInterface = api.addInterfaceForPort("12345", "portid");

         /*
          * Check request
          */
         assertAuthentication(server);
         assertRequest(server.takeRequest(), "PUT", "/v2.0/routers/12345/add_router_interface", "/router_add_interface_port_request.json");

         /*
          * Check response
          */
         assertNotNull(routerInterface);
         assertEquals(routerInterface.getSubnetId(), "a2f1f29d-571b-4533-907f-5803ab96ead1");
         assertEquals(routerInterface.getPortId(), "3a44f4e5-1694-493a-a1fb-393881c673a4");
      } finally {
         server.shutdown();
      }
   }
View Full Code Here

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

         RouterInterface routerInterface = api.addInterfaceForPort("12345", "portid");

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

         assertNotNull(subnet2);

         Router router = routerApi.create(Router.createOptions().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(Router.createOptions().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 (Network network : networks) {
            assertNotNull(network.getName());
            assertTrue(references.contains(ReferenceWithName.builder().id(network.getId()).tenantId(network.getTenantId()).name(network.getName()).build()));

            Network retrievedNetwork = api.getNetworkApiForZone(zone).get(network.getId());
            assertEquals(network, retrievedNetwork);
         }
      }
   }
View Full Code Here

   }

   public void testCreateUpdateAndDeleteNetwork() {
      for (String zone : api.getConfiguredZones()) {
         NetworkApi networkApi = api.getNetworkApiForZone(zone);
         Network net = networkApi.create(CreateNetworkOptions.builder().name("jclouds-test").networkType(NetworkType.LOCAL).build());
         Network test = networkApi.create();
         assertNotNull(net);

         Network network = networkApi.get(net.getId());

         assertEquals(network.getId(), net.getId());
         assertEquals(network.getName(), "jclouds-test");
         assertEquals(network.getNetworkType(), NetworkType.LOCAL);
         assertTrue(network.getSubnets().isEmpty());
         assertTrue(networkApi.update(net.getId(), UpdateNetworkOptions.builder().name("jclouds-live-test").build()));

         network = networkApi.get(net.getId());

         assertEquals(network.getId(), net.getId());
         assertEquals(network.getName(), "jclouds-live-test");
         assertTrue(network.getSubnets().isEmpty());

         Network net2 = networkApi.create(CreateNetworkOptions.builder().name("jclouds-test2").networkType(NetworkType.LOCAL).build());
         assertNotNull(net2);

         assertTrue(networkApi.delete(net.getId()));
         assertTrue(networkApi.delete(net2.getId()));
         assertTrue(networkApi.delete(test.getId()));
      }
   }
View Full Code Here

         keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess,
         authenticatedGET().endpoint(endpoint + "/networks/16dba3bc-f3fa-4775-afdc-237e12c72f6a").build(),
         HttpResponse.builder().statusCode(200).payload(payloadFromResourceWithContentType("/network.json", APPLICATION_JSON)).build())
         .getNetworkApiForZone(ZONE);

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

         authenticatedGET().endpoint(endpoint + "/networks").method("POST")
            .payload(payloadFromStringWithContentType("{\"network\":{\"name\":\"another-test\",\"router:external\":true,\"provider:network_type\":\"local\"}}", MediaType.APPLICATION_JSON)).build(),
         HttpResponse.builder().statusCode(200).payload(payloadFromStringWithContentType("{\"network\":{\"id\":\"12345\",\"tenant_id\":\"6789\",\"router:external\":true,\"provider:network_type\":\"local\"}}", APPLICATION_JSON)).build())
         .getNetworkApiForZone(ZONE);

      Network net = api.create(CreateNetworkOptions.builder().name("another-test").external(true).networkType(NetworkType.LOCAL).build());
      assertEquals(net, Network.builder().id("12345").tenantId("6789").external(true).networkType(NetworkType.LOCAL).build());
   }
View Full Code Here

TOP

Related Classes of org.jclouds.openstack.neutron.v2_0.domain.RouterInterface$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.