-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pysros 21.10R3 is ready for customers
- Loading branch information
SRBuilds
committed
Feb 11, 2022
1 parent
85ec234
commit c60ffc7
Showing
6 changed files
with
119 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,93 +1,131 @@ | ||
:mod:`ehs` -- Functions specific to the event handling system (EHS) | ||
=================================================================== | ||
|
||
.. module:: ehs | ||
:synopsis: Functions specific for the SR OS event handling system (EHS) | ||
|
||
This module is used when executing on SR OS only. On a remote machine, the | ||
event handling system (EHS) and its functionality are not supported. | ||
|
||
The :mod:`ehs` module provides functions for obtaining the data from the | ||
The :mod:`pysros.ehs` module provides functionality to obtain data from the | ||
specific event that triggered the execution of a Python application from | ||
the event handling system (EHS). | ||
|
||
.. Reviewed by PLM 20211201 | ||
.. Reviewed by TechComms 20211202 | ||
.. Reviewed by PLM 20220118 | ||
.. Reviewed by TechComms 20220120 | ||
.. note:: This module is available when executing on SR OS only. On a remote | ||
machine, the event handling system (EHS) and its functionality | ||
are not supported. | ||
|
||
Classes | ||
------- | ||
.. Reviewed by PLM 20220117 | ||
.. Reviewed by TechComms 20220124 | ||
.. class:: get_event | ||
.. py:function:: get_event | ||
The EHS event that triggered the execution of the Python application. | ||
|
||
.. function:: appid | ||
:return: The Event object or None. | ||
:rtype: :py:class:`pysros.ehs.Event` or ``None`` | ||
|
||
.. Reviewed by PLM 20220118 | ||
.. Reviewed by TechComms 20220124 | ||
.. class:: Event | ||
|
||
The EHS event Class for the event that triggered the execution of the | ||
Python application. | ||
|
||
.. py:attribute:: appid | ||
The name of the application that generated the event. | ||
|
||
:type: str | ||
|
||
.. Reviewed by PLM 20220118 | ||
.. Reviewed by TechComms 20220124 | ||
.. py:attribute:: eventid | ||
The event ID number of the application. | ||
|
||
:type: int | ||
|
||
.. Reviewed by PLM 20220118 | ||
.. Reviewed by TechComms 20220124 | ||
.. py:attribute:: severity | ||
The severity level of the event. | ||
|
||
:type: str | ||
|
||
.. Reviewed by PLM 20220118 | ||
.. Reviewed by TechComms 20220124 | ||
.. py:attribute:: subject | ||
The subject or affected object of the event. | ||
|
||
:type: str | ||
|
||
.. Reviewed by PLM 20220118 | ||
.. Reviewed by TechComms 20220124 | ||
The name of the application that generated the event. | ||
.. py:attribute:: gentime | ||
:return: Application name. | ||
:rtype: str | ||
The formatted time, in ISO 8601 format, that the event was generated. | ||
|
||
.. Reviewed by PLM 20211201 | ||
.. Reviewed by TechComms 20211202 | ||
:type: str | ||
|
||
.. function:: eventid | ||
.. Reviewed by PLM 20220118 | ||
.. Reviewed by TechComms 20220124 | ||
The event ID number of the application. | ||
.. py:attribute:: timestamp | ||
:return: Event ID. | ||
:rtype: int | ||
The timestamp, in seconds, that the event was generated. | ||
|
||
.. Reviewed by PLM 20211201 | ||
.. Reviewed by TechComms 20211202 | ||
:type: float | ||
|
||
.. function:: severity | ||
.. Reviewed by PLM 20220118 | ||
.. Reviewed by TechComms 20220124 | ||
The severity level of the event. | ||
.. function:: eventparameters | ||
|
||
:return: Severity of the event. | ||
:rtype: str | ||
The additional parameters specific to the event that caused the | ||
Python application to execute. | ||
|
||
.. Reviewed by PLM 20211201 | ||
.. Reviewed by TechComms 20211202 | ||
:type: :py:class:`pysros.ehs.EventParams` | ||
|
||
.. function:: subject | ||
.. Reviewed by PLM 20220118 | ||
.. Reviewed by TechComms 20220124 | ||
The subject or affected object of the event. | ||
.. py:method:: format_msg | ||
:return: Subject or affected object. | ||
:rtype: str | ||
Return a string representation of the SR OS formatted log message. | ||
|
||
.. Reviewed by PLM 20211201 | ||
.. Reviewed by TechComms 20211202 | ||
:return: SR OS formatted log message. | ||
:rtype: str | ||
|
||
.. function:: gentime | ||
.. Reviewed by PLM 20220118 | ||
.. Reviewed by TechComms 20220124 | ||
The formatted time the event was generated in UTC. | ||
.. class:: EventParams | ||
|
||
:return: The timestamp in ISO 8601 format that the event was generated. | ||
:rtype: str | ||
The additional parameters of the specific :py:class:`pysros.ehs.Event`. | ||
This class is *read-only*. Specific additional parameters may be | ||
accessed using standard Python subscript syntax. | ||
|
||
.. Reviewed by PLM 20211201 | ||
.. Reviewed by TechComms 21211202 | ||
.. Reviewed by PLM 20220118 | ||
.. Reviewed by TechComms 20220124 | ||
.. function:: timestamp | ||
.. py:method:: keys | ||
The formatted time the event was generated. | ||
Obtain the additional parameters names. | ||
|
||
:return: The timestamp in seconds. | ||
:rtype: float | ||
:return: Additional parameters names for the Event. | ||
:rtype: tuple(str) | ||
|
||
.. Reviewed by PLM 20211201 | ||
.. Reviewed by TechComms 21211202 | ||
.. Reviewed by PLM 20220118 | ||
.. Reviewed by TechComms 20220124 | ||
.. function:: eventparameters | ||
.. describe:: params[key] | ||
|
||
The additional parameters specific to the event that caused the | ||
Python application to execute. | ||
Return the value of the parameter *key*. If the parameter does not exist, | ||
a :exc:`KeyError` is raised. | ||
|
||
:return: Additional attributes of the specific event. | ||
:rtype: dict | ||
.. Reviewed by PLM 20220118 | ||
.. Reviewed by TechComms 20220124 | ||
.. Reviewed by PLM 20211201 | ||
.. Reviewed by TechComms 21211202 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters