当前位置: 首页>>代码示例>>Python>>正文


Python IGUIDManager.getPath方法代码示例

本文整理汇总了Python中Products.ZenUtils.guid.interfaces.IGUIDManager.getPath方法的典型用法代码示例。如果您正苦于以下问题:Python IGUIDManager.getPath方法的具体用法?Python IGUIDManager.getPath怎么用?Python IGUIDManager.getPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Products.ZenUtils.guid.interfaces.IGUIDManager的用法示例。


在下文中一共展示了IGUIDManager.getPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: EventCompatInfo

# 需要导入模块: from Products.ZenUtils.guid.interfaces import IGUIDManager [as 别名]
# 或者: from Products.ZenUtils.guid.interfaces.IGUIDManager import getPath [as 别名]
class EventCompatInfo(object):
    """
    Takes a zep event and maps it to the format that the UI expects
    """
    implements(IMarshallable)

    def __init__(self, dmd, event_summary):
        self._dmd = dmd
        self._event_summary = event_summary
        self._eventOccurrence = event_summary['occurrence'][0]
        self._eventActor = self._eventOccurrence['actor']
        self._eventDetails = self._findDetails(self._eventOccurrence)
        self._catalog = ICatalogTool(dmd)
        self._manager = IGUIDManager(dmd)

    @property
    def id(self):
        return self._event_summary['uuid']

    @property
    def evid(self):
        return self.id

    @property
    def dedupid(self):
        return self._eventOccurrence.get('fingerprint')

    @property
    def eventState(self):
        return EventStatus.getPrettyName(self._event_summary['status'])

    @property
    def severity(self):
        return self._eventOccurrence['severity']

    @property
    def component(self):
        return {
            'text': self._eventActor.get('element_sub_title'),
            'uid': self._getPathFromUuid(self._eventActor.get('element_sub_uuid')),
            'url' : self._uuidUrl(self._eventActor.get('element_sub_uuid')),
            'uuid' : self._eventActor.get('element_sub_uuid')
            }

    @property
    def eventClass(self):
        eventClass = self._eventOccurrence['event_class']
        return {"text": eventClass, "uid": "/zport/dmd/Events%s" % eventClass}

    @property
    def summary(self):
        return self._eventOccurrence['summary']

    @property
    def firstTime(self):
        return isoDateTimeFromMilli(self._event_summary['first_seen_time'])

    @property
    def lastTime(self):
        return isoDateTimeFromMilli(self._event_summary['last_seen_time'])

    @property
    def count(self):
        return self._event_summary['count']

    @property
    def stateChange(self):
        return isoDateTimeFromMilli(self._event_summary['status_change_time'])

    @property
    def eventClassKey(self):
        return self._eventOccurrence.get('event_class_key')

    @property
    def eventGroup(self):
        return self._eventOccurrence.get('event_group')

    @property
    def eventKey(self):
        return self._eventOccurrence.get('event_key')

    @property
    def agent(self):
        return self._eventOccurrence.get('agent')

    @property
    def monitor(self):
        return self._eventOccurrence.get('monitor')

    @property
    def ownerid(self):
        return self._event_summary.get('current_user_name')

    @property
    def facility(self):
        return self._eventOccurrence.get('syslog_facility')

    @property
    def priority(self):
        return self._eventOccurrence.get('syslog_priority')
#.........这里部分代码省略.........
开发者ID:SteelHouseLabs,项目名称:zenoss-prodbin,代码行数:103,代码来源:event.py


注:本文中的Products.ZenUtils.guid.interfaces.IGUIDManager.getPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。