|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.libvirt.Connect
public class Connect
The Connect object represents a connection to a local or remote hypervisor/driver.
Field Summary | |
---|---|
protected ConnectionPointer |
VCP
the native virConnectPtr. |
Constructor Summary | |
---|---|
Connect(java.lang.String uri)
Constructs a read-write Connect object from the supplied URI. |
|
Connect(java.lang.String uri,
boolean readOnly)
Constructs a Connect object from the supplied URI. |
|
Connect(java.lang.String uri,
ConnectAuth auth,
int flags)
Constructs a Connect object from the supplied URI, using the supplied authentication callback |
Method Summary | |
---|---|
int |
close()
Closes the connection to the hypervisor/driver. |
static int[] |
convertUUIDBytes(byte[] bytes)
Helper function to convert bytes into ints for the UUID calls |
static byte[] |
createUUIDBytes(int[] UUID)
Helper function to convert UUIDs into a stirng for the UUID calls |
Domain |
domainCreateLinux(java.lang.String xmlDesc,
int flags)
Launches a new Linux guest domain. |
Domain |
domainCreateXML(java.lang.String xmlDesc,
int flags)
Launch a new guest domain, based on an XML description |
Domain |
domainDefineXML(java.lang.String xmlDesc)
Defines a domain, but does not start it |
Domain |
domainLookupByID(int id)
Finds a domain based on the hypervisor ID number. |
Domain |
domainLookupByName(java.lang.String name)
Looks up a domain based on its name. |
Domain |
domainLookupByUUID(int[] UUID)
Looks up a domain based on its UUID in array form. |
Domain |
domainLookupByUUID(java.util.UUID uuid)
Fetch a domain based on its globally unique id |
Domain |
domainLookupByUUIDString(java.lang.String UUID)
Looks up a domain based on its UUID in String form. |
void |
finalize()
|
java.lang.String |
findStoragePoolSources(java.lang.String type,
java.lang.String srcSpecs,
int flags)
Talks to a storage backend and attempts to auto-discover the set of available storage pool sources. |
java.lang.String |
getCapabilities()
Provides capabilities of the hypervisor / driver. |
java.lang.String |
getHostName()
Returns the system hostname on which the hypervisor is running. |
long |
getHypervisorVersion(java.lang.String type)
Returns the version of the hypervisor against which the library was compiled. |
long |
getLibVirVersion()
Gets the version of the native libvirt library that the JNI part is linked to. |
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 but inactive domains |
java.lang.String[] |
listDefinedNetworks()
Lists the inactive networks |
java.lang.String[] |
listDefinedStoragePools()
Provides the list of names of inactive storage pools. |
int[] |
listDomains()
Lists the active domains. |
java.lang.String[] |
listNetworks()
Lists the active networks. |
java.lang.String[] |
listStoragePools()
Provides the list of names of active storage pools. |
Network |
networkCreateXML(java.lang.String xmlDesc)
Creates and starts a new virtual network. |
Network |
networkDefineXML(java.lang.String xmlDesc)
Defines a network, but does not create it. |
Network |
networkLookupByName(java.lang.String name)
Looks up a network on the based on its name. |
Network |
networkLookupByUUID(int[] UUID)
Deprecated. use the UUIDString or UUID API. |
Network |
networkLookupByUUID(java.util.UUID uuid)
Fetch a network based on its globally unique id |
Network |
networkLookupByUUIDString(java.lang.String UUID)
Looks up a network based on its UUID represented as a String. |
NodeInfo |
nodeInfo()
Returns a NodeInfo object describing the hardware configuration of the node. |
int |
numOfDefinedDomains()
Provides the number of inactive domains. |
int |
numOfDefinedNetworks()
Provides the number of inactive networks. |
int |
numOfDefinedStoragePools()
Provides the number of inactive storage pools |
int |
numOfDomains()
Provides the number of active domains. |
int |
numOfNetworks()
Provides the number of active networks. |
int |
numOfStoragePools()
Provides the number of active storage pools |
protected void |
processError()
call the error handling logic. |
void |
restore(java.lang.String from)
Restores a domain saved to disk by Domain.save(). |
void |
setDom0Memory(long memory)
change the amount of memory reserved to Domain0. |
StoragePool |
storagePoolCreateXML(java.lang.String xmlDesc,
int flags)
Create a new storage based on its XML description. |
StoragePool |
storagePoolDefineXML(java.lang.String xml,
int flags)
Define a new inactive storage pool based on its XML description. |
StoragePool |
storagePoolLookupByName(java.lang.String name)
Fetch a storage pool based on its unique name |
StoragePool |
storagePoolLookupByUUID(int[] UUID)
Deprecated. Use the UUIDString or UUID APIs. |
StoragePool |
storagePoolLookupByUUID(java.util.UUID uuid)
Fetch a storage pool based on its globally unique id |
StoragePool |
storagePoolLookupByUUIDString(java.lang.String UUID)
Fetch a storage pool based on its globally unique id |
StorageVol |
storageVolLookupByKey(java.lang.String key)
Fetch a a storage volume based on its globally unique key |
StorageVol |
storageVolLookupByPath(java.lang.String path)
Fetch a storage volume based on its locally (host) unique path |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ConnectionPointer VCP
Constructor Detail |
---|
public Connect(java.lang.String uri) throws LibvirtException
uri
- The connection URI
LibvirtException
public Connect(java.lang.String uri, boolean readOnly) throws LibvirtException
uri
- The connection URIreadOnly
- Whether the connection is read-only
LibvirtException
public Connect(java.lang.String uri, ConnectAuth auth, int flags) throws LibvirtException
uri
- The connection URIauth
- a ConnectAuth objectflags
-
LibvirtException
Method Detail |
---|
public static int[] convertUUIDBytes(byte[] bytes)
public static byte[] createUUIDBytes(int[] UUID)
public int close() throws LibvirtException
LibvirtException
public Domain domainCreateLinux(java.lang.String xmlDesc, int flags) throws LibvirtException
xmlDesc
- the Domain description in XMLflags
- an optional set of flags (unused)
LibvirtException
public Domain domainCreateXML(java.lang.String xmlDesc, int flags) throws LibvirtException
xmlDesc
-
LibvirtException
public Domain domainDefineXML(java.lang.String xmlDesc) throws LibvirtException
xmlDesc
-
LibvirtException
public Domain domainLookupByID(int id) throws LibvirtException
id
- the hypervisor id
LibvirtException
public Domain domainLookupByName(java.lang.String name) throws LibvirtException
name
- the name of the domain
LibvirtException
public Domain domainLookupByUUID(int[] UUID) throws LibvirtException
UUID
- the UUID as an unpacked int array
LibvirtException
public Domain domainLookupByUUID(java.util.UUID uuid) throws LibvirtException
UUID
- a java UUID
LibvirtException
public Domain domainLookupByUUIDString(java.lang.String UUID) throws LibvirtException
UUID
- the UUID in canonical String representation
LibvirtException
public void finalize() throws LibvirtException
finalize
in class java.lang.Object
LibvirtException
public java.lang.String findStoragePoolSources(java.lang.String type, java.lang.String srcSpecs, int flags) throws LibvirtException
type
- type of storage pool to discoversrcSpecs
- XML document specifying discovery sourcflags
- unused
LibvirtException
public java.lang.String getCapabilities() throws LibvirtException
LibvirtException
public java.lang.String getHostName() throws LibvirtException
LibvirtException
public long getHypervisorVersion(java.lang.String type) throws LibvirtException
type
-
LibvirtException
public long getLibVirVersion() 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 java.lang.String[] listDefinedDomains() throws LibvirtException
LibvirtException
public java.lang.String[] listDefinedNetworks() throws LibvirtException
LibvirtException
public java.lang.String[] listDefinedStoragePools() throws LibvirtException
LibvirtException
public int[] listDomains() throws LibvirtException
LibvirtException
public java.lang.String[] listNetworks() throws LibvirtException
LibvirtException
public java.lang.String[] listStoragePools() throws LibvirtException
LibvirtException
public Network networkCreateXML(java.lang.String xmlDesc) throws LibvirtException
xmlDesc
- the Network Description
LibvirtException
public Network networkDefineXML(java.lang.String xmlDesc) throws LibvirtException
xmlDesc
-
LibvirtException
public Network networkLookupByName(java.lang.String name) throws LibvirtException
name
- name of the network
LibvirtException
public Network networkLookupByUUID(int[] UUID) throws LibvirtException
UUID
- the UUID as an unpacked int array
LibvirtException
public Network networkLookupByUUID(java.util.UUID uuid) throws LibvirtException
UUID
- a java UUID
LibvirtException
public Network networkLookupByUUIDString(java.lang.String UUID) throws LibvirtException
UUID
- the UUID in canonical String representation
LibvirtException
public NodeInfo nodeInfo() throws LibvirtException
LibvirtException
public int numOfDefinedDomains() throws LibvirtException
LibvirtException
public int numOfDefinedNetworks() throws LibvirtException
LibvirtException
public int numOfDefinedStoragePools() throws LibvirtException
LibvirtException
public int numOfDomains() throws LibvirtException
LibvirtException
public int numOfNetworks() throws LibvirtException
LibvirtException
public int numOfStoragePools() throws LibvirtException
LibvirtException
protected void processError() throws LibvirtException
LibvirtException
public void restore(java.lang.String from) throws LibvirtException
from
- the path of the saved file on the remote host
LibvirtException
public void setDom0Memory(long memory) throws LibvirtException
memory
- in kilobytes
LibvirtException
public StoragePool storagePoolCreateXML(java.lang.String xmlDesc, int flags) throws LibvirtException
xmlDesc
- XML description for new poolflags
- future flags, use 0 for now
LibvirtException
public StoragePool storagePoolDefineXML(java.lang.String xml, int flags) throws LibvirtException
xml
- XML description for new poolflags
- flags future flags, use 0 for now
LibvirtException
public StoragePool storagePoolLookupByName(java.lang.String name) throws LibvirtException
name
- name of pool to fetch
LibvirtException
public StoragePool storagePoolLookupByUUID(int[] UUID) throws LibvirtException
UUID
- globally unique id of pool to fetch
LibvirtException
public StoragePool storagePoolLookupByUUID(java.util.UUID uuid) throws LibvirtException
UUID
- a java UUID
LibvirtException
public StoragePool storagePoolLookupByUUIDString(java.lang.String UUID) throws LibvirtException
UUID
- globally unique id of pool to fetch
LibvirtException
public StorageVol storageVolLookupByKey(java.lang.String key) throws LibvirtException
key
- globally unique key
LibvirtException
public StorageVol storageVolLookupByPath(java.lang.String path) throws LibvirtException
path
- locally unique path
LibvirtException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |