aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/honeycomb/Notifications.py
diff options
context:
space:
mode:
authorPeter Mikus <pmikus@cisco.com>2019-11-11 16:14:32 +0000
committerPeter Mikus <pmikus@cisco.com>2019-11-19 06:43:59 +0000
commite7ad66f3147662973039caaac33015de7e0c6f8c (patch)
tree809a056325425bad672a8a9274c3c2d696a35030 /resources/libraries/python/honeycomb/Notifications.py
parent20cc67d5f23a7f4e05b08012bf3d3a63be4bcf63 (diff)
HONEYCOMB: Remove
Signed-off-by: Peter Mikus <pmikus@cisco.com> Change-Id: I60d80564050cb786c7b1e0a08f31f8292f82197e
Diffstat (limited to 'resources/libraries/python/honeycomb/Notifications.py')
-rw-r--r--resources/libraries/python/honeycomb/Notifications.py68
1 files changed, 0 insertions, 68 deletions
diff --git a/resources/libraries/python/honeycomb/Notifications.py b/resources/libraries/python/honeycomb/Notifications.py
deleted file mode 100644
index 38f1fd3093..0000000000
--- a/resources/libraries/python/honeycomb/Notifications.py
+++ /dev/null
@@ -1,68 +0,0 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at:
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-"""Implementation of keywords for managing Honeycomb notifications."""
-
-from robot.api import logger
-
-from resources.libraries.python.honeycomb.HoneycombUtil import HoneycombError
-from resources.libraries.python.honeycomb.Netconf import Netconf
-
-
-class Notifications(Netconf):
- """Implements keywords for receiving Honeycomb notifications.
-
- The keywords implemented in this class make it possible to:
- - receive notifications from Honeycomb
- - read received notifications
- """
-
- def add_notification_listener(self, subscription):
- """Open a new channel on the SSH session, connect to Netconf subsystem
- and subscribe to receive Honeycomb notifications.
-
- :param subscription: RPC for subscription to notifications.
- :type subscription: str
- :raises HoneycombError: If subscription to notifications fails.
- """
-
- logger.debug(subscription)
- self.send(subscription)
-
- reply = self.get_response(
- err="Timeout on notifications subscription."
- )
-
- if "<ok/>" not in reply:
- raise HoneycombError("Notifications subscription failed with"
- " message: {0}".format(reply))
-
- logger.debug("Notifications subscription successful.")
-
- def get_notification(self, time_out=10):
- """Read and return the next notification message.
-
- :param time_out: Timeout value for the read operation in seconds.
- :type time_out: int
- :returns: Data received from buffer.
- :rtype: str
- """
-
- logger.debug("Getting notification. Timeout set to {0} seconds."
- .format(time_out))
-
- reply = self.get_response(
- err="Timeout on getting notification."
- )
-
- return reply