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

# Source Code for Module Products.ZenModel.interfaces

      1  ###########################################################################
      2  #
      3  # This program is part of Zenoss Core, an open source monitoring platform.
      4  # Copyright (C) 2007, Zenoss Inc.
      5  #
      6  # This program is free software; you can redistribute it and/or modify it
      7  # under the terms of the GNU General Public License version 2 or (at your
      8  # option) any later version as published by the Free Software Foundation.
      9  #
     10  # For complete information please visit: http://www.zenoss.com/oss/
     11  #
     12  ###########################################################################
     13
     14  from zope.interface import Interface, Attribute
     15
     16 -class IDeviceLoader(Interface):
     17      """
     18      Object with ability to add devices to the database.
     19      """
     20 -    def load_device():
     21          """
     22          Attempt to load a single device into the database.
     23          """
     24
     25 -    def load_devices():
     26          """
     27          Attempt to load multiple devices into the database.
     28          """
     29
     30 -class IIndexed(Interface):
     31      """
     32      Object with ability to keep itself indexed in one or more catalogs.
     33      """
     34 -    def index_object():
     35          pass
     36 -    def unindex_object():
     37          pass
     38
     39
     40 -class IDataRoot(Interface):
     41      """
     42      Marker interface for the DMD, so it can be looked up as a global utility.
     43      """
     44
     45 -class IZenDocProvider(Interface):
     46      """
     47      Adapter that does zendoc manipulation for an underlying object
     48      """
     49 -    def getZendoc():
     50          """
     51          retrieves zendoc text
     52          """
     53          pass
     54
     55 -    def setZendoc(zendocText):
     56          """
     57          set zendoc text
     58          """
     59          pass
     60
     61 -    def exportZendocXml(self):
     62          pass
     63
     64 -class IAction(Interface):
     65
     66      id = Attribute("The unique identifier for this action.")
     67      name = Attribute("The human-friendly name of this action.")
     68      actionContentInfo = Attribute("The class that adapts a notification to an "
     69                                    "IInfo object for this class.")
     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 -    def process(signal):
    127          """
    128          @param signal: The signal that may require additional processing
    129          @type signal: zenoss.protocols.protobufs.zep_pb2.Signal
    130          """
    131          pass
    132