com.xensource.xenapi
Class Network

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

public class Network
extends Object

A virtual network


Nested Class Summary
static class Network.Record
          Represents all the fields in a Network
 
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 network.
static Network create(Network.Record record)
          Create a new network instance, and return its handle.
 void destroy()
          Destroy the specified network instance.
static Set<Network> getAll()
          Return a list of all the networks known to the system.
static Map<Network,Network.Record> getAllRecords()
          Get all the Network Records at once, in a single XML RPC call
static Set<Network> getByNameLabel(String label)
          Get all the network instances with the given label.
static Network getByUuid(String uuid)
          Get a reference to the network instance with the specified UUID.
protected static Network getInstFromRef(String ref)
           
 String getNameDescription()
          Get the name/description field of the given network.
 String getNameLabel()
          Get the name/label field of the given network.
 Map<String,String> getOtherConfig()
          Get the other_config field of the given network.
 Set<PIF> getPIFs()
          Get the PIFs field of the given network.
 Network.Record getRecord()
          Get a record containing the current state of the given network.
 String getUuid()
          Get the uuid field of the given network.
 Set<VIF> getVIFs()
          Get the VIFs field of the given network.
 void removeFromOtherConfig(String key)
          Remove the given key and its corresponding value from the other_config field of the given network.
 void setNameDescription(String description)
          Set the name/description field of the given network.
 void setNameLabel(String label)
          Set the name/label field of the given network.
 void setOtherConfig(Map<String,String> otherConfig)
          Set the other_config field of the given network.
 
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 Network getInstFromRef(String ref)

getRecord

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

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

getByUuid

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

Throws:
Types.BadServerResponse
ConnectionHelper.NoConnectionOnThisThreadException
XmlRpcException

getByNameLabel

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

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

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

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

getVIFs

public Set<VIF> getVIFs()
                 throws Types.BadServerResponse,
                        ConnectionHelper.NoConnectionOnThisThreadException,
                        XmlRpcException
Get the VIFs field of the given network.

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

getPIFs

public Set<PIF> getPIFs()
                 throws Types.BadServerResponse,
                        ConnectionHelper.NoConnectionOnThisThreadException,
                        XmlRpcException
Get the PIFs field of the given network.

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

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

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

Parameters:
description - 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 network.

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

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

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

getAll

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

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

getAllRecords

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

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