Re: [jclouds-labs] JCLOUDS-702: JClouds ProfitBricks provider - Storage API (#128)

2015-02-05 Thread Ignasi Barrera
Pushed to master as [67cae0ca](https://git1-us-west.apache.org/repos/asf?p=jclouds-labs.git;a=commit;h=67cae0ca). Thanks @devcsrj! --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/128#issuecomment-73050251

Re: [jclouds-labs] JCLOUDS-702: JClouds ProfitBricks provider - Storage API (#128)

2015-02-02 Thread Reijhanniel Jearl Campos
Oh this streams. Haha! Anyway, @nacx I amended the previous commit and [here's the change](https://github.com/devcsrj/jclouds-labs/commit/e16878763e51f249a428335f11279393ee5deabc#diff-7772dc9ed46441061f1e9d43596e1866R96). --- Reply to this email directly or view it on GitHub: https://github.com/

Re: [jclouds-labs] JCLOUDS-702: JClouds ProfitBricks provider - Storage API (#128)

2015-02-02 Thread Ignasi Barrera
>is this change better? Yes, it is better, but take into account that if the `isSoapPayload` returns false you are not updating the payload in the response, and the original input stream might be already read. I'd put the soap check inside the try/finally block to make sure the response always

Re: [jclouds-labs] JCLOUDS-702: JClouds ProfitBricks provider - Storage API (#128)

2015-01-30 Thread Reijhanniel Jearl Campos
Hi @nacx , is this change better? --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/128#issuecomment-72304981

Re: [jclouds-labs] JCLOUDS-702: JClouds ProfitBricks provider - Storage API (#128)

2015-01-30 Thread Ignasi Barrera
> @@ -119,4 +129,9 @@ private static boolean hasPayload(final HttpResponse > response) { >return response.getPayload() != null && > response.getPayload().getRawContent() != null; > } > > + private static boolean isSoapPayload( final InputStream is ) throws > IOException { > +

Re: [jclouds-labs] JCLOUDS-702: JClouds ProfitBricks provider - Storage API (#128)

2015-01-28 Thread Reijhanniel Jearl Campos
Here are the Storage API [live tests](https://gist.github.com/devcsrj/d0f3cb9d7c0f2e6a5988). --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/128#issuecomment-71960552

Re: [jclouds-labs] JCLOUDS-702: JClouds ProfitBricks provider - Storage API (#128)

2015-01-28 Thread Reijhanniel Jearl Campos
> @@ -119,4 +129,9 @@ private static boolean hasPayload(final HttpResponse > response) { >return response.getPayload() != null && > response.getPayload().getRawContent() != null; > } > > + private static boolean isSoapPayload( final InputStream is ) throws > IOException { > +

Re: [jclouds-labs] JCLOUDS-702: JClouds ProfitBricks provider - Storage API (#128)

2015-01-28 Thread Ignasi Barrera
BTW, can you share the live test results? --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/128#issuecomment-71921895

Re: [jclouds-labs] JCLOUDS-702: JClouds ProfitBricks provider - Storage API (#128)

2015-01-28 Thread Ignasi Barrera
Thanks @devcsrj! Just one last minor (style) comment: prefer `if (foo) {` (wihtout spaces) instead of `if ( foo ) {`. --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/128#issuecomment-71921739

Re: [jclouds-labs] JCLOUDS-702: JClouds ProfitBricks provider - Storage API (#128)

2015-01-28 Thread Ignasi Barrera
> + > + try { > + api.createServer( Server.Request.CreatePayload.create( > "some-datacenter-id", "node1", 99, 12800) ); > + fail( "Request should have failed."); > + } catch (Exception ex){ > + assertTrue(ex instanceof InsufficientResourcesException, "Except

Re: [jclouds-labs] JCLOUDS-702: JClouds ProfitBricks provider - Storage API (#128)

2015-01-28 Thread Ignasi Barrera
> + ProfitBricksApi pbApi = api( server.getUrl( rootUrl ) ); > + StorageApi api = pbApi.storageApi(); > + > + String storageId = "qswdefrg-qaws-qaws-defe-rgrgdsvcxbrh"; > + > + String content = "" + storageId + > ""; > + > + try { > + boolean result = api.deleteSto

Re: [jclouds-labs] JCLOUDS-702: JClouds ProfitBricks provider - Storage API (#128)

2015-01-28 Thread Ignasi Barrera
> + this.waitUntilAvailable = Predicates2.retry( > + new ProvisioningStatusPollingPredicate( api, > ProvisioningStatusAware.STORAGE, ProvisioningState.AVAILABLE ), > + 6l * 60l, 2l, TimeUnit.SECONDS ); > + } > + > + @Test( expectedExceptions = InsufficientResourc

Re: [jclouds-labs] JCLOUDS-702: JClouds ProfitBricks provider - Storage API (#128)

2015-01-28 Thread Ignasi Barrera
> @@ -119,4 +129,9 @@ private static boolean hasPayload(final HttpResponse > response) { >return response.getPayload() != null && > response.getPayload().getRawContent() != null; > } > > + private static boolean isSoapPayload( final InputStream is ) throws > IOException { > +

Re: [jclouds-labs] JCLOUDS-702: JClouds ProfitBricks provider - Storage API (#128)

2015-01-28 Thread Ignasi Barrera
> @@ -59,7 +59,11 @@ public void handleError(final HttpCommand command, final > HttpResponse response) > break; > case 413: > case 503: > -exception = new > InsufficientResourcesException(response.getMessage(), exception); > + // if nothi

Re: [jclouds-labs] JCLOUDS-702: JClouds ProfitBricks provider - Storage API (#128)

2015-01-28 Thread Ignasi Barrera
> // @Nullable public abstract List loadBalancers(); > - public static DataCenter create(String id, String name, int version, > ProvisioningState state, Location location) { > - return new AutoValue_DataCenter(id, name, version, state, location); > + public static DataCenter create(Str

Re: [jclouds-labs] JCLOUDS-702: JClouds ProfitBricks provider - Storage API (#128)

2015-01-28 Thread Ignasi Barrera
> @@ -50,6 +50,8 @@ public boolean apply(String input) { > return expect == api.dataCenterApi().getDataCenterState(input); > case SERVER: > return expect == api.serverApi().getServer( input ).state(); > + case STORAGE: > +return expect == api.

[jclouds-labs] JCLOUDS-702: JClouds ProfitBricks provider - Storage API (#128)

2015-01-26 Thread Reijhanniel Jearl Campos
Following PRs [72](https://github.com/jclouds/jclouds-labs/pull/72) and [119](https://github.com/jclouds/jclouds-labs/pull/119), here is another PR that implements ProfitBricks' [Storage API](https://www.profitbricks.com/apidoc/1_3/APIDocumentation.html?StorageOperations.html). You can view, com