You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by Andrea Turli <no...@github.com> on 2015/06/30 19:59:23 UTC
[jclouds-labs-openstack] add FWaaS extension to openstack-neutron
(#196)
@zack-shoylev could you please review it?
I'd like to merge that on master and 1.9.x if you think it is ok
LiveTests are ok for me, but `removeFirewallRuleFromPolicy` as it seems that the [doc](https://docs.google.com/document/d/1PJaKvsX2MzMRlLGfR0fBkrMraHYF0flvl0sqyZ704tA/edit#) is not up-to-date
You can view, comment on, or merge this pull request online at:
https://github.com/jclouds/jclouds-labs-openstack/pull/196
-- Commit Summary --
* add FWaaS extension to openstack-neutron
-- File Changes --
M openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/NeutronApi.java (11)
A openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/Firewall.java (207)
A openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/FirewallPolicies.java (36)
A openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/FirewallPolicy.java (201)
A openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/FirewallRule.java (363)
A openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/FirewallRules.java (36)
A openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/domain/Firewalls.java (36)
M openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/extensions/ExtensionNamespaces.java (4)
A openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/extensions/FWaaSApi.java (250)
A openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/fallbacks/EmptyFirewallsFallback.java (38)
A openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/functions/FirewallPolicyToPagedIterable.java (63)
A openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/functions/FirewallRuleToPagedIterable.java (63)
A openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/functions/FirewallToPagedIterable.java (63)
A openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/functions/ParseFirewallPolicies.java (38)
A openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/functions/ParseFirewallRules.java (38)
A openstack-neutron/src/main/java/org/jclouds/openstack/neutron/v2/functions/ParseFirewalls.java (38)
A openstack-neutron/src/test/java/org/jclouds/openstack/neutron/v2/extensions/FWaaSApiLiveTest.java (192)
A openstack-neutron/src/test/java/org/jclouds/openstack/neutron/v2/extensions/FWaaSApiMockTest.java (978)
M openstack-neutron/src/test/java/org/jclouds/openstack/neutron/v2/extensions/SecurityGroupApiLiveTest.java (5)
M openstack-neutron/src/test/java/org/jclouds/openstack/neutron/v2/features/ExtensionApiMockTest.java (2)
M openstack-neutron/src/test/resources/extension_list.json (262)
A openstack-neutron/src/test/resources/firewall_create_request.json (6)
A openstack-neutron/src/test/resources/firewall_create_response.json (11)
A openstack-neutron/src/test/resources/firewall_get_response.json (11)
A openstack-neutron/src/test/resources/firewall_list_response.json (13)
A openstack-neutron/src/test/resources/firewall_policy_create_request.json (8)
A openstack-neutron/src/test/resources/firewall_policy_create_response.json (11)
A openstack-neutron/src/test/resources/firewall_policy_get_response.json (14)
A openstack-neutron/src/test/resources/firewall_policy_insert_rule_request.json (1)
A openstack-neutron/src/test/resources/firewall_policy_insert_rule_response.json (10)
A openstack-neutron/src/test/resources/firewall_policy_list_response.json (255)
A openstack-neutron/src/test/resources/firewall_rule_create_request.json (12)
A openstack-neutron/src/test/resources/firewall_rule_create_response.json (19)
A openstack-neutron/src/test/resources/firewall_rule_get_response.json (19)
A openstack-neutron/src/test/resources/firewall_rule_update_request.json (6)
A openstack-neutron/src/test/resources/firewall_rule_update_response.json (19)
A openstack-neutron/src/test/resources/firewall_update_request.json (5)
A openstack-neutron/src/test/resources/firewall_update_response.json (11)
M openstack-neutron/src/test/resources/logback.xml (43)
-- Patch Links --
https://github.com/jclouds/jclouds-labs-openstack/pull/196.patch
https://github.com/jclouds/jclouds-labs-openstack/pull/196.diff
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/196
Re: [jclouds-labs-openstack] add FWaaS extension to openstack-neutron
(#196)
Posted by Zack Shoylev <no...@github.com>.
> +
> +/**
> + * 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 {
> +
> + @Nullable
> + public abstract String getId();
> + @Nullable public abstract String getTenantId();
> + @Nullable public abstract String getName();
> + @Nullable public abstract String getDescription();
> + public abstract boolean isShared();
@Nullable Boolean?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/196/files#r33672026
Re: [jclouds-labs-openstack] add FWaaS extension to openstack-neutron
(#196)
Posted by Zack Shoylev <no...@github.com>.
Closed #196.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/196#event-346826522
Re: [jclouds-labs-openstack] add FWaaS extension to openstack-neutron
(#196)
Posted by Andrea Turli <no...@github.com>.
> +
> +/**
> + * 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 {
> +
> + @Nullable
> + public abstract String getId();
> + @Nullable public abstract String getTenantId();
> + @Nullable public abstract String getName();
> + @Nullable public abstract String getDescription();
> + public abstract boolean isShared();
I think I've managed required shared parameter at line 57
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/196/files#r33690872
Re: [jclouds-labs-openstack] add FWaaS extension to openstack-neutron
(#196)
Posted by Zack Shoylev <no...@github.com>.
> +
> + @Named("firewall:insertFirewallRuleToPolicy")
> + @PUT
> + @Path("/firewall_policies/{id}/insert_rule")
> + @Fallback(NullOnNotFoundOr404.class)
> + @Nullable
> + FirewallPolicy insertFirewallRuleToPolicy(@PathParam("id") String policyId, @WrapWith("firewall_rule_id") String firewallRuleId);
> +
> + @Named("firewall:removeFirewallRuleFromPolicy")
> + @DELETE
> + @Path("/firewall_policies/{id}/remove_rule")
> + @Fallback(NullOnNotFoundOr404.class)
> + @Nullable
> + FirewallPolicy removeFirewallRuleFromPolicy(@PathParam("id") String policyId, @WrapWith("firewall_rule_id") String firewallRuleId);
> +
> +
Extra line
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/196/files#r33672509
Re: [jclouds-labs-openstack] add FWaaS extension to openstack-neutron
(#196)
Posted by Zack Shoylev <no...@github.com>.
Thanks @andreaturli ; looking pretty good
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/196#issuecomment-117638687
Re: [jclouds-labs-openstack] add FWaaS extension to openstack-neutron
(#196)
Posted by Zack Shoylev <no...@github.com>.
> + @SelectJson("firewall")
> + @Fallback(NullOnNotFoundOr404.class)
> + @Nullable
> + Firewall get(@PathParam("id") String id);
> +
> + /**
> + * Create a new firewall
> + *
> + * @param firewall Options for creating a firewall
> + * @return the newly created firewall
> + */
> + @Named("firewall:create")
> + @POST
> + @SelectJson("firewall")
> + @Path("/firewalls")
> + Firewall create(@WrapWith("firewall") Firewall firewall);
While this is possible and very simple/effective, it is discouraged. The preferred way to do this might be
```
Firewall create(@WrapWith("firewall") CreateFirewall firewall);
```
Basically, we should provide slightly different CreateFirewall and UpdateFirewall classes - for example, they don't support specifying IDs or other parameters that are strictly determined by the service (another example is Status).
There is some repetition, yes, but we have autovalue to take care of that.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/196/files#r33672426
Re: [jclouds-labs-openstack] add FWaaS extension to openstack-neutron
(#196)
Posted by Andrea Turli <no...@github.com>.
> + FirewallRule createFirewallRule(@WrapWith("firewall_rule") FirewallRule firewallRule);
> +
> + @Named("firewall:listFirewallRules")
> + @GET
> + @Transform(FirewallRuleToPagedIterable.class)
> + @ResponseParser(ParseFirewallRules.class)
> + @Fallback(EmptyPagedIterableOnNotFoundOr404.class)
> + @Path("/firewall_rules")
> + PagedIterable<FirewallRule> listFirewallRules();
> +
> + @Named("firewall:listFirewallRules")
> + @GET
> + @ResponseParser(ParseFirewallRules.class)
> + @Fallback(EmptyFirewallsFallback.class)
> + @Path("/firewall_rules")
> + FirewallRules listFirewallRules(PaginationOptions options);
thanks for the suggestion
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/196/files#r33611908
Re: [jclouds-labs-openstack] add FWaaS extension to openstack-neutron
(#196)
Posted by Zack Shoylev <no...@github.com>.
> + *
> + * 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;
> +
> +public class FirewallRule {
> +
> + public enum IpVersion {
Consider using a separate file for the enum. It will be more readable.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/196/files#r33606342
Re: [jclouds-labs-openstack] add FWaaS extension to openstack-neutron
(#196)
Posted by Andrea Turli <no...@github.com>.
Thanks @zack-shoylev
I've addressed your comments:
- I've added AutoValue for Firewall, FirewallPolicy and FirewallPolicyRule
- Add PaginatedCollection where possible
and some other minor fixes
Does it look better now?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/196#issuecomment-117343931
Re: [jclouds-labs-openstack] add FWaaS extension to openstack-neutron
(#196)
Posted by Zack Shoylev <no...@github.com>.
squashed, merged, backported
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/196#issuecomment-118152081
Re: [jclouds-labs-openstack] add FWaaS extension to openstack-neutron
(#196)
Posted by Zack Shoylev <no...@github.com>.
Another thing I overlooked - openstack-heat has the good up-to-date examples that I recently refactored.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/196#issuecomment-118010952
Re: [jclouds-labs-openstack] add FWaaS extension to openstack-neutron
(#196)
Posted by Zack Shoylev <no...@github.com>.
> +import org.jclouds.javax.annotation.Nullable;
> +import org.jclouds.json.SerializedNames;
> +
> +import com.google.auto.value.AutoValue;
> +import com.google.common.collect.ImmutableList;
> +
> +/**
> + * 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 {
> +
> + @Nullable
Formatting
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/196/files#r33672011
Re: [jclouds-labs-openstack] add FWaaS extension to openstack-neutron
(#196)
Posted by Andrea Turli <no...@github.com>.
I'd appreciate if you could merge it on both master and 1.9.x. Thanks!
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/196#issuecomment-118087862
Re: [jclouds-labs-openstack] add FWaaS extension to openstack-neutron
(#196)
Posted by Andrea Turli <no...@github.com>.
> + @SelectJson("firewall")
> + @Fallback(NullOnNotFoundOr404.class)
> + @Nullable
> + Firewall get(@PathParam("id") String id);
> +
> + /**
> + * Create a new firewall
> + *
> + * @param firewall Options for creating a firewall
> + * @return the newly created firewall
> + */
> + @Named("firewall:create")
> + @POST
> + @SelectJson("firewall")
> + @Path("/firewalls")
> + Firewall create(@WrapWith("firewall") Firewall firewall);
Are you thinking about something like `openstack-poppy's Service` and `openstack-poppy's CreateService` ? I'm not sure I like it but I think it is better than plain `Firewall`.
Maybe @nacx has another suggestion?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/196/files#r33693999
Re: [jclouds-labs-openstack] add FWaaS extension to openstack-neutron
(#196)
Posted by Zack Shoylev <no...@github.com>.
Also I think the getSomeName() getters were fine. Auto works fine with
getName()
and name(String name)/getName() in the builder, for example.
https://github.com/jclouds/jclouds-labs-openstack/blob/master/openstack-heat/src/main/java/org/jclouds/openstack/heat/v1/options/CreateStack.java
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/196#issuecomment-118011305
Re: [jclouds-labs-openstack] add FWaaS extension to openstack-neutron
(#196)
Posted by Andrea Turli <no...@github.com>.
> + @Named("firewall_policy_id")
> + private String firewallPolicyId;
> +
> + @ConstructorProperties({"id", "tenant_id", "name", "description", "admin_state_up",
> + "status", "firewall_policy_id"})
> + protected Firewall(String id, String tenantId, String name, String description, boolean adminStateUp, String status, String firewallPolicyId) {
> + this.id = id;
> + this.tenantId = tenantId;
> + this.name = name;
> + this.description = description;
> + this.adminStateUp = adminStateUp;
> + this.status = status;
> + this.firewallPolicyId = firewallPolicyId;
> + }
> +
> + private Firewall() {}
I think all of the domain objects need to be refactored with AutoValue. Do we want to start from these new ones?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/196/files#r33611812
Re: [jclouds-labs-openstack] add FWaaS extension to openstack-neutron
(#196)
Posted by Zack Shoylev <no...@github.com>.
> +public abstract class CreateFirewallPolicy {
> +
> + @Nullable public abstract String getTenantId();
> + @Nullable public abstract String getName();
> + @Nullable public abstract String getDescription();
> + public abstract boolean isShared();
> + @Nullable public abstract List<String> getFirewallRules();
> + public abstract boolean isAudited();
> +
> + @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();
Haven't tried it, but this might fix it:
```
return new AutoValue_CreateFirewallPolicy.Builder().shared(false).audited(false);
```
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/196/files#r33740843
Re: [jclouds-labs-openstack] add FWaaS extension to openstack-neutron
(#196)
Posted by Zack Shoylev <no...@github.com>.
> + */
> + 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);
> +
> + abstract CreateFirewall autoBuild();
> +
> + public CreateFirewall build() {
> + CreateFirewall createFirewall = autoBuild();
Eh, that's messy.
It might be better to implement the builder getters. That way users benefit from having them; and you benefit from being able to check validation before sending this to the service;
As an afterthought - I don't really like client-side validation of parameters as is done here. Let the service validate.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/196/files#r33775753
Re: [jclouds-labs-openstack] add FWaaS extension to openstack-neutron
(#196)
Posted by Andrea Turli <no...@github.com>.
> @@ -47,6 +48,10 @@ public void testCreateUpdateAndDeleteSecurityGroup() {
> try {
> sgApi = api.getSecurityGroupApi(region).get();
>
> + for (Subnet subnet : api.getSubnetApi(region).list().concat().toList()) {
> + System.out.println("subnet: " + subnet.getName());
ops, sorry about that
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/196/files#r33611891
Re: [jclouds-labs-openstack] add FWaaS extension to openstack-neutron
(#196)
Posted by Zack Shoylev <no...@github.com>.
> + @SelectJson("firewall")
> + @Fallback(NullOnNotFoundOr404.class)
> + @Nullable
> + Firewall get(@PathParam("id") String id);
> +
> + /**
> + * Create a new firewall
> + *
> + * @param firewall Options for creating a firewall
> + * @return the newly created firewall
> + */
> + @Named("firewall:create")
> + @POST
> + @SelectJson("firewall")
> + @Path("/firewalls")
> + Firewall create(@WrapWith("firewall") Firewall firewall);
That's exactly right - similar to poppy.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/196/files#r33694616
Re: [jclouds-labs-openstack] add FWaaS extension to openstack-neutron
(#196)
Posted by Zack Shoylev <no...@github.com>.
> + FirewallRule createFirewallRule(@WrapWith("firewall_rule") FirewallRule firewallRule);
> +
> + @Named("firewall:listFirewallRules")
> + @GET
> + @Transform(FirewallRuleToPagedIterable.class)
> + @ResponseParser(ParseFirewallRules.class)
> + @Fallback(EmptyPagedIterableOnNotFoundOr404.class)
> + @Path("/firewall_rules")
> + PagedIterable<FirewallRule> listFirewallRules();
> +
> + @Named("firewall:listFirewallRules")
> + @GET
> + @ResponseParser(ParseFirewallRules.class)
> + @Fallback(EmptyFirewallsFallback.class)
> + @Path("/firewall_rules")
> + FirewallRules listFirewallRules(PaginationOptions options);
Is it possible to switch this to using PaginatedCollection instead, similar to
https://github.com/jclouds/jclouds-labs-openstack/blob/master/openstack-poppy/src/main/java/org/jclouds/openstack/poppy/v1/features/ServiceApi.java#L92
That way, you should be able to eliminate the FirewallRules class, and might be able to aply to a few more classes.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/196/files#r33607219
Re: [jclouds-labs-openstack] add FWaaS extension to openstack-neutron
(#196)
Posted by Zack Shoylev <no...@github.com>.
> @@ -47,6 +48,10 @@ public void testCreateUpdateAndDeleteSecurityGroup() {
> try {
> sgApi = api.getSecurityGroupApi(region).get();
>
> + for (Subnet subnet : api.getSubnetApi(region).list().concat().toList()) {
> + System.out.println("subnet: " + subnet.getName());
?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/196/files#r33608701
Re: [jclouds-labs-openstack] add FWaaS extension to openstack-neutron
(#196)
Posted by Zack Shoylev <no...@github.com>.
> + @Nullable 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 builder().id(id).tenantId(tenantId).name(name).description(description).adminStateUp(adminStateUp).status(status).firewallPolicyId
> + (firewallPolicyId).build();
> + }
> +
> + public static Builder builder() {
> + return new AutoValue_Firewall.Builder();
> + }
> +
> + public abstract Builder toBuilder();
> +
> + @AutoValue.Builder
Only CreateFirewall and UpdateFirewall will need a builder, you can switch to a regular autovalue class here (with no builder).
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/196/files#r33740585
Re: [jclouds-labs-openstack] add FWaaS extension to openstack-neutron
(#196)
Posted by Andrea Turli <no...@github.com>.
thanks @zack-shoylev
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/196#issuecomment-118153386
Re: [jclouds-labs-openstack] add FWaaS extension to openstack-neutron
(#196)
Posted by Andrea Turli <no...@github.com>.
thanks @zack-shoylev for your help. For some reason, when using getSomeName() format the builder was not generated at all. I think we can solve this issue later on, as other domain objects need to be refactored with AutoValue, anyway. Wdyt?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/196#issuecomment-118012009
Re: [jclouds-labs-openstack] add FWaaS extension to openstack-neutron
(#196)
Posted by Zack Shoylev <no...@github.com>.
> +public abstract class CreateFirewallPolicy {
> +
> + @Nullable public abstract String getTenantId();
> + @Nullable public abstract String getName();
> + @Nullable public abstract String getDescription();
> + public abstract boolean isShared();
> + @Nullable public abstract List<String> getFirewallRules();
> + public abstract boolean isAudited();
> +
> + @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();
I am guessing your builder needs to have isShared and isAudited set to default values (false) here.
Also based on this:
http://docs.openstack.org/admin-guide-cloud/content/fwaas_api_abstractions.html
Please add the corresponding docs for the properties here and in other places as applicable.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/196/files#r33740521
Re: [jclouds-labs-openstack] add FWaaS extension to openstack-neutron
(#196)
Posted by Zack Shoylev <no...@github.com>.
> + * @see <a
> + * href="http://docs.openstack.org/admin-guide-cloud/content/fwaas_api_abstractions.html">api doc</a>
> + */
> +@AutoValue
> +public abstract class FirewallPolicy {
> +
> + @Nullable
> + public abstract String getId();
> + @Nullable public abstract String getTenantId();
> + @Nullable public abstract String getName();
> + @Nullable public abstract String getDescription();
> + public abstract boolean isShared();
> + @Nullable public abstract List<String> getFirewallRules();
> + public abstract boolean isAudited();
> +
> + FirewallPolicy() {
I don't think this is needed at all?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/196/files#r33671975
Re: [jclouds-labs-openstack] add FWaaS extension to openstack-neutron
(#196)
Posted by Zack Shoylev <no...@github.com>.
> + @Named("firewall_policy_id")
> + private String firewallPolicyId;
> +
> + @ConstructorProperties({"id", "tenant_id", "name", "description", "admin_state_up",
> + "status", "firewall_policy_id"})
> + protected Firewall(String id, String tenantId, String name, String description, boolean adminStateUp, String status, String firewallPolicyId) {
> + this.id = id;
> + this.tenantId = tenantId;
> + this.name = name;
> + this.description = description;
> + this.adminStateUp = adminStateUp;
> + this.status = status;
> + this.firewallPolicyId = firewallPolicyId;
> + }
> +
> + private Firewall() {}
Use autovalue with builders to eliminate most of the boilerplate.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/196/files#r33605218
Re: [jclouds-labs-openstack] add FWaaS extension to openstack-neutron
(#196)
Posted by Zack Shoylev <no...@github.com>.
That is strange. Sure, but maybe have a look and see it's not something else that's going wrong.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/196#issuecomment-118012210
Re: [jclouds-labs-openstack] add FWaaS extension to openstack-neutron
(#196)
Posted by Zack Shoylev <no...@github.com>.
> +
> +/**
> + * 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 {
> +
> + @Nullable
> + public abstract String getId();
> + @Nullable public abstract String getTenantId();
> + @Nullable public abstract String getName();
> + @Nullable public abstract String getDescription();
> + public abstract boolean isShared();
I see it, just wanted to make sure actually required by the service.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/196/files#r33695222
Re: [jclouds-labs-openstack] add FWaaS extension to openstack-neutron
(#196)
Posted by Andrea Turli <no...@github.com>.
@zack-shoylev thanks again. I think now the AutoValue classes are in a better shape
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/196#issuecomment-118087687
Re: [jclouds-labs-openstack] add FWaaS extension to openstack-neutron
(#196)
Posted by Zack Shoylev <no...@github.com>.
> +
> +/**
> + * 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 {
> +
> + @Nullable public abstract String getId();
> + @Nullable public abstract String getTenantId();
> + @Nullable public abstract String getName();
> + @Nullable public abstract String getDescription();
> + public abstract boolean isAdminStateUp();
Might want to consider using Boolean instead, if this is not a required parameter.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/196/files#r33671834