Re: [jclouds-labs-openstack] OS Neutron Extension Router (#47)

2014-02-04 Thread Everett Toews
I ran all of the LiveTests and everything is running 100%. I used the command mvn -Plive -Dtest.openstack-neutron.endpoint=http://xxx.xxx.xxx.xxx:5000/v2.0/ -Dtest.openstack-neutron.identity=admin:admin -Dtest.openstack-neutron.credential=devstack clean install What's left to be done on

Re: [jclouds-labs-openstack] OS Neutron Extension Router (#47)

2014-02-04 Thread Andrew Phillips
+ } + + @Override + public boolean equals(Object obj) { + if (this == obj) return true; + if (obj == null || getClass() != obj.getClass()) return false; + Router that = Router.class.cast(obj); + return super.equals(obj) + Objects.equal(this.adminStateUp,

Re: [jclouds-labs-openstack] OS Neutron Extension Router (#47)

2014-02-04 Thread Andrew Phillips
+ * + * @author Nick Livens + * @see a href= + * http://docs.openstack.org/api/openstack-network/2.0/content/router_ext.html;api doc/a + */ +@Path(/v2.0/routers) +@RequestFilters(AuthenticateRequest.class) +@Consumes(MediaType.APPLICATION_JSON) +public interface RouterApi { + +

Re: [jclouds-labs-openstack] OS Neutron Extension Router (#47)

2014-02-04 Thread Andrew Phillips
@@ -116,6 +122,7 @@ @Path(/{id}) @SelectJson(subnet) @Fallback(Fallbacks.NullOnNotFoundOr404.class) + @Nullable Subnet get(@PathParam(id) String id); [minor] I think we tend to put `@Nullable` on the same line as the object, i.e. ``` @Fallback(... @Nullable Subnet get(...

Re: [jclouds-labs-openstack] OS Neutron Extension Router (#47)

2013-12-03 Thread Andrew Phillips
+ authenticatedGET().endpoint(endpoint + /routers).addQueryParam(fields, id, tenant_id, name).build(), + HttpResponse.builder().statusCode(200).payload(payloadFromResourceWithContentType(/list_routers.json, APPLICATION_JSON)).build()) +

Re: [jclouds-labs-openstack] OS Neutron Extension Router (#47)

2013-12-02 Thread Kris Sterckx
+ authenticatedGET().endpoint(endpoint + /routers).addQueryParam(fields, id, tenant_id, name).build(), + HttpResponse.builder().statusCode(200).payload(payloadFromResourceWithContentType(/list_routers.json, APPLICATION_JSON)).build()) +

Re: [jclouds-labs-openstack] OS Neutron Extension Router (#47)

2013-11-25 Thread Kris Sterckx
+* @return the list of all router references configured for the tenant. +*/ + @Named(router:list) + @GET + @ResponseParser(ParseRouters.class) + @Transform(ParseRouters.ToPagedIterable.class) + @Fallback(Fallbacks.EmptyPagedIterableOnNotFoundOr404.class) +

Re: [jclouds-labs-openstack] OS Neutron Extension Router (#47)

2013-11-25 Thread Kris Sterckx
+* Returns all routers currently defined in Neutron for the current tenant. +* +* @return the list of all routers configured for the tenant +*/ + @Named(router:list) + @GET + @ResponseParser(ParseRouterDetails.class) +

Re: [jclouds-labs-openstack] OS Neutron Extension Router (#47)

2013-11-25 Thread Kris Sterckx
+ + @Override + protected FunctionObject, IterableWithMarkerReferenceWithName markerToNextForArg0(OptionalObject arg0) { + String zone = arg0.isPresent() ? arg0.get().toString() : null; + final RouterApi routerApi = api.getRouterExtensionForZone(zone).get(); +

Re: [jclouds-labs-openstack] OS Neutron Extension Router (#47)

2013-11-25 Thread Kris Sterckx
assertTrue(subnetApi.delete(net.getId())); } assertTrue(networkApi.delete(networkId)); } } + + private PredicateSubnet createPredicate(final String subnetId) { See above comment --- Reply to this email directly or view it on GitHub:

Re: [jclouds-labs-openstack] OS Neutron Extension Router (#47)

2013-11-25 Thread Kris Sterckx
+ */ + public T state(State state) { + this.state = state; + return self(); + } + + /** + * @see Router#getExternalGatewayInfo() + */ + public T externalGatewayInfo(ExternalGatewayInfo externalGatewayInfo) { +

Re: [jclouds-labs-openstack] OS Neutron Extension Router (#47)

2013-11-25 Thread Kris Sterckx
+ } + + public Builder toBuilder() { + return new ConcreteBuilder().fromExternalGatewayInfo(this); + } + + public static abstract class Builder { + protected abstract Builder self(); + + protected String networkId; + + /** + * @see

Re: [jclouds-labs-openstack] OS Neutron Extension Router (#47)

2013-11-25 Thread Andrew Phillips
@@ -37,10 +37,7 @@ public String getValue() { } public static NetworkType fromValue(String value) { - for (NetworkType networkType : values()) { - if (networkType.getValue().equalsIgnoreCase(value)) -return networkType; - } - return null; +

Re: [jclouds-labs-openstack] OS Neutron Extension Router (#47)

2013-11-25 Thread Andrew Phillips
+ + /** +* Returns the list of all routers currently defined in Neutron for the current tenant. The list provides the unique +* identifier of each router configured for the tenant +* +* @return the list of all router references configured for the tenant. +*/ +

Re: [jclouds-labs-openstack] OS Neutron Extension Router (#47)

2013-11-25 Thread Andrew Phillips
+ + @Override + protected FunctionObject, IterableWithMarkerReferenceWithName markerToNextForArg0(OptionalObject arg0) { + String zone = arg0.isPresent() ? arg0.get().toString() : null; + final RouterApi routerApi = api.getRouterExtensionForZone(zone).get(); +

Re: [jclouds-labs-openstack] OS Neutron Extension Router (#47)

2013-11-25 Thread Andrew Phillips
Thanks for responding to the review comments, @KrisSterckx! --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs-openstack/pull/47#issuecomment-29208427

Re: [jclouds-labs-openstack] OS Neutron Extension Router (#47)

2013-11-25 Thread Andrew Phillips
@@ -29,7 +29,7 @@ * @author Nick Livens * @see a href=http://docs.openstack.org/api/openstack-network/2.0/content/Subnets.html;api doc/a */ -public class AllocationPool { +public final class AllocationPool { Ah, yes, I recall. Thanks for the reminder, @KrisSterckx! --- Reply to

Re: [jclouds-labs-openstack] OS Neutron Extension Router (#47)

2013-11-09 Thread Andrew Phillips
@@ -29,7 +29,7 @@ * @author Nick Livens * @see a href=http://docs.openstack.org/api/openstack-network/2.0/content/Subnets.html;api doc/a */ -public class AllocationPool { +public final class AllocationPool { Any reason for making this and the domain classes below final? This may

Re: [jclouds-labs-openstack] OS Neutron Extension Router (#47)

2013-11-09 Thread Andrew Phillips
+ } + + public Builder toBuilder() { + return new ConcreteBuilder().fromExternalGatewayInfo(this); + } + + public static abstract class Builder { + protected abstract Builder self(); + + protected String networkId; + + /** + * @see

Re: [jclouds-labs-openstack] OS Neutron Extension Router (#47)

2013-11-09 Thread Andrew Phillips
@@ -37,10 +37,7 @@ public String getValue() { } public static NetworkType fromValue(String value) { - for (NetworkType networkType : values()) { - if (networkType.getValue().equalsIgnoreCase(value)) -return networkType; - } - return null; +

Re: [jclouds-labs-openstack] OS Neutron Extension Router (#47)

2013-11-09 Thread Andrew Phillips
+ */ + public T state(State state) { + this.state = state; + return self(); + } + + /** + * @see Router#getExternalGatewayInfo() + */ + public T externalGatewayInfo(ExternalGatewayInfo externalGatewayInfo) { +

Re: [jclouds-labs-openstack] OS Neutron Extension Router (#47)

2013-11-09 Thread Andrew Phillips
+ + /** +* Returns the list of all routers currently defined in Neutron for the current tenant. The list provides the unique +* identifier of each router configured for the tenant +* +* @return the list of all router references configured for the tenant. +*/ +

Re: [jclouds-labs-openstack] OS Neutron Extension Router (#47)

2013-11-09 Thread Andrew Phillips
+ @Path(/{id}) + @SelectJson(router) + @Fallback(Fallbacks.NullOnNotFoundOr404.class) + Router get(@PathParam(id) String id); + + /** +* Create a new router +* +* @param options optional arguments +* @return the newly created router +*/ +

Re: [jclouds-labs-openstack] OS Neutron Extension Router (#47)

2013-11-09 Thread Andrew Phillips
+import java.beans.ConstructorProperties; + +import static com.google.common.base.Preconditions.checkNotNull; +import static org.jclouds.openstack.v2_0.options.PaginationOptions.Builder.marker; + +/** + * @author Nick Livens + */ +@Beta +@Singleton +public class ParseRouterDetails

Re: [jclouds-labs-openstack] OS Neutron Extension Router (#47)

2013-11-09 Thread Andrew Phillips
+ authenticatedGET().endpoint(endpoint + /routers).addQueryParam(fields, id, tenant_id, name).build(), + HttpResponse.builder().statusCode(200).payload(payloadFromResourceWithContentType(/list_routers.json, APPLICATION_JSON)).build()) +

Re: [jclouds-labs-openstack] OS Neutron Extension Router (#47)

2013-11-09 Thread Andrew Phillips
assertTrue(subnetApi.delete(net.getId())); } assertTrue(networkApi.delete(networkId)); } } + + private PredicateSubnet createPredicate(final String subnetId) { See above comment. And since we're using this in multiple places, move out to a