|
| 1 | + |
| 2 | +.. _federation-extension: |
| 3 | + |
| 4 | +=========================== |
| 5 | +openEO Federation Extension |
| 6 | +=========================== |
| 7 | + |
| 8 | + |
| 9 | +The `openEO Federation extension <https://github.com/Open-EO/openeo-api/tree/master/extensions/federation>`_ |
| 10 | +is a set of additional specifications, |
| 11 | +on top of the standard openEO API specification, |
| 12 | +to address the need for extra metadata in the context |
| 13 | +of federated openEO processing, |
| 14 | +where multiple (separately operated) openEO services are bundled together |
| 15 | +behind a single API endpoint. |
| 16 | + |
| 17 | + |
| 18 | +Accessing federation extension metadata |
| 19 | +======================================== |
| 20 | + |
| 21 | +The openEO Python client library provides access to this additional metadata |
| 22 | +in a couple of resources. |
| 23 | + |
| 24 | +.. versionadded:: 0.38.0 |
| 25 | + initial support to access federation extension related metadata. |
| 26 | + |
| 27 | +Backend details |
| 28 | +--------------- |
| 29 | + |
| 30 | +Participating backends in a federation are listed under the ``federation`` field |
| 31 | +of the capabilities document (``GET /``) and can be inspected |
| 32 | +using :py:meth:`OpenEoCapabilities.get_federation() <openeo.rest.capabilities.OpenEoCapabilities.get_federation>`: |
| 33 | + |
| 34 | +.. code-block:: python |
| 35 | +
|
| 36 | + import openeo |
| 37 | + connection = openeo.connect(url=...) |
| 38 | + capabilities = connection.capabilities() |
| 39 | + print("Federated backends:", capabilities.get_federation()) |
| 40 | +
|
| 41 | +
|
| 42 | +Unavailable backends (``federation:missing``) |
| 43 | +---------------------------------------------- |
| 44 | + |
| 45 | +When listing resources like |
| 46 | +collections (with :py:meth:`Connection.list_collections() <openeo.rest.connection.Connection.list_collections>`), |
| 47 | +processes (with :py:meth:`Connection.list_processes() <openeo.rest.connection.Connection.list_processes>`), |
| 48 | +jobs (with :py:meth:`Connection.list_jobs() <openeo.rest.connection.Connection.list_jobs>`), |
| 49 | +etc., |
| 50 | +there might be items missing due to federation participants being temporarily unavailable. |
| 51 | +These missing federation components are listed in the response under the ``federation:missing`` field |
| 52 | +and can be inspected as follows: |
| 53 | + |
| 54 | +.. code-block:: python |
| 55 | +
|
| 56 | + import openeo |
| 57 | + connection = openeo.connect(url=...) |
| 58 | + collections = connection.list_collections() |
| 59 | + print("Number of collections:", len(collections)) |
| 60 | + print("Missing federation components:", collections.ext_federation.missing) |
| 61 | +
|
| 62 | +
|
| 63 | +Note that the ``collections`` object in this example, returned by |
| 64 | +:py:meth:`Connection.list_collections() <openeo.rest.connection.Connection.list_collections>`, |
| 65 | +acts at the surface as a simple list of dictionaries with collection metadata, |
| 66 | +but also provides additional properties/methods like |
| 67 | +:py:attr:`ext_federation <openeo.rest.models.general.CollectionListingResponse.ext_federation>`. |
| 68 | +This is an accessor (an instance of :py:class:`FederationExtension <openeo.rest.models.federation_extension.FederationExtension>`) |
0 commit comments