com.xensource.xenapi
Class VDI

java.lang.Object
  extended by com.xensource.xenapi.VDI

public class VDI
extends Object

A virtual disk image


Nested Class Summary
static class VDI.Record
          Represents all the fields in a VDI
 
Field Summary
protected  String ref
          The XenAPI reference to this object.
 
Method Summary
 void addToOtherConfig(String key, String value)
          Add the given key-value pair to the other_config field of the given VDI.
static VDI create(VDI.Record record)
          Create a new VDI instance, and return its handle.
 void destroy()
          Destroy the specified VDI instance.
static Set<VDI> getAll()
          Return a list of all the VDIs known to the system.
static Map<VDI,VDI.Record> getAllRecords()
          Get all the VDI Records at once, in a single XML RPC call
static Set<VDI> getByNameLabel(String label)
          Get all the VDI instances with the given label.
static VDI getByUuid(String uuid)
          Get a reference to the VDI instance with the specified UUID.
 Set<Crashdump> getCrashDumps()
          Get the crash_dumps field of the given VDI.
protected static VDI getInstFromRef(String ref)
           
 String getNameDescription()
          Get the name/description field of the given VDI.
 String getNameLabel()
          Get the name/label field of the given VDI.
 Map<String,String> getOtherConfig()
          Get the other_config field of the given VDI.
 Long getPhysicalUtilisation()
          Get the physical_utilisation field of the given VDI.
 Boolean getReadOnly()
          Get the read_only field of the given VDI.
 VDI.Record getRecord()
          Get a record containing the current state of the given VDI.
 Boolean getSharable()
          Get the sharable field of the given VDI.
 SR getSR()
          Get the SR field of the given VDI.
 Boolean getStorageLock()
          Get the storage_lock field of the given VDI.
 com.xensource.xenapi.Types.VdiType getType()
          Get the type field of the given VDI.
 String getUuid()
          Get the uuid field of the given VDI.
 Set<VBD> getVBDs()
          Get the VBDs field of the given VDI.
 Long getVirtualSize()
          Get the virtual_size field of the given VDI.
 void removeFromOtherConfig(String key)
          Remove the given key and its corresponding value from the other_config field of the given VDI.
 void setNameDescription(String description)
          Set the name/description field of the given VDI.
 void setNameLabel(String label)
          Set the name/label field of the given VDI.
 void setOtherConfig(Map<String,String> otherConfig)
          Set the other_config field of the given VDI.
 void setReadOnly(Boolean readOnly)
          Set the read_only field of the given VDI.
 void setSharable(Boolean sharable)
          Set the sharable field of the given VDI.
 void setVirtualSize(Long virtualSize)
          Set the virtual_size field of the given VDI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ref

protected final String ref
The XenAPI reference to this object.

Method Detail

getInstFromRef

protected static VDI getInstFromRef(String ref)

getRecord

public VDI.Record getRecord()
                     throws Types.BadServerResponse,
                            ConnectionHelper.NoConnectionOnThisThreadException,
                            XmlRpcException
Get a record containing the current state of the given VDI.

Returns:
all fields from the object
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

getByUuid

public static VDI getByUuid(String uuid)
                     throws Types.BadServerResponse,
                            ConnectionHelper.NoConnectionOnThisThreadException,
                            XmlRpcException
Get a reference to the VDI instance with the specified UUID.

Parameters:
uuid - UUID of object to return
Returns:
reference to the object
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

create

public static VDI create(VDI.Record record)
                  throws Types.BadServerResponse,
                         ConnectionHelper.NoConnectionOnThisThreadException,
                         XmlRpcException
Create a new VDI instance, and return its handle.

Parameters:
record - All constructor arguments
Returns:
reference to the newly created object
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

destroy

public void destroy()
             throws Types.BadServerResponse,
                    ConnectionHelper.NoConnectionOnThisThreadException,
                    XmlRpcException
Destroy the specified VDI instance.

Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

getByNameLabel

public static Set<VDI> getByNameLabel(String label)
                               throws Types.BadServerResponse,
                                      ConnectionHelper.NoConnectionOnThisThreadException,
                                      XmlRpcException
Get all the VDI instances with the given label.

Parameters:
label - label of object to return
Returns:
references to objects with matching names
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

getUuid

public String getUuid()
               throws Types.BadServerResponse,
                      ConnectionHelper.NoConnectionOnThisThreadException,
                      XmlRpcException
Get the uuid field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

getNameLabel

public String getNameLabel()
                    throws Types.BadServerResponse,
                           ConnectionHelper.NoConnectionOnThisThreadException,
                           XmlRpcException
Get the name/label field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

getNameDescription

public String getNameDescription()
                          throws Types.BadServerResponse,
                                 ConnectionHelper.NoConnectionOnThisThreadException,
                                 XmlRpcException
Get the name/description field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

getSR

public SR getSR()
         throws Types.BadServerResponse,
                ConnectionHelper.NoConnectionOnThisThreadException,
                XmlRpcException
Get the SR field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

getVBDs

public Set<VBD> getVBDs()
                 throws Types.BadServerResponse,
                        ConnectionHelper.NoConnectionOnThisThreadException,
                        XmlRpcException
Get the VBDs field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

getCrashDumps

public Set<Crashdump> getCrashDumps()
                             throws Types.BadServerResponse,
                                    ConnectionHelper.NoConnectionOnThisThreadException,
                                    XmlRpcException
Get the crash_dumps field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

getVirtualSize

public Long getVirtualSize()
                    throws Types.BadServerResponse,
                           ConnectionHelper.NoConnectionOnThisThreadException,
                           XmlRpcException
Get the virtual_size field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

getPhysicalUtilisation

public Long getPhysicalUtilisation()
                            throws Types.BadServerResponse,
                                   ConnectionHelper.NoConnectionOnThisThreadException,
                                   XmlRpcException
Get the physical_utilisation field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

getType

public com.xensource.xenapi.Types.VdiType getType()
                                           throws Types.BadServerResponse,
                                                  ConnectionHelper.NoConnectionOnThisThreadException,
                                                  XmlRpcException
Get the type field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

getSharable

public Boolean getSharable()
                    throws Types.BadServerResponse,
                           ConnectionHelper.NoConnectionOnThisThreadException,
                           XmlRpcException
Get the sharable field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

getReadOnly

public Boolean getReadOnly()
                    throws Types.BadServerResponse,
                           ConnectionHelper.NoConnectionOnThisThreadException,
                           XmlRpcException
Get the read_only field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

getOtherConfig

public Map<String,String> getOtherConfig()
                                  throws Types.BadServerResponse,
                                         ConnectionHelper.NoConnectionOnThisThreadException,
                                         XmlRpcException
Get the other_config field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

getStorageLock

public Boolean getStorageLock()
                       throws Types.BadServerResponse,
                              ConnectionHelper.NoConnectionOnThisThreadException,
                              XmlRpcException
Get the storage_lock field of the given VDI.

Returns:
value of the field
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

setNameLabel

public void setNameLabel(String label)
                  throws Types.BadServerResponse,
                         ConnectionHelper.NoConnectionOnThisThreadException,
                         XmlRpcException
Set the name/label field of the given VDI.

Parameters:
label - New value to set
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

setNameDescription

public void setNameDescription(String description)
                        throws Types.BadServerResponse,
                               ConnectionHelper.NoConnectionOnThisThreadException,
                               XmlRpcException
Set the name/description field of the given VDI.

Parameters:
description - New value to set
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

setVirtualSize

public void setVirtualSize(Long virtualSize)
                    throws Types.BadServerResponse,
                           ConnectionHelper.NoConnectionOnThisThreadException,
                           XmlRpcException
Set the virtual_size field of the given VDI.

Parameters:
virtualSize - New value to set
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

setSharable

public void setSharable(Boolean sharable)
                 throws Types.BadServerResponse,
                        ConnectionHelper.NoConnectionOnThisThreadException,
                        XmlRpcException
Set the sharable field of the given VDI.

Parameters:
sharable - New value to set
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

setReadOnly

public void setReadOnly(Boolean readOnly)
                 throws Types.BadServerResponse,
                        ConnectionHelper.NoConnectionOnThisThreadException,
                        XmlRpcException
Set the read_only field of the given VDI.

Parameters:
readOnly - New value to set
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

setOtherConfig

public void setOtherConfig(Map<String,String> otherConfig)
                    throws Types.BadServerResponse,
                           ConnectionHelper.NoConnectionOnThisThreadException,
                           XmlRpcException
Set the other_config field of the given VDI.

Parameters:
otherConfig - New value to set
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

addToOtherConfig

public void addToOtherConfig(String key,
                             String value)
                      throws Types.BadServerResponse,
                             ConnectionHelper.NoConnectionOnThisThreadException,
                             XmlRpcException
Add the given key-value pair to the other_config field of the given VDI.

Parameters:
key - Key to add
value - Value to add
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

removeFromOtherConfig

public void removeFromOtherConfig(String key)
                           throws Types.BadServerResponse,
                                  ConnectionHelper.NoConnectionOnThisThreadException,
                                  XmlRpcException
Remove the given key and its corresponding value from the other_config field of the given VDI. If the key is not in that Map, then do nothing.

Parameters:
key - Key to remove
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

getAll

public static Set<VDI> getAll()
                       throws Types.BadServerResponse,
                              ConnectionHelper.NoConnectionOnThisThreadException,
                              XmlRpcException
Return a list of all the VDIs known to the system.

Returns:
references to all objects
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

getAllRecords

public static Map<VDI,VDI.Record> getAllRecords()
                                         throws Types.BadServerResponse,
                                                ConnectionHelper.NoConnectionOnThisThreadException,
                                                XmlRpcException
Get all the VDI Records at once, in a single XML RPC call

Returns:
A map from VDI to VDI.Record
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException