Metadata-Version: 2.5
Name: trytond_strings_xo
Version: 8.0.0.6
Summary: Xen Orchestra Integration
Author: Clemens Hupka
Maintainer-email: Clemens Hupka <clemens.hupka@backend.at>
License-Expression: GPL-3.0-or-later
License-File: COPYRIGHT
License-File: LICENSE
Keywords: orchestra,tryton,virtualization,xcp-ng,xen
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Environment :: Plugins
Classifier: Framework :: Tryton
Classifier: Topic :: Office/Business
Classifier: Topic :: System :: Systems Administration
Requires-Python: >=3.10
Requires-Dist: cryptography
Requires-Dist: trytond-company<8.1,>=8.0
Requires-Dist: trytond<8.1,>=8.0
Provides-Extra: test
Description-Content-Type: text/x-rst

Xen Orchestra
=============

The ``strings_xo`` module provides the foundation for integrating
Xen Orchestra (XO) and XCP-ng with Tryton.  It defines the server
configuration and an encrypted credential store, together with a REST
client for the Xen Orchestra REST API v0.

Features
--------

- **Server configuration**: describe a Xen Orchestra instance with its
  URL, authentication method, company, default pool and connection
  settings.
- **Encrypted credentials**: API tokens and passwords are encrypted at
  rest with Fernet symmetric encryption and masked in every read
  result.  Credentials can be stored on the server or reused through
  the ``xo.credential`` model.
- **REST client**: a complete client for the Xen Orchestra REST API v0
  covering collections, object actions (``?sync=true``), ``PATCH``,
  ``DELETE``, binary import/export and NDJSON streaming, with bounded
  retry and exponential backoff.
- **Sync framework**: a generic, idempotent pull-sync framework reused
  by every suite module.  A mirror model declares the Xen Orchestra
  collection and a field map, and the framework performs the upsert
  keyed on ``(server, uuid)``, the orphan handling and the structured
  logging of every run.
- **Manual and scheduled sync**: a *Manual Sync* wizard and a scheduled
  ``ir.cron`` with an interval controlled by the ``[strings_xo]``
  configuration section.
- **Security**: dedicated access groups, model access and field level
  access rights protecting the token and password fields.  The suite
  roles — the operators, the administrators and the self-service portal
  users — are defined by this module and reused by every suite module.

Configuration
-------------

After installing the module, open *Xen Orchestra > Servers* to add a
Xen Orchestra instance, and *Xen Orchestra > Credentials* to manage
reusable credentials.  The module configuration is available under
*Xen Orchestra > Configuration*.

Security groups
---------------

Three roles are defined by the module and granted access by the suite
modules that own the models they cover:

- *Xen Orchestra* (``group_strings_xo``) — the operators: read-only
  access on the servers, the credentials and the whole inventory.
- *Xen Orchestra Administration* (``group_strings_xo_admin``) — the
  administrators: full access, including the operations that power a
  machine on or off.  The token and the password of a server stay
  protected by the field level access rights, which deny them to every
  group but the administrators.
- *Xen Orchestra Web User* (``group_strings_xo_web``) — the users of the
  self-service portal: read-only access on the inventory the portal
  reads (granted by ``strings_xo_compute``) and on the servers and the
  provisioning requests of the portal (granted by ``strings_xo_web``).
  The group is defined here because the two modules both grant it access
  and neither of them may depend on the other (Heptapod issue #822).

Dependencies
------------

- Tryton modules: ``ir``, ``res``, ``company``.

Models
------

- ``xo.server`` — ``XOServer``: a Xen Orchestra instance and its
  authentication settings.
- ``xo.credential`` — ``XOCredential``: an encrypted, reusable
  credential (API token or user name / password).
- ``xo.configuration`` — ``XOConfiguration``: singleton holding the
  Fernet key used to encrypt credential secrets.

Cron Jobs
---------

- *Xen Orchestra: Synchronise* (``xo.server|sync_cron``) — synchronises
  every active server every five minutes, honouring the
  ``[strings_xo] sync_interval_minutes`` setting.

Wizards
-------

- *Manual Sync* — synchronise a selected Xen Orchestra server and show
  the summary counters and errors of the run.
