weaver.processes.opensearch
¶
Module Contents¶
-
weaver.processes.opensearch.
alter_payload_after_query
(payload)[source]¶ When redeploying the package on ADES, strip out any EOImage parameter
Parameters: payload –
-
weaver.processes.opensearch.
query_eo_images_from_wps_inputs
(wps_inputs, eoimage_source_info, accept_mime_types) → Dict[str, Deque][source]¶ Query OpenSearch using parameters in inputs and return file links.
eoimage_ids is used to identify if a certain input is an eoimage.
Parameters: - wps_inputs – inputs containing info to query
- eoimage_source_info – data source info of eoimages
- accept_mime_types – dict of list of accepted mime types, ordered by preference
-
weaver.processes.opensearch.
replace_with_opensearch_scheme
(link)[source]¶ Parameters: link – url to replace scheme
-
weaver.processes.opensearch.
load_wkt
(wkt)[source]¶ Parameters: wkt (string) – to get the bounding box of
-
class
weaver.processes.opensearch.
OpenSearchQuery
(collection_identifier, osdd_url, catalog_search_field='parentIdentifier')[source]¶ Bases:
object
Parameters: - collection_identifier – Collection ID to query
- osdd_url – Global OSDD url for opensearch queries.
- catalog_search_field – Name of the field for the collection identifier.
-
_prepare_query_url
(self, template_url, params)[source]¶ Parameters: - template_url – url containing query parameters
- params – parameters to insert in formatted url
-
static
_requests_get_retry
(*args, **kwargs)[source]¶ Retry a requests.get call
Parameters: - args – passed to requests.get
- kwargs – passed to requests.get
-
query_datasets
(self, params, accept_schemes, accept_mime_types)[source]¶ 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)
Parameters: - params – query parameters
- accept_schemes – only return links of this scheme
- accept_mime_types – list of accepted mime types, ordered by preference
Raises: KeyError – If the feature doesn’t contain a json data section or an atom alternative link
-
weaver.processes.opensearch.
get_additional_parameters
(input_data) → List[Tuple[str, str]][source]¶ Parameters: input_data – Dict containing or not the “additionalParameters” key
-
weaver.processes.opensearch.
get_eo_images_inputs_from_payload
(payload)[source]¶ Parameters: payload –
-
weaver.processes.opensearch.
get_original_collection_id
(payload, wps_inputs) → Dict[str, deque][source]¶ 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:
-
weaver.processes.opensearch.
get_eo_images_data_sources
(payload, wps_inputs) → Dict[str, Dict][source]¶ Parameters: - payload – Deploy payload
- wps_inputs – Execute inputs
-
weaver.processes.opensearch.
get_eo_images_mime_types
(payload) → Dict[str, List][source]¶ From the deploy payload, get the accepted mime types. :param payload: Deploy payload
-
weaver.processes.opensearch.
insert_max_occurs
(payload, wps_inputs) → None[source]¶ Insert maxOccurs value in wps inputs using the deploy payload. :param payload: Deploy payload :param wps_inputs: WPS inputs