com.xensource.xenapi
Class VIF

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

public class VIF
extends XenAPIObject

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 addToOtherConfig(Connection c, String key, String value)
          Add the given key-value pair to the other_config field of the given VIF.
 void addToQosAlgorithmParams(Connection c, String key, String value)
          Add the given key-value pair to the qos/algorithm_params field of the given VIF.
static VIF create(Connection c, VIF.Record record)
          Create a new VIF instance, and return its handle.
static Task createAsync(Connection c, VIF.Record record)
          Create a new VIF instance, and return its handle.
 void destroy(Connection c)
          Destroy the specified VIF instance.
 Task destroyAsync(Connection c)
          Destroy the specified VIF instance.
 boolean equals(Object obj)
          If obj is a VIF, compares XenAPI references for equality.
static Set<VIF> getAll(Connection c)
          Return a list of all the VIFs known to the system.
 Set<Types.VifOperations> getAllowedOperations(Connection c)
          Get the allowed_operations field of the given VIF.
static Map<VIF,VIF.Record> getAllRecords(Connection c)
          Return a map of VIF references to VIF records for all VIFs known to the system.
static VIF getByUuid(Connection c, String uuid)
          Get a reference to the VIF instance with the specified UUID.
 Boolean getCurrentlyAttached(Connection c)
          Get the currently_attached field of the given VIF.
 Map<String,Types.VifOperations> getCurrentOperations(Connection c)
          Get the current_operations field of the given VIF.
 String getDevice(Connection c)
          Get the device field of the given VIF.
 String getMAC(Connection c)
          Get the MAC field of the given VIF.
 Boolean getMACAutogenerated(Connection c)
          Get the MAC_autogenerated field of the given VIF.
 VIFMetrics getMetrics(Connection c)
          Get the metrics field of the given VIF.
 Long getMTU(Connection c)
          Get the MTU field of the given VIF.
 Network getNetwork(Connection c)
          Get the network field of the given VIF.
 Map<String,String> getOtherConfig(Connection c)
          Get the other_config field of the given VIF.
 Map<String,String> getQosAlgorithmParams(Connection c)
          Get the qos/algorithm_params field of the given VIF.
 String getQosAlgorithmType(Connection c)
          Get the qos/algorithm_type field of the given VIF.
 Set<String> getQosSupportedAlgorithms(Connection c)
          Get the qos/supported_algorithms field of the given VIF.
 VIF.Record getRecord(Connection c)
          Get a record containing the current state of the given VIF.
 Map<String,String> getRuntimeProperties(Connection c)
          Get the runtime_properties field of the given VIF.
 Long getStatusCode(Connection c)
          Get the status_code field of the given VIF.
 String getStatusDetail(Connection c)
          Get the status_detail field of the given VIF.
 String getUuid(Connection c)
          Get the uuid field of the given VIF.
 VM getVM(Connection c)
          Get the VM field of the given VIF.
 int hashCode()
           
 void plug(Connection c)
          Hotplug the specified VIF, dynamically attaching it to the running VM
 Task plugAsync(Connection c)
          Hotplug the specified VIF, dynamically attaching it to the running VM
 void removeFromOtherConfig(Connection c, String key)
          Remove the given key and its corresponding value from the other_config field of the given VIF.
 void removeFromQosAlgorithmParams(Connection c, String key)
          Remove the given key and its corresponding value from the qos/algorithm_params field of the given VIF.
 void setOtherConfig(Connection c, Map<String,String> otherConfig)
          Set the other_config field of the given VIF.
 void setQosAlgorithmParams(Connection c, Map<String,String> algorithmParams)
          Set the qos/algorithm_params field of the given VIF.
 void setQosAlgorithmType(Connection c, String algorithmType)
          Set the qos/algorithm_type field of the given VIF.
 String toWireString()
           
 void unplug(Connection c)
          Hot-unplug the specified VIF, dynamically unattaching it from the running VM
 Task unplugAsync(Connection c)
          Hot-unplug the specified VIF, dynamically unattaching it from the running VM
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ref

protected final String ref
The XenAPI reference to this object.

Method Detail

toWireString

public String toWireString()
Specified by:
toWireString in class XenAPIObject

equals

public boolean equals(Object obj)
If obj is a VIF, compares XenAPI references for equality.

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getRecord

public VIF.Record getRecord(Connection c)
                     throws Types.BadServerResponse,
                            Types.XenAPIException,
                            org.apache.xmlrpc.XmlRpcException
Get a record containing the current state of the given VIF.

Returns:
all fields from the object
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getByUuid

public static VIF getByUuid(Connection c,
                            String uuid)
                     throws Types.BadServerResponse,
                            Types.XenAPIException,
                            org.apache.xmlrpc.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
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

createAsync

public static Task createAsync(Connection c,
                               VIF.Record record)
                        throws Types.BadServerResponse,
                               Types.XenAPIException,
                               org.apache.xmlrpc.XmlRpcException
Create a new VIF instance, and return its handle.

Parameters:
record - All constructor arguments
Returns:
Task
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

create

public static VIF create(Connection c,
                         VIF.Record record)
                  throws Types.BadServerResponse,
                         Types.XenAPIException,
                         org.apache.xmlrpc.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
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

destroyAsync

public Task destroyAsync(Connection c)
                  throws Types.BadServerResponse,
                         Types.XenAPIException,
                         org.apache.xmlrpc.XmlRpcException
Destroy the specified VIF instance.

Returns:
Task
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

destroy

public void destroy(Connection c)
             throws Types.BadServerResponse,
                    Types.XenAPIException,
                    org.apache.xmlrpc.XmlRpcException
Destroy the specified VIF instance.

Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getUuid

public String getUuid(Connection c)
               throws Types.BadServerResponse,
                      Types.XenAPIException,
                      org.apache.xmlrpc.XmlRpcException
Get the uuid field of the given VIF.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getAllowedOperations

public Set<Types.VifOperations> getAllowedOperations(Connection c)
                                              throws Types.BadServerResponse,
                                                     Types.XenAPIException,
                                                     org.apache.xmlrpc.XmlRpcException
Get the allowed_operations field of the given VIF.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getCurrentOperations

public Map<String,Types.VifOperations> getCurrentOperations(Connection c)
                                                     throws Types.BadServerResponse,
                                                            Types.XenAPIException,
                                                            org.apache.xmlrpc.XmlRpcException
Get the current_operations field of the given VIF.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getDevice

public String getDevice(Connection c)
                 throws Types.BadServerResponse,
                        Types.XenAPIException,
                        org.apache.xmlrpc.XmlRpcException
Get the device field of the given VIF.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getNetwork

public Network getNetwork(Connection c)
                   throws Types.BadServerResponse,
                          Types.XenAPIException,
                          org.apache.xmlrpc.XmlRpcException
Get the network field of the given VIF.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getVM

public VM getVM(Connection c)
         throws Types.BadServerResponse,
                Types.XenAPIException,
                org.apache.xmlrpc.XmlRpcException
Get the VM field of the given VIF.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getMAC

public String getMAC(Connection c)
              throws Types.BadServerResponse,
                     Types.XenAPIException,
                     org.apache.xmlrpc.XmlRpcException
Get the MAC field of the given VIF.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getMTU

public Long getMTU(Connection c)
            throws Types.BadServerResponse,
                   Types.XenAPIException,
                   org.apache.xmlrpc.XmlRpcException
Get the MTU field of the given VIF.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getOtherConfig

public Map<String,String> getOtherConfig(Connection c)
                                  throws Types.BadServerResponse,
                                         Types.XenAPIException,
                                         org.apache.xmlrpc.XmlRpcException
Get the other_config field of the given VIF.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getCurrentlyAttached

public Boolean getCurrentlyAttached(Connection c)
                             throws Types.BadServerResponse,
                                    Types.XenAPIException,
                                    org.apache.xmlrpc.XmlRpcException
Get the currently_attached field of the given VIF.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getStatusCode

public Long getStatusCode(Connection c)
                   throws Types.BadServerResponse,
                          Types.XenAPIException,
                          org.apache.xmlrpc.XmlRpcException
Get the status_code field of the given VIF.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getStatusDetail

public String getStatusDetail(Connection c)
                       throws Types.BadServerResponse,
                              Types.XenAPIException,
                              org.apache.xmlrpc.XmlRpcException
Get the status_detail field of the given VIF.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getRuntimeProperties

public Map<String,String> getRuntimeProperties(Connection c)
                                        throws Types.BadServerResponse,
                                               Types.XenAPIException,
                                               org.apache.xmlrpc.XmlRpcException
Get the runtime_properties field of the given VIF.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getQosAlgorithmType

public String getQosAlgorithmType(Connection c)
                           throws Types.BadServerResponse,
                                  Types.XenAPIException,
                                  org.apache.xmlrpc.XmlRpcException
Get the qos/algorithm_type field of the given VIF.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getQosAlgorithmParams

public Map<String,String> getQosAlgorithmParams(Connection c)
                                         throws Types.BadServerResponse,
                                                Types.XenAPIException,
                                                org.apache.xmlrpc.XmlRpcException
Get the qos/algorithm_params field of the given VIF.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getQosSupportedAlgorithms

public Set<String> getQosSupportedAlgorithms(Connection c)
                                      throws Types.BadServerResponse,
                                             Types.XenAPIException,
                                             org.apache.xmlrpc.XmlRpcException
Get the qos/supported_algorithms field of the given VIF.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getMetrics

public VIFMetrics getMetrics(Connection c)
                      throws Types.BadServerResponse,
                             Types.XenAPIException,
                             org.apache.xmlrpc.XmlRpcException
Get the metrics field of the given VIF.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getMACAutogenerated

public Boolean getMACAutogenerated(Connection c)
                            throws Types.BadServerResponse,
                                   Types.XenAPIException,
                                   org.apache.xmlrpc.XmlRpcException
Get the MAC_autogenerated field of the given VIF.

Returns:
value of the field
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

setOtherConfig

public void setOtherConfig(Connection c,
                           Map<String,String> otherConfig)
                    throws Types.BadServerResponse,
                           Types.XenAPIException,
                           org.apache.xmlrpc.XmlRpcException
Set the other_config field of the given VIF.

Parameters:
otherConfig - New value to set
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

addToOtherConfig

public void addToOtherConfig(Connection c,
                             String key,
                             String value)
                      throws Types.BadServerResponse,
                             Types.XenAPIException,
                             org.apache.xmlrpc.XmlRpcException
Add the given key-value pair to the other_config field of the given VIF.

Parameters:
key - Key to add
value - Value to add
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

removeFromOtherConfig

public void removeFromOtherConfig(Connection c,
                                  String key)
                           throws Types.BadServerResponse,
                                  Types.XenAPIException,
                                  org.apache.xmlrpc.XmlRpcException
Remove the given key and its corresponding value from the other_config field of the given VIF. If the key is not in that Map, then do nothing.

Parameters:
key - Key to remove
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

setQosAlgorithmType

public void setQosAlgorithmType(Connection c,
                                String algorithmType)
                         throws Types.BadServerResponse,
                                Types.XenAPIException,
                                org.apache.xmlrpc.XmlRpcException
Set the qos/algorithm_type field of the given VIF.

Parameters:
algorithmType - New value to set
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

setQosAlgorithmParams

public void setQosAlgorithmParams(Connection c,
                                  Map<String,String> algorithmParams)
                           throws Types.BadServerResponse,
                                  Types.XenAPIException,
                                  org.apache.xmlrpc.XmlRpcException
Set the qos/algorithm_params field of the given VIF.

Parameters:
algorithmParams - New value to set
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

addToQosAlgorithmParams

public void addToQosAlgorithmParams(Connection c,
                                    String key,
                                    String value)
                             throws Types.BadServerResponse,
                                    Types.XenAPIException,
                                    org.apache.xmlrpc.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
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

removeFromQosAlgorithmParams

public void removeFromQosAlgorithmParams(Connection c,
                                         String key)
                                  throws Types.BadServerResponse,
                                         Types.XenAPIException,
                                         org.apache.xmlrpc.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
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

plugAsync

public Task plugAsync(Connection c)
               throws Types.BadServerResponse,
                      Types.XenAPIException,
                      org.apache.xmlrpc.XmlRpcException
Hotplug the specified VIF, dynamically attaching it to the running VM

Returns:
Task
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

plug

public void plug(Connection c)
          throws Types.BadServerResponse,
                 Types.XenAPIException,
                 org.apache.xmlrpc.XmlRpcException
Hotplug the specified VIF, dynamically attaching it to the running VM

Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

unplugAsync

public Task unplugAsync(Connection c)
                 throws Types.BadServerResponse,
                        Types.XenAPIException,
                        org.apache.xmlrpc.XmlRpcException
Hot-unplug the specified VIF, dynamically unattaching it from the running VM

Returns:
Task
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

unplug

public void unplug(Connection c)
            throws Types.BadServerResponse,
                   Types.XenAPIException,
                   org.apache.xmlrpc.XmlRpcException
Hot-unplug the specified VIF, dynamically unattaching it from the running VM

Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getAll

public static Set<VIF> getAll(Connection c)
                       throws Types.BadServerResponse,
                              Types.XenAPIException,
                              org.apache.xmlrpc.XmlRpcException
Return a list of all the VIFs known to the system.

Returns:
references to all objects
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getAllRecords

public static Map<VIF,VIF.Record> getAllRecords(Connection c)
                                         throws Types.BadServerResponse,
                                                Types.XenAPIException,
                                                org.apache.xmlrpc.XmlRpcException
Return a map of VIF references to VIF records for all VIFs known to the system.

Returns:
records of all objects
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException