Re: [jclouds-labs] JCLOUDS-664:Implement OSImageToImage Function (#117)

2014-12-19 Thread Andrea Turli
@@ -67,7 +67,7 @@ public static Attachment create(String hostedService, String deployment, String @Nullable public abstract String description(); /** The operating system type of the OS image, or null if a data disk. */ - @Nullable public abstract OSImage.Type os(); +

Re: [jclouds-labs] JCLOUDS-664:Implement OSImageToImage Function (#117)

2014-12-19 Thread Andrea Turli
@@ -95,9 +95,9 @@ public static Attachment create(String hostedService, String deployment, String */ @Nullable public abstract String sourceImage(); - public static Disk create(String name, String location, String affinityGroup, String description, OSImage.Type os, +

Re: [jclouds-labs] JCLOUDS-664:Implement OSImageToImage Function (#117)

2014-12-19 Thread Andrea Turli
URI mediaLink, Integer logicalSizeInGB, Attachment attachedTo, String sourceImage) { - return new AutoValue_Disk(name, location, affinityGroup, description, os, mediaLink, logicalSizeInGB, attachedTo, + return new AutoValue_Disk(name, location, affinityGroup,

Re: [jclouds-labs] JCLOUDS-664:Implement OSImageToImage Function (#117)

2014-12-19 Thread Andrea Turli
@@ -37,7 +37,7 @@ public abstract String name(); /** The geo-locations of the image, if the image is not associated with an affinity group. */ - public abstract ListString locations(); + @Nullable public abstract String location(); Good spot! Please make sure that all the

Re: [jclouds-labs] JCLOUDS-664:Implement OSImageToImage Function (#117)

2014-12-19 Thread Andrea Turli
@@ -68,7 +68,7 @@ private void checkOSImage(OSImage OSImage) { MediaLink should be an http(s) url + OSImage); } - assertTrue(locations.containsAll(OSImage.locations()), Locations not in + locations + : + OSImage); + //

Re: [jclouds-labs] JCLOUDS-664:Implement OSImageToImage Function (#117)

2014-12-19 Thread Andrea Turli
@@ -60,8 +60,8 @@ public void testList() { } private void checkDisk(Disk disk) { - assertNull(disk.name(), Name cannot be null for: + disk); - assertNull(disk.os(), OS cannot be null for: + disk); + assertNotNull(disk.name(), Name cannot be null for: + disk); +

Re: [jclouds-labs] JCLOUDS-664:Implement OSImageToImage Function (#117)

2014-12-19 Thread Andrea Turli
+ + ImageBuilder builder = new ImageBuilder() +.id(image.label()) +.name(image.name()) +.description(image.description()) +.status(Image.Status.AVAILABLE) +.uri(image.mediaLink()) +

Re: [jclouds-labs] JCLOUDS-664:Implement OSImageToImage Function (#117)

2014-12-19 Thread Andrea Turli
Thanks @hsbhathiya for your PR, very good start! There are some comments from my side, please try to address them and if you have troubles, feel free to reach out to us on IRC #jclouds. --- Reply to this email directly or view it on GitHub:

[jclouds-labs-google] Options cleanup (#117)

2014-12-19 Thread danbroudy
Currently the options classes are not consistent. This PR modifies `TargetHttpProxyOptions` and `TargetPoolCreationOptions`. Are these improvements and should other Options classes be changed to this form? You can merge this Pull Request by running: git pull

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+project xmlns=http://maven.apache.org/POM/4.0.0; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd; +modelVersion4.0.0/modelVersion +parent +

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+ * 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.profitbricks;

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+ .defaultProperties(ProfitBricksApiMetadata.defaultProperties()) + .defaultModules(ImmutableSet.Class? extends Moduleof(ProfitBricksHttpApiModule.class)); + } + + @Override + public ProfitBricksApiMetadata build() { + return new

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+ .defaultProperties(ProfitBricksApiMetadata.defaultProperties()) + .defaultModules(ImmutableSet.Class? extends Moduleof(ProfitBricksHttpApiModule.class)); + } + + @Override + public ProfitBricksApiMetadata build() { + return new

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+ +import static com.google.common.base.Preconditions.checkNotNull; +import static java.lang.String.format; + +import java.util.Map; + +import javax.ws.rs.core.MediaType; + +import org.jclouds.http.HttpRequest; +import org.jclouds.rest.MapBinder; + +import

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+ +public abstract class BaseProfitBricksRequestBinderT implements MapBinder { + + protected final StringBuilder requestBuilder; + protected String paramName; + + public BaseProfitBricksRequestBinder() { + this.requestBuilder = new StringBuilder(255); + } + + @Override +

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+import com.google.common.base.Strings; + +public abstract class BaseProfitBricksRequestBinderT implements MapBinder { + + protected final StringBuilder requestBuilder; + protected String paramName; + + public BaseProfitBricksRequestBinder() { + this.requestBuilder = new

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+import static com.google.common.base.Preconditions.checkNotNull; +import static java.lang.String.format; + +import java.util.Map; + +import javax.ws.rs.core.MediaType; + +import org.jclouds.http.HttpRequest; +import org.jclouds.rest.MapBinder; + +import com.google.common.base.Strings;

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+ T payload = (T) obj; + + return createRequest(request, createPayload(payload)); + } + + @Override + public R extends HttpRequest R bindToRequest(R request, Object input) { + throw new UnsupportedOperationException(Not supported yet.); + } + + protected

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+ + checkNotNull(paramName, Initialize 'paramName' in constructor); + Object obj = checkNotNull(postParams.get(paramName), format(Param '%s' cannot be null., paramName)); + T payload = (T) obj; + + return createRequest(request, createPayload(payload)); + } + +

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+ @Override + public R extends HttpRequest R bindToRequest(R request, Object input) { + throw new UnsupportedOperationException(Not supported yet.); + } + + protected abstract String createPayload(T payload); + + protected String ifNotEmpty(String pattern, Object param) { +

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+ + protected String ifNotEmpty(String pattern, Object param) { + try { + return Strings.isNullOrEmpty((String) param) ? : String.format(pattern, param); + } catch (ClassCastException ex) { + return Strings.isNullOrEmpty(param.toString()) ? :

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+import org.jclouds.rest.annotations.Fallback; +import org.jclouds.rest.annotations.MapBinder; +import org.jclouds.rest.annotations.Payload; +import org.jclouds.rest.annotations.PayloadParam; +import org.jclouds.rest.annotations.RequestFilters; +import

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+* @return Returns a list of all Virtual Data Centers created by the user, including ID, name and version number. +*/ + @POST + @Payload(ws:getAllDataCenters/) + @XMLResponseParser(DataCenterListResponseHandler.class) + @Fallback(Fallbacks.EmptyListOnNotFoundOr404.class) +

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+ /** +* @param identifier Virtual Data Center identifier +* @return Returns information about an existing virtual data center's state and configuration. +*/ + @POST + @Payload(ws:getDataCenterdataCenterId{id}/dataCenterId/ws:getDataCenter) +

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+*/ + @POST + @Payload(ws:clearDataCenterdataCenterId{id}/dataCenterId/ws:clearDataCenter) + @XMLResponseParser(DataCenterInfoResponseHandler.class) + DataCenter clearDataCenter(@PayloadParam(id) String identifier) throws HttpResponseException; + + /** +* Deletes an

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+import org.jclouds.rest.ResourceNotFoundException; + +/** + * Parse ProfitBricks API errors and set the appropriate exception. + */ +@Singleton +public class ProfitBricksHttpErrorHandler implements HttpErrorHandler { + + @Override + public void handleError(final HttpCommand command,

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
++ soapenv:Header/ ++ soapenv:Body; + + private final String SOAP_SUFFIX = /soapenv:Body/soapenv:Envelope; + + @Override + public HttpRequest filter(HttpRequest request) throws HttpException { + checkNotNull(request.getPayload(), HTTP Request must contain payload

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+ * 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

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+ * limitations under the License. + */ +package org.jclouds.profitbricks.http.parser.datacenter; + +import javax.inject.Inject; + +import org.jclouds.date.DateCodecFactory; +import org.jclouds.profitbricks.domain.DataCenter; +import

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+package org.jclouds.profitbricks.http.parser.datacenter; + +import org.jclouds.date.DateCodecFactory; +import org.jclouds.profitbricks.domain.DataCenter; +import org.jclouds.profitbricks.domain.Location; +import org.jclouds.profitbricks.domain.ProvisioningState; +import

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+ +import org.jclouds.date.DateCodecFactory; +import org.jclouds.profitbricks.domain.DataCenter; +import org.jclouds.profitbricks.domain.Location; +import org.jclouds.profitbricks.domain.ProvisioningState; +import org.xml.sax.SAXException; + +import com.google.common.collect.Lists;

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+ */ +package org.jclouds.profitbricks.http.parser.state; + +import org.jclouds.date.DateCodecFactory; +import org.jclouds.profitbricks.domain.ProvisioningState; +import org.jclouds.profitbricks.http.parser.BaseProfitBricksResponseHandler; +import org.xml.sax.SAXException; + +import

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
+ + DataCenter fetchedDc = api.getDataCenterApi().getDataCenter(dcId); + + assertNotNull(fetchedDc); + assertEquals(newName, fetchedDc.name()); + } + + @Test(dependsOnMethods = testUpdateDataCenter) + public void testClearDataCenter() { + DataCenter dataCenter =

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Ignasi Barrera
@devcsrj I've added the comments. The code looks very good, and you've followed the advice of other PRs. Many thanks for that! :) This way we can set a good base line so upcoming PRs are easier to review and to get merged. Apart from the inline comments, there are a couple things missing that

Re: [jclouds] Fix for JCLOUDS-655 (#626)

2014-12-19 Thread Ignasi Barrera
Hmmm... In that case, if we are going to *keep* both forever, and now that we have a custom Json adapter for the *entire* image object, wouldn't it be better to remove the *complexMetadata* class, and promote the block device mapping metadata as a root level element in the Image class? The

Re: [jclouds-labs-google] dabbleing with fixes, still broken (#116)

2014-12-19 Thread Ignasi Barrera
I'll have a deep look at this over the weekend. In general, access to VMs is the main cause of Compute live test failures, and we need to make sure the base compute live test class works out of the box, to be sure the compute implementation meets the expected contract. That said, configuring

Re: [jclouds-labs-google] dabbleing with fixes, still broken (#116)

2014-12-19 Thread danbroudy
Sounds good! --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs-google/pull/116#issuecomment-67712167

Re: [jclouds-labs-google] Options cleanup (#117)

2014-12-19 Thread Ignasi Barrera
So, this moves the mandatory fields to the options object itself. I like it, as it is consistent (as long as we keep the mandatory parameter checks, which are already present in the builders) and removes the need to have custom binders. The simpler, the better. Thanks! --- Reply to this email

Re: [jclouds-labs-google] Updating links (#115)

2014-12-19 Thread Ignasi Barrera
Merged to master as [b9d20f5](https://git-wip-us.apache.org/repos/asf?p=jclouds-labs-google.git;a=commit;h=b9d20f5b00f3cfb3857d179570f91daf75d8fd34). Thanks! --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs-google/pull/115#issuecomment-67713044

Re: [jclouds-examples] Update examples to 1.8.1 (#68)

2014-12-19 Thread Ignasi Barrera
+1! --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-examples/pull/68#issuecomment-67713226

Re: [jclouds] Update AzureBlobStore.java (#422)

2014-12-19 Thread Andrew Gaul
@@ -208,10 +208,15 @@ public String putBlob(String container, Blob blob) { @Override public String putBlob(String container, Blob blob, PutOptions options) { if (options.isMultipart()) { - return multipartUploadStrategy.get().execute(container, blob); + String

[jclouds] JCLOUDS-391: Azure multipart putBlob user metadata (#628)

2014-12-19 Thread Andrew Gaul
You can merge this Pull Request by running: git pull https://github.com/andrewgaul/jclouds azure-multipart-usermetadata Or you can view, comment on it, or merge it online at: https://github.com/jclouds/jclouds/pull/628 -- Commit Summary -- * JCLOUDS-391: Azure multipart putBlob user

Re: [jclouds] Update AzureBlobStore.java (#422)

2014-12-19 Thread Andrew Gaul
Closed #422. --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/422#event-210476074

Re: [jclouds] Update AzureBlobStore.java (#422)

2014-12-19 Thread Andrew Gaul
@@ -208,10 +208,15 @@ public String putBlob(String container, Blob blob) { @Override public String putBlob(String container, Blob blob, PutOptions options) { if (options.isMultipart()) { - return multipartUploadStrategy.get().execute(container, blob); + String

[jira] [Commented] (JCLOUDS-391) can't set user-defined metadata for Azure with multipart blobs

2014-12-19 Thread Andrew Gaul (JIRA)
[ https://issues.apache.org/jira/browse/JCLOUDS-391?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14254406#comment-14254406 ] Andrew Gaul commented on JCLOUDS-391: - Reimplemented this the proper way with a live

[jira] [Assigned] (JCLOUDS-391) can't set user-defined metadata for Azure with multipart blobs

2014-12-19 Thread Andrew Gaul (JIRA)
[ https://issues.apache.org/jira/browse/JCLOUDS-391?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andrew Gaul reassigned JCLOUDS-391: --- Assignee: Andrew Gaul can't set user-defined metadata for Azure with multipart blobs

[jira] [Updated] (JCLOUDS-391) can't set user-defined metadata for Azure with multipart blobs

2014-12-19 Thread Andrew Gaul (JIRA)
[ https://issues.apache.org/jira/browse/JCLOUDS-391?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andrew Gaul updated JCLOUDS-391: Description: Try to set user defined meta data for Azure blob storage. No error setting meta

[jira] [Updated] (JCLOUDS-391) can't set user-defined metadata for Azure with multipart blobs

2014-12-19 Thread Andrew Gaul (JIRA)
[ https://issues.apache.org/jira/browse/JCLOUDS-391?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andrew Gaul updated JCLOUDS-391: Description: Try to set user defined meta data for Azure blob storage. No error setting meta

Re: [jclouds-labs] [JCLOUDS-702] JCloud ProfitBricks provider implementation (#72)

2014-12-19 Thread Reijhanniel Jearl Campos
+ * 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