com.xensource.xenapi
Class Network

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

public class Network
extends XenAPIObject

A virtual network First published in XenServer 4.0.


Nested Class Summary
static class Network.Record
          Represents all the fields in a Network
 
Field Summary
protected  java.lang.String ref
          The XenAPI reference (OpaqueRef) to this object.
 
Method Summary
 void addTags(Connection c, java.lang.String value)
          Add the given value to the tags field of the given network.
 void addToOtherConfig(Connection c, java.lang.String key, java.lang.String value)
          Add the given key-value pair to the other_config field of the given network.
static Network create(Connection c, Network.Record record)
          Create a new network instance, and return its handle.
static Task createAsync(Connection c, Network.Record record)
          Create a new network instance, and return its handle.
 Blob createNewBlob(Connection c, java.lang.String name, java.lang.String mimeType)
          Create a placeholder for a named binary blob of data that is associated with this pool First published in XenServer 5.0.
 Blob createNewBlob(Connection c, java.lang.String name, java.lang.String mimeType, java.lang.Boolean _public)
          Create a placeholder for a named binary blob of data that is associated with this pool First published in XenServer 5.0.
 Task createNewBlobAsync(Connection c, java.lang.String name, java.lang.String mimeType)
          Create a placeholder for a named binary blob of data that is associated with this pool First published in XenServer 5.0.
 Task createNewBlobAsync(Connection c, java.lang.String name, java.lang.String mimeType, java.lang.Boolean _public)
          Create a placeholder for a named binary blob of data that is associated with this pool First published in XenServer 5.0.
 void destroy(Connection c)
          Destroy the specified network instance.
 Task destroyAsync(Connection c)
          Destroy the specified network instance.
 boolean equals(java.lang.Object obj)
          If obj is a Network, compares XenAPI references for equality.
static java.util.Set<Network> getAll(Connection c)
          Return a list of all the networks known to the system.
 java.util.Set<Types.NetworkOperations> getAllowedOperations(Connection c)
          Get the allowed_operations field of the given network.
static java.util.Map<Network,Network.Record> getAllRecords(Connection c)
          Return a map of network references to network records for all networks known to the system.
 java.util.Map<VIF,java.lang.String> getAssignedIps(Connection c)
          Get the assigned_ips field of the given network.
 java.util.Map<java.lang.String,Blob> getBlobs(Connection c)
          Get the blobs field of the given network.
 java.lang.String getBridge(Connection c)
          Get the bridge field of the given network.
static java.util.Set<Network> getByNameLabel(Connection c, java.lang.String label)
          Get all the network instances with the given label.
static Network getByUuid(Connection c, java.lang.String uuid)
          Get a reference to the network instance with the specified UUID.
 java.util.Map<java.lang.String,Types.NetworkOperations> getCurrentOperations(Connection c)
          Get the current_operations field of the given network.
 Types.NetworkDefaultLockingMode getDefaultLockingMode(Connection c)
          Get the default_locking_mode field of the given network.
 java.lang.Long getMTU(Connection c)
          Get the MTU field of the given network.
 java.lang.String getNameDescription(Connection c)
          Get the name/description field of the given network.
 java.lang.String getNameLabel(Connection c)
          Get the name/label field of the given network.
 java.util.Map<java.lang.String,java.lang.String> getOtherConfig(Connection c)
          Get the other_config field of the given network.
 java.util.Set<PIF> getPIFs(Connection c)
          Get the PIFs field of the given network.
 Network.Record getRecord(Connection c)
          Get a record containing the current state of the given network.
 java.util.Set<java.lang.String> getTags(Connection c)
          Get the tags field of the given network.
 java.lang.String getUuid(Connection c)
          Get the uuid field of the given network.
 java.util.Set<VIF> getVIFs(Connection c)
          Get the VIFs field of the given network.
 int hashCode()
           
 void removeFromOtherConfig(Connection c, java.lang.String key)
          Remove the given key and its corresponding value from the other_config field of the given network.
 void removeTags(Connection c, java.lang.String value)
          Remove the given value from the tags field of the given network.
 void setDefaultLockingMode(Connection c, Types.NetworkDefaultLockingMode value)
          Set the default locking mode for VIFs attached to this network First published in XenServer 6.1.
 Task setDefaultLockingModeAsync(Connection c, Types.NetworkDefaultLockingMode value)
          Set the default locking mode for VIFs attached to this network First published in XenServer 6.1.
 void setMTU(Connection c, java.lang.Long MTU)
          Set the MTU field of the given network.
 void setNameDescription(Connection c, java.lang.String description)
          Set the name/description field of the given network.
 void setNameLabel(Connection c, java.lang.String label)
          Set the name/label field of the given network.
 void setOtherConfig(Connection c, java.util.Map<java.lang.String,java.lang.String> otherConfig)
          Set the other_config field of the given network.
 void setTags(Connection c, java.util.Set<java.lang.String> tags)
          Set the tags field of the given network.
 java.lang.String toWireString()
           
 
Methods inherited from class com.xensource.xenapi.XenAPIObject
isNull
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ref

protected final java.lang.String ref
The XenAPI reference (OpaqueRef) to this object.

Method Detail

toWireString

public java.lang.String toWireString()
Specified by:
toWireString in class XenAPIObject
Returns:
The XenAPI reference (OpaqueRef) to this object.

equals

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

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getRecord

public Network.Record getRecord(Connection c)
                         throws Types.BadServerResponse,
                                Types.XenAPIException,
                                org.apache.xmlrpc.XmlRpcException
Get a record containing the current state of the given network. First published in XenServer 4.0.

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

getByUuid

public static Network getByUuid(Connection c,
                                java.lang.String uuid)
                         throws Types.BadServerResponse,
                                Types.XenAPIException,
                                org.apache.xmlrpc.XmlRpcException
Get a reference to the network instance with the specified UUID. First published in XenServer 4.0.

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,
                               Network.Record record)
                        throws Types.BadServerResponse,
                               Types.XenAPIException,
                               org.apache.xmlrpc.XmlRpcException
Create a new network instance, and return its handle. First published in XenServer 4.0.

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

create

public static Network create(Connection c,
                             Network.Record record)
                      throws Types.BadServerResponse,
                             Types.XenAPIException,
                             org.apache.xmlrpc.XmlRpcException
Create a new network instance, and return its handle. First published in XenServer 4.0.

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 network instance. First published in XenServer 4.0.

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 network instance. First published in XenServer 4.0.

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

getByNameLabel

public static java.util.Set<Network> getByNameLabel(Connection c,
                                                    java.lang.String label)
                                             throws Types.BadServerResponse,
                                                    Types.XenAPIException,
                                                    org.apache.xmlrpc.XmlRpcException
Get all the network instances with the given label. First published in XenServer 4.0.

Parameters:
label - label of object to return
Returns:
references to objects with matching names
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getUuid

public java.lang.String getUuid(Connection c)
                         throws Types.BadServerResponse,
                                Types.XenAPIException,
                                org.apache.xmlrpc.XmlRpcException
Get the uuid field of the given network. First published in XenServer 4.0.

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

getNameLabel

public java.lang.String getNameLabel(Connection c)
                              throws Types.BadServerResponse,
                                     Types.XenAPIException,
                                     org.apache.xmlrpc.XmlRpcException
Get the name/label field of the given network. First published in XenServer 4.0.

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

getNameDescription

public java.lang.String getNameDescription(Connection c)
                                    throws Types.BadServerResponse,
                                           Types.XenAPIException,
                                           org.apache.xmlrpc.XmlRpcException
Get the name/description field of the given network. First published in XenServer 4.0.

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

getAllowedOperations

public java.util.Set<Types.NetworkOperations> getAllowedOperations(Connection c)
                                                            throws Types.BadServerResponse,
                                                                   Types.XenAPIException,
                                                                   org.apache.xmlrpc.XmlRpcException
Get the allowed_operations field of the given network. First published in XenServer 4.0.

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

getCurrentOperations

public java.util.Map<java.lang.String,Types.NetworkOperations> getCurrentOperations(Connection c)
                                                                             throws Types.BadServerResponse,
                                                                                    Types.XenAPIException,
                                                                                    org.apache.xmlrpc.XmlRpcException
Get the current_operations field of the given network. First published in XenServer 4.0.

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

getVIFs

public java.util.Set<VIF> getVIFs(Connection c)
                           throws Types.BadServerResponse,
                                  Types.XenAPIException,
                                  org.apache.xmlrpc.XmlRpcException
Get the VIFs field of the given network. First published in XenServer 4.0.

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

getPIFs

public java.util.Set<PIF> getPIFs(Connection c)
                           throws Types.BadServerResponse,
                                  Types.XenAPIException,
                                  org.apache.xmlrpc.XmlRpcException
Get the PIFs field of the given network. First published in XenServer 4.0.

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

getMTU

public java.lang.Long getMTU(Connection c)
                      throws Types.BadServerResponse,
                             Types.XenAPIException,
                             org.apache.xmlrpc.XmlRpcException
Get the MTU field of the given network. First published in XenServer 5.6.

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

getOtherConfig

public java.util.Map<java.lang.String,java.lang.String> getOtherConfig(Connection c)
                                                                throws Types.BadServerResponse,
                                                                       Types.XenAPIException,
                                                                       org.apache.xmlrpc.XmlRpcException
Get the other_config field of the given network. First published in XenServer 4.0.

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

getBridge

public java.lang.String getBridge(Connection c)
                           throws Types.BadServerResponse,
                                  Types.XenAPIException,
                                  org.apache.xmlrpc.XmlRpcException
Get the bridge field of the given network. First published in XenServer 4.0.

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

getBlobs

public java.util.Map<java.lang.String,Blob> getBlobs(Connection c)
                                              throws Types.BadServerResponse,
                                                     Types.XenAPIException,
                                                     org.apache.xmlrpc.XmlRpcException
Get the blobs field of the given network. First published in XenServer 5.0.

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

getTags

public java.util.Set<java.lang.String> getTags(Connection c)
                                        throws Types.BadServerResponse,
                                               Types.XenAPIException,
                                               org.apache.xmlrpc.XmlRpcException
Get the tags field of the given network. First published in XenServer 5.0.

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

getDefaultLockingMode

public Types.NetworkDefaultLockingMode getDefaultLockingMode(Connection c)
                                                      throws Types.BadServerResponse,
                                                             Types.XenAPIException,
                                                             org.apache.xmlrpc.XmlRpcException
Get the default_locking_mode field of the given network. First published in XenServer 6.1.

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

getAssignedIps

public java.util.Map<VIF,java.lang.String> getAssignedIps(Connection c)
                                                   throws Types.BadServerResponse,
                                                          Types.XenAPIException,
                                                          org.apache.xmlrpc.XmlRpcException
Get the assigned_ips field of the given network. First published in XenServer 6.5.

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

setNameLabel

public void setNameLabel(Connection c,
                         java.lang.String label)
                  throws Types.BadServerResponse,
                         Types.XenAPIException,
                         org.apache.xmlrpc.XmlRpcException
Set the name/label field of the given network. First published in XenServer 4.0.

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

setNameDescription

public void setNameDescription(Connection c,
                               java.lang.String description)
                        throws Types.BadServerResponse,
                               Types.XenAPIException,
                               org.apache.xmlrpc.XmlRpcException
Set the name/description field of the given network. First published in XenServer 4.0.

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

setMTU

public void setMTU(Connection c,
                   java.lang.Long MTU)
            throws Types.BadServerResponse,
                   Types.XenAPIException,
                   org.apache.xmlrpc.XmlRpcException
Set the MTU field of the given network. First published in XenServer 5.6.

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

setOtherConfig

public void setOtherConfig(Connection c,
                           java.util.Map<java.lang.String,java.lang.String> otherConfig)
                    throws Types.BadServerResponse,
                           Types.XenAPIException,
                           org.apache.xmlrpc.XmlRpcException
Set the other_config field of the given network. First published in XenServer 4.0.

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

addToOtherConfig

public void addToOtherConfig(Connection c,
                             java.lang.String key,
                             java.lang.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 network. First published in XenServer 4.0.

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

removeFromOtherConfig

public void removeFromOtherConfig(Connection c,
                                  java.lang.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 network. If the key is not in that Map, then do nothing. First published in XenServer 4.0.

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

setTags

public void setTags(Connection c,
                    java.util.Set<java.lang.String> tags)
             throws Types.BadServerResponse,
                    Types.XenAPIException,
                    org.apache.xmlrpc.XmlRpcException
Set the tags field of the given network. First published in XenServer 5.0.

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

addTags

public void addTags(Connection c,
                    java.lang.String value)
             throws Types.BadServerResponse,
                    Types.XenAPIException,
                    org.apache.xmlrpc.XmlRpcException
Add the given value to the tags field of the given network. If the value is already in that Set, then do nothing. First published in XenServer 5.0.

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

removeTags

public void removeTags(Connection c,
                       java.lang.String value)
                throws Types.BadServerResponse,
                       Types.XenAPIException,
                       org.apache.xmlrpc.XmlRpcException
Remove the given value from the tags field of the given network. If the value is not in that Set, then do nothing. First published in XenServer 5.0.

Parameters:
value - Value to remove
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

createNewBlobAsync

public Task createNewBlobAsync(Connection c,
                               java.lang.String name,
                               java.lang.String mimeType)
                        throws Types.BadServerResponse,
                               Types.XenAPIException,
                               org.apache.xmlrpc.XmlRpcException
Create a placeholder for a named binary blob of data that is associated with this pool First published in XenServer 5.0.

Parameters:
name - The name associated with the blob
mimeType - The mime type for the data. Empty string translates to application/octet-stream
Returns:
Task
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

createNewBlob

public Blob createNewBlob(Connection c,
                          java.lang.String name,
                          java.lang.String mimeType)
                   throws Types.BadServerResponse,
                          Types.XenAPIException,
                          org.apache.xmlrpc.XmlRpcException
Create a placeholder for a named binary blob of data that is associated with this pool First published in XenServer 5.0.

Parameters:
name - The name associated with the blob
mimeType - The mime type for the data. Empty string translates to application/octet-stream
Returns:
The reference of the blob, needed for populating its data
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

createNewBlobAsync

public Task createNewBlobAsync(Connection c,
                               java.lang.String name,
                               java.lang.String mimeType,
                               java.lang.Boolean _public)
                        throws Types.BadServerResponse,
                               Types.XenAPIException,
                               org.apache.xmlrpc.XmlRpcException
Create a placeholder for a named binary blob of data that is associated with this pool First published in XenServer 5.0.

Parameters:
name - The name associated with the blob
mimeType - The mime type for the data. Empty string translates to application/octet-stream
_public - True if the blob should be publicly available First published in XenServer 6.1.
Returns:
Task
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

createNewBlob

public Blob createNewBlob(Connection c,
                          java.lang.String name,
                          java.lang.String mimeType,
                          java.lang.Boolean _public)
                   throws Types.BadServerResponse,
                          Types.XenAPIException,
                          org.apache.xmlrpc.XmlRpcException
Create a placeholder for a named binary blob of data that is associated with this pool First published in XenServer 5.0.

Parameters:
name - The name associated with the blob
mimeType - The mime type for the data. Empty string translates to application/octet-stream
_public - True if the blob should be publicly available First published in XenServer 6.1.
Returns:
The reference of the blob, needed for populating its data
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

setDefaultLockingModeAsync

public Task setDefaultLockingModeAsync(Connection c,
                                       Types.NetworkDefaultLockingMode value)
                                throws Types.BadServerResponse,
                                       Types.XenAPIException,
                                       org.apache.xmlrpc.XmlRpcException
Set the default locking mode for VIFs attached to this network First published in XenServer 6.1.

Parameters:
value - The default locking mode for VIFs attached to this network.
Returns:
Task
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

setDefaultLockingMode

public void setDefaultLockingMode(Connection c,
                                  Types.NetworkDefaultLockingMode value)
                           throws Types.BadServerResponse,
                                  Types.XenAPIException,
                                  org.apache.xmlrpc.XmlRpcException
Set the default locking mode for VIFs attached to this network First published in XenServer 6.1.

Parameters:
value - The default locking mode for VIFs attached to this network.
Throws:
Types.BadServerResponse
Types.XenAPIException
org.apache.xmlrpc.XmlRpcException

getAll

public static java.util.Set<Network> getAll(Connection c)
                                     throws Types.BadServerResponse,
                                            Types.XenAPIException,
                                            org.apache.xmlrpc.XmlRpcException
Return a list of all the networks known to the system. First published in XenServer 4.0.

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

getAllRecords

public static java.util.Map<Network,Network.Record> getAllRecords(Connection c)
                                                           throws Types.BadServerResponse,
                                                                  Types.XenAPIException,
                                                                  org.apache.xmlrpc.XmlRpcException
Return a map of network references to network records for all networks known to the system. First published in XenServer 4.0.

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