com.xensource.xenapi
Class PIF

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

public class PIF
extends Object

A physical network interface (note separate VLANs are represented as several PIFs)


Nested Class Summary
static class PIF.Record
          Represents all the fields in a PIF
 
Field Summary
protected  String ref
          The XenAPI reference to this object.
 
Method Summary
static PIF createVLAN(String device, Network network, Host host, Long VLAN)
          Create a VLAN interface from an existing physical interface
 void destroy()
          Destroy the interface (provided it is a synthetic interface like a VLAN; fail if it is a physical interface)
static Set<PIF> getAll()
          Return a list of all the PIFs known to the system.
static Map<PIF,PIF.Record> getAllRecords()
          Get all the PIF Records at once, in a single XML RPC call
static PIF getByUuid(String uuid)
          Get a reference to the PIF instance with the specified UUID.
 String getDevice()
          Get the device field of the given PIF.
 Host getHost()
          Get the host field of the given PIF.
protected static PIF getInstFromRef(String ref)
           
 String getMAC()
          Get the MAC field of the given PIF.
 PIFMetrics getMetrics()
          Get the metrics field of the given PIF.
 Long getMTU()
          Get the MTU field of the given PIF.
 Network getNetwork()
          Get the network field of the given PIF.
 PIF.Record getRecord()
          Get a record containing the current state of the given PIF.
 String getUuid()
          Get the uuid field of the given PIF.
 Long getVLAN()
          Get the VLAN field of the given PIF.
 void setDevice(String device)
          Set the device field of the given PIF.
 void setMAC(String MAC)
          Set the MAC field of the given PIF.
 void setMTU(Long MTU)
          Set the MTU field of the given PIF.
 void setVLAN(Long VLAN)
          Set the VLAN field of the given PIF.
 
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 PIF getInstFromRef(String ref)

getRecord

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

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

getByUuid

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

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

getUuid

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

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

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

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

getHost

public Host getHost()
             throws Types.BadServerResponse,
                    ConnectionHelper.NoConnectionOnThisThreadException,
                    XmlRpcException
Get the host field of the given PIF.

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

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

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

getVLAN

public Long getVLAN()
             throws Types.BadServerResponse,
                    ConnectionHelper.NoConnectionOnThisThreadException,
                    XmlRpcException
Get the VLAN field of the given PIF.

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

getMetrics

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

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

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

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

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

setVLAN

public void setVLAN(Long VLAN)
             throws Types.BadServerResponse,
                    ConnectionHelper.NoConnectionOnThisThreadException,
                    XmlRpcException
Set the VLAN field of the given PIF.

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

createVLAN

public static PIF createVLAN(String device,
                             Network network,
                             Host host,
                             Long VLAN)
                      throws Types.BadServerResponse,
                             ConnectionHelper.NoConnectionOnThisThreadException,
                             XmlRpcException,
                             Types.VlanTagInvalid
Create a VLAN interface from an existing physical interface

Parameters:
device - physical interface on which to crate the VLAN interface
network - network to which this interface should be connected
host - physical machine to which this PIF is connected
VLAN - VLAN tag for the new interface
Returns:
The reference of the created PIF object
Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException
Types.VlanTagInvalid

destroy

public void destroy()
             throws Types.BadServerResponse,
                    ConnectionHelper.NoConnectionOnThisThreadException,
                    XmlRpcException,
                    Types.PifIsPhysical
Destroy the interface (provided it is a synthetic interface like a VLAN; fail if it is a physical interface)

Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException
Types.PifIsPhysical

getAll

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

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

getAllRecords

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

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