From eacf00436e8f6c6a627f5fa578681813bd21f363 Mon Sep 17 00:00:00 2001 From: Zack Shoylev Date: Wed, 22 Oct 2014 11:57:43 -0500 Subject: [PATCH 01/12] Adds rackspace cloudnetworks-us provider --- .../rackspace-cloudnetworks-us/README.md | 4 + providers/rackspace-cloudnetworks-us/pom.xml | 128 ++++++++++++++++++ .../us/CloudNetworksUSProviderMetadata.java | 121 +++++++++++++++++ .../us/CloudNetworksUSNetworkApiLiveTest.java | 76 +++++++++++ .../us/CloudNetworksUSPortApiLiveTest.java | 85 ++++++++++++ .../us/CloudNetworksUSProviderTest.java | 28 ++++ .../us/CloudNetworksUSSubnetApiLiveTest.java | 89 ++++++++++++ .../src/test/resources/logback.xml | 69 ++++++++++ 8 files changed, 600 insertions(+) create mode 100644 providers/rackspace-cloudnetworks-us/README.md create mode 100644 providers/rackspace-cloudnetworks-us/pom.xml create mode 100644 providers/rackspace-cloudnetworks-us/src/main/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSProviderMetadata.java create mode 100644 providers/rackspace-cloudnetworks-us/src/test/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSNetworkApiLiveTest.java create mode 100644 providers/rackspace-cloudnetworks-us/src/test/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSPortApiLiveTest.java create mode 100644 providers/rackspace-cloudnetworks-us/src/test/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSProviderTest.java create mode 100644 providers/rackspace-cloudnetworks-us/src/test/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSSubnetApiLiveTest.java create mode 100644 providers/rackspace-cloudnetworks-us/src/test/resources/logback.xml diff --git a/providers/rackspace-cloudnetworks-us/README.md b/providers/rackspace-cloudnetworks-us/README.md new file mode 100644 index 0000000000..4a833078ca --- /dev/null +++ b/providers/rackspace-cloudnetworks-us/README.md @@ -0,0 +1,4 @@ +Rackspace Networks US +======================== + +Beta diff --git a/providers/rackspace-cloudnetworks-us/pom.xml b/providers/rackspace-cloudnetworks-us/pom.xml new file mode 100644 index 0000000000..7a62e1b958 --- /dev/null +++ b/providers/rackspace-cloudnetworks-us/pom.xml @@ -0,0 +1,128 @@ + + + + 4.0.0 + + org.apache.jclouds + jclouds-project + 2.0.0-SNAPSHOT + + + + + org.apache.jclouds.labs + rackspace-cloudnetworks-us + 2.0.0-SNAPSHOT + jclouds Rackspace Cloud Networks US provider + OpenStack Neutron implementation targeted to Rackspace Cloud Networks US + bundle + + + + https://identity.api.rackspacecloud.com/v2.0/ + 2.0 + + ${test.rackspace-us.identity} + ${test.rackspace-us.credential} + org.jclouds.rackspace.cloudnetworks.us*;version="${project.version}" + + org.jclouds*;version="${project.version}",* + + + + + + org.apache.jclouds.labs + openstack-neutron + ${project.parent.version} + + + org.apache.jclouds.api + rackspace-cloudidentity + ${project.parent.version} + + + + + org.apache.jclouds.labs + openstack-neutron + ${project.parent.version} + test-jar + test + + + org.apache.jclouds + jclouds-core + ${project.parent.version} + test-jar + test + + + org.apache.jclouds.driver + jclouds-slf4j + ${project.parent.version} + test + + + ch.qos.logback + logback-classic + test + + + + com.google.auto.value + auto-value + provided + + + + + + live + + + + org.apache.maven.plugins + maven-surefire-plugin + + + integration + integration-test + + test + + + + ${test.rackspace-cloudnetworks-us.endpoint} + ${test.rackspace-cloudnetworks-us.api-version} + ${test.rackspace-cloudnetworks-us.build-version} + ${test.rackspace-cloudnetworks-us.identity} + ${test.rackspace-cloudnetworks-us.credential} + + + + + + + + + + + diff --git a/providers/rackspace-cloudnetworks-us/src/main/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSProviderMetadata.java b/providers/rackspace-cloudnetworks-us/src/main/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSProviderMetadata.java new file mode 100644 index 0000000000..6a84aac9cd --- /dev/null +++ b/providers/rackspace-cloudnetworks-us/src/main/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSProviderMetadata.java @@ -0,0 +1,121 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jclouds.rackspace.cloudnetworks.us; + +import static org.jclouds.location.reference.LocationConstants.ISO3166_CODES; +import static org.jclouds.location.reference.LocationConstants.PROPERTY_REGION; +import static org.jclouds.location.reference.LocationConstants.PROPERTY_REGIONS; +import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.CREDENTIAL_TYPE; +import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.SERVICE_TYPE; + +import java.net.URI; +import java.util.Properties; + +import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule.RegionModule; +import org.jclouds.openstack.neutron.v2.NeutronApiMetadata; +import org.jclouds.openstack.neutron.v2.config.NeutronHttpApiModule; +import org.jclouds.providers.ProviderMetadata; +import org.jclouds.providers.internal.BaseProviderMetadata; +import org.jclouds.rackspace.cloudidentity.v2_0.config.CloudIdentityAuthenticationApiModule; +import org.jclouds.rackspace.cloudidentity.v2_0.config.CloudIdentityAuthenticationModule; +import org.jclouds.rackspace.cloudidentity.v2_0.config.CloudIdentityCredentialTypes; + +import com.google.auto.service.AutoService; +import com.google.common.collect.ImmutableSet; +import com.google.inject.Module; + +@AutoService(ProviderMetadata.class) +public class CloudNetworksUSProviderMetadata extends BaseProviderMetadata { + + public static Builder builder() { + return new Builder(); + } + + @Override + public Builder toBuilder() { + return builder().fromProviderMetadata(this); + } + + public CloudNetworksUSProviderMetadata() { + this(new Builder()); + } + + protected CloudNetworksUSProviderMetadata(Builder builder) { + super(builder); + } + + /** + * @return a {@link Properties} object containing the default provider properties. + * This returns the credential type, service type, and configured regions. + */ + public static Properties defaultProperties() { + Properties properties = new Properties(); + properties.setProperty(CREDENTIAL_TYPE, CloudIdentityCredentialTypes.API_KEY_CREDENTIALS); + properties.setProperty(SERVICE_TYPE, "networks"); + + properties.setProperty(PROPERTY_REGIONS, "ORD,DFW,IAD,SYD,HKG"); + properties.setProperty(PROPERTY_REGION + ".ORD." + ISO3166_CODES, "US-IL"); + properties.setProperty(PROPERTY_REGION + ".DFW." + ISO3166_CODES, "US-TX"); + properties.setProperty(PROPERTY_REGION + ".IAD." + ISO3166_CODES, "US-VA"); + properties.setProperty(PROPERTY_REGION + ".SYD." + ISO3166_CODES, "AU-NSW"); + properties.setProperty(PROPERTY_REGION + ".HKG." + ISO3166_CODES, "HK"); + + return properties; + } + + public static class Builder extends BaseProviderMetadata.Builder { + + protected Builder() { + id("rackspace-cloudnetworks-us") + .name("Rackspace Cloud Networks US") + .apiMetadata(new NeutronApiMetadata().toBuilder() + .identityName("${userName}") + .credentialName("${apiKey}") + .defaultEndpoint("https://identity.api.rackspacecloud.com/v2.0/") + .documentation(URI.create("http://docs.rackspace.com/networks/api/v1/cf-devguide/content/index.html")) + .endpointName("Rackspace Cloud Identity service URL ending in /v2.0/") + .version("2.0") + .defaultModules(ImmutableSet.>builder() + .add(CloudIdentityAuthenticationApiModule.class) + .add(CloudIdentityAuthenticationModule.class) + .add(RegionModule.class) + .add(NeutronHttpApiModule.class) + .build()) + .build()) + .homepage(URI.create("http://www.rackspace.com/cloud/networks")) + .console(URI.create("https://mycloud.rackspace.com")) + .linkedServices("rackspace-autoscale-us", "rackspace-cloudblockstorage-us", + "rackspace-clouddatabases-us", "rackspace-clouddns-us", + "rackspace-cloudidentity", "rackspace-cloudloadbalancers-us", + "rackspace-cloudqueues-us") + .iso3166Codes("US-IL", "US-TX", "US-VA", "AU-NSW", "HK") + .defaultProperties(CloudNetworksUSProviderMetadata.defaultProperties()); + + } + + @Override + public CloudNetworksUSProviderMetadata build() { + return new CloudNetworksUSProviderMetadata(this); + } + + @Override + public Builder fromProviderMetadata(ProviderMetadata in) { + super.fromProviderMetadata(in); + return this; + } + } +} diff --git a/providers/rackspace-cloudnetworks-us/src/test/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSNetworkApiLiveTest.java b/providers/rackspace-cloudnetworks-us/src/test/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSNetworkApiLiveTest.java new file mode 100644 index 0000000000..c8e09c5f79 --- /dev/null +++ b/providers/rackspace-cloudnetworks-us/src/test/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSNetworkApiLiveTest.java @@ -0,0 +1,76 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jclouds.rackspace.cloudnetworks.us; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNotNull; +import static org.testng.Assert.assertTrue; + +import org.jclouds.openstack.neutron.v2.domain.Network; +import org.jclouds.openstack.neutron.v2.features.NetworkApi; +import org.jclouds.openstack.neutron.v2.features.NetworkApiLiveTest; +import org.testng.SkipException; +import org.testng.annotations.Test; + +@Test(groups = "live", testName = "CloudNetworksUSNetworkApiLiveTest", singleThreaded = true) +public class CloudNetworksUSNetworkApiLiveTest extends NetworkApiLiveTest { + public CloudNetworksUSNetworkApiLiveTest() { + provider = "rackspace-cloudnetworks-us"; + } + + @Override + public void testCreateUpdateAndDeleteNetwork() { + for (String region : api.getConfiguredRegions()) { + NetworkApi networkApi = api.getNetworkApi(region); + Network net = networkApi.create(Network.createBuilder("jclouds-test").build()); + Network test = networkApi.create(Network.createBuilder("jclouds-test").build()); + assertNotNull(net); + + /* List and get tests */ + Network networkList = api.getNetworkApi(region).list().concat().toSet().iterator().next(); + assertNotNull(networkList); + Network networkGet = api.getNetworkApi(region).get(networkList.getId()); + assertEquals(networkList, networkGet); + /****/ + + Network network = networkApi.get(net.getId()); + + assertEquals(network.getId(), net.getId()); + assertEquals(network.getName(), "jclouds-test"); + assertTrue(network.getSubnets().isEmpty()); + assertNotNull(networkApi.update(net.getId(), Network.updateBuilder().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(Network.createBuilder("jclouds-test2").build()); + assertNotNull(net2); + + assertTrue(networkApi.delete(net.getId())); + assertTrue(networkApi.delete(net2.getId())); + assertTrue(networkApi.delete(test.getId())); + } + } + + @Override + public void testBulkCreateNetwork() { + throw new SkipException("unsupported functionality"); + } +} diff --git a/providers/rackspace-cloudnetworks-us/src/test/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSPortApiLiveTest.java b/providers/rackspace-cloudnetworks-us/src/test/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSPortApiLiveTest.java new file mode 100644 index 0000000000..07efb8758e --- /dev/null +++ b/providers/rackspace-cloudnetworks-us/src/test/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSPortApiLiveTest.java @@ -0,0 +1,85 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jclouds.rackspace.cloudnetworks.us; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNotNull; +import static org.testng.Assert.assertTrue; + +import org.jclouds.openstack.neutron.v2.domain.Network; +import org.jclouds.openstack.neutron.v2.domain.Port; +import org.jclouds.openstack.neutron.v2.domain.Subnet; +import org.jclouds.openstack.neutron.v2.features.NetworkApi; +import org.jclouds.openstack.neutron.v2.features.PortApi; +import org.jclouds.openstack.neutron.v2.features.PortApiLiveTest; +import org.jclouds.openstack.neutron.v2.features.SubnetApi; +import org.testng.SkipException; +import org.testng.annotations.Test; + +import com.google.common.collect.ImmutableSet; + +@Test(groups = "live", testName = "CloudNetworksUSPortApiLiveTest", singleThreaded = true) +public class CloudNetworksUSPortApiLiveTest extends PortApiLiveTest { + public CloudNetworksUSPortApiLiveTest() { + provider = "rackspace-cloudnetworks-us"; + } + + public void testCreateUpdateAndDeletePort() { + for (String region : api.getConfiguredRegions()) { + NetworkApi networkApi = api.getNetworkApi(region); + SubnetApi subnetApi = api.getSubnetApi(region); + PortApi portApi = api.getPortApi(region); + String networkId = networkApi.create( + Network.createBuilder("JClouds-Live-Network").build()).getId(); + String ipv4SubnetId = subnetApi.create(Subnet.createBuilder(networkId, "192.168.0.0/30").ipVersion(4) + .name("JClouds-Live-IPv4-Subnet").build()).getId(); + + assertNotNull(networkId); + assertNotNull(ipv4SubnetId); + + String ipv4PortId = portApi.create(Port.createBuilder(networkId).name("JClouds-Live-IPv4-Port") + .fixedIps(ImmutableSet.copyOf(getFixedAddresses(ipv4SubnetId))).build()).getId(); + + /* List and get test */ + Port portList = api.getPortApi(region).list().concat().toSet().iterator().next(); + assertNotNull(portList); + Port portGet = api.getPortApi(region).get(portList.getId()); + assertEquals(portList, portGet); + /****/ + + assertNotNull(ipv4PortId); + + Port ipv4Port = portApi.get(ipv4PortId); + assertNotNull(ipv4Port); + assertEquals(ipv4Port.getId(), ipv4PortId); + assertEquals(ipv4Port.getName(), "JClouds-Live-IPv4-Port"); + + assertNotNull(portApi.update(ipv4PortId, Port.updateBuilder().name("Updated").build())); + Port updatedIpv4Port = portApi.get(ipv4PortId); + assertEquals(updatedIpv4Port.getName(), "Updated"); + + assertTrue(portApi.delete(ipv4PortId)); + assertTrue(subnetApi.delete(ipv4SubnetId)); + assertTrue(networkApi.delete(networkId)); + } + } + + @Override + public void testBulkCreatePort() { + throw new SkipException("unsupported functionality"); + } +} diff --git a/providers/rackspace-cloudnetworks-us/src/test/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSProviderTest.java b/providers/rackspace-cloudnetworks-us/src/test/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSProviderTest.java new file mode 100644 index 0000000000..21dab6f211 --- /dev/null +++ b/providers/rackspace-cloudnetworks-us/src/test/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSProviderTest.java @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jclouds.rackspace.cloudnetworks.us; + +import org.jclouds.openstack.neutron.v2.NeutronApiMetadata; +import org.jclouds.providers.internal.BaseProviderMetadataTest; +import org.testng.annotations.Test; + +@Test(groups = "unit", testName = "CloudNetworksUSProviderTest", singleThreaded = true) +public class CloudNetworksUSProviderTest extends BaseProviderMetadataTest { + public CloudNetworksUSProviderTest() { + super(new CloudNetworksUSProviderMetadata(), new NeutronApiMetadata()); + } +} diff --git a/providers/rackspace-cloudnetworks-us/src/test/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSSubnetApiLiveTest.java b/providers/rackspace-cloudnetworks-us/src/test/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSSubnetApiLiveTest.java new file mode 100644 index 0000000000..8156da2fb6 --- /dev/null +++ b/providers/rackspace-cloudnetworks-us/src/test/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSSubnetApiLiveTest.java @@ -0,0 +1,89 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jclouds.rackspace.cloudnetworks.us; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNotNull; +import static org.testng.Assert.assertTrue; + +import org.jclouds.openstack.neutron.v2.domain.AllocationPool; +import org.jclouds.openstack.neutron.v2.domain.HostRoute; +import org.jclouds.openstack.neutron.v2.domain.Network; +import org.jclouds.openstack.neutron.v2.domain.Subnet; +import org.jclouds.openstack.neutron.v2.features.NetworkApi; +import org.jclouds.openstack.neutron.v2.features.SubnetApi; +import org.jclouds.openstack.neutron.v2.features.SubnetApiLiveTest; +import org.testng.SkipException; +import org.testng.annotations.Test; + +import com.google.common.collect.ImmutableSet; + +@Test(groups = "live", testName = "CloudNetworksUSSubnetApiLiveTest", singleThreaded = true) +public class CloudNetworksUSSubnetApiLiveTest extends SubnetApiLiveTest { + public CloudNetworksUSSubnetApiLiveTest() { + provider = "rackspace-cloudnetworks-us"; + } + + @Override + public void testCreateUpdateAndDeleteSubnet() { + for (String region : api.getConfiguredRegions()) { + NetworkApi networkApi = api.getNetworkApi(region); + String networkId = networkApi.create( + Network.createBuilder("jclouds-live-test").build()).getId(); + + SubnetApi subnetApi = api.getSubnetApi(region); + ImmutableSet allocationPools = ImmutableSet.of( + AllocationPool.builder().start("192.168.100.0").end("192.168.100.2").build() + ); + ImmutableSet hostRoutes = ImmutableSet.of( + HostRoute.builder().destinationCidr("192.168.100.0/30").nextHop("192.168.100.4").build() + ); + Subnet subnet = subnetApi.create(Subnet.createBuilder(networkId, "192.168.100.0/30").ipVersion(4).allocationPools(allocationPools).hostRoutes(hostRoutes).build()); + assertNotNull(subnet); + + /* Test list and get */ + Subnet subnetList = api.getSubnetApi(region).list().concat().toSet().iterator().next(); + assertNotNull(subnetList); + Subnet subnetGet = api.getSubnetApi(region).get(subnetList.getId()); + assertEquals(subnetList, subnetGet); + /***/ + + Subnet retrievedSubnet = subnetApi.get(subnet.getId()); + + assertEquals(retrievedSubnet.getId(), subnet.getId()); + assertEquals(retrievedSubnet.getCidr(), "192.168.100.0/30"); + assertTrue(retrievedSubnet.getDnsNameservers().isEmpty()); + assertEquals(retrievedSubnet.getAllocationPools().size(), 1); + assertEquals(retrievedSubnet.getHostRoutes().size(), 1); + assertNotNull(subnetApi.update(retrievedSubnet.getId(), Subnet.updateBuilder().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()); + + assertTrue(subnetApi.delete(subnet.getId())); + assertTrue(networkApi.delete(networkId)); + } + } + + @Override + public void testBulkCreateSubnet() { + throw new SkipException("unsupported functionality"); + } +} diff --git a/providers/rackspace-cloudnetworks-us/src/test/resources/logback.xml b/providers/rackspace-cloudnetworks-us/src/test/resources/logback.xml new file mode 100644 index 0000000000..6559c2351d --- /dev/null +++ b/providers/rackspace-cloudnetworks-us/src/test/resources/logback.xml @@ -0,0 +1,69 @@ + + + + + target/test-data/jclouds.log + + + %d %-5p [%c] [%thread] %m%n + + + + + target/test-data/jclouds-wire.log + + + %d %-5p [%c] [%thread] %m%n + + + + + target/test-data/jclouds-blobstore.log + + + %d %-5p [%c] [%thread] %m%n + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 6bcaa97214a56eb11dddec5e232b4e7bb6418fe3 Mon Sep 17 00:00:00 2001 From: Jeremy Daggett Date: Mon, 24 Nov 2014 10:58:58 -0800 Subject: [PATCH 02/12] Use AutoService for creation of Service Loader Metadata --- providers/rackspace-cloudnetworks-us/pom.xml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/providers/rackspace-cloudnetworks-us/pom.xml b/providers/rackspace-cloudnetworks-us/pom.xml index 7a62e1b958..fb960e9ce9 100644 --- a/providers/rackspace-cloudnetworks-us/pom.xml +++ b/providers/rackspace-cloudnetworks-us/pom.xml @@ -42,9 +42,7 @@ ${test.rackspace-us.identity} ${test.rackspace-us.credential} org.jclouds.rackspace.cloudnetworks.us*;version="${project.version}" - - org.jclouds*;version="${project.version}",* - + org.jclouds*;version="${project.version}",* @@ -85,11 +83,10 @@ logback-classic test - - com.google.auto.value - auto-value - provided + com.google.auto.service + auto-service + provided From 4e61d52291061056888e3d5f2c86c82d54e77135 Mon Sep 17 00:00:00 2001 From: Jeremy Daggett Date: Wed, 3 Dec 2014 12:46:44 -0800 Subject: [PATCH 03/12] Updated service type from "networks" to "network" --- .../cloudnetworks/us/CloudNetworksUSProviderMetadata.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/providers/rackspace-cloudnetworks-us/src/main/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSProviderMetadata.java b/providers/rackspace-cloudnetworks-us/src/main/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSProviderMetadata.java index 6a84aac9cd..3920c20d8d 100644 --- a/providers/rackspace-cloudnetworks-us/src/main/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSProviderMetadata.java +++ b/providers/rackspace-cloudnetworks-us/src/main/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSProviderMetadata.java @@ -28,6 +28,7 @@ import java.util.Properties; import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule.RegionModule; import org.jclouds.openstack.neutron.v2.NeutronApiMetadata; import org.jclouds.openstack.neutron.v2.config.NeutronHttpApiModule; +import org.jclouds.openstack.v2_0.ServiceType; import org.jclouds.providers.ProviderMetadata; import org.jclouds.providers.internal.BaseProviderMetadata; import org.jclouds.rackspace.cloudidentity.v2_0.config.CloudIdentityAuthenticationApiModule; @@ -65,7 +66,7 @@ public class CloudNetworksUSProviderMetadata extends BaseProviderMetadata { public static Properties defaultProperties() { Properties properties = new Properties(); properties.setProperty(CREDENTIAL_TYPE, CloudIdentityCredentialTypes.API_KEY_CREDENTIALS); - properties.setProperty(SERVICE_TYPE, "networks"); + properties.setProperty(SERVICE_TYPE, ServiceType.NETWORK); properties.setProperty(PROPERTY_REGIONS, "ORD,DFW,IAD,SYD,HKG"); properties.setProperty(PROPERTY_REGION + ".ORD." + ISO3166_CODES, "US-IL"); From e36cf4233f048823c1aa92116d386d0eabe98e71 Mon Sep 17 00:00:00 2001 From: Jeremy Daggett Date: Wed, 3 Dec 2014 13:38:24 -0800 Subject: [PATCH 04/12] Support Rackspace Cloud Networks UK --- .../rackspace-cloudnetworks-uk/README.md | 4 + providers/rackspace-cloudnetworks-uk/pom.xml | 125 ++++++++++++++++++ .../uk/CloudNetworksUKProviderMetadata.java | 118 +++++++++++++++++ .../uk/CloudNetworksUKNetworkApiLiveTest.java | 76 +++++++++++ .../uk/CloudNetworksUKPortApiLiveTest.java | 85 ++++++++++++ .../uk/CloudNetworksUKProviderTest.java | 28 ++++ .../uk/CloudNetworksUKSubnetApiLiveTest.java | 89 +++++++++++++ .../src/test/resources/logback.xml | 56 ++++++++ 8 files changed, 581 insertions(+) create mode 100644 providers/rackspace-cloudnetworks-uk/README.md create mode 100644 providers/rackspace-cloudnetworks-uk/pom.xml create mode 100644 providers/rackspace-cloudnetworks-uk/src/main/java/org/jclouds/rackspace/cloudnetworks/uk/CloudNetworksUKProviderMetadata.java create mode 100644 providers/rackspace-cloudnetworks-uk/src/test/java/org/jclouds/rackspace/cloudnetworks/uk/CloudNetworksUKNetworkApiLiveTest.java create mode 100644 providers/rackspace-cloudnetworks-uk/src/test/java/org/jclouds/rackspace/cloudnetworks/uk/CloudNetworksUKPortApiLiveTest.java create mode 100644 providers/rackspace-cloudnetworks-uk/src/test/java/org/jclouds/rackspace/cloudnetworks/uk/CloudNetworksUKProviderTest.java create mode 100644 providers/rackspace-cloudnetworks-uk/src/test/java/org/jclouds/rackspace/cloudnetworks/uk/CloudNetworksUKSubnetApiLiveTest.java create mode 100644 providers/rackspace-cloudnetworks-uk/src/test/resources/logback.xml diff --git a/providers/rackspace-cloudnetworks-uk/README.md b/providers/rackspace-cloudnetworks-uk/README.md new file mode 100644 index 0000000000..dc52a0f488 --- /dev/null +++ b/providers/rackspace-cloudnetworks-uk/README.md @@ -0,0 +1,4 @@ +Rackspace Networks UK +======================== + +Beta diff --git a/providers/rackspace-cloudnetworks-uk/pom.xml b/providers/rackspace-cloudnetworks-uk/pom.xml new file mode 100644 index 0000000000..1cf16fc961 --- /dev/null +++ b/providers/rackspace-cloudnetworks-uk/pom.xml @@ -0,0 +1,125 @@ + + + + 4.0.0 + + org.apache.jclouds + jclouds-project + 2.0.0-SNAPSHOT + + + + + org.apache.jclouds.labs + rackspace-cloudnetworks-uk + 2.0.0-SNAPSHOT + jclouds Rackspace Cloud Networks UK provider + OpenStack Neutron implementation targeted to Rackspace Cloud Networks UK + bundle + + + + https://lon.identity.api.rackspacecloud.com/v2.0/ + 2.0 + + ${test.rackspace-uk.identity} + ${test.rackspace-uk.credential} + org.jclouds.rackspace.cloudnetworks.uk*;version="${project.version}" + org.jclouds*;version="${project.version}",* + + + + + org.apache.jclouds.labs + openstack-neutron + ${project.parent.version} + + + org.apache.jclouds.api + rackspace-cloudidentity + ${project.parent.version} + + + + + org.apache.jclouds.labs + openstack-neutron + ${project.parent.version} + test-jar + test + + + org.apache.jclouds + jclouds-core + ${project.parent.version} + test-jar + test + + + org.apache.jclouds.driver + jclouds-slf4j + ${project.parent.version} + test + + + ch.qos.logback + logback-classic + test + + + com.google.auto.service + auto-service + true + + + + + + live + + + + org.apache.maven.plugins + maven-surefire-plugin + + + integration + integration-test + + test + + + + ${test.rackspace-cloudnetworks-uk.endpoint} + ${test.rackspace-cloudnetworks-uk.api-version} + ${test.rackspace-cloudnetworks-uk.build-version} + ${test.rackspace-cloudnetworks-uk.identity} + ${test.rackspace-cloudnetworks-uk.credential} + + + + + + + + + + + diff --git a/providers/rackspace-cloudnetworks-uk/src/main/java/org/jclouds/rackspace/cloudnetworks/uk/CloudNetworksUKProviderMetadata.java b/providers/rackspace-cloudnetworks-uk/src/main/java/org/jclouds/rackspace/cloudnetworks/uk/CloudNetworksUKProviderMetadata.java new file mode 100644 index 0000000000..4cc4c16270 --- /dev/null +++ b/providers/rackspace-cloudnetworks-uk/src/main/java/org/jclouds/rackspace/cloudnetworks/uk/CloudNetworksUKProviderMetadata.java @@ -0,0 +1,118 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jclouds.rackspace.cloudnetworks.uk; + +import static org.jclouds.location.reference.LocationConstants.ISO3166_CODES; +import static org.jclouds.location.reference.LocationConstants.PROPERTY_REGION; +import static org.jclouds.location.reference.LocationConstants.PROPERTY_REGIONS; +import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.CREDENTIAL_TYPE; +import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.SERVICE_TYPE; + +import java.net.URI; +import java.util.Properties; + +import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule.RegionModule; +import org.jclouds.openstack.neutron.v2.NeutronApiMetadata; +import org.jclouds.openstack.neutron.v2.config.NeutronHttpApiModule; +import org.jclouds.openstack.v2_0.ServiceType; +import org.jclouds.providers.ProviderMetadata; +import org.jclouds.providers.internal.BaseProviderMetadata; +import org.jclouds.rackspace.cloudidentity.v2_0.config.CloudIdentityAuthenticationApiModule; +import org.jclouds.rackspace.cloudidentity.v2_0.config.CloudIdentityAuthenticationModule; +import org.jclouds.rackspace.cloudidentity.v2_0.config.CloudIdentityCredentialTypes; + +import com.google.auto.service.AutoService; +import com.google.common.collect.ImmutableSet; +import com.google.inject.Module; + +@AutoService(ProviderMetadata.class) +public class CloudNetworksUKProviderMetadata extends BaseProviderMetadata { + + public static Builder builder() { + return new Builder(); + } + + @Override + public Builder toBuilder() { + return builder().fromProviderMetadata(this); + } + + public CloudNetworksUKProviderMetadata() { + this(new Builder()); + } + + protected CloudNetworksUKProviderMetadata(Builder builder) { + super(builder); + } + + /** + * @return a {@link Properties} object containing the default provider properties. + * This returns the credential type, service type, and configured regions. + */ + public static Properties defaultProperties() { + Properties properties = new Properties(); + properties.setProperty(CREDENTIAL_TYPE, CloudIdentityCredentialTypes.API_KEY_CREDENTIALS); + properties.setProperty(SERVICE_TYPE, ServiceType.NETWORK); + + properties.setProperty(PROPERTY_REGIONS, "LON"); + properties.setProperty(PROPERTY_REGION + ".LON." + ISO3166_CODES, "GB-SLG"); + + return properties; + } + + public static class Builder extends BaseProviderMetadata.Builder { + + protected Builder() { + id("rackspace-cloudnetworks-uk") + .name("Rackspace Cloud Networks UK") + .apiMetadata(new NeutronApiMetadata().toBuilder() + .identityName("${userName}") + .credentialName("${apiKey}") + .defaultEndpoint("https://lon.identity.api.rackspacecloud.com/v2.0/") + .documentation(URI.create("http://docs.rackspace.com/networks/api/v1/cf-devguide/content/index.html")) + .endpointName("Rackspace Cloud Identity service URL ending in /v2.0/") + .version("2.0") + .defaultModules(ImmutableSet.>builder() + .add(CloudIdentityAuthenticationApiModule.class) + .add(CloudIdentityAuthenticationModule.class) + .add(RegionModule.class) + .add(NeutronHttpApiModule.class) + .build()) + .build()) + .homepage(URI.create("http://www.rackspace.com/cloud/networks")) + .console(URI.create("https://mycloud.rackspace.co.uk")) + .linkedServices("rackspace-autoscale-uk", "rackspace-cloudblockstorage-uk", + "rackspace-clouddatabases-uk", "rackspace-clouddns-uk", "rackspace-cloudidentity", + "rackspace-cloudloadbalancers-uk", "rackspace-cloudqueues-uk", + "rackspace-cloudservers-uk") + .iso3166Codes("GB-SLG") + .defaultProperties(CloudNetworksUKProviderMetadata.defaultProperties()); + + } + + @Override + public CloudNetworksUKProviderMetadata build() { + return new CloudNetworksUKProviderMetadata(this); + } + + @Override + public Builder fromProviderMetadata(ProviderMetadata in) { + super.fromProviderMetadata(in); + return this; + } + } +} diff --git a/providers/rackspace-cloudnetworks-uk/src/test/java/org/jclouds/rackspace/cloudnetworks/uk/CloudNetworksUKNetworkApiLiveTest.java b/providers/rackspace-cloudnetworks-uk/src/test/java/org/jclouds/rackspace/cloudnetworks/uk/CloudNetworksUKNetworkApiLiveTest.java new file mode 100644 index 0000000000..e6fd5c76ac --- /dev/null +++ b/providers/rackspace-cloudnetworks-uk/src/test/java/org/jclouds/rackspace/cloudnetworks/uk/CloudNetworksUKNetworkApiLiveTest.java @@ -0,0 +1,76 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jclouds.rackspace.cloudnetworks.uk; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNotNull; +import static org.testng.Assert.assertTrue; + +import org.jclouds.openstack.neutron.v2.domain.Network; +import org.jclouds.openstack.neutron.v2.features.NetworkApi; +import org.jclouds.openstack.neutron.v2.features.NetworkApiLiveTest; +import org.testng.SkipException; +import org.testng.annotations.Test; + +@Test(groups = "live", testName = "CloudNetworksUKNetworkApiLiveTest", singleThreaded = true) +public class CloudNetworksUKNetworkApiLiveTest extends NetworkApiLiveTest { + public CloudNetworksUKNetworkApiLiveTest() { + provider = "rackspace-cloudnetworks-uk"; + } + + @Override + public void testCreateUpdateAndDeleteNetwork() { + for (String region : api.getConfiguredRegions()) { + NetworkApi networkApi = api.getNetworkApi(region); + Network net = networkApi.create(Network.createBuilder("jclouds-test").build()); + Network test = networkApi.create(Network.createBuilder("jclouds-test").build()); + assertNotNull(net); + + /* List and get tests */ + Network networkList = api.getNetworkApi(region).list().concat().toSet().iterator().next(); + assertNotNull(networkList); + Network networkGet = api.getNetworkApi(region).get(networkList.getId()); + assertEquals(networkList, networkGet); + /****/ + + Network network = networkApi.get(net.getId()); + + assertEquals(network.getId(), net.getId()); + assertEquals(network.getName(), "jclouds-test"); + assertTrue(network.getSubnets().isEmpty()); + assertNotNull(networkApi.update(net.getId(), Network.updateBuilder().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(Network.createBuilder("jclouds-test2").build()); + assertNotNull(net2); + + assertTrue(networkApi.delete(net.getId())); + assertTrue(networkApi.delete(net2.getId())); + assertTrue(networkApi.delete(test.getId())); + } + } + + @Override + public void testBulkCreateNetwork() { + throw new SkipException("unsupported functionality"); + } +} diff --git a/providers/rackspace-cloudnetworks-uk/src/test/java/org/jclouds/rackspace/cloudnetworks/uk/CloudNetworksUKPortApiLiveTest.java b/providers/rackspace-cloudnetworks-uk/src/test/java/org/jclouds/rackspace/cloudnetworks/uk/CloudNetworksUKPortApiLiveTest.java new file mode 100644 index 0000000000..1685766b2c --- /dev/null +++ b/providers/rackspace-cloudnetworks-uk/src/test/java/org/jclouds/rackspace/cloudnetworks/uk/CloudNetworksUKPortApiLiveTest.java @@ -0,0 +1,85 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jclouds.rackspace.cloudnetworks.uk; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNotNull; +import static org.testng.Assert.assertTrue; + +import org.jclouds.openstack.neutron.v2.domain.Network; +import org.jclouds.openstack.neutron.v2.domain.Port; +import org.jclouds.openstack.neutron.v2.domain.Subnet; +import org.jclouds.openstack.neutron.v2.features.NetworkApi; +import org.jclouds.openstack.neutron.v2.features.PortApi; +import org.jclouds.openstack.neutron.v2.features.PortApiLiveTest; +import org.jclouds.openstack.neutron.v2.features.SubnetApi; +import org.testng.SkipException; +import org.testng.annotations.Test; + +import com.google.common.collect.ImmutableSet; + +@Test(groups = "live", testName = "CloudNetworksUKPortApiLiveTest", singleThreaded = true) +public class CloudNetworksUKPortApiLiveTest extends PortApiLiveTest { + public CloudNetworksUKPortApiLiveTest() { + provider = "rackspace-cloudnetworks-uk"; + } + + public void testCreateUpdateAndDeletePort() { + for (String region : api.getConfiguredRegions()) { + NetworkApi networkApi = api.getNetworkApi(region); + SubnetApi subnetApi = api.getSubnetApi(region); + PortApi portApi = api.getPortApi(region); + String networkId = networkApi.create( + Network.createBuilder("JClouds-Live-Network").build()).getId(); + String ipv4SubnetId = subnetApi.create(Subnet.createBuilder(networkId, "192.168.0.0/30").ipVersion(4) + .name("JClouds-Live-IPv4-Subnet").build()).getId(); + + assertNotNull(networkId); + assertNotNull(ipv4SubnetId); + + String ipv4PortId = portApi.create(Port.createBuilder(networkId).name("JClouds-Live-IPv4-Port") + .fixedIps(ImmutableSet.copyOf(getFixedAddresses(ipv4SubnetId))).build()).getId(); + + /* List and get test */ + Port portList = api.getPortApi(region).list().concat().toSet().iterator().next(); + assertNotNull(portList); + Port portGet = api.getPortApi(region).get(portList.getId()); + assertEquals(portList, portGet); + /****/ + + assertNotNull(ipv4PortId); + + Port ipv4Port = portApi.get(ipv4PortId); + assertNotNull(ipv4Port); + assertEquals(ipv4Port.getId(), ipv4PortId); + assertEquals(ipv4Port.getName(), "JClouds-Live-IPv4-Port"); + + assertNotNull(portApi.update(ipv4PortId, Port.updateBuilder().name("Updated").build())); + Port updatedIpv4Port = portApi.get(ipv4PortId); + assertEquals(updatedIpv4Port.getName(), "Updated"); + + assertTrue(portApi.delete(ipv4PortId)); + assertTrue(subnetApi.delete(ipv4SubnetId)); + assertTrue(networkApi.delete(networkId)); + } + } + + @Override + public void testBulkCreatePort() { + throw new SkipException("unsupported functionality"); + } +} diff --git a/providers/rackspace-cloudnetworks-uk/src/test/java/org/jclouds/rackspace/cloudnetworks/uk/CloudNetworksUKProviderTest.java b/providers/rackspace-cloudnetworks-uk/src/test/java/org/jclouds/rackspace/cloudnetworks/uk/CloudNetworksUKProviderTest.java new file mode 100644 index 0000000000..2b2a01ca7b --- /dev/null +++ b/providers/rackspace-cloudnetworks-uk/src/test/java/org/jclouds/rackspace/cloudnetworks/uk/CloudNetworksUKProviderTest.java @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jclouds.rackspace.cloudnetworks.uk; + +import org.jclouds.openstack.neutron.v2.NeutronApiMetadata; +import org.jclouds.providers.internal.BaseProviderMetadataTest; +import org.testng.annotations.Test; + +@Test(groups = "unit", testName = "CloudNetworksUKProviderTest", singleThreaded = true) +public class CloudNetworksUKProviderTest extends BaseProviderMetadataTest { + public CloudNetworksUKProviderTest() { + super(new CloudNetworksUKProviderMetadata(), new NeutronApiMetadata()); + } +} diff --git a/providers/rackspace-cloudnetworks-uk/src/test/java/org/jclouds/rackspace/cloudnetworks/uk/CloudNetworksUKSubnetApiLiveTest.java b/providers/rackspace-cloudnetworks-uk/src/test/java/org/jclouds/rackspace/cloudnetworks/uk/CloudNetworksUKSubnetApiLiveTest.java new file mode 100644 index 0000000000..54df5e0569 --- /dev/null +++ b/providers/rackspace-cloudnetworks-uk/src/test/java/org/jclouds/rackspace/cloudnetworks/uk/CloudNetworksUKSubnetApiLiveTest.java @@ -0,0 +1,89 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jclouds.rackspace.cloudnetworks.uk; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNotNull; +import static org.testng.Assert.assertTrue; + +import org.jclouds.openstack.neutron.v2.domain.AllocationPool; +import org.jclouds.openstack.neutron.v2.domain.HostRoute; +import org.jclouds.openstack.neutron.v2.domain.Network; +import org.jclouds.openstack.neutron.v2.domain.Subnet; +import org.jclouds.openstack.neutron.v2.features.NetworkApi; +import org.jclouds.openstack.neutron.v2.features.SubnetApi; +import org.jclouds.openstack.neutron.v2.features.SubnetApiLiveTest; +import org.testng.SkipException; +import org.testng.annotations.Test; + +import com.google.common.collect.ImmutableSet; + +@Test(groups = "live", testName = "CloudNetworksUKSubnetApiLiveTest", singleThreaded = true) +public class CloudNetworksUKSubnetApiLiveTest extends SubnetApiLiveTest { + public CloudNetworksUKSubnetApiLiveTest() { + provider = "rackspace-cloudnetworks-uk"; + } + + @Override + public void testCreateUpdateAndDeleteSubnet() { + for (String region : api.getConfiguredRegions()) { + NetworkApi networkApi = api.getNetworkApi(region); + String networkId = networkApi.create( + Network.createBuilder("jclouds-live-test").build()).getId(); + + SubnetApi subnetApi = api.getSubnetApi(region); + ImmutableSet allocationPools = ImmutableSet.of( + AllocationPool.builder().start("192.168.100.0").end("192.168.100.2").build() + ); + ImmutableSet hostRoutes = ImmutableSet.of( + HostRoute.builder().destinationCidr("192.168.100.0/30").nextHop("192.168.100.4").build() + ); + Subnet subnet = subnetApi.create(Subnet.createBuilder(networkId, "192.168.100.0/30").ipVersion(4).allocationPools(allocationPools).hostRoutes(hostRoutes).build()); + assertNotNull(subnet); + + /* Test list and get */ + Subnet subnetList = api.getSubnetApi(region).list().concat().toSet().iterator().next(); + assertNotNull(subnetList); + Subnet subnetGet = api.getSubnetApi(region).get(subnetList.getId()); + assertEquals(subnetList, subnetGet); + /***/ + + Subnet retrievedSubnet = subnetApi.get(subnet.getId()); + + assertEquals(retrievedSubnet.getId(), subnet.getId()); + assertEquals(retrievedSubnet.getCidr(), "192.168.100.0/30"); + assertTrue(retrievedSubnet.getDnsNameservers().isEmpty()); + assertEquals(retrievedSubnet.getAllocationPools().size(), 1); + assertEquals(retrievedSubnet.getHostRoutes().size(), 1); + assertNotNull(subnetApi.update(retrievedSubnet.getId(), Subnet.updateBuilder().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()); + + assertTrue(subnetApi.delete(subnet.getId())); + assertTrue(networkApi.delete(networkId)); + } + } + + @Override + public void testBulkCreateSubnet() { + throw new SkipException("unsupported functionality"); + } +} diff --git a/providers/rackspace-cloudnetworks-uk/src/test/resources/logback.xml b/providers/rackspace-cloudnetworks-uk/src/test/resources/logback.xml new file mode 100644 index 0000000000..d7c463a01a --- /dev/null +++ b/providers/rackspace-cloudnetworks-uk/src/test/resources/logback.xml @@ -0,0 +1,56 @@ + + + + + target/test-data/jclouds.log + + + %d %-5p [%c] [%thread] %m%n + + + + + target/test-data/jclouds-wire.log + + + %d %-5p [%c] [%thread] %m%n + + + + + + + + + + + + + + + + + + + + + + + From ba4846e2a8c8145e59fe385c29de18eabf7b1ba8 Mon Sep 17 00:00:00 2001 From: Ignasi Barrera Date: Tue, 24 Mar 2015 10:59:36 +0100 Subject: [PATCH 05/12] Apache jclouds 1.9.0 release --- providers/rackspace-cloudnetworks-uk/pom.xml | 4 ++-- providers/rackspace-cloudnetworks-us/pom.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/providers/rackspace-cloudnetworks-uk/pom.xml b/providers/rackspace-cloudnetworks-uk/pom.xml index 1cf16fc961..3a6de1472f 100644 --- a/providers/rackspace-cloudnetworks-uk/pom.xml +++ b/providers/rackspace-cloudnetworks-uk/pom.xml @@ -22,14 +22,14 @@ org.apache.jclouds jclouds-project - 2.0.0-SNAPSHOT + 1.9.0 org.apache.jclouds.labs rackspace-cloudnetworks-uk - 2.0.0-SNAPSHOT + 1.9.0 jclouds Rackspace Cloud Networks UK provider OpenStack Neutron implementation targeted to Rackspace Cloud Networks UK bundle diff --git a/providers/rackspace-cloudnetworks-us/pom.xml b/providers/rackspace-cloudnetworks-us/pom.xml index fb960e9ce9..3926897799 100644 --- a/providers/rackspace-cloudnetworks-us/pom.xml +++ b/providers/rackspace-cloudnetworks-us/pom.xml @@ -22,14 +22,14 @@ org.apache.jclouds jclouds-project - 2.0.0-SNAPSHOT + 1.9.0 org.apache.jclouds.labs rackspace-cloudnetworks-us - 2.0.0-SNAPSHOT + 1.9.0 jclouds Rackspace Cloud Networks US provider OpenStack Neutron implementation targeted to Rackspace Cloud Networks US bundle From 1bd0a4a4cba705c878801270623a83731cf35126 Mon Sep 17 00:00:00 2001 From: Ignasi Barrera Date: Tue, 24 Mar 2015 11:02:39 +0100 Subject: [PATCH 06/12] Next development version 2.0.0-SNAPSHOT --- providers/rackspace-cloudnetworks-uk/pom.xml | 4 ++-- providers/rackspace-cloudnetworks-us/pom.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/providers/rackspace-cloudnetworks-uk/pom.xml b/providers/rackspace-cloudnetworks-uk/pom.xml index 3a6de1472f..1cf16fc961 100644 --- a/providers/rackspace-cloudnetworks-uk/pom.xml +++ b/providers/rackspace-cloudnetworks-uk/pom.xml @@ -22,14 +22,14 @@ org.apache.jclouds jclouds-project - 1.9.0 + 2.0.0-SNAPSHOT org.apache.jclouds.labs rackspace-cloudnetworks-uk - 1.9.0 + 2.0.0-SNAPSHOT jclouds Rackspace Cloud Networks UK provider OpenStack Neutron implementation targeted to Rackspace Cloud Networks UK bundle diff --git a/providers/rackspace-cloudnetworks-us/pom.xml b/providers/rackspace-cloudnetworks-us/pom.xml index 3926897799..fb960e9ce9 100644 --- a/providers/rackspace-cloudnetworks-us/pom.xml +++ b/providers/rackspace-cloudnetworks-us/pom.xml @@ -22,14 +22,14 @@ org.apache.jclouds jclouds-project - 1.9.0 + 2.0.0-SNAPSHOT org.apache.jclouds.labs rackspace-cloudnetworks-us - 1.9.0 + 2.0.0-SNAPSHOT jclouds Rackspace Cloud Networks US provider OpenStack Neutron implementation targeted to Rackspace Cloud Networks US bundle From 60737100cec28b6096ebd810c6e158c8cc656a44 Mon Sep 17 00:00:00 2001 From: Zack Shoylev Date: Fri, 27 Feb 2015 07:00:59 -0600 Subject: [PATCH 07/12] Enables live tests for neutron security groups. Makes tests more robust. --- ...oudNetworksUSSecurityGroupApiLiveTest.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 providers/rackspace-cloudnetworks-us/src/test/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSSecurityGroupApiLiveTest.java diff --git a/providers/rackspace-cloudnetworks-us/src/test/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSSecurityGroupApiLiveTest.java b/providers/rackspace-cloudnetworks-us/src/test/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSSecurityGroupApiLiveTest.java new file mode 100644 index 0000000000..b53de9cea8 --- /dev/null +++ b/providers/rackspace-cloudnetworks-us/src/test/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSSecurityGroupApiLiveTest.java @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.jclouds.rackspace.cloudnetworks.us; + +import org.jclouds.openstack.neutron.v2.extensions.SecurityGroupApiLiveTest; +import org.testng.annotations.Test; + +@Test(groups = "live", testName = "CloudNetworksUSSecurityGroupApiLiveTest", singleThreaded = true) +public class CloudNetworksUSSecurityGroupApiLiveTest extends SecurityGroupApiLiveTest { + public CloudNetworksUSSecurityGroupApiLiveTest() { + provider = "rackspace-cloudnetworks-us"; + } +} From 15a1c6abfdf57009cee2334e32c5d4fc4d47cecc Mon Sep 17 00:00:00 2001 From: Ignasi Barrera Date: Wed, 9 Nov 2016 22:43:56 +0100 Subject: [PATCH 08/12] Apache jclouds 2.0.0-rc3 release --- providers/rackspace-cloudnetworks-uk/pom.xml | 4 ++-- providers/rackspace-cloudnetworks-us/pom.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/providers/rackspace-cloudnetworks-uk/pom.xml b/providers/rackspace-cloudnetworks-uk/pom.xml index 1cf16fc961..934be5f0e0 100644 --- a/providers/rackspace-cloudnetworks-uk/pom.xml +++ b/providers/rackspace-cloudnetworks-uk/pom.xml @@ -22,14 +22,14 @@ org.apache.jclouds jclouds-project - 2.0.0-SNAPSHOT + 2.0.0 org.apache.jclouds.labs rackspace-cloudnetworks-uk - 2.0.0-SNAPSHOT + 2.0.0 jclouds Rackspace Cloud Networks UK provider OpenStack Neutron implementation targeted to Rackspace Cloud Networks UK bundle diff --git a/providers/rackspace-cloudnetworks-us/pom.xml b/providers/rackspace-cloudnetworks-us/pom.xml index fb960e9ce9..375c28c5bd 100644 --- a/providers/rackspace-cloudnetworks-us/pom.xml +++ b/providers/rackspace-cloudnetworks-us/pom.xml @@ -22,14 +22,14 @@ org.apache.jclouds jclouds-project - 2.0.0-SNAPSHOT + 2.0.0 org.apache.jclouds.labs rackspace-cloudnetworks-us - 2.0.0-SNAPSHOT + 2.0.0 jclouds Rackspace Cloud Networks US provider OpenStack Neutron implementation targeted to Rackspace Cloud Networks US bundle From 1c49a1b170c750a2046c5884593fbc85f44bf0cc Mon Sep 17 00:00:00 2001 From: Ignasi Barrera Date: Tue, 15 Nov 2016 01:13:00 +0100 Subject: [PATCH 09/12] Next development version 2.1.0-SNAPSHOT --- providers/rackspace-cloudnetworks-uk/pom.xml | 4 ++-- providers/rackspace-cloudnetworks-us/pom.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/providers/rackspace-cloudnetworks-uk/pom.xml b/providers/rackspace-cloudnetworks-uk/pom.xml index 934be5f0e0..96935c9fc2 100644 --- a/providers/rackspace-cloudnetworks-uk/pom.xml +++ b/providers/rackspace-cloudnetworks-uk/pom.xml @@ -22,14 +22,14 @@ org.apache.jclouds jclouds-project - 2.0.0 + 2.1.0-SNAPSHOT org.apache.jclouds.labs rackspace-cloudnetworks-uk - 2.0.0 + 2.1.0-SNAPSHOT jclouds Rackspace Cloud Networks UK provider OpenStack Neutron implementation targeted to Rackspace Cloud Networks UK bundle diff --git a/providers/rackspace-cloudnetworks-us/pom.xml b/providers/rackspace-cloudnetworks-us/pom.xml index 375c28c5bd..385118f736 100644 --- a/providers/rackspace-cloudnetworks-us/pom.xml +++ b/providers/rackspace-cloudnetworks-us/pom.xml @@ -22,14 +22,14 @@ org.apache.jclouds jclouds-project - 2.0.0 + 2.1.0-SNAPSHOT org.apache.jclouds.labs rackspace-cloudnetworks-us - 2.0.0 + 2.1.0-SNAPSHOT jclouds Rackspace Cloud Networks US provider OpenStack Neutron implementation targeted to Rackspace Cloud Networks US bundle From 6b5f522f5c96981a621f869e00416d1cf39bdcf5 Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Wed, 30 Aug 2017 12:27:08 -0700 Subject: [PATCH 10/12] Make auto service optional This makes dependencies consistent and eliminates warnings of the form: $M2_HOME/repository/org/apache/jclouds/driver/jclouds-slf4j/2.1.0-SNAPSHOT/jclouds-slf4j-2.1.0-SNAPSHOT.jar(org/jclouds/logging/slf4j/config/SLF4JLoggingModule.class): warning: Cannot find annotation method 'value()' in type 'AutoService': class file for com.google.auto.service.AutoService not found Reference: https://github.com/google/auto/tree/master/service#download --- providers/rackspace-cloudnetworks-us/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/providers/rackspace-cloudnetworks-us/pom.xml b/providers/rackspace-cloudnetworks-us/pom.xml index 385118f736..aeb8a3ce5a 100644 --- a/providers/rackspace-cloudnetworks-us/pom.xml +++ b/providers/rackspace-cloudnetworks-us/pom.xml @@ -87,6 +87,7 @@ com.google.auto.service auto-service provided + true From 6aa759cebc67f93288a9da14e51aa41793fa3a90 Mon Sep 17 00:00:00 2001 From: andreaturli Date: Tue, 21 Nov 2017 12:34:12 +0100 Subject: [PATCH 11/12] [Openstack-Neutron] move SecurityGroupApi from extensions to features --- .../us/CloudNetworksUSSecurityGroupApiLiveTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/providers/rackspace-cloudnetworks-us/src/test/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSSecurityGroupApiLiveTest.java b/providers/rackspace-cloudnetworks-us/src/test/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSSecurityGroupApiLiveTest.java index b53de9cea8..dee11f3581 100644 --- a/providers/rackspace-cloudnetworks-us/src/test/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSSecurityGroupApiLiveTest.java +++ b/providers/rackspace-cloudnetworks-us/src/test/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSSecurityGroupApiLiveTest.java @@ -16,7 +16,7 @@ */ package org.jclouds.rackspace.cloudnetworks.us; -import org.jclouds.openstack.neutron.v2.extensions.SecurityGroupApiLiveTest; +import org.jclouds.openstack.neutron.v2.features.SecurityGroupApiLiveTest; import org.testng.annotations.Test; @Test(groups = "live", testName = "CloudNetworksUSSecurityGroupApiLiveTest", singleThreaded = true) From efeedb45261696e674a7b6b2b720b2def624f86a Mon Sep 17 00:00:00 2001 From: Ignasi Barrera Date: Mon, 15 Jan 2018 15:06:02 +0100 Subject: [PATCH 12/12] Add support for Keystone V3 --- .../uk/CloudNetworksUKProviderMetadata.java | 12 +++++++----- .../us/CloudNetworksUSProviderMetadata.java | 12 +++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/providers/rackspace-cloudnetworks-uk/src/main/java/org/jclouds/rackspace/cloudnetworks/uk/CloudNetworksUKProviderMetadata.java b/providers/rackspace-cloudnetworks-uk/src/main/java/org/jclouds/rackspace/cloudnetworks/uk/CloudNetworksUKProviderMetadata.java index 4cc4c16270..620ad524fc 100644 --- a/providers/rackspace-cloudnetworks-uk/src/main/java/org/jclouds/rackspace/cloudnetworks/uk/CloudNetworksUKProviderMetadata.java +++ b/providers/rackspace-cloudnetworks-uk/src/main/java/org/jclouds/rackspace/cloudnetworks/uk/CloudNetworksUKProviderMetadata.java @@ -19,19 +19,20 @@ package org.jclouds.rackspace.cloudnetworks.uk; import static org.jclouds.location.reference.LocationConstants.ISO3166_CODES; import static org.jclouds.location.reference.LocationConstants.PROPERTY_REGION; import static org.jclouds.location.reference.LocationConstants.PROPERTY_REGIONS; -import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.CREDENTIAL_TYPE; -import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.SERVICE_TYPE; +import static org.jclouds.openstack.keystone.config.KeystoneProperties.CREDENTIAL_TYPE; +import static org.jclouds.openstack.keystone.config.KeystoneProperties.KEYSTONE_VERSION; +import static org.jclouds.openstack.keystone.config.KeystoneProperties.SERVICE_TYPE; import java.net.URI; import java.util.Properties; -import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule.RegionModule; +import org.jclouds.openstack.keystone.catalog.config.ServiceCatalogModule; +import org.jclouds.openstack.keystone.catalog.config.ServiceCatalogModule.RegionModule; import org.jclouds.openstack.neutron.v2.NeutronApiMetadata; import org.jclouds.openstack.neutron.v2.config.NeutronHttpApiModule; import org.jclouds.openstack.v2_0.ServiceType; import org.jclouds.providers.ProviderMetadata; import org.jclouds.providers.internal.BaseProviderMetadata; -import org.jclouds.rackspace.cloudidentity.v2_0.config.CloudIdentityAuthenticationApiModule; import org.jclouds.rackspace.cloudidentity.v2_0.config.CloudIdentityAuthenticationModule; import org.jclouds.rackspace.cloudidentity.v2_0.config.CloudIdentityCredentialTypes; @@ -67,6 +68,7 @@ public class CloudNetworksUKProviderMetadata extends BaseProviderMetadata { Properties properties = new Properties(); properties.setProperty(CREDENTIAL_TYPE, CloudIdentityCredentialTypes.API_KEY_CREDENTIALS); properties.setProperty(SERVICE_TYPE, ServiceType.NETWORK); + properties.setProperty(KEYSTONE_VERSION, "2"); properties.setProperty(PROPERTY_REGIONS, "LON"); properties.setProperty(PROPERTY_REGION + ".LON." + ISO3166_CODES, "GB-SLG"); @@ -87,8 +89,8 @@ public class CloudNetworksUKProviderMetadata extends BaseProviderMetadata { .endpointName("Rackspace Cloud Identity service URL ending in /v2.0/") .version("2.0") .defaultModules(ImmutableSet.>builder() - .add(CloudIdentityAuthenticationApiModule.class) .add(CloudIdentityAuthenticationModule.class) + .add(ServiceCatalogModule.class) .add(RegionModule.class) .add(NeutronHttpApiModule.class) .build()) diff --git a/providers/rackspace-cloudnetworks-us/src/main/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSProviderMetadata.java b/providers/rackspace-cloudnetworks-us/src/main/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSProviderMetadata.java index 3920c20d8d..60bff942de 100644 --- a/providers/rackspace-cloudnetworks-us/src/main/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSProviderMetadata.java +++ b/providers/rackspace-cloudnetworks-us/src/main/java/org/jclouds/rackspace/cloudnetworks/us/CloudNetworksUSProviderMetadata.java @@ -19,19 +19,20 @@ package org.jclouds.rackspace.cloudnetworks.us; import static org.jclouds.location.reference.LocationConstants.ISO3166_CODES; import static org.jclouds.location.reference.LocationConstants.PROPERTY_REGION; import static org.jclouds.location.reference.LocationConstants.PROPERTY_REGIONS; -import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.CREDENTIAL_TYPE; -import static org.jclouds.openstack.keystone.v2_0.config.KeystoneProperties.SERVICE_TYPE; +import static org.jclouds.openstack.keystone.config.KeystoneProperties.CREDENTIAL_TYPE; +import static org.jclouds.openstack.keystone.config.KeystoneProperties.KEYSTONE_VERSION; +import static org.jclouds.openstack.keystone.config.KeystoneProperties.SERVICE_TYPE; import java.net.URI; import java.util.Properties; -import org.jclouds.openstack.keystone.v2_0.config.KeystoneAuthenticationModule.RegionModule; +import org.jclouds.openstack.keystone.catalog.config.ServiceCatalogModule; +import org.jclouds.openstack.keystone.catalog.config.ServiceCatalogModule.RegionModule; import org.jclouds.openstack.neutron.v2.NeutronApiMetadata; import org.jclouds.openstack.neutron.v2.config.NeutronHttpApiModule; import org.jclouds.openstack.v2_0.ServiceType; import org.jclouds.providers.ProviderMetadata; import org.jclouds.providers.internal.BaseProviderMetadata; -import org.jclouds.rackspace.cloudidentity.v2_0.config.CloudIdentityAuthenticationApiModule; import org.jclouds.rackspace.cloudidentity.v2_0.config.CloudIdentityAuthenticationModule; import org.jclouds.rackspace.cloudidentity.v2_0.config.CloudIdentityCredentialTypes; @@ -67,6 +68,7 @@ public class CloudNetworksUSProviderMetadata extends BaseProviderMetadata { Properties properties = new Properties(); properties.setProperty(CREDENTIAL_TYPE, CloudIdentityCredentialTypes.API_KEY_CREDENTIALS); properties.setProperty(SERVICE_TYPE, ServiceType.NETWORK); + properties.setProperty(KEYSTONE_VERSION, "2"); properties.setProperty(PROPERTY_REGIONS, "ORD,DFW,IAD,SYD,HKG"); properties.setProperty(PROPERTY_REGION + ".ORD." + ISO3166_CODES, "US-IL"); @@ -91,8 +93,8 @@ public class CloudNetworksUSProviderMetadata extends BaseProviderMetadata { .endpointName("Rackspace Cloud Identity service URL ending in /v2.0/") .version("2.0") .defaultModules(ImmutableSet.>builder() - .add(CloudIdentityAuthenticationApiModule.class) .add(CloudIdentityAuthenticationModule.class) + .add(ServiceCatalogModule.class) .add(RegionModule.class) .add(NeutronHttpApiModule.class) .build())