com.vmware.vcloud.sdk
Class Disk

java.lang.Object
  extended by com.vmware.vcloud.sdk.VcloudResource<T>
      extended by com.vmware.vcloud.sdk.VcloudEntity<com.vmware.vcloud.api.rest.schema.DiskType>
          extended by com.vmware.vcloud.sdk.Disk

public class Disk
extends VcloudEntity<com.vmware.vcloud.api.rest.schema.DiskType>

Helper class to access the disk Resource in vCloud API.

Since:
API 5.1, SDK 5.1
See Also:
DiskType

Method Summary
 void changeOwner(com.vmware.vcloud.api.rest.schema.ReferenceType userReference)
          Change Disk owner.
static void changeOwner(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType diskRef, com.vmware.vcloud.api.rest.schema.ReferenceType userReference)
          Change Disk owner.
 Task delete()
          Delete Disk .
static Task delete(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType diskRef)
          Delete Disk .
 List<com.vmware.vcloud.api.rest.schema.ReferenceType> getAttachedVms()
          Returns the vm references to which this disk is attached to.
 BusType getBus()
          Returns the bus type.
 BusSubType getBusSub()
          Returns the bus sub type.
static Disk getDiskById(VcloudClient client, String vCloudId)
          Get Disk helper using the vCloud ID
static Disk getDiskByReference(VcloudClient client, com.vmware.vcloud.api.rest.schema.ReferenceType diskRef)
          Get Disk for the given Disk reference
 com.vmware.vcloud.api.rest.schema.ReferenceType getOwner()
          Returns the owner of the Disk.
 com.vmware.vcloud.api.rest.schema.ReferenceType getVdcReference()
          Returns the Parent Vdc ReferenceType.
 Task updateDisk(String name, String description, com.vmware.vcloud.api.rest.schema.ReferenceType storageProfileRef)
          Updates name, description and storage profile of Disk.
 
Methods inherited from class com.vmware.vcloud.sdk.VcloudEntity
getMetadata, getReference, getTasks
 
Methods inherited from class com.vmware.vcloud.sdk.VcloudResource
getResource
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDiskByReference

public static Disk getDiskByReference(VcloudClient client,
                                      com.vmware.vcloud.api.rest.schema.ReferenceType diskRef)
                               throws VCloudException
Get Disk for the given Disk reference

Parameters:
client -
diskRef -
Returns:
Disk
Throws:
VCloudException

getDiskById

public static Disk getDiskById(VcloudClient client,
                               String vCloudId)
                        throws VCloudException
Get Disk helper using the vCloud ID

Parameters:
client - VcloudClient
vCloudId - format - The vCloud ID is of the form: "urn:vcloud:type:uuid". For example: "urn:vcloud:disk:d9d976ba-e0ec-4682-a67d-380af49b54e1". String
Returns:
Disk
Throws:
VCloudException

updateDisk

public Task updateDisk(String name,
                       String description,
                       com.vmware.vcloud.api.rest.schema.ReferenceType storageProfileRef)
                throws VCloudException
Updates name, description and storage profile of Disk. Specify "null" for properties which you dont want to change.

Parameters:
name -
description -
storageProfileRef -
Returns:
Task
Throws:
VCloudException

delete

public Task delete()
            throws VCloudException
Delete Disk . This is long running operation and returns the Task

Returns:
Task Task
Throws:
VCloudException

delete

public static Task delete(VcloudClient client,
                          com.vmware.vcloud.api.rest.schema.ReferenceType diskRef)
                   throws VCloudException
Delete Disk . This is long running operation and returns the Task

Parameters:
client - vCloud Client VcloudClient
diskRef - Disk Ref
Returns:
Task Task
Throws:
VCloudException

getVdcReference

public com.vmware.vcloud.api.rest.schema.ReferenceType getVdcReference()
                                                                throws VCloudException
Returns the Parent Vdc ReferenceType.

Returns:
ReferenceType
Throws:
VCloudException

getOwner

public com.vmware.vcloud.api.rest.schema.ReferenceType getOwner()
                                                         throws VCloudException
Returns the owner of the Disk.

Returns:
ReferenceType
Throws:
VCloudException

getBus

public BusType getBus()
Returns the bus type.

Returns:
BusType

getBusSub

public BusSubType getBusSub()
Returns the bus sub type.

Returns:
BusSubType

changeOwner

public static void changeOwner(VcloudClient client,
                               com.vmware.vcloud.api.rest.schema.ReferenceType diskRef,
                               com.vmware.vcloud.api.rest.schema.ReferenceType userReference)
                        throws VCloudException
Change Disk owner.

Parameters:
client - - VcloudClient
diskRef - - ReferenceType Disk reference
userReference - - ReferenceType
Throws:
VCloudException

changeOwner

public void changeOwner(com.vmware.vcloud.api.rest.schema.ReferenceType userReference)
                 throws VCloudException
Change Disk owner.

Parameters:
userReference - ReferenceType
Throws:
VCloudException

getAttachedVms

public List<com.vmware.vcloud.api.rest.schema.ReferenceType> getAttachedVms()
                                                                     throws VCloudException
Returns the vm references to which this disk is attached to.

Returns:
List
Throws:
VCloudException


Copyright © 2016. All Rights Reserved.