Package org.opennebula.client.cluster
Class Cluster
java.lang.Object
org.opennebula.client.PoolElement
org.opennebula.client.cluster.Cluster
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddDatastore
(int dsId) Adds a Datastore to this Clusterstatic OneResponse
addDatastore
(Client client, int id, int dsId) Adds a Datastore to this ClusteraddHost
(int hid) Adds a Host to this Clusterstatic OneResponse
Adds a Host to this ClusteraddVnet
(int vnetId) Adds a VNet to this Clusterstatic OneResponse
Adds a VNet to this Clusterstatic OneResponse
Allocates a new cluster in OpenNebulaboolean
containsDatastore
(int id) Returns whether or not the datastore is part of this clusterboolean
containsHost
(int id) Returns whether or not the host is part of this clusterboolean
containsVnet
(int id) Returns whether or not the vnet is part of this clusterdelDatastore
(int dsId) Deletes a Datastore from this Clusterstatic OneResponse
delDatastore
(Client client, int id, int dsId) Deletes a Datastore from this Clusterdelete()
Deletes the cluster from OpenNebula.static OneResponse
Deletes a cluster from OpenNebula.delHost
(int hid) Deletes a Host from this Clusterstatic OneResponse
Deletes a Host from this ClusterdelVnet
(int vnetId) Deletes a VNet from this Clusterstatic OneResponse
Deletes a VNet from this Clusterinfo()
Loads the xml representation of the cluster.static OneResponse
Retrieves the information of the given cluster.static OneResponse
Retrieves the information of the given cluster.optimize()
Optimize Clusterstatic OneResponse
Optimize ClusterDelete Planstatic OneResponse
planDelete
(Client client, int id) Delete PlanExecute Planstatic OneResponse
planExecute
(Client client, int id) Execute PlanRenames this Clusterstatic OneResponse
Renames this Cluster.Replaces the cluster template.Replaces the cluster template.static OneResponse
Replaces the cluster contents.
-
Constructor Details
-
Cluster
Creates a new Cluster representation.- Parameters:
id
- The cluster id.client
- XML-RPC Client.
-
Cluster
- See Also:
-
-
Method Details
-
allocate
Allocates a new cluster in OpenNebula- Parameters:
client
- XML-RPC Client.name
- Name for the new cluster.- Returns:
- If successful the message contains the associated id generated for this cluster.
-
info
Retrieves the information of the given cluster.- Parameters:
client
- XML-RPC Client.id
- The cluster id.- Returns:
- If successful the message contains the string with the information returned by OpenNebula.
-
info
Retrieves the information of the given cluster.- Parameters:
client
- XML-RPC Client.id
- The Cluster id for the Cluster to retrieve the information fromdecrypt
- If true decrypt sensitive attributes- Returns:
- If successful the message contains the string with the information returned by OpenNebula.
-
delete
Deletes a cluster from OpenNebula.- Parameters:
client
- XML-RPC Client.id
- The cluster id.- Returns:
- A encapsulated response.
-
update
Replaces the cluster contents.- Parameters:
client
- XML-RPC Client.id
- The id of the target cluster we want to modify.new_template
- New template contents.append
- True to append new attributes instead of replace the whole template- Returns:
- If successful the message contains the cluster id.
-
addHost
Adds a Host to this Cluster- Parameters:
client
- XML-RPC Client.id
- The cluster id.hid
- Host ID.- Returns:
- A encapsulated response.
-
delHost
Deletes a Host from this Cluster- Parameters:
client
- XML-RPC Client.id
- The cluster id.hid
- Host ID.- Returns:
- A encapsulated response.
-
addDatastore
Adds a Datastore to this Cluster- Parameters:
client
- XML-RPC Client.id
- The cluster id.dsId
- Datastore ID.- Returns:
- A encapsulated response.
-
delDatastore
Deletes a Datastore from this Cluster- Parameters:
client
- XML-RPC Client.id
- The cluster id.dsId
- Datastore ID.- Returns:
- A encapsulated response.
-
addVnet
Adds a VNet to this Cluster- Parameters:
client
- XML-RPC Client.id
- The cluster id.vnetId
- VNet ID.- Returns:
- A encapsulated response.
-
delVnet
Deletes a VNet from this Cluster- Parameters:
client
- XML-RPC Client.id
- The cluster id.vnetId
- VNet ID.- Returns:
- A encapsulated response.
-
rename
Renames this Cluster.- Parameters:
client
- XML-RPC Client.id
- The cluster id.name
- New name for the Cluster- Returns:
- If successful the message contains the cluster id.
-
optimize
Optimize Cluster- Parameters:
client
- XML-RPC Client.id
- The cluster id.
-
planExecute
Execute Plan- Parameters:
client
- XML-RPC Client.id
- The cluster id.
-
planDelete
Delete Plan- Parameters:
client
- XML-RPC Client.id
- The cluster id.
-
info
Loads the xml representation of the cluster. The info is also stored internally.- See Also:
-
delete
Deletes the cluster from OpenNebula.- See Also:
-
update
Replaces the cluster template.- Parameters:
new_template
- New cluster template.- Returns:
- If successful the message contains the cluster id.
-
update
Replaces the cluster template.- Parameters:
new_template
- New cluster template.append
- True to append new attributes instead of replace the whole template- Returns:
- If successful the message contains the cluster id.
-
addHost
Adds a Host to this Cluster- Parameters:
hid
- Host ID.- Returns:
- A encapsulated response.
-
delHost
Deletes a Host from this Cluster- Parameters:
hid
- Host ID.- Returns:
- A encapsulated response.
-
addDatastore
Adds a Datastore to this Cluster- Parameters:
dsId
- Datastore ID.- Returns:
- A encapsulated response.
-
delDatastore
Deletes a Datastore from this Cluster- Parameters:
dsId
- Datastore ID.- Returns:
- A encapsulated response.
-
addVnet
Adds a VNet to this Cluster- Parameters:
vnetId
- VNet ID.- Returns:
- A encapsulated response.
-
delVnet
Deletes a VNet from this Cluster- Parameters:
vnetId
- VNet ID.- Returns:
- A encapsulated response.
-
rename
Renames this Cluster- Parameters:
name
- New name for the Cluster.- Returns:
- If an error occurs the error message contains the reason.
-
optimize
Optimize Cluster- Returns:
- If an error occurs the error message contains the reason.
-
planExecute
Execute Plan- Returns:
- If an error occurs the error message contains the reason.
-
planDelete
Delete Plan- Returns:
- If an error occurs the error message contains the reason.
-
containsHost
public boolean containsHost(int id) Returns whether or not the host is part of this cluster- Parameters:
id
- The host ID.- Returns:
- Whether or not the host is part of this cluster.
-
containsDatastore
public boolean containsDatastore(int id) Returns whether or not the datastore is part of this cluster- Parameters:
id
- The datastore ID.- Returns:
- Whether or not the datastore is part of this cluster.
-
containsVnet
public boolean containsVnet(int id) Returns whether or not the vnet is part of this cluster- Parameters:
id
- The vnet ID.- Returns:
- Whether or not the vnet is part of this cluster.
-