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

# Source Code for Module Products.ZenModel.VdefGraphPoint

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