mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-09-09 09:14:57 +00:00
api: Complete list of function and naming conventions
This commit is contained in:
parent
cc24589e75
commit
492233e773
@ -89,38 +89,74 @@
|
|||||||
set of nodes.</p></li>
|
set of nodes.</p></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h2><a name="Functions">Functions and naming
|
<h2><a name="Functions">Functions and Naming Conventions</a></h2>
|
||||||
conventions</a></h2>
|
|
||||||
<p> The naming of the functions present in the library is usually
|
<p> The naming of the functions present in the library is usually
|
||||||
made of a prefix describing the object associated to the function
|
composed by a prefix describing the object associated to the function
|
||||||
and a verb describing the action on that object.</p>
|
and a verb describing the action on that object.</p>
|
||||||
<p> For each first class object you will find apis
|
<p> For each first class object you will find APIs
|
||||||
for the following actions:</p>
|
for the following actions:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><b>Lookup</b>:...LookupByName,</li>
|
<li><b>Lookup</b> [...LookupBy...]
|
||||||
<li><b>Enumeration</b>:virConnectList... and virConnectNumOf...:
|
<p>Used to perform lookups on objects by some type of identifier,
|
||||||
those are used to enumerate a set of object available to an given
|
such as:</p>
|
||||||
hypervisor connection like:
|
<ul>
|
||||||
<code class='docref'>virConnectListDomains</code>,
|
<li><code class='docref'>virDomainLookupByID</code></li>
|
||||||
<code class='docref'>virConnectNumOfDomains</code>,
|
<li><code class='docref'>virDomainLookupByName</code></li>
|
||||||
<code class='docref'>virConnectListNetworks</code>,
|
<li><code class='docref'>virDomainLookupByUUID</code></li>
|
||||||
<code class='docref'>virConnectListStoragePools</code>, etc.</li>
|
<li><code class='docref'>virDomainLookupByUUIDString</code></li>
|
||||||
<li><b>Description</b>: ...GetInfo: those are generic accessor providing
|
</ul>
|
||||||
a set of informations about an object, they are
|
</li>
|
||||||
<code class='docref'>virNodeGetInfo</code>,
|
<li><b>Enumeration</b> [virConnectList..., virConnectNumOf...]
|
||||||
<code class='docref'>virDomainGetInfo</code>,
|
<p>Used to enumerate a set of object available to an given
|
||||||
<code class='docref'>virStoragePoolGetInfo</code>,
|
hypervisor connection such as:</p>
|
||||||
<code class='docref'>virStorageVolGetInfo</code>.</li>
|
<ul>
|
||||||
<li><b>Accessors</b>: ...Get... and ...Set...: those are more specific
|
<li><code class='docref'>virConnectListDomains</code></li>
|
||||||
accessors to query or modify the given object, like
|
<li><code class='docref'>virConnectNumOfDomains</code></li>
|
||||||
<code class='docref'>virConnectGetType</code>,
|
<li><code class='docref'>virConnectListNetworks</code></li>
|
||||||
<code class='docref'>virDomainGetMaxMemory</code>,
|
<li><code class='docref'>virConnectListStoragePools</code></li>
|
||||||
<code class='docref'>virDomainSetMemory</code>,
|
</ul>
|
||||||
<code class='docref'>virDomainGetVcpus</code>,
|
</li>
|
||||||
<code class='docref'>virStoragePoolSetAutostart</code>,
|
<li><b>Description</b> [...GetInfo]
|
||||||
<code class='docref'>virNetworkGetBridgeName</code>, etc.</li>
|
<p>Generic accessor providing a set of generic information about an
|
||||||
<li><b>Creation</b>: </li>
|
object, such as: </p>
|
||||||
<li><b>Destruction</b>: ... </li>
|
<ul>
|
||||||
|
<li><code class='docref'>virNodeGetInfo</code></li>
|
||||||
|
<li><code class='docref'>virDomainGetInfo</code></li>
|
||||||
|
<li><code class='docref'>virStoragePoolGetInfo</code></li>
|
||||||
|
<li><code class='docref'>virStorageVolGetInfo</code></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li><b>Accessors</b> [...Get..., ...Set...]
|
||||||
|
<p>Specific accessors used to query or modify data for the given object,
|
||||||
|
such as: </p>
|
||||||
|
<ul>
|
||||||
|
<li><code class='docref'>virConnectGetType</code></li>
|
||||||
|
<li><code class='docref'>virDomainGetMaxMemory</code></li>
|
||||||
|
<li><code class='docref'>virDomainSetMemory</code></li>
|
||||||
|
<li><code class='docref'>virDomainGetVcpus</code></li>
|
||||||
|
<li><code class='docref'>virStoragePoolSetAutostart</code></li>
|
||||||
|
<li><code class='docref'>virNetworkGetBridgeName</code></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li><b>Creation</b> [...Create, ...CreateXML]
|
||||||
|
<p>Used to create and start objects. The ...CreateXML APIs will create
|
||||||
|
the object based on an XML description, while the ...Create APIs will
|
||||||
|
create the object based on existing object pointer, such as: </p>
|
||||||
|
<ul>
|
||||||
|
<li><code class='docref'>virDomainCreate</code></li>
|
||||||
|
<li><code class='docref'>virDomainCreateXML</code></li>
|
||||||
|
<li><code class='docref'>virNetworkCreate</code></li>
|
||||||
|
<li><code class='docref'>virNetworkCreateXML</code></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li><b>Destruction</b> [...Destroy]
|
||||||
|
<p>Used to shutdown or deactivate and destroy objects, such as: </p>
|
||||||
|
<ul>
|
||||||
|
<li><code class='docref'>virDomainDestroy</code></li>
|
||||||
|
<li><code class='docref'>virNetworkDestroy</code></li>
|
||||||
|
<li><code class='docref'>virStoragePoolDestroy</code></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p> For more in-depth details of the storage related APIs see
|
<p> For more in-depth details of the storage related APIs see
|
||||||
<a href="storage.html">the storage management page</a>.
|
<a href="storage.html">the storage management page</a>.
|
||||||
|
Loading…
Reference in New Issue
Block a user