public class Host extends PoolElement
Modifier and Type | Class | Description |
---|---|---|
static class |
Host.Status |
client, id, xml, xpath
Modifier | Constructor | Description |
---|---|---|
|
Host(int id,
Client client) |
Creates a new Host representation.
|
protected |
Host(org.w3c.dom.Node xmlElement,
Client client) |
Modifier and Type | Method | Description |
---|---|---|
static OneResponse |
allocate(Client client,
java.lang.String hostname,
java.lang.String im,
java.lang.String vmm) |
Allocates a new host in OpenNebula
|
static OneResponse |
allocate(Client client,
java.lang.String hostname,
java.lang.String im,
java.lang.String vmm,
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 |
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
|
OneResponse |
offline() |
Sets the host offline
|
OneResponse |
rename(java.lang.String name) |
Renames this Host.
|
static OneResponse |
rename(Client client,
int id,
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 |
status(Client client,
int id,
Host.Status status) |
Enables or disables a given host.
|
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 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, 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)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)
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)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 status(Client client, int id, Host.Status status)
client
- XML-RPC Client.id
- The host id (hid) of the target machine.status
- Host statuspublic 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()
public OneResponse disable()
public OneResponse offline()
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-2019 ©
OpenNebula Project, OpenNebula Systems.