示例#1
0
    def get_data(self, hostname, **params):
        data = []
        from_date = params.get('from_date', datetime.datetime.now().strftime('%Y-%m-%d'))
        to_date = params.get('to_date', (datetime.datetime.now() + datetime.timedelta(1)).strftime('%Y-%m-%d'))

        if 'show' in params:
            data = reportdata.getLocksReport(hostname, from_date, to_date)
        host_names = hosts.getHostsWithFeature('blockingStatsGatherInterval').items()
        return data, from_date, to_date, host_names
示例#2
0
    def get_data(self, hostname, **params):
        data = []
        from_date = params.get('from_date', datetime.datetime.now().strftime('%Y-%m-%d'))
        to_date = params.get('to_date', (datetime.datetime.now() + datetime.timedelta(1)).strftime('%Y-%m-%d'))

        if 'show' in params:
            data = reportdata.getLocksReport(hostname, from_date, to_date)
        host_names = hosts.getHostsWithFeature('blockingStatsGatherInterval').items()
        return data, from_date, to_date, host_names
示例#3
0
    def get_data(self, selected_hostname, **params):
        data = {}
        filter = params.get('filter', 'api')
        from_date = params.get('from_date', (datetime.datetime.now() - datetime.timedelta(14)).strftime('%Y-%m-%d'))
        to_date = params.get('to_date', (datetime.datetime.now() + datetime.timedelta(1)).strftime('%Y-%m-%d'))

        if selected_hostname:
            data = reportdata.get_unused_schemas(selected_hostname, from_date, to_date, filter)

        host_names = hosts.getHostsWithFeature('schemaStatsGatherInterval').items()

        return data, from_date, to_date, host_names, filter
示例#4
0
    def get_data(self, selected_hostname, **params):
        data = {}
        filter = params.get('filter', 'api')
        from_date = params.get('from_date', (datetime.datetime.now() - datetime.timedelta(14)).strftime('%Y-%m-%d'))
        to_date = params.get('to_date', (datetime.datetime.now() + datetime.timedelta(1)).strftime('%Y-%m-%d'))

        if selected_hostname:
            data = reportdata.get_unused_schemas(selected_hostname, from_date, to_date, filter)

        host_names = hosts.getHostsWithFeature('schemaStatsGatherInterval').items()
        host_names.sort(key=lambda x: x[1]['host_name'])

        return data, from_date, to_date, host_names, filter