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

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


         Router.UpdateOptions updateOptions = Router.updateOptions()
               .externalGatewayInfo(
                     ExternalGatewayInfo.builder().networkId("8ca37218-28ff-41cb-9b10-039601ea7e6b").build())
               .build();

         Router router = api.update("12345", updateOptions);

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

         /*
          * Check response
          */
         assertNotNull(router);
         assertEquals(router.getName(), "another_router");
         assertEquals(router.getExternalGatewayInfo().getNetworkId(), "8ca37218-28ff-41cb-9b10-039601ea7e6b");
         assertEquals(router.getStatus(), NetworkStatus.ACTIVE);
         assertEquals(router.isAdminStateUp().booleanValue(), true);
         assertEquals(router.getId(), "8604a0de-7f6b-409a-a47c-a1cc7bc77b2e");
         assertEquals(router.getTenantId(), "6b96ff0cb17a4b859e1e575d221683d3");
      } finally {
         server.shutdown();
      }
   }
View Full Code Here


         Router.UpdateOptions updateOptions = Router.updateOptions()
               .externalGatewayInfo(
                     ExternalGatewayInfo.builder().networkId("8ca37218-28ff-41cb-9b10-039601ea7e6b").build())
               .build();

         Router router = api.update("12345", updateOptions);

         /*
          * 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.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

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

         Routers routers = api.list(PaginationOptions.Builder.limit(2).marker("abcdefg"));

         /*
          * Check request
          */
         assertAuthentication(server);
         assertRequest(server.takeRequest(), "GET", "/v2.0/routers?limit=2&marker=abcdefg");

         /*
          * Check response
          */
         assertNotNull(routers);
         assertEquals(routers.size(), 2);
         assertEquals(routers.first().get().getId(), "a9254bdb-2613-4a13-ac4c-adc581fba50d");
      } finally {
         server.shutdown();
      }
   }
View Full Code Here

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

         Routers routers = api.list(PaginationOptions.Builder.limit(2).marker("abcdefg"));

         /*
          * Check request
          */
         assertAuthentication(server);
         assertRequest(server.takeRequest(), "GET", "/v2.0/routers?limit=2&marker=abcdefg");

         /*
          * Check response
          */
         assertNotNull(routers);
         assertTrue(routers.isEmpty());
      } finally {
         server.shutdown();
      }
   }
View Full Code Here

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

         Subnet subnet = api.get("12345");

         /*
          * Check request
          */
         assertEquals(server.getRequestCount(), 2);
View Full Code Here

         Subnet.UpdateOptions updateSubnet = Subnet.updateOptions()
               .name("new_name")
               .gatewayIp("10.0.3.254")
               .build();

         Subnet subnet = api.update("12345", updateSubnet);

         /*
          * Check request
          */
         assertEquals(server.getRequestCount(), 2);
         assertAuthentication(server);
         assertRequest(server.takeRequest(), "PUT", "/v2.0/subnets/12345", "/subnet_update_request.json");

         /*
          * Check response
          */
         assertNotNull(subnet);
         assertEquals(subnet.getName(), "new_name");
         assertEquals(subnet.getId(), "9436e561-47bf-436a-b1f1-fe23a926e031");
         assertEquals(subnet.getTenantId(), "c1210485b2424d48804aad5d39c61b8f");
      } finally {
         server.shutdown();
      }
   }
View Full Code Here

TOP

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

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.