:mod:`weaver.processes.opensearch` ================================== .. py:module:: weaver.processes.opensearch Module Contents --------------- .. data:: LOGGER .. function:: alter_payload_after_query(payload) When redeploying the package on ADES, strip out any EOImage parameter :param payload: .. function:: validate_bbox(bbox) .. function:: query_eo_images_from_wps_inputs(wps_inputs, eoimage_source_info, accept_mime_types) -> Dict[str, Deque] Query OpenSearch using parameters in inputs and return file links. eoimage_ids is used to identify if a certain input is an eoimage. :param wps_inputs: inputs containing info to query :param eoimage_source_info: data source info of eoimages :param accept_mime_types: dict of list of accepted mime types, ordered by preference .. function:: replace_with_opensearch_scheme(link) :param link: url to replace scheme .. function:: load_wkt(wkt) :param wkt: to get the bounding box of :type wkt: string .. py:class:: OpenSearchQuery(collection_identifier, osdd_url, catalog_search_field='parentIdentifier') Bases: :class:`object` :param collection_identifier: Collection ID to query :param osdd_url: Global OSDD url for opensearch queries. :param catalog_search_field: Name of the field for the collection identifier. .. attribute:: DEFAULT_MAX_QUERY_RESULTS :annotation: = 5 .. method:: get_template_url(self) .. method:: _prepare_query_url(self, template_url, params) :param template_url: url containing query parameters :param params: parameters to insert in formatted url .. staticmethod:: _fetch_datatsets_from_alternates_links(alternate_links) .. staticmethod:: _requests_get_retry(*args, **kwargs) Retry a requests.get call :param args: passed to requests.get :param kwargs: passed to requests.get .. method:: _query_features_paginated(self, params) :param params: query parameters .. method:: query_datasets(self, params, accept_schemes, accept_mime_types) Loop on every opensearch result feature and yield url matching required mimetype and scheme. Log a warning if a feature cannot yield a valid url (either no compatible mimetype or scheme) :param params: query parameters :param accept_schemes: only return links of this scheme :param accept_mime_types: list of accepted mime types, ordered by preference :raise KeyError: If the feature doesn't contain a json data section or an atom alternative link .. function:: get_additional_parameters(input_data) -> List[Tuple[str, str]] :param input_data: Dict containing or not the "additionalParameters" key .. py:class:: EOImageDescribeProcessHandler(inputs) Bases: :class:`object` .. staticmethod:: is_eoimage_input(input_data) .. staticmethod:: get_allowed_collections(input_data) .. staticmethod:: make_aoi(id_) .. staticmethod:: make_collection(identifier, allowed_values) .. staticmethod:: make_toi(id_, start_date=True) :param id_: :param start_date: (Default value = True) .. method:: to_opensearch(self, unique_aoi, unique_toi) :param unique_aoi: :param unique_toi: .. function:: get_eo_images_inputs_from_payload(payload) :param payload: .. function:: get_original_collection_id(payload, wps_inputs) -> Dict[str, deque] When we deploy a Process that contains OpenSearch parameters, the collection identifier is modified. Ex: files -> collection Ex: s2 -> collection_s2, probav -> collection_probav This function changes the id in the execute request to the one in the deploy description. :param payload: :param wps_inputs: :return: .. function:: get_eo_images_data_sources(payload, wps_inputs) -> Dict[str, Dict] :param payload: Deploy payload :param wps_inputs: Execute inputs .. function:: get_eo_images_mime_types(payload) -> Dict[str, List] From the deploy payload, get the accepted mime types. :param payload: Deploy payload .. function:: insert_max_occurs(payload, wps_inputs) -> None Insert maxOccurs value in wps inputs using the deploy payload. :param payload: Deploy payload :param wps_inputs: WPS inputs .. function:: modified_collection_identifiers(eo_image_identifiers) .. function:: get_data_source(collection_id) .. function:: get_eo_images_ids_from_payload(payload) .. function:: replace_inputs_describe_process(inputs, payload) -> List[Dict] Replace ``EOImage`` inputs (if ``additionalParameter -> EOImage -> true``) with `OpenSearch` query parameters. .. function:: _make_specific_identifier(param_name, identifier) Only adds an underscore between the parameters.