Example #1
0
    def get_data(self, uishortname, **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 uishortname:
            data = reportdata.get_unused_schemas(uishortname, from_date, to_date, filter)

        uishortnames = hosts.getHostsWithFeatureAsShortnames('schemaStatsGatherInterval')

        return data, from_date, to_date, uishortnames, filter
Example #2
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
Example #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()
        host_names.sort(key=lambda x: x[1]['host_name'])

        return data, from_date, to_date, host_names, filter
Example #4
0
    def get_data(self, uishortname, **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 uishortname:
            data = reportdata.get_unused_schemas(uishortname, from_date,
                                                 to_date, filter)

        uishortnames = hosts.getHostsWithFeatureAsShortnames(
            'schemaStatsGatherInterval')

        return data, from_date, to_date, uishortnames, filter