Пример #1
0
 def get_json_data(self, site):
     self.validateSiteName(site)
     if site == 'T1_US_FNAL':
         site = 'T1_US_FNAL_Buffer'
         logger.info('changing name of T1_US_FNAL to T1_US_FNAL_Buffer for the PhEDEx query')
     params = {'node':site}
     phedex_data = httpInterface.get_json_data(self, params)
     formatted_data = self.format_response(phedex_data,site)
     return formatted_data
Пример #2
0
    def get_json_data(self, site, source, timestart=None, timestop=None):
        self.validateSiteName(site)
            
        params  = {'sitename':site, 'tstart': timestart, 'tstop': timestop}
        if not timestart and not timestop:
            params  = {'sitename':site}
   
        if Lexicon.accsource(source):
            params['source'] = source
        else:
            raise popularityInterfaceException("Given source (access data source) is not valid")

        pop_data = httpInterface.get_json_data(self, params)
        try:
            pop_data[site]
        except KeyError:
            logger.warning('WARNING: empty popularity results for %s' % site)
        return pop_data