com.xensource.xenapi
Class SR

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

public class SR
extends Object

A storage repository


Nested Class Summary
static class SR.Record
          Represents all the fields in a SR
 
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 SR.
static Set<SR> getAll()
          Return a list of all the SRs known to the system.
static Map<SR,SR.Record> getAllRecords()
          Get all the SR Records at once, in a single XML RPC call
static Set<SR> getByNameLabel(String label)
          Get all the SR instances with the given label.
static SR getByUuid(String uuid)
          Get a reference to the SR instance with the specified UUID.
 String getContentType()
          Get the content_type field of the given SR.
protected static SR getInstFromRef(String ref)
           
 String getNameDescription()
          Get the name/description field of the given SR.
 String getNameLabel()
          Get the name/label field of the given SR.
 Map<String,String> getOtherConfig()
          Get the other_config field of the given SR.
 Set<PBD> getPBDs()
          Get the PBDs field of the given SR.
 Long getPhysicalSize()
          Get the physical_size field of the given SR.
 Long getPhysicalUtilisation()
          Get the physical_utilisation field of the given SR.
 SR.Record getRecord()
          Get a record containing the current state of the given SR.
 Boolean getShared()
          Get the shared field of the given SR.
static Set<String> getSupportedTypes()
          Return a set of all the SR types supported by the system
 String getType()
          Get the type field of the given SR.
 String getUuid()
          Get the uuid field of the given SR.
 Set<VDI> getVDIs()
          Get the VDIs field of the given SR.
 Long getVirtualAllocation()
          Get the virtual_allocation field of the given SR.
 void removeFromOtherConfig(String key)
          Remove the given key and its corresponding value from the other_config field of the given SR.
 void setNameDescription(String description)
          Set the name/description field of the given SR.
 void setNameLabel(String label)
          Set the name/label field of the given SR.
 void setOtherConfig(Map<String,String> otherConfig)
          Set the other_config field of the given SR.
 void setShared(Boolean shared)
          Set the shared field of the given SR.
 
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 SR getInstFromRef(String ref)

getRecord

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

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

getByUuid

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

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

getByNameLabel

public static Set<SR> getByNameLabel(String label)
                              throws Types.BadServerResponse,
                                     ConnectionHelper.NoConnectionOnThisThreadException,
                                     XmlRpcException
Get all the SR 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 SR.

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

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

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

getVDIs

public Set<VDI> getVDIs()
                 throws Types.BadServerResponse,
                        ConnectionHelper.NoConnectionOnThisThreadException,
                        XmlRpcException
Get the VDIs field of the given SR.

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

getPBDs

public Set<PBD> getPBDs()
                 throws Types.BadServerResponse,
                        ConnectionHelper.NoConnectionOnThisThreadException,
                        XmlRpcException
Get the PBDs field of the given SR.

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

getVirtualAllocation

public Long getVirtualAllocation()
                          throws Types.BadServerResponse,
                                 ConnectionHelper.NoConnectionOnThisThreadException,
                                 XmlRpcException
Get the virtual_allocation field of the given SR.

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

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

getPhysicalSize

public Long getPhysicalSize()
                     throws Types.BadServerResponse,
                            ConnectionHelper.NoConnectionOnThisThreadException,
                            XmlRpcException
Get the physical_size field of the given SR.

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

getType

public String getType()
               throws Types.BadServerResponse,
                      ConnectionHelper.NoConnectionOnThisThreadException,
                      XmlRpcException
Get the type field of the given SR.

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

getContentType

public String getContentType()
                      throws Types.BadServerResponse,
                             ConnectionHelper.NoConnectionOnThisThreadException,
                             XmlRpcException
Get the content_type field of the given SR.

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

getShared

public Boolean getShared()
                  throws Types.BadServerResponse,
                         ConnectionHelper.NoConnectionOnThisThreadException,
                         XmlRpcException
Get the shared field of the given SR.

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

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

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

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

setShared

public void setShared(Boolean shared)
               throws Types.BadServerResponse,
                      ConnectionHelper.NoConnectionOnThisThreadException,
                      XmlRpcException
Set the shared field of the given SR.

Parameters:
shared - 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 SR.

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

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 SR. If the key is not in that Map, then do nothing.

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

getSupportedTypes

public static Set<String> getSupportedTypes()
                                     throws Types.BadServerResponse,
                                            ConnectionHelper.NoConnectionOnThisThreadException,
                                            XmlRpcException
Return a set of all the SR types supported by the system

Returns:
the supported SR types
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

getAll

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

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

getAllRecords

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

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