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));
}
}