當前位置: 首頁>>代碼示例>>Python>>正文


Python ZenModelRM.ZenModelRM類代碼示例

本文整理匯總了Python中Products.ZenModel.ZenModelRM.ZenModelRM的典型用法代碼示例。如果您正苦於以下問題:Python ZenModelRM類的具體用法?Python ZenModelRM怎麽用?Python ZenModelRM使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ZenModelRM類的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

 def __init__(self, id):
     ZenModelRM.__init__(self, id)
     self.eventClassKey = id
     self.sequence = None
     self.rule = ""
     self.regex = ""
     self.example = ""
     self.explanation = ""
     self.resolution = ""
開發者ID:bbc,項目名稱:zenoss-prodbin,代碼行數:9,代碼來源:EventClassInst.py

示例2: __init__

 def __init__(self, sourcepath, id='', title='', description='', 
              preview='', height=200, permission=ZEN_COMMON):
     if not id: id = basename(sourcepath).split('.')[0]
     self.id = id
     ZenModelRM.__init__(self, id)
     self.title = title
     self.description = description
     self.permission = permission
     self.sourcepath = sourcepath
     self.preview = preview
     self.height = height
     self._read_source()
開發者ID:SteelHouseLabs,項目名稱:zenoss-prodbin,代碼行數:12,代碼來源:Portlet.py

示例3: managedDeviceLink

    def managedDeviceLink(self):
        from Products.ZenModel.ZenModelRM import ZenModelRM

        d = self.getDmdRoot("Devices").findDevice(self.bsProductName)
        if d:
            return ZenModelRM.urlLink(d, "link")
        return None
開發者ID:whyzgeek,項目名稱:ZenPacks.community.HPBladeChassis,代碼行數:7,代碼來源:BladeChassisInterconnect.py

示例4: managedDeviceLink

 def managedDeviceLink(self):
     from Products.ZenModel.ZenModelRM import ZenModelRM
     d = self.getDmdRoot('Devices').findDevice(self.id)
     if d:
         return ZenModelRM.urlLink(d, 'link')
     return None
開發者ID:Hackman238,項目名稱:ZenPacks.Rackspace.BTI7200,代碼行數:6,代碼來源:Shelf.py

示例5: managedDeviceLink

 def managedDeviceLink(self):
     from Products.ZenModel.ZenModelRM import ZenModelRM
     d = self.getDmdRoot("Devices").findDevice(self.rttMonCtrlAdminTag)
     if d:
         return ZenModelRM.urlLink(d, 'link')
     return None
開發者ID:rskoog,項目名稱:ZenPacks.ShaneScott.ipSLA,代碼行數:6,代碼來源:SLAS.py

示例6: getPerformanceLink

 def getPerformanceLink(self):
     from Products.ZenModel.ZenModelRM import ZenModelRM
     d = self.getDmdRoot("Devices").findDevice(self.serialPortLabel)
     if d:
         return ZenModelRM.urlLink(d, 'link')
     return None
開發者ID:BillTheBest,項目名稱:Community-Zenpacks,代碼行數:6,代碼來源:SerialPort.py

示例7: managedDeviceLink

 def managedDeviceLink(self):
     from Products.ZenModel.ZenModelRM import ZenModelRM
     d = self.getDmdRoot("Devices").findDevice(self.serverAlias)
     if d:
         return ZenModelRM.urlLink(d, 'link')
     return None
開發者ID:BillTheBest,項目名稱:Community-Zenpacks,代碼行數:6,代碼來源:Terminal.py

示例8: managedDeviceLink

 def managedDeviceLink(self):
     from Products.ZenModel.ZenModelRM import ZenModelRM
     d = self.getDmdRoot("Devices").findDevice(self.bsDisplayName)
     if d:
         return ZenModelRM.urlLink(d, 'link', attrs={'target':'_top'})
     return None
開發者ID:chrisheyne,項目名稱:ZenPacks.community.HPBladeChassis,代碼行數:6,代碼來源:BladeServer.py

示例9: feedLinks

 def feedLinks(self):
     links = []
     for feed in self.getFeedObjs():
         links.append(ZenModelRM.urlLink(feed, feed.getId()))
     return ", ".join(links)
開發者ID:BillTheBest,項目名稱:Community-Zenpacks,代碼行數:5,代碼來源:Tower.py

示例10: managedDeviceLink

    def managedDeviceLink(self):
	from Products.ZenModel.ZenModelRM import ZenModelRM
	d = self.getDmdRoot("Devices").findDevice(self.cfcDisplayName)
	if d:
	    return ZenModelRM.urlLink(d, self.cfcDisplayName)
	return self.cfcDisplayName
開發者ID:BillTheBest,項目名稱:Community-Zenpacks,代碼行數:6,代碼來源:CfengineClient.py

示例11: zmanage_editProperties

    def zmanage_editProperties(self, REQUEST, redirect=False):
        """
        Edit a ZenPack object
        """

        if self.isEggPack():
            # Handle the dependencies fields and recreate self.dependencies
            newDeps = {}
            depNames = REQUEST.get('dependencies', [])
            if not isinstance(depNames, list):
                depNames = [depNames]
            newDeps = {}
            for depName in depNames:
                fieldName = 'version_%s' % depName
                vers = REQUEST.get(fieldName, '').strip()
                if vers and vers[0] in string.digits:
                    vers = '==' + vers
                try:
                    req = pkg_resources.Requirement.parse(depName + vers)
                except ValueError:
                    messaging.IMessageSender(self).sendToBrowser(
                        'Error',
                        '%s is not a valid version specification.' % vers,
                        priority=messaging.WARNING
                    )
                    return self.callZenScreen(REQUEST)
                zp = self.dmd.ZenPackManager.packs._getOb(depName, None)
                if not zp:
                    messaging.IMessageSender(self).sendToBrowser(
                        'Error',
                        '%s is not installed.' % depName,
                        priority=messaging.WARNING
                    )
                    return self.callZenScreen(REQUEST)
                if not req.__contains__(zp.version):
                    messaging.IMessageSender(self).sendToBrowser(
                        'Error',
                        ('The required version for %s (%s) ' % (depName, vers) +
                        'does not match the installed version (%s).' %
                         zp.version),
                        priority=messaging.WARNING
                    )
                    return self.callZenScreen(REQUEST)
                newDeps[depName] = vers
                REQUEST.form[fieldName] = vers
            self.dependencies = newDeps
            # Check the value of compatZenossVers and the dependencies to
            # make sure that they match installed versions
            compatZenossVers = REQUEST.form['compatZenossVers'] or ''
            if compatZenossVers:
                if compatZenossVers[0] in string.digits:
                    compatZenossVers = '==' + compatZenossVers
                try:
                    req = pkg_resources.Requirement.parse(
                                                'zenoss%s' % compatZenossVers)
                except ValueError:
                    messaging.IMessageSender(self).sendToBrowser(
                        'Error',
                        ('%s is not a valid version specification for Zenoss.'
                                                        % compatZenossVers),
                        priority=messaging.WARNING
                    )
                if not req.__contains__(ZENOSS_VERSION):
                    messaging.IMessageSender(self).sendToBrowser(
                        'Error',
                        ('%s does not match this version of Zenoss (%s).' %
                            (compatZenossVers, ZENOSS_VERSION)),
                        priority=messaging.WARNING
                    )
                    return self.callZenScreen(REQUEST)
                REQUEST.form['compatZenossVers'] = compatZenossVers

        if 'Select or specify your own' in REQUEST.get('license', ''):
            REQUEST.form['license'] = ''

        result =  ZenModelRM.zmanage_editProperties(self, REQUEST, redirect,
                audit=False)
        audit('UI.ZenPack.Edit',
                self.id,
                data_=REQUEST.form,
                skipFields_=('redirect',
                        'zenScreenName',
                        'zmanage_editProperties'))

        if self.isEggPack():
            self.writeSetupValues()
            self.writeLicense()
            self.buildEggInfo()
        return result
開發者ID:c0ns0le,項目名稱:zenoss-4,代碼行數:89,代碼來源:ZenPack.py

示例12: __init__

 def __init__(self, id, title=None, buildRelations=True):
     #self.dependencies = {'zenpacksupport':''}
     self.dependencies = {}
     ZenModelRM.__init__(self, id, title, buildRelations)
開發者ID:c0ns0le,項目名稱:zenoss-4,代碼行數:4,代碼來源:ZenPack.py


注:本文中的Products.ZenModel.ZenModelRM.ZenModelRM類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。