OpenNebula
Cloud API

org.opennebula.client.cluster
Class Cluster

java.lang.Object
  extended by org.opennebula.client.PoolElement
      extended by org.opennebula.client.cluster.Cluster

public class Cluster
extends PoolElement

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


Field Summary
 
Fields inherited from class org.opennebula.client.PoolElement
client, id, xml, xpath
 
Constructor Summary
  Cluster(int id, Client client)
          Creates a new Image representation.
protected Cluster(org.w3c.dom.Node xmlElement, Client client)
           
 
Method Summary
static OneResponse add(Client client, int id, int hid)
          Adds a host to a cluster.
 OneResponse add(Host host)
          Adds a host to the cluster.
 OneResponse add(int hid)
          Adds a host to the cluster.
static OneResponse allocate(Client client, java.lang.String name)
          Allocates a new Cluster in OpenNebula.
 OneResponse delete()
          Deletes the cluster from OpenNebula.
static OneResponse delete(Client client, int id)
          Deletes a cluster from OpenNebula.
 OneResponse info()
          Retrieves the information of the Cluster.
static OneResponse info(Client client, int id)
          Retrieves the information of the given Cluster.
static OneResponse remove(Client client, int hid)
          Removes a host from its cluster.
 OneResponse remove(Host host)
          Removes a host from its cluster.
 OneResponse remove(int hid)
          Removes a host from its cluster.
 
Methods inherited from class org.opennebula.client.PoolElement
getId, getName, id, processInfo, state, xpath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Cluster

public Cluster(int id,
               Client client)
Creates a new Image representation.

Parameters:
id - The image id.
client - XML-RPC Client.

Cluster

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

allocate

public static OneResponse allocate(Client client,
                                   java.lang.String name)
Allocates a new Cluster in OpenNebula.

Parameters:
client - XML-RPC Client.
name - Name for the cluster we want to add.
Returns:
If successful the message contains the associated id generated for this Cluster.

info

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

Parameters:
client - XML-RPC Client.
id - The cluster id for the cluster 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 cluster from OpenNebula.

Parameters:
client - XML-RPC Client.
id - The cluster id of the target cluster we want to delete.
Returns:
A encapsulated response.

add

public static OneResponse add(Client client,
                              int id,
                              int hid)
Adds a host to a cluster.

Parameters:
client - XML-RPC Client.
id - The cluster id of the cluster where the host will be assigned.
hid - The host id (hid) of the host.
Returns:
If an error occurs the error message contains the reason.

remove

public static OneResponse remove(Client client,
                                 int hid)
Removes a host from its cluster.

Parameters:
client - XML-RPC Client.
hid - The host id (hid) of the host.
Returns:
If an error occurs the error message contains the reason.

info

public OneResponse info()
Retrieves the information of the Cluster.

Returns:
If successful the message contains the string with the information returned by OpenNebula.

delete

public OneResponse delete()
Deletes the cluster from OpenNebula.

Returns:
A encapsulated response.

add

public OneResponse add(int hid)
Adds a host to the cluster.

Parameters:
hid - The host id (hid) of the host.
Returns:
If an error occurs the error message contains the reason.

add

public OneResponse add(Host host)
Adds a host to the cluster.

Parameters:
host - The Host to add.
Returns:
If an error occurs the error message contains the reason.

remove

public OneResponse remove(int hid)
Removes a host from its cluster.

Parameters:
hid - The host id (hid) of the host.
Returns:
If an error occurs the error message contains the reason.

remove

public OneResponse remove(Host host)
Removes a host from its cluster.

Parameters:
host - The Host to remove.
Returns:
If an error occurs the error message contains the reason.

OpenNebula
Cloud API

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