com.xensource.xenapi
Class VBD

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

public class VBD
extends Object

A virtual block device


Nested Class Summary
static class VBD.Record
          Represents all the fields in a VBD
 
Field Summary
protected  String ref
          The XenAPI reference to this object.
 
Method Summary
 void addToQosAlgorithmParams(String key, String value)
          Add the given key-value pair to the qos/algorithm_params field of the given VBD.
static VBD create(VBD.Record record)
          Create a new VBD instance, and return its handle.
 void destroy()
          Destroy the specified VBD instance.
static Set<VBD> getAll()
          Return a list of all the VBDs known to the system.
static Map<VBD,VBD.Record> getAllRecords()
          Get all the VBD Records at once, in a single XML RPC call
 Boolean getBootable()
          Get the bootable field of the given VBD.
static VBD getByUuid(String uuid)
          Get a reference to the VBD instance with the specified UUID.
 Boolean getCurrentlyAttached()
          Get the currently_attached field of the given VBD.
 String getDevice()
          Get the device field of the given VBD.
protected static VBD getInstFromRef(String ref)
           
 VBDMetrics getMetrics()
          Get the metrics field of the given VBD.
 com.xensource.xenapi.Types.VbdMode getMode()
          Get the mode field of the given VBD.
 Map<String,String> getQosAlgorithmParams()
          Get the qos/algorithm_params field of the given VBD.
 String getQosAlgorithmType()
          Get the qos/algorithm_type field of the given VBD.
 Set<String> getQosSupportedAlgorithms()
          Get the qos/supported_algorithms field of the given VBD.
 VBD.Record getRecord()
          Get a record containing the current state of the given VBD.
 Map<String,String> getRuntimeProperties()
          Get the runtime_properties field of the given VBD.
 Long getStatusCode()
          Get the status_code field of the given VBD.
 String getStatusDetail()
          Get the status_detail field of the given VBD.
 Boolean getStorageLock()
          Get the storage_lock field of the given VBD.
 com.xensource.xenapi.Types.VbdType getType()
          Get the type field of the given VBD.
 String getUserdevice()
          Get the userdevice field of the given VBD.
 String getUuid()
          Get the uuid field of the given VBD.
 VDI getVDI()
          Get the VDI field of the given VBD.
 VM getVM()
          Get the VM field of the given VBD.
 void mediaChange(VDI vdi)
          Change the media in the device for CDROM-like devices only.
 void plug()
          Hotplug the specified VBD, dynamically attaching it to the running VM
 void removeFromQosAlgorithmParams(String key)
          Remove the given key and its corresponding value from the qos/algorithm_params field of the given VBD.
 void setBootable(Boolean bootable)
          Set the bootable field of the given VBD.
 void setMode(com.xensource.xenapi.Types.VbdMode mode)
          Set the mode field of the given VBD.
 void setQosAlgorithmParams(Map<String,String> algorithmParams)
          Set the qos/algorithm_params field of the given VBD.
 void setQosAlgorithmType(String algorithmType)
          Set the qos/algorithm_type field of the given VBD.
 void setType(com.xensource.xenapi.Types.VbdType type)
          Set the type field of the given VBD.
 void setUserdevice(String userdevice)
          Set the userdevice field of the given VBD.
 void unplug()
          Hot-unplug the specified VBD, dynamically unattaching it from the running VM
 
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 VBD getInstFromRef(String ref)

getRecord

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

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

getByUuid

public static VBD getByUuid(String uuid)
                     throws Types.BadServerResponse,
                            ConnectionHelper.NoConnectionOnThisThreadException,
                            XmlRpcException
Get a reference to the VBD 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 VBD create(VBD.Record record)
                  throws Types.BadServerResponse,
                         ConnectionHelper.NoConnectionOnThisThreadException,
                         XmlRpcException
Create a new VBD 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 VBD instance.

Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

getUuid

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

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

getVM

public VM getVM()
         throws Types.BadServerResponse,
                ConnectionHelper.NoConnectionOnThisThreadException,
                XmlRpcException
Get the VM field of the given VBD.

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

getVDI

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

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

getDevice

public String getDevice()
                 throws Types.BadServerResponse,
                        ConnectionHelper.NoConnectionOnThisThreadException,
                        XmlRpcException
Get the device field of the given VBD.

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

getUserdevice

public String getUserdevice()
                     throws Types.BadServerResponse,
                            ConnectionHelper.NoConnectionOnThisThreadException,
                            XmlRpcException
Get the userdevice field of the given VBD.

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

getBootable

public Boolean getBootable()
                    throws Types.BadServerResponse,
                           ConnectionHelper.NoConnectionOnThisThreadException,
                           XmlRpcException
Get the bootable field of the given VBD.

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

getMode

public com.xensource.xenapi.Types.VbdMode getMode()
                                           throws Types.BadServerResponse,
                                                  ConnectionHelper.NoConnectionOnThisThreadException,
                                                  XmlRpcException
Get the mode field of the given VBD.

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

getType

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

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 VBD.

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

getCurrentlyAttached

public Boolean getCurrentlyAttached()
                             throws Types.BadServerResponse,
                                    ConnectionHelper.NoConnectionOnThisThreadException,
                                    XmlRpcException
Get the currently_attached field of the given VBD.

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

getStatusCode

public Long getStatusCode()
                   throws Types.BadServerResponse,
                          ConnectionHelper.NoConnectionOnThisThreadException,
                          XmlRpcException
Get the status_code field of the given VBD.

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

getStatusDetail

public String getStatusDetail()
                       throws Types.BadServerResponse,
                              ConnectionHelper.NoConnectionOnThisThreadException,
                              XmlRpcException
Get the status_detail field of the given VBD.

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

getRuntimeProperties

public Map<String,String> getRuntimeProperties()
                                        throws Types.BadServerResponse,
                                               ConnectionHelper.NoConnectionOnThisThreadException,
                                               XmlRpcException
Get the runtime_properties field of the given VBD.

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

getQosAlgorithmType

public String getQosAlgorithmType()
                           throws Types.BadServerResponse,
                                  ConnectionHelper.NoConnectionOnThisThreadException,
                                  XmlRpcException
Get the qos/algorithm_type field of the given VBD.

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

getQosAlgorithmParams

public Map<String,String> getQosAlgorithmParams()
                                         throws Types.BadServerResponse,
                                                ConnectionHelper.NoConnectionOnThisThreadException,
                                                XmlRpcException
Get the qos/algorithm_params field of the given VBD.

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

getQosSupportedAlgorithms

public Set<String> getQosSupportedAlgorithms()
                                      throws Types.BadServerResponse,
                                             ConnectionHelper.NoConnectionOnThisThreadException,
                                             XmlRpcException
Get the qos/supported_algorithms field of the given VBD.

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

getMetrics

public VBDMetrics getMetrics()
                      throws Types.BadServerResponse,
                             ConnectionHelper.NoConnectionOnThisThreadException,
                             XmlRpcException
Get the metrics field of the given VBD.

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

setUserdevice

public void setUserdevice(String userdevice)
                   throws Types.BadServerResponse,
                          ConnectionHelper.NoConnectionOnThisThreadException,
                          XmlRpcException
Set the userdevice field of the given VBD.

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

setBootable

public void setBootable(Boolean bootable)
                 throws Types.BadServerResponse,
                        ConnectionHelper.NoConnectionOnThisThreadException,
                        XmlRpcException
Set the bootable field of the given VBD.

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

setMode

public void setMode(com.xensource.xenapi.Types.VbdMode mode)
             throws Types.BadServerResponse,
                    ConnectionHelper.NoConnectionOnThisThreadException,
                    XmlRpcException
Set the mode field of the given VBD.

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

setType

public void setType(com.xensource.xenapi.Types.VbdType type)
             throws Types.BadServerResponse,
                    ConnectionHelper.NoConnectionOnThisThreadException,
                    XmlRpcException
Set the type field of the given VBD.

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

setQosAlgorithmType

public void setQosAlgorithmType(String algorithmType)
                         throws Types.BadServerResponse,
                                ConnectionHelper.NoConnectionOnThisThreadException,
                                XmlRpcException
Set the qos/algorithm_type field of the given VBD.

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

setQosAlgorithmParams

public void setQosAlgorithmParams(Map<String,String> algorithmParams)
                           throws Types.BadServerResponse,
                                  ConnectionHelper.NoConnectionOnThisThreadException,
                                  XmlRpcException
Set the qos/algorithm_params field of the given VBD.

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

addToQosAlgorithmParams

public void addToQosAlgorithmParams(String key,
                                    String value)
                             throws Types.BadServerResponse,
                                    ConnectionHelper.NoConnectionOnThisThreadException,
                                    XmlRpcException
Add the given key-value pair to the qos/algorithm_params field of the given VBD.

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

removeFromQosAlgorithmParams

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

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

mediaChange

public void mediaChange(VDI vdi)
                 throws Types.BadServerResponse,
                        ConnectionHelper.NoConnectionOnThisThreadException,
                        XmlRpcException
Change the media in the device for CDROM-like devices only. For other devices, detach the VBD and attach a new one

Parameters:
vdi - The new VDI to 'insert'
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

plug

public void plug()
          throws Types.BadServerResponse,
                 ConnectionHelper.NoConnectionOnThisThreadException,
                 XmlRpcException
Hotplug the specified VBD, dynamically attaching it to the running VM

Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

unplug

public void unplug()
            throws Types.BadServerResponse,
                   ConnectionHelper.NoConnectionOnThisThreadException,
                   XmlRpcException
Hot-unplug the specified VBD, dynamically unattaching it from the running VM

Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

getAll

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

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

getAllRecords

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

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