|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.libvirt.VirConnect
public class VirConnect
The VirConnect object represents a connection to a local or remote hypervisor/driver.
Constructor Summary | |
---|---|
VirConnect(java.lang.String uri)
Constructs a read-write VirConnect object from the supplied URI. |
|
VirConnect(java.lang.String uri,
boolean readOnly)
Constructs a VirConnect object from the supplied URI. |
|
VirConnect(java.lang.String uri,
VirConnectAuth auth,
int flags)
Constructs a VirConnect object from the supplied URI, using the supplied authentication callback |
Method Summary | |
---|---|
void |
close()
Closes the connection to the hypervisor/driver. |
void |
finalize()
|
java.lang.String |
getCapabilities()
Provides capabilities of the hypervisor / driver. |
java.lang.String |
getHostName()
Returns the system hostname on which the hypervisor is running. |
int |
getMaxVcpus(java.lang.String type)
Provides the maximum number of virtual CPUs supported for a guest VM of a specific type. |
java.lang.String |
getType()
Gets the name of the Hypervisor software used. |
java.lang.String |
getURI()
Returns the URI (name) of the hypervisor connection. |
long |
getVersion()
Gets the version level of the Hypervisor running. |
java.lang.String[] |
listDefinedDomains()
Lists the names of the defined domains |
java.lang.String[] |
listDefinedNetworks()
Lists the inactive networks |
int[] |
listDomains()
Lists the active domains. |
java.lang.String[] |
listNetworks()
Lists the active networks. |
int |
numOfDefinedDomains()
Provides the number of inactive domains. |
int |
numOfDefinedNetworks()
Provides the number of inactive networks. |
int |
numOfDomains()
Provides the number of active domains. |
int |
numOfNetworks()
Provides the number of active networks. |
void |
restore(java.lang.String from)
Restores a domain saved to disk by VirDomain.save(). |
void |
setDom0Memory(long memory)
change the amount of memory reserved to Domain0. |
VirDomain |
virDomainCreateLinux(java.lang.String xmlDesc,
int flags)
Launches a new Linux guest domain. |
VirDomain |
virDomainDefineXML(java.lang.String xmlDesc)
Defines a domain, but does not start it |
VirDomain |
virDomainLookupByID(int id)
Finds a domain based on the hypervisor ID number. |
VirDomain |
virDomainLookupByName(java.lang.String name)
Looks up a domain based on its name. |
VirDomain |
virDomainLookupByUUID(int[] UUID)
Looks up a domain based on its UUID in array form. |
VirDomain |
virDomainLookupByUUIDString(java.lang.String UUID)
Looks up a domain based on its UUID in String form. |
long |
virGetHypervisorVersion(java.lang.String type)
Returns the version of the hypervisor against which the library was compiled. |
long |
virGetLibVirVersion()
Gets the version of the native libvirt library that the JNI part is linked to. |
VirNetwork |
virNetworkCreateXML(java.lang.String xmlDesc)
Creates and starts a new virtual network. |
VirNetwork |
virNetworkDefineXML(java.lang.String xmlDesc)
Defines a network, but does not create it. |
VirNetwork |
virNetworkLookupByName(java.lang.String name)
Looks up a network on the based on its name. |
VirNetwork |
virNetworkLookupByUUID(int[] UUID)
Looks up a network based on its UUID represented as an int array. |
VirNetwork |
virNetworkLookupByUUIDString(java.lang.String UUID)
Looks up a network based on its UUID represented as a String. |
VirNodeInfo |
virNodeInfo()
Returns a VirNodeInfo object describing the hardware configuration of the node. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public VirConnect(java.lang.String uri, boolean readOnly) throws LibvirtException
uri
- The connection URIreadOnly
- Whether the connection is read-only
LibvirtException
public VirConnect(java.lang.String uri, VirConnectAuth auth, int flags) throws LibvirtException
uri
- The connection URIauth
- a VirConnectAuth objectflags
-
LibvirtException
public VirConnect(java.lang.String uri) throws LibvirtException
uri
- The connection URI
LibvirtException
Method Detail |
---|
public void finalize() throws LibvirtException
finalize
in class java.lang.Object
LibvirtException
public void close() throws LibvirtException
LibvirtException
public java.lang.String getCapabilities() throws LibvirtException
LibvirtException
public java.lang.String getHostName() throws LibvirtException
LibvirtException
public int getMaxVcpus(java.lang.String type) throws LibvirtException
type
-
LibvirtException
public java.lang.String getType() throws LibvirtException
LibvirtException
public java.lang.String getURI() throws LibvirtException
LibvirtException
public long getVersion() throws LibvirtException
LibvirtException
public long virGetLibVirVersion() throws LibvirtException
LibvirtException
public long virGetHypervisorVersion(java.lang.String type) throws LibvirtException
type
-
LibvirtException
public java.lang.String[] listDefinedDomains() throws LibvirtException
LibvirtException
public java.lang.String[] listDefinedNetworks() throws LibvirtException
LibvirtException
public int[] listDomains() throws LibvirtException
LibvirtException
public java.lang.String[] listNetworks() throws LibvirtException
LibvirtException
public int numOfDefinedDomains() throws LibvirtException
LibvirtException
public int numOfDefinedNetworks() throws LibvirtException
LibvirtException
public int numOfDomains() throws LibvirtException
LibvirtException
public int numOfNetworks() throws LibvirtException
LibvirtException
public VirNetwork virNetworkLookupByName(java.lang.String name) throws LibvirtException
name
- name of the network
LibvirtException
public VirNetwork virNetworkLookupByUUID(int[] UUID) throws LibvirtException
UUID
- the UUID as an unpacked int array
LibvirtException
public VirNetwork virNetworkLookupByUUIDString(java.lang.String UUID) throws LibvirtException
UUID
- the UUID in canonical String representation
LibvirtException
public VirNetwork virNetworkCreateXML(java.lang.String xmlDesc) throws LibvirtException
xmlDesc
- the Network Description
LibvirtException
public VirNetwork virNetworkDefineXML(java.lang.String xmlDesc) throws LibvirtException
xmlDesc
-
LibvirtException
public VirDomain virDomainLookupByID(int id) throws LibvirtException
id
- the hypervisor id
LibvirtException
public VirDomain virDomainLookupByName(java.lang.String name) throws LibvirtException
name
- the name of the domain
LibvirtException
public VirDomain virDomainLookupByUUID(int[] UUID) throws LibvirtException
UUID
- the UUID as an unpacked int array
LibvirtException
public VirDomain virDomainLookupByUUIDString(java.lang.String UUID) throws LibvirtException
UUID
- the UUID in canonical String representation
LibvirtException
public VirDomain virDomainCreateLinux(java.lang.String xmlDesc, int flags) throws LibvirtException
xmlDesc
- the Domain description in XMLflags
- an optional set of flags (unused)
LibvirtException
public VirDomain virDomainDefineXML(java.lang.String xmlDesc) throws LibvirtException
xmlDesc
-
LibvirtException
public void restore(java.lang.String from) throws LibvirtException
from
- the path of the saved file on the remote host
LibvirtException
public VirNodeInfo virNodeInfo() throws LibvirtException
LibvirtException
public void setDom0Memory(long memory) throws LibvirtException
memory
- in kilobytes
LibvirtException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |