Package Products :: Package ZenModel :: Module interfaces |
[hide private]
[frames] | no frames]

# Source Code for Module Products.ZenModel.interfaces

      1  ##############################################################################
      2  #
      3  # Copyright (C) Zenoss, Inc. 2007, all rights reserved.
      4  #
      5  # This content is made available according to terms specified in
      6  # License.zenoss under the directory where your Zenoss product is installed.
      7  #
      8  ##############################################################################
      9
     10
     11  from zope.interface import Interface, Attribute
     12
     13 -class IDeviceLoader(Interface):
     14      """
     15      Object with ability to add devices to the database.
     16      """
     17 -    def load_device():
     18          """
     19          Attempt to load a single device into the database.
     20          """
     21
     22 -    def load_devices():
     23          """
     24          Attempt to load multiple devices into the database.
     25          """
     26
     27 -class IIndexed(Interface):
     28      """
     29      Object with ability to keep itself indexed in one or more catalogs.
     30      """
     31 -    def index_object():
     32          pass
     33 -    def unindex_object():
     34          pass
     35
     36
     37 -class IDataRoot(Interface):
     38      """
     39      Marker interface for the DMD, so it can be looked up as a global utility.
     40      """
     41
     42 -class IZenDocProvider(Interface):
     43      """
     44      Adapter that does zendoc manipulation for an underlying object
     45      """
     46 -    def getZendoc():
     47          """
     48          retrieves zendoc text
     49          """
     50          pass
     51
     52 -    def setZendoc(zendocText):
     53          """
     54          set zendoc text
     55          """
     56          pass
     57
     58 -    def exportZendocXml(self):
     59          pass
     60
     61 -class IAction(Interface):
     62
     63      id = Attribute("The unique identifier for this action.")
     64      name = Attribute("The human-friendly name of this action.")
     65      actionContentInfo = Attribute("The class that adapts a notification to an "
     66                                    "IInfo object for this class.")
     67
     68 -    def getDefaultData(dmd):
     69          """Return a dictionary of the default data for the notification content"""
     70
     71 -    def configure(options):
     72          """
     73          @param options: Options to configure the specified action.
     74          @type  options: Dictionary.
     75          """
     76          pass
     77
     78 -    def execute(notification, signal):
     79          """
     80          @param notification: The notification that should be sent.
     81          @type notification: NotificationSubscription
     82          @param signal: The signal that caused this notification to be executed.
     83          @type signal: zenoss.protocols.protobufs.zep_pb2.Signal
     84          """
     85          pass
     86
     87 -    def getInfo(notification):
     88          """
     89          Given a notification, adapt it to it's appropriate ActionContentInfo object.
     90
     91          @param notificaiton: The notification to adapt
     92          @type notification: NotificationSubscription
     93          """
     94
     95 -    def generateJavascriptContent(notification):
     96          """
     97          Generate a block of JS that will be used to render this action's
     98          content tab in the UI.
     99
    100          @param notification: The notification providing the data.
    101          @type notification: NotificationSubscription
    102          """
    103
    104 -    def updateContent(content, **kwargs):
    105          """
    106          Update the notification's content.
    107
    108          @param content: This is the NotificationSubscription.content container
    109                          for this action's data.
    110          @type content: dict
    111          @param kwargs: key word arguments passed to the update method. Contains
    112                         all update params.
    113          @type kwargs: dict
    114          """
    115
    116 -class IProvidesEmailAddresses(Interface):
    117 -    def getEmailAddresses():
    118          pass
    119
    120 -class IProvidesPagerAddresses(Interface):
    121 -    def getPagerAddresses():
    122          pass
    123
    124 -class IProcessSignal(Interface):
    125      """
    126      @deprecated: Use INotificationContextProvider.
    127      """
    128
    129 -    def process(signal):
    130          """
    131          @param signal: The signal that may require additional processing
    132          @type signal: zenoss.protocols.protobufs.zep_pb2.Signal
    133          """
    134          pass
    135
    136 -class INotificationContextProvider(Interface):
    137      """
    138      Hook to allow a ZenPack to provide additional context to a notification.
    139      @since 4.1.1
    140      """
    141
    142 -    def updateContext(signal, context):
    143          """
    144          @param signal: The signal which triggered the notification.
    145          @type signal: zenoss.protocols.protobufs.zep_pb2.Signal
    146          @param context: The dictionary of context passed to the underlying
    147                          notification.
    148          @type context: dict
    149          """
    150
    151 -class IExpandedLinkProvider(Interface):
    152      """
    153      Subscriber interface that gives a hook for adding
    154      context-specific html links (for example, the
    155      device links on the DeviceDetails page).
    156      """
    157 -    def getExpandedLinks(self):
    158          """
    159          @rtype list of html elements with links
    160          """
    161