nacx requested changes on this pull request.

Thanks @alibazlamit!

> +import org.jclouds.rest.annotations.Fallback;
+import org.jclouds.rest.annotations.MapBinder;
+import org.jclouds.rest.annotations.RequestFilters;
+import org.jclouds.rest.annotations.SelectJson;
+import org.jclouds.rest.binders.BindToJsonPayload;
+
+@Path("/vpns")
+@Produces("application/json")
+@Consumes("application/json")
+@RequestFilters(AuthenticateRequest.class)
+public interface VpnApi {
+
+   @Named("vpn:list")
+   @GET
+   @Fallback(Fallbacks.EmptyListOnNotFoundOr404.class)
+   List<Vpn> getList();

Rename to `list`.

> +      assertNotNull(resultWithQuery);
+      assertFalse(resultWithQuery.isEmpty());
+      Assert.assertTrue(resultWithQuery.size() > 0);
+   }
+
+   @Test
+   public void testGet() {
+      Vpn result = vpnApi().get(currentVpn.id());
+
+      assertNotNull(result);
+      assertEquals(result.id(), currentVpn.id());
+   }
+
+   @Test
+   public void testGetConfiguration() throws InterruptedException {
+      Thread.sleep(15000);

Is this really needed? Is there a more deterministic way of waiting?

> @@ -37,7 +37,7 @@
   </scm>
 
   <properties>
-    <jclouds.version>2.0.0-SNAPSHOT</jclouds.version>
+    <jclouds.version>2.0.0-SNAPSHOT</jclouds.version>  

[nit] Discard this change.

> +   @GET
+   @Fallback(Fallbacks.EmptyListOnNotFoundOr404.class)
+   List<Vpn> getList(GenericQueryOptions options);
+
+   @Named("vpn:get")
+   @GET
+   @Path("/{vpnId}")
+   @Fallback(Fallbacks.NullOnNotFoundOr404.class)
+   Vpn get(@PathParam("vpnId") String vpnId);
+
+   @Named("vpn:configurations:get")
+   @GET
+   @Path("/{vpnId}/configuration_file")
+   @SelectJson("config_zip_file")
+   @Fallback(Fallbacks.NullOnNotFoundOr404.class)
+   String getConfiguration(@PathParam("vpnId") String vpnId);

Interesting, so this method returns a base64 encoded zip file containing the 
VPN files. Would it make sense to return a `ZipInputStream`, so users can 
easily consume and store the returned files?

You could create a `Function<String, ZipInputStream>` that takes that base64 
string and returns a proper ZipInputStream, and then annotate this method with 
`@Transform(YourFunction.class)`, so jclouds automatically transforms the 
response.

WDYT?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/319#pullrequestreview-1293800

Reply via email to