Metadata-Version: 2.5
Name: trytond_cmdb_service
Version: 8.0.0.2
Summary: Tryton module cmdb_service
Author: Clemens Hupka
Maintainer-email: Clemens Hupka <issues@tryton-erp.eu>
License-Expression: GPL-3.0-or-later
License-File: COPYRIGHT
License-File: LICENSE
License-File: icons/LICENSE
Keywords: cmdb_service,tryton
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Plugins
Classifier: Framework :: Tryton
Classifier: Topic :: Office/Business
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: trytond-cmdb<8.1,>=8.0
Requires-Dist: trytond-company<8.1,>=8.0
Requires-Dist: trytond-party<8.1,>=8.0
Requires-Dist: trytond-product<8.1,>=8.0
Requires-Dist: trytond-stock-lot<8.1,>=8.0
Requires-Dist: trytond<8.1,>=8.0
Provides-Extra: test
Requires-Dist: trytond-itil4-service-catalogue<8.1,>=8.0; extra == 'test'
Description-Content-Type: text/x-rst

cmdb_service
############

The cmdb_service module adds a business service catalogue to the CMDB
module suite and maps it onto the configuration items (CIs).

The suite could answer "which configuration items do we have" but not
"which configuration items deliver service X" and therefore not "if this
server dies, which services are down" - the core reason to run a CMDB.
This module adds that layer on top of the CI relationship graph of the
``cmdb`` module.

.. class:: cmdb.service.category

   The service category master data (e.g. "Infrastructure", "Business
   Application").  A category groups the service groups.

.. class:: cmdb.service.group

   The service group master data (e.g. "Network", "ERP").  A group may
   belong to a category, and it groups the services.

.. class:: cmdb.service

   The business service itself.  It carries the name and the unique
   code, the description, the category and the group, the business
   criticality, the business and technical owner, the availability
   target, the support hours and the status.  It also inherits the state
   fields of the CMDB (deployment state, incident state, purpose,
   category) from ``cmdb.CMDBStatesMixin``.

   ``business_impact`` is derived from the open incidents of the
   configuration items of the service: an open incident of a *major*
   severity degrades the service, one of a *critical* or *blocker*
   severity takes it down.  The derived value is shown on the service
   and on the incident that causes it.

.. class:: cmdb.service.item

   The junction between a service and a configuration item.  It carries
   the role of the item (``hosts``, ``supports``, ``provides``,
   ``depends``, ``monitors``), its criticality for the service, a
   description and an active flag.  A configuration item can only be
   linked once to a service.

Impact Analysis
---------------

The impact queries build on
``cmdb.relationship.get_impact_closure()``, the traversal introduced
with the CI relationship model:

* ``CMDBService.get_services_for_ci(reference)`` returns the services
  the loss of a CI affects.  The downstream closure of the CI is
  followed as well, so a service linked to a component the CI hosts is
  reported too.
* ``CMDBService.get_supporting_ci_closure()`` returns the closure of the
  configuration items a service rests on, the direct items first and
  then the closure reachable through the relationships.
* ``CMDBService.get_single_points_of_failure(threshold)`` returns the
  configuration items whose loss takes down more than ``threshold``
  services, ordered by decreasing count.  The default threshold is
  ``DEFAULT_SPOF_THRESHOLD``.

Incident Linkage
----------------

``cmdb.incident`` gains a many2many to ``cmdb.service`` and a
``business_impact`` flag.  An incident is linked to a service either
explicitly, through that many2many, or implicitly, through the
configuration items it points at:
``CMDBIncident.get_services()`` merges both.  ``service_impact`` shows
the services the incident currently degrades or takes down.

ITIL4 Service Catalogue
-----------------------

``itil4_service_catalogue`` is an optional (``extras_depend``)
dependency: the module installs and works without it, and when it is
activated a service can be mapped onto its ``itil4.service`` record.
The mapping matrix is:

=======================  ==============================
cmdb_service             itil4_service_catalogue
=======================  ==============================
cmdb.service.category    itil4.service.category
cmdb.service.group       itil4.service.group
cmdb.service             itil4.service
cmdb.service.item        -
=======================  ==============================

Only ``cmdb.service`` carries the mapping: the category and the group of
the module are master data of the service catalogue of the
organisation, the ITIL4 catalogue keeps its own.  The mapping is
registered by the ``[register itil4_service_catalogue]`` section of
``tryton.cfg``, so no code of the module imports it directly.

Access Rights
-------------

The module ships the module local ``group_cmdb_service`` (read-only) and
``group_cmdb_service_admin`` (full control) groups and a ``security.xml``
that covers every model of the module.  The suite wide groups are owned
by the base ``cmdb`` module.
