Introduction ============ The `Luna-Video-Manager` service is intended for streams distribution among agents and subsequent analysis of these streams. The `agent` is a third-party service designed to decode and execute analytics on streams. There is a `Luna-Video-Agent` service provided by VL, but there is a possibility to create your own agent, see `agent interaction chapter <./agent_interaction.html>`_ for details. The `Luna-Video-Manager` distributes streams to agents taking into account of available analytics, does not create/modify analytics itself, but only registers analytics provided by agent(s) and uses knowledge about agent possibility to work with one or another analytics to distribute streams. For more information about analytics see `analytics chapter <./analytics.html>`_. Each `Luna-Video-Manager` can serve a limited count of user requests and each agent can analyze a limited count of streams, that's why these services can be scaled like so each `Luna-Video-Manager` has access to one and the same database and each agent has access to one of Luna-Video-Managers. For more information about interaction with database in this case see `master instance chapter <./master_instance.html>`_. .. note:: The `Luna-Video-Manager` can work with streams and files, to simplify the description here and below the `stream` will be used to denote both options since the difference from the point of view of processing and distribution is only that the file will end anyway User interaction ---------------- Common user interaction occurs as follows: - stream creation using `stream creation request <_static/api.html#operation/createStream>`_ - watch stream status using `get stream request <_static/api.html#operation/getStream>`_ - stop or start stream processing using `patch stream request <_static/api.html#operation/patchStream>`_ For more information about user interaction see `user interaction chapter <./user_interaction.html>`_. For more information about stream lifecycle see `streams lifecycle <./streams_statuses.html#streams-lifecycle>`_. Agent interaction ----------------- The `Luna-Video-Manager` interaction with agent occurs as follows: - agent register itself using `register agent request <_static/api.html#operation/registerAgent>`_ - agent periodically get streams for analysis using `get streams request <_static/api.html#operation/postAgentStreams>`_ - agent send feedback to `Luna-Video-Manager` using `send feedback request <_static/api.html#operation/postStreamsFeedback>`_ For more information about agent interaction see `agent interaction chapter <./agent_interaction.html>`_. Luna-Video-Manager background processes --------------------------------------- Independently of `Luna-Video-Manager` instance count, one of them will become master instance (see `master instance <./master_instance.html>`_ for details). The master instance will periodically execute several tasks: - distribute streams to agents (see `streams distribution <./streams_distribution.html>`_ for details) - streams restarting (see `streams autorestart <./streams_statuses.html#streams-autorestart>`_ for details) - streams downgrade (see `streams downgrade <./downgrade.html#streams-downgrade>`_ for details) - agents downgrade (see `agents downgrade <./downgrade.html#agents-downgrade>`_ for details) - logs auto deletion (see `logs auto deletion <./logs_auto_deletion.html>`_ for details) - inactive agents auto deletion (see `agents auto deletion <./agent_auto_deletion.html>`_ for details)