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

# Source Code for Module Products.ZenModel.VdefGraphPoint

     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  __doc__="""VdefGraphPoint
    12
    13  Handles GraphPoints that define an rrd VDEF
    14  """
    15
    16  from Globals import InitializeClass
    17
    18  from Products.ZenModel.RpnGraphPoint import RpnGraphPoint
    19  from Products.ZenUtils.deprecated import deprecated
    20
    21  @deprecated
    22 -def manage_addVdefGraphPoint(context, id, REQUEST = None):
    23      ''' This is here so than zope will let us copy/paste/rename
    24      graphpoints.
    25      '''
    26      gp = VdefGraphPoint(id)
    27      context._setObject(gp.id, gp)
    28      if REQUEST:
    29          return context.callZenScreen(REQUEST)
    30
    31
    32 -class VdefGraphPoint(RpnGraphPoint):
    33      meta_type = 'VdefGraphPoint'
    34
    35
    36 -    def getType(self):
    37          return 'VDEF'
    38
    39
    40 -    def getGraphCmds(self, cmds, context, rrdDir, addSummary, idx,
    41                              multiid=-1, prefix=''):
    42          ''' Build the graphing commands for this graphpoint
    43          '''
    44          from Products.ZenUtils.Utils import unused
    45          unused(multiid, prefix, rrdDir)
    46          if not self.rpn:
    47              return cmds
    48          rpn = self.talesEval(self.rpn, context)
    49          return cmds + ['VDEF:%s=%s' % (
    50                          self.getDsName(self.id, multiid, prefix),
    51                          self.getRpn(multiid, prefix))]
    52
    53
    54  InitializeClass(VdefGraphPoint)
    55