def __init__(self, id, deviceId='', compPath='', deviceOrganizer='',
                 recurse=False, sequence=0, title=None, buildRelations=True):
     ZenModelRM.__init__(self, id, title, buildRelations)
     self.deviceId = deviceId
     self.compPath = compPath
     self.deviceOrganizer = deviceOrganizer
     self.recurse = recurse
     self.sequence = sequence
 def __init__(self, userSettings, managedObject):
     userid = userSettings.getId()
     ZenModelRM.__init__(self, userid)
     self.role = userSettings.defaultAdminRole
     self.id = userid
     managedObject = managedObject.primaryAq()
     managedObject.adminRoles._setObject(userid, self)
     self.userSetting.addRelation(userSettings)
     managedObject.manage_setLocalRoles(userid, (self.role,),)
     managedObject.index_object()
Пример #3
0
 def __init__(self, id, description = ''):
     """
     @param id: Name of this organizer
     @type id: string
     @param description: A decription of this organizer
     @type description: string
     @rtype: Organizer
     """
     ZenModelRM.__init__(self, id)
     self.description = description
Пример #4
0
 def __init__(self,
              newId,
              collectionId='',
              graphDefId='',
              sequence=0,
              title=None,
              buildRelations=True):
     ZenModelRM.__init__(self, newId, title, buildRelations)
     self.collectionId = collectionId
     self.graphDefId = graphDefId
     self.sequence = sequence
Пример #5
0
 def __init__(self, userSettings, managedObject):
     userid = userSettings.getId()
     ZenModelRM.__init__(self, userid)
     self.role = userSettings.defaultAdminRole
     self.id = userid
     managedObject = managedObject.primaryAq()
     managedObject.adminRoles._setObject(userid, self)
     self.userSetting.addRelation(userSettings)
     managedObject.manage_setLocalRoles(
         userid,
         (self.role, ),
     )
     managedObject.index_object()
Пример #6
0
 def __init__(self, id, title="", prodName=None,
              productKey=None, partNumber="",description=""):
     ZenModelRM.__init__(self, id, title)
     # XXX per a comment in #406 from Erik, we may want to get rid
     # of prodName and only use productKey, to avoid redundancy
     if productKey:
         self.productKeys = [productKey]
     elif prodName:
         self.productKeys = [prodName]
     else:
         # When adding manually through the gui or via device discovery if
         # the device model is not already in the system, both prodName
         # and productKey will be None
         self.productKeys = [id]
     self.name = prodName if prodName is not None else id
     self.partNumber = partNumber
     self.description = description
 def breadCrumbs(self, terminator='dmd'):
     """Return the breadcrumb links for this object add ActionRules list.
     [('url','id'), ...]
     """
     if self.rrdTemplate():
         from RRDTemplate import crumbspath
         crumbs = super(GraphDefinition, self).breadCrumbs(terminator)
         return crumbspath(self.rrdTemplate(), crumbs, -2)
     return ZenModelRM.breadCrumbs(self, terminator)
Пример #8
0
    def urlLink(self, text=None, url=None, attrs={}):
        """
        Override urlLink to return a link with the full path of the organizer.

        >>> dmd.Devices.Server.urlLink()
        '<a href="/zport/dmd/Devices/Server">/Server</a>'
        """
        if text is None: text = self.getOrganizerName()
        return ZenModelRM.urlLink(self, text=text, url=url, attrs=attrs)
Пример #9
0
 def breadCrumbs(self, terminator='dmd'):
     """Return the breadcrumb links for this object add ActionRules list.
     [('url','id'), ...]
     """
     if self.rrdTemplate():
         from RRDTemplate import crumbspath
         crumbs = super(GraphDefinition, self).breadCrumbs(terminator)
         return crumbspath(self.rrdTemplate(), crumbs, -2)
     return ZenModelRM.breadCrumbs(self, terminator)
Пример #10
0
 def checkValidId(self, id, prep_id = False):
     """Checks a valid id
     """
     if len(id) > 128:
         return 'Command definition names can not be longer than 128 characters.'
     allowed = set(string.ascii_letters + string.digits + '_')
     attempted = set(id)
     if not attempted.issubset(allowed):
         return 'Only letters, digits and underscores are allowed' + \
                 ' in command definition names.'
     return ZenModelRM.checkValidId(self, id, prep_id)
Пример #11
0
 def checkValidId(self, id, prep_id=False):
     """Checks a valid id
     """
     if len(id) > 128:
         return 'Command definition names can not be longer than 128 characters.'
     allowed = set(string.ascii_letters + string.digits + '_')
     attempted = set(id)
     if not attempted.issubset(allowed):
         return 'Only letters, digits and underscores are allowed' + \
                 ' in command definition names.'
     return ZenModelRM.checkValidId(self, id, prep_id)
Пример #12
0
 def __init__(self,
              id,
              title="",
              prodName=None,
              productKey=None,
              partNumber="",
              description=""):
     ZenModelRM.__init__(self, id, title)
     # XXX per a comment in #406 from Erik, we may want to get rid
     # of prodName and only use productKey, to avoid redundancy
     if productKey:
         self.productKeys = [productKey]
     elif prodName:
         self.productKeys = [prodName]
     else:
         # When adding manually through the gui or via device discovery if
         # the device model is not already in the system, both prodName
         # and productKey will be None
         self.productKeys = [id]
     self.name = prodName if prodName is not None else id
     self.partNumber = partNumber
     self.description = description
 def checkValidId(self, id, prep_id = False):
     """Checks a valid id
     """
     # RRD docs say that limit on vnames is 255 characters and that
     # A-Za-z0-9_ are the valid characters.  Zenoss reserves - for it's own
     # use.  Limiting to 200 instead just to leave room for whatever.
     # http://oss.oetiker.ch/rrdtool/doc/rrdgraph_data.en.html
     if len(id) > 200:
         return 'GraphPoint names can not be longer than 200 characters.'
     allowed = set(string.ascii_letters + string.digits + '_')
     attempted = set(id)
     if not attempted.issubset(allowed):
         return 'Only letters, digits and underscores are allowed' + \
                 ' in GraphPoint names.'
     return ZenModelRM.checkValidId(self, id, prep_id)
Пример #14
0
 def checkValidId(self, id, prep_id=False):
     """Checks a valid id
     """
     # RRD docs say that limit on vnames is 255 characters and that
     # A-Za-z0-9_ are the valid characters.  Zenoss reserves - for it's own
     # use.  Limiting to 200 instead just to leave room for whatever.
     # http://oss.oetiker.ch/rrdtool/doc/rrdgraph_data.en.html
     if len(id) > 200:
         return 'GraphPoint names can not be longer than 200 characters.'
     allowed = set(string.ascii_letters + string.digits + '_')
     attempted = set(id)
     if not attempted.issubset(allowed):
         return 'Only letters, digits and underscores are allowed' + \
                 ' in GraphPoint names.'
     return ZenModelRM.checkValidId(self, id, prep_id)
Пример #15
0
    def zmanage_editProperties(self, REQUEST=None, redirect=False):
        """Edit a ZenModel object and return its proper page template
        """
        unused(redirect)
        if REQUEST:
            msgs = []
            for optional in 'rrdmin', 'rrdmax':
                v = REQUEST.form.get(optional, None)
                if v:
                    try:
                        REQUEST.form[optional] = long(v)
                    except ValueError:
                        msgs.append('Unable to convert "%s" to a number' % v)
            msgs = ', '.join(msgs)
            if msgs:
                messaging.IMessageSender(self).sendToBrowser(
                    'Properties Saved', msgs[0].capitalize() + msgs[1:])
                return self.callZenScreen(REQUEST, False)

        return ZenModelRM.zmanage_editProperties(self, REQUEST)
Пример #16
0
    def zmanage_editProperties(self, REQUEST=None, redirect=False):
        """Edit a ZenModel object and return its proper page template
        """
        unused(redirect)
        if REQUEST:
            msgs = []
            for optional in 'rrdmin', 'rrdmax':
                v = REQUEST.form.get(optional, None)
                if v:
                    try:
                        REQUEST.form[optional] = long(v)
                    except ValueError:
                        msgs.append('Unable to convert "%s" to a number' % v)
            msgs = ', '.join(msgs)
            if msgs:
                messaging.IMessageSender(self).sendToBrowser(
                    'Properties Saved',
                    msgs[0].capitalize() + msgs[1:]
                )
                return self.callZenScreen(REQUEST, False)

        return ZenModelRM.zmanage_editProperties(self, REQUEST)
Пример #17
0
 def zmanage_editProperties(self, REQUEST=None, ignored=None):
     return ZenModelRM.zmanage_editProperties(self, REQUEST)
Пример #18
0
 def __init__(self, id, title=None):
     ZenModelRM.__init__(self, id, title)
     from ZVersion import VERSION
     self.version = "Zenoss " + VERSION
Пример #19
0
 def __init__(self, id, title=None, buildRelations=True):
     ZenModelRM.__init__(self, id, title, buildRelations)
     self.prevCollectorPerDevice = OOBTree()
Пример #20
0
 def breadCrumbs(self, target='dmd'):
     from Products.ZenUtils.Utils import unused
     unused(target)
     bc = ZenModelRM.breadCrumbs(self)
     return [bc[0], bc[-1]]
Пример #21
0
 def breadCrumbs(self, target='dmd'):
     from Products.ZenUtils.Utils import unused
     unused(target)
     bc = ZenModelRM.breadCrumbs(self)
     return [bc[0],bc[-1]]
Пример #22
0
 def __init__(self, id, title=None, buildRelations=True):
     ZenModelRM.__init__(self, id, title, buildRelations)
Пример #23
0
 def __init__(self, id, title=None, text=None, content_type='text/html'):
     ZenModelRM.__init__(self, id)
     self._template = ZopePageTemplate(id, text, content_type)
     self.title = title
Пример #24
0
 def __init__(self, newId, collectionId='', graphDefId='', sequence=0,
                                         title=None, buildRelations=True):
     ZenModelRM.__init__(self, newId, title, buildRelations)
     self.collectionId = collectionId
     self.graphDefId = graphDefId
     self.sequence = sequence
Пример #25
0
 def __init__(self, id, title = None, text=None, content_type='text/html'):
     ZenModelRM.__init__(self, id);
     self._template = ZopePageTemplate(id, text, content_type)
     self.title = title
Пример #26
0
 def __init__(self, id, title=None):
     ZenModelRM.__init__(self, id, title)
     from ZVersion import VERSION
     self.version = "Zenoss " + VERSION
Пример #27
0
 def zmanage_editProperties(self, REQUEST=None, ignored=None):
     return ZenModelRM.zmanage_editProperties(self, REQUEST)
Пример #28
0
 def __init__(self, id):
     ZenModelRM.__init__(self, id)
     self.start = time.time()
     self.enabled = False
Пример #29
0
 def __init__(self, id):
     ZenModelRM.__init__(self, id)
     self.start = time.time()
     self.enabled = False
Пример #30
0
 def __init__(self, id, title=None, buildRelations=True):
     ZenModelRM.__init__(self, id, title, buildRelations)
     self.prevCollectorPerDevice = OOBTree()