java-oca-4.14.2/ 0000775 0001750 0001750 00000000000 12623124371 013142 5 ustar cmartin cmartin java-oca-4.14.2/doc/ 0000775 0001750 0001750 00000000000 12623124371 013707 5 ustar cmartin cmartin java-oca-4.14.2/doc/index.html 0000664 0001750 0001750 00000005426 12623124371 015713 0 ustar cmartin cmartin
Modifier and Type | Constant Field | Value |
---|---|---|
public static final java.lang.String |
VERSION |
"4.14.2" |
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-2015 ©
OpenNebula Project, OpenNebula Systems.
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 |
addgroup(Client client,
int id,
int gid)
Adds the User to a secondary group
|
OneResponse |
addgroup(int gid)
Adds the User to a secondary group
|
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.
|
static OneResponse |
delgroup(Client client,
int id,
int gid)
Removes the User from a secondary group.
|
OneResponse |
delgroup(int gid)
Removes the User from a secondary group.
|
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 |
login(Client client,
java.lang.String username,
java.lang.String token,
int expire)
Sets the LOGIN_TOKEN for the user
|
OneResponse |
login(java.lang.String token,
int expire)
Sets the LOGIN_TOKEN for the user.
|
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,
boolean append)
Replaces the user template contents.
|
OneResponse |
update(java.lang.String new_template)
Replaces the user template contents.
|
OneResponse |
update(java.lang.String new_template,
boolean append)
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 addgroup(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 delgroup(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 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, boolean append)
client
- XML-RPC Client.id
- The user id of the target user we want to modify.new_template
- New template contents.append
- True to append new attributes instead of replace the whole templatepublic 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 static OneResponse login(Client client, java.lang.String username, java.lang.String token, int expire)
username
- of the usertoken
- the login token, if empty OpenNebula will
generate oneexpire
- valid period of the token in secs. If <= 0
the token will be resetpublic 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 addgroup(int gid)
gid
- The new group ID.public OneResponse delgroup(int gid)
gid
- The 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 update(java.lang.String new_template, boolean append)
new_template
- New template contents.append
- True to append new attributes instead of replace the whole templatepublic OneResponse setQuota(java.lang.String quota_template)
quota_template
- New quota template contents.public OneResponse login(java.lang.String token, int expire)
token
- the login token, if empty OpenNebula will
generate oneexpire
- valid period of the token in secs. If <= 0
the token will be resetpublic boolean isEnabled()
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
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-2015 ©
OpenNebula Project, OpenNebula Systems.
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-2015 ©
OpenNebula Project, OpenNebula Systems.
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
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,
int targetDS)
Clones this Image into a new one
|
OneResponse |
clone(java.lang.String name)
Clones this Image into a new one
|
OneResponse |
clone(java.lang.String name,
int targetDS)
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.
|
static OneResponse |
snapshotDelete(Client client,
int id,
int snapId)
Deletes Image from snapshot
|
OneResponse |
snapshotDelete(int snapId)
Deletes Image from snapshot
|
static OneResponse |
snapshotFlatten(Client client,
int id,
int snapId)
Flattens an image snapshot
|
OneResponse |
snapshotFlatten(int snapId)
Flattens an image snapshot
|
static OneResponse |
snapshotRevert(Client client,
int id,
int snapId)
Reverts Image state to a previous snapshot
|
OneResponse |
snapshotRevert(int snapId)
Reverts Image state to a previous snapshot
|
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,
boolean append)
Replaces the template contents.
|
OneResponse |
update(java.lang.String new_template)
Replaces the template contents.
|
OneResponse |
update(java.lang.String new_template,
boolean append)
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, boolean append)
client
- XML-RPC Client.id
- The image id of the target image we want to modify.new_template
- New template contentsappend
- True to append new attributes instead of replace the whole templatepublic 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, int targetDS)
client
- XML-RPC Client.id
- The Image id of the target Image.name
- Name for the new Image.targetDS
- The ID of the target datastore. Set to -1 to use the current one.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 static OneResponse snapshotDelete(Client client, int id, int snapId)
client
- XML-RPC Client.id
- The Image id of the target Image.snapId
- ID of the snapshot to deletepublic static OneResponse snapshotRevert(Client client, int id, int snapId)
client
- XML-RPC Client.id
- The Image id of the target Image.snapId
- ID of the snapshot to revert topublic static OneResponse snapshotFlatten(Client client, int id, int snapId)
client
- XML-RPC Client.id
- The Image id of the target Image.snapId
- ID of the snapshot to flattenpublic OneResponse info()
public OneResponse delete()
public OneResponse update(java.lang.String new_template)
new_template
- New template contentspublic OneResponse update(java.lang.String new_template, boolean append)
new_template
- New template contentsappend
- True to append new attributes instead of replace the whole templatepublic 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 clone(java.lang.String name, int targetDS)
name
- Name for the new Image.targetDS
- The ID of the target datastore.public OneResponse rename(java.lang.String name)
name
- New name for the Image.public OneResponse snapshotDelete(int snapId)
snapId
- ID of the snapshot to deletepublic OneResponse snapshotRevert(int snapId)
snapId
- ID of the snapshot to revert topublic OneResponse snapshotFlatten(int snapId)
snapId
- ID of the snapshot to flattenpublic 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-2015 ©
OpenNebula Project, OpenNebula Systems.
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
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-2015 ©
OpenNebula Project, OpenNebula Systems.
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
public class SecurityGroup extends PoolElement
client, id, xml, xpath
Modifier | Constructor and Description |
---|---|
|
SecurityGroup(int id,
Client client)
Creates a new security group representation.
|
protected |
SecurityGroup(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 security group 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 security group 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 security group 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 security group into a new one
|
OneResponse |
clone(java.lang.String name)
Clones this security group into a new one
|
OneResponse |
delete()
Deletes the security group from OpenNebula.
|
static OneResponse |
delete(Client client,
int id)
Deletes a security group from OpenNebula.
|
OneResponse |
info()
Loads the xml representation of the security group.
|
static OneResponse |
info(Client client,
int id)
Retrieves the information of the given security group
|
static OneResponse |
rename(Client client,
int id,
java.lang.String name)
Renames this security group
|
OneResponse |
rename(java.lang.String name)
Renames this security group
|
static OneResponse |
update(Client client,
int id,
java.lang.String new_template,
boolean append)
Replaces the security group template contents.
|
OneResponse |
update(java.lang.String new_template)
Replaces the security group template contents.
|
OneResponse |
update(java.lang.String new_template,
boolean append)
Replaces the security group template contents.
|
public SecurityGroup(int id, Client client)
id
- The security group id.client
- XML-RPC Client.protected SecurityGroup(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 security group.public static OneResponse info(Client client, int id)
client
- XML-RPC Client.id
- the id for the security group to
retrieve the information from.public static OneResponse delete(Client client, int id)
client
- XML-RPC Client.id
- The id of the target security group.public static OneResponse chown(Client client, int id, int uid, int gid)
client
- XML-RPC Client.id
- The id of the target security group.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 security group.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, boolean append)
client
- XML-RPC Client.id
- The id of the target security group we want to modify.new_template
- New template contents.append
- True to append new attributes instead of replace the whole templatepublic static OneResponse clone(Client client, int id, java.lang.String name)
client
- XML-RPC Client.id
- The id of the target security group.name
- Name for the new template.public static OneResponse rename(Client client, int id, java.lang.String name)
client
- XML-RPC Client.id
- The id of the target security group.name
- New name for the security group.public OneResponse info()
info(Client, int)
public OneResponse delete()
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 update(java.lang.String new_template, boolean append)
new_template
- New template contents.append
- True to append new attributes instead of replace the whole templatepublic OneResponse clone(java.lang.String name)
name
- Name for the new security group.public OneResponse rename(java.lang.String name)
name
- New name for the security group.Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
Class | Description |
---|---|
SecurityGroup |
This class represents an OpenNebula security group.
|
SecurityGroupPool |
This class represents an OpenNebula Security Group pool.
|
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
public class SecurityGroupPool extends Pool implements java.lang.Iterable<SecurityGroup>
ALL, client, elementName, infoMethod, MINE, MINE_GROUP, poolElements
Constructor and Description |
---|
SecurityGroupPool(Client client)
Creates a new Security Group pool with the default filter flag value
set to
Pool.MINE_GROUP (Security Groups belonging to the connected user,
and the ones in his group) |
SecurityGroupPool(Client client,
int filter)
Creates a new Security 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.
|
SecurityGroup |
getById(int id)
Returns the Security Group with the given Id from the pool.
|
OneResponse |
info()
Loads the xml representation of all or part of the
Security Groups in the pool.
|
static OneResponse |
info(Client client,
int filter)
Retrieves all or part of the Security Groups in the pool.
|
static OneResponse |
info(Client client,
int filter,
int startId,
int endId)
Retrieves all or part of the Security Groups in the pool.
|
OneResponse |
info(int filter,
int startId,
int endId)
Retrieves all or part of the Security Groups in the pool.
|
OneResponse |
infoAll()
Loads the xml representation of all the Security Groups in the pool.
|
static OneResponse |
infoAll(Client client)
Retrieves all the Security Groups in the pool.
|
OneResponse |
infoGroup()
Loads the xml representation of all the connected user's Security Groups and
the ones in his group.
|
static OneResponse |
infoGroup(Client client)
Retrieves all the connected user's Security Groups and the ones in
his group.
|
OneResponse |
infoMine()
Loads the xml representation of all the connected user's Security Groups.
|
static OneResponse |
infoMine(Client client)
Retrieves all the connected user's Security Groups.
|
java.util.Iterator<SecurityGroup> |
iterator() |
getLength, info, info, infoAll, infoGroup, infoMine, item, processInfo, xmlrpcInfo
public SecurityGroupPool(Client client)
Pool.MINE_GROUP
(Security Groups belonging to the connected user,
and the ones in his group)client
- XML-RPC Client.SecurityGroupPool(Client, int)
public SecurityGroupPool(Client client, int filter)
client
- XML-RPC Client.filter
- Filter flag to use by default in the method
info()
. Possible values:
Pool.ALL
: All Security GroupsPool.MINE
: Connected user's Security GroupsPool.MINE_GROUP
: Connected user's Security Groups, 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 Security GroupsPool.MINE
: Connected user's Security GroupsPool.MINE_GROUP
: Connected user's Security Groups, 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 Security GroupsPool.MINE
: Connected user's Security GroupsPool.MINE_GROUP
: Connected user's Security Groups, 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 Security GroupsPool.MINE
: Connected user's Security GroupsPool.MINE_GROUP
: Connected user's Security Groups, and the ones in
his groupstartId
- Lowest Id to retrieveendId
- Biggest Id to retrievepublic java.util.Iterator<SecurityGroup> iterator()
iterator
in interface java.lang.Iterable<SecurityGroup>
public SecurityGroup getById(int id)
info()
must be called before.Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
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-2015 ©
OpenNebula Project, OpenNebula Systems.
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 |
addAdmin(Client client,
int id,
int uid)
Adds a User to the Group administrators set
|
OneResponse |
addAdmin(int uid)
Adds a User to the Group administrators set
|
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
|
boolean |
containsAdmin(int uid)
Returns whether or not the user is an admin of this group
|
static OneResponse |
delAdmin(Client client,
int id,
int uid)
Removes a User from the Group administrators set
|
OneResponse |
delAdmin(int uid)
Removes a User from the Group administrators set
|
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.
|
static OneResponse |
update(Client client,
int id,
java.lang.String new_template,
boolean append)
Replaces the template contents.
|
OneResponse |
update(java.lang.String new_template)
Replaces the template contents.
|
OneResponse |
update(java.lang.String new_template,
boolean append)
Replaces the 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 static OneResponse update(Client client, int id, java.lang.String new_template, boolean append)
client
- XML-RPC Client.id
- The group id of the target group we want to modify.new_template
- New template contentsappend
- True to append new attributes instead of replace the whole templatepublic static OneResponse addAdmin(Client client, int id, int uid)
client
- XML-RPC Client.id
- The group id of the target group we want to modify.uid
- User IDpublic static OneResponse delAdmin(Client client, int id, int uid)
client
- XML-RPC Client.id
- The group id of the target group we want to modify.uid
- User IDpublic 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 OneResponse update(java.lang.String new_template)
new_template
- New template contentspublic OneResponse update(java.lang.String new_template, boolean append)
new_template
- New template contentsappend
- True to append new attributes instead of replace the whole templatepublic OneResponse addAdmin(int uid)
uid
- User IDpublic OneResponse delAdmin(int uid)
uid
- User IDpublic boolean contains(int uid)
uid
- The user ID.public boolean containsAdmin(int uid)
uid
- The user ID.Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
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 |
rename(Client client,
int id,
java.lang.String name)
Renames this Cluster.
|
OneResponse |
rename(java.lang.String name)
Renames this Cluster
|
static OneResponse |
update(Client client,
int id,
java.lang.String new_template,
boolean append)
Replaces the cluster contents.
|
OneResponse |
update(java.lang.String new_template)
Replaces the cluster template.
|
OneResponse |
update(java.lang.String new_template,
boolean append)
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, boolean append)
client
- XML-RPC Client.id
- The id of the target cluster we want to modify.new_template
- New template contents.append
- True to append new attributes instead of replace the whole templatepublic 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 static OneResponse rename(Client client, int id, java.lang.String name)
client
- XML-RPC Client.id
- The image id of the target host we want to modify.name
- New name for the Clusterpublic 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 update(java.lang.String new_template, boolean append)
new_template
- New cluster template.append
- True to append new attributes instead of replace the whole templatepublic 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 OneResponse rename(java.lang.String name)
name
- New name for the Cluster.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-2015 ©
OpenNebula Project, OpenNebula Systems.
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
Class | Description |
---|---|
Cluster |
This class represents an OpenNebula cluster.
|
ClusterPool |
This class represents an OpenNebula cluster pool.
|
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
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-2015 ©
OpenNebula Project, OpenNebula Systems.
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
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 |
disable()
Disables the datastore.
|
OneResponse |
enable()
Enables the datastore.
|
OneResponse |
enable(boolean enable)
Enables or disables the datastore.
|
static OneResponse |
enable(Client client,
int id,
boolean enable)
Enables or disables this Datastore.
|
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.
|
static OneResponse |
rename(Client client,
int id,
java.lang.String name)
Renames this Datastore.
|
OneResponse |
rename(java.lang.String name)
Renames this Datastore
|
java.lang.String |
shortStateStr()
Returns the state of the Datastore as a short String.
|
java.lang.String |
shortTypeStr()
Returns the type of the Datastore as a short String.
|
int |
state()
Returns the state of the Datastore.
|
java.lang.String |
stateStr()
Returns the state of the Datastore as a 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,
boolean append)
Replaces the datastore contents.
|
OneResponse |
update(java.lang.String new_template)
Replaces the datastore template.
|
OneResponse |
update(java.lang.String new_template,
boolean append)
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, boolean append)
client
- XML-RPC Client.id
- The id of the target datastore we want to modify.new_template
- New datastore contents.append
- True to append new attributes instead of replace the whole templatepublic 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 static OneResponse rename(Client client, int id, java.lang.String name)
client
- XML-RPC Client.id
- The id of the target object.name
- New name for the Datastorepublic static OneResponse enable(Client client, int id, boolean enable)
client
- XML-RPC Client.id
- The id of the target object.enable
- True for enabling, false for disabling.public OneResponse info()
public OneResponse delete()
public OneResponse update(java.lang.String new_template)
new_template
- New datastore template.public OneResponse update(java.lang.String new_template, boolean append)
new_template
- New datastore template.append
- True to append new attributes instead of replace the whole templatepublic 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 rename(java.lang.String name)
name
- New name for the Datastore.public OneResponse enable(boolean enable)
enable
- True for enabling, false for disabling.public OneResponse enable()
public OneResponse disable()
public int type()
public java.lang.String typeStr()
public java.lang.String shortTypeStr()
public int state()
state
in class PoolElement
public java.lang.String stateStr()
public java.lang.String shortStateStr()
public boolean contains(int id)
id
- The image ID.Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
Class | Description |
---|---|
Datastore |
This class represents an OpenNebula datastore.
|
DatastorePool |
This class represents an OpenNebula datastore pool.
|
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
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-2015 ©
OpenNebula Project, OpenNebula Systems.
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-2015 ©
OpenNebula Project, OpenNebula Systems.
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
Class | Description |
---|---|
VirtualNetwork |
This class represents an OpenNebula virtual network.
|
VirtualNetworkPool |
This class represents an OpenNebula Virtual Network pool.
|
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
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 |
addAr(Client client,
int id,
java.lang.String template)
Adds an Address Range to the VirtualNetwork
|
OneResponse |
addAr(java.lang.String template)
Adds an Address Range 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 |
free(Client client,
int id,
int arId)
Removes an Address Range from the VirtualNetwork
|
OneResponse |
free(int arId)
Removes an Address Range from the VirtualNetwork
|
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 |
hold(java.lang.String ip,
int arId)
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
|
OneResponse |
release(java.lang.String ip,
int arId)
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 |
reserve(Client client,
int id,
java.lang.String template)
Reserve a set of addresses from this virtual network
|
OneResponse |
reserve(java.lang.String template)
Reserve a set of addresses from this virtual network
|
static OneResponse |
rmAr(Client client,
int id,
int arId)
Removes an Address Range from the VirtualNetwork
|
OneResponse |
rmAr(int arId)
Removes an Address Range from the VirtualNetwork
|
OneResponse |
unpublish()
Unpublishes the virtual network.
|
static OneResponse |
update(Client client,
int id,
java.lang.String new_template,
boolean append)
Replaces the VirtualNetwork template contents.
|
OneResponse |
update(java.lang.String new_template)
Replaces the VirtualNetwork template contents.
|
OneResponse |
update(java.lang.String new_template,
boolean append)
Replaces the VirtualNetwork template contents.
|
static OneResponse |
updateAr(Client client,
int id,
java.lang.String template)
Upates an Address Range from the VirtualNetwork
|
OneResponse |
updateAr(java.lang.String template)
Upates an Address Range from the VirtualNetwork
|
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 addAr(Client client, int id, java.lang.String template)
client
- XML-RPC Client.id
- The virtual network id (nid) of the target network.template
- AR to add, example:
AR = [
TYPE = IP4,
IP = 192.168.0.5,
SIZE = 10 ]public static OneResponse rmAr(Client client, int id, int arId)
client
- XML-RPC Client.id
- The virtual network id (nid) of the target network.arId
- Id of the Address Range to removepublic static OneResponse updateAr(Client client, int id, java.lang.String template)
client
- XML-RPC Client.id
- The virtual network id (nid) of the target network.template
- AR to update, example:
AR = [
AR_ID = 3,
TYPE = IP4,
IP = 192.168.0.5,
SIZE = 10 ]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
- Address to hold, examples:
LEASES = [ IP = 192.168.0.5 ] LEASES = [ MAC = 02:00:0a:00:00:96 ] LEASES = [ IP = 192.168.0.5, AR_ID = 3 ]
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
- Address to release, examples:
LEASES = [ IP = 192.168.0.5 ] LEASES = [ MAC = 02:00:0a:00:00:96 ] LEASES = [ IP = 192.168.0.5, AR_ID = 3 ]
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, boolean append)
client
- XML-RPC Client.id
- The vnet id of the target vnet we want to modify.new_template
- New template contents.append
- True to append new attributes instead of replace the whole templatepublic 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 static OneResponse reserve(Client client, int id, java.lang.String template)
client
- XML-RPC Client.id
- The virtual network id (nid) of the target network.template
- of the reservation. Examples:
SIZE = 10 SIZE = 10 AR_ID = 3 NAME = "new_network" SIZE = 10 IP = 192.168.10.50 NETWORK_ID = 9
public static OneResponse free(Client client, int id, int arId)
client
- XML-RPC Client.id
- The virtual network id (nid) of the target network.arId
- Id of the Address Range to removepublic 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 addAr(java.lang.String template)
template
- AR to add, example:
AR = [ TYPE = IP4, IP = 192.168.0.5, SIZE = 10 ]
public OneResponse rmAr(int arId)
arId
- Id of the Address Range to removepublic OneResponse updateAr(java.lang.String template)
template
- AR to update, example:
AR = [ AR_ID = 3, TYPE = IP4, IP = 192.168.0.5, SIZE = 10 ]
public OneResponse hold(java.lang.String ip)
ip
- IP or MAC to hold, e.g. "192.168.0.5", "02:00:0a:00:00:96"public OneResponse hold(java.lang.String ip, int arId)
ip
- IP or MAC to hold, e.g. "192.168.0.5", "02:00:0a:00:00:96"arId
- Id of the Address Range to hold the lease frompublic OneResponse release(java.lang.String ip)
ip
- IP or MAC to hold, e.g. "192.168.0.5", "02:00:0a:00:00:96"public OneResponse release(java.lang.String ip, int arId)
ip
- IP or MAC to hold, e.g. "192.168.0.5", "02:00:0a:00:00:96"arId
- Id of the Address Range to release the lease frompublic 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 update(java.lang.String new_template, boolean append)
new_template
- New template contents.append
- True to append new attributes instead of replace the whole templatepublic OneResponse rename(java.lang.String name)
name
- New name for the VirtualNetwork.public OneResponse reserve(java.lang.String template)
template
- of the reservation. Examples:
SIZE = 10 SIZE = 10 AR_ID = 3 NAME = "new_network" SIZE = 10 IP = 192.168.10.50 NETWORK_ID = 9
public OneResponse free(int arId)
arId
- Id of the Address Range to removeVisit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
Class | Description |
---|---|
VirtualMachine |
This class represents an OpenNebula VM.
|
VirtualMachinePool |
This class represents an OpenNebula VM pool.
|
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
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 |
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,
int dsId)
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 |
diskSaveas(Client client,
int id,
int diskId,
java.lang.String imageName,
java.lang.String imageType,
int snapId)
Sets the specified vm's disk to be saved as a new image.
|
OneResponse |
diskSaveas(int diskId,
java.lang.String imageName)
Sets the specified vm's disk to be saved as a new image.
|
OneResponse |
diskSaveas(int diskId,
java.lang.String imageName,
int snapId)
Sets the specified vm's disk to be saved in a new image.
|
OneResponse |
diskSaveas(int diskId,
java.lang.String imageName,
java.lang.String imageType,
int snapId)
Sets the specified vm's disk to be saved as a new image.
|
static OneResponse |
diskSnapshotCreate(Client client,
int id,
int diskId,
java.lang.String name)
Takes a new snapshot of a disk
|
OneResponse |
diskSnapshotCreate(int diskId,
java.lang.String name)
Takes a new snapshot of a disk
|
static OneResponse |
diskSnapshotDelete(Client client,
int id,
int diskId,
int snapId)
Deletes a disk snapshot
|
OneResponse |
diskSnapshotDelete(int diskId,
int snapId)
Deletes a disk snapshot
|
static OneResponse |
diskSnapshotRevert(Client client,
int id,
int diskId,
int snapId)
Reverts disk state to a previously taken snapshot
|
OneResponse |
diskSnapshotRevert(int diskId,
int snapId)
Reverts disk state to a previously taken snapshot
|
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, int) |
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,
int ds_id)
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.
|
static OneResponse |
recover(Client client,
int id,
int operation)
Recovers a stuck VM.
|
OneResponse |
recover(int operation)
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 |
resubmit()
Deprecated.
Replaced by delete and recreate
delete(boolean) |
OneResponse |
resume()
Resumes the execution of a saved VM.
|
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,
boolean append)
Replaces the user template contents for the given VM.
|
OneResponse |
update(java.lang.String new_template)
Replaces this VM's user template contents.
|
OneResponse |
update(java.lang.String new_template,
boolean append)
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, boolean append)
client
- XML-RPC Client.id
- The id of the target vm.new_template
- New template contentsappend
- True to append new attributes instead of replace the whole templatepublic 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 diskSaveas(Client client, int id, int diskId, java.lang.String imageName, java.lang.String imageType, int snapId)
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 typesnapId
- ID of the snapshot to save, -1 to use the
current disk image statepublic 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 diskSnapshotCreate(Client client, int id, int diskId, java.lang.String name)
client
- XML-RPC Client.id
- The VM id of the target VM.diskId
- Id of the diskname
- description for the snapshotpublic static OneResponse diskSnapshotRevert(Client client, int id, int diskId, int snapId)
client
- XML-RPC Client.id
- The VM id of the target VM.diskId
- Id of the disksnapId
- Id of the snapshotpublic static OneResponse diskSnapshotDelete(Client client, int id, int diskId, int snapId)
client
- XML-RPC Client.id
- The VM id of the target VM.diskId
- Id of the disksnapId
- Id of the snapshotpublic static OneResponse recover(Client client, int id, int operation)
client
- XML-RPC Client.id
- The virtual machine id (vid) of the target instance.operation
- to recover the VM: (0) failure, (1) success or (2)
retrypublic OneResponse info()
info(Client, int)
public OneResponse deploy(int hostId, boolean enforce, int dsId)
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 falsedsId
- The System Datastore where to deploy the VM. To use the
default, set it to -1public 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, int ds_id)
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 falseds_id
- The System Datastore where to migrate the VM. To use the
current one, set it to -1public 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 diskSaveas(int diskId, java.lang.String imageName, java.lang.String imageType, int snapId)
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 typesnapId
- ID of the snapshot to save, -1 to use the
current disk image statepublic OneResponse diskSaveas(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 diskSaveas(int diskId, java.lang.String imageName, int snapId)
diskId
- ID of the disk to be saved.imageName
- Name of the new Image that will be created.snapId
- ID of the snapshot to save, -1 to use the
current disk image statepublic 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 update(java.lang.String new_template, boolean append)
new_template
- New template contentsappend
- True to append new attributes instead of replace the whole templatepublic 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 diskSnapshotCreate(int diskId, java.lang.String name)
diskId
- Id of the diskname
- description for the snapshotpublic OneResponse diskSnapshotRevert(int diskId, int snapId)
diskId
- Id of the disksnapId
- Id of the snapshotpublic OneResponse diskSnapshotDelete(int diskId, int snapId)
diskId
- Id of the disksnapId
- Id of the snapshotpublic OneResponse recover(int operation)
operation
- to recover the VM: (0) failure, (1) success or (2)
retrypublic 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 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 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 liveMigrate(int hostId)
migrate(int, boolean, boolean, int)
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-2015 ©
OpenNebula Project, OpenNebula Systems.
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-2015 ©
OpenNebula Project, OpenNebula Systems.
public abstract class PoolElement
extends java.lang.Object
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-2015 ©
OpenNebula Project, OpenNebula Systems.
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-2015 ©
OpenNebula Project, OpenNebula Systems.
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-2015 ©
OpenNebula Project, OpenNebula Systems.
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-2015 ©
OpenNebula Project, OpenNebula Systems.
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
public class Vdc extends PoolElement
client, id, xml, xpath
Modifier | Constructor and Description |
---|---|
|
Vdc(int id,
Client client)
Creates a new Vdc representation.
|
protected |
Vdc(org.w3c.dom.Node xmlElement,
Client client) |
Modifier and Type | Method and Description |
---|---|
static OneResponse |
addCluster(Client client,
int id,
int zoneId,
int clusterId)
Adds a cluster to this VDC
|
OneResponse |
addCluster(int zoneId,
int clusterId)
Adds a cluster to this VDC
|
static OneResponse |
addDatastore(Client client,
int id,
int zoneId,
int datastoreId)
Adds a datastore to this VDC
|
OneResponse |
addDatastore(int zoneId,
int datastoreId)
Adds a datastore to this VDC
|
static OneResponse |
addGroup(Client client,
int id,
int groupId)
Adds a group to this VDC
|
OneResponse |
addGroup(int groupId)
Adds a group to this VDC
|
static OneResponse |
addHost(Client client,
int id,
int zoneId,
int hostId)
Adds a host to this VDC
|
OneResponse |
addHost(int zoneId,
int hostId)
Adds a host to this VDC
|
static OneResponse |
addVnet(Client client,
int id,
int zoneId,
int vnetId)
Adds a vnet to this VDC
|
OneResponse |
addVnet(int zoneId,
int vnetId)
Adds a vnet to this VDC
|
static OneResponse |
allocate(Client client,
java.lang.String description)
Allocates a new vdc in OpenNebula
|
static OneResponse |
delCluster(Client client,
int id,
int zoneId,
int clusterId)
Deletes a cluster from this VDC
|
OneResponse |
delCluster(int zoneId,
int clusterId)
Deletes a cluster from this VDC
|
static OneResponse |
delDatastore(Client client,
int id,
int zoneId,
int datastoreId)
Deletes a datastore from this VDC
|
OneResponse |
delDatastore(int zoneId,
int datastoreId)
Deletes a datastore from this VDC
|
OneResponse |
delete()
Deletes the vdc from OpenNebula.
|
static OneResponse |
delete(Client client,
int id)
Deletes a vdc from OpenNebula.
|
static OneResponse |
delGroup(Client client,
int id,
int groupId)
Deletes a group from this VDC
|
OneResponse |
delGroup(int groupId)
Deletes a group from this VDC
|
static OneResponse |
delHost(Client client,
int id,
int zoneId,
int hostId)
Deletes a host from this VDC
|
OneResponse |
delHost(int zoneId,
int hostId)
Deletes a host from this VDC
|
static OneResponse |
delVnet(Client client,
int id,
int zoneId,
int vnetId)
Deletes a vnet from this VDC
|
OneResponse |
delVnet(int zoneId,
int vnetId)
Deletes a vnet from this VDC
|
OneResponse |
info()
Loads the xml representation of the vdc.
|
static OneResponse |
info(Client client,
int id)
Retrieves the information of the given vdc.
|
static OneResponse |
rename(Client client,
int id,
java.lang.String name)
Renames this vdc
|
OneResponse |
rename(java.lang.String name)
Renames this Vdc
|
static OneResponse |
update(Client client,
int id,
java.lang.String new_template,
boolean append)
Replaces the template contents.
|
OneResponse |
update(java.lang.String new_template)
Replaces the template contents.
|
OneResponse |
update(java.lang.String new_template,
boolean append)
Replaces the template contents.
|
public Vdc(int id, Client client)
id
- The vdc id.client
- XML-RPC Client.protected Vdc(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 vdc.public static OneResponse info(Client client, int id)
client
- XML-RPC Client.id
- The vdc id.public static OneResponse delete(Client client, int id)
client
- XML-RPC Client.id
- The vdc id.public static OneResponse update(Client client, int id, java.lang.String new_template, boolean append)
client
- XML-RPC Client.id
- The vdc id of the target vdc we want to modify.new_template
- New template contentsappend
- True to append new attributes instead of replace the whole templatepublic static OneResponse rename(Client client, int id, java.lang.String name)
client
- XML-RPC Client.id
- The vdc id of the target vdcname
- New name for the vdc.public static OneResponse addGroup(Client client, int id, int groupId)
client
- XML-RPC Client.id
- The vdc id of the target vdcgroupId
- The group to addpublic static OneResponse delGroup(Client client, int id, int groupId)
client
- XML-RPC Client.id
- The vdc id of the target vdcgroupId
- The group to deletepublic static OneResponse addCluster(Client client, int id, int zoneId, int clusterId)
client
- XML-RPC Client.id
- The vdc id of the target vdczoneId
- The cluster's zoneclusterId
- The cluster to addpublic static OneResponse delCluster(Client client, int id, int zoneId, int clusterId)
client
- XML-RPC Client.id
- The vdc id of the target vdczoneId
- The cluster's zoneclusterId
- The cluster to deletepublic static OneResponse addHost(Client client, int id, int zoneId, int hostId)
client
- XML-RPC Client.id
- The vdc id of the target vdczoneId
- The host's zonehostId
- The host to addpublic static OneResponse delHost(Client client, int id, int zoneId, int hostId)
client
- XML-RPC Client.id
- The vdc id of the target vdczoneId
- The host's zonehostId
- The host to deletepublic static OneResponse addVnet(Client client, int id, int zoneId, int vnetId)
client
- XML-RPC Client.id
- The vdc id of the target vdczoneId
- The vnet's zonevnetId
- The vnet to addpublic static OneResponse delVnet(Client client, int id, int zoneId, int vnetId)
client
- XML-RPC Client.id
- The vdc id of the target vdczoneId
- The vnet's zonevnetId
- The vnet to deletepublic static OneResponse addDatastore(Client client, int id, int zoneId, int datastoreId)
client
- XML-RPC Client.id
- The vdc id of the target vdczoneId
- The datastore's zonedatastoreId
- The datastore to addpublic static OneResponse delDatastore(Client client, int id, int zoneId, int datastoreId)
client
- XML-RPC Client.id
- The vdc id of the target vdczoneId
- The datastore's zonedatastoreId
- The datastore to deletepublic OneResponse info()
info(Client, int)
public OneResponse delete()
delete(Client, int)
public OneResponse update(java.lang.String new_template)
new_template
- New template contentspublic OneResponse update(java.lang.String new_template, boolean append)
new_template
- New template contentsappend
- True to append new attributes instead of replace the whole templatepublic OneResponse rename(java.lang.String name)
name
- New name for the vdc.public OneResponse addGroup(int groupId)
groupId
- The group to addpublic OneResponse delGroup(int groupId)
groupId
- The group to deletepublic OneResponse addCluster(int zoneId, int clusterId)
zoneId
- The cluster's zoneclusterId
- The cluster to addpublic OneResponse delCluster(int zoneId, int clusterId)
zoneId
- The cluster's zoneclusterId
- The cluster to deletepublic OneResponse addHost(int zoneId, int hostId)
zoneId
- The host's zonehostId
- The host to addpublic OneResponse delHost(int zoneId, int hostId)
zoneId
- The host's zonehostId
- The host to deletepublic OneResponse addVnet(int zoneId, int vnetId)
zoneId
- The vnet's zonevnetId
- The vnet to addpublic OneResponse delVnet(int zoneId, int vnetId)
zoneId
- The vnet's zonevnetId
- The vnet to deletepublic OneResponse addDatastore(int zoneId, int datastoreId)
zoneId
- The datastore's zonedatastoreId
- The datastore to addpublic OneResponse delDatastore(int zoneId, int datastoreId)
zoneId
- The datastore's zonedatastoreId
- The datastore to deleteVisit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
ALL, client, elementName, infoMethod, MINE, MINE_GROUP, poolElements
Constructor and Description |
---|
VdcPool(Client client)
Creates a new vdc 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.
|
Vdc |
getById(int id)
Returns the Vdc with the given Id from the pool.
|
OneResponse |
info()
Loads the xml representation of the vdc pool.
|
static OneResponse |
info(Client client)
Retrieves all the vdcs in the pool.
|
java.util.Iterator<Vdc> |
iterator() |
public VdcPool(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<Vdc> iterator()
iterator
in interface java.lang.Iterable<Vdc>
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
ALL, client, elementName, infoMethod, MINE, MINE_GROUP, poolElements
Constructor and Description |
---|
ZonePool(Client client)
Creates a new zone 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.
|
Zone |
getById(int id)
Returns the Zone with the given Id from the pool.
|
OneResponse |
info()
Loads the xml representation of the zone pool.
|
static OneResponse |
info(Client client)
Retrieves all the zones in the pool.
|
java.util.Iterator<Zone> |
iterator() |
public ZonePool(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<Zone> iterator()
iterator
in interface java.lang.Iterable<Zone>
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
public class Zone extends PoolElement
client, id, xml, xpath
Modifier | Constructor and Description |
---|---|
|
Zone(int id,
Client client)
Creates a new Zone representation.
|
protected |
Zone(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 Zone in OpenNebula.
|
OneResponse |
delete()
Deletes the zone from OpenNebula.
|
static OneResponse |
delete(Client client,
int id)
Deletes a zone from OpenNebula.
|
OneResponse |
info()
Loads the xml representation of the zone.
|
static OneResponse |
info(Client client,
int id)
Retrieves the information of the given zone.
|
static OneResponse |
rename(Client client,
int id,
java.lang.String name)
Renames this Zone
|
OneResponse |
rename(java.lang.String name)
Renames this Zone
|
static OneResponse |
update(Client client,
int id,
java.lang.String new_template,
boolean append)
Replaces the template contents.
|
OneResponse |
update(java.lang.String new_template)
Replaces the template contents.
|
OneResponse |
update(java.lang.String new_template,
boolean append)
Replaces the template contents.
|
public Zone(int id, Client client)
id
- The zone id.client
- XML-RPC Client.protected Zone(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 zone.public static OneResponse info(Client client, int id)
client
- XML-RPC Client.id
- The zone id.public static OneResponse delete(Client client, int id)
client
- XML-RPC Client.id
- The zone id.public static OneResponse update(Client client, int id, java.lang.String new_template, boolean append)
client
- XML-RPC Client.id
- The zone id of the target zone we want to modify.new_template
- New template contentsappend
- True to append new attributes instead of replace the whole templatepublic static OneResponse rename(Client client, int id, java.lang.String name)
client
- XML-RPC Client.id
- The Zone id of the target Zone.name
- New name for the Zone.public OneResponse info()
info(Client, int)
public OneResponse delete()
delete(Client, int)
public OneResponse rename(java.lang.String name)
name
- New name for the Zone.public OneResponse update(java.lang.String new_template)
new_template
- New template contentspublic OneResponse update(java.lang.String new_template, boolean append)
new_template
- New template contentsappend
- True to append new attributes instead of replace the whole templateVisit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
public class ClientConfigurationException extends OneException
Constructor and Description |
---|
ClientConfigurationException(java.lang.String message) |
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
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-2015 ©
OpenNebula Project, OpenNebula Systems.
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
Class | Description |
---|---|
Template |
This class represents an OpenNebula template.
|
TemplatePool |
This class represents an OpenNebula Template pool.
|
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
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.
|
OneResponse |
info(boolean extended)
Retrieves the information of the given Template.
|
static OneResponse |
info(Client client,
int id)
Retrieves the information of the given Template.
|
static OneResponse |
info(Client client,
int id,
boolean extended)
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,
boolean append)
Replaces the template contents.
|
OneResponse |
update(java.lang.String new_template)
Replaces the template contents.
|
OneResponse |
update(java.lang.String new_template,
boolean append)
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 info(Client client, int id, boolean extended)
client
- XML-RPC Client.id
- The template id for the template to retrieve the information fromextended
- optional flag to process the template and include
extended information, such as the SIZE for each DISKpublic 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, boolean append)
client
- XML-RPC Client.id
- The template id of the target template we want to modify.new_template
- New template contents.append
- True to append new attributes instead of replace the whole templatepublic 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 info(boolean extended)
extended
- optional flag to process the template and include
extended information, such as the SIZE for each DISKpublic OneResponse delete()
public OneResponse update(java.lang.String new_template)
new_template
- New template contents.public OneResponse update(java.lang.String new_template, boolean append)
new_template
- New template contents.append
- True to append new attributes instead of replace the whole templatepublic 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-2015 ©
OpenNebula Project, OpenNebula Systems.
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,
long user,
long resource,
long rights,
long zone)
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
|
static OneResponse |
allocate(Client client,
java.lang.String user,
java.lang.String resource,
java.lang.String rights,
java.lang.String zone)
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() |
long |
zone() |
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, java.lang.String user, java.lang.String resource, java.lang.String rights, java.lang.String zone)
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. 0x10zone
- 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, long user, long resource, long rights, long zone)
client
- XML-RPC Client.user
- 64b encoded userresource
- 64b encodedrights
- 64b encodedzone
- 64b encodedpublic 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 long zone()
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-2015 ©
OpenNebula Project, OpenNebula Systems.
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
public class RuleParseException extends OneException
Constructor and Description |
---|
RuleParseException(java.lang.String message) |
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
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-2015 ©
OpenNebula Project, OpenNebula Systems.
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-2015 ©
OpenNebula Project, OpenNebula Systems.
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 |
lock(java.lang.String owner)
Locks this object
|
OneResponse |
publish()
Publishes the document.
|
OneResponse |
publish(boolean publish)
Publishes or unpublishes a document.
|
OneResponse |
rename(java.lang.String name)
Renames this document
|
OneResponse |
unlock(java.lang.String owner)
Unlocks this object
|
OneResponse |
unpublish()
Unpublishes the document.
|
OneResponse |
update(java.lang.String new_document)
Replaces the document template contents.
|
OneResponse |
update(java.lang.String new_document,
boolean append)
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 update(java.lang.String new_document, boolean append)
new_document
- New template contents.append
- True to append new attributes instead of replace the whole templatepublic 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 lock(java.lang.String owner)
owner
- String to identify the application requestiong the lockpublic OneResponse unlock(java.lang.String owner)
owner
- String to identify the application requestiong the lockpublic 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-2015 ©
OpenNebula Project, OpenNebula Systems.
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
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-2015 ©
OpenNebula Project, OpenNebula Systems.
Class | Description |
---|---|
Document |
This class represents an OpenNebula document.
|
DocumentPool |
This class represents an OpenNebula Document pool.
|
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
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
|
static OneResponse |
rename(Client client,
int id,
java.lang.String name)
Renames this Host.
|
OneResponse |
rename(java.lang.String name)
Renames this Host.
|
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,
boolean append)
Replaces the template contents.
|
OneResponse |
update(java.lang.String new_template)
Replaces the template contents.
|
OneResponse |
update(java.lang.String new_template,
boolean append)
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, boolean append)
client
- XML-RPC Client.id
- The image id of the target host we want to modify.new_template
- New template contentsappend
- True to append new attributes instead of replace the whole templatepublic static OneResponse monitoring(Client client, int id)
client
- XML-RPC Client.id
- The host id (hid) of the target machine.public static OneResponse rename(Client client, int id, java.lang.String name)
client
- XML-RPC Client.id
- The image id of the target host we want to modify.name
- New name for the Hostpublic 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 update(java.lang.String new_template, boolean append)
new_template
- New template contentsappend
- True to append new attributes instead of replace the whole templatepublic OneResponse monitoring()
public OneResponse rename(java.lang.String name)
name
- New name for the Hostpublic 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-2015 ©
OpenNebula Project, OpenNebula Systems.
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
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-2015 ©
OpenNebula Project, OpenNebula Systems.
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 |
---|---|
boolean |
getBooleanMessage()
Parses the string returned by getMessage
|
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()
public boolean getBooleanMessage()
getMessage()
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
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-2015 ©
OpenNebula Project, OpenNebula Systems.
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
java-oca-4.14.2/doc/help-doc.html 0000664 0001750 0001750 00000020261 12623124371 016271 0 ustar cmartin cmartin
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-2015 ©
OpenNebula Project, OpenNebula Systems.
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
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.secgroup | |
org.opennebula.client.template | |
org.opennebula.client.user | |
org.opennebula.client.vdc | |
org.opennebula.client.vm | |
org.opennebula.client.vnet | |
org.opennebula.client.zone |
Visit OpenNebula.org
Copyright 2002-2015 ©
OpenNebula Project, OpenNebula Systems.
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)OneException
class is a generic OpenNebula exception.VirtualMachine.reboot(boolean)
VirtualMachine.delete(boolean)
Pool.MINE_GROUP
(Security Groups belonging to the connected user,
and the ones in his group)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-2015 ©
OpenNebula Project, OpenNebula Systems.