PostJsonSearch#
- class eodag.plugins.search.qssearch.PostJsonSearch(provider, config)[source]#
A specialisation of a
QueryStringSearchthat uses POST methodAll configuration parameters available for
QueryStringSearchare also available for PostJsonSearch. The mappings given in metadata_mapping are used to construct a (json) body for the POST request that is sent to the provider. Due to the fact that we sent a POST request and not a get request, the pagination configuration will look slightly different. It has the following parameters:- Parameters:
provider (
str) – provider nameconfig (
PluginConfig) –Search plugin configuration:
next_page_query_obj(str): The additional parameters needed to add pagination information to the search request. These parameters won’t be included in result. This must be a json dict formatted like{{"foo":"bar"}}because it will be passed to astr.format()method before being loaded as json.total_items_nb_key_path(str): An XPath or JsonPath leading to the total number of results satisfying a request. This is used for providers which provides the total results metadata along with the result of the query and don’t have an endpoint for querying the number of items satisfying a request, or for providers for which the count endpoint returns a json or xml documentmax_items_per_page(int): The maximum number of items per page that the provider can handle; default:50
- __init__(provider, config)#
- Parameters:
provider (
str)config (
PluginConfig)
Methods
__init__(provider, config)build_query_string(product_type, query_dict)Build The query string using the search parameters
build_sort_by(sort_by_arg)Build the sorting part of the query string or body by transforming the
sort_byargument into a provider-specific string or dictionaryclear()Clear search context
collect_search_urls([prep])Adds pagination to query parameters, and auth to url
count_hits(count_url[, result_type])Count the number of results satisfying some criteria
discover_product_types(**kwargs)Fetch product types list from provider using discover_product_types conf
discover_product_types_per_page(**kwargs)Fetch product types list from provider using discover_product_types conf using paginated
kwargs["fetch_url"]discover_queryables(**kwargs)Fetch queryables list from provider using
discover_queryablesconfdo_search([prep])Perform the actual search request.
get_assets_from_mapping(provider_item)Create assets based on the assets_mapping in the provider's config and an item returned by the provider
get_collections(prep, **kwargs)Get the collection to which the product belongs
get_metadata_mapping([product_type])Get the plugin metadata mapping configuration (product type specific if exists)
get_product_type_cfg_value(key[, default])Get the value of a configuration option specific to the current product type.
get_product_type_def_params(product_type[, ...])Get the provider product type definition parameters and specific settings
get_sort_by_arg(kwargs)Extract the
sort_byargument from the kwargs or the provider default sort configurationlist_queryables(filters, ...[, ...])Get queryables
map_product_type(product_type, **kwargs)Get the provider product type from eodag product type
normalize_results(results, **kwargs)Build EOProducts from provider results
query([prep])Perform a search on an OpenSearch-like interface
queryables_from_metadata_mapping([...])Extract queryable parameters from product type metadata mapping.
validate(search_params, auth)Validate a search request.
Attributes
extract_propertiespluginsauthnext_page_urlnext_page_query_objtotal_items_nbneed_count