Skip to content

Commit

Permalink
Added listener command group
Browse files Browse the repository at this point in the history
Details:

* Added support for a 'listener' command group that manages WBEM indication
  listeners. (see issue #430)

* Removed Python 3.4 on Windows from GitHub Actions tests, because this environment
  does not have the Microsoft Visual C++ 10.0 compiler needed for building the
  'psutils' package.

Signed-off-by: Andreas Maier <[email protected]>
  • Loading branch information
andy-maier committed May 5, 2021
1 parent e66b1b0 commit 641b2b8
Show file tree
Hide file tree
Showing 8 changed files with 767 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ jobs:
\"os\": \"macos-latest\", \
\"python-version\": \"3.4\", \
\"package_level\": \"latest\" \
}, \
{ \
\"os\": \"windows-latest\", \
\"python-version\": \"3.4\", \
\"package_level\": \"minimum\" \
}, \
{ \
\"os\": \"windows-latest\", \
\"python-version\": \"3.4\", \
\"package_level\": \"latest\" \
} \
], \
\"include\": [ \
Expand Down Expand Up @@ -113,12 +123,12 @@ jobs:
}, \
{ \
\"os\": \"windows-latest\", \
\"python-version\": \"3.4\", \
\"python-version\": \"3.5\", \
\"package_level\": \"minimum\" \
}, \
{ \
\"os\": \"windows-latest\", \
\"python-version\": \"3.4\", \
\"python-version\": \"3.5\", \
\"package_level\": \"latest\" \
} \
] \
Expand Down
3 changes: 3 additions & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ Released: not yet

**Enhancements:**

* Added support for managing WBEM indication listeners by adding a command
group 'listener'. (issue #430)

**Cleanup:**

**Known issues:**
Expand Down
193 changes: 193 additions & 0 deletions docs/pywbemcli/cmdshelp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ Help text for ``pywbemcli``:
Commands:
class Command group for CIM classes.
instance Command group for CIM instances.
listener Command group for WBEM indication listeners.
namespace Command group for CIM namespaces.
profile Command group for WBEM management profiles.
qualifier Command group for CIM qualifier declarations.
Expand Down Expand Up @@ -1600,6 +1601,198 @@ Help text for ``pywbemcli instance shrub`` (see :ref:`instance shrub command`):
-h, --help Show this help message.


.. _`pywbemcli listener --help`:

pywbemcli listener --help
-------------------------



Help text for ``pywbemcli listener`` (see :ref:`listener command group`):


::

Usage: pywbemcli [GENERAL-OPTIONS] listener COMMAND [ARGS] [COMMAND-OPTIONS]

Command group for WBEM indication listeners.

This command group defines commands to manage WBEM indication listeners. Each listener is a running process that
executes the `pywbemcli listener run` command acting as a listener.

These processes can be started manually by the user by invoking the `pywbemcli listener run` command in the
background, or by using the `pywbemcli listener start` command which does exactly that.

There is no persisted data about the currently running listeners, instead the currently running processes executing
the `pywbemcli listener run` command are the currently running listeners.

If such a listener process terminates, the corresponding listener no longer exists, so there is no notion of a
stopped listener nor does a listener have an operational status. The `pywbemcli listener stop` command terminates a
listener gracefully.

In addition to the command-specific options shown in this help text, the general options (see 'pywbemcli --help')
can also be specified before the 'connection' keyword.

Command Options:
-h, --help Show this help message.

Commands:
run Run as a named WBEM indication listener.
start Start a named WBEM indication listener in the background.
stop Stop a named WBEM indication listener.
show Show a named WBEM indication listener.
list List the currently running named WBEM indication listeners.


.. _`pywbemcli listener list --help`:

pywbemcli listener list --help
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



Help text for ``pywbemcli listener list`` (see :ref:`listener list command`):


::

Usage: pywbemcli [GENERAL-OPTIONS] listener list [COMMAND-OPTIONS]

List the currently running named WBEM indication listeners.

This is done by listing the currently running `pywbemcli listener run` commands.

Command Options:
-h, --help Show this help message.


.. _`pywbemcli listener run --help`:

pywbemcli listener run --help
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



Help text for ``pywbemcli listener run`` (see :ref:`listener run command`):


::

Usage: pywbemcli [GENERAL-OPTIONS] listener run NAME [COMMAND-OPTIONS]

Run as a named WBEM indication listener.

Run this command as a named WBEM indication listener until it gets terminated, e.g. by a keyboard interrupt, break
signal (e.g. kill), or the `pywbemcli listener stop` command.

A listener with that name must not be running, otherwise the command fails.

Examples:

pywbemcli listener run lis1

Command Options:
--port PORT The port number listened on. Default: 5988
--protocol PROTOCOL The protocol used by the listener (http, https). Default: http
--certfile FILE Path name of a PEM file containing the certificate that will be presented as a server certificate
during SSL/TLS handshake. Required when using https. The file may in addition contain the private
key of the certificate.

--keyfile FILE Path name of a PEM file containing the private key of the server certificate. Required when using
https and when the certificate file does not contain the private key.

-h, --help Show this help message.


.. _`pywbemcli listener show --help`:

pywbemcli listener show --help
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



Help text for ``pywbemcli listener show`` (see :ref:`listener show command`):


::

Usage: pywbemcli [GENERAL-OPTIONS] listener show NAME [COMMAND-OPTIONS]

Show a named WBEM indication listener.

A listener with that name must be running, otherwise the command fails.

Examples:

pywbemcli listener stop lis1

Command Options:
-h, --help Show this help message.


.. _`pywbemcli listener start --help`:

pywbemcli listener start --help
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



Help text for ``pywbemcli listener start`` (see :ref:`listener start command`):


::

Usage: pywbemcli [GENERAL-OPTIONS] listener start NAME [COMMAND-OPTIONS]

Start a named WBEM indication listener in the background.

A listener with that name must not be running, otherwise the command fails.

Examples:

pywbemcli listener start lis1

Command Options:
--port PORT The port number listened on. Default: 5988
--protocol PROTOCOL The protocol used by the listener (http, https). Default: http
--certfile FILE Path name of a PEM file containing the certificate that will be presented as a server certificate
during SSL/TLS handshake. Required when using https. The file may in addition contain the private
key of the certificate.

--keyfile FILE Path name of a PEM file containing the private key of the server certificate. Required when using
https and when the certificate file does not contain the private key.

-h, --help Show this help message.


.. _`pywbemcli listener stop --help`:

pywbemcli listener stop --help
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



Help text for ``pywbemcli listener stop`` (see :ref:`listener stop command`):


::

Usage: pywbemcli [GENERAL-OPTIONS] listener stop NAME [COMMAND-OPTIONS]

Stop a named WBEM indication listener.

The listener is stopped gracefully.

A listener with that name must be running, otherwise the command fails.

Examples:

pywbemcli listener stop lis1

Command Options:
-h, --help Show this help message.


.. _`pywbemcli namespace --help`:

pywbemcli namespace --help
Expand Down
1 change: 1 addition & 0 deletions minimum-constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ PyYAML==5.3.1; python_version >= '3.5'
yamlloader==0.5.5
mock==3.0.0
toposort==1.6
psutil==5.5.0

# Virtualenv
virtualenv==14.0.0; python_version < '3.5'
Expand Down
1 change: 1 addition & 0 deletions pywbemtools/pywbemcli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
from ._cmd_connection import * # noqa: F403,F401
from ._cmd_profile import * # noqa: F403,F401
from ._cmd_statistics import * # noqa: F403,F401
from ._cmd_listener import * # noqa: F403,F401
from ._context_obj import * # noqa: F403,F401
from ._connection_repository import * # noqa: F403,F401
from .pywbemcli import * # noqa: F403,F401
Expand Down
Loading

0 comments on commit 641b2b8

Please sign in to comment.