Exemplo n.º 1
0
    def __init__(self, provider_def):
        """
        Initialize object

        :param provider_def: provider definition
        :returns: `woudc_api.plugins.metrics.MetricsProcessor`
        """

        BaseProcessor.__init__(self, provider_def, PROCESS_SETTINGS)

        url_tokens = os.environ.get('WOUDC_API_ES_URL').split('/')

        LOGGER.debug('Setting Elasticsearch properties')
        self.index = 'woudc_data_registry.data_record'
        host = url_tokens[2]

        LOGGER.debug('Host: {}'.format(host))
        LOGGER.debug('Index name: {}'.format(self.index))

        LOGGER.debug('Connecting to Elasticsearch')
        self.es = Elasticsearch(host)

        if not self.es.ping():
            msg = 'Cannot connect to Elasticsearch'
            LOGGER.error(msg)
            raise ProcessorExecuteError(msg)

        LOGGER.debug('Checking Elasticsearch version')
        version = float(self.es.info()['version']['number'][:3])
        if version < 7:
            msg = 'Elasticsearch version below 7 not supported ({})' \
                  .format(version)
            LOGGER.error(msg)
            raise ProcessorExecuteError(msg)
Exemplo n.º 2
0
        def __init__(self, provider_def):
            """
            Initialize object
            :param provider_def: provider definition
            :returns: pygeoapi.process.weather.rdpa_graph.RdpaGraphProcessor
             """

            BaseProcessor.__init__(self, provider_def, PROCESS_METADATA)
Exemplo n.º 3
0
    def __init__(self, provider_def):
        """
        Initialize object
        :param provider_def: provider definition
        :returns: pygeoapi.process.hello_world.HelloWorldProcessor
        """

        BaseProcessor.__init__(self, provider_def, PROCESS_METADATA)
Exemplo n.º 4
0
        def __init__(self, provider_def):
            """
            Initialize object
            :param provider_def: provider definition
            :returns: pygeoapi.process.cccs.raster_drill.RasterDrillProcessor
             """

            BaseProcessor.__init__(self, provider_def, PROCESS_METADATA)
Exemplo n.º 5
0
    def __init__(self, provider_def):
        """
        Initialize object
        :param provider_def: provider definition
        :returns: pygeoapi.process.nldi_delineate.NLDIDelineateProcessor
        """

        BaseProcessor.__init__(self, provider_def, PROCESS_METADATA)
Exemplo n.º 6
0
    def __init__(self, processor_def):
        """
        Initialize object
        :param processor_def: provider definition
        :returns: pygeoapi.process.crs_extent.CRSExtentProcessor
        """

        BaseProcessor.__init__(self, processor_def, PROCESS_METADATA)
    def __init__(self, provider_def):
        """
        Initialize object

        :param provider_def: provider definition

        :returns: pygeoapi.process.wind_calculator_demo.wind_calculator_demo.WindCalculatorDemoProcessor  # noqa
        """

        BaseProcessor.__init__(self, provider_def, PROCESS_METADATA)
Exemplo n.º 8
0
        def __init__(self, provider_def):
            '''
            Initialize object
            :param provider_def: provider definition
            :returns: pygeoapi.process.reproject-coords.WKTReprojectorProcessor
            '''
            # Filter out empty outputs
            metadata = dict(PROCESS_METADATA)
            metadata['outputs'] = list(filter(bool, metadata['outputs']))

            BaseProcessor.__init__(self, provider_def, metadata)
Exemplo n.º 9
0
        def __init__(self, provider_def):
            """
            Initialize object

            :param provider_def: provider definition

            :returns:
            pygeoapi.process.weather.generate_vigilance.GenerateVigilanceProcessor
             """

            BaseProcessor.__init__(self, provider_def, PROCESS_METADATA)