port = 20007
return eos.__init__(self, server, port, password)
- def list_pm_data(self, startPeriod=None, endPeriod=None, neNames=[], periodType=None, counters=[], pmPoints=[], parse=True):
+ def list_pm_data(self, startPeriod=None, endPeriod=None, neNames=[], periodType=None, counters=[], parse=True):
'''
Function used to obtain a listing of of PM DATA from NMS. Depending on parse value the output is either raw data from NMS
or structured python data
@type endPeriod: String
@param endPeriod: To when to collect PM data. Format: YYYYMMDDQH where QH in [00,96] representing 15min periods in a day.
- @type neNames: A list of strings
- @param neNames: A list of NetworkElement names with pmPoints assigned. If omitted all NEs are assumed. To get different pmpoints from different network elements use the notation ['neName1{pmpoint1|pmpoint2}','neName2{pmpoint4|pmpoint5}','neName3']
+ @type neNames: A list of complex strings
+ @param neNames: A list of NetworkElement names with their respective pmPoints(optional). If pmPoints are omitted, all NEs are assumed. To get different pmpoints from different network elements use the notation ['neName1{pmpoint1|pmpoint2}','neName2{pmpoint4|pmpoint5}','neName3{}']
@type periodType: String
@param periodType: The period of monitoring. Values: 15, 1h, 24, RM1, RM2, RM3, RM4, RM5, FL, immediate, peak, 30-day, IM, day, month. Default 15
@type counters: A list of strings
@param counters: The counters for the above NetworkElements to fetch. Assumes that the Network Elements have the same pmPoints. If omitted all counters are returned
- @type pmPoints: A list of strings
- @param pmPoints: The pmPoints for the above NetworkElements to fetch. Assumes that the Network Elements have the same pmPoints. If omitted all pmPoints are fetched.
-
@type parse: Boolean
@param parse: Default: True. If set to True, the output is a python list of dictionaries. Otherwise the output is the NMS response text.
@return: Performance monitoring data (counter values) in raw text format or in structured format. False in case of errors.
'''
extras = []
- extras.append('periodType=%s'%(periodType) if periodType else 'periodType=15')
- extras.append('startPeriod=%s'%(startPeriod) if startPeriod else '')
- extras.append('endPeriod=%s'%(endPeriod) if endPeriod else '')
- extras.append('counters={%s}'%(('|'.join(counters)) if counters else ''))
- pmpoints = '{%s}' %('|'.join(["pmPoint="+pmPoint for pmPoint in pmPoints])) if pmPoints else None
- extras.append('neName=%s'%(''.join([name+(pmpoints or '{}') for name in neNames])) if neNames else '')
+ extras.append('%s'%(periodType) if periodType else '15')
+ extras.append('%s'%(startPeriod) if startPeriod else '')
+ extras.append('%s'%(endPeriod) if endPeriod else '')
+ extras.append('{%s}'%(('|'.join(counters)) if counters else ''))
+ extras.append(''.join(["%s"%name for name in neNames]) if neNames else '')
params = "|".join(extras) or ''
message = "LIST_PM_DATA_REQ[%s]" %params
if self.send(message) == False: