various improvements
This commit is contained in:
@ -1,38 +1,8 @@
|
||||
Python API
|
||||
==========
|
||||
|
||||
The API allows you to perform actions on instances programmatically.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
import compute
|
||||
|
||||
with compute.Session() as session:
|
||||
instance = session.get_instance('myinstance')
|
||||
info = instance.get_info()
|
||||
|
||||
print(info)
|
||||
|
||||
|
||||
:class:`Session` context manager provides an abstraction over :class:`libvirt.virConnect`
|
||||
and returns objects of other classes of the present library.
|
||||
|
||||
Entity representation
|
||||
---------------------
|
||||
|
||||
Entities such as a compute-instance are represented as classes. These classes directly
|
||||
call libvirt methods to perform operations on the hypervisor. An example class is
|
||||
:class:`Volume`.
|
||||
|
||||
The configuration files of various libvirt objects in `compute` are described by special
|
||||
dataclasses. The dataclass stores object parameters in its properties and can return an
|
||||
XML config for libvirt using the ``to_xml()`` method. For example :class:`VolumeConfig`.
|
||||
|
||||
`Pydantic <https://docs.pydantic.dev/>`_ models are used to validate input data.
|
||||
For example :class:`VolumeSchema`.
|
||||
|
||||
Modules documentation
|
||||
---------------------
|
||||
API Reference
|
||||
-------------
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 4
|
||||
|
5
docs/source/pyapi/instance/devices.rst
Normal file
5
docs/source/pyapi/instance/devices.rst
Normal file
@ -0,0 +1,5 @@
|
||||
``devices``
|
||||
===========
|
||||
|
||||
.. automodule:: compute.instance.devices
|
||||
:members:
|
@ -7,4 +7,5 @@
|
||||
|
||||
instance
|
||||
guest_agent
|
||||
devices
|
||||
schemas
|
||||
|
@ -12,3 +12,10 @@
|
||||
|
||||
.. automodule:: compute.utils.ids
|
||||
:members:
|
||||
|
||||
|
||||
``utils.dictutil``
|
||||
------------------
|
||||
|
||||
.. automodule:: compute.utils.dictutil
|
||||
:members:
|
||||
|
Reference in New Issue
Block a user