Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-11 Thread Zack Shoylev
Closed #179. --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs-openstack/pull/179#event-250395569

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-11 Thread Zack Shoylev
merged --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs-openstack/pull/179#issuecomment-78357174

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-11 Thread Zack Shoylev
Will merge when tests pass --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs-openstack/pull/179#issuecomment-78354993

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-11 Thread Zack Shoylev
Rebased changes to the original commit --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs-openstack/pull/179#issuecomment-78354886

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-11 Thread Zack Shoylev
Last round of sanity checks, then squash and merge. --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs-openstack/pull/179#issuecomment-78341462

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-11 Thread Everett Toews
:+1: --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs-openstack/pull/179#issuecomment-78336509

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-11 Thread Zack Shoylev
I have removed the dependency on auto 1.1 and will refactor back to builders once released. At this point I want mostly to make sure this makes it into 1.9.0 --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs-openstack/pull/179#issuecomment-78324705

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-10 Thread Zack Shoylev
I'm thinking snapshot is not updated yet. Will try to rebuild later - passes locally. --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs-openstack/pull/179#issuecomment-78173346

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-10 Thread Zack Shoylev
Applied changes made possible by https://github.com/jclouds/jclouds/pull/700 --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs-openstack/pull/179#issuecomment-78172270

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-10 Thread Zack Shoylev
> @@ -52,7 +53,7 @@ > @Consumes(MediaType.APPLICATION_JSON) > @Endpoint(CDN.class) > @RequestFilters(AuthenticateRequest.class) > - @Fallback(FalseOn500or503.class) > + @Fallback(PoppyFallbacks.FalseOn500or503orIOE.class) This PR still needs to be updated after https://github.com/

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-09 Thread Zack Shoylev
> +import org.jclouds.json.SerializedNames; > + > +import com.google.auto.value.AutoValue; > + > +/** > + * Representation of an OpenStack Poppy Caching Rule. > + */ > +@AutoValue > +public abstract class Caching { > + public abstract String getName(); > + public abstract int getTtl(); > + @N

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-09 Thread Zack Shoylev
> + @Named("service:list") > + @GET > + @ResponseParser(ParseServices.class) > + @Transform(ServicesToPagedIterable.class) > + @Fallback(Fallbacks.EmptyPagedIterableOnNotFoundOr404.class) > + PagedIterable list(); > + > + /** > +* Lists services by providing a specific set of list

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-09 Thread Zack Shoylev
> @@ -52,7 +53,7 @@ > @Consumes(MediaType.APPLICATION_JSON) > @Endpoint(CDN.class) > @RequestFilters(AuthenticateRequest.class) > - @Fallback(FalseOn500or503.class) > + @Fallback(PoppyFallbacks.FalseOn500or503orIOE.class) Thanks @nacx - awesome! --- Reply to this email directly or

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-09 Thread Everett Toews
> + @Fallback(NullOnNotFoundOr404.class) > + @Nullable > + Service get(@PathParam("id") String id); > + > + /** > +* Creates a service. > +* > +* @param options the options to create the service with > +* @return a URI to the created service > +*/ > + @Named("service:

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-09 Thread Everett Toews
> +* @param id the id of the service to delete > +* @return true if delete was successful, false if not > +*/ > + @Named("network:delete") > + @DELETE > + @Path("/{id}") > + @Fallback(Fallbacks.FalseOnNotFoundOr404.class) > + boolean delete(@PathParam("id") String id); > + > +

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-09 Thread Ignasi Barrera
> @@ -52,7 +53,7 @@ > @Consumes(MediaType.APPLICATION_JSON) > @Endpoint(CDN.class) > @RequestFilters(AuthenticateRequest.class) > - @Fallback(FalseOn500or503.class) > + @Fallback(PoppyFallbacks.FalseOn500or503orIOE.class) Here is a patch that should fix the issue and allow you to r

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-09 Thread Everett Toews
> + @Named("service:list") > + @GET > + @ResponseParser(ParseServices.class) > + @Transform(ServicesToPagedIterable.class) > + @Fallback(Fallbacks.EmptyPagedIterableOnNotFoundOr404.class) > + PagedIterable list(); > + > + /** > +* Lists services by providing a specific set of list

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-09 Thread Everett Toews
> + > + @Override > + public R bindToRequest(R request, Map Object> postParams) { > + String jsonPatch = null; > + Service service = (Service) postParams.get("service"); > + > + Json json = Guice.createInjector(new > GsonModule()).getInstance(Json.class); > + > + String ta

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-09 Thread Everett Toews
> + @Override > + public R bindToRequest(R request, Map Object> postParams) { > + String jsonPatch = null; > + Service service = (Service) postParams.get("service"); > + > + Json json = Guice.createInjector(new > GsonModule()).getInstance(Json.class); > + > + String target

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-08 Thread Ignasi Barrera
> @@ -52,7 +53,7 @@ > @Consumes(MediaType.APPLICATION_JSON) > @Endpoint(CDN.class) > @RequestFilters(AuthenticateRequest.class) > - @Fallback(FalseOn500or503.class) > + @Fallback(PoppyFallbacks.FalseOn500or503orIOE.class) I've investigated a bit, and the issue you are facing is [J

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-06 Thread Zack Shoylev
Thanks for the review @nacx! Good stuff. Any idea on who to contact about the google auto 1.1 release? I don't want to bother them too much, especially if we already asked. --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs-openstack/pull/179#issuecomm

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-06 Thread Zack Shoylev
> +import org.jclouds.json.SerializedNames; > + > +import com.google.auto.value.AutoValue; > + > +/** > + * Representation of an OpenStack Poppy Caching Rule. > + */ > +@AutoValue > +public abstract class Caching { > + public abstract String getName(); > + public abstract int getTtl(); > + @N

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-06 Thread Zack Shoylev
> @@ -52,7 +53,7 @@ > @Consumes(MediaType.APPLICATION_JSON) > @Endpoint(CDN.class) > @RequestFilters(AuthenticateRequest.class) > - @Fallback(FalseOn500or503.class) > + @Fallback(PoppyFallbacks.FalseOn500or503orIOE.class) testPingFailOn500(org.jclouds.openstack.poppy.v1.features.Po

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-06 Thread Ignasi Barrera
> + * Diff to create JSONPatch using dependency. > + * Send the JSONPatch in the request. > + * > + * JSONPatch RFC: > + * https://tools.ietf.org/html/rfc6902 > + */ > +public class JSONPatchUpdate implements MapBinder { > + @Inject > + private BindToJsonPayload jsonBinder; > + > + @Override

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-06 Thread Ignasi Barrera
> @@ -46,6 +46,20 @@ > > org.jclouds*;version="${project.version}",* > > > + Absolutely. That would help us remove a lot of boilerplate code. Let's try to push them to make a release! --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs-ope

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-06 Thread Ignasi Barrera
> + @GET > + @Path("/{id}") > + @Fallback(NullOnNotFoundOr404.class) > + @Nullable > + Service get(@PathParam("id") String id); > + > + /** > +* Creates a service. > +* > +* @param options the options to create the service with > +* @return a URI to the created service

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-06 Thread Ignasi Barrera
> + > + @Override > + public R bindToRequest(R request, Map Object> postParams) { > + String jsonPatch = null; > + Service service = (Service) postParams.get("service"); > + > + Json json = Guice.createInjector(new > GsonModule()).getInstance(Json.class); > + > + String ta

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-06 Thread Ignasi Barrera
> +import javax.inject.Singleton; > + > +import org.jclouds.http.functions.ParseJson; > +import org.jclouds.json.Json; > +import org.jclouds.openstack.poppy.v1.domain.Services; > + > +import com.google.inject.TypeLiteral; > + > +/** > + * Used by jclouds to provide more specific collections and fal

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-06 Thread Zack Shoylev
> @@ -52,7 +53,7 @@ > @Consumes(MediaType.APPLICATION_JSON) > @Endpoint(CDN.class) > @RequestFilters(AuthenticateRequest.class) > - @Fallback(FalseOn500or503.class) > + @Fallback(PoppyFallbacks.FalseOn500or503orIOE.class) Let me try to reproduce it again then... --- Reply to this

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-06 Thread Ignasi Barrera
> + > + /** > +* Updates a service by applying JSONPatch internally. > +* https://tools.ietf.org/html/rfc6902 > +* This requires providing your updateable JSON and the target JSON. > +* > +* @param service Source JSON > +* @param createService Target JSON > +* @return

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-06 Thread Zack Shoylev
> @@ -46,6 +46,20 @@ > > org.jclouds*;version="${project.version}",* > > > + Almost a recurring theme at this point... :) But it's just so powerful! --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs-openstack/pull/179/files#r25982047

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-06 Thread Ignasi Barrera
> +import java.util.List; > +import java.util.Set; > + > +import org.jclouds.javax.annotation.Nullable; > +import org.jclouds.json.SerializedNames; > +import org.jclouds.openstack.v2_0.domain.Link; > + > +import com.google.auto.value.AutoValue; > +import com.google.inject.name.Named; > + > +/** > +

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-06 Thread Ignasi Barrera
> +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 an OpenStack Poppy Origin. > + */ > +@AutoV

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-06 Thread Ignasi Barrera
> +import org.jclouds.json.SerializedNames; > + > +import com.google.auto.value.AutoValue; > + > +/** > + * Representation of an OpenStack Poppy Caching Rule. > + */ > +@AutoValue > +public abstract class Caching { > + public abstract String getName(); > + public abstract int getTtl(); > + @N

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-06 Thread Ignasi Barrera
> @@ -46,6 +46,20 @@ > > org.jclouds*;version="${project.version}",* > > > + Fine, but as discussed in other threads take care and don't merge this pull request until that happens :) --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs-open

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-06 Thread Ignasi Barrera
> @@ -52,7 +53,7 @@ > @Consumes(MediaType.APPLICATION_JSON) > @Endpoint(CDN.class) > @RequestFilters(AuthenticateRequest.class) > - @Fallback(FalseOn500or503.class) > + @Fallback(PoppyFallbacks.FalseOn500or503orIOE.class) Can you share the stacktrace? This seems to be something tha

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-06 Thread Zack Shoylev
> + * 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

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-06 Thread Zack Shoylev
> +import org.jclouds.json.config.GsonModule; > +import org.jclouds.openstack.poppy.v1.domain.Service; > +import org.jclouds.rest.MapBinder; > +import org.jclouds.rest.binders.BindToJsonPayload; > + > +import com.fasterxml.jackson.databind.ObjectMapper; > +import com.github.fge.jsonpatch.diff.JsonD

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-05 Thread Zack Shoylev
>provided > > + > + org.apache.jclouds.driver > + jclouds-okhttp > + ${project.parent.version} > + > + > + com.github.fge > + json-patch > + 1.9 > + This api's update feature uses PATCH that accepts a JSONPatch as per the RFC https://too

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-05 Thread Zack Shoylev
> @@ -52,7 +53,7 @@ > @Consumes(MediaType.APPLICATION_JSON) > @Endpoint(CDN.class) > @RequestFilters(AuthenticateRequest.class) > - @Fallback(FalseOn500or503.class) > + @Fallback(PoppyFallbacks.FalseOn500or503orIOE.class) Switching to okhttp: 500 errors seem to cause an IOException

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-05 Thread Zack Shoylev
> @@ -46,6 +46,20 @@ > > org.jclouds*;version="${project.version}",* > > > + This PR uses autovalue 1.1 snapshot for now (until released) --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs-openstack/pull/179/files#r25899272

Re: [jclouds-labs-openstack] Poppy service api (#179)

2015-03-05 Thread Zack Shoylev
> + * User side: > + * Get a Service with api.get(service_id) > + * Get a UpdateService builder by using Service.toUpdatabaleService() > + *This step will provide an interface that exposes the updatable JSON > values to the user. > + * Use the UpdateService.Builder instance to modify and build