diff --git a/api/python/doctrees/environment.pickle b/api/python/doctrees/environment.pickle index a78873861..dd55e815d 100644 Binary files a/api/python/doctrees/environment.pickle and b/api/python/doctrees/environment.pickle differ diff --git a/api/python/doctrees/generated/rs_server_adgs/rs_server_adgs.api.doctree b/api/python/doctrees/generated/rs_server_adgs/rs_server_adgs.api.doctree index 549fd5699..edd0cb02b 100644 Binary files a/api/python/doctrees/generated/rs_server_adgs/rs_server_adgs.api.doctree and b/api/python/doctrees/generated/rs_server_adgs/rs_server_adgs.api.doctree differ diff --git a/api/python/doctrees/generated/rs_server_adgs/rs_server_adgs.doctree b/api/python/doctrees/generated/rs_server_adgs/rs_server_adgs.doctree index aaf08daa4..362748afe 100644 Binary files a/api/python/doctrees/generated/rs_server_adgs/rs_server_adgs.doctree and b/api/python/doctrees/generated/rs_server_adgs/rs_server_adgs.doctree differ diff --git a/api/python/doctrees/generated/rs_server_cadip/rs_server_cadip.api.doctree b/api/python/doctrees/generated/rs_server_cadip/rs_server_cadip.api.doctree index 5c4c9fbfb..9e80ee92d 100644 Binary files a/api/python/doctrees/generated/rs_server_cadip/rs_server_cadip.api.doctree and b/api/python/doctrees/generated/rs_server_cadip/rs_server_cadip.api.doctree differ diff --git a/api/python/doctrees/generated/rs_server_cadip/rs_server_cadip.doctree b/api/python/doctrees/generated/rs_server_cadip/rs_server_cadip.doctree index a46fd567d..ab6144157 100644 Binary files a/api/python/doctrees/generated/rs_server_cadip/rs_server_cadip.doctree and b/api/python/doctrees/generated/rs_server_cadip/rs_server_cadip.doctree differ diff --git a/api/python/doctrees/generated/rs_server_catalog/rs_server_catalog.doctree b/api/python/doctrees/generated/rs_server_catalog/rs_server_catalog.doctree index e74278dd6..f849eb87e 100644 Binary files a/api/python/doctrees/generated/rs_server_catalog/rs_server_catalog.doctree and b/api/python/doctrees/generated/rs_server_catalog/rs_server_catalog.doctree differ diff --git a/api/python/doctrees/generated/rs_server_common/rs_server_common.data_retrieval.doctree b/api/python/doctrees/generated/rs_server_common/rs_server_common.data_retrieval.doctree index c07a3fc3d..bef69215c 100644 Binary files a/api/python/doctrees/generated/rs_server_common/rs_server_common.data_retrieval.doctree and b/api/python/doctrees/generated/rs_server_common/rs_server_common.data_retrieval.doctree differ diff --git a/api/python/doctrees/generated/rs_server_common/rs_server_common.db.models.doctree b/api/python/doctrees/generated/rs_server_common/rs_server_common.db.models.doctree index 739d7058a..552d9f9d4 100644 Binary files a/api/python/doctrees/generated/rs_server_common/rs_server_common.db.models.doctree and b/api/python/doctrees/generated/rs_server_common/rs_server_common.db.models.doctree differ diff --git a/api/python/doctrees/generated/rs_server_common/rs_server_common.doctree b/api/python/doctrees/generated/rs_server_common/rs_server_common.doctree index 34d1e1fe6..2a6f49057 100644 Binary files a/api/python/doctrees/generated/rs_server_common/rs_server_common.doctree and b/api/python/doctrees/generated/rs_server_common/rs_server_common.doctree differ diff --git a/api/python/doctrees/generated/rs_server_common/rs_server_common.s3_storage_handler.doctree b/api/python/doctrees/generated/rs_server_common/rs_server_common.s3_storage_handler.doctree index 7f42cd5e0..f0dd645cc 100644 Binary files a/api/python/doctrees/generated/rs_server_common/rs_server_common.s3_storage_handler.doctree and b/api/python/doctrees/generated/rs_server_common/rs_server_common.s3_storage_handler.doctree differ diff --git a/api/python/doctrees/generated/rs_server_common/rs_server_common.schemas.doctree b/api/python/doctrees/generated/rs_server_common/rs_server_common.schemas.doctree index 1ff67ffa7..27905f04b 100644 Binary files a/api/python/doctrees/generated/rs_server_common/rs_server_common.schemas.doctree and b/api/python/doctrees/generated/rs_server_common/rs_server_common.schemas.doctree differ diff --git a/api/python/doctrees/generated/rs_server_common/rs_server_common.utils.doctree b/api/python/doctrees/generated/rs_server_common/rs_server_common.utils.doctree index 9f17c13ed..dffd959c3 100644 Binary files a/api/python/doctrees/generated/rs_server_common/rs_server_common.utils.doctree and b/api/python/doctrees/generated/rs_server_common/rs_server_common.utils.doctree differ diff --git a/api/python/html/.buildinfo b/api/python/html/.buildinfo index adc63a410..23f36e277 100644 --- a/api/python/html/.buildinfo +++ b/api/python/html/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: bd938ec3361617b4f802706a8c211fc8 +config: 75b8300648854b99db7f447bcd483ae8 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/api/python/html/_sources/generated/rs_server_catalog/rs_server_catalog.rst.txt b/api/python/html/_sources/generated/rs_server_catalog/rs_server_catalog.rst.txt index d11d364f9..2c18ea12a 100644 --- a/api/python/html/_sources/generated/rs_server_catalog/rs_server_catalog.rst.txt +++ b/api/python/html/_sources/generated/rs_server_catalog/rs_server_catalog.rst.txt @@ -4,6 +4,14 @@ rs\_server\_catalog package Submodules ---------- +rs\_server\_catalog.authentication\_catalog module +-------------------------------------------------- + +.. automodule:: rs_server_catalog.authentication_catalog + :members: + :undoc-members: + :show-inheritance: + rs\_server\_catalog.landing\_page module ---------------------------------------- @@ -20,6 +28,14 @@ rs\_server\_catalog.main module :undoc-members: :show-inheritance: +rs\_server\_catalog.response\_manager module +-------------------------------------------- + +.. automodule:: rs_server_catalog.response_manager + :members: + :undoc-members: + :show-inheritance: + rs\_server\_catalog.user\_catalog module ---------------------------------------- diff --git a/api/python/html/_sources/generated/rs_server_common/rs_server_common.utils.rst.txt b/api/python/html/_sources/generated/rs_server_common/rs_server_common.utils.rst.txt index 37560937e..e636bd17f 100644 --- a/api/python/html/_sources/generated/rs_server_common/rs_server_common.utils.rst.txt +++ b/api/python/html/_sources/generated/rs_server_common/rs_server_common.utils.rst.txt @@ -12,10 +12,10 @@ rs\_server\_common.utils.logging module :undoc-members: :show-inheritance: -rs\_server\_common.utils.provider\_ws\_address module ------------------------------------------------------ +rs\_server\_common.utils.opentelemetry module +--------------------------------------------- -.. automodule:: rs_server_common.utils.provider_ws_address +.. automodule:: rs_server_common.utils.opentelemetry :members: :undoc-members: :show-inheritance: diff --git a/api/python/html/_static/basic.css b/api/python/html/_static/basic.css index 30fee9d0f..f316efcb4 100644 --- a/api/python/html/_static/basic.css +++ b/api/python/html/_static/basic.css @@ -4,7 +4,7 @@ * * Sphinx stylesheet -- basic theme. * - * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ diff --git a/api/python/html/_static/doctools.js b/api/python/html/_static/doctools.js index d06a71d75..4d67807d1 100644 --- a/api/python/html/_static/doctools.js +++ b/api/python/html/_static/doctools.js @@ -4,7 +4,7 @@ * * Base JavaScript utilities for all Sphinx HTML documentation. * - * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ diff --git a/api/python/html/_static/language_data.js b/api/python/html/_static/language_data.js index 250f5665f..367b8ed81 100644 --- a/api/python/html/_static/language_data.js +++ b/api/python/html/_static/language_data.js @@ -5,7 +5,7 @@ * This script contains the language-specific data used by searchtools.js, * namely the list of stopwords, stemmer, scorer and splitter. * - * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -13,7 +13,7 @@ var stopwords = ["a", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "it", "near", "no", "not", "of", "on", "or", "such", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with"]; -/* Non-minified version is copied as a separate JS file, is available */ +/* Non-minified version is copied as a separate JS file, if available */ /** * Porter Stemmer diff --git a/api/python/html/_static/searchtools.js b/api/python/html/_static/searchtools.js index 7918c3fab..92da3f8b2 100644 --- a/api/python/html/_static/searchtools.js +++ b/api/python/html/_static/searchtools.js @@ -4,7 +4,7 @@ * * Sphinx JavaScript utilities for the full-text search. * - * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -99,7 +99,7 @@ const _displayItem = (item, searchTerms, highlightTerms) => { .then((data) => { if (data) listItem.appendChild( - Search.makeSearchSummary(data, searchTerms) + Search.makeSearchSummary(data, searchTerms, anchor) ); // highlight search terms in the summary if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js @@ -116,8 +116,8 @@ const _finishSearch = (resultCount) => { ); else Search.status.innerText = _( - `Search finished, found ${resultCount} page(s) matching the search query.` - ); + "Search finished, found ${resultCount} page(s) matching the search query." + ).replace('${resultCount}', resultCount); }; const _displayNextItem = ( results, @@ -137,6 +137,22 @@ const _displayNextItem = ( // search finished, update title and status message else _finishSearch(resultCount); }; +// Helper function used by query() to order search results. +// Each input is an array of [docname, title, anchor, descr, score, filename]. +// Order the results by score (in opposite order of appearance, since the +// `_displayNextItem` function uses pop() to retrieve items) and then alphabetically. +const _orderResultsByScoreThenName = (a, b) => { + const leftScore = a[4]; + const rightScore = b[4]; + if (leftScore === rightScore) { + // same score: sort alphabetically + const leftTitle = a[1].toLowerCase(); + const rightTitle = b[1].toLowerCase(); + if (leftTitle === rightTitle) return 0; + return leftTitle > rightTitle ? -1 : 1; // inverted is intentional + } + return leftScore > rightScore ? 1 : -1; +}; /** * Default splitQuery function. Can be overridden in ``sphinx.search`` with a @@ -160,13 +176,26 @@ const Search = { _queued_query: null, _pulse_status: -1, - htmlToText: (htmlString) => { + htmlToText: (htmlString, anchor) => { const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html'); - htmlElement.querySelectorAll(".headerlink").forEach((el) => { el.remove() }); + for (const removalQuery of [".headerlinks", "script", "style"]) { + htmlElement.querySelectorAll(removalQuery).forEach((el) => { el.remove() }); + } + if (anchor) { + const anchorContent = htmlElement.querySelector(`[role="main"] ${anchor}`); + if (anchorContent) return anchorContent.textContent; + + console.warn( + `Anchored content block not found. Sphinx search tries to obtain it via DOM query '[role=main] ${anchor}'. Check your theme or template.` + ); + } + + // if anchor not specified or not found, fall back to main content const docContent = htmlElement.querySelector('[role="main"]'); - if (docContent !== undefined) return docContent.textContent; + if (docContent) return docContent.textContent; + console.warn( - "Content block not found. Sphinx search tries to obtain it via '[role=main]'. Could you check your theme or template." + "Content block not found. Sphinx search tries to obtain it via DOM query '[role=main]'. Check your theme or template." ); return ""; }, @@ -239,16 +268,7 @@ const Search = { else Search.deferQuery(query); }, - /** - * execute search (requires search index to be loaded) - */ - query: (query) => { - const filenames = Search._index.filenames; - const docNames = Search._index.docnames; - const titles = Search._index.titles; - const allTitles = Search._index.alltitles; - const indexEntries = Search._index.indexentries; - + _parseQuery: (query) => { // stem the search terms and add them to the correct list const stemmer = new Stemmer(); const searchTerms = new Set(); @@ -284,16 +304,32 @@ const Search = { // console.info("required: ", [...searchTerms]); // console.info("excluded: ", [...excludedTerms]); - // array of [docname, title, anchor, descr, score, filename] - let results = []; + return [query, searchTerms, excludedTerms, highlightTerms, objectTerms]; + }, + + /** + * execute search (requires search index to be loaded) + */ + _performSearch: (query, searchTerms, excludedTerms, highlightTerms, objectTerms) => { + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const titles = Search._index.titles; + const allTitles = Search._index.alltitles; + const indexEntries = Search._index.indexentries; + + // Collect multiple result groups to be sorted separately and then ordered. + // Each is an array of [docname, title, anchor, descr, score, filename]. + const normalResults = []; + const nonMainIndexResults = []; + _removeChildren(document.getElementById("search-progress")); - const queryLower = query.toLowerCase(); + const queryLower = query.toLowerCase().trim(); for (const [title, foundTitles] of Object.entries(allTitles)) { - if (title.toLowerCase().includes(queryLower) && (queryLower.length >= title.length/2)) { + if (title.toLowerCase().trim().includes(queryLower) && (queryLower.length >= title.length/2)) { for (const [file, id] of foundTitles) { let score = Math.round(100 * queryLower.length / title.length) - results.push([ + normalResults.push([ docNames[file], titles[file] !== title ? `${titles[file]} > ${title}` : title, id !== null ? "#" + id : "", @@ -308,46 +344,47 @@ const Search = { // search for explicit entries in index directives for (const [entry, foundEntries] of Object.entries(indexEntries)) { if (entry.includes(queryLower) && (queryLower.length >= entry.length/2)) { - for (const [file, id] of foundEntries) { - let score = Math.round(100 * queryLower.length / entry.length) - results.push([ + for (const [file, id, isMain] of foundEntries) { + const score = Math.round(100 * queryLower.length / entry.length); + const result = [ docNames[file], titles[file], id ? "#" + id : "", null, score, filenames[file], - ]); + ]; + if (isMain) { + normalResults.push(result); + } else { + nonMainIndexResults.push(result); + } } } } // lookup as object objectTerms.forEach((term) => - results.push(...Search.performObjectSearch(term, objectTerms)) + normalResults.push(...Search.performObjectSearch(term, objectTerms)) ); // lookup as search terms in fulltext - results.push(...Search.performTermsSearch(searchTerms, excludedTerms)); + normalResults.push(...Search.performTermsSearch(searchTerms, excludedTerms)); // let the scorer override scores with a custom scoring function - if (Scorer.score) results.forEach((item) => (item[4] = Scorer.score(item))); - - // now sort the results by score (in opposite order of appearance, since the - // display function below uses pop() to retrieve items) and then - // alphabetically - results.sort((a, b) => { - const leftScore = a[4]; - const rightScore = b[4]; - if (leftScore === rightScore) { - // same score: sort alphabetically - const leftTitle = a[1].toLowerCase(); - const rightTitle = b[1].toLowerCase(); - if (leftTitle === rightTitle) return 0; - return leftTitle > rightTitle ? -1 : 1; // inverted is intentional - } - return leftScore > rightScore ? 1 : -1; - }); + if (Scorer.score) { + normalResults.forEach((item) => (item[4] = Scorer.score(item))); + nonMainIndexResults.forEach((item) => (item[4] = Scorer.score(item))); + } + + // Sort each group of results by score and then alphabetically by name. + normalResults.sort(_orderResultsByScoreThenName); + nonMainIndexResults.sort(_orderResultsByScoreThenName); + + // Combine the result groups in (reverse) order. + // Non-main index entries are typically arbitrary cross-references, + // so display them after other results. + let results = [...nonMainIndexResults, ...normalResults]; // remove duplicate search results // note the reversing of results, so that in the case of duplicates, the highest-scoring entry is kept @@ -361,7 +398,12 @@ const Search = { return acc; }, []); - results = results.reverse(); + return results.reverse(); + }, + + query: (query) => { + const [searchQuery, searchTerms, excludedTerms, highlightTerms, objectTerms] = Search._parseQuery(query); + const results = Search._performSearch(searchQuery, searchTerms, excludedTerms, highlightTerms, objectTerms); // for debugging //Search.lastresults = results.slice(); // a copy @@ -466,14 +508,18 @@ const Search = { // add support for partial matches if (word.length > 2) { const escapedWord = _escapeRegExp(word); - Object.keys(terms).forEach((term) => { - if (term.match(escapedWord) && !terms[word]) - arr.push({ files: terms[term], score: Scorer.partialTerm }); - }); - Object.keys(titleTerms).forEach((term) => { - if (term.match(escapedWord) && !titleTerms[word]) - arr.push({ files: titleTerms[word], score: Scorer.partialTitle }); - }); + if (!terms.hasOwnProperty(word)) { + Object.keys(terms).forEach((term) => { + if (term.match(escapedWord)) + arr.push({ files: terms[term], score: Scorer.partialTerm }); + }); + } + if (!titleTerms.hasOwnProperty(word)) { + Object.keys(titleTerms).forEach((term) => { + if (term.match(escapedWord)) + arr.push({ files: titleTerms[term], score: Scorer.partialTitle }); + }); + } } // no match but word was a required one @@ -496,9 +542,8 @@ const Search = { // create the mapping files.forEach((file) => { - if (fileMap.has(file) && fileMap.get(file).indexOf(word) === -1) - fileMap.get(file).push(word); - else fileMap.set(file, [word]); + if (!fileMap.has(file)) fileMap.set(file, [word]); + else if (fileMap.get(file).indexOf(word) === -1) fileMap.get(file).push(word); }); }); @@ -549,8 +594,8 @@ const Search = { * search summary for a given text. keywords is a list * of stemmed words. */ - makeSearchSummary: (htmlText, keywords) => { - const text = Search.htmlToText(htmlText); + makeSearchSummary: (htmlText, keywords, anchor) => { + const text = Search.htmlToText(htmlText, anchor); if (text === "") return null; const textLower = text.toLowerCase(); diff --git a/api/python/html/generated/rs_server_adgs/modules.html b/api/python/html/generated/rs_server_adgs/modules.html index 3f623a106..72ef65085 100644 --- a/api/python/html/generated/rs_server_adgs/modules.html +++ b/api/python/html/generated/rs_server_adgs/modules.html @@ -16,7 +16,7 @@ - + diff --git a/api/python/html/generated/rs_server_adgs/rs_server_adgs.api.html b/api/python/html/generated/rs_server_adgs/rs_server_adgs.api.html index c908beb8c..21db08e59 100644 --- a/api/python/html/generated/rs_server_adgs/rs_server_adgs.api.html +++ b/api/python/html/generated/rs_server_adgs/rs_server_adgs.api.html @@ -16,7 +16,7 @@ - + diff --git a/api/python/html/generated/rs_server_adgs/rs_server_adgs.fastapi.html b/api/python/html/generated/rs_server_adgs/rs_server_adgs.fastapi.html index 40cdb0a81..bb97848b3 100644 --- a/api/python/html/generated/rs_server_adgs/rs_server_adgs.fastapi.html +++ b/api/python/html/generated/rs_server_adgs/rs_server_adgs.fastapi.html @@ -16,7 +16,7 @@ - + diff --git a/api/python/html/generated/rs_server_adgs/rs_server_adgs.html b/api/python/html/generated/rs_server_adgs/rs_server_adgs.html index 0a73aabb8..ea52b52c2 100644 --- a/api/python/html/generated/rs_server_adgs/rs_server_adgs.html +++ b/api/python/html/generated/rs_server_adgs/rs_server_adgs.html @@ -16,7 +16,7 @@ - + diff --git a/api/python/html/generated/rs_server_cadip/modules.html b/api/python/html/generated/rs_server_cadip/modules.html index 7dd9c072a..d30b95033 100644 --- a/api/python/html/generated/rs_server_cadip/modules.html +++ b/api/python/html/generated/rs_server_cadip/modules.html @@ -16,7 +16,7 @@ - + diff --git a/api/python/html/generated/rs_server_cadip/rs_server_cadip.api.html b/api/python/html/generated/rs_server_cadip/rs_server_cadip.api.html index a55b50b48..13593b068 100644 --- a/api/python/html/generated/rs_server_cadip/rs_server_cadip.api.html +++ b/api/python/html/generated/rs_server_cadip/rs_server_cadip.api.html @@ -16,7 +16,7 @@ - + diff --git a/api/python/html/generated/rs_server_cadip/rs_server_cadip.fastapi.html b/api/python/html/generated/rs_server_cadip/rs_server_cadip.fastapi.html index 6486a5545..f13734f79 100644 --- a/api/python/html/generated/rs_server_cadip/rs_server_cadip.fastapi.html +++ b/api/python/html/generated/rs_server_cadip/rs_server_cadip.fastapi.html @@ -16,7 +16,7 @@ - + diff --git a/api/python/html/generated/rs_server_cadip/rs_server_cadip.html b/api/python/html/generated/rs_server_cadip/rs_server_cadip.html index 6827d2ab7..283f4241a 100644 --- a/api/python/html/generated/rs_server_cadip/rs_server_cadip.html +++ b/api/python/html/generated/rs_server_cadip/rs_server_cadip.html @@ -16,7 +16,7 @@ - + @@ -208,7 +208,7 @@
station – the station to interact with.
+station – the station to interact with: ns, mps, mti, nsg, sgs, cadip(?)
the EodagProvider initialized
diff --git a/api/python/html/generated/rs_server_catalog/modules.html b/api/python/html/generated/rs_server_catalog/modules.html index 4ac23fdfe..6ece3c5d8 100644 --- a/api/python/html/generated/rs_server_catalog/modules.html +++ b/api/python/html/generated/rs_server_catalog/modules.html @@ -16,7 +16,7 @@ - + @@ -86,8 +86,10 @@EodagProvider.create_eodag_product()
EodagProvider.download()
EodagProvider.init_eodag_client()
EodagProvider.lock
S3StorageHandler.check_bucket_access()
S3StorageHandler.check_file_overwriting()
S3StorageHandler.connect_s3()
S3StorageHandler.delete_bucket_completely()
S3StorageHandler.delete_file_from_s3()
S3StorageHandler.disconnect_s3()
S3StorageHandler.files_to_be_downloaded()
S3StorageHandler.files_to_be_uploaded()
S3StorageHandler.get_basename()
S3StorageHandler.get_keys_from_s3()
S3StorageHandler.get_s3_data()
S3StorageHandler.get_secrets()
S3StorageHandler.get_secrets_from_file()
S3StorageHandler.list_s3_files_obj()
S3StorageHandler.put_files_to_s3()
S3StorageHandler.s3_path_parser()
S3StorageHandler.transfer_from_s3_to_s3()
S3StorageHandler.wait_timeout()
station_to_server_url()
FastAPI Security dependency for the cluster mode. Check the api key validity, passed as an HTTP header.
apikey_value (Security) – API key passed in header,
+apikey_header (Security) – API key passed in HTTP header
Tuple of (IAM roles, config) information from the keycloak server, associated with the api key.
@@ -377,7 +375,7 @@station (str) – The station name.
station (str) – The station name = adgs or cadip
access_type (str) – The type of access.
api_version (str) – version of our application (not the version of the OpenAPI specification
used) (nor the version of FastAPI being) –
used) (nor the version of FastAPI being)
routers (list[APIRouter]) – list of FastAPI routers to add to the application.
init_db (bool) – should we init the database session ?
timeout (int) – timeout in seconds to wait for the database connection.
Store diverse objects and values used throughout the application.
-Return ‘not local_mode()’
-Return True if the ‘RSPY_LOCAL_MODE’ environemnt variable is set to 1, true or yes (case insensitive). -By default: if not set or set to a different value, return False.
-Check whether a file already exists at the specified local path and handles overwriting.
-Parameters: -- local_file (str): The local file path to check. -- overwrite (bool): A flag indicating whether to overwrite the existing file if found. -- logger (Logger): The logger object for logging messages.
-Returns: -bool: True if overwriting is allowed or if the file doesn’t exist, False otherwise.
+Check if file exists and determine if it should be overwritten.
+local_file (str) – Path to the local file.
overwrite (bool) – Whether to overwrite the existing file.
True if the file should be overwritten, False otherwise.
+bool
+Note: -- If the file already exists and the overwrite flag is set to True, the function will log a message, -delete the existing file, and return True. -- If the file already exists and the overwrite flag is set to False, the function will log a warning -message, and return False. In this case, the existing file won’t be deleted. -- If the file doesn’t exist, the function will return True.
+- If the file already exists and the overwrite flag is set to True, the function logs a message, +deletes the existing file, and returns True. +- If the file already exists and the overwrite flag is set to False, the function logs a warning +message, and returns False. In this case, the existing file won’t be deleted. +- If the file doesn’t exist, the function returns True.Utils function used to remove a s3 bucket even if not empty
-RuntimeError – If an error occurs during the bucket access check.
+Create a list of S3 keys to be downloaded.
+Create a list with the S3 keys to be downloaded.
The list will have the s3 keys to be downloaded from the bucket. It contains pairs (local_prefix_where_the_file_will_be_downloaded, full_s3_key_path) If a s3 key doesn’t exist, the pair will be (None, requested_s3_key_path)
@@ -416,7 +421,7 @@Creates a list of local files to be uploaded.
+Creates a list with the local files to be uploaded.
The list contains pairs (s3_path, absolute_local_file_path) If the local file doesn’t exist, the pair will be (None, requested_file_to_upload)
Parses S3 URL to extract bucket, prefix, and file.
-s3_url (str) – The S3 URL.
-Tuple containing bucket, prefix, and file.
-tuple
-Read secrets from a specified file.
It reads the secrets from .s3cfg or aws credentials files This function should not be used in production
@@ -547,6 +535,23 @@Parses S3 URL to extract bucket, prefix, and file.
+s3_url (str) – The S3 URL.
+Tuple containing bucket, prefix, and file.
+tuple
+Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
diff --git a/api/python/html/generated/rs_server_common/rs_server_common.utils.html b/api/python/html/generated/rs_server_common/rs_server_common.utils.html index 9d951c9d8..9335b39e3 100644 --- a/api/python/html/generated/rs_server_common/rs_server_common.utils.html +++ b/api/python/html/generated/rs_server_common/rs_server_common.utils.html @@ -16,7 +16,7 @@ - + @@ -167,29 +167,19 @@TODO Docstring will be added here
+OpenTelemetry utility
Retrieve the configuration data (webserver address) for a CADIP station based on its identifier.
-Notes
-The station identifier is case-insensitive and is converted to uppercase for matching.
The function reads the station configuration data from a JSON file.
If the station identifier is not found in the configuration data, the function returns None.
Init instrumentation of OpenTelemetry traces.
station (str) – Identifier for the CADIP station.
-A str containing the webserver address for the specified station, -or None if the station identifier is not found.
-str or None
+app (fastapi.FastAPI) – FastAPI application
service_name (str) – service name
rs_server_common.utils.provider_ws_address
rs_server_common.utils.opentelemetry