Coverage for src/zenossapi/routers/incidentmanagement.py: 60%
10 statements
« prev ^ index » next coverage.py v7.9.1, created at 2025-06-25 05:47 +0000
« prev ^ index » next coverage.py v7.9.1, created at 2025-06-25 05:47 +0000
1# -*- coding: utf-8 -*-
3"""
4Zenoss Events/IncidentManagementRouter
5"""
7from zenossapi.routers import ZenossRouter
9__router__ = 'IncidentManagementRouter'
12class IncidentManagementRouter(ZenossRouter):
13 """
14 Class for interacting with the Zenoss incidentmanagement router
15 """
17 def __init__(self, url, headers, ssl_verify):
18 super(IncidentManagementRouter, self).__init__(url, headers, ssl_verify,
19 'Events/IncidentManagementRouter',
20 'IncidentManagementRouter')
22 def __repr__(self):
23 identifier = "at {0}".format(hex(id(self)))
25 return '<{0} object {1}>'.format(
26 type(self).__name__, identifier
27 )
29 def associate_incident_to_event(self, notification, incident, evids):
30 """
31 Associates an incident with a specific event ID.
33 Arguments:
34 notification (str): URI path to NotificationSubscriptions
35 incident (str): The incident ID
36 evids (list): The event IDs
37 """
38 self._router_request(
39 self._make_request_data(
40 'associateIncident',
41 dict(
42 notification=notification,
43 number=incident,
44 evids=evids
45 )
46 )
47 )