various improvements

This commit is contained in:
ge
2023-11-23 02:34:02 +03:00
parent b9d089dd78
commit 05f90b14f2
200 changed files with 15968 additions and 84 deletions

View File

@ -0,0 +1,5 @@
``exceptions``
==============
.. automodule:: compute.exceptions
:members:

View File

@ -0,0 +1,49 @@
Python API
==========
The API allows you to perform actions on instances programmatically. Below is
an example of changing parameters and launching the `myinstance` instance.
.. code-block:: python
import logging
from compute import Session
logging.basicConfig(level=logging.DEBUG)
with Session() as session:
instance = session.get_instance('myinstance')
instance.set_vcpus(4)
instance.start()
instance.set_autostart(enabled=True)
: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
---------------------
.. toctree::
:maxdepth: 4
session
instance/index
storage/index
utils
exceptions

View File

@ -0,0 +1,6 @@
``guest_agent``
===============
.. automodule:: compute.instance.guest_agent
:members:
:special-members: __init__

View File

@ -0,0 +1,10 @@
``instance``
============
.. toctree::
:maxdepth: 1
:caption: Contents:
instance
guest_agent
schemas

View File

@ -0,0 +1,6 @@
``instance``
============
.. automodule:: compute.instance.instance
:members:
:special-members: __init__

View File

@ -0,0 +1,5 @@
``schemas``
===========
.. automodule:: compute.instance.schemas
:members:

View File

@ -0,0 +1,6 @@
``session``
===========
.. automodule:: compute.session
:members:
:special-members: __init__

View File

@ -0,0 +1,9 @@
``storage``
============
.. toctree::
:maxdepth: 1
:caption: Contents:
pool
volume

View File

@ -0,0 +1,6 @@
``pool``
========
.. automodule:: compute.storage.pool
:members:
:special-members: __init__

View File

@ -0,0 +1,6 @@
``volume``
==========
.. automodule:: compute.storage.volume
:members:
:special-members: __init__

View File

@ -0,0 +1,14 @@
``utils``
=========
``utils.units``
---------------
.. automodule:: compute.utils.units
:members:
``utils.ids``
-------------
.. automodule:: compute.utils.ids
:members: