You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by Bhathiya <no...@github.com> on 2015/01/22 14:34:56 UTC

[jclouds-labs] JCLOUDS-664: Added DataVirtualHardDisk Representation With Tests (#126)

You can view, comment on, or merge this pull request online at:

  https://github.com/jclouds/jclouds-labs/pull/126

-- Commit Summary --

  * JCLOUDS-664: Added DataVirtualHardDisk Representation With Tests

-- File Changes --

    A azurecompute/src/main/java/org/jclouds/azurecompute/domain/DataVirtualHardDisk.java (97)
    A azurecompute/src/main/java/org/jclouds/azurecompute/xml/DataVirtualHardDiskHandler.java (91)
    A azurecompute/src/main/java/org/jclouds/azurecompute/xml/ListDataVirtualHardDisksHandler.java (61)
    A azurecompute/src/test/java/org/jclouds/azurecompute/xml/ListDataVirtualHardDisksHandlerTest.java (59)
    A azurecompute/src/test/resources/datavirtualharddisk.xml (18)

-- Patch Links --

https://github.com/jclouds/jclouds-labs/pull/126.patch
https://github.com/jclouds/jclouds-labs/pull/126.diff

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/126

Re: [jclouds-labs] JCLOUDS-664: Added DataVirtualHardDisk Representation With Tests (#126)

Posted by Bhathiya <no...@github.com>.
@nacx  I made that change

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/126#issuecomment-72278436

Re: [jclouds-labs] JCLOUDS-664: Added DataVirtualHardDisk Representation With Tests (#126)

Posted by Ignasi Barrera <no...@github.com>.
Pushed to master as [80f5c8f](https://git-wip-us.apache.org/repos/asf?p=jclouds-labs.git;a=commit;h=80f5c8f763f731437ba68986b7d9837900544334). Thanks @hsbhathiya!

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/126#issuecomment-72473575

Re: [jclouds-labs] JCLOUDS-664: Added DataVirtualHardDisk Representation With Tests (#126)

Posted by Bhathiya <no...@github.com>.
@andreaturli  I have corected the pointed out mistakes. Shall we merge this? 

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/126#issuecomment-71612637

Re: [jclouds-labs] JCLOUDS-664: Added DataVirtualHardDisk Representation With Tests (#126)

Posted by Bhathiya <no...@github.com>.
@andreaturli  I corrected those mistakes

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/126#issuecomment-71242283

Re: [jclouds-labs] JCLOUDS-664: Added DataVirtualHardDisk Representation With Tests (#126)

Posted by Ignasi Barrera <no...@github.com>.
Closed #126.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/126#event-228562208

Re: [jclouds-labs] JCLOUDS-664: Added DataVirtualHardDisk Representation With Tests (#126)

Posted by Ignasi Barrera <no...@github.com>.
@hsbhathiya One last minor comment. I'll merge it once addressed. Thanks!

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/126#issuecomment-72180220

Re: [jclouds-labs] JCLOUDS-664: Added DataVirtualHardDisk Representation With Tests (#126)

Posted by Ignasi Barrera <no...@github.com>.
> +import com.google.common.collect.ImmutableList.Builder;
> +import com.google.inject.Inject;
> +import org.jclouds.azurecompute.domain.DataVirtualHardDisk;
> +import org.jclouds.http.functions.ParseSax;
> +import org.xml.sax.Attributes;
> +
> +import java.util.List;
> +
> +public final class ListDataVirtualHardDisksHandler
> +      extends ParseSax.HandlerForGeneratedRequestWithResult<List<DataVirtualHardDisk>> {
> +   private boolean inDataVHD;
> +   private final DataVirtualHardDiskHandler dataVirtualHardDiskHandler;
> +   private final Builder<DataVirtualHardDisk> VHDs = ImmutableList.builder();
> +
> +   @Inject
> +   public ListDataVirtualHardDisksHandler(DataVirtualHardDiskHandler dataVirtualHardDiskHandler) {

In general, injection constructors should be package protected. Just remove the public modifier:
```java
@Inject
ListDataVirtualHardDisksHandler(DataVirtualHardDiskHandler dataVirtualHardDiskHandler) {
```

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/126/files#r23833496

Re: [jclouds-labs] JCLOUDS-664: Added DataVirtualHardDisk Representation With Tests (#126)

Posted by Andrea Turli <no...@github.com>.
> +
> +   /**
> +    * Required if an existing disk is being used to create a Virtual Machine.
> +    * Specifies the name of a new or existing disk
> +    */
> +   @Nullable public abstract String diskName();
> +
> +   /**
> +    * Specifies the Logical Unit Number (LUN) for the data disk. If the disk is the first disk that is added,
> +    * this element is optional and the default value of 0 is used. If more than one disk is being added,
> +    * this element is required.
> +    * <p/>
> +    * You can use Get Role to find the LUN numbers that are already being used.
> +    * Valid LUN values are 0 through 31
> +    */
> +   @Nullable public abstract Integer LUN();

why upper-case?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/126/files#r23438996

Re: [jclouds-labs] JCLOUDS-664: Added DataVirtualHardDisk Representation With Tests (#126)

Posted by Bhathiya <no...@github.com>.
@nacx I addressed those issues you mentioned. can we merge this? 

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/126#issuecomment-72078688

Re: [jclouds-labs] JCLOUDS-664: Added DataVirtualHardDisk Representation With Tests (#126)

Posted by Ignasi Barrera <no...@github.com>.
> + * limitations under the License.
> + */
> +package org.jclouds.azurecompute.xml;
> +
> +import com.google.common.collect.ImmutableList;
> +import com.google.common.collect.ImmutableList.Builder;
> +import org.jclouds.azurecompute.domain.DataVirtualHardDisk;
> +import org.jclouds.http.functions.ParseSax;
> +import org.xml.sax.Attributes;
> +
> +import java.util.List;
> +
> +public final class ListDataVirtualHardDisksHandler
> +      extends ParseSax.HandlerForGeneratedRequestWithResult<List<DataVirtualHardDisk>> {
> +   private boolean inDataVHD;
> +   private final DataVirtualHardDiskHandler dataVirtualHardDiskHandler = new DataVirtualHardDiskHandler();

Don't assign this here. Add a constructor that receives it as a parameter to get it injected instead.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/126/files#r23727029

Re: [jclouds-labs] JCLOUDS-664: Added DataVirtualHardDisk Representation With Tests (#126)

Posted by Andrea Turli <no...@github.com>.
> +    * If the disk that is being added is already registered in the subscription or the VHD for the disk already exists
> +    * in blob storage, this element is ignored. If a VHD file does not exist in blob storage, this element defines the
> +    * location of the new VHD that is created when the new disk is added.
> +    * Example:
> +    * http://example.blob.core.windows.net/disks/mydatadisk.vhd
> +    */
> +   @Nullable public abstract URI mediaLink();
> +
> +   /**
> +    * This property identifies the type of the storage account for the backing VHD.
> +    * If the backing VHD is in an Provisioned Storage account, “Provisioned” is returned otherwise “Standard”
> +    * is returned.
> +    * <p/>
> +    * This property is only returned with a version header of 2014-10-01 or newer
> +    */
> +   @Nullable public abstract String IOType();

why upper-case?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/126/files#r23439009

Re: [jclouds-labs] JCLOUDS-664: Added DataVirtualHardDisk Representation With Tests (#126)

Posted by Bhathiya <no...@github.com>.
@andreaturli  Can you review this?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/126#issuecomment-71131095

Re: [jclouds-labs] JCLOUDS-664: Added DataVirtualHardDisk Representation With Tests (#126)

Posted by Ignasi Barrera <no...@github.com>.
> +import com.google.auto.value.AutoValue;
> +import org.jclouds.javax.annotation.Nullable;
> +
> +import java.net.URI;
> +
> +/**
> + * @see <a href="https://msdn.microsoft.com/en-us/library/azure/jj157193.aspx#DataVirtualHardDisks" >api</a>
> + */
> +
> +@AutoValue
> +public abstract class DataVirtualHardDisk {
> +
> +   public enum Caching {
> +      READ_ONLY,
> +      READ_WRITE,
> +      None

Is this case sensitive? Can this value be upper case too?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/126/files#r23726836