Package org.jclouds.openstack.neutron.v2_0

Examples of org.jclouds.openstack.neutron.v2_0.NeutronApi


         for (Port port : ports) {
            assertNotNull(port.getName());
            assertTrue(references.contains(ReferenceWithName.builder().id(port.getId()).tenantId(port.getTenantId()).name(port.getName()).build()));

            Port retrievedPort = api.getPortApiForZone(zone).get(port.getId());
            assertEquals(port, retrievedPort);
         }
      }
   }
View Full Code Here


         String ipv6PortId = portApi.create(networkId, CreatePortOptions.builder().name("JClouds-Live-IPv6-Port").fixedIps(getFixedAddresses(ipv6SubnetId)).build()).getId();

         assertNotNull(ipv4PortId);
         assertNotNull(ipv6PortId);

         Port ipv4Port = portApi.get(ipv4PortId);
         assertNotNull(ipv4Port);
         assertEquals(ipv4Port.getId(), ipv4PortId);
         assertEquals(ipv4Port.getName(), "JClouds-Live-IPv4-Port");

         Port ipv6Port = portApi.get(ipv6PortId);
         assertNotNull(ipv6Port);
         assertEquals(ipv6Port.getId(), ipv6PortId);
         assertEquals(ipv6Port.getName(), "JClouds-Live-IPv6-Port");

         assertTrue(portApi.update(ipv4PortId, UpdatePortOptions.builder().name("Updated").build()));
         Port updatedIpv4Port = portApi.get(ipv4PortId);
         assertEquals(updatedIpv4Port.getName(), "Updated");

         assertTrue(portApi.delete(ipv4PortId));
         assertTrue(portApi.delete(ipv6PortId));
         assertTrue(subnetApi.delete(ipv4SubnetId));
         assertTrue(subnetApi.delete(ipv6SubnetId));
View Full Code Here

         for (Port port : ports) {
            assertNotNull(port.getName());
            assertTrue(references.contains(ReferenceWithName.builder().id(port.getId()).tenantId(port.getTenantId()).name(port.getName()).build()));

            Port retrievedPort = api.getPortApiForZone(zone).get(port.getId());
            assertEquals(port, retrievedPort);
         }
      }
   }
View Full Code Here

         String ipv6PortId = portApi.create(networkId, CreatePortOptions.builder().name("JClouds-Live-IPv6-Port").fixedIps(getFixedAddresses(ipv6SubnetId)).build()).getId();

         assertNotNull(ipv4PortId);
         assertNotNull(ipv6PortId);

         Port ipv4Port = portApi.get(ipv4PortId);
         assertNotNull(ipv4Port);
         assertEquals(ipv4Port.getId(), ipv4PortId);
         assertEquals(ipv4Port.getName(), "JClouds-Live-IPv4-Port");

         Port ipv6Port = portApi.get(ipv6PortId);
         assertNotNull(ipv6Port);
         assertEquals(ipv6Port.getId(), ipv6PortId);
         assertEquals(ipv6Port.getName(), "JClouds-Live-IPv6-Port");

         assertTrue(portApi.update(ipv4PortId, UpdatePortOptions.builder().name("Updated").build()));
         Port updatedIpv4Port = portApi.get(ipv4PortId);
         assertEquals(updatedIpv4Port.getName(), "Updated");

         assertTrue(portApi.delete(ipv4PortId));
         assertTrue(portApi.delete(ipv6PortId));
         assertTrue(subnetApi.delete(ipv4SubnetId));
         assertTrue(subnetApi.delete(ipv6SubnetId));
View Full Code Here

         for (Port port : ports) {
            assertNotNull(port.getName());
            assertTrue(references.contains(ReferenceWithName.builder().id(port.getId()).tenantId(port.getTenantId()).name(port.getName()).build()));

            Port retrievedPort = api.getPortApiForZone(zone).get(port.getId());
            assertEquals(port, retrievedPort);
         }
      }
   }
View Full Code Here

         String ipv6PortId = portApi.create(networkId, CreatePortOptions.builder().name("JClouds-Live-IPv6-Port").fixedIps(getFixedAddresses(ipv6SubnetId)).build()).getId();

         assertNotNull(ipv4PortId);
         assertNotNull(ipv6PortId);

         Port ipv4Port = portApi.get(ipv4PortId);
         assertNotNull(ipv4Port);
         assertEquals(ipv4Port.getId(), ipv4PortId);
         assertEquals(ipv4Port.getName(), "JClouds-Live-IPv4-Port");

         Port ipv6Port = portApi.get(ipv6PortId);
         assertNotNull(ipv6Port);
         assertEquals(ipv6Port.getId(), ipv6PortId);
         assertEquals(ipv6Port.getName(), "JClouds-Live-IPv6-Port");

         assertTrue(portApi.update(ipv4PortId, UpdatePortOptions.builder().name("Updated").build()));
         Port updatedIpv4Port = portApi.get(ipv4PortId);
         assertEquals(updatedIpv4Port.getName(), "Updated");

         assertTrue(portApi.delete(ipv4PortId));
         assertTrue(portApi.delete(ipv6PortId));
         assertTrue(subnetApi.delete(ipv4SubnetId));
         assertTrue(subnetApi.delete(ipv6SubnetId));
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.NeutronApi

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.