geosolutions-it / evo-odas

Code Repository for the EVO-ODAS
https://waffle.io/geosolutions-it/evo-odas
MIT License
31 stars 15 forks source link

get_published_products #266

Closed maabdelghaffar closed 6 years ago

maabdelghaffar commented 6 years ago

This PR includes:

torse commented 6 years ago

Nice. Would it be possible to also implement a "is_product_published" to check if a product with specific ID (e.g. S1B_IW_GRDH_1SDV_20171013T095250_20171013T095315_007809_00DCB4_7722) is already published? I am afraid that the get_published_products will get big over time (with hundereds/thousand new products each day..)

maabdelghaffar commented 6 years ago

Yes sure

maabdelghaffar commented 6 years ago

Yes log message updated and product_id will be included in the geoserver_rest_endpoint

torse commented 6 years ago

Ah, ok. I would have make the function explicit (..,collection_id,product_id) and building the url within instead of building the url outside the function. @randomorder: what do you think?

randomorder commented 6 years ago

@torse @maabdelghaffar I agree with @torse One more thing: Currently on error returns None.

  elif r.status_code    != 200 and r.status_code != 404:
        log.info("Request failed")
       return None

I think it would be better to raise an exception and let the caller decide what to do. Take a look at what we do for the publishing function here: https://github.com/geosolutions-it/evo-odas/blob/master/airflow/plugins/geoserver_plugin.py#L261

randomorder commented 6 years ago

Duplicated PR #270