Package org.opennebula.client.vdc
Class Vdc
- java.lang.Object
-
- org.opennebula.client.PoolElement
-
- org.opennebula.client.vdc.Vdc
-
public class Vdc extends PoolElement
This class represents an OpenNebula vdc. It also offers static XML-RPC call wrappers.
-
-
Field Summary
-
Fields inherited from class org.opennebula.client.PoolElement
client, id, xml, xpath
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description OneResponse
addCluster(int zoneId, int clusterId)
Adds a cluster to this VDCstatic OneResponse
addCluster(Client client, int id, int zoneId, int clusterId)
Adds a cluster to this VDCOneResponse
addDatastore(int zoneId, int datastoreId)
Adds a datastore to this VDCstatic OneResponse
addDatastore(Client client, int id, int zoneId, int datastoreId)
Adds a datastore to this VDCOneResponse
addGroup(int groupId)
Adds a group to this VDCstatic OneResponse
addGroup(Client client, int id, int groupId)
Adds a group to this VDCOneResponse
addHost(int zoneId, int hostId)
Adds a host to this VDCstatic OneResponse
addHost(Client client, int id, int zoneId, int hostId)
Adds a host to this VDCOneResponse
addVnet(int zoneId, int vnetId)
Adds a vnet to this VDCstatic OneResponse
addVnet(Client client, int id, int zoneId, int vnetId)
Adds a vnet to this VDCstatic OneResponse
allocate(Client client, java.lang.String description)
Allocates a new vdc in OpenNebulaOneResponse
delCluster(int zoneId, int clusterId)
Deletes a cluster from this VDCstatic OneResponse
delCluster(Client client, int id, int zoneId, int clusterId)
Deletes a cluster from this VDCOneResponse
delDatastore(int zoneId, int datastoreId)
Deletes a datastore from this VDCstatic OneResponse
delDatastore(Client client, int id, int zoneId, int datastoreId)
Deletes a datastore from this VDCOneResponse
delete()
Deletes the vdc from OpenNebula.static OneResponse
delete(Client client, int id)
Deletes a vdc from OpenNebula.OneResponse
delGroup(int groupId)
Deletes a group from this VDCstatic OneResponse
delGroup(Client client, int id, int groupId)
Deletes a group from this VDCOneResponse
delHost(int zoneId, int hostId)
Deletes a host from this VDCstatic OneResponse
delHost(Client client, int id, int zoneId, int hostId)
Deletes a host from this VDCOneResponse
delVnet(int zoneId, int vnetId)
Deletes a vnet from this VDCstatic OneResponse
delVnet(Client client, int id, int zoneId, int vnetId)
Deletes a vnet from this VDCOneResponse
info()
Loads the xml representation of the vdc.static OneResponse
info(Client client, int id)
Retrieves the information of the given vdc.static OneResponse
info(Client client, int id, boolean decrypt)
Retrieves the information of the given VDC.OneResponse
rename(java.lang.String name)
Renames this Vdcstatic OneResponse
rename(Client client, int id, java.lang.String name)
Renames this vdcOneResponse
update(java.lang.String new_template)
Replaces the template contents.OneResponse
update(java.lang.String new_template, boolean append)
Replaces the template contents.static OneResponse
update(Client client, int id, java.lang.String new_template, boolean append)
Replaces the template contents.
-
-
-
Constructor Detail
-
Vdc
public Vdc(int id, Client client)
Creates a new Vdc representation.- Parameters:
id
- The vdc id.client
- XML-RPC Client.
-
Vdc
protected Vdc(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 vdc in OpenNebula- Parameters:
client
- XML-RPC Client.description
- A string containing the template of the vdc.- Returns:
- If successful the message contains the associated id generated for this vdc.
-
info
public static OneResponse info(Client client, int id)
Retrieves the information of the given vdc.- Parameters:
client
- XML-RPC Client.id
- The vdc id.- Returns:
- If successful the message contains the string with the information returned by OpenNebula.
-
info
public static OneResponse info(Client client, int id, boolean decrypt)
Retrieves the information of the given VDC.- Parameters:
client
- XML-RPC Client.id
- The VDC id for the VDC 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
public static OneResponse delete(Client client, int id)
Deletes a vdc from OpenNebula.- Parameters:
client
- XML-RPC Client.id
- The vdc id.- Returns:
- A encapsulated response.
-
update
public static OneResponse update(Client client, int id, java.lang.String new_template, boolean append)
Replaces the template contents.- Parameters:
client
- XML-RPC Client.id
- The vdc id of the target vdc we want to modify.new_template
- New template contentsappend
- True to append new attributes instead of replace the whole template- Returns:
- If successful the message contains the vdc id.
-
rename
public static OneResponse rename(Client client, int id, java.lang.String name)
Renames this vdc- Parameters:
client
- XML-RPC Client.id
- The vdc id of the target vdcname
- New name for the vdc.- Returns:
- If an error occurs the error message contains the reason.
-
addGroup
public static OneResponse addGroup(Client client, int id, int groupId)
Adds a group to this VDC- Parameters:
client
- XML-RPC Client.id
- The vdc id of the target vdcgroupId
- The group to add- Returns:
- If an error occurs the error message contains the reason.
-
delGroup
public static OneResponse delGroup(Client client, int id, int groupId)
Deletes a group from this VDC- Parameters:
client
- XML-RPC Client.id
- The vdc id of the target vdcgroupId
- The group to delete- Returns:
- If an error occurs the error message contains the reason.
-
addCluster
public static OneResponse addCluster(Client client, int id, int zoneId, int clusterId)
Adds a cluster to this VDC- Parameters:
client
- XML-RPC Client.id
- The vdc id of the target vdczoneId
- The cluster's zoneclusterId
- The cluster to add- Returns:
- If an error occurs the error message contains the reason.
-
delCluster
public static OneResponse delCluster(Client client, int id, int zoneId, int clusterId)
Deletes a cluster from this VDC- Parameters:
client
- XML-RPC Client.id
- The vdc id of the target vdczoneId
- The cluster's zoneclusterId
- The cluster to delete- Returns:
- If an error occurs the error message contains the reason.
-
addHost
public static OneResponse addHost(Client client, int id, int zoneId, int hostId)
Adds a host to this VDC- Parameters:
client
- XML-RPC Client.id
- The vdc id of the target vdczoneId
- The host's zonehostId
- The host to add- Returns:
- If an error occurs the error message contains the reason.
-
delHost
public static OneResponse delHost(Client client, int id, int zoneId, int hostId)
Deletes a host from this VDC- Parameters:
client
- XML-RPC Client.id
- The vdc id of the target vdczoneId
- The host's zonehostId
- The host to delete- Returns:
- If an error occurs the error message contains the reason.
-
addVnet
public static OneResponse addVnet(Client client, int id, int zoneId, int vnetId)
Adds a vnet to this VDC- Parameters:
client
- XML-RPC Client.id
- The vdc id of the target vdczoneId
- The vnet's zonevnetId
- The vnet to add- Returns:
- If an error occurs the error message contains the reason.
-
delVnet
public static OneResponse delVnet(Client client, int id, int zoneId, int vnetId)
Deletes a vnet from this VDC- Parameters:
client
- XML-RPC Client.id
- The vdc id of the target vdczoneId
- The vnet's zonevnetId
- The vnet to delete- Returns:
- If an error occurs the error message contains the reason.
-
addDatastore
public static OneResponse addDatastore(Client client, int id, int zoneId, int datastoreId)
Adds a datastore to this VDC- Parameters:
client
- XML-RPC Client.id
- The vdc id of the target vdczoneId
- The datastore's zonedatastoreId
- The datastore to add- Returns:
- If an error occurs the error message contains the reason.
-
delDatastore
public static OneResponse delDatastore(Client client, int id, int zoneId, int datastoreId)
Deletes a datastore from this VDC- Parameters:
client
- XML-RPC Client.id
- The vdc id of the target vdczoneId
- The datastore's zonedatastoreId
- The datastore to delete- Returns:
- If an error occurs the error message contains the reason.
-
info
public OneResponse info()
Loads the xml representation of the vdc. The info is also stored internally.- See Also:
info(Client, int)
-
delete
public OneResponse delete()
Deletes the vdc from OpenNebula.- See Also:
delete(Client, int)
-
update
public OneResponse update(java.lang.String new_template)
Replaces the template contents.- Parameters:
new_template
- New template contents- Returns:
- If successful the message contains the vdc id.
-
update
public OneResponse update(java.lang.String new_template, boolean append)
Replaces the template contents.- Parameters:
new_template
- New template contentsappend
- True to append new attributes instead of replace the whole template- Returns:
- If successful the message contains the vdc id.
-
rename
public OneResponse rename(java.lang.String name)
Renames this Vdc- Parameters:
name
- New name for the vdc.- Returns:
- If an error occurs the error message contains the reason.
-
addGroup
public OneResponse addGroup(int groupId)
Adds a group to this VDC- Parameters:
groupId
- The group to add- Returns:
- If an error occurs the error message contains the reason.
-
delGroup
public OneResponse delGroup(int groupId)
Deletes a group from this VDC- Parameters:
groupId
- The group to delete- Returns:
- If an error occurs the error message contains the reason.
-
addCluster
public OneResponse addCluster(int zoneId, int clusterId)
Adds a cluster to this VDC- Parameters:
zoneId
- The cluster's zoneclusterId
- The cluster to add- Returns:
- If an error occurs the error message contains the reason.
-
delCluster
public OneResponse delCluster(int zoneId, int clusterId)
Deletes a cluster from this VDC- Parameters:
zoneId
- The cluster's zoneclusterId
- The cluster to delete- Returns:
- If an error occurs the error message contains the reason.
-
addHost
public OneResponse addHost(int zoneId, int hostId)
Adds a host to this VDC- Parameters:
zoneId
- The host's zonehostId
- The host to add- Returns:
- If an error occurs the error message contains the reason.
-
delHost
public OneResponse delHost(int zoneId, int hostId)
Deletes a host from this VDC- Parameters:
zoneId
- The host's zonehostId
- The host to delete- Returns:
- If an error occurs the error message contains the reason.
-
addVnet
public OneResponse addVnet(int zoneId, int vnetId)
Adds a vnet to this VDC- Parameters:
zoneId
- The vnet's zonevnetId
- The vnet to add- Returns:
- If an error occurs the error message contains the reason.
-
delVnet
public OneResponse delVnet(int zoneId, int vnetId)
Deletes a vnet from this VDC- Parameters:
zoneId
- The vnet's zonevnetId
- The vnet to delete- Returns:
- If an error occurs the error message contains the reason.
-
addDatastore
public OneResponse addDatastore(int zoneId, int datastoreId)
Adds a datastore to this VDC- Parameters:
zoneId
- The datastore's zonedatastoreId
- The datastore to add- Returns:
- If an error occurs the error message contains the reason.
-
delDatastore
public OneResponse delDatastore(int zoneId, int datastoreId)
Deletes a datastore from this VDC- Parameters:
zoneId
- The datastore's zonedatastoreId
- The datastore to delete- Returns:
- If an error occurs the error message contains the reason.
-
-