本文整理匯總了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')
#.........這裏部分代碼省略.........