OpenStack Neutron promoted to the main repo
Project: http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/repo Commit: http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/commit/35142182 Tree: http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/tree/35142182 Diff: http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/diff/35142182 Branch: refs/heads/master Commit: 35142182c41168f034a856d846dc94d4f12d7a57 Parents: d3afa6e Author: Ignasi Barrera <[email protected]> Authored: Wed Jan 17 09:11:10 2018 +0100 Committer: Ignasi Barrera <[email protected]> Committed: Wed Jan 17 09:11:10 2018 +0100 ---------------------------------------------------------------------- openstack-neutron/README.md | 7 - openstack-neutron/pom.xml | 156 --- .../openstack/neutron/v2/NeutronApi.java | 130 --- .../neutron/v2/NeutronApiMetadata.java | 104 -- .../neutron/v2/config/NeutronHttpApiModule.java | 92 -- .../neutron/v2/domain/AddressPair.java | 177 --- .../neutron/v2/domain/AllocationPool.java | 139 --- .../neutron/v2/domain/CreateFirewall.java | 120 -- .../neutron/v2/domain/CreateFirewallPolicy.java | 142 --- .../neutron/v2/domain/CreateFirewallRule.java | 231 ---- .../neutron/v2/domain/ExternalGatewayInfo.java | 140 --- .../neutron/v2/domain/ExtraDhcpOption.java | 168 --- .../openstack/neutron/v2/domain/Firewall.java | 47 - .../neutron/v2/domain/FirewallPolicies.java | 36 - .../neutron/v2/domain/FirewallPolicy.java | 48 - .../neutron/v2/domain/FirewallRule.java | 52 - .../neutron/v2/domain/FirewallRules.java | 36 - .../openstack/neutron/v2/domain/Firewalls.java | 36 - .../openstack/neutron/v2/domain/FloatingIP.java | 318 ------ .../neutron/v2/domain/FloatingIPs.java | 36 - .../openstack/neutron/v2/domain/HostRoute.java | 124 -- .../jclouds/openstack/neutron/v2/domain/IP.java | 138 --- .../neutron/v2/domain/IPv6DHCPMode.java | 57 - .../openstack/neutron/v2/domain/IpVersion.java | 50 - .../openstack/neutron/v2/domain/Network.java | 647 ----------- .../neutron/v2/domain/NetworkSegment.java | 170 --- .../neutron/v2/domain/NetworkStatus.java | 60 - .../neutron/v2/domain/NetworkType.java | 81 -- .../openstack/neutron/v2/domain/Networks.java | 36 - .../openstack/neutron/v2/domain/Port.java | 764 ------------- .../openstack/neutron/v2/domain/Ports.java | 36 - .../openstack/neutron/v2/domain/Router.java | 286 ----- .../neutron/v2/domain/RouterInterface.java | 142 --- .../openstack/neutron/v2/domain/Routers.java | 36 - .../openstack/neutron/v2/domain/Rule.java | 379 ------- .../neutron/v2/domain/RuleDirection.java | 61 - .../neutron/v2/domain/RuleEthertype.java | 61 - .../neutron/v2/domain/RuleProtocol.java | 65 -- .../openstack/neutron/v2/domain/Rules.java | 36 - .../neutron/v2/domain/SecurityGroup.java | 220 ---- .../neutron/v2/domain/SecurityGroups.java | 36 - .../openstack/neutron/v2/domain/Subnet.java | 467 -------- .../openstack/neutron/v2/domain/Subnets.java | 36 - .../neutron/v2/domain/UpdateFirewall.java | 68 -- .../neutron/v2/domain/UpdateFirewallPolicy.java | 80 -- .../neutron/v2/domain/UpdateFirewallRule.java | 100 -- .../openstack/neutron/v2/domain/VIFType.java | 62 - .../openstack/neutron/v2/domain/VNICType.java | 56 - .../v2/domain/lbaas/v1/HealthMonitor.java | 451 -------- .../v2/domain/lbaas/v1/HealthMonitorStatus.java | 101 -- .../v2/domain/lbaas/v1/HealthMonitors.java | 37 - .../neutron/v2/domain/lbaas/v1/HttpMethod.java | 75 -- .../neutron/v2/domain/lbaas/v1/LBaaSStatus.java | 78 -- .../neutron/v2/domain/lbaas/v1/Member.java | 368 ------ .../neutron/v2/domain/lbaas/v1/Members.java | 36 - .../neutron/v2/domain/lbaas/v1/Pool.java | 482 -------- .../neutron/v2/domain/lbaas/v1/PoolStatus.java | 101 -- .../neutron/v2/domain/lbaas/v1/Pools.java | 36 - .../neutron/v2/domain/lbaas/v1/ProbeType.java | 70 -- .../neutron/v2/domain/lbaas/v1/Protocol.java | 67 -- .../v2/domain/lbaas/v1/SessionPersistence.java | 183 --- .../neutron/v2/domain/lbaas/v1/VIP.java | 493 -------- .../neutron/v2/domain/lbaas/v1/VIPs.java | 36 - .../v2/extensions/ExtensionNamespaces.java | 43 - .../neutron/v2/extensions/FWaaSApi.java | 247 ---- .../neutron/v2/extensions/FloatingIPApi.java | 139 --- .../neutron/v2/extensions/RouterApi.java | 198 ---- .../v2/extensions/lbaas/v1/LBaaSApi.java | 418 ------- .../v2/fallbacks/EmptyFloatingIPsFallback.java | 38 - .../v2/fallbacks/EmptyNetworksFallback.java | 38 - .../v2/fallbacks/EmptyPortsFallback.java | 38 - .../v2/fallbacks/EmptyRoutersFallback.java | 38 - .../v2/fallbacks/EmptyRulesFallback.java | 38 - .../fallbacks/EmptySecurityGroupsFallback.java | 38 - .../v2/fallbacks/EmptySubnetsFallback.java | 38 - .../lbaas/v1/EmptyHealthMonitorsFallback.java | 38 - .../lbaas/v1/EmptyMembersFallback.java | 38 - .../fallbacks/lbaas/v1/EmptyPoolsFallback.java | 38 - .../fallbacks/lbaas/v1/EmptyVIPsFallback.java | 38 - .../neutron/v2/features/NetworkApi.java | 149 --- .../openstack/neutron/v2/features/PortApi.java | 149 --- .../neutron/v2/features/SecurityGroupApi.java | 184 --- .../neutron/v2/features/SubnetApi.java | 145 --- .../FirewallPolicyToPagedIterable.java | 63 -- .../functions/FirewallRuleToPagedIterable.java | 63 -- .../v2/functions/FirewallToPagedIterable.java | 63 -- .../functions/FloatingIPsToPagedIterable.java | 64 -- .../v2/functions/NetworksToPagedIterable.java | 64 -- .../v2/functions/ParseFirewallPolicies.java | 38 - .../v2/functions/ParseFirewallRules.java | 38 - .../neutron/v2/functions/ParseFirewalls.java | 38 - .../neutron/v2/functions/ParseFloatingIPs.java | 37 - .../neutron/v2/functions/ParseNetworks.java | 38 - .../neutron/v2/functions/ParsePorts.java | 37 - .../neutron/v2/functions/ParseRouters.java | 37 - .../neutron/v2/functions/ParseRules.java | 38 - .../v2/functions/ParseSecurityGroups.java | 38 - .../neutron/v2/functions/ParseSubnets.java | 37 - .../v2/functions/PortsToPagedIterable.java | 64 -- .../v2/functions/RouterToPagedIterable.java | 65 -- .../v2/functions/RulesToPagedIterable.java | 66 -- .../SecurityGroupsToPagedIterable.java | 66 -- .../v2/functions/SubnetsToPagedIterable.java | 64 -- .../functions/VersionAwareRegionToEndpoint.java | 67 -- .../lbaas/v1/HealthMonitorsToPagedIterable.java | 66 -- .../lbaas/v1/MembersToPagedIterable.java | 65 -- .../functions/lbaas/v1/ParseHealthMonitors.java | 38 - .../v2/functions/lbaas/v1/ParseMembers.java | 38 - .../v2/functions/lbaas/v1/ParsePools.java | 38 - .../v2/functions/lbaas/v1/ParseVIPs.java | 38 - .../lbaas/v1/PoolsToPagedIterable.java | 65 -- .../functions/lbaas/v1/VIPsToPagedIterable.java | 65 -- .../v2/handlers/NeutronErrorHandler.java | 62 - .../neutron/v2/options/EmptyOptions.java | 45 - .../neutron/v2/NeutronApiMetadataTest.java | 33 - .../neutron/v2/extensions/FWaaSApiLiveTest.java | 199 ---- .../neutron/v2/extensions/FWaaSApiMockTest.java | 568 ---------- .../v2/extensions/FloatingIPApiLiveTest.java | 92 -- .../v2/extensions/FloatingIPApiMockTest.java | 292 ----- .../v2/extensions/RouterApiLiveTest.java | 173 --- .../v2/extensions/RouterApiMockTest.java | 387 ------- .../extensions/lbaas/v1/LBaaSApiLiveTest.java | 634 ----------- .../extensions/lbaas/v1/LBaaSApiMockTest.java | 1055 ------------------ .../v2/features/ExtensionApiLiveTest.java | 82 -- .../v2/features/ExtensionApiMockTest.java | 96 -- .../neutron/v2/features/NetworkApiLiveTest.java | 100 -- .../neutron/v2/features/NetworkApiMockTest.java | 306 ----- .../neutron/v2/features/PortApiLiveTest.java | 149 --- .../neutron/v2/features/PortApiMockTest.java | 298 ----- .../v2/features/SecurityGroupApiLiveTest.java | 111 -- .../v2/features/SecurityGroupApiMockTest.java | 394 ------- .../neutron/v2/features/SubnetApiLiveTest.java | 118 -- .../neutron/v2/features/SubnetApiMockTest.java | 284 ----- .../v2/internal/BaseNeutronApiLiveTest.java | 51 - .../v2/internal/BaseNeutronApiMockTest.java | 44 - .../openstack/neutron/v2/util/ClassUtil.java | 39 - .../neutron/v2/util/PredicateUtil.java | 47 - .../src/test/resources/access.json | 228 ---- .../src/test/resources/extension_details.json | 10 - .../src/test/resources/extension_list.json | 124 -- .../extension_list_with_lbaas_v1_response.json | 140 --- ...xtension_list_without_lbaas_v1_response.json | 132 --- .../test/resources/firewall_create_request.json | 6 - .../resources/firewall_create_response.json | 11 - .../test/resources/firewall_get_response.json | 11 - .../test/resources/firewall_list_response.json | 13 - .../firewall_policy_create_request.json | 8 - .../firewall_policy_create_response.json | 11 - .../resources/firewall_policy_get_response.json | 14 - .../firewall_policy_insert_rule_request.json | 1 - .../firewall_policy_insert_rule_response.json | 10 - .../firewall_policy_list_response.json | 255 ----- .../resources/firewall_rule_create_request.json | 12 - .../firewall_rule_create_response.json | 19 - .../resources/firewall_rule_get_response.json | 19 - .../resources/firewall_rule_update_request.json | 6 - .../firewall_rule_update_response.json | 19 - .../test/resources/firewall_update_request.json | 5 - .../resources/firewall_update_response.json | 11 - .../resources/floatingip_create_request.json | 6 - .../resources/floatingip_create_response.json | 11 - .../test/resources/floatingip_get_response.json | 11 - .../resources/floatingip_list_response.json | 22 - .../floatingip_list_response_paged1.json | 32 - .../floatingip_list_response_paged2.json | 28 - .../floatingip_update_dissociate_request.json | 5 - .../floatingip_update_dissociate_response.json | 11 - .../resources/floatingip_update_request.json | 5 - .../resources/floatingip_update_response.json | 11 - .../lbaas/v1/health_monitor_create_request.json | 8 - .../v1/health_monitor_create_response.json | 16 - .../lbaas/v1/health_monitor_get_response.json | 16 - .../v1/health_monitor_list_response_paged1.json | 20 - .../v1/health_monitor_list_response_paged2.json | 23 - .../lbaas/v1/health_monitor_update_request.json | 11 - .../v1/health_monitor_update_response.json | 16 - .../lbaas/v1/member_create_request.json | 6 - .../lbaas/v1/member_create_response.json | 12 - .../resources/lbaas/v1/member_get_response.json | 12 - .../lbaas/v1/member_list_response_paged1.json | 20 - .../lbaas/v1/member_list_response_paged2.json | 20 - .../lbaas/v1/member_update_request.json | 7 - .../lbaas/v1/member_update_response.json | 12 - .../pool_associate_health_monitor_request.json | 5 - .../pool_associate_health_monitor_response.json | 4 - .../resources/lbaas/v1/pool_create_request.json | 8 - .../lbaas/v1/pool_create_response.json | 18 - .../resources/lbaas/v1/pool_get_response.json | 35 - .../lbaas/v1/pool_list_response_paged1.json | 46 - .../lbaas/v1/pool_list_response_paged2.json | 42 - .../resources/lbaas/v1/pool_update_request.json | 11 - .../lbaas/v1/pool_update_response.json | 29 - .../resources/lbaas/v1/vip_create_request.json | 9 - .../resources/lbaas/v1/vip_create_response.json | 17 - .../resources/lbaas/v1/vip_get_response.json | 21 - .../lbaas/v1/vip_list_response_paged1.json | 29 - .../lbaas/v1/vip_list_response_paged2.json | 29 - .../resources/lbaas/v1/vip_update_request.json | 13 - .../resources/lbaas/v1/vip_update_response.json | 21 - .../src/test/resources/list_networks.json | 62 - .../src/test/resources/list_ports.json | 86 -- .../src/test/resources/list_routers.json | 74 -- .../src/test/resources/list_subnets.json | 98 -- .../src/test/resources/logback.xml | 42 - .../src/test/resources/network.json | 7 - .../resources/network_bulk_create_request.json | 12 - .../resources/network_bulk_create_response.json | 18 - .../test/resources/network_create_request.json | 4 - .../test/resources/network_create_response.json | 7 - .../test/resources/network_get_response.json | 7 - .../test/resources/network_list_response.json | 62 - .../resources/network_list_response_paged1.json | 40 - .../resources/network_list_response_paged2.json | 36 - .../test/resources/network_update_request.json | 4 - .../test/resources/network_update_response.json | 11 - openstack-neutron/src/test/resources/port.json | 7 - .../resources/port_create_bulk_request.json | 22 - .../resources/port_create_bulk_response.json | 47 - .../src/test/resources/port_create_request.json | 14 - .../test/resources/port_create_response.json | 29 - .../src/test/resources/port_get_response.json | 10 - .../src/test/resources/port_list_response.json | 86 -- .../resources/port_list_response_paged1.json | 48 - .../resources/port_list_response_paged2.json | 44 - .../src/test/resources/port_update_request.json | 8 - .../test/resources/port_update_response.json | 23 - .../src/test/resources/router.json | 9 - .../router_add_interface_port_request.json | 3 - .../resources/router_add_interface_request.json | 3 - .../router_add_interface_response.json | 4 - .../test/resources/router_create_request.json | 10 - .../test/resources/router_create_response.json | 13 - .../src/test/resources/router_get_response.json | 12 - .../test/resources/router_list_response.json | 74 -- .../resources/router_list_response_paged1.json | 34 - .../resources/router_list_response_paged2.json | 30 - .../router_remove_interface_port_request.json | 3 - .../router_remove_interface_subnet_request.json | 3 - .../test/resources/router_update_request.json | 7 - .../test/resources/router_update_response.json | 12 - .../security_group_create_request.json | 6 - .../security_group_create_response.json | 34 - .../resources/security_group_get_response.json | 58 - .../resources/security_group_list_response.json | 116 -- .../security_group_list_response_paged1.json | 126 --- .../security_group_list_response_paged2.json | 122 -- .../security_group_rule_create_request.json | 11 - .../security_group_rule_create_response.json | 15 - .../security_group_rule_get_response.json | 14 - .../security_group_rule_list_response.json | 52 - ...ecurity_group_rule_list_response_paged1.json | 62 - ...ecurity_group_rule_list_response_paged2.json | 58 - .../src/test/resources/subnet.json | 8 - .../resources/subnet_bulk_create_request.json | 14 - .../resources/subnet_bulk_create_response.json | 48 - .../test/resources/subnet_create_request.json | 6 - .../test/resources/subnet_create_response.json | 8 - .../src/test/resources/subnet_get_response.json | 9 - .../test/resources/subnet_list_response.json | 98 -- .../resources/subnet_list_response_pages1.json | 30 - .../resources/subnet_list_response_pages2.json | 26 - .../test/resources/subnet_update_request.json | 6 - .../test/resources/subnet_update_response.json | 18 - pom.xml | 1 - 264 files changed, 22244 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/35142182/openstack-neutron/README.md ---------------------------------------------------------------------- diff --git a/openstack-neutron/README.md b/openstack-neutron/README.md deleted file mode 100644 index b3a1c1a..0000000 --- a/openstack-neutron/README.md +++ /dev/null @@ -1,7 +0,0 @@ -OpenStack Neutron -================= - -Neutron is a virtual network service for Openstack. - -Production ready? -Yes http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/35142182/openstack-neutron/pom.xml ---------------------------------------------------------------------- diff --git a/openstack-neutron/pom.xml b/openstack-neutron/pom.xml deleted file mode 100644 index 1446d98..0000000 --- a/openstack-neutron/pom.xml +++ /dev/null @@ -1,156 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - 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. - ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.jclouds</groupId> - <artifactId>jclouds-project</artifactId> - <version>2.1.0-SNAPSHOT</version> - <relativePath /> - </parent> - - <!-- TODO: when out of labs, switch to org.jclouds.api --> - <groupId>org.apache.jclouds.labs</groupId> - <artifactId>openstack-neutron</artifactId> - <version>2.1.0-SNAPSHOT</version> - <name>jclouds openstack-neutron api</name> - <description>jclouds components to access an implementation of OpenStack Neutron</description> - <packaging>bundle</packaging> - - <properties> - <!-- keystone endpoint --> - <test.openstack-neutron.endpoint>http://localhost:5000/v2.0/</test.openstack-neutron.endpoint> - <!-- keystone version --> - <test.openstack-neutron.api-version>v2.0</test.openstack-neutron.api-version> - <test.openstack-neutron.build-version /> - <test.openstack-neutron.identity>FIXME_IDENTITY</test.openstack-neutron.identity> - <test.openstack-neutron.credential>FIXME_CREDENTIALS</test.openstack-neutron.credential> - <test.jclouds.keystone.credential-type>passwordCredentials</test.jclouds.keystone.credential-type> - <jclouds.osgi.export>org.jclouds.openstack.neutron.v2*;version="${project.version}"</jclouds.osgi.export> - <jclouds.osgi.import>org.jclouds*;version="${project.version}",*</jclouds.osgi.import> - </properties> - - <repositories> - <repository> - <id>apache-snapshots</id> - <url>https://repository.apache.org/content/repositories/snapshots</url> - <releases> - <enabled>false</enabled> - </releases> - <snapshots> - <enabled>true</enabled> - </snapshots> - </repository> - </repositories> - - <dependencies> - <dependency> - <groupId>org.apache.jclouds.api</groupId> - <artifactId>openstack-keystone</artifactId> - <version>${project.parent.version}</version> - </dependency> - <dependency> - <groupId>org.apache.jclouds</groupId> - <artifactId>jclouds-core</artifactId> - <version>${project.parent.version}</version> - </dependency> - <!-- for the extension namespaces --> - <dependency> - <groupId>com.google.inject.extensions</groupId> - <artifactId>guice-multibindings</artifactId> - </dependency> - <dependency> - <groupId>org.apache.jclouds</groupId> - <artifactId>jclouds-core</artifactId> - <version>${project.parent.version}</version> - <type>test-jar</type> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.jclouds.api</groupId> - <artifactId>openstack-keystone</artifactId> - <version>${project.parent.version}</version> - <type>test-jar</type> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.jclouds.driver</groupId> - <artifactId>jclouds-slf4j</artifactId> - <version>${project.parent.version}</version> - <scope>test</scope> - </dependency> - <dependency> - <groupId>ch.qos.logback</groupId> - <artifactId>logback-classic</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>com.squareup.okhttp</groupId> - <artifactId>mockwebserver</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>com.google.auto.service</groupId> - <artifactId>auto-service</artifactId> - <scope>provided</scope> - <optional>true</optional> - </dependency> - <dependency> - <groupId>com.google.auto.value</groupId> - <artifactId>auto-value</artifactId> - <scope>provided</scope> - </dependency> - </dependencies> - - <profiles> - <profile> - <id>live</id> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <executions> - <execution> - <id>integration</id> - <phase>integration-test</phase> - <goals> - <goal>test</goal> - </goals> - <configuration> - <systemPropertyVariables> - <test.openstack-neutron.endpoint>${test.openstack-neutron.endpoint}</test.openstack-neutron.endpoint> - <test.openstack-neutron.api-version>${test.openstack-neutron.api-version}</test.openstack-neutron.api-version> - <test.openstack-neutron.build-version>${test.openstack-neutron.build-version}</test.openstack-neutron.build-version> - <test.openstack-neutron.identity>${test.openstack-neutron.identity}</test.openstack-neutron.identity> - <test.openstack-neutron.credential>${test.openstack-neutron.credential}</test.openstack-neutron.credential> - <test.jclouds.keystone.credential-type>${test.jclouds.keystone.credential-type}</test.jclouds.keystone.credential-type> - </systemPropertyVariables> - <parallel>classes</parallel> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> - </profiles> - -</project> http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/35142182/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/NeutronApi.java ---------------------------------------------------------------------- diff --git a/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/NeutronApi.java b/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/NeutronApi.java deleted file mode 100644 index 97530f8..0000000 --- a/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/NeutronApi.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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.openstack.neutron.v2; - -import java.io.Closeable; -import java.util.Set; - -import javax.ws.rs.Path; - -import org.jclouds.location.Region; -import org.jclouds.openstack.neutron.v2.extensions.FloatingIPApi; -import org.jclouds.openstack.neutron.v2.extensions.RouterApi; -import org.jclouds.openstack.neutron.v2.features.SecurityGroupApi; -import org.jclouds.openstack.neutron.v2.extensions.lbaas.v1.LBaaSApi; -import org.jclouds.openstack.neutron.v2.extensions.FWaaSApi; -import org.jclouds.openstack.neutron.v2.features.NetworkApi; -import org.jclouds.openstack.neutron.v2.features.PortApi; -import org.jclouds.openstack.neutron.v2.features.SubnetApi; -import org.jclouds.openstack.neutron.v2.functions.VersionAwareRegionToEndpoint; -import org.jclouds.openstack.v2_0.features.ExtensionApi; -import org.jclouds.rest.annotations.Delegate; -import org.jclouds.rest.annotations.EndpointParam; - -import com.google.common.base.Optional; -import com.google.inject.Provides; - -/** - * Provides access to the OpenStack Networking (Neutron) v2 API. - * - * The service-side API will always have a v2.0 in the path. - * However, the endpoint will sometimes contain a v2.0 and sometimes it will not. - * The @Path annotation here ensures the path is always added. The VersionAwareRegionToEndpoint ensures that the - * endpoint will always look the same. - * - * Cannot leave labs until fixed: - * TODO: https://issues.apache.org/jira/browse/JCLOUDS-773 - */ -@Path("v2.0") -public interface NeutronApi extends Closeable { - /** - * @return the Region codes configured - */ - @Provides - @Region - Set<String> getConfiguredRegions(); - - /** - * Provides access to Extension features. - */ - @Delegate - ExtensionApi getExtensionApi(@EndpointParam(parser = VersionAwareRegionToEndpoint.class) String region); - - /** - * Provides access to Network features. - */ - @Delegate - NetworkApi getNetworkApi(@EndpointParam(parser = VersionAwareRegionToEndpoint.class) String region); - - /** - * Provides access to Subnet features. - */ - @Delegate - SubnetApi getSubnetApi(@EndpointParam(parser = VersionAwareRegionToEndpoint.class) String region); - - /** - * Provides access to Port features. - */ - @Delegate - PortApi getPortApi(@EndpointParam(parser = VersionAwareRegionToEndpoint.class) String region); - - /** - * Provides access to SecurityGroup features. - */ - @Delegate - SecurityGroupApi getSecurityGroupApi(@EndpointParam(parser = VersionAwareRegionToEndpoint.class) String region); - - /** - * Provides access to Router features. - * - * <h3>NOTE</h3> - * This API is an extension that may or may not be present in your OpenStack cloud. Use the Optional return type - * to determine if it is present. - */ - @Delegate - Optional<RouterApi> getRouterApi(@EndpointParam(parser = VersionAwareRegionToEndpoint.class) String region); - - /** - * Provides access to Floating IP features. - * - * <h3>NOTE</h3> - * This API is an extension that may or may not be present in your OpenStack cloud. Use the Optional return type - * to determine if it is present. - */ - @Delegate - Optional<FloatingIPApi> getFloatingIPApi(@EndpointParam(parser = VersionAwareRegionToEndpoint.class) String region); - - /** - * Provides access to LBaaS features. - * - * <h3>NOTE</h3> - * This API is an extension that may or may not be present in your OpenStack cloud. Use the Optional return type - * to determine if it is present. - */ - @Delegate - Optional<LBaaSApi> getLBaaSApi(@EndpointParam(parser = VersionAwareRegionToEndpoint.class) String region); - - /** - * Provides access to FWaaS features. - * - * <h3>NOTE</h3> - * This API is an extension that may or may not be present in your OpenStack cloud. Use the Optional return type - * to determine if it is present. - */ - @Delegate - Optional<FWaaSApi> getFWaaSApi(@EndpointParam(parser = VersionAwareRegionToEndpoint.class) String region); -} http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/35142182/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/NeutronApiMetadata.java ---------------------------------------------------------------------- diff --git a/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/NeutronApiMetadata.java b/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/NeutronApiMetadata.java deleted file mode 100644 index 1487af0..0000000 --- a/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/NeutronApiMetadata.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * 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.openstack.neutron.v2; - -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.apis.ApiMetadata; -import org.jclouds.openstack.keystone.auth.config.AuthenticationModule; -import org.jclouds.openstack.keystone.auth.config.CredentialTypes; -import org.jclouds.openstack.keystone.catalog.config.ServiceCatalogModule; -import org.jclouds.openstack.keystone.catalog.config.ServiceCatalogModule.RegionModule; -import org.jclouds.openstack.neutron.v2.config.NeutronHttpApiModule; -import org.jclouds.openstack.v2_0.ServiceType; -import org.jclouds.rest.internal.BaseHttpApiMetadata; - -import com.google.auto.service.AutoService; -import com.google.common.collect.ImmutableSet; -import com.google.inject.Module; - -/** - * Implementation of {@link org.jclouds.apis.ApiMetadata} for Neutron 2.0 API - * - */ -@AutoService(ApiMetadata.class) -public class NeutronApiMetadata extends BaseHttpApiMetadata<NeutronApi> { - - @Override - public Builder toBuilder() { - return new Builder().fromApiMetadata(this); - } - - public NeutronApiMetadata() { - this(new Builder()); - } - - protected NeutronApiMetadata(Builder builder) { - super(builder); - } - - public static Properties defaultProperties() { - Properties properties = BaseHttpApiMetadata.defaultProperties(); - properties.setProperty(SERVICE_TYPE, ServiceType.NETWORK); - properties.setProperty(CREDENTIAL_TYPE, CredentialTypes.PASSWORD_CREDENTIALS); - properties.setProperty(KEYSTONE_VERSION, "2"); - return properties; - } - - public static class Builder extends BaseHttpApiMetadata.Builder<NeutronApi, Builder> { - - protected Builder() { - super(NeutronApi.class); - id("openstack-neutron") - .name("OpenStack Neutron API") - .identityName("${tenantName}:${userName} or ${userName}, if your keystone supports a default tenant") - .credentialName("${password}") - .endpointName("Neutron base url ending in /v2.0/") - .documentation(URI.create("http://docs.openstack.org/api/openstack-network/2.0/content/")) - .version("v2.0") - .defaultEndpoint("http://localhost:5000/v2.0/") - .defaultProperties(NeutronApiMetadata.defaultProperties()) - .defaultModules(ImmutableSet.<Class<? extends Module>>builder() - .add(AuthenticationModule.class) - .add(ServiceCatalogModule.class) - .add(RegionModule.class) - .add(NeutronHttpApiModule.class).build()); - } - - @Override - public NeutronApiMetadata build() { - return new NeutronApiMetadata(this); - } - - @Override - public Builder fromApiMetadata(ApiMetadata in) { - super.fromApiMetadata(in); - return this; - } - - @Override - protected Builder self() { - return this; - } - } - -} http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/35142182/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/config/NeutronHttpApiModule.java ---------------------------------------------------------------------- diff --git a/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/config/NeutronHttpApiModule.java b/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/config/NeutronHttpApiModule.java deleted file mode 100644 index b8ac2c6..0000000 --- a/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/config/NeutronHttpApiModule.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * 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.openstack.neutron.v2.config; - -import static org.jclouds.openstack.keystone.v2_0.config.KeystoneHttpApiModule.namespaceAliasBinder; - -import java.net.URI; -import java.util.Set; -import java.util.concurrent.TimeUnit; - -import javax.inject.Provider; -import javax.inject.Singleton; - -import org.jclouds.http.HttpErrorHandler; -import org.jclouds.http.annotation.ClientError; -import org.jclouds.http.annotation.Redirection; -import org.jclouds.http.annotation.ServerError; -import org.jclouds.json.config.GsonModule.DateAdapter; -import org.jclouds.json.config.GsonModule.Iso8601DateAdapter; -import org.jclouds.openstack.neutron.v2.NeutronApi; -import org.jclouds.openstack.neutron.v2.extensions.ExtensionNamespaces; -import org.jclouds.openstack.neutron.v2.handlers.NeutronErrorHandler; -import org.jclouds.openstack.v2_0.domain.Extension; -import org.jclouds.openstack.v2_0.functions.PresentWhenExtensionAnnotationMatchesExtensionSet; -import org.jclouds.rest.ConfiguresHttpApi; -import org.jclouds.rest.config.HttpApiModule; -import org.jclouds.rest.functions.ImplicitOptionalConverter; - -import com.google.common.cache.CacheBuilder; -import com.google.common.cache.CacheLoader; -import com.google.common.cache.LoadingCache; -import com.google.inject.Provides; -import com.google.inject.multibindings.MapBinder; - -/** - * Configures the Neutron connection. - * - */ -@ConfiguresHttpApi -public class NeutronHttpApiModule extends HttpApiModule<NeutronApi> { - - @Override - protected void configure() { - bind(DateAdapter.class).to(Iso8601DateAdapter.class); - bind(ImplicitOptionalConverter.class).to(PresentWhenExtensionAnnotationMatchesExtensionSet.class); - super.configure(); - bindAliases(); - } - - private void bindAliases() { - MapBinder<URI, URI> namespaceAliases = namespaceAliasBinder(binder()); - namespaceAliases.addBinding(URI.create(ExtensionNamespaces.L3_ROUTER)).toInstance( - URI.create("http://docs.openstack.org/ext/neutron/router/api/v1.0")); - namespaceAliases.addBinding(URI.create(ExtensionNamespaces.SECURITY_GROUPS)).toInstance( - URI.create("http://docs.openstack.org/ext/securitygroups/api/v2.0")); - namespaceAliases.addBinding(URI.create(ExtensionNamespaces.LBAAS)).toInstance( - URI.create("http://docs.openstack.org/networking/ext/lbaas/api/v1.0")); - } - - @Provides - @Singleton - public LoadingCache<String, Set<? extends Extension>> provideExtensionsByRegion(final Provider<NeutronApi> neutronApi) { - return CacheBuilder.newBuilder().expireAfterWrite(23, TimeUnit.HOURS) - .build(new CacheLoader<String, Set<? extends Extension>>() { - @Override - public Set<? extends Extension> load(String key) throws Exception { - return neutronApi.get().getExtensionApi(key).list(); - } - }); - } - - @Override - protected void bindErrorHandlers() { - bind(HttpErrorHandler.class).annotatedWith(Redirection.class).to(NeutronErrorHandler.class); - bind(HttpErrorHandler.class).annotatedWith(ClientError.class).to(NeutronErrorHandler.class); - bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(NeutronErrorHandler.class); - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/35142182/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/AddressPair.java ---------------------------------------------------------------------- diff --git a/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/AddressPair.java b/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/AddressPair.java deleted file mode 100644 index 289efe5..0000000 --- a/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/AddressPair.java +++ /dev/null @@ -1,177 +0,0 @@ -/* - * 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.openstack.neutron.v2.domain; - -import static com.google.common.base.Preconditions.checkNotNull; - -import java.beans.ConstructorProperties; - -import javax.inject.Named; - -import org.jclouds.javax.annotation.Nullable; - -import com.google.common.base.MoreObjects; -import com.google.common.base.Objects; - -/** - * Contains a mapping between a MAC address and an IP address. - */ -public class AddressPair { - - @Named("mac_address") - private String macAddress; - @Named("ip_address") - private String ipAddress; - - @ConstructorProperties({"mac_address", "ip_address"}) - protected AddressPair(String macAddress, String ipAddress) { - checkNotNull(macAddress, "mac address should not be null"); - checkNotNull(ipAddress, "ip should not be null"); - this.macAddress = macAddress; - this.ipAddress = ipAddress; - } - - /** - * Copy constructor - * @param addressPair - */ - private AddressPair(AddressPair addressPair) { - this(addressPair.getMacAddress(), addressPair.getIpAddress()); - } - - /** - * Default constructor - */ - private AddressPair() {} - - /** - * @return the macAddress of the AddressPair - */ - @Nullable - public String getMacAddress() { - return macAddress; - } - - /** - * @return the ipAddress of the AddressPair - */ - @Nullable - public String getIpAddress() { - return ipAddress; - } - - @Override - public int hashCode() { - return Objects.hashCode(macAddress, ipAddress); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null || getClass() != obj.getClass()) - return false; - AddressPair that = AddressPair.class.cast(obj); - return Objects.equal(this.macAddress, that.macAddress) && Objects.equal(this.ipAddress, that.ipAddress); - } - - protected MoreObjects.ToStringHelper string() { - return MoreObjects.toStringHelper(this).add("macAddress", macAddress).add("ipAddress", ipAddress); - } - - @Override - public String toString() { - return string().toString(); - } - - /** - * Returns a builder, but requires the user to specify any parameters required when creating a resource. - * In this case, both parameters are required. - * @return the Builder for AddressPair - */ - public static Builder builder(String macAddress, String ipAddress) { - return new Builder(macAddress, ipAddress); - } - - /** - * Gets a Builder configured as this object. - */ - public Builder toBuilder() { - return new Builder().fromAddressPair(this); - } - - public static class Builder { - // Keep track of the builder's state. - private AddressPair addressPair; - - /** - * No-parameters constructor used when updating. - * */ - private Builder() { - addressPair = new AddressPair(); - } - - /** - * Required parameters constructor used when creating. - * @param macAddress - * @param ipAddress - */ - private Builder(String macAddress, String ipAddress) { - addressPair = new AddressPair(); - addressPair.macAddress = macAddress; - addressPair.ipAddress = ipAddress; - } - - /** - * Provide the macAddress to the AddressPair's Builder. - * - * @return the Builder. - * @see AddressPair#getMacAddress() - */ - public Builder macAddress(String macAddress) { - addressPair.macAddress = macAddress; - return this; - } - - /** - * Provide the ipAddress to the AddressPair's Builder. - * - * @return the Builder. - * @see AddressPair#getIpAddress() - */ - public Builder ipAddress(String ipAddress) { - addressPair.ipAddress = ipAddress; - return this; - } - - /** - * @return a AddressPair constructed with this Builder. - */ - public AddressPair build() { - // Use the copy constructor to copy the builder's state (config) object and pass back to the user. - // Immutability is preserved, and fields are defined only once. - return new AddressPair(addressPair); - } - - /** - * @return a Builder from another AddressPair. - */ - public Builder fromAddressPair(AddressPair in) { - return this.macAddress(in.getMacAddress()).ipAddress(in.getIpAddress()); - } - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/35142182/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/AllocationPool.java ---------------------------------------------------------------------- diff --git a/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/AllocationPool.java b/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/AllocationPool.java deleted file mode 100644 index 335bfb5..0000000 --- a/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/AllocationPool.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * 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.openstack.neutron.v2.domain; - -import java.beans.ConstructorProperties; - -import org.jclouds.javax.annotation.Nullable; - -import com.google.common.base.MoreObjects; -import com.google.common.base.Objects; - -/** - * A Neutron Subnet Allocation Pool - * Contains a start and an end IP address describing the pool. - * - * @see <a - * href="http://docs.openstack.org/api/openstack-network/2.0/content/Subnets.html">api - * doc</a> - */ -public class AllocationPool { - - protected final String start; - protected final String end; - - @ConstructorProperties({"start", "end"}) - protected AllocationPool(String start, String end) { - this.start = start; - this.end = end; - } - - /** - * @return the start of the AllocationPool - */ - @Nullable - public String getStart() { - return start; - } - - /** - * @return the end of the AllocationPool - */ - @Nullable - public String getEnd() { - return end; - } - - @Override - public int hashCode() { - return Objects.hashCode(start, end); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null || getClass() != obj.getClass()) - return false; - AllocationPool that = AllocationPool.class.cast(obj); - return Objects.equal(this.start, that.start) && Objects.equal(this.end, that.end); - } - - protected MoreObjects.ToStringHelper string() { - return MoreObjects.toStringHelper(this).add("start", start).add("end", end); - } - - @Override - public String toString() { - return string().toString(); - } - - /** - * @return the Builder for AllocationPool - */ - public static Builder builder() { - return new Builder(); - } - - /** - * Gets a Builder configured as this object. - */ - public Builder toBuilder() { - return new Builder().fromAllocationPool(this); - } - - public static class Builder { - protected String start; - protected String end; - - /** - * Provide the start to the AllocationPool's Builder. - * - * @return the Builder. - * @see AllocationPool#getStart() - */ - public Builder start(String start) { - this.start = start; - return this; - } - - /** - * Provide the end to the AllocationPool's Builder. - * - * @return the Builder. - * @see AllocationPool#getEnd() - */ - public Builder end(String end) { - this.end = end; - return this; - } - - /** - * @return a AllocationPool constructed with this Builder. - */ - public AllocationPool build() { - return new AllocationPool(start, end); - } - - /** - * @return a Builder from another AllocationPool. - */ - public Builder fromAllocationPool(AllocationPool in) { - return this.start(in.getStart()).end(in.getEnd()); - } - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/35142182/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/CreateFirewall.java ---------------------------------------------------------------------- diff --git a/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/CreateFirewall.java b/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/CreateFirewall.java deleted file mode 100644 index 9c65419..0000000 --- a/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/CreateFirewall.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * 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.openstack.neutron.v2.domain; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.json.SerializedNames; - -import com.google.auto.value.AutoValue; - -/** - * Representation of creation options for an OpenStack Neutron Firewall. - * - * @see <a - * href="http://docs.openstack.org/admin-guide-cloud/content/fwaas_api_abstractions.html">api - * doc</a> - */ -@AutoValue -public abstract class CreateFirewall { - - /** - * @see Builder#tenantId(String) - */ - @Nullable public abstract String getTenantId(); - - /** - * @see Builder#name(String) - */ - @Nullable public abstract String getName(); - - /** - * @see Builder#description(String) - */ - @Nullable public abstract String getDescription(); - - /** - * @see Builder#adminStateUp(Boolean) - */ - @Nullable public abstract Boolean getAdminStateUp(); - - /** - * @see Builder#firewallPolicyId(String) - */ - @Nullable public abstract String getFirewallPolicyId(); - - @SerializedNames({ "tenant_id", "name", "description", "admin_state_up", "firewall_policy_id"}) - public static CreateFirewall create(String tenantId, String name, String description, Boolean adminStateUp, String firewallPolicyId) { - return builder().tenantId(tenantId).name(name).description(description).adminStateUp(adminStateUp) - .firewallPolicyId(firewallPolicyId).build(); - } - - public static Builder builder() { - return new AutoValue_CreateFirewall.Builder(); - } - - public abstract Builder toBuilder(); - - @AutoValue.Builder - public abstract static class Builder { - - /** - * - * @param tenantId Owner of the firewall. Only admin users can specify a tenant_id other than its own. - * @return The CreateFirewall builder. - */ - public abstract Builder tenantId(String tenantId); - - /** - * - * @param name Human readable name for the firewall (255 characters limit). - * @return The CreateFirewall builder. - */ - public abstract Builder name(String name); - - /** - * - * @param description Human readable description for the firewall (1024 characters limit). - * @return The CreateFirewall builder. - */ - public abstract Builder description(String description); - - /** - * - * @param adminStateUp The administrative state of the firewall. If False (down), the firewall does not forward any packets. - * @return The CreateFirewall builder. - */ - public abstract Builder adminStateUp(Boolean adminStateUp); - - /** - * - * @param firewallPolicyId The firewall policy uuid that this firewall is associated with. This firewall implements the rules contained in the - * firewall policy represented by this uuid. - * - * @return The CreateFirewall builder. - */ - public abstract Builder firewallPolicyId(String firewallPolicyId); - - @Nullable public abstract String getTenantId(); - @Nullable public abstract String getName(); - @Nullable public abstract String getDescription(); - @Nullable public abstract Boolean getAdminStateUp(); - @Nullable public abstract String getFirewallPolicyId(); - - public abstract CreateFirewall build(); - } - -} http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/35142182/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/CreateFirewallPolicy.java ---------------------------------------------------------------------- diff --git a/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/CreateFirewallPolicy.java b/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/CreateFirewallPolicy.java deleted file mode 100644 index 6418c0d..0000000 --- a/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/CreateFirewallPolicy.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * 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.openstack.neutron.v2.domain; - -import java.util.List; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.json.SerializedNames; - -import com.google.auto.value.AutoValue; -import com.google.common.collect.ImmutableList; - -/** - * Representation of creation options for an OpenStack Neutron Firewall Policy. - * - * @see <a - * href="http://docs.openstack.org/admin-guide-cloud/content/fwaas_api_abstractions.html">api - * doc</a> - */ -@AutoValue -public abstract class CreateFirewallPolicy { - - /** - * @see Builder#tenantId(String) - */ - @Nullable public abstract String getTenantId(); - - /** - * @see Builder#name(String) - */ - @Nullable public abstract String getName(); - - /** - * @see Builder#description(String) - */ - @Nullable public abstract String getDescription(); - - /** - * @see Builder#shared(Boolean) - */ - @Nullable public abstract Boolean getShared(); - - /** - * @see Builder#firewallRules(java.util.List) - */ - @Nullable public abstract List<String> getFirewallRules(); - - /** - * @see Builder#audited(Boolean) - */ - @Nullable public abstract Boolean getAudited(); - - @SerializedNames({"tenant_id", "name", "description", "shared", "firewall_rules", "audited"}) - private static CreateFirewallPolicy create(String tenantId, String name, String description, Boolean shared, List<String> firewallRules, Boolean audited) { - return builder().tenantId(tenantId).name(name).description(description).shared(shared).firewallRules(firewallRules).audited(audited).build(); - } - - public static Builder builder() { - return new AutoValue_CreateFirewallPolicy.Builder().shared(false).audited(false); - } - - public abstract Builder toBuilder(); - - @AutoValue.Builder - public abstract static class Builder { - - /** - * - * @param tenantId Owner of the firewall. Only admin users can specify a tenant_id other than its own. - * @return The CreateFirewallPolicy builder. - */ - public abstract Builder tenantId(String tenantId); - - /** - * - * @param name Human readable name for the firewall (255 characters limit). - * @return The CreateFirewallPolicy builder. - */ - public abstract Builder name(String name); - - /** - * - * @param description Human readable description for the firewall (1024 characters limit). - * @return The CreateFirewallPolicy builder. - */ - public abstract Builder description(String description); - - /** - * - * @param shared When set to True makes this firewall policy visible to tenants other than its owner and - * can be used to associate with firewalls not owned by its tenant. - * @return The CreateFirewallPolicy builder. - */ - public abstract Builder shared(Boolean shared); - - /** - * - * @param firewallRules This is an ordered list of firewall rule uuids. - * The firewall applies the rules in the order in which they appear in this list. - * @return The CreateFirewallPolicy builder. - */ - public abstract Builder firewallRules(List<String> firewallRules); - - /** - * - * @param audited When set to True by the policy owner indicates that the firewall policy has been audited. This attribute is meant to aid in the - * firewall policy audit work flows. Each time the firewall policy or the associated firewall rules are changed, this attribute is set - * to False and must be explicitly set to True through an update operation. - * @return The CreateFirewallPolicy builder. - */ - public abstract Builder audited(Boolean audited); - - @Nullable public abstract String getTenantId(); - @Nullable public abstract String getName(); - @Nullable public abstract String getDescription(); - @Nullable public abstract Boolean getShared(); - @Nullable public abstract List<String> getFirewallRules(); - @Nullable public abstract Boolean getAudited(); - - abstract CreateFirewallPolicy autoBuild(); - - public CreateFirewallPolicy build() { - firewallRules(getFirewallRules() != null ? ImmutableList.copyOf(getFirewallRules()) : ImmutableList.<String>of()); - return autoBuild(); - } - } - -} http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/35142182/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/CreateFirewallRule.java ---------------------------------------------------------------------- diff --git a/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/CreateFirewallRule.java b/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/CreateFirewallRule.java deleted file mode 100644 index 0e7bdbe..0000000 --- a/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/CreateFirewallRule.java +++ /dev/null @@ -1,231 +0,0 @@ -/* - * 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.openstack.neutron.v2.domain; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.json.SerializedNames; - -import com.google.auto.value.AutoValue; - -/** - * Representation of creation options for an OpenStack Neutron Firewall Rule. - * - * @see <a - * href="http://docs.openstack.org/admin-guide-cloud/content/fwaas_api_abstractions.html">api - * doc</a> - */ -@AutoValue -public abstract class CreateFirewallRule { - - /** - * @see Builder#tenantId(String) - */ - @Nullable public abstract String getTenantId(); - /** - * @see Builder#name(String) - */ - @Nullable public abstract String getName(); - /** - * @see Builder#description(String) - */ - @Nullable public abstract String getDescription(); - /** - * @see Builder#firewallPolicyId(String) - */ - @Nullable public abstract String getFirewallPolicyId(); - /** - * @see Builder#shared(Boolean) - */ - @Nullable public abstract Boolean getShared(); - /** - * @see Builder#protocol(String) - */ - @Nullable public abstract String getProtocol(); - /** - * @see Builder#ipVersion(IpVersion) - */ - @Nullable public abstract IpVersion getIpVersion(); - /** - * @see Builder#sourceIpAddress(String) - */ - @Nullable public abstract String getSourceIpAddress(); - /** - * @see Builder#destinationIpAddress(String) - */ - @Nullable public abstract String getDestinationIpAddress(); - /** - * @see Builder#sourcePort(String) - */ - @Nullable public abstract String getSourcePort(); - /** - * @see Builder#destinationPort(String) - */ - @Nullable public abstract String getDestinationPort(); - /** - * see Builder#position(Integer) - */ - @Nullable public abstract Integer getPosition(); - /** - * @see Builder#action(String) - */ - @Nullable public abstract String getAction(); - /** - * @see Builder#enabled(Boolean) - */ - @Nullable public abstract Boolean getEnabled(); - - @SerializedNames({ "tenant_id", "name", "description", "firewall_policy_id", "shared", "protocol", "ip_version", "source_ip_address", - "destination_ip_address", "source_port", "destination_port", "position", "action", "enabled"}) - public static CreateFirewallRule create(String tenantId, String name, String description, String firewallPolicyId, Boolean shared, String protocol, - IpVersion ipVersion, String sourceIpAddress, String destinationIpAddress, String sourcePort, String destinationPort, int position, - String action, Boolean enabled) { - return builder().tenantId(tenantId).name(name).description(description).firewallPolicyId(firewallPolicyId).shared(shared) - .protocol(protocol).ipVersion(ipVersion).sourceIpAddress(sourceIpAddress).destinationIpAddress(destinationIpAddress).sourcePort(sourcePort) - .destinationPort(destinationPort).position(position).action(action).enabled(enabled).build(); - } - - public static Builder builder() { - return new AutoValue_CreateFirewallRule.Builder(); - } - - public abstract Builder toBuilder(); - - @AutoValue.Builder - public abstract static class Builder { - - /** - * - * @param tenantId Owner of the firewall. Only admin users can specify a tenant_id other than its own. - * @return The CreateFirewallRule builder. - */ - public abstract Builder tenantId(String tenantId); - - /** - * - * @param name Human readable name for the firewall (255 characters limit). - * @return The CreateFirewallRule builder. - */ - public abstract Builder name(String name); - - /** - * - * @param description Human readable description for the firewall (1024 characters limit). - * @return The CreateFirewallRule builder. - */ - public abstract Builder description(String description); - - /** - * - * @param shared When set to True makes this firewall policy visible to tenants other than its owner and - * can be used to associate with firewalls not owned by its tenant. - * @return The CreateFirewallRule builder. - */ - public abstract Builder shared(Boolean shared); - - /** - * - * @param firewallPolicyId This is a read-only attribute that gets populated with the uuid of the firewall policy when this firewall rule is associated - * with a firewall policy. A firewall rule can be associated with only one firewall policy at a time. However, the association - * can be changed to a different firewall policy. - * @return The CreateFirewallRule builder. - */ - public abstract Builder firewallPolicyId(String firewallPolicyId); - - /** - * - * @param protocol IP protocol (icmp, tcp, udp, None). - * @return The CreateFirewallRule builder. - */ - public abstract Builder protocol(String protocol); - - /** - * - * @param ipVersion IP version (4, 6). - * @return The CreateFirewallRule builder. - */ - public abstract Builder ipVersion(IpVersion ipVersion); - - /** - * - * @param sourceIpAddress Source IP address or CIDR. - * @return The CreateFirewallRule builder. - */ - public abstract Builder sourceIpAddress(String sourceIpAddress); - - /** - * - * @param destinationIpAddress Destination IP address or CIDR. - * @return The CreateFirewallRule builder. - */ - public abstract Builder destinationIpAddress(String destinationIpAddress); - - /** - * - * @param sourcePort Source port number or a range. - * @return The CreateFirewallRule builder. - */ - public abstract Builder sourcePort(String sourcePort); - - /** - * - * @param destinationPort Destination port number or a range. - * @return The CreateFirewallRule builder. - */ - public abstract Builder destinationPort(String destinationPort); - - /** - * - * @param position This is a read-only attribute that gets assigned to this rule when the rule is associated with a firewall policy. It indicates the - * position of this rule in that firewall policy. - * @return The CreateFirewallRule builder. - */ - public abstract Builder position(Integer position); - - /** - * - * @param action Action to be performed on the traffic matching the rule (allow, deny). - * @return The CreateFirewallRule builder. - */ - public abstract Builder action(String action); - - /** - * - * @param enabled When set to False, disables this rule in the firewall policy. Facilitates selectively turning off rules without having to - * disassociate the rule from the firewall policy. - * @return The CreateFirewallRule builder. - */ - public abstract Builder enabled(Boolean enabled); - - @Nullable public abstract String getTenantId(); - @Nullable public abstract String getName(); - @Nullable public abstract String getDescription(); - @Nullable public abstract Boolean getShared(); - @Nullable public abstract String getFirewallPolicyId(); - @Nullable public abstract String getProtocol(); - @Nullable public abstract IpVersion getIpVersion(); - @Nullable public abstract String getSourceIpAddress(); - @Nullable public abstract String getDestinationIpAddress(); - @Nullable public abstract String getSourcePort(); - @Nullable public abstract String getDestinationPort(); - @Nullable public abstract Integer getPosition(); - @Nullable public abstract String getAction(); - @Nullable public abstract Boolean getEnabled(); - - public abstract CreateFirewallRule build(); - } - -} http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/35142182/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/ExternalGatewayInfo.java ---------------------------------------------------------------------- diff --git a/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/ExternalGatewayInfo.java b/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/ExternalGatewayInfo.java deleted file mode 100644 index dd89a2f..0000000 --- a/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/ExternalGatewayInfo.java +++ /dev/null @@ -1,140 +0,0 @@ -/* - * 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.openstack.neutron.v2.domain; - -import java.beans.ConstructorProperties; - -import javax.inject.Named; - -import org.jclouds.javax.annotation.Nullable; - -import com.google.common.base.MoreObjects; -import com.google.common.base.Objects; - -/** - * Information on the external gateway for the router - */ -public class ExternalGatewayInfo { - - @Named("network_id") - protected final String networkId; - @Named("enable_snat") - protected final Boolean enableSnat; - - @ConstructorProperties({"network_id", "enable_snat"}) - protected ExternalGatewayInfo(String networkId, Boolean enableSnat) { - this.networkId = networkId; - this.enableSnat = enableSnat; - } - - /** - * @return the networkId of the ExternalGatewayInfo - */ - @Nullable - public String getNetworkId() { - return networkId; - } - - /** - * @return the enableSnat status of the ExternalGatewayInfo - */ - @Nullable - public Boolean getEnableSnat() { - return enableSnat; - } - - @Override - public int hashCode() { - return Objects.hashCode(networkId, enableSnat); - } - - @Override - public boolean equals(Object o) { - if (this == o) - return true; - if (o == null || getClass() != o.getClass()) - return false; - - ExternalGatewayInfo that = (ExternalGatewayInfo) o; - - return Objects.equal(this.networkId, that.networkId) && - Objects.equal(this.enableSnat, that.enableSnat); - } - - /** - * @return the Builder for ExternalGatewayInfo - */ - public static Builder builder() { - return new Builder(); - } - - /** - * Gets a Builder configured as this object. - */ - public Builder toBuilder() { - return new Builder().fromExternalGatewayInfo(this); - } - - @Override - public String toString() { - return MoreObjects.toStringHelper(this) - .add("networkId", networkId) - .add("enableSnat", enableSnat) - .toString(); - } - - public static class Builder { - protected String networkId; - protected Boolean enableSnat; - - /** - * Provide the networkId to the ExternalGatewayInfo's Builder. - * - * @return the Builder. - * @see ExternalGatewayInfo#getNetworkId() - */ - public Builder networkId(String networkId) { - this.networkId = networkId; - return this; - } - - /** - * Provide the enableSnat status to the ExternalGatewayInfo's Builder. - * - * @return the Builder. - * @see ExternalGatewayInfo#getEnableSnat() - */ - public Builder enableSnat(Boolean enableSnat) { - this.enableSnat = enableSnat; - return this; - } - - /** - * @return a ExternalGatewayInfo constructed with this Builder. - */ - public ExternalGatewayInfo build() { - return new ExternalGatewayInfo(networkId, enableSnat); - } - - /** - * @return a Builder from another ExternalGatewayInfo. - */ - public Builder fromExternalGatewayInfo(ExternalGatewayInfo in) { - return this.networkId(in.getNetworkId()).enableSnat(in.getEnableSnat()); - } - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/35142182/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/ExtraDhcpOption.java ---------------------------------------------------------------------- diff --git a/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/ExtraDhcpOption.java b/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/ExtraDhcpOption.java deleted file mode 100644 index 3cfe064..0000000 --- a/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/ExtraDhcpOption.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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.openstack.neutron.v2.domain; - -import java.beans.ConstructorProperties; - -import javax.inject.Named; - -import org.jclouds.javax.annotation.Nullable; - -import com.google.common.base.MoreObjects; -import com.google.common.base.Objects; - -/** - * This is used to provide additional DHCP-related options to Subnet. This is - * based on a neutron extension. - * For example PXE boot options to DHCP clients can be specified (e.g. tftp-server, - * server-ip-address, bootfile-name) - * - * @see <a - * href="http://docs.openstack.org/api/openstack-network/2.0/content/Subnets.html">api - * doc</a> - */ -public class ExtraDhcpOption { - - protected final String id; - @Named("opt_name") - protected final String optionName; - @Named("opt_value") - protected final String optionValue; - - @ConstructorProperties({"id", "opt_name", "opt_value"}) - protected ExtraDhcpOption(String id, String optionName, String optionValue) { - this.id = id; - this.optionName = optionName; - this.optionValue = optionValue; - } - - /** - * @return the id of the ExtraDhcpOption - */ - @Nullable - public String getId() { - return id; - } - - /** - * @return the optionName of the ExtraDhcpOption - */ - @Nullable - public String getOptionName() { - return optionName; - } - - /** - * @return the optionValue of the ExtraDhcpOption - */ - @Nullable - public String getOptionValue() { - return optionValue; - } - - @Override - public int hashCode() { - return Objects.hashCode(id, optionName, optionValue); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null || getClass() != obj.getClass()) - return false; - ExtraDhcpOption that = ExtraDhcpOption.class.cast(obj); - return Objects.equal(this.id, that.id) && Objects.equal(this.optionName, that.optionName) - && Objects.equal(this.optionValue, that.optionValue); - } - - protected MoreObjects.ToStringHelper string() { - return MoreObjects.toStringHelper(this).add("id", id).add("optionName", optionName).add("optionValue", optionValue); - } - - @Override - public String toString() { - return string().toString(); - } - - /** - * @return the Builder for ExtraDhcpOption - */ - public static Builder builder() { - return new Builder(); - } - - /** - * Gets a Builder configured as this object. - */ - public Builder toBuilder() { - return new Builder().fromExtraDhcpOption(this); - } - - public static class Builder { - protected String id; - protected String optionName; - protected String optionValue; - - /** - * Provide the id to the ExtraDhcpOption's Builder. - * - * @return the Builder. - * @see ExtraDhcpOption#getId() - */ - public Builder id(String id) { - this.id = id; - return this; - } - - /** - * Provide the optionName to the ExtraDhcpOption's Builder. - * - * @return the Builder. - * @see ExtraDhcpOption#getOptionName() - */ - public Builder optionName(String optionName) { - this.optionName = optionName; - return this; - } - - /** - * Provide the optionValue to the ExtraDhcpOption's Builder. - * - * @return the Builder. - * @see ExtraDhcpOption#getOptionValue() - */ - public Builder optionValue(String optionValue) { - this.optionValue = optionValue; - return this; - } - - /** - * @return a ExtraDhcpOption constructed with this Builder. - */ - public ExtraDhcpOption build() { - return new ExtraDhcpOption(id, optionName, optionValue); - } - - /** - * @return a Builder from another ExtraDhcpOption. - */ - public Builder fromExtraDhcpOption(ExtraDhcpOption in) { - return this.id(in.getId()).optionName(in.getOptionName()).optionValue(in.getOptionValue()); - } - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/35142182/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/Firewall.java ---------------------------------------------------------------------- diff --git a/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/Firewall.java b/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/Firewall.java deleted file mode 100644 index e9e8e6e..0000000 --- a/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/Firewall.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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.openstack.neutron.v2.domain; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.json.SerializedNames; - -import com.google.auto.value.AutoValue; - -/** - * A Firewall - * - * @see <a - * href="http://docs.openstack.org/admin-guide-cloud/content/fwaas_api_abstractions.html">api - * doc</a> - */ -@AutoValue -public abstract class Firewall { - - public abstract String getId(); - public abstract String getTenantId(); - @Nullable public abstract String getName(); - @Nullable public abstract String getDescription(); - @Nullable public abstract Boolean isAdminStateUp(); - public abstract String getStatus(); - @Nullable public abstract String getFirewallPolicyId(); - - @SerializedNames({"id", "tenant_id", "name", "description", "admin_state_up", "status", "firewall_policy_id"}) - public static Firewall create(String id, String tenantId, String name, String description, Boolean adminStateUp, String status, String firewallPolicyId) { - return new AutoValue_Firewall(id, tenantId, name, description, adminStateUp, status, firewallPolicyId); - } - -} http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/35142182/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/FirewallPolicies.java ---------------------------------------------------------------------- diff --git a/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/FirewallPolicies.java b/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/FirewallPolicies.java deleted file mode 100644 index 1dbf429..0000000 --- a/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/FirewallPolicies.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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.openstack.neutron.v2.domain; - -import java.beans.ConstructorProperties; - -import org.jclouds.openstack.v2_0.domain.Link; -import org.jclouds.openstack.v2_0.domain.PaginatedCollection; - -import com.google.common.collect.ImmutableSet; - -/** - * A collection of FirewallPolicies - */ -public class FirewallPolicies extends PaginatedCollection<FirewallPolicy> { - public static final FirewallPolicies EMPTY = new FirewallPolicies(ImmutableSet.<FirewallPolicy> of(), ImmutableSet.<Link> of()); - - @ConstructorProperties({"firewall_policies", "firewall_policies_links"}) - protected FirewallPolicies(Iterable<FirewallPolicy> firewallPolicies, Iterable<Link> firewallPoliciesLinks) { - super(firewallPolicies, firewallPoliciesLinks); - } -} http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/35142182/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/FirewallPolicy.java ---------------------------------------------------------------------- diff --git a/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/FirewallPolicy.java b/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/FirewallPolicy.java deleted file mode 100644 index d0f2fec..0000000 --- a/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/FirewallPolicy.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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.openstack.neutron.v2.domain; - -import java.util.List; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.json.SerializedNames; - -import com.google.auto.value.AutoValue; - -/** - * A firewall policy - * - * @see <a - * href="http://docs.openstack.org/admin-guide-cloud/content/fwaas_api_abstractions.html">api doc</a> - */ -@AutoValue -public abstract class FirewallPolicy { - - public abstract String getId(); - public abstract String getTenantId(); - public abstract String getName(); - @Nullable public abstract String getDescription(); - public abstract boolean isShared(); - @Nullable public abstract List<String> getFirewallRules(); - public abstract boolean isAudited(); - - @SerializedNames({"id", "tenant_id", "name", "description", "shared", "firewall_rules", "audited"}) - private static FirewallPolicy create(String id, String tenantId, String name, String description, boolean shared, List<String> firewallRules, boolean audited) { - return new AutoValue_FirewallPolicy(id, tenantId, name, description, shared, firewallRules, audited); - } - -} http://git-wip-us.apache.org/repos/asf/jclouds-labs-openstack/blob/35142182/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/FirewallRule.java ---------------------------------------------------------------------- diff --git a/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/FirewallRule.java b/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/FirewallRule.java deleted file mode 100644 index 0bc23de..0000000 --- a/openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/FirewallRule.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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.openstack.neutron.v2.domain; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.json.SerializedNames; - -import com.google.auto.value.AutoValue; - -@AutoValue -public abstract class FirewallRule { - - public abstract String getId(); - public abstract String getTenantId(); - public abstract String getName(); - @Nullable public abstract String getDescription(); - @Nullable public abstract String getFirewallPolicyId(); - public abstract boolean isShared(); - @Nullable public abstract String getProtocol(); - @Nullable public abstract IpVersion getIpVersion(); - @Nullable public abstract String getSourceIpAddress(); - @Nullable public abstract String getDestinationIpAddress(); - @Nullable public abstract String getSourcePort(); - @Nullable public abstract String getDestinationPort(); - @Nullable public abstract Integer getPosition(); // for AutoValue.builder - @Nullable public abstract String getAction(); - public abstract boolean isEnabled(); - - @SerializedNames({"id", "tenant_id", "name", "description", "firewall_policy_id", "shared", "protocol", "ip_version", "source_ip_address", - "destination_ip_address", "source_port", "destination_port", "position", "action", "enabled"}) - public static FirewallRule create(String id, String tenantId, String name, String description, String firewallPolicyId, boolean shared, String protocol, - IpVersion ipVersion, String sourceIpAddress, String destinationIpAddress, String sourcePort, String destinationPort, int position, - String action, boolean enabled) { - return new AutoValue_FirewallRule(id, tenantId, name, description, firewallPolicyId, shared, protocol, ipVersion, sourceIpAddress, - destinationIpAddress, sourcePort, destinationPort, position, action, enabled); - } - -}
