java-oca-4.0.1/ 0000755 0001750 0001750 00000000000 12145423573 013057 5 ustar cmartin cmartin java-oca-4.0.1/doc/ 0000755 0001750 0001750 00000000000 12145423573 013624 5 ustar cmartin cmartin java-oca-4.0.1/doc/overview-tree.html 0000644 0001750 0001750 00000026104 12145423573 017320 0 ustar cmartin cmartin
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
java-oca-4.0.1/doc/allclasses-noframe.html 0000644 0001750 0001750 00000010043 12145423573 020263 0 ustar cmartin cmartin
ALL, client, elementName, infoMethod, MINE, MINE_GROUP, poolElements
Constructor and Description |
---|
GroupPool(Client client)
Creates a new group pool
|
Modifier and Type | Method and Description |
---|---|
PoolElement |
factory(org.w3c.dom.Node node)
The factory method returns a suitable PoolElement object from
an XML node.
|
Group |
getById(int id)
Returns the Group with the given Id from the pool.
|
OneResponse |
info()
Loads the xml representation of the group pool.
|
static OneResponse |
info(Client client)
Retrieves all the groups in the pool.
|
java.util.Iterator<Group> |
iterator() |
public GroupPool(Client client)
client
- XML-RPC Client.public PoolElement factory(org.w3c.dom.Node node)
Pool
public static OneResponse info(Client client)
client
- XML-RPC Client.public OneResponse info()
info
in class Pool
info(Client)
public java.util.Iterator<Group> iterator()
iterator
in interface java.lang.Iterable<Group>
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
public class Group extends PoolElement
client, id, xml, xpath
Modifier | Constructor and Description |
---|---|
|
Group(int id,
Client client)
Creates a new Group representation.
|
protected |
Group(org.w3c.dom.Node xmlElement,
Client client) |
Modifier and Type | Method and Description |
---|---|
static OneResponse |
allocate(Client client,
java.lang.String name)
Allocates a new group in OpenNebula
|
boolean |
contains(int uid)
Returns whether or not the user is part of this group
|
OneResponse |
delete()
Deletes the group from OpenNebula.
|
static OneResponse |
delete(Client client,
int id)
Deletes a group from OpenNebula.
|
OneResponse |
info()
Loads the xml representation of the group.
|
static OneResponse |
info(Client client,
int id)
Retrieves the information of the given group.
|
static OneResponse |
setQuota(Client client,
int id,
java.lang.String quota_template)
Replaces the group quota template contents.
|
OneResponse |
setQuota(java.lang.String quota_template)
Replaces the group quota template contents.
|
public Group(int id, Client client)
id
- The group id.client
- XML-RPC Client.protected Group(org.w3c.dom.Node xmlElement, Client client)
PoolElement
public static OneResponse allocate(Client client, java.lang.String name)
client
- XML-RPC Client.name
- Name for the new group.public static OneResponse info(Client client, int id)
client
- XML-RPC Client.id
- The group id.public static OneResponse delete(Client client, int id)
client
- XML-RPC Client.id
- The group id.public static OneResponse setQuota(Client client, int id, java.lang.String quota_template)
client
- XML-RPC Client.id
- The group id of the target group we want to modify.quota_template
- New quota template contents.public OneResponse info()
info(Client, int)
public OneResponse delete()
delete(Client, int)
public OneResponse setQuota(java.lang.String quota_template)
quota_template
- New quota template contents.public boolean contains(int uid)
uid
- The user ID.Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
Modifier and Type | Field and Description |
---|---|
static int |
NONE_CLUSTER_ID |
ALL, client, elementName, infoMethod, MINE, MINE_GROUP, poolElements
Constructor and Description |
---|
ClusterPool(Client client)
Creates a new cluster pool
|
Modifier and Type | Method and Description |
---|---|
PoolElement |
factory(org.w3c.dom.Node node)
The factory method returns a suitable PoolElement object from
an XML node.
|
Cluster |
getById(int id)
Returns the Cluster with the given Id from the pool.
|
OneResponse |
info()
Loads the xml representation of the cluster pool.
|
static OneResponse |
info(Client client)
Retrieves all the clusters in the pool.
|
java.util.Iterator<Cluster> |
iterator() |
public static final int NONE_CLUSTER_ID
public ClusterPool(Client client)
client
- XML-RPC Client.public PoolElement factory(org.w3c.dom.Node node)
Pool
public static OneResponse info(Client client)
client
- XML-RPC Client.public OneResponse info()
info
in class Pool
info(Client)
public java.util.Iterator<Cluster> iterator()
iterator
in interface java.lang.Iterable<Cluster>
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
public class Cluster extends PoolElement
client, id, xml, xpath
Modifier | Constructor and Description |
---|---|
|
Cluster(int id,
Client client)
Creates a new Cluster representation.
|
protected |
Cluster(org.w3c.dom.Node xmlElement,
Client client) |
Modifier and Type | Method and Description |
---|---|
static OneResponse |
addDatastore(Client client,
int id,
int dsId)
Adds a Datastore to this Cluster
|
OneResponse |
addDatastore(int dsId)
Adds a Datastore to this Cluster
|
static OneResponse |
addHost(Client client,
int id,
int hid)
Adds a Host to this Cluster
|
OneResponse |
addHost(int hid)
Adds a Host to this Cluster
|
static OneResponse |
addVnet(Client client,
int id,
int vnetId)
Adds a VNet to this Cluster
|
OneResponse |
addVnet(int vnetId)
Adds a VNet to this Cluster
|
static OneResponse |
allocate(Client client,
java.lang.String name)
Allocates a new cluster in OpenNebula
|
boolean |
containsDatastore(int id)
Returns whether or not the datastore is part of this cluster
|
boolean |
containsHost(int id)
Returns whether or not the host is part of this cluster
|
boolean |
containsVnet(int id)
Returns whether or not the vnet is part of this cluster
|
static OneResponse |
delDatastore(Client client,
int id,
int dsId)
Deletes a Datastore from this Cluster
|
OneResponse |
delDatastore(int dsId)
Deletes a Datastore from this Cluster
|
OneResponse |
delete()
Deletes the cluster from OpenNebula.
|
static OneResponse |
delete(Client client,
int id)
Deletes a cluster from OpenNebula.
|
static OneResponse |
delHost(Client client,
int id,
int hid)
Deletes a Host from this Cluster
|
OneResponse |
delHost(int hid)
Deletes a Host from this Cluster
|
static OneResponse |
delVnet(Client client,
int id,
int vnetId)
Deletes a VNet from this Cluster
|
OneResponse |
delVnet(int vnetId)
Deletes a VNet from this Cluster
|
OneResponse |
info()
Loads the xml representation of the cluster.
|
static OneResponse |
info(Client client,
int id)
Retrieves the information of the given cluster.
|
static OneResponse |
update(Client client,
int id,
java.lang.String new_template)
Replaces the cluster contents.
|
OneResponse |
update(java.lang.String new_template)
Replaces the cluster template.
|
public Cluster(int id, Client client)
id
- The cluster id.client
- XML-RPC Client.protected Cluster(org.w3c.dom.Node xmlElement, Client client)
PoolElement
public static OneResponse allocate(Client client, java.lang.String name)
client
- XML-RPC Client.name
- Name for the new cluster.public static OneResponse info(Client client, int id)
client
- XML-RPC Client.id
- The cluster id.public static OneResponse delete(Client client, int id)
client
- XML-RPC Client.id
- The cluster id.public static OneResponse update(Client client, int id, java.lang.String new_template)
client
- XML-RPC Client.id
- The id of the target cluster we want to modify.new_template
- New template contents.public static OneResponse addHost(Client client, int id, int hid)
client
- XML-RPC Client.id
- The cluster id.hid
- Host ID.public static OneResponse delHost(Client client, int id, int hid)
client
- XML-RPC Client.id
- The cluster id.hid
- Host ID.public static OneResponse addDatastore(Client client, int id, int dsId)
client
- XML-RPC Client.id
- The cluster id.dsId
- Datastore ID.public static OneResponse delDatastore(Client client, int id, int dsId)
client
- XML-RPC Client.id
- The cluster id.dsId
- Datastore ID.public static OneResponse addVnet(Client client, int id, int vnetId)
client
- XML-RPC Client.id
- The cluster id.vnetId
- VNet ID.public static OneResponse delVnet(Client client, int id, int vnetId)
client
- XML-RPC Client.id
- The cluster id.vnetId
- VNet ID.public OneResponse info()
info(Client, int)
public OneResponse delete()
delete(Client, int)
public OneResponse update(java.lang.String new_template)
new_template
- New cluster template.public OneResponse addHost(int hid)
hid
- Host ID.public OneResponse delHost(int hid)
hid
- Host ID.public OneResponse addDatastore(int dsId)
dsId
- Datastore ID.public OneResponse delDatastore(int dsId)
dsId
- Datastore ID.public OneResponse addVnet(int vnetId)
vnetId
- VNet ID.public OneResponse delVnet(int vnetId)
vnetId
- VNet ID.public boolean containsHost(int id)
id
- The host ID.public boolean containsDatastore(int id)
id
- The datastore ID.public boolean containsVnet(int id)
id
- The vnet ID.Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
Class | Description |
---|---|
Cluster |
This class represents an OpenNebula cluster.
|
ClusterPool |
This class represents an OpenNebula cluster pool.
|
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
public class Host extends PoolElement
client, id, xml, xpath
Modifier | Constructor and Description |
---|---|
|
Host(int id,
Client client)
Creates a new Host representation.
|
protected |
Host(org.w3c.dom.Node xmlElement,
Client client) |
Modifier and Type | Method and Description |
---|---|
static OneResponse |
allocate(Client client,
java.lang.String hostname,
java.lang.String im,
java.lang.String vmm,
java.lang.String vnm)
Allocates a new host in OpenNebula
|
static OneResponse |
allocate(Client client,
java.lang.String hostname,
java.lang.String im,
java.lang.String vmm,
java.lang.String vnm,
int clusterId)
Allocates a new host in OpenNebula
|
OneResponse |
delete()
Deletes the host from OpenNebula.
|
static OneResponse |
delete(Client client,
int id)
Deletes a host from OpenNebula.
|
OneResponse |
disable()
Disables the host
|
OneResponse |
enable()
Enables the host.
|
OneResponse |
enable(boolean enable)
Enables or disables the host.
|
static OneResponse |
enable(Client client,
int id,
boolean enable)
Enables or disables a given host.
|
OneResponse |
info()
Loads the xml representation of the host.
|
static OneResponse |
info(Client client,
int id)
Retrieves the information of the given host.
|
boolean |
isEnabled()
Returns true if the host is enabled.
|
OneResponse |
monitoring()
Retrieves the monitoring information of the given host, in XML
|
static OneResponse |
monitoring(Client client,
int id)
Retrieves the monitoring information of the given host, in XML
|
java.lang.String |
shortStateStr()
Returns the short length string state of the Host.
|
java.lang.String |
stateStr()
Returns the state of the Host.
|
static OneResponse |
update(Client client,
int id,
java.lang.String new_template)
Replaces the template contents.
|
OneResponse |
update(java.lang.String new_template)
Replaces the template contents.
|
public Host(int id, Client client)
id
- The host id (hid) of the machine.client
- XML-RPC Client.protected Host(org.w3c.dom.Node xmlElement, Client client)
PoolElement
public static OneResponse allocate(Client client, java.lang.String hostname, java.lang.String im, java.lang.String vmm, java.lang.String vnm, int clusterId)
client
- XML-RPC Client.hostname
- Hostname of the machine we want to addim
- The name of the information manager (im_mad_name),
this values are taken from the oned.conf with the tag name IM_MAD (name)vmm
- The name of the virtual machine manager mad name
(vmm_mad_name), this values are taken from the oned.conf with the
tag name VM_MAD (name)vnm
- The name of the virtual network manager mad name
(vnm_mad_name), this values are taken from the oned.conf with the
tag name VN_MAD (name)clusterId
- The cluster ID. If it is -1, this host won't be
added to any cluster.public static OneResponse allocate(Client client, java.lang.String hostname, java.lang.String im, java.lang.String vmm, java.lang.String vnm)
client
- XML-RPC Client.hostname
- Hostname of the machine we want to addim
- The name of the information manager (im_mad_name),
this values are taken from the oned.conf with the tag name IM_MAD (name)vmm
- The name of the virtual machine manager mad name
(vmm_mad_name), this values are taken from the oned.conf with the
tag name VM_MAD (name)vnm
- The name of the virtual network manager mad name
(vnm_mad_name), this values are taken from the oned.conf with the
tag name VN_MAD (name)public static OneResponse info(Client client, int id)
client
- XML-RPC Client.id
- The host id (hid) of the target machine.public static OneResponse delete(Client client, int id)
client
- XML-RPC Client.id
- The host id (hid) of the target machine.public static OneResponse enable(Client client, int id, boolean enable)
client
- XML-RPC Client.id
- The host id (hid) of the target machine.enable
- If set true OpenNebula will enable the
target host, if set false it will disable it.public static OneResponse update(Client client, int id, java.lang.String new_template)
client
- XML-RPC Client.id
- The image id of the target host we want to modify.new_template
- New template contentspublic static OneResponse monitoring(Client client, int id)
client
- XML-RPC Client.id
- The host id (hid) of the target machine.public OneResponse info()
info(Client, int)
public OneResponse delete()
delete(Client, int)
public OneResponse enable(boolean enable)
enable(Client, int, boolean)
public OneResponse enable()
public OneResponse disable()
public OneResponse update(java.lang.String new_template)
new_template
- New template contentspublic OneResponse monitoring()
public java.lang.String stateStr()
info()
must be called before.public java.lang.String shortStateStr()
info()
must be called before.public boolean isEnabled()
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
ALL, client, elementName, infoMethod, MINE, MINE_GROUP, poolElements
Constructor and Description |
---|
HostPool(Client client)
Creates a new host pool
|
Modifier and Type | Method and Description |
---|---|
PoolElement |
factory(org.w3c.dom.Node node)
The factory method returns a suitable PoolElement object from
an XML node.
|
Host |
getById(int id)
Returns the Host with the given Id from the pool.
|
OneResponse |
info()
Loads the xml representation of the host pool.
|
static OneResponse |
info(Client client)
Retrieves all the hosts in the pool.
|
java.util.Iterator<Host> |
iterator() |
OneResponse |
monitoring()
Retrieves the monitoring data for all the hosts in the pool.
|
static OneResponse |
monitoring(Client client)
Retrieves the monitoring data for all the hosts in the pool.
|
public HostPool(Client client)
client
- XML-RPC Client.public PoolElement factory(org.w3c.dom.Node node)
Pool
public static OneResponse info(Client client)
client
- XML-RPC Client.public static OneResponse monitoring(Client client)
client
- XML-RPC Client.public OneResponse info()
info
in class Pool
info(Client)
public OneResponse monitoring()
public java.util.Iterator<Host> iterator()
iterator
in interface java.lang.Iterable<Host>
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
public abstract class Pool
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
ALL
All resources in the pool
|
protected Client |
client |
protected java.lang.String |
elementName |
protected java.lang.String |
infoMethod |
static int |
MINE
Connected user's resources
|
static int |
MINE_GROUP
Connected user's resources, and the ones in his group
|
protected org.w3c.dom.NodeList |
poolElements |
Modifier | Constructor and Description |
---|---|
protected |
Pool(java.lang.String elementName,
Client client,
java.lang.String infoMethod)
Protected constructor, to be called from subclasses.
|
Modifier and Type | Method and Description |
---|---|
abstract PoolElement |
factory(org.w3c.dom.Node node)
The factory method returns a suitable PoolElement object from
an XML node.
|
protected PoolElement |
getById(int id)
Returns the element with the given Id from the pool.
|
int |
getLength()
The number of elements in the pool.
|
protected OneResponse |
info() |
protected static OneResponse |
info(Client client,
java.lang.String infoMethod)
Info methods
|
protected static OneResponse |
info(Client client,
java.lang.String infoMethod,
int filter,
int startId,
int endId) |
protected OneResponse |
info(int filter,
int startId,
int endId) |
protected OneResponse |
infoAll() |
protected static OneResponse |
infoAll(Client client,
java.lang.String infoMethod) |
protected OneResponse |
infoGroup() |
protected static OneResponse |
infoGroup(Client client,
java.lang.String infoMethod) |
protected OneResponse |
infoMine() |
protected static OneResponse |
infoMine(Client client,
java.lang.String infoMethod) |
PoolElement |
item(int index)
Returns the indexth element in the pool.
|
protected void |
processInfo(OneResponse info)
After a *pool.info call, this method builds the internal xml
representation of the pool.
|
protected static OneResponse |
xmlrpcInfo(Client client,
java.lang.String infoMethod,
java.lang.Object... args) |
protected Client client
protected java.lang.String elementName
protected java.lang.String infoMethod
protected org.w3c.dom.NodeList poolElements
public static final int ALL
public static final int MINE
public static final int MINE_GROUP
protected Pool(java.lang.String elementName, Client client, java.lang.String infoMethod)
elementName
- Name of the PoolElement's xml elementclient
- XML-RPC client which will handle callsinfoMethod
- XML-RPC info method for the subclass Poolpublic abstract PoolElement factory(org.w3c.dom.Node node)
node
- XML Dom node to build the PoolElement fromprotected static OneResponse info(Client client, java.lang.String infoMethod)
protected static OneResponse info(Client client, java.lang.String infoMethod, int filter, int startId, int endId)
protected static OneResponse infoAll(Client client, java.lang.String infoMethod)
protected static OneResponse infoMine(Client client, java.lang.String infoMethod)
protected static OneResponse infoGroup(Client client, java.lang.String infoMethod)
protected static OneResponse xmlrpcInfo(Client client, java.lang.String infoMethod, java.lang.Object... args)
protected OneResponse info()
protected OneResponse infoAll()
protected OneResponse infoMine()
protected OneResponse infoGroup()
protected OneResponse info(int filter, int startId, int endId)
protected void processInfo(OneResponse info)
info
- The XML-RPC *pool.info responsepublic PoolElement item(int index)
index
- Index of the element.protected PoolElement getById(int id)
info()
must be called before.id
- of the element to retrievepublic int getLength()
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
public class OneResponse
extends java.lang.Object
Constructor and Description |
---|
OneResponse(boolean success,
java.lang.String message)
Creates a new response.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getErrorMessage()
Returns a string containing the error message, or null
if the response isn't an error.
|
int |
getIntMessage()
Parses the string returned by getMessage
|
java.lang.String |
getMessage()
Returns a string containing the response information, or
null if the response was an error.
|
boolean |
isError()
Returns true if the call resulted in error.
|
public OneResponse(boolean success, java.lang.String message)
success
- Indicates if the call was successful, and if
the message is an error or an information string.message
- String containing the response message, or
the error message.public boolean isError()
public java.lang.String getErrorMessage()
public java.lang.String getMessage()
public int getIntMessage()
getMessage()
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
Class | Description |
---|---|
Document |
This class represents an OpenNebula document.
|
DocumentPool |
This class represents an OpenNebula Document pool.
|
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
public abstract class DocumentPool extends Pool
This class represents an OpenNebula Document pool.
Documents are generic objects. You can dynamically create new Pools in OpenNebula, creating subclasses with different TYPE values.Document
public class GenericObjAPool extends DocumentPool implements Iterable<GenericObjA>
{
private static final int TYPE = 200;
protected int type()
{
return TYPE;
}
public GenericObjAPool(Client client)
{
super(client);
}
public GenericObjAPool(Client client, int filter)
{
super(client, filter);
}
public GenericObjA factory(Node node)
{
return new GenericObjA(node, client);
}
public Iterator<GenericObjA> iterator()
{
AbstractList<GenericObjA> ab = new AbstractList<GenericObjA>()
{
public int size()
{
return getLength();
}
public GenericObjA get(int index)
{
return (GenericObjA) item(index);
}
};
return ab.iterator();
}
}
ALL, client, elementName, infoMethod, MINE, MINE_GROUP, poolElements
Constructor and Description |
---|
DocumentPool(Client client)
Creates a new Document pool with the default filter flag value
set to
Pool.MINE_GROUP (Document belonging to the connected user,
and the ones in his group) |
DocumentPool(Client client,
int filter)
Creates a new Document pool.
|
Modifier and Type | Method and Description |
---|---|
Document |
getById(int id)
Returns the Document with the given Id from the pool.
|
OneResponse |
info()
Loads the xml representation of all or part of the
Documents in the pool.
|
OneResponse |
info(int filter,
int startId,
int endId)
Retrieves all or part of the Documents in the pool.
|
OneResponse |
infoAll()
Loads the xml representation of all the Documents in the pool.
|
OneResponse |
infoGroup()
Loads the xml representation of all the connected user's Documents and
the ones in his group.
|
OneResponse |
infoMine()
Loads the xml representation of all the connected user's Documents.
|
protected abstract int |
type() |
public DocumentPool(Client client)
Pool.MINE_GROUP
(Document belonging to the connected user,
and the ones in his group)client
- XML-RPC Client.DocumentPool(Client, int)
public DocumentPool(Client client, int filter)
client
- XML-RPC Client.filter
- Filter flag to use by default in the method
info()
. Possible values:
Pool.ALL
: All DocumentsPool.MINE
: Connected user's DocumentsPool.MINE_GROUP
: Connected user's Documents, and the ones in
his groupprotected abstract int type()
public OneResponse info()
public OneResponse infoAll()
public OneResponse infoMine()
public OneResponse infoGroup()
public OneResponse info(int filter, int startId, int endId)
info
in class Pool
filter
- Filter flag to use. Possible values:
Pool.ALL
: All DocumentsPool.MINE
: Connected user's DocumentsPool.MINE_GROUP
: Connected user's Documents, and the ones in
his groupstartId
- Lowest Id to retrieveendId
- Biggest Id to retrieveVisit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
public abstract class Document extends PoolElement
DocumentPool
public class GenericObjA extends Document
{
private static final int TYPE = 200;
public GenericObjA(int id, Client client)
{
super(id, client);
}
public GenericObjA(Node xmlElement, Client client)
{
super(xmlElement, client);
}
public static OneResponse allocate(Client client, String description)
{
return Document.allocate(client, description, TYPE);
}
}
client, id, xml, xpath
Constructor and Description |
---|
Document(int id,
Client client)
Creates a new Document representation.
|
Document(org.w3c.dom.Node xmlElement,
Client client) |
Modifier and Type | Method and Description |
---|---|
protected static OneResponse |
allocate(Client client,
java.lang.String description,
int type)
Allocates a new Document in OpenNebula.
|
OneResponse |
chgrp(int gid)
Changes the group
|
OneResponse |
chmod(int octet)
Changes the permissions
|
OneResponse |
chmod(int owner_u,
int owner_m,
int owner_a,
int group_u,
int group_m,
int group_a,
int other_u,
int other_m,
int other_a)
Changes the document permissions
|
OneResponse |
chmod(java.lang.String octet)
Changes the permissions
|
OneResponse |
chown(int uid)
Changes the owner
|
OneResponse |
chown(int uid,
int gid)
Changes the owner/group
|
OneResponse |
clone(java.lang.String name)
Clones this document into a new one
|
OneResponse |
delete()
Deletes a document from OpenNebula.
|
OneResponse |
info()
Retrieves the information of the given Document.
|
OneResponse |
publish()
Publishes the document.
|
OneResponse |
publish(boolean publish)
Publishes or unpublishes a document.
|
OneResponse |
rename(java.lang.String name)
Renames this document
|
OneResponse |
unpublish()
Unpublishes the document.
|
OneResponse |
update(java.lang.String new_document)
Replaces the document template contents.
|
public Document(int id, Client client)
id
- The document id.client
- XML-RPC Client.public Document(org.w3c.dom.Node xmlElement, Client client)
PoolElement
protected static OneResponse allocate(Client client, java.lang.String description, int type)
client
- XML-RPC Client.description
- A string containing the template of the document.public OneResponse info()
public OneResponse delete()
public OneResponse update(java.lang.String new_document)
new_document
- New template contents.public OneResponse publish(boolean publish)
publish
- True for publishing, false for unpublishing.public OneResponse chown(int uid, int gid)
uid
- The new owner user ID. Set it to -1 to leave the current one.gid
- The new group ID. Set it to -1 to leave the current one.public OneResponse chmod(int owner_u, int owner_m, int owner_a, int group_u, int group_m, int group_a, int other_u, int other_m, int other_a)
owner_u
- 1 to allow, 0 deny, -1 do not changeowner_m
- 1 to allow, 0 deny, -1 do not changeowner_a
- 1 to allow, 0 deny, -1 do not changegroup_u
- 1 to allow, 0 deny, -1 do not changegroup_m
- 1 to allow, 0 deny, -1 do not changegroup_a
- 1 to allow, 0 deny, -1 do not changeother_u
- 1 to allow, 0 deny, -1 do not changeother_m
- 1 to allow, 0 deny, -1 do not changeother_a
- 1 to allow, 0 deny, -1 do not changepublic OneResponse chmod(java.lang.String octet)
octet
- Permissions octed , e.g. 640public OneResponse chmod(int octet)
octet
- Permissions octed , e.g. 640public OneResponse clone(java.lang.String name)
name
- Name for the new document.public OneResponse rename(java.lang.String name)
name
- New name for the document.public OneResponse publish()
public OneResponse unpublish()
public OneResponse chown(int uid)
uid
- The new owner user ID.public OneResponse chgrp(int gid)
gid
- The new group ID.Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
public class Datastore extends PoolElement
client, id, xml, xpath
Modifier | Constructor and Description |
---|---|
|
Datastore(int id,
Client client)
Creates a new Datastore representation.
|
protected |
Datastore(org.w3c.dom.Node xmlElement,
Client client) |
Modifier and Type | Method and Description |
---|---|
static OneResponse |
allocate(Client client,
java.lang.String description)
Allocates a new Datastore in OpenNebula.
|
static OneResponse |
allocate(Client client,
java.lang.String description,
int clusterId)
Allocates a new Datastore in OpenNebula.
|
OneResponse |
chgrp(int gid)
Changes the group
|
static OneResponse |
chmod(Client client,
int id,
int octet)
Changes the permissions
|
static OneResponse |
chmod(Client client,
int id,
int owner_u,
int owner_m,
int owner_a,
int group_u,
int group_m,
int group_a,
int other_u,
int other_m,
int other_a)
Changes the datastore permissions
|
static OneResponse |
chmod(Client client,
int id,
java.lang.String octet)
Changes the permissions
|
OneResponse |
chmod(int octet)
Changes the permissions
|
OneResponse |
chmod(int owner_u,
int owner_m,
int owner_a,
int group_u,
int group_m,
int group_a,
int other_u,
int other_m,
int other_a)
Changes the datastore permissions
|
OneResponse |
chmod(java.lang.String octet)
Changes the permissions
|
static OneResponse |
chown(Client client,
int id,
int uid,
int gid)
Changes the owner/group
|
OneResponse |
chown(int uid)
Changes the owner
|
OneResponse |
chown(int uid,
int gid)
Changes the owner/group
|
boolean |
contains(int id)
Returns whether or not the image is part of this datastore
|
OneResponse |
delete()
Deletes the datastore from OpenNebula.
|
static OneResponse |
delete(Client client,
int id)
Deletes a datastore from OpenNebula.
|
OneResponse |
info()
Retrieves the information of the Datastore.
|
static OneResponse |
info(Client client,
int id)
Retrieves the information of the given Datastore.
|
OneResponse |
publish()
Publishes the datastore.
|
OneResponse |
publish(boolean publish)
Publishes or unpublishes the datastore.
|
static OneResponse |
publish(Client client,
int id,
boolean publish)
Publishes or unpublishes a datastore.
|
java.lang.String |
shortTypeStr()
Returns the type of the Datastore as a short String.
|
int |
type()
Returns the type of the Datastore.
|
java.lang.String |
typeStr()
Returns the type of the Datastore as a String.
|
OneResponse |
unpublish()
Unpublishes the datastore.
|
static OneResponse |
update(Client client,
int id,
java.lang.String new_template)
Replaces the datastore contents.
|
OneResponse |
update(java.lang.String new_template)
Replaces the datastore template.
|
public Datastore(int id, Client client)
id
- The datastore id.client
- XML-RPC Client.protected Datastore(org.w3c.dom.Node xmlElement, Client client)
PoolElement
public static OneResponse allocate(Client client, java.lang.String description, int clusterId)
client
- XML-RPC Client.description
- A string containing the template of the datastore.clusterId
- Id of the clusterpublic static OneResponse allocate(Client client, java.lang.String description)
client
- XML-RPC Client.description
- A string containing the template of the datastore.public static OneResponse info(Client client, int id)
client
- XML-RPC Client.id
- The datastore id to retrieve the information frompublic static OneResponse delete(Client client, int id)
client
- XML-RPC Client.id
- The id of the target datastore we want to delete.public static OneResponse update(Client client, int id, java.lang.String new_template)
client
- XML-RPC Client.id
- The id of the target datastore we want to modify.new_template
- New datastore contents.public static OneResponse publish(Client client, int id, boolean publish)
client
- XML-RPC Client.id
- The id of the target datastore we want to modify.publish
- True for publishing, false for unpublishing.public static OneResponse chown(Client client, int id, int uid, int gid)
client
- XML-RPC Client.id
- The id of the target datastore we want to modify.uid
- The new owner user ID. Set it to -1 to leave the current one.gid
- The new group ID. Set it to -1 to leave the current one.public static OneResponse chmod(Client client, int id, int owner_u, int owner_m, int owner_a, int group_u, int group_m, int group_a, int other_u, int other_m, int other_a)
client
- XML-RPC Client.id
- The id of the target datastore.owner_u
- 1 to allow, 0 deny, -1 do not changeowner_m
- 1 to allow, 0 deny, -1 do not changeowner_a
- 1 to allow, 0 deny, -1 do not changegroup_u
- 1 to allow, 0 deny, -1 do not changegroup_m
- 1 to allow, 0 deny, -1 do not changegroup_a
- 1 to allow, 0 deny, -1 do not changeother_u
- 1 to allow, 0 deny, -1 do not changeother_m
- 1 to allow, 0 deny, -1 do not changeother_a
- 1 to allow, 0 deny, -1 do not changepublic static OneResponse chmod(Client client, int id, java.lang.String octet)
client
- XML-RPC Client.id
- The id of the target object.octet
- Permissions octet, e.g. 640public static OneResponse chmod(Client client, int id, int octet)
client
- XML-RPC Client.id
- The id of the target object.octet
- Permissions octed , e.g. 640public OneResponse info()
public OneResponse delete()
public OneResponse update(java.lang.String new_template)
new_template
- New datastore template.public OneResponse publish(boolean publish)
publish
- True for publishing, false for unpublishing.public OneResponse publish()
public OneResponse unpublish()
public OneResponse chown(int uid, int gid)
uid
- The new owner user ID. Set it to -1 to leave the current one.gid
- The new group ID. Set it to -1 to leave the current one.public OneResponse chown(int uid)
uid
- The new owner user ID.public OneResponse chgrp(int gid)
gid
- The new group ID.public OneResponse chmod(int owner_u, int owner_m, int owner_a, int group_u, int group_m, int group_a, int other_u, int other_m, int other_a)
owner_u
- 1 to allow, 0 deny, -1 do not changeowner_m
- 1 to allow, 0 deny, -1 do not changeowner_a
- 1 to allow, 0 deny, -1 do not changegroup_u
- 1 to allow, 0 deny, -1 do not changegroup_m
- 1 to allow, 0 deny, -1 do not changegroup_a
- 1 to allow, 0 deny, -1 do not changeother_u
- 1 to allow, 0 deny, -1 do not changeother_m
- 1 to allow, 0 deny, -1 do not changeother_a
- 1 to allow, 0 deny, -1 do not changepublic OneResponse chmod(java.lang.String octet)
octet
- Permissions octed , e.g. 640public OneResponse chmod(int octet)
octet
- Permissions octed , e.g. 640public int type()
public java.lang.String typeStr()
public java.lang.String shortTypeStr()
public boolean contains(int id)
id
- The image ID.Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
Class | Description |
---|---|
Datastore |
This class represents an OpenNebula datastore.
|
DatastorePool |
This class represents an OpenNebula datastore pool.
|
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
ALL, client, elementName, infoMethod, MINE, MINE_GROUP, poolElements
Constructor and Description |
---|
DatastorePool(Client client)
Creates a new datastore pool
|
Modifier and Type | Method and Description |
---|---|
PoolElement |
factory(org.w3c.dom.Node node)
The factory method returns a suitable PoolElement object from
an XML node.
|
Datastore |
getById(int id)
Returns the Datastore with the given Id from the pool.
|
OneResponse |
info()
Loads the xml representation of the datastore pool.
|
static OneResponse |
info(Client client)
Retrieves all the datastores in the pool.
|
java.util.Iterator<Datastore> |
iterator() |
public DatastorePool(Client client)
client
- XML-RPC Client.public PoolElement factory(org.w3c.dom.Node node)
Pool
public static OneResponse info(Client client)
client
- XML-RPC Client.public OneResponse info()
info
in class Pool
info(Client)
public java.util.Iterator<Datastore> iterator()
iterator
in interface java.lang.Iterable<Datastore>
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
public class Image extends PoolElement
client, id, xml, xpath
Modifier | Constructor and Description |
---|---|
|
Image(int id,
Client client)
Creates a new Image representation.
|
protected |
Image(org.w3c.dom.Node xmlElement,
Client client) |
Modifier and Type | Method and Description |
---|---|
static OneResponse |
allocate(Client client,
java.lang.String description,
int datastoreId)
Allocates a new Image in OpenNebula.
|
OneResponse |
chgrp(int gid)
Changes the group
|
static OneResponse |
chmod(Client client,
int id,
int octet)
Changes the permissions
|
static OneResponse |
chmod(Client client,
int id,
int owner_u,
int owner_m,
int owner_a,
int group_u,
int group_m,
int group_a,
int other_u,
int other_m,
int other_a)
Changes the Image permissions
|
static OneResponse |
chmod(Client client,
int id,
java.lang.String octet)
Changes the permissions
|
OneResponse |
chmod(int octet)
Changes the permissions
|
OneResponse |
chmod(int owner_u,
int owner_m,
int owner_a,
int group_u,
int group_m,
int group_a,
int other_u,
int other_m,
int other_a)
Changes the Image permissions
|
OneResponse |
chmod(java.lang.String octet)
Changes the permissions
|
static OneResponse |
chown(Client client,
int id,
int uid,
int gid)
Changes the owner/group
|
OneResponse |
chown(int uid)
Changes the owner
|
OneResponse |
chown(int uid,
int gid)
Changes the owner/group
|
static OneResponse |
chtype(Client client,
int id,
java.lang.String type)
Changes the Image type
|
OneResponse |
chtype(java.lang.String type)
Changes the Image type
|
static OneResponse |
clone(Client client,
int id,
java.lang.String name)
Clones this Image into a new one
|
OneResponse |
clone(java.lang.String name)
Clones this Image into a new one
|
OneResponse |
delete()
Deletes the image from OpenNebula.
|
static OneResponse |
delete(Client client,
int id)
Deletes an image from OpenNebula.
|
OneResponse |
disable()
Disables the image.
|
OneResponse |
enable()
Enables the image.
|
OneResponse |
enable(boolean enable)
Enables or disables the image.
|
static OneResponse |
enable(Client client,
int id,
boolean enable)
Enables or disables an image.
|
OneResponse |
info()
Retrieves the information of the Image.
|
static OneResponse |
info(Client client,
int id)
Retrieves the information of the given Image.
|
boolean |
isEnabled()
Returns true if the image is enabled.
|
OneResponse |
nonpersistent()
Sets the Image as persistent or not persistent.
|
OneResponse |
persistent()
Sets the Image as persistent
|
OneResponse |
persistent(boolean persistent)
Sets the Image as persistent or not persistent.
|
static OneResponse |
persistent(Client client,
int id,
boolean persistent)
Sets the Image as persistent or not persistent.
|
OneResponse |
publish()
Publishes the image.
|
OneResponse |
publish(boolean publish)
Publishes or unpublishes the image.
|
static OneResponse |
publish(Client client,
int id,
boolean publish)
Publishes or unpublishes an image.
|
static OneResponse |
rename(Client client,
int id,
java.lang.String name)
Renames this Image
|
OneResponse |
rename(java.lang.String name)
Renames this Image
|
java.lang.String |
shortStateStr()
Returns the short length string state of the Image.
|
java.lang.String |
shortTypeStr()
Returns the type of the Image as a short String.
|
java.lang.String |
stateString()
Returns the state of the Image.
|
int |
type()
Returns the type of the Image.
|
java.lang.String |
typeStr()
Returns the type of the Image as a String.
|
OneResponse |
unpublish()
Unpublishes the image.
|
static OneResponse |
update(Client client,
int id,
java.lang.String new_template)
Replaces the template contents.
|
OneResponse |
update(java.lang.String new_template)
Replaces the template contents.
|
public Image(int id, Client client)
id
- The image id.client
- XML-RPC Client.protected Image(org.w3c.dom.Node xmlElement, Client client)
PoolElement
public static OneResponse allocate(Client client, java.lang.String description, int datastoreId)
client
- XML-RPC Client.description
- A string containing the template of the image.datastoreId
- The cluster ID. If it is -1, this image
won't be added to any cluster.public static OneResponse info(Client client, int id)
client
- XML-RPC Client.id
- The image id for the image to retrieve the information frompublic static OneResponse delete(Client client, int id)
client
- XML-RPC Client.id
- The image id of the target image we want to delete.public static OneResponse update(Client client, int id, java.lang.String new_template)
client
- XML-RPC Client.id
- The image id of the target image we want to modify.new_template
- New template contentspublic static OneResponse enable(Client client, int id, boolean enable)
client
- XML-RPC Client.id
- The image id of the target image we want to modify.enable
- True for enabling, false for disabling.public static OneResponse persistent(Client client, int id, boolean persistent)
client
- XML-RPC Client.id
- The image id of the target image we want to modify.persistent
- True to make it persistent, false non-persistentpublic static OneResponse publish(Client client, int id, boolean publish)
client
- XML-RPC Client.id
- The image id of the target image we want to modify.publish
- True for publishing, false for unpublishing.public static OneResponse chown(Client client, int id, int uid, int gid)
client
- XML-RPC Client.id
- The image id of the target image we want to modify.uid
- The new owner user ID. Set it to -1 to leave the current one.gid
- The new group ID. Set it to -1 to leave the current one.public static OneResponse chmod(Client client, int id, int owner_u, int owner_m, int owner_a, int group_u, int group_m, int group_a, int other_u, int other_m, int other_a)
client
- XML-RPC Client.id
- The image id of the target image we want to modify.owner_u
- 1 to allow, 0 deny, -1 do not changeowner_m
- 1 to allow, 0 deny, -1 do not changeowner_a
- 1 to allow, 0 deny, -1 do not changegroup_u
- 1 to allow, 0 deny, -1 do not changegroup_m
- 1 to allow, 0 deny, -1 do not changegroup_a
- 1 to allow, 0 deny, -1 do not changeother_u
- 1 to allow, 0 deny, -1 do not changeother_m
- 1 to allow, 0 deny, -1 do not changeother_a
- 1 to allow, 0 deny, -1 do not changepublic static OneResponse chmod(Client client, int id, java.lang.String octet)
client
- XML-RPC Client.id
- The id of the target object.octet
- Permissions octed , e.g. 640public static OneResponse chmod(Client client, int id, int octet)
client
- XML-RPC Client.id
- The id of the target object.octet
- Permissions octed , e.g. 640public static OneResponse chtype(Client client, int id, java.lang.String type)
client
- XML-RPC Client.id
- The image id of the target image we want to modify.type
- The new Image typepublic static OneResponse clone(Client client, int id, java.lang.String name)
client
- XML-RPC Client.id
- The Image id of the target Image.name
- Name for the new Image.public static OneResponse rename(Client client, int id, java.lang.String name)
client
- XML-RPC Client.id
- The Image id of the target Image.name
- New name for the Image.public OneResponse info()
public OneResponse delete()
public OneResponse update(java.lang.String new_template)
new_template
- New template contentspublic OneResponse enable(boolean enable)
enable
- True for enabling, false for disabling.public OneResponse enable()
public OneResponse disable()
public OneResponse persistent(boolean persistent)
persistent
- True for enabling, false for disabling.public OneResponse persistent()
public OneResponse nonpersistent()
public OneResponse publish(boolean publish)
publish
- True for publishing, false for unpublishing.public OneResponse publish()
public OneResponse unpublish()
public OneResponse chown(int uid, int gid)
uid
- The new owner user ID. Set it to -1 to leave the current one.gid
- The new group ID. Set it to -1 to leave the current one.public OneResponse chown(int uid)
uid
- The new owner user ID.public OneResponse chgrp(int gid)
gid
- The new group ID.public OneResponse chmod(int owner_u, int owner_m, int owner_a, int group_u, int group_m, int group_a, int other_u, int other_m, int other_a)
owner_u
- 1 to allow, 0 deny, -1 do not changeowner_m
- 1 to allow, 0 deny, -1 do not changeowner_a
- 1 to allow, 0 deny, -1 do not changegroup_u
- 1 to allow, 0 deny, -1 do not changegroup_m
- 1 to allow, 0 deny, -1 do not changegroup_a
- 1 to allow, 0 deny, -1 do not changeother_u
- 1 to allow, 0 deny, -1 do not changeother_m
- 1 to allow, 0 deny, -1 do not changeother_a
- 1 to allow, 0 deny, -1 do not changepublic OneResponse chmod(java.lang.String octet)
octet
- Permissions octed , e.g. 640public OneResponse chmod(int octet)
octet
- Permissions octed , e.g. 640public OneResponse chtype(java.lang.String type)
type
- The new Image typepublic OneResponse clone(java.lang.String name)
name
- Name for the new Image.public OneResponse rename(java.lang.String name)
name
- New name for the Image.public java.lang.String stateString()
info()
must be called before.public java.lang.String shortStateStr()
info()
must be called before.public int type()
public java.lang.String typeStr()
public java.lang.String shortTypeStr()
public boolean isEnabled()
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
ALL, client, elementName, infoMethod, MINE, MINE_GROUP, poolElements
Constructor and Description |
---|
ImagePool(Client client)
Creates a new Image pool with the default filter flag value
set to
Pool.MINE_GROUP (Images belonging to the connected user,
and the ones in his group) |
ImagePool(Client client,
int filter)
Creates a new Image pool.
|
Modifier and Type | Method and Description |
---|---|
PoolElement |
factory(org.w3c.dom.Node node)
The factory method returns a suitable PoolElement object from
an XML node.
|
Image |
getById(int id)
Returns the Image with the given Id from the pool.
|
OneResponse |
info()
Loads the xml representation of all or part of the
Images in the pool.
|
static OneResponse |
info(Client client,
int filter)
Retrieves all or part of the Images in the pool.
|
static OneResponse |
info(Client client,
int filter,
int startId,
int endId)
Retrieves all or part of the Images in the pool.
|
OneResponse |
info(int filter,
int startId,
int endId)
Retrieves all or part of the Images in the pool.
|
OneResponse |
infoAll()
Loads the xml representation of all the Images in the pool.
|
static OneResponse |
infoAll(Client client)
Retrieves all the Images in the pool.
|
OneResponse |
infoGroup()
Loads the xml representation of all the connected user's Images and
the ones in his group.
|
static OneResponse |
infoGroup(Client client)
Retrieves all the connected user's Images and the ones in
his group.
|
OneResponse |
infoMine()
Loads the xml representation of all the connected user's Images.
|
static OneResponse |
infoMine(Client client)
Retrieves all the connected user's Images.
|
java.util.Iterator<Image> |
iterator() |
getLength, info, info, infoAll, infoGroup, infoMine, item, processInfo, xmlrpcInfo
public ImagePool(Client client)
Pool.MINE_GROUP
(Images belonging to the connected user,
and the ones in his group)client
- XML-RPC Client.ImagePool(Client, int)
public ImagePool(Client client, int filter)
client
- XML-RPC Client.filter
- Filter flag to use by default in the method
info()
. Possible values:
Pool.ALL
: All ImagesPool.MINE
: Connected user's ImagesPool.MINE_GROUP
: Connected user's Images, and the ones in
his grouppublic PoolElement factory(org.w3c.dom.Node node)
Pool
public static OneResponse info(Client client, int filter)
client
- XML-RPC Client.filter
- Filter flag to use. Possible values:
Pool.ALL
: All ImagesPool.MINE
: Connected user's ImagesPool.MINE_GROUP
: Connected user's Images, and the ones in
his grouppublic static OneResponse infoAll(Client client)
client
- XML-RPC Client.public static OneResponse infoMine(Client client)
client
- XML-RPC Client.public static OneResponse infoGroup(Client client)
client
- XML-RPC Client.public static OneResponse info(Client client, int filter, int startId, int endId)
client
- XML-RPC Client.filter
- Filter flag to use. Possible values:
Pool.ALL
: All ImagesPool.MINE
: Connected user's ImagesPool.MINE_GROUP
: Connected user's Images, and the ones in
his groupstartId
- Lowest Id to retrieveendId
- Biggest Id to retrievepublic OneResponse info()
info
in class Pool
info(Client, int)
public OneResponse infoAll()
public OneResponse infoMine()
public OneResponse infoGroup()
public OneResponse info(int filter, int startId, int endId)
info
in class Pool
filter
- Filter flag to use. Possible values:
Pool.ALL
: All ImagesPool.MINE
: Connected user's ImagesPool.MINE_GROUP
: Connected user's Images, and the ones in
his groupstartId
- Lowest Id to retrieveendId
- Biggest Id to retrievepublic java.util.Iterator<Image> iterator()
iterator
in interface java.lang.Iterable<Image>
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
See: Description
Class | Description |
---|---|
Client |
This class represents the connection with the core and handles the
xml-rpc calls.
|
OneResponse |
This class encapsulates OpenNebula's XML-RPC responses.
|
OneSystem | |
Pool |
Represents a generic OpenNebula Pool in XML format
and provides the basic functionality to handle the Pool elements.
|
PoolElement |
Represents a generic element of a Pool in
XML format.
|
Exception | Description |
---|---|
ClientConfigurationException |
This exception is thrown when a a new Client is constructed with wrong
authorization options.
|
OneException |
The
OneException class is a generic OpenNebula exception. |
Provides the Java bindings for the OpenNebula Cloud API (OCA).
The included classes can be used as simple wrappers for the XML-RPC calls supported by the OpenNebula core, or as objects that store the information and provide useful helpers.
Apart from this jar file, you need to add to the project's build-path the Apache XML-RPC library.
You can download it from Apache's distribution directory. The jar files you need are xmlrpc-client-*.jar, ws-commons-util-*.jar and xmlrpc-common-*.jar.
Please visit the OpenNebula site for general information, and consult the documentation section to find up to date references, tutorials, and more.
You can learn about the OpenNebula XML-RPC API here.
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
public class Template extends PoolElement
client, id, xml, xpath
Modifier | Constructor and Description |
---|---|
|
Template(int id,
Client client)
Creates a new Template representation.
|
protected |
Template(org.w3c.dom.Node xmlElement,
Client client) |
Modifier and Type | Method and Description |
---|---|
static OneResponse |
allocate(Client client,
java.lang.String description)
Allocates a new Template in OpenNebula.
|
OneResponse |
chgrp(int gid)
Changes the group
|
static OneResponse |
chmod(Client client,
int id,
int octet)
Changes the permissions
|
static OneResponse |
chmod(Client client,
int id,
int owner_u,
int owner_m,
int owner_a,
int group_u,
int group_m,
int group_a,
int other_u,
int other_m,
int other_a)
Changes the template permissions
|
static OneResponse |
chmod(Client client,
int id,
java.lang.String octet)
Changes the permissions
|
OneResponse |
chmod(int octet)
Changes the permissions
|
OneResponse |
chmod(int owner_u,
int owner_m,
int owner_a,
int group_u,
int group_m,
int group_a,
int other_u,
int other_m,
int other_a)
Changes the template permissions
|
OneResponse |
chmod(java.lang.String octet)
Changes the permissions
|
static OneResponse |
chown(Client client,
int id,
int uid,
int gid)
Changes the owner/group
|
OneResponse |
chown(int uid)
Changes the owner
|
OneResponse |
chown(int uid,
int gid)
Changes the owner/group
|
static OneResponse |
clone(Client client,
int id,
java.lang.String name)
Clones this template into a new one
|
OneResponse |
clone(java.lang.String name)
Clones this template into a new one
|
OneResponse |
delete()
Deletes the template from OpenNebula.
|
static OneResponse |
delete(Client client,
int id)
Deletes a template from OpenNebula.
|
OneResponse |
info()
Retrieves the information of the Template.
|
static OneResponse |
info(Client client,
int id)
Retrieves the information of the given Template.
|
OneResponse |
instantiate()
Creates a VM instance from a Template
|
static OneResponse |
instantiate(Client client,
int id,
java.lang.String name,
boolean onHold,
java.lang.String template)
Creates a VM instance from a Template
|
OneResponse |
instantiate(java.lang.String name)
Creates a VM instance from a Template
|
OneResponse |
instantiate(java.lang.String name,
boolean onHold,
java.lang.String template)
Creates a VM instance from a Template
|
OneResponse |
publish()
Publishes the template.
|
OneResponse |
publish(boolean publish)
Publishes or unpublishes the template.
|
static OneResponse |
publish(Client client,
int id,
boolean publish)
Publishes or unpublishes a template.
|
static OneResponse |
rename(Client client,
int id,
java.lang.String name)
Renames this Template
|
OneResponse |
rename(java.lang.String name)
Renames this Template
|
OneResponse |
unpublish()
Unpublishes the template.
|
static OneResponse |
update(Client client,
int id,
java.lang.String new_template)
Replaces the template contents.
|
OneResponse |
update(java.lang.String new_template)
Replaces the template contents.
|
public Template(int id, Client client)
id
- The template id.client
- XML-RPC Client.protected Template(org.w3c.dom.Node xmlElement, Client client)
PoolElement
public static OneResponse allocate(Client client, java.lang.String description)
client
- XML-RPC Client.description
- A string containing the template of the template.public static OneResponse info(Client client, int id)
client
- XML-RPC Client.id
- The template id for the template to retrieve the information frompublic static OneResponse delete(Client client, int id)
client
- XML-RPC Client.id
- The template id of the target template we want to delete.public static OneResponse update(Client client, int id, java.lang.String new_template)
client
- XML-RPC Client.id
- The template id of the target template we want to modify.new_template
- New template contents.public static OneResponse publish(Client client, int id, boolean publish)
client
- XML-RPC Client.id
- The template id of the target template we want to modify.publish
- True for publishing, false for unpublishing.public static OneResponse chown(Client client, int id, int uid, int gid)
client
- XML-RPC Client.id
- The template id of the target template we want to modify.uid
- The new owner user ID. Set it to -1 to leave the current one.gid
- The new group ID. Set it to -1 to leave the current one.public static OneResponse chmod(Client client, int id, int owner_u, int owner_m, int owner_a, int group_u, int group_m, int group_a, int other_u, int other_m, int other_a)
client
- XML-RPC Client.id
- The template id of the target template.owner_u
- 1 to allow, 0 deny, -1 do not changeowner_m
- 1 to allow, 0 deny, -1 do not changeowner_a
- 1 to allow, 0 deny, -1 do not changegroup_u
- 1 to allow, 0 deny, -1 do not changegroup_m
- 1 to allow, 0 deny, -1 do not changegroup_a
- 1 to allow, 0 deny, -1 do not changeother_u
- 1 to allow, 0 deny, -1 do not changeother_m
- 1 to allow, 0 deny, -1 do not changeother_a
- 1 to allow, 0 deny, -1 do not changepublic static OneResponse chmod(Client client, int id, java.lang.String octet)
client
- XML-RPC Client.id
- The id of the target object.octet
- Permissions octed , e.g. 640public static OneResponse chmod(Client client, int id, int octet)
client
- XML-RPC Client.id
- The id of the target object.octet
- Permissions octed , e.g. 640public static OneResponse instantiate(Client client, int id, java.lang.String name, boolean onHold, java.lang.String template)
client
- XML-RPC Client.id
- The template id of the target template.name
- A string containing the name of the VM instance, can be empty.onHold
- False to create this VM in pending state, true on holdtemplate
- User provided Template to merge with the one
being instantiatedpublic static OneResponse clone(Client client, int id, java.lang.String name)
client
- XML-RPC Client.id
- The template id of the target template.name
- Name for the new template.public static OneResponse rename(Client client, int id, java.lang.String name)
client
- XML-RPC Client.id
- The Template id of the target Template.name
- New name for the Template.public OneResponse info()
public OneResponse delete()
public OneResponse update(java.lang.String new_template)
new_template
- New template contents.public OneResponse publish(boolean publish)
publish
- True for publishing, false for unpublishing.public OneResponse publish()
public OneResponse unpublish()
public OneResponse chown(int uid, int gid)
uid
- The new owner user ID. Set it to -1 to leave the current one.gid
- The new group ID. Set it to -1 to leave the current one.public OneResponse chown(int uid)
uid
- The new owner user ID.public OneResponse chgrp(int gid)
gid
- The new group ID.public OneResponse chmod(int owner_u, int owner_m, int owner_a, int group_u, int group_m, int group_a, int other_u, int other_m, int other_a)
owner_u
- 1 to allow, 0 deny, -1 do not changeowner_m
- 1 to allow, 0 deny, -1 do not changeowner_a
- 1 to allow, 0 deny, -1 do not changegroup_u
- 1 to allow, 0 deny, -1 do not changegroup_m
- 1 to allow, 0 deny, -1 do not changegroup_a
- 1 to allow, 0 deny, -1 do not changeother_u
- 1 to allow, 0 deny, -1 do not changeother_m
- 1 to allow, 0 deny, -1 do not changeother_a
- 1 to allow, 0 deny, -1 do not changepublic OneResponse chmod(java.lang.String octet)
octet
- Permissions octed , e.g. 640public OneResponse chmod(int octet)
octet
- Permissions octed , e.g. 640public OneResponse instantiate(java.lang.String name, boolean onHold, java.lang.String template)
name
- A string containing the name of the VM instance, can be empty.onHold
- False to create this VM in pending state, true on holdtemplate
- User provided Template to merge with the one
being instantiatedpublic OneResponse instantiate(java.lang.String name)
name
- A string containing the name of the VM instance, can be empty.public OneResponse instantiate()
public OneResponse clone(java.lang.String name)
name
- Name for the new template.public OneResponse rename(java.lang.String name)
name
- New name for the Template.Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
Class | Description |
---|---|
Template |
This class represents an OpenNebula template.
|
TemplatePool |
This class represents an OpenNebula Template pool.
|
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
ALL, client, elementName, infoMethod, MINE, MINE_GROUP, poolElements
Constructor and Description |
---|
TemplatePool(Client client)
Creates a new Template pool with the default filter flag value
set to
Pool.MINE_GROUP (Template belonging to the connected user,
and the ones in his group) |
TemplatePool(Client client,
int filter)
Creates a new Template pool.
|
Modifier and Type | Method and Description |
---|---|
PoolElement |
factory(org.w3c.dom.Node node)
The factory method returns a suitable PoolElement object from
an XML node.
|
Template |
getById(int id)
Returns the Template with the given Id from the pool.
|
OneResponse |
info()
Loads the xml representation of all or part of the
Templates in the pool.
|
static OneResponse |
info(Client client,
int filter)
Retrieves all or part of the Templates in the pool.
|
static OneResponse |
info(Client client,
int filter,
int startId,
int endId)
Retrieves all or part of the Templates in the pool.
|
OneResponse |
info(int filter,
int startId,
int endId)
Retrieves all or part of the Templates in the pool.
|
OneResponse |
infoAll()
Loads the xml representation of all the Templates in the pool.
|
static OneResponse |
infoAll(Client client)
Retrieves all the Templates in the pool.
|
OneResponse |
infoGroup()
Loads the xml representation of all the connected user's Templates and
the ones in his group.
|
static OneResponse |
infoGroup(Client client)
Retrieves all the connected user's Templates and the ones in
his group.
|
OneResponse |
infoMine()
Loads the xml representation of all the connected user's Templates.
|
static OneResponse |
infoMine(Client client)
Retrieves all the connected user's Templates.
|
java.util.Iterator<Template> |
iterator() |
getLength, info, info, infoAll, infoGroup, infoMine, item, processInfo, xmlrpcInfo
public TemplatePool(Client client)
Pool.MINE_GROUP
(Template belonging to the connected user,
and the ones in his group)client
- XML-RPC Client.TemplatePool(Client, int)
public TemplatePool(Client client, int filter)
client
- XML-RPC Client.filter
- Filter flag to use by default in the method
info()
. Possible values:
Pool.ALL
: All TemplatesPool.MINE
: Connected user's TemplatesPool.MINE_GROUP
: Connected user's Templates, and the ones in
his grouppublic PoolElement factory(org.w3c.dom.Node node)
Pool
public static OneResponse info(Client client, int filter)
client
- XML-RPC Client.filter
- Filter flag to use. Possible values:
Pool.ALL
: All TemplatesPool.MINE
: Connected user's TemplatesPool.MINE_GROUP
: Connected user's Templates, and the ones in
his grouppublic static OneResponse infoAll(Client client)
client
- XML-RPC Client.public static OneResponse infoMine(Client client)
client
- XML-RPC Client.public static OneResponse infoGroup(Client client)
client
- XML-RPC Client.public static OneResponse info(Client client, int filter, int startId, int endId)
client
- XML-RPC Client.filter
- Filter flag to use. Possible values:
Pool.ALL
: All TemplatesPool.MINE
: Connected user's TemplatesPool.MINE_GROUP
: Connected user's Templates, and the ones in
his groupstartId
- Lowest Id to retrieveendId
- Biggest Id to retrievepublic OneResponse info()
info
in class Pool
info(Client, int)
public OneResponse infoAll()
public OneResponse infoMine()
public OneResponse infoGroup()
public OneResponse info(int filter, int startId, int endId)
info
in class Pool
filter
- Filter flag to use. Possible values:
Pool.ALL
: All TemplatesPool.MINE
: Connected user's TemplatesPool.MINE_GROUP
: Connected user's Templates, and the ones in
his groupstartId
- Lowest Id to retrieveendId
- Biggest Id to retrievepublic java.util.Iterator<Template> iterator()
iterator
in interface java.lang.Iterable<Template>
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
public class VirtualNetworkPool extends Pool implements java.lang.Iterable<VirtualNetwork>
ALL, client, elementName, infoMethod, MINE, MINE_GROUP, poolElements
Constructor and Description |
---|
VirtualNetworkPool(Client client)
Creates a new Virtual Network pool with the default filter flag value
set to
Pool.MINE_GROUP (Virtual Networks belonging to the connected user,
and the ones in his group) |
VirtualNetworkPool(Client client,
int filter)
Creates a new Virtual Network pool.
|
Modifier and Type | Method and Description |
---|---|
PoolElement |
factory(org.w3c.dom.Node node)
The factory method returns a suitable PoolElement object from
an XML node.
|
VirtualNetwork |
getById(int id)
Returns the Virtual Network with the given Id from the pool.
|
OneResponse |
info()
Loads the xml representation of all or part of the
Virtual Networks in the pool.
|
static OneResponse |
info(Client client,
int filter)
Retrieves all or part of the Virtual Networks in the pool.
|
static OneResponse |
info(Client client,
int filter,
int startId,
int endId)
Retrieves all or part of the Virtual Networks in the pool.
|
OneResponse |
info(int filter,
int startId,
int endId)
Retrieves all or part of the Virtual Networks in the pool.
|
OneResponse |
infoAll()
Loads the xml representation of all the Virtual Networks in the pool.
|
static OneResponse |
infoAll(Client client)
Retrieves all the Virtual Networks in the pool.
|
OneResponse |
infoGroup()
Loads the xml representation of all the connected user's Virtual Networks and
the ones in his group.
|
static OneResponse |
infoGroup(Client client)
Retrieves all the connected user's Virtual Networks and the ones in
his group.
|
OneResponse |
infoMine()
Loads the xml representation of all the connected user's Virtual Networks.
|
static OneResponse |
infoMine(Client client)
Retrieves all the connected user's Virtual Networks.
|
java.util.Iterator<VirtualNetwork> |
iterator() |
getLength, info, info, infoAll, infoGroup, infoMine, item, processInfo, xmlrpcInfo
public VirtualNetworkPool(Client client)
Pool.MINE_GROUP
(Virtual Networks belonging to the connected user,
and the ones in his group)client
- XML-RPC Client.VirtualNetworkPool(Client, int)
public VirtualNetworkPool(Client client, int filter)
client
- XML-RPC Client.filter
- Filter flag to use by default in the method
info()
. Possible values:
Pool.ALL
: All Virtual NetworksPool.MINE
: Connected user's Virtual NetworksPool.MINE_GROUP
: Connected user's Virtual Networks, and the ones in
his grouppublic PoolElement factory(org.w3c.dom.Node node)
Pool
public static OneResponse info(Client client, int filter)
client
- XML-RPC Client.filter
- Filter flag to use. Possible values:
Pool.ALL
: All Virtual NetworksPool.MINE
: Connected user's Virtual NetworksPool.MINE_GROUP
: Connected user's Virtual Networks, and the ones in
his grouppublic static OneResponse infoAll(Client client)
client
- XML-RPC Client.public static OneResponse infoMine(Client client)
client
- XML-RPC Client.public static OneResponse infoGroup(Client client)
client
- XML-RPC Client.public static OneResponse info(Client client, int filter, int startId, int endId)
client
- XML-RPC Client.filter
- Filter flag to use. Possible values:
Pool.ALL
: All Virtual NetworksPool.MINE
: Connected user's Virtual NetworksPool.MINE_GROUP
: Connected user's Virtual Networks, and the ones in
his groupstartId
- Lowest Id to retrieveendId
- Biggest Id to retrievepublic OneResponse info()
info
in class Pool
info(Client, int)
public OneResponse infoAll()
public OneResponse infoMine()
public OneResponse infoGroup()
public OneResponse info(int filter, int startId, int endId)
info
in class Pool
filter
- Filter flag to use. Possible values:
Pool.ALL
: All Virtual NetworksPool.MINE
: Connected user's Virtual NetworksPool.MINE_GROUP
: Connected user's Virtual Networks, and the ones in
his groupstartId
- Lowest Id to retrieveendId
- Biggest Id to retrievepublic java.util.Iterator<VirtualNetwork> iterator()
iterator
in interface java.lang.Iterable<VirtualNetwork>
public VirtualNetwork getById(int id)
info()
must be called before.Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
public class VirtualNetwork extends PoolElement
client, id, xml, xpath
Modifier | Constructor and Description |
---|---|
|
VirtualNetwork(int id,
Client client)
Creates a new virtual network representation.
|
protected |
VirtualNetwork(org.w3c.dom.Node xmlElement,
Client client) |
Modifier and Type | Method and Description |
---|---|
static OneResponse |
addLeases(Client client,
int id,
java.lang.String template)
Adds a lease to the VirtualNetwork
|
OneResponse |
addLeases(java.lang.String ip)
Adds a lease to the VirtualNetwork
|
OneResponse |
addLeases(java.lang.String ip,
java.lang.String mac)
Adds a lease to the VirtualNetwork
|
static OneResponse |
allocate(Client client,
java.lang.String description)
Allocates a new virtual network in OpenNebula.
|
static OneResponse |
allocate(Client client,
java.lang.String description,
int clusterId)
Allocates a new virtual network in OpenNebula.
|
OneResponse |
chgrp(int gid)
Changes the group
|
static OneResponse |
chmod(Client client,
int id,
int octet)
Changes the permissions
|
static OneResponse |
chmod(Client client,
int id,
int owner_u,
int owner_m,
int owner_a,
int group_u,
int group_m,
int group_a,
int other_u,
int other_m,
int other_a)
Changes the VirtualNetwork permissions
|
static OneResponse |
chmod(Client client,
int id,
java.lang.String octet)
Changes the permissions
|
OneResponse |
chmod(int octet)
Changes the permissions
|
OneResponse |
chmod(int owner_u,
int owner_m,
int owner_a,
int group_u,
int group_m,
int group_a,
int other_u,
int other_m,
int other_a)
Changes the VirtualNetwork permissions
|
OneResponse |
chmod(java.lang.String octet)
Changes the permissions
|
static OneResponse |
chown(Client client,
int id,
int uid,
int gid)
Changes the owner/group
|
OneResponse |
chown(int uid)
Changes the owner
|
OneResponse |
chown(int uid,
int gid)
Changes the owner/group
|
OneResponse |
delete()
Deletes the network from OpenNebula.
|
static OneResponse |
delete(Client client,
int id)
Deletes a network from OpenNebula.
|
static OneResponse |
hold(Client client,
int id,
java.lang.String template)
Holds a VirtualNetwork lease, marking it as used
|
OneResponse |
hold(java.lang.String ip)
Holds a VirtualNetwork lease, marking it as used
|
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
|
OneResponse |
publish()
Publishes the virtual network.
|
OneResponse |
publish(boolean publish)
Publishes or unpublishes the virtual network.
|
static OneResponse |
publish(Client client,
int id,
boolean publish)
Publishes or unpublishes a virtual network.
|
static OneResponse |
release(Client client,
int id,
java.lang.String template)
Releases a VirtualNetwork lease on hold
|
OneResponse |
release(java.lang.String ip)
Releases a VirtualNetwork lease on hold
|
static OneResponse |
rename(Client client,
int id,
java.lang.String name)
Renames this VirtualNetwork
|
OneResponse |
rename(java.lang.String name)
Renames this VirtualNetwork
|
static OneResponse |
rmLeases(Client client,
int id,
java.lang.String template)
Removes a lease from the VirtualNetwork
|
OneResponse |
rmLeases(java.lang.String ip)
Removes a lease from the VirtualNetwork
|
OneResponse |
unpublish()
Unpublishes the virtual network.
|
static OneResponse |
update(Client client,
int id,
java.lang.String new_template)
Replaces the VirtualNetwork template contents.
|
OneResponse |
update(java.lang.String new_template)
Replaces the VirtualNetwork template contents.
|
public VirtualNetwork(int id, Client client)
id
- The virtual network id (nid) .client
- XML-RPC Client.protected VirtualNetwork(org.w3c.dom.Node xmlElement, Client client)
PoolElement
public static OneResponse allocate(Client client, java.lang.String description, int clusterId)
client
- XML-RPC Client.description
- A string containing the template
of the virtual network.clusterId
- The cluster ID. If it is -1, this virtual network
won't be added to any cluster.public static OneResponse allocate(Client client, java.lang.String description)
client
- XML-RPC Client.description
- A string containing the template
of the virtual network.public static OneResponse info(Client client, int id)
client
- XML-RPC Client.id
- the virtual network id (nid) for the network to
retrieve the information from.public static OneResponse delete(Client client, int id)
client
- XML-RPC Client.id
- The virtual network id (nid) of the target network.public static OneResponse publish(Client client, int id, boolean publish)
client
- XML-RPC Client.id
- The virtual network id (nid) of the target network.publish
- True for publishing, false for unpublishing.public static OneResponse addLeases(Client client, int id, java.lang.String template)
client
- XML-RPC Client.id
- The virtual network id (nid) of the target network.template
- IP to add, e.g. "LEASES = [ IP = 192.168.0.5 ]"public static OneResponse rmLeases(Client client, int id, java.lang.String template)
client
- XML-RPC Client.id
- The virtual network id (nid) of the target network.template
- IP to remove, e.g. "LEASES = [ IP = 192.168.0.5 ]"public static OneResponse hold(Client client, int id, java.lang.String template)
client
- XML-RPC Client.id
- The virtual network id (nid) of the target network.template
- IP to hold, e.g. "LEASES = [ IP = 192.168.0.5 ]"public static OneResponse release(Client client, int id, java.lang.String template)
client
- XML-RPC Client.id
- The virtual network id (nid) of the target network.template
- IP to release, e.g. "LEASES = [ IP = 192.168.0.5 ]"public static OneResponse chown(Client client, int id, int uid, int gid)
client
- XML-RPC Client.id
- The virtual network id (nid) of the target network.uid
- The new owner user ID. Set it to -1 to leave the current one.gid
- The new group ID. Set it to -1 to leave the current one.public static OneResponse chmod(Client client, int id, int owner_u, int owner_m, int owner_a, int group_u, int group_m, int group_a, int other_u, int other_m, int other_a)
client
- XML-RPC Client.id
- The virtual network id (nid) of the target network.owner_u
- 1 to allow, 0 deny, -1 do not changeowner_m
- 1 to allow, 0 deny, -1 do not changeowner_a
- 1 to allow, 0 deny, -1 do not changegroup_u
- 1 to allow, 0 deny, -1 do not changegroup_m
- 1 to allow, 0 deny, -1 do not changegroup_a
- 1 to allow, 0 deny, -1 do not changeother_u
- 1 to allow, 0 deny, -1 do not changeother_m
- 1 to allow, 0 deny, -1 do not changeother_a
- 1 to allow, 0 deny, -1 do not changepublic static OneResponse chmod(Client client, int id, java.lang.String octet)
client
- XML-RPC Client.id
- The id of the target object.octet
- Permissions octed , e.g. 640public static OneResponse chmod(Client client, int id, int octet)
client
- XML-RPC Client.id
- The id of the target object.octet
- Permissions octed , e.g. 640public static OneResponse update(Client client, int id, java.lang.String new_template)
client
- XML-RPC Client.id
- The vnet id of the target vnet we want to modify.new_template
- New template contents.public static OneResponse rename(Client client, int id, java.lang.String name)
client
- XML-RPC Client.id
- The VirtualNetwork id of the target VirtualNetwork.name
- New name for the VirtualNetwork.public OneResponse info()
info(Client, int)
public OneResponse delete()
public OneResponse publish(boolean publish)
publish
- True for publishing, false for unpublishing.public OneResponse publish()
public OneResponse unpublish()
public OneResponse addLeases(java.lang.String ip)
ip
- IP to add, e.g. "192.168.0.5"public OneResponse addLeases(java.lang.String ip, java.lang.String mac)
ip
- IP to add, e.g. "192.168.0.5"mac
- MAC address associated to the IP. Can be null, in which case
OpenNebula will generate it using the following rule:
MAC = MAC_PREFFIX:IPpublic OneResponse rmLeases(java.lang.String ip)
ip
- IP to remove, e.g. "192.168.0.5"public OneResponse hold(java.lang.String ip)
ip
- IP to hold, e.g. "192.168.0.5"public OneResponse release(java.lang.String ip)
ip
- IP to release, e.g. "192.168.0.5"public OneResponse chown(int uid, int gid)
uid
- The new owner user ID. Set it to -1 to leave the current one.gid
- The new group ID. Set it to -1 to leave the current one.public OneResponse chown(int uid)
uid
- The new owner user ID.public OneResponse chgrp(int gid)
gid
- The new group ID.public OneResponse chmod(int owner_u, int owner_m, int owner_a, int group_u, int group_m, int group_a, int other_u, int other_m, int other_a)
owner_u
- 1 to allow, 0 deny, -1 do not changeowner_m
- 1 to allow, 0 deny, -1 do not changeowner_a
- 1 to allow, 0 deny, -1 do not changegroup_u
- 1 to allow, 0 deny, -1 do not changegroup_m
- 1 to allow, 0 deny, -1 do not changegroup_a
- 1 to allow, 0 deny, -1 do not changeother_u
- 1 to allow, 0 deny, -1 do not changeother_m
- 1 to allow, 0 deny, -1 do not changeother_a
- 1 to allow, 0 deny, -1 do not changepublic OneResponse chmod(java.lang.String octet)
octet
- Permissions octed , e.g. 640public OneResponse chmod(int octet)
octet
- Permissions octed , e.g. 640public OneResponse update(java.lang.String new_template)
new_template
- New template contents.public OneResponse rename(java.lang.String name)
name
- New name for the VirtualNetwork.Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
Class | Description |
---|---|
VirtualNetwork |
This class represents an OpenNebula virtual network.
|
VirtualNetworkPool |
This class represents an OpenNebula Virtual Network pool.
|
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
public class OneException
extends java.lang.Exception
OneException
class is a generic OpenNebula exception.Constructor and Description |
---|
OneException(java.lang.String message) |
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
public class OneSystem
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected Client |
client |
static java.lang.String |
VERSION |
Modifier and Type | Method and Description |
---|---|
boolean |
compatibleVersion()
Returns whether of not the oned version is the same as the OCA version
|
OneResponse |
getConfiguration()
Calls OpenNebula and retrieves oned configuration
|
org.w3c.dom.Node |
getConfigurationXML()
Calls OpenNebula and retrieves oned configuration
|
OneResponse |
getGroupQuotas()
Gets the default group quota limits
|
org.w3c.dom.Node |
getGroupQuotasXML()
Gets the default group quota limits
|
OneResponse |
getOnedVersion()
Calls OpenNebula and retrieves the oned version
|
OneResponse |
getUserQuotas()
Gets the default user quota limits
|
org.w3c.dom.Node |
getUserQuotasXML()
Gets the default user quota limits
|
OneResponse |
setGroupQuotas(java.lang.String quota)
Sets the default group quota limits
|
OneResponse |
setUserQuotas(java.lang.String quota)
Sets the default user quota limits
|
protected Client client
public static final java.lang.String VERSION
public OneSystem(Client client)
public OneResponse getOnedVersion()
public boolean compatibleVersion()
public OneResponse getConfiguration()
public org.w3c.dom.Node getConfigurationXML()
public OneResponse getUserQuotas()
public org.w3c.dom.Node getUserQuotasXML()
public OneResponse setUserQuotas(java.lang.String quota)
quota
- a template (XML or txt) with the new quota limitspublic OneResponse getGroupQuotas()
public org.w3c.dom.Node getGroupQuotasXML()
public OneResponse setGroupQuotas(java.lang.String quota)
quota
- a template (XML or txt) with the new quota limitsVisit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
Modifier and Type | Field and Description |
---|---|
protected Client |
client |
protected int |
id |
protected org.w3c.dom.Node |
xml |
protected static javax.xml.xpath.XPath |
xpath |
Modifier | Constructor and Description |
---|---|
protected |
PoolElement(int id,
Client client)
Creates a new PoolElement with the specified attributes.
|
protected |
PoolElement(org.w3c.dom.Node xmlElement,
Client client)
Creates a new PoolElement from the xml provided.
|
Modifier and Type | Method and Description |
---|---|
protected static OneResponse |
chmod(Client client,
java.lang.String method,
int id,
int octet)
Changes the permissions
|
protected static OneResponse |
chmod(Client client,
java.lang.String method,
int id,
int owner_u,
int owner_m,
int owner_a,
int group_u,
int group_m,
int group_a,
int other_u,
int other_m,
int other_a)
Changes the permissions
|
protected static OneResponse |
chmod(Client client,
java.lang.String method,
int id,
java.lang.String octet)
Changes the permissions
|
java.lang.String |
getId()
Returns the element's ID.
|
java.lang.String |
getName()
Returns the element's name.
|
int |
gid()
Returns the element group's ID, or -1 if the element doesn't have one.
|
int |
id() |
protected void |
processInfo(OneResponse info)
After a *.info call, this method builds the internal xml
representation of the pool.
|
int |
state()
Performs an xpath evaluation for the "state" expression.
|
int |
uid()
Returns the owner User's ID, or -1 if the element doesn't have one.
|
java.lang.String |
xpath(java.lang.String expression)
Evaluates an XPath expression and returns the result as a String.
|
protected static javax.xml.xpath.XPath xpath
protected int id
protected org.w3c.dom.Node xml
protected Client client
protected PoolElement(int id, Client client)
id
- Id of the element.client
- XML-RPC Client.protected PoolElement(org.w3c.dom.Node xmlElement, Client client)
client
- XML-RPC Client.xmlElement
- XML representation of the element.protected void processInfo(OneResponse info)
info
- The XML-RPC *.info responseprotected static OneResponse chmod(Client client, java.lang.String method, int id, int owner_u, int owner_m, int owner_a, int group_u, int group_m, int group_a, int other_u, int other_m, int other_a)
client
- XML-RPC Client.method
- XML-RPC method.id
- The id of the target object.owner_u
- 1 to allow, 0 deny, -1 do not changeowner_m
- 1 to allow, 0 deny, -1 do not changeowner_a
- 1 to allow, 0 deny, -1 do not changegroup_u
- 1 to allow, 0 deny, -1 do not changegroup_m
- 1 to allow, 0 deny, -1 do not changegroup_a
- 1 to allow, 0 deny, -1 do not changeother_u
- 1 to allow, 0 deny, -1 do not changeother_m
- 1 to allow, 0 deny, -1 do not changeother_a
- 1 to allow, 0 deny, -1 do not changeprotected static OneResponse chmod(Client client, java.lang.String method, int id, java.lang.String octet)
client
- XML-RPC Client.method
- XML-RPC method.id
- The id of the target object.octet
- Permissions octet, e.g. 640protected static OneResponse chmod(Client client, java.lang.String method, int id, int octet)
client
- XML-RPC Client.method
- XML-RPC method.id
- The id of the target object.octet
- Permissions octed , e.g. 640public java.lang.String getId()
public int id()
public java.lang.String getName()
public int state()
public int uid()
public int gid()
public java.lang.String xpath(java.lang.String expression)
expression
- The XPath expression.Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
public class Client
extends java.lang.Object
Constructor and Description |
---|
Client()
Creates a new xml-rpc client with default options: the auth.
|
Client(java.lang.String secret,
java.lang.String endpoint)
Creates a new xml-rpc client with specified options.
|
Modifier and Type | Method and Description |
---|---|
OneResponse |
call(java.lang.String action,
java.lang.Object... args)
Performs an XML-RPC call.
|
OneResponse |
get_version()
Calls OpenNebula and retrieves oned version
|
public Client() throws ClientConfigurationException
ClientConfigurationException
- if the default configuration options are invalid.public Client(java.lang.String secret, java.lang.String endpoint) throws ClientConfigurationException
secret
- A string containing the ONE user:password tuple. Can be nullendpoint
- Where the rpc server is listening, must be something like
"http://localhost:2633/RPC2". Can be nullClientConfigurationException
- if the configuration options are invalidpublic OneResponse call(java.lang.String action, java.lang.Object... args)
action
- ONE actionargs
- ONE argumentspublic OneResponse get_version()
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
public class ClientConfigurationException extends OneException
Constructor and Description |
---|
ClientConfigurationException(java.lang.String message) |
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
ALL, client, elementName, infoMethod, MINE, MINE_GROUP, poolElements
Constructor and Description |
---|
UserPool(Client client)
Creates a new user pool
|
Modifier and Type | Method and Description |
---|---|
PoolElement |
factory(org.w3c.dom.Node node)
The factory method returns a suitable PoolElement object from
an XML node.
|
User |
getById(int id)
Returns the User with the given Id from the pool.
|
OneResponse |
info()
Loads the xml representation of the user pool.
|
static OneResponse |
info(Client client)
Retrieves all the users in the pool.
|
java.util.Iterator<User> |
iterator() |
public UserPool(Client client)
client
- XML-RPC Client.public PoolElement factory(org.w3c.dom.Node node)
Pool
public static OneResponse info(Client client)
client
- XML-RPC Client.public OneResponse info()
public java.util.Iterator<User> iterator()
iterator
in interface java.lang.Iterable<User>
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
public class User extends PoolElement
client, id, xml, xpath
Modifier | Constructor and Description |
---|---|
|
User(int id,
Client client)
Creates a new User representation.
|
protected |
User(org.w3c.dom.Node xmlElement,
Client client) |
Modifier and Type | Method and Description |
---|---|
static OneResponse |
allocate(Client client,
java.lang.String username,
java.lang.String password)
Allocates a new user in OpenNebula.
|
static OneResponse |
allocate(Client client,
java.lang.String username,
java.lang.String password,
java.lang.String auth)
Allocates a new user in OpenNebula.
|
static OneResponse |
chauth(Client client,
int id,
java.lang.String auth,
java.lang.String password)
Changes the auth driver and the password of the given user
|
OneResponse |
chauth(java.lang.String auth)
Changes the auth driver of the given user
|
OneResponse |
chauth(java.lang.String auth,
java.lang.String password)
Changes the auth driver and the password of the given user
|
static OneResponse |
chgrp(Client client,
int id,
int gid)
Changes the main group of the given user
|
OneResponse |
chgrp(int gid)
Changes the main group of the given user
|
OneResponse |
delete()
Deletes the user from OpenNebula.
|
static OneResponse |
delete(Client client,
int id)
Deletes a user from OpenNebula.
|
OneResponse |
info()
Loads the xml representation of the user.
|
static OneResponse |
info(Client client,
int id)
Retrieves the information of the given user.
|
boolean |
isEnabled()
Returns true if the user is enabled.
|
static OneResponse |
passwd(Client client,
int id,
java.lang.String password)
Changes the password for the given user.
|
OneResponse |
passwd(java.lang.String password)
Changes the password for the user.
|
static OneResponse |
setQuota(Client client,
int id,
java.lang.String quota_template)
Replaces the user quota template contents.
|
OneResponse |
setQuota(java.lang.String quota_template)
Replaces the user quota template contents.
|
static OneResponse |
update(Client client,
int id,
java.lang.String new_template)
Replaces the user template contents.
|
OneResponse |
update(java.lang.String new_template)
Replaces the user template contents.
|
public User(int id, Client client)
id
- The user id (uid).client
- XML-RPC Client.protected User(org.w3c.dom.Node xmlElement, Client client)
PoolElement
public static OneResponse allocate(Client client, java.lang.String username, java.lang.String password)
client
- XML-RPC Client.username
- Username for the new user.password
- Password for the new userpublic static OneResponse allocate(Client client, java.lang.String username, java.lang.String password, java.lang.String auth)
client
- XML-RPC Client.username
- Username for the new user.password
- Password for the new userauth
- Auth driver for the new user.public static OneResponse info(Client client, int id)
client
- XML-RPC Client.id
- The user id (uid) for the user to
retrieve the information from.public static OneResponse delete(Client client, int id)
client
- XML-RPC Client.id
- The user id (uid) of the target user we want to delete.public static OneResponse passwd(Client client, int id, java.lang.String password)
client
- XML-RPC Client.id
- The user id (uid) of the target user we want to modify.password
- The new password.public static OneResponse chgrp(Client client, int id, int gid)
client
- XML-RPC Client.id
- The user id (uid) of the target user we want to modify.gid
- The new group ID.public static OneResponse chauth(Client client, int id, java.lang.String auth, java.lang.String password)
client
- XML-RPC Client.id
- The user id (uid) of the target user we want to modify.auth
- The new auth driver.password
- The new password. If it is an empty string,
the user password is not changedpublic static OneResponse update(Client client, int id, java.lang.String new_template)
client
- XML-RPC Client.id
- The user id of the target user we want to modify.new_template
- New template contents.public static OneResponse setQuota(Client client, int id, java.lang.String quota_template)
client
- XML-RPC Client.id
- The user id of the target user we want to modify.quota_template
- New quota template contents.public OneResponse info()
info(Client, int)
public OneResponse delete()
delete(Client, int)
public OneResponse passwd(java.lang.String password)
password
- The new password.public OneResponse chgrp(int gid)
gid
- The new group ID.public OneResponse chauth(java.lang.String auth, java.lang.String password)
auth
- The new auth driver.password
- The new password. If it is an empty string,
the user password is not changedpublic OneResponse chauth(java.lang.String auth)
auth
- The new auth driver.public OneResponse update(java.lang.String new_template)
new_template
- New template contents.public OneResponse setQuota(java.lang.String quota_template)
quota_template
- New quota template contents.public boolean isEnabled()
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
public class VirtualMachinePool extends Pool implements java.lang.Iterable<VirtualMachine>
Modifier and Type | Field and Description |
---|---|
static int |
ALL_VM
Flag for Virtual Machines in any state.
|
static int |
NOT_DONE
Flag for Virtual Machines in any state, except for DONE.
|
ALL, client, elementName, infoMethod, MINE, MINE_GROUP, poolElements
Constructor and Description |
---|
VirtualMachinePool(Client client)
Creates a new Virtual Machine pool with the default filter flag value
set to
Pool.MINE_GROUP (Virtual Machines belonging to the connected user,
and the ones in his group) |
VirtualMachinePool(Client client,
int filter)
Creates a new Virtual Machine pool.
|
Modifier and Type | Method and Description |
---|---|
PoolElement |
factory(org.w3c.dom.Node node)
The factory method returns a suitable PoolElement object from
an XML node.
|
VirtualMachine |
getById(int id)
Returns the Virtual Machine with the given Id from the pool.
|
OneResponse |
info()
Loads the xml representation of all or part of the
Virtual Machines in the pool.
|
static OneResponse |
info(Client client,
int filter)
Retrieves all or part of the Virtual Machines in the pool.
|
static OneResponse |
info(Client client,
int filter,
int startId,
int endId,
int state)
Retrieves all or part of the Virtual Machines in the pool.
|
OneResponse |
info(int filter,
int startId,
int endId,
int state)
Retrieves all or part of the Virtual Machines in the pool.
|
OneResponse |
infoAll()
Loads the xml representation of all the Virtual Machines in the pool.
|
static OneResponse |
infoAll(Client client)
Retrieves all the Virtual Machines in the pool.
|
OneResponse |
infoGroup()
Loads the xml representation of all the connected user's Virtual Machines and
the ones in his group.
|
static OneResponse |
infoGroup(Client client)
Retrieves all the connected user's Virtual Machines and the ones in
his group.
|
OneResponse |
infoMine()
Loads the xml representation of all the connected user's Virtual Machines.
|
static OneResponse |
infoMine(Client client)
Retrieves all the connected user's Virtual Machines.
|
java.util.Iterator<VirtualMachine> |
iterator() |
static OneResponse |
monitoring(Client client,
int filter)
Retrieves the monitoring data for all or part of the Virtual
Machines in the pool.
|
OneResponse |
monitoring(int filter)
Retrieves the monitoring data for all or part of the Virtual
Machines in the pool.
|
public static final int ALL_VM
public static final int NOT_DONE
public VirtualMachinePool(Client client)
Pool.MINE_GROUP
(Virtual Machines belonging to the connected user,
and the ones in his group)client
- XML-RPC Client.VirtualMachinePool(Client, int)
public VirtualMachinePool(Client client, int filter)
client
- XML-RPC Client.filter
- Filter flag to use by default in the method
info()
. Possible values:
Pool.ALL
: All Virtual MachinesPool.MINE
: Connected user's Virtual MachinesPool.MINE_GROUP
: Connected user's Virtual Machines, and the ones in
his grouppublic PoolElement factory(org.w3c.dom.Node node)
Pool
public static OneResponse info(Client client, int filter)
client
- XML-RPC Client.filter
- Filter flag to use. Possible values:
Pool.ALL
: All Virtual MachinesPool.MINE
: Connected user's Virtual MachinesPool.MINE_GROUP
: Connected user's Virtual Machines, and the ones in
his grouppublic static OneResponse infoAll(Client client)
client
- XML-RPC Client.public static OneResponse infoMine(Client client)
client
- XML-RPC Client.public static OneResponse infoGroup(Client client)
client
- XML-RPC Client.public static OneResponse info(Client client, int filter, int startId, int endId, int state)
client
- XML-RPC Client.filter
- Filter flag to use. Possible values:
Pool.ALL
: All Virtual MachinesPool.MINE
: Connected user's Virtual MachinesPool.MINE_GROUP
: Connected user's Virtual Machines, and the ones in
his groupstartId
- Lowest Id to retrieveendId
- Biggest Id to retrievestate
- Numeric state of the Virtual Machines wanted, or one
of ALL_VM
or
NOT_DONE
public static OneResponse monitoring(Client client, int filter)
client
- XML-RPC Client.filter
- Filter flag to use. Possible values:
Pool.ALL
: All Virtual MachinesPool.MINE
: Connected user's Virtual MachinesPool.MINE_GROUP
: Connected user's Virtual Machines, and
the ones in his grouppublic OneResponse info()
info
in class Pool
info(Client, int)
public OneResponse infoAll()
public OneResponse infoMine()
public OneResponse infoGroup()
public OneResponse info(int filter, int startId, int endId, int state)
filter
- Filter flag to use. Possible values:
Pool.ALL
: All Virtual MachinesPool.MINE
: Connected user's Virtual MachinesPool.MINE_GROUP
: Connected user's Virtual Machines, and the ones in
his groupstartId
- Lowest Id to retrieveendId
- Biggest Id to retrievestate
- Numeric state of the Virtual Machines wantedpublic OneResponse monitoring(int filter)
filter
- Filter flag to use. Possible values:
Pool.ALL
: All Virtual MachinesPool.MINE
: Connected user's Virtual MachinesPool.MINE_GROUP
: Connected user's Virtual Machines, and
the ones in his grouppublic java.util.Iterator<VirtualMachine> iterator()
iterator
in interface java.lang.Iterable<VirtualMachine>
public VirtualMachine getById(int id)
info()
must be called before.Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
public class VirtualMachine extends PoolElement
client, id, xml, xpath
Modifier | Constructor and Description |
---|---|
|
VirtualMachine(int id,
Client client)
Creates a new VM representation.
|
protected |
VirtualMachine(org.w3c.dom.Node xmlElement,
Client client) |
Modifier and Type | Method and Description |
---|---|
protected OneResponse |
action(java.lang.String action)
Submits an action to be performed on the virtual machine.
|
static OneResponse |
allocate(Client client,
java.lang.String description)
Allocates a new VM in OpenNebula.
|
static OneResponse |
allocate(Client client,
java.lang.String description,
boolean onHold)
Allocates a new VM in OpenNebula.
|
static OneResponse |
attachdisk(Client client,
int id,
java.lang.String diskTemplate)
Deprecated.
|
OneResponse |
attachdisk(java.lang.String diskTemplate)
Deprecated.
Replaced by
diskAttach(String) |
OneResponse |
boot()
Forces a re-deployment of a VM in UNKNOWN or BOOT states.
|
OneResponse |
cancel()
Deprecated.
Replaced by hard shutdown
shutdown(boolean) |
OneResponse |
chgrp(int gid)
Changes the group
|
static OneResponse |
chmod(Client client,
int id,
int octet)
Changes the permissions
|
static OneResponse |
chmod(Client client,
int id,
int owner_u,
int owner_m,
int owner_a,
int group_u,
int group_m,
int group_a,
int other_u,
int other_m,
int other_a)
Changes the VM permissions
|
static OneResponse |
chmod(Client client,
int id,
java.lang.String octet)
Changes the permissions
|
OneResponse |
chmod(int octet)
Changes the permissions
|
OneResponse |
chmod(int owner_u,
int owner_m,
int owner_a,
int group_u,
int group_m,
int group_a,
int other_u,
int other_m,
int other_a)
Changes the VM permissions
|
OneResponse |
chmod(java.lang.String octet)
Changes the permissions
|
static OneResponse |
chown(Client client,
int id,
int uid,
int gid)
Changes the owner/group
|
OneResponse |
chown(int uid)
Changes the owner
|
OneResponse |
chown(int uid,
int gid)
Changes the owner/group
|
OneResponse |
delete()
Deletes the VM from the pool and database.
|
OneResponse |
delete(boolean recreate)
Deletes the VM from the pool and database.
|
OneResponse |
deploy(int hostId)
Initiates the instance of the VM on the target host.
|
OneResponse |
deploy(int hostId,
boolean enforce)
Initiates the instance of the VM on the target host.
|
static OneResponse |
detachdisk(Client client,
int id,
int diskId)
Deprecated.
|
OneResponse |
detachdisk(int diskId)
Deprecated.
|
static OneResponse |
diskAttach(Client client,
int id,
java.lang.String diskTemplate)
Attaches a disk to a running VM
|
OneResponse |
diskAttach(java.lang.String diskTemplate)
Attaches a disk to a running VM
|
static OneResponse |
diskDetach(Client client,
int id,
int diskId)
Detaches a disk from a running VM
|
OneResponse |
diskDetach(int diskId)
Detaches a disk from a running VM
|
static OneResponse |
diskSnapshot(Client client,
int id,
int diskId,
java.lang.String imageName,
java.lang.String imageType,
boolean hot)
Sets the specified vm's disk to be saved in a new image.
|
OneResponse |
diskSnapshot(int diskId,
java.lang.String imageName)
Sets the specified vm's disk to be saved in a new image when the
VirtualMachine shuts down.
|
OneResponse |
diskSnapshot(int diskId,
java.lang.String imageName,
boolean hot)
Sets the specified vm's disk to be saved in a new image.
|
OneResponse |
diskSnapshot(int diskId,
java.lang.String imageName,
java.lang.String imageType,
boolean hot)
Sets the specified vm's disk to be saved in a new image.
|
OneResponse |
finalizeVM()
Deprecated.
Replaced by
delete() |
OneResponse |
hold()
Sets the VM to hold state.
|
OneResponse |
info()
Loads the xml representation of the virtual machine.
|
static OneResponse |
info(Client client,
int id)
Retrieves the information of the given VM.
|
int |
lcmState()
Returns the LCM state of the VirtualMachine (numeric value).
|
java.lang.String |
lcmStateStr()
Returns the LCM state of the VirtualMachine (string value).
|
OneResponse |
liveMigrate(int hostId)
Deprecated.
Replaced by
migrate(int, boolean, boolean) |
OneResponse |
migrate(int hostId)
Migrates the virtual machine to the target host (hid).
|
OneResponse |
migrate(int hostId,
boolean live)
Migrates the virtual machine to the target host (hid).
|
OneResponse |
migrate(int hostId,
boolean live,
boolean enforce)
Migrates the virtual machine to the target host (hid).
|
OneResponse |
monitoring()
Retrieves the monitoring information of the given VM, in XML
|
static OneResponse |
monitoring(Client client,
int id)
Retrieves the monitoring information of the given VM, in XML
|
static OneResponse |
nicAttach(Client client,
int id,
java.lang.String nicTemplate)
Attaches a NIC to a running VM
|
OneResponse |
nicAttach(java.lang.String nicTemplate)
Attaches a NIC to a running VM
|
static OneResponse |
nicDetach(Client client,
int id,
int nicId)
Detaches a NIC from a running VM
|
OneResponse |
nicDetach(int nicId)
Detaches a NIC from a running VM
|
OneResponse |
poweroff()
Powers off a running VM.
|
OneResponse |
poweroff(boolean hard)
Powers off a running VM.
|
OneResponse |
reboot()
Reboots a running VM.
|
OneResponse |
reboot(boolean hard)
Reboots a running VM.
|
OneResponse |
recover(boolean success)
Recovers a stuck VM.
|
static OneResponse |
recover(Client client,
int id,
boolean success)
Recovers a stuck VM.
|
OneResponse |
release()
Releases a virtual machine from hold state.
|
static OneResponse |
rename(Client client,
int id,
java.lang.String name)
Renames this VM
|
OneResponse |
rename(java.lang.String name)
Renames this VM
|
OneResponse |
resched()
Sets the re-scheduling flag for the VM
|
OneResponse |
reset()
Deprecated.
Replaced by hard reboot
reboot(boolean) |
static OneResponse |
resize(Client client,
int id,
java.lang.String capacityTemplate,
boolean enforce)
Resizes the VM capacity
|
OneResponse |
resize(java.lang.String capacityTemplate,
boolean enforce)
Resizes this VM's capacity
|
OneResponse |
restart()
Deprecated.
Replaced by
boot() |
OneResponse |
resubmit()
Deprecated.
Replaced by delete and recreate
delete(boolean) |
OneResponse |
resume()
Resumes the execution of a saved VM.
|
OneResponse |
savedisk(int diskId,
java.lang.String imageName)
Deprecated.
Replaced by
diskSnapshot(int,String) |
OneResponse |
savedisk(int diskId,
java.lang.String imageName,
java.lang.String imageType)
Deprecated.
Replaced by
diskSnapshot(int,String,String,boolean) |
OneResponse |
shutdown()
Gracefully shuts down the already deployed VM.
|
OneResponse |
shutdown(boolean hard)
Shuts down the already deployed VM.
|
static OneResponse |
snapshotCreate(Client client,
int id,
java.lang.String name)
Creates a new VM snapshot
|
OneResponse |
snapshotCreate(java.lang.String name)
Creates a new VM snapshot
|
static OneResponse |
snapshotDelete(Client client,
int id,
int snapId)
Deletes a VM snapshot.
|
OneResponse |
snapshotDelete(int snapId)
Deletes a VM snapshot
|
static OneResponse |
snapshotRevert(Client client,
int id,
int snapId)
Reverts to a snapshot
|
OneResponse |
snapshotRevert(int snapId)
Reverts to a snapshot
|
int |
state()
Performs an xpath evaluation for the "state" expression.
|
java.lang.String |
stateStr()
Returns the VM state of the VirtualMachine (string value).
|
java.lang.String |
status()
Returns the short status string for the VirtualMachine.
|
OneResponse |
stop()
Stops the virtual machine.
|
OneResponse |
suspend()
Suspends the virtual machine.
|
OneResponse |
undeploy(boolean hard)
Undeploy a running VM, it preserve its resources and disk modifications.
|
OneResponse |
unresched()
Unsets the re-scheduling flag for the VM
|
static OneResponse |
update(Client client,
int id,
java.lang.String new_template)
Replaces the user template contents for the given VM.
|
OneResponse |
update(java.lang.String new_template)
Replaces this VM's user template contents.
|
public VirtualMachine(int id, Client client)
id
- The virtual machine Id (vid).client
- XML-RPC Client.protected VirtualMachine(org.w3c.dom.Node xmlElement, Client client)
PoolElement
public static OneResponse allocate(Client client, java.lang.String description)
client
- XML-RPC Client.description
- A string containing the template of the vm.public static OneResponse allocate(Client client, java.lang.String description, boolean onHold)
client
- XML-RPC Client.description
- A string containing the template of the vm.onHold
- False to create this VM in pending state, true on holdpublic static OneResponse update(Client client, int id, java.lang.String new_template)
client
- XML-RPC Client.id
- The id of the target vm.new_template
- New template contentspublic static OneResponse resize(Client client, int id, java.lang.String capacityTemplate, boolean enforce)
client
- XML-RPC Client.id
- The id of the target vm.capacityTemplate
- Template containing the new capacity
elements CPU, VCPU, MEMORY. If one of them is not present, or its
value is 0, it will not be resizedenforce
- If it is set to true, the host capacity
will be checked. This will only affect oneadmin requests, regular users
resize requests will always be enforcedpublic static OneResponse info(Client client, int id)
client
- XML-RPC Client.id
- The virtual machine id (vid) of the target instance.public static OneResponse chown(Client client, int id, int uid, int gid)
client
- XML-RPC Client.id
- The virtual machine id (vid) of the target instance.uid
- The new owner user ID. Set it to -1 to leave the current one.gid
- The new group ID. Set it to -1 to leave the current one.public static OneResponse chmod(Client client, int id, int owner_u, int owner_m, int owner_a, int group_u, int group_m, int group_a, int other_u, int other_m, int other_a)
client
- XML-RPC Client.id
- The VM id of the target VM.owner_u
- 1 to allow, 0 deny, -1 do not changeowner_m
- 1 to allow, 0 deny, -1 do not changeowner_a
- 1 to allow, 0 deny, -1 do not changegroup_u
- 1 to allow, 0 deny, -1 do not changegroup_m
- 1 to allow, 0 deny, -1 do not changegroup_a
- 1 to allow, 0 deny, -1 do not changeother_u
- 1 to allow, 0 deny, -1 do not changeother_m
- 1 to allow, 0 deny, -1 do not changeother_a
- 1 to allow, 0 deny, -1 do not changepublic static OneResponse chmod(Client client, int id, java.lang.String octet)
client
- XML-RPC Client.id
- The id of the target object.octet
- Permissions octed , e.g. 640public static OneResponse chmod(Client client, int id, int octet)
client
- XML-RPC Client.id
- The id of the target object.octet
- Permissions octed , e.g. 640public static OneResponse monitoring(Client client, int id)
client
- XML-RPC Client.id
- The virtual machine id (vid) of the target instance.public static OneResponse diskAttach(Client client, int id, java.lang.String diskTemplate)
client
- XML-RPC Client.id
- The virtual machine id (vid) of the target instance.diskTemplate
- Template containing the new DISK definitionpublic static OneResponse diskDetach(Client client, int id, int diskId)
client
- XML-RPC Client.id
- The virtual machine id (vid) of the target instance.diskId
- The DISK_ID of the disk to detachpublic static OneResponse diskSnapshot(Client client, int id, int diskId, java.lang.String imageName, java.lang.String imageType, boolean hot)
client
- XML-RPC Client.id
- The virtual machine id (vid) of the target instance.diskId
- ID of the disk to be saved.imageName
- Name of the new Image that will be created.imageType
- Type of the new image. Set to empty string to use
the default typehot
- True to save the disk immediately, false will perform
the operation when the VM shuts downpublic static OneResponse nicAttach(Client client, int id, java.lang.String nicTemplate)
client
- XML-RPC Client.id
- The virtual machine id (vid) of the target instance.nicTemplate
- Template containing the new NIC definitionpublic static OneResponse nicDetach(Client client, int id, int nicId)
client
- XML-RPC Client.id
- The virtual machine id (vid) of the target instance.nicId
- The NIC_ID of the NIC to detachpublic static OneResponse rename(Client client, int id, java.lang.String name)
client
- XML-RPC Client.id
- The VM id of the target VM.name
- New name for the VM.public static OneResponse snapshotCreate(Client client, int id, java.lang.String name)
client
- XML-RPC Client.id
- The VM id of the target VM.name
- Name for the snapshot.public static OneResponse snapshotRevert(Client client, int id, int snapId)
client
- XML-RPC Client.id
- The VM id of the target VM.snapId
- Id of the snapshotpublic static OneResponse snapshotDelete(Client client, int id, int snapId)
client
- XML-RPC Client.id
- The VM id of the target VM.snapId
- Id of the snapshotpublic static OneResponse recover(Client client, int id, boolean success)
client
- XML-RPC Client.id
- The virtual machine id (vid) of the target instance.success
- recover by succeeding the missing transaction if true.public OneResponse info()
info(Client, int)
public OneResponse deploy(int hostId, boolean enforce)
hostId
- The host id (hid) of the target host where
the VM will be instantiated.enforce
- If it is set to true, the host capacity
will be checked, and the deployment will fail if the host is
overcommited. Defaults to falsepublic OneResponse deploy(int hostId)
hostId
- The host id (hid) of the target host where
the VM will be instantiated.protected OneResponse action(java.lang.String action)
action
- The action name to be performed, can be:public OneResponse migrate(int hostId, boolean live, boolean enforce)
hostId
- The target host id (hid) where we want to migrate
the vm.live
- If true we are indicating that we want livemigration,
otherwise false.enforce
- If it is set to true, the host capacity
will be checked, and the deployment will fail if the host is
overcommited. Defaults to falsepublic OneResponse migrate(int hostId, boolean live)
hostId
- The target host id (hid) where we want to migrate
the vm.live
- If true the migration is done without downtime.public OneResponse migrate(int hostId)
hostId
- The target host id (hid) where we want to migrate
the vm.public OneResponse chown(int uid, int gid)
uid
- The new owner user ID. Set it to -1 to leave the current one.gid
- The new group ID. Set it to -1 to leave the current one.public OneResponse chown(int uid)
uid
- The new owner user ID.public OneResponse chgrp(int gid)
gid
- The new group ID.public OneResponse chmod(int owner_u, int owner_m, int owner_a, int group_u, int group_m, int group_a, int other_u, int other_m, int other_a)
owner_u
- 1 to allow, 0 deny, -1 do not changeowner_m
- 1 to allow, 0 deny, -1 do not changeowner_a
- 1 to allow, 0 deny, -1 do not changegroup_u
- 1 to allow, 0 deny, -1 do not changegroup_m
- 1 to allow, 0 deny, -1 do not changegroup_a
- 1 to allow, 0 deny, -1 do not changeother_u
- 1 to allow, 0 deny, -1 do not changeother_m
- 1 to allow, 0 deny, -1 do not changeother_a
- 1 to allow, 0 deny, -1 do not changepublic OneResponse chmod(java.lang.String octet)
octet
- Permissions octed , e.g. 640public OneResponse chmod(int octet)
octet
- Permissions octed , e.g. 640public OneResponse monitoring()
public OneResponse diskAttach(java.lang.String diskTemplate)
diskTemplate
- Template containing the new DISK definitionpublic OneResponse diskDetach(int diskId)
diskId
- The DISK_ID of the disk to detachpublic OneResponse diskSnapshot(int diskId, java.lang.String imageName, java.lang.String imageType, boolean hot)
diskId
- ID of the disk to be saved.imageName
- Name of the new Image that will be created.imageType
- Type of the new image. Set to empty string to use
the default typehot
- True to save the disk immediately, false will perform
the operation when the VM shuts downpublic OneResponse diskSnapshot(int diskId, java.lang.String imageName)
diskId
- ID of the disk to be saved.imageName
- Name of the new Image that will be created.public OneResponse diskSnapshot(int diskId, java.lang.String imageName, boolean hot)
diskId
- ID of the disk to be saved.imageName
- Name of the new Image that will be created.hot
- True to save the disk immediately, false will perform
the operation when the VM shuts downpublic OneResponse nicAttach(java.lang.String nicTemplate)
nicTemplate
- Template containing the new NIC definitionpublic OneResponse nicDetach(int nicId)
nicId
- The NIC_ID of the NIC to detachpublic OneResponse rename(java.lang.String name)
name
- New name for the VM.public OneResponse update(java.lang.String new_template)
new_template
- New template contentspublic OneResponse resize(java.lang.String capacityTemplate, boolean enforce)
capacityTemplate
- Template containing the new capacity
elements CPU, VCPU, MEMORY. If one of them is not present, or its
value is 0, it will not be resizedenforce
- If it is set to true, the host capacity
will be checked. This will only affect oneadmin requests, regular users
resize requests will always be enforcedpublic OneResponse snapshotCreate(java.lang.String name)
name
- Name for the snapshot.public OneResponse snapshotRevert(int snapId)
snapId
- Id of the snapshotpublic OneResponse snapshotDelete(int snapId)
snapId
- Id of the snapshotpublic OneResponse recover(boolean success)
success
- recover by succeeding the missing transaction if true.public OneResponse shutdown()
public OneResponse shutdown(boolean hard)
hard
- True to perform a hard (no acpi) shutdown, false for a
graceful shutdownpublic OneResponse undeploy(boolean hard)
hard
- True to perform a hard (no acpi) shutdown, false for a
graceful shutdownpublic OneResponse poweroff()
public OneResponse poweroff(boolean hard)
hard
- True to perform a hard (no acpi) shutdown, false for a
graceful shutdownpublic OneResponse reboot()
public OneResponse reboot(boolean hard)
hard
- True to perform a hard (no acpi) reboot, false for a
graceful rebootpublic OneResponse hold()
public OneResponse release()
public OneResponse stop()
public OneResponse suspend()
public OneResponse resume()
public OneResponse delete()
public OneResponse delete(boolean recreate)
recreate
- True to recreate the VM in the pending state.public OneResponse boot()
public OneResponse resched()
public OneResponse unresched()
public int state()
PoolElement
state
in class PoolElement
public java.lang.String stateStr()
public int lcmState()
public java.lang.String lcmStateStr()
public java.lang.String status()
@Deprecated public static OneResponse attachdisk(Client client, int id, java.lang.String diskTemplate)
diskAttach(org.opennebula.client.Client, int, java.lang.String)
client
- XML-RPC Client.id
- The virtual machine id (vid) of the target instance.diskTemplate
- Template containing the new DISK definition@Deprecated public static OneResponse detachdisk(Client client, int id, int diskId)
diskDetach(org.opennebula.client.Client, int, int)
client
- XML-RPC Client.id
- The virtual machine id (vid) of the target instance.diskId
- The DISK_ID of the disk to detach@Deprecated public OneResponse savedisk(int diskId, java.lang.String imageName)
diskSnapshot(int,String)
public OneResponse savedisk(int diskId, java.lang.String imageName, java.lang.String imageType)
diskSnapshot(int,String,String,boolean)
@Deprecated public OneResponse attachdisk(java.lang.String diskTemplate)
diskAttach(String)
@Deprecated public OneResponse detachdisk(int diskId)
@Deprecated public OneResponse cancel()
shutdown(boolean)
@Deprecated public OneResponse reset()
reboot(boolean)
@Deprecated public OneResponse finalizeVM()
delete()
@Deprecated public OneResponse resubmit()
delete(boolean)
@Deprecated public OneResponse restart()
boot()
@Deprecated public OneResponse liveMigrate(int hostId)
migrate(int, boolean, boolean)
migrate(int, boolean)
with live set to true.hostId
- The target host id (hid) where we want to migrate
the vm.Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
Class | Description |
---|---|
VirtualMachine |
This class represents an OpenNebula VM.
|
VirtualMachinePool |
This class represents an OpenNebula VM pool.
|
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
public class Acl extends PoolElement
AclPool.getById(int)
client, id, xml, xpath
Modifier | Constructor and Description |
---|---|
protected |
Acl(org.w3c.dom.Node xmlElement,
Client client) |
Modifier and Type | Method and Description |
---|---|
static OneResponse |
allocate(Client client,
long user,
long resource,
long rights)
Allocates a new ACl rule in OpenNebula
|
static OneResponse |
allocate(Client client,
java.lang.String rule)
Allocates a new ACl rule in OpenNebula
|
static OneResponse |
allocate(Client client,
java.lang.String user,
java.lang.String resource,
java.lang.String rights)
Allocates a new ACl rule in OpenNebula
|
OneResponse |
delete()
Deletes the ACL rule from OpenNebula.
|
static OneResponse |
delete(Client client,
int id)
Deletes an ACL rule from OpenNebula.
|
static java.lang.String[] |
parseRule(java.lang.String rule)
Parses a rule string, e.g.
|
long |
resource() |
long |
rights() |
java.lang.String |
toString() |
long |
user() |
protected Acl(org.w3c.dom.Node xmlElement, Client client)
PoolElement
public static OneResponse allocate(Client client, java.lang.String user, java.lang.String resource, java.lang.String rights)
client
- XML-RPC Client.user
- A string containing a hex number, e.g. 0x100000001resource
- A string containing a hex number, e.g. 0x2100000001rights
- A string containing a hex number, e.g. 0x10public static OneResponse allocate(Client client, long user, long resource, long rights)
client
- XML-RPC Client.user
- 64b encoded userresource
- 64b encoded userrights
- 64b encoded userpublic static OneResponse allocate(Client client, java.lang.String rule) throws RuleParseException
client
- XML-RPC Client.rule
- a rule string, e.g. "#5 HOST+VM/@12 INFO+CREATE+DELETE"RuleParseException
- If the rule syntax is wrong.public static OneResponse delete(Client client, int id)
client
- XML-RPC Client.id
- The ACL rule id.public OneResponse delete()
delete(Client, int)
public long user()
public long resource()
public long rights()
public java.lang.String toString()
toString
in class java.lang.Object
public static java.lang.String[] parseRule(java.lang.String rule) throws RuleParseException
rule
- an ACL rule in string formatRuleParseException
- If the rule syntax is wrong.Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
ALL, client, elementName, infoMethod, MINE, MINE_GROUP, poolElements
Constructor and Description |
---|
AclPool(Client client)
Creates a new ACL rule pool
|
Modifier and Type | Method and Description |
---|---|
PoolElement |
factory(org.w3c.dom.Node node)
The factory method returns a suitable PoolElement object from
an XML node.
|
Acl |
getById(int id)
Returns the ACl rule with the given Id from the pool.
|
OneResponse |
info()
Loads the xml representation of the ACL rule pool.
|
static OneResponse |
info(Client client)
Retrieves all the hosts in the pool.
|
java.util.Iterator<Acl> |
iterator() |
public AclPool(Client client)
client
- XML-RPC Client.public PoolElement factory(org.w3c.dom.Node node)
Pool
public static OneResponse info(Client client)
client
- XML-RPC Client.public OneResponse info()
info
in class Pool
info(Client)
public java.util.Iterator<Acl> iterator()
iterator
in interface java.lang.Iterable<Acl>
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
Class | Description |
---|---|
Acl |
This class represents an OpenNebula ACL rule.
|
AclPool |
This class represents an OpenNebula ACL rule pool.
|
Exception | Description |
---|---|
RuleParseException |
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
public class RuleParseException extends OneException
Constructor and Description |
---|
RuleParseException(java.lang.String message) |
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
Package | Description |
---|---|
org.opennebula.client |
Provides the Java bindings for the OpenNebula Cloud API (OCA).
|
org.opennebula.client.acl | |
org.opennebula.client.cluster | |
org.opennebula.client.datastore | |
org.opennebula.client.document | |
org.opennebula.client.group | |
org.opennebula.client.host | |
org.opennebula.client.image | |
org.opennebula.client.template | |
org.opennebula.client.user | |
org.opennebula.client.vm | |
org.opennebula.client.vnet |
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
Modifier and Type | Constant Field | Value |
---|---|---|
public static final java.lang.String |
VERSION |
"4.0.1" |
Modifier and Type | Constant Field | Value |
---|---|---|
public static final int |
ALL |
-2 |
public static final int |
MINE |
-3 |
public static final int |
MINE_GROUP |
-1 |
Modifier and Type | Constant Field | Value |
---|---|---|
public static final int |
NONE_CLUSTER_ID |
-1 |
Modifier and Type | Constant Field | Value |
---|---|---|
public static final int |
ALL_VM |
-2 |
public static final int |
NOT_DONE |
-1 |
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.
Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:
Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:
Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
Each annotation type has its own separate page with the following sections:
Each enum has its own separate page with the following sections:
There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object
. The interfaces do not inherit from java.lang.Object
.
The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
These links take you to the next or previous class, interface, package, or related page.
These links show and hide the HTML frames. All pages are available with or without frames.
The All Classes link shows all classes and interfaces except non-static nested types.
Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.
The Constant Field Values page lists the static final fields and their values.
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.
VirtualMachine.diskAttach(String)
VirtualMachine.shutdown(boolean)
Pool.MINE_GROUP
(Document belonging to the connected user,
and the ones in his group)VirtualMachine.delete()
Pool.MINE_GROUP
(Images belonging to the connected user,
and the ones in his group)VirtualMachine.migrate(int, boolean, boolean)
OneException
class is a generic OpenNebula exception.VirtualMachine.reboot(boolean)
VirtualMachine.boot()
VirtualMachine.delete(boolean)
VirtualMachine.diskSnapshot(int,String)
Pool.MINE_GROUP
(Template belonging to the connected user,
and the ones in his group)Pool.MINE_GROUP
(Virtual Machines belonging to the connected user,
and the ones in his group)Pool.MINE_GROUP
(Virtual Networks belonging to the connected user,
and the ones in his group)Visit OpenNebula.org
Copyright 2002-2013 ©
OpenNebula Project (OpenNebula.org), C12G Labs.