OpenNebula
Cloud API

org.opennebula.client.vnet
Class VirtualNetwork

java.lang.Object
  extended by org.opennebula.client.PoolElement
      extended by org.opennebula.client.vnet.VirtualNetwork

public class VirtualNetwork
extends PoolElement

This class represents an OpenNebula virtual network. It also offers static XML-RPC call wrappers.


Field Summary
 
Fields inherited from class org.opennebula.client.PoolElement
client, id, xml, xpath
 
Constructor Summary
  VirtualNetwork(int id, Client client)
          Creates a new virtual network representation.
protected VirtualNetwork(org.w3c.dom.Node xmlElement, Client client)
           
 
Method Summary
static OneResponse allocate(Client client, java.lang.String description)
          Allocates a new virtual network in OpenNebula.
 OneResponse delete()
          Deletes the network from OpenNebula.
static OneResponse delete(Client client, int id)
          Deletes a network from OpenNebula.
 OneResponse info()
          Loads the xml representation of the virtual network.
static OneResponse info(Client client, int id)
          Retrieves the information of the given virtual network
 
Methods inherited from class org.opennebula.client.PoolElement
getId, getName, processInfo, state, xpath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VirtualNetwork

public VirtualNetwork(int id,
                      Client client)
Creates a new virtual network representation.

Parameters:
id - The virtual network id (nid) .
client - XML-RPC Client.

VirtualNetwork

protected VirtualNetwork(org.w3c.dom.Node xmlElement,
                         Client client)
See Also:
PoolElement
Method Detail

allocate

public static OneResponse allocate(Client client,
                                   java.lang.String description)
Allocates a new virtual network in OpenNebula.

Parameters:
client - XML-RPC Client.
description - A string containing the template of the virtual network.
Returns:
If successful the message contains the associated id generated for this virtual network.

info

public static OneResponse info(Client client,
                               int id)
Retrieves the information of the given virtual network

Parameters:
client - XML-RPC Client.
id - the virtual network id (nid) for the network to retrieve the information from.
Returns:
If successful the message contains the string with the information returned by OpenNebula.

delete

public static OneResponse delete(Client client,
                                 int id)
Deletes a network from OpenNebula.

Parameters:
client - XML-RPC Client.
id - The virtual network id (nid) of the target network.
Returns:
A encapsulated response.

info

public OneResponse info()
Loads the xml representation of the virtual network. The info is also stored internally.

See Also:
info(Client, int)

delete

public OneResponse delete()
Deletes the network from OpenNebula.

Returns:
A encapsulated response.

OpenNebula
Cloud API

Visit OpenNebula.org
Copyright 2002-2010 © OpenNebula Project Leads (OpenNebula.org).