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

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


            } else if (network.getNetworkType() == NetworkType.GRE) {
               checkNotNull(network.getSegmentationId(), "segmentationId must be present when NetworkType=GRE");
            }
         }

         CreateNetworkRequest createNetworkRequest = new CreateNetworkRequest();
         if (network.getName() != null)
            createNetworkRequest.name = network.getName();
         if (network.getAdminStateUp() != null)
            createNetworkRequest.admin_state_up = network.getAdminStateUp();
         if (network.getExternal() != null)
View Full Code Here


            } else if (network.getNetworkType() == NetworkType.GRE) {
               checkNotNull(network.getSegmentationId(), "segmentationId must be present when NetworkType=GRE");
            }
         }

         CreateNetworkRequest createNetworkRequest = new CreateNetworkRequest();
         if (network.getName() != null)
            createNetworkRequest.name = network.getName();
         if (network.getAdminStateUp() != null)
            createNetworkRequest.admin_state_up = network.getAdminStateUp();
         if (network.getExternal() != null)
View Full Code Here

         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/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 + "/ports/624312ff-d14b-4ba3-9834-1c78d23d574d").build(),
         HttpResponse.builder().statusCode(200).payload(payloadFromResourceWithContentType("/port.json", APPLICATION_JSON)).build())
         .getPortApiForZone(ZONE);

      Port port = api.get("624312ff-d14b-4ba3-9834-1c78d23d574d");
      assertEquals(port, new ParsePortTest().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 + "/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/646c123b-871a-4124-9fa2-a94f04a582df").build(),
            HttpResponse.builder().statusCode(200).payload(payloadFromResourceWithContentType("/port.json", APPLICATION_JSON)).build())
            .getPortApiForZoneAndNetwork("region-a.geo-1", "16dba3bc-f3fa-4775-afdc-237e12c72f6a");

      Port port = api.get("646c123b-871a-4124-9fa2-a94f04a582df");
      assertEquals(port, new ParsePortTest().expected());
   }
View Full Code Here

         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

TOP

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