openeo-python-client icon indicating copy to clipboard operation
openeo-python-client copied to clipboard

How to get "Open-EO-Costs" from synchronous `download`

Open soxofaan opened this issue 1 year ago • 4 comments

The response of synchronous processing (https://api.openeo.org/#tag/Data-Processing/operation/compute-result) has an optional "OpenEO-Costs" header with processing costs.

How could we expose that to user from a simple cube.download() call?

soxofaan avatar Apr 24 '24 12:04 soxofaan

(Same question for the optional "Link" header in synchronous processing response, but I don't think there are implementations of that in the wild yet)

soxofaan avatar Apr 24 '24 12:04 soxofaan

:eyes:

I was also thinking of the Request-Id header for debugging (successful) requests; looks like an easier version of the Link header.

bossie avatar May 03 '24 09:05 bossie

and related, here I propose to add a OpenEO-Identifier header for sync requests to align better with batch job creation:

  • https://github.com/Open-EO/openeo-api/pull/533

soxofaan avatar May 03 '24 10:05 soxofaan

(Same question for the optional "Link" header in synchronous processing response, but I don't think there are implementations of that in the wild yet)

The Google Earth Engine driver implements it if you want to test it.

m-mohr avatar Jun 17 '24 08:06 m-mohr

https://github.com/Open-EO/openeo-api/pull/533 was just merged, so the "OpenEO-Identifier" header (which should hold request id) is within the "official" scope of this feature request as well

soxofaan avatar Jan 13 '25 17:01 soxofaan

as generic solution, I added to the download methods an on_response_headers argument to handle the response headers e.g. to just print them: cube.download(..., on_response_headers=print)

soxofaan avatar Mar 27 '25 11:03 soxofaan

I think that's enough for now

soxofaan avatar Mar 27 '25 11:03 soxofaan