com.xensource.xenapi
Class VIF

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

public class VIF
extends Object

A virtual network interface


Nested Class Summary
static class VIF.Record
          Represents all the fields in a VIF
 
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 VIF.
static VIF create(VIF.Record record)
          Create a new VIF instance, and return its handle.
 void destroy()
          Destroy the specified VIF instance.
static Set<VIF> getAll()
          Return a list of all the VIFs known to the system.
static Map<VIF,VIF.Record> getAllRecords()
          Get all the VIF Records at once, in a single XML RPC call
static VIF getByUuid(String uuid)
          Get a reference to the VIF instance with the specified UUID.
 Boolean getCurrentlyAttached()
          Get the currently_attached field of the given VIF.
 String getDevice()
          Get the device field of the given VIF.
protected static VIF getInstFromRef(String ref)
           
 String getMAC()
          Get the MAC field of the given VIF.
 VIFMetrics getMetrics()
          Get the metrics field of the given VIF.
 Long getMTU()
          Get the MTU field of the given VIF.
 Network getNetwork()
          Get the network field of the given VIF.
 Map<String,String> getQosAlgorithmParams()
          Get the qos/algorithm_params field of the given VIF.
 String getQosAlgorithmType()
          Get the qos/algorithm_type field of the given VIF.
 Set<String> getQosSupportedAlgorithms()
          Get the qos/supported_algorithms field of the given VIF.
 VIF.Record getRecord()
          Get a record containing the current state of the given VIF.
 Map<String,String> getRuntimeProperties()
          Get the runtime_properties field of the given VIF.
 Long getStatusCode()
          Get the status_code field of the given VIF.
 String getStatusDetail()
          Get the status_detail field of the given VIF.
 String getUuid()
          Get the uuid field of the given VIF.
 VM getVM()
          Get the VM field of the given VIF.
 void plug()
          Hotplug the specified VIF, 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 VIF.
 void setDevice(String device)
          Set the device field of the given VIF.
 void setMAC(String MAC)
          Set the MAC field of the given VIF.
 void setMTU(Long MTU)
          Set the MTU field of the given VIF.
 void setQosAlgorithmParams(Map<String,String> algorithmParams)
          Set the qos/algorithm_params field of the given VIF.
 void setQosAlgorithmType(String algorithmType)
          Set the qos/algorithm_type field of the given VIF.
 void unplug()
          Hot-unplug the specified VIF, 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 VIF getInstFromRef(String ref)

getRecord

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

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

getByUuid

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

Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

getUuid

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

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

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

getNetwork

public Network getNetwork()
                   throws Types.BadServerResponse,
                          ConnectionHelper.NoConnectionOnThisThreadException,
                          XmlRpcException
Get the network field of the given VIF.

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

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

getMAC

public String getMAC()
              throws Types.BadServerResponse,
                     ConnectionHelper.NoConnectionOnThisThreadException,
                     XmlRpcException
Get the MAC field of the given VIF.

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

getMTU

public Long getMTU()
            throws Types.BadServerResponse,
                   ConnectionHelper.NoConnectionOnThisThreadException,
                   XmlRpcException
Get the MTU field of the given VIF.

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

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

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

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

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

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

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

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

getMetrics

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

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

setDevice

public void setDevice(String device)
               throws Types.BadServerResponse,
                      ConnectionHelper.NoConnectionOnThisThreadException,
                      XmlRpcException
Set the device field of the given VIF.

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

setMAC

public void setMAC(String MAC)
            throws Types.BadServerResponse,
                   ConnectionHelper.NoConnectionOnThisThreadException,
                   XmlRpcException
Set the MAC field of the given VIF.

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

setMTU

public void setMTU(Long MTU)
            throws Types.BadServerResponse,
                   ConnectionHelper.NoConnectionOnThisThreadException,
                   XmlRpcException
Set the MTU field of the given VIF.

Parameters:
MTU - 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 VIF.

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

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

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

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

plug

public void plug()
          throws Types.BadServerResponse,
                 ConnectionHelper.NoConnectionOnThisThreadException,
                 XmlRpcException
Hotplug the specified VIF, 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 VIF, dynamically unattaching it from the running VM

Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

getAll

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

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

getAllRecords

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

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