public class Image extends PoolElement
client, id, xml, xpath
Modifier | Constructor | Description |
---|---|---|
|
Image(int id,
Client client) |
Creates a new Image representation.
|
protected |
Image(org.w3c.dom.Node xmlElement,
Client client) |
Modifier and Type | Method | Description |
---|---|---|
static OneResponse |
allocate(Client client,
java.lang.String description,
int datastoreId) |
Allocates a new Image in OpenNebula.
|
static OneResponse |
allocate(Client client,
java.lang.String description,
int datastoreId,
boolean no_check_capacity) |
Allocates a new Image 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 Image permissions
|
OneResponse |
chmod(java.lang.String octet) |
Changes the permissions
|
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 |
chown(int uid) |
Changes the owner
|
OneResponse |
chown(int uid,
int gid) |
Changes the owner/group
|
static OneResponse |
chown(Client client,
int id,
int uid,
int gid) |
Changes the owner/group
|
OneResponse |
chtype(java.lang.String type) |
Changes the Image type
|
static OneResponse |
chtype(Client client,
int id,
java.lang.String type) |
Changes the Image type
|
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
|
static OneResponse |
clone(Client client,
int id,
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 |
lock(int level) |
Lock this Image
|
static OneResponse |
lock(Client client,
int id,
int level) |
lock this Image
|
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.
|
OneResponse |
rename(java.lang.String name) |
Renames this Image
|
static OneResponse |
rename(Client client,
int id,
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.
|
OneResponse |
snapshotDelete(int snapId) |
Deletes Image from snapshot
|
static OneResponse |
snapshotDelete(Client client,
int id,
int snapId) |
Deletes Image from snapshot
|
OneResponse |
snapshotFlatten(int snapId) |
Flattens an image snapshot
|
static OneResponse |
snapshotFlatten(Client client,
int id,
int snapId) |
Flattens an image snapshot
|
OneResponse |
snapshotRevert(int snapId) |
Reverts Image state to a previous snapshot
|
static OneResponse |
snapshotRevert(Client client,
int id,
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 |
unlock() |
Unlock this Image
|
static OneResponse |
unlock(Client client,
int id) |
Unlock this Image
|
OneResponse |
unpublish() |
Unpublishes the image.
|
OneResponse |
update(java.lang.String new_template) |
Replaces the template contents.
|
OneResponse |
update(java.lang.String new_template,
boolean append) |
Replaces the template contents.
|
static OneResponse |
update(Client client,
int id,
java.lang.String new_template,
boolean append) |
Replaces the template contents.
|
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 Datastore IDpublic static OneResponse allocate(Client client, java.lang.String description, int datastoreId, boolean no_check_capacity)
client
- XML-RPC Client.description
- A string containing the template of the image.datastoreId
- The Datastore IDno_check_capacity
- to check datastore capacitypublic 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 static OneResponse lock(Client client, int id, int level)
client
- XML-RPC Client.id
- The Image id.level
- Lock level.public static OneResponse unlock(Client client, int id)
client
- XML-RPC Client.id
- The Image id.public 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 OneResponse lock(int level)
level
- Lock level.public OneResponse unlock()
public java.lang.String stateString()
info()
must be called before.public java.lang.String shortStateStr()
info()
must be called before.public int type()
public java.lang.String typeStr()
public java.lang.String shortTypeStr()
public boolean isEnabled()
Visit OpenNebula.org
Copyright 2002-2019 ©
OpenNebula Project, OpenNebula Systems.