#NEWLINE# def get_report_table_data( self ) : #NEWLINE# #INDENT# meters = ceilometer . Meters ( self . request ) #NEWLINE# services = { #NEWLINE# #INDENT# _ ( 'Nova' ) : meters . list_nova ( ) , #NEWLINE# _ ( 'Neutron' ) : meters . list_neutron ( ) , #NEWLINE# _ ( 'Glance' ) : meters . list_glance ( ) , #NEWLINE# _ ( 'Cinder' ) : meters . list_cinder ( ) , #NEWLINE# _ ( 'Swift_meters' ) : meters . list_swift ( ) , #NEWLINE# _ ( 'Kwapi' ) : meters . list_kwapi ( ) , #NEWLINE# #UNINDENT# } #NEWLINE# report_rows = [ ] #NEWLINE# date_options = self . request . session . get ( 'period' , 7 ) #NEWLINE# date_from = self . request . session . get ( 'date_from' , '' ) #NEWLINE# date_to = self . request . session . get ( 'date_to' , '' ) #NEWLINE# try : #NEWLINE# #INDENT# ( date_from , date_to ) = metering . calc_date_args ( date_from , date_to , date_options ) #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# exceptions . handle ( self . request , _ ( 'Dates cannot be recognized.' ) ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# project_aggregates = metering . ProjectAggregatesQuery ( self . request , date_from , date_to , ( 3600 * 24 ) ) #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# exceptions . handle ( self . request , _ ( 'Unable to retrieve project list.' ) ) #NEWLINE# #UNINDENT# for meter in meters . _cached_meters . values ( ) : #NEWLINE# #INDENT# service = None #NEWLINE# for ( name , m_list ) in services . items ( ) : #NEWLINE# #INDENT# if ( meter in m_list ) : #NEWLINE# #INDENT# service = name #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# ( res , unit ) = project_aggregates . query ( meter . name ) #NEWLINE# for re in res : #NEWLINE# #INDENT# values = re . get_meter ( meter . name . replace ( '.' , '_' ) ) #NEWLINE# if values : #NEWLINE# #INDENT# for value in values : #NEWLINE# #INDENT# row = { #NEWLINE# #INDENT# 'name' : 'none' , #NEWLINE# 'project' : re . id , #NEWLINE# 'meter' : meter . name , #NEWLINE# 'description' : meter . description , #NEWLINE# 'service' : service , #NEWLINE# 'time' : value . _apiresource . period_end , #NEWLINE# 'value' : value . _apiresource . avg , #NEWLINE# #UNINDENT# } #NEWLINE# report_rows . append ( row ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return report_rows