本文整理汇总了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 = ""
示例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()
示例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
示例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
示例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
示例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
示例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
示例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
示例9: feedLinks
def feedLinks(self):
links = []
for feed in self.getFeedObjs():
links.append(ZenModelRM.urlLink(feed, feed.getId()))
return ", ".join(links)
示例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
示例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
示例12: __init__
def __init__(self, id, title=None, buildRelations=True):
#self.dependencies = {'zenpacksupport':''}
self.dependencies = {}
ZenModelRM.__init__(self, id, title, buildRelations)