diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 24809ede..1f305979 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -12,10 +12,10 @@ jobs: steps: - name: Inject env variables uses: rlespinasse/github-slug-action@v3.x - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v3 with: - node-version: '16' - - uses: actions/checkout@v2 + node-version: 'lts/*' + - uses: actions/checkout@v3 - run: | npm install npm run build diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b61f951c..64b0febd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,12 +3,11 @@ on: [push, pull_request] jobs: deploy: runs-on: ubuntu-latest - strategy: - matrix: - node-version: [14.x] steps: - - uses: actions/setup-node@v1 - - uses: actions/checkout@v2 + - uses: actions/setup-node@v3 + with: + node-version: 'lts/*' + - uses: actions/checkout@v3 - name: Run tests run: | npm install diff --git a/.spectral.yml b/.spectral.yml index 0f3ff244..cfe29b52 100644 --- a/.spectral.yml +++ b/.spectral.yml @@ -1,27 +1,15 @@ extends: "spectral:oas" -# don't error on circular schemas, these are currently not supported by spectral -# https://github.com/stoplightio/spectral/issues/894 +# Work around broken rules: https://github.com/stoplightio/spectral/issues/1972 except: - "openapi.yaml#/components/schemas/process_graph/example": + "openapi.yaml#/paths/~1udf_runtimes/get/responses/200/content/application~1json/example": - oas3-valid-schema-example - "openapi.yaml#/paths/~1processes/get/responses/200/content/application~1json/example": - - oas3-valid-oas-content-example - "openapi.yaml#/paths/~1process_graphs/get/responses/200/content/application~1json/example": - - oas3-valid-oas-content-example - "openapi.yaml#/paths/~1service_types/get/responses/200/content/application~1json/example": - - oas3-valid-oas-content-example - "openapi.yaml#/paths/~1file_formats/get/responses/200/content/application~1json/example": - - oas3-valid-oas-content-example rules: - # Ported from Spectral 4.0 contact-properties: true tag-description: true oas3-parameter-description: true - oas3-unused-components-schema: false # Broken: https://github.com/stoplightio/spectral/issues/1271 + oas3-unused-component: false # Broken: https://github.com/stoplightio/spectral/issues/1271 operation-summary-formatted: description: Operation `summary` should start with upper case and not end with a dot. - recommended: true - type: style given: '$.paths.*[?( @property === ''get'' || @property === ''put'' || @property === ''post'' || @property === ''delete'' || @property === ''options'' || @property === ''head'' || @property === ''patch'' || @property === ''trace'' )]' then: field: summary @@ -31,7 +19,7 @@ rules: tags: - operation operation-id-kebab-case: - given: "$" + given: "$..operationId" then: function: pattern functionOptions: diff --git a/CHANGELOG.md b/CHANGELOG.md index 7750b7a8..bced4c98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,68 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased / Draft +## [1.2.0] - 2021-05-31 + +### Added + +- **New extensions:** + - [Commercial Data Extension](./extensions/commercial-data/README.md) + - [Federation Extension](./extensions/federation/README.md) +- `GET /`: New Relation types: [#404](https://github.com/Open-EO/openeo-api/issues/404) + - `create-form` to link to the registration page + - `recovery-form` to link to the credentials recovery page. +- `GET /file_formats`: Add `pointcloud` to the `gis_data_types`. [#475](https://github.com/Open-EO/openeo-api/issues/475) +- `GET /me`: New Relation types `alternate` and `related` for user-specific external pages. [#404](https://github.com/Open-EO/openeo-api/issues/404) +- `GET /credentials/oidc`: Allow `authorization_code` and `urn:ietf:params:oauth:grant-type:device_code` (both without PKCE) as grants for `default_clients`. [#410](https://github.com/Open-EO/openeo-api/issues/410) +- `GET /jobs` and `GET /jobs/{job_id}`: Added a links property that can for example link to results and logs. [#453](https://github.com/Open-EO/openeo-api/issues/453) +- `GET /jobs/{job_id}/results`: + - Recommendation to add a link with relation type `canonical` which points to a signed URL with the same content as the response. [#397](https://github.com/Open-EO/openeo-api/issues/397) + - Added metadata field `openeo:status` to indicate the job status (and whether the result is complete or not). + - Added parameter `partial` to allow retrieving incomplete results, which must also add the new property `openeo:status` to the metadata. [#430](https://github.com/Open-EO/openeo-api/issues/430) +- `GET /jobs/{job_id}/logs`, `GET /services/{service_id}/logs`: Added `level` parameter to requests to set the minimum log level returned by the response. [#485](https://github.com/Open-EO/openeo-api/issues/485) +- Added property `log_level` to secondary web service, batch job and synchronous processing endpoints to indicate the minimum severity level that should be stored for logs. [#329](https://github.com/Open-EO/openeo-api/issues/329) +- `GET /jobs/{job_id}/logs`, `GET /services/{service_id}/logs` and `POST /result`: Added `level` property in responses to reflect the minimum log level that may appear in the response. [#329](https://github.com/Open-EO/openeo-api/issues/329) +- Recommendation to add media types and titles to links for a better user experience. +- Allow the relation type `canonical` to be used generally for (shared) resources (e.g. UDPs or batch jobs) without requiring Bearer authentication. [#405](https://github.com/Open-EO/openeo-api/issues/405) +- Recommendation for UDF runtime names. [#409](https://github.com/Open-EO/openeo-api/issues/409) +- Processes: Added `dimensions` schema for subtype `datacube` +- Collections: Added `geometry` dimension type to `cube:dimensions` +- New endpoint for metadata filters (queryables): `/collections/{collection_id}/queryables`. Also adds a new rel type to the collection links. [#396](https://github.com/Open-EO/openeo-api/issues/396) + +### Changed + +- Updated STAC specification examples and references to v1.0.0, please see the [STAC changelog](https://github.com/radiantearth/stac-spec/blob/master/CHANGELOG.md) for all changes between 0.9 and 1.0. +- `cube:dimensions`: `reference_system` is allowed to be PROJJSON, too. +- Relaxed requirement that unsupported endpoints must return HTTP status code 501. Instead also HTTP status code 404 can be used (and is regularly used in practice). [#415](https://github.com/Open-EO/openeo-api/issues/415) +- Minimum value for `costs` and `budget` is 0. +- `GET /jobs/{job_id}/estimate`: If a batch job can't be estimated reliably, a `EstimateComplexity` error should be returned. [#443](https://github.com/Open-EO/openeo-api/issues/443) +- The `/conformance` endpoint is now generally used for OGC APIs, STAC API and openEO. `conformsTo` is also exposed in `GET /` for STAC APIs. The openEO API and all extensions got individual conformance classes. [#186](https://github.com/Open-EO/openeo-api/issues/186) + +### Fixed + +- Explicitly mention the use of HTTP content negotiation +- Clarify that the default charset is UTF-8 [#462](https://github.com/Open-EO/openeo-api/issues/462) +- Fixed inconsistencies in errors.json: removed `ProcessGraphIdDoesntMatch`, clarified `ProcessGraphMissing`, added `ProcessInvalid` and `ProcessGraphInvalid`. [#394](https://github.com/Open-EO/openeo-api/issues/394), [#395](https://github.com/Open-EO/openeo-api/issues/395), [#401](https://github.com/Open-EO/openeo-api/issues/401) +- Fixed the default value for the version number in the API url (`v1.0` -> `v1`) and improved the description for API versioning. [#393](https://github.com/Open-EO/openeo-api/issues/393) +- Fixed the Collection example to use `gsd` instead of `eo:gsd`. [#399](https://github.com/Open-EO/openeo-api/issues/399) +- Clarify use of `user_id`. [#404](https://github.com/Open-EO/openeo-api/issues/404) +- Clarify that the relation type `version-history` should include `/.well-known/openeo` in the URL. +- Clarify that clients should (re-)request capabilities and discovery endpoints with token if available and supported. [#416](https://github.com/Open-EO/openeo-api/issues/416) +- Clarify the fields `plan` (for processing requests) and `billing_plan` (in `GET /` and `GET /me`). [#425](https://github.com/Open-EO/openeo-api/issues/425) [#426](https://github.com/Open-EO/openeo-api/issues/426) +- Clarified ambiguous batch job status changes. +- Reflect that the `debug` process has been renamed to `inspect`. +- Clarified uniqueness constraints for identifiers. [#449](https://github.com/Open-EO/openeo-api/issues/449) [#454](https://github.com/Open-EO/openeo-api/issues/454) +- Clarified schematically the applicability of JSON Schema extensions (`parameters`, `returns`, `dimensions`) and their relation to the subtypes +- `GET /`: Removed the superfluous default value for `currency`. [#423](https://github.com/Open-EO/openeo-api/issues/423) +- `GET /credentials/oidc`: Clarify that clients may add additional scopes +- `GET /me`: Clarify the behavior of the field `budget`. +- `GET /jobs/{job_id}/logs`, `GET /services/{service_id}/logs` and `POST /result`: Clarified the formatting of the `message` property. [#455](https://github.com/Open-EO/openeo-api/issues/455) +- `GET /jobs/{job_id}/estimate`: Don't require that the costs are the upper limit. Services may specify the costs more freely depending on their terms of service. +- `GET /services` and `GET /services/{service_id}`: Clarify that `enabled` is required by removing the default value. [#473](https://github.com/Open-EO/openeo-api/issues/473) +- Several appearances of `nullable` were clarified according to the lint report by Spectral +- Clarify how the well-known document works [#460](https://github.com/Open-EO/openeo-api/issues/460) +- Clarify handling of JSON Schema versions + ## [1.1.0] - 2021-05-17 ### Added @@ -34,7 +96,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Clarified that job results require the property `datetime` and allow for additional properties. [#362](https://github.com/Open-EO/openeo-api/issues/362) - Clarified that billing plans, service names and file formats must be accepted case-insensitive. [#371](https://github.com/Open-EO/openeo-api/issues/371) - Clarified that the first provider listed at `GET /credentials/oidc` is the default provider for OpenID Connect. -- Clarified that `GET /jobs/{job_id}/results` should always return valid signed URLs and the endpoint can be used to renew the signed URLs. [#379](https://github.com/Open-EO/openeo-api/issues/379) +- Clarified that `GET /jobs/{job_id}/results` should always return valid signed URLs and the endpoint can be used to renew the signed URLs. [#379](https://github.com/Open-EO/openeo-api/issues/379) - Fixed casing of potential endpoints `GET /collections/{collection_id}/items` and `GET /collections/{collection_id}/items/{feature_id}`. - Clarified allowed characters in the `path` for uploaded user files. @@ -83,9 +145,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Additional dimensions in `cube:dimensions` can only be of type `other`. - The extents `interval` and `bbox` can have multiple entries. - Allow all STAC versions that are compatible to STAC 0.9.0. -- Process graph nodes have an additional field `namespace` to distinguish pre-defined and user-defined processes. The default behavior has not changed. [#305](https://github.com/Open-EO/openeo-api/issues/305) +- Process graph nodes have an additional field `namespace` to distinguish predefined and user-defined processes. The default behavior has not changed. [#305](https://github.com/Open-EO/openeo-api/issues/305) - Added `format: commonmark` to all properties supporting CommonMark formatting. -- `errors.json`: The pre-defined error messages have been reworked. [#272](https://github.com/Open-EO/openeo-api/issues/272), [#273](https://github.com/Open-EO/openeo-api/issues/273) +- `errors.json`: The predefined error messages have been reworked. [#272](https://github.com/Open-EO/openeo-api/issues/272), [#273](https://github.com/Open-EO/openeo-api/issues/273) - Added `FolderOperationUnsupported`, `UnsupportedApiVersion`, `PermissionsInsufficient`, `ProcessGraphIdDoesntMatch` and `PredefinedProcessExists`. - Added variable `reason` to error `FilePathInvalid` and `type` to `FileTypeInvalid` and`ServiceUnsupported`. - Replaced the following error messages. The variables in the messages may have changed, too. @@ -272,7 +334,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `GET /jobs/{job_id}/estimate` can return the estimated required storage capacity. [#122](https://github.com/Open-EO/openeo-api/issues/122) - `GET /jobs/{job_id}` has two new properties: - `progress` indicates the batch job progress when running. [#82](https://github.com/Open-EO/openeo-api/issues/82) - - `error` states the error message when a job errored out. + - `error` states the error message when a job stopped due to an error. `GET /jobs/{job_id}/result` mirrors this error message in a response with HTTP status code 424. [#165](https://github.com/Open-EO/openeo-api/issues/165) - `GET /.well-known/openeo` allows clients to choose between versions. [#148](https://github.com/Open-EO/openeo-api/issues/148) - `GET /` (Capabilities): @@ -369,6 +431,7 @@ Initial version. [Unreleased]: +[1.2.0]: [1.1.0]: [1.0.1]: [1.0.0]: diff --git a/README.md b/README.md index e8fcb2cb..aef37924 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,13 @@ openEO develops an open API to connect R, Python and JavaScript clients to big E ## Versions / Branches -The [master branch](https://github.com/Open-EO/openeo-api/tree/master) is the 'stable' version of the openEO API specification. It is currently version **1.1.0** of the specification. The [draft branch](https://github.com/Open-EO/openeo-api/tree/draft) is where active development takes place. +The [master branch](https://github.com/Open-EO/openeo-api/tree/master) is the 'stable' version of the openEO API specification. It is currently version **1.2.0** of the specification. The [draft branch](https://github.com/Open-EO/openeo-api/tree/draft) is where active development takes place. | Version / Branch | Status | Description | | --------------------------------------------------------- | ----------- | ----------- | | [draft](https://api.openeo.org/draft) | planned | *Unstable* - Next version. | -| [**1.1.0**](https://api.openeo.org) | **current** | Clarifications, STAC updates, return value for child processes, more details for logs and jobs, default clients for OIDC. [Changelog](CHANGELOG.md#110---2021-06-15). | +| [**1.2.0**](https://api.openeo.org) | **current** | Clarifications, new extensions, vector data cubes, STAC (API) updates, more link relation types, improved batch job results and logs. [Changelog](CHANGELOG.md#120---2023-05-31). | +| [1.1.0](https://api.openeo.org/1.1.0) | legacy | Clarifications, STAC updates, return value for child processes, more details for logs and jobs, default clients for OIDC. [Changelog](CHANGELOG.md#110---2021-06-15). | | [1.0.1](https://api.openeo.org/1.0.1) | legacy | Clarifications, bugfixes and CORS improvements. [Changelog](CHANGELOG.md#101---2020-12-07). | | [1.0.0](https://api.openeo.org/1.0.0) | legacy | First stable version of openEO. [Changelog](CHANGELOG.md#100---2020-07-17). | | [1.0.0-rc.2](https://api.openeo.org/1.0.0-rc.2) | legacy | Introduced user-defined processes. [Changelog](CHANGELOG.md#100-rc2---2020-02-20). | @@ -26,6 +27,13 @@ The [master branch](https://github.com/Open-EO/openeo-api/tree/master) is the 's See also the [changelog](CHANGELOG.md) and the [milestones](https://github.com/Open-EO/openeo-api/milestones) for a rough roadmap based on GitHub issues. +## Extensions + +| Name | Version | Stability | Description | +| ---------------------------------------------- | ------- | ------------ | ----------- | +| [Commercial Data](extensions/commercial-data/) | 0.1.0 | experimental | Provides an interface for discovering, ordering and using commercial data. | +| [Federation](extensions/federation/) | 0.1.0 | experimental | Covers federation aspects, i.e. where multiple back-ends are exposed as a single API. | + ## Repository This repository contains a set of files formally describing the openEO API, each with a human-readable and easily browseable version: @@ -33,3 +41,16 @@ This repository contains a set of files formally describing the openEO API, each * [openapi.yaml](openapi.yaml) provides the [OpenAPI](https://www.openapis.org/) 3.0 definition of the openEO API. See the table above for human-readable versions of the OpenAPI definition. * [errors.json](errors.json) is a list of potential global error codes and messages, excluding specific exceptions separately available for each process. * The [assets](assets/) folder contains some useful additional files such as examples or schemas. All of these are non-binding additions. The source of truth are the top-level specification files. +* The [extensions](extensions/) folder contains extensions to the openEO API. + +# Development + +The `draft` branch is the latest version and is the one to create Pull Requests against. + +For development some tools can be used: + +1. Install [node and npm](https://nodejs.org) - should run with any recent version +2. Run `npm install` in this folder to install the dependencies +3. Run the linter for the OpenAPI file with `npm test`. This will lint the files and check against some best-practices. It uses `spectral` in the background. +4. To show the files nicely formatted in a web browser, run `npm start`. It starts a server and opens the API specification rendered with ReDoc in a web browser. +5. To create a static HTML page (e.g. for hosting it on GitHub Pages), you can run `npm run build` and it will create a `redoc.html` in this folder. diff --git a/errors.json b/errors.json index c3b9e2f7..7288ba6b 100644 --- a/errors.json +++ b/errors.json @@ -66,6 +66,14 @@ "Data Processing" ] }, + "EstimateComplexity": { + "description": "The process is too complex to calculate an estimate, e.g. due to a UDF or other processes that are complex to estimate costs reliably.", + "message": "The process is too complex to calculate an estimate.", + "http": 500, + "tags": [ + "Batch Jobs" + ] + }, "NoDataForUpdate": { "description": "For PATCH requests: No valid data specified at all.", "message": "No data specified to be updated.", @@ -191,8 +199,8 @@ "User-Defined Processes" ] }, - "ProcessGraphMissing": { - "description": "The parameter `process` doesn't contain a valid process.", + "ProcessInvalid": { + "description": "The process given is invalid, which ususlly means that the process metadata is invalid.", "message": "Invalid process specified.", "http": 400, "tags": [ @@ -202,17 +210,31 @@ "Data Processing" ] }, - "ProcessGraphIdDoesntMatch": { - "description": "If a user-defined process is stored and the ID in the request path and the JSON document are not equal.", - "message": "The ids in the path and in the document don't match.", + "ProcessGraphMissing": { + "description": "The process doesn't contain a process graph. For jobs, services, and sync. processing the parameter `process` must contain a `process_graph`.", + "message": "Invalid process specified. It doesn't contain a process graph.", "http": 400, "tags": [ - "User-Defined Processes" + "User-Defined Processes", + "Batch Jobs", + "Secondary Services", + "Data Processing" + ] + }, + "ProcessGraphInvalid": { + "description": "The process doesn't contain a valid process graph, which means it doesn't comply to the general structure / schema.", + "message": "Invalid process graph specified.", + "http": 400, + "tags": [ + "User-Defined Processes", + "Batch Jobs", + "Secondary Services", + "Data Processing" ] }, "PredefinedProcessExists": { - "description": "If a user wants to store a user-defined process with the id of a pre-defined process.", - "message": "A pre-defined process with the given identifier exists.", + "description": "If a user wants to store a user-defined process with the id of a predefined process.", + "message": "A predefined process with the given identifier exists.", "http": 400, "tags": [ "User-Defined Processes" @@ -227,7 +249,7 @@ ] }, "ProcessUnsupported": { - "description": "A process (pre-defined or user-defined) with the specified identifier is not available. To be used when validating or executing process graphs.", + "description": "A process (predefined or user-defined) with the specified identifier is not available. To be used when validating or executing process graphs.", "message": "Process with identifier '{process}' is not available in namespace '{namespace}'.", "http": 400, "tags": [ @@ -317,6 +339,16 @@ "Data Processing" ] }, + "BillingPlanMissing": { + "description": "No billing plan has been specified by the user and the billing plan can't be determined unambiguously.", + "message": "A billing plan must be specified.", + "http": 400, + "tags": [ + "Batch Jobs", + "Secondary Services", + "Data Processing" + ] + }, "AuthenticationRequired": { "description": "The client did not provide any authentication details for a resource requiring authentication or the provided authentication details are not correct.", "message": "Unauthorized.", diff --git a/extensions/commercial-data/README.md b/extensions/commercial-data/README.md new file mode 100644 index 00000000..3fe7c177 --- /dev/null +++ b/extensions/commercial-data/README.md @@ -0,0 +1,233 @@ +# Commercial Data Extension + +The Commercial Data API extension provides an interface for discovering, ordering and using commercial data in the openEO API. + +- Version: **0.1.0** +- Stability: **experimental** +- [OpenAPI document](openapi.yaml) +- Conformance class: `https://api.openeo.org/extensions/commercial-data/0.1.0` + +**Note:** This document only documents the additions to the specification. +Extensions can not change or break existing behavior of the openEO API. + +## Overview of the workflow + +All the available datasets provided by a backend are listed on the `GET /collections` endpoint. The collections are normally freely accessible. This extension adds capabilities for providing collections that are not free of charge and require purchasing data products that can thereupon be used in processing. Commercial data collections usually allow purchasing small subsets of the data (products), for example, a single observation of an area. + +Therefore, the client must have an ability to search the available products that match their desired criteria and inspect their metadata to decide whether the products should be purchased. + +The client can then create an order for the desired products from a orderable collection. Because of the financial cost of purchasing the data, a separate endpoint for confirming the execution of that specific order should be implemented. + +When the order is completed, the data is ingested in a collection and its ID is available at `/orders/{order_id}` as `target_collection_id`. The user should be able to access the data using the `target_collection_id` at the temporal and spatial location of the purchased products. + +### Collection discovery + +A backend should add general information about a commercial data collection to the `/collections` and `/collections/{collection_id}` endpoints, the same as with freely available collections. Only the metadata about the entire dataset needs to be provided, not about the specific data products that a user has already purchased. + +Commercial data collections are distinguished from freely available collections by including `"order:status": "orderable"` as specified in the [STAC Order extension](https://github.com/stac-extensions/order/tree/v1.0.0). + +Commercial data collections can include an `order_parameters` field if ordering supports additional parameters that specify how the products should be delivered. + +Commercial data collections must also include human-readable pricing information for searching and ordering the products. If searching the products is free it should be set to `null`. If needed, references to additional information about pricing can be added to `links` with the relation type `pricing_info`. + +#### Example + +```json +{ + "stac_version": "1.0.0", + "stac_extensions": [ + "https://stac-extensions.github.io/datacube/v1.0.0/schema.json", + "https://stac-extensions.github.io/order/v1.0.0/schema.json" + ], + "type": "Collection", + "id": "PLEIADES", + "title": "Airbus Pleiades", + "description": "Pleiades is a satellite constellation providing very high-resolution optical imagery and is owned by Airbus. Pléiades is composed of two twin satellites orbiting the Earth 180° apart. The satellites deliver 0.5 m optical imagery and offer a daily revisit capability to any point on the globe.", + "license": "proprietary", + "providers": [...], + "extent": {...}, + "cube:dimensions": {...}, + "summaries": {...}, + "assets": {...}, + "order:status": "orderable", + "order_parameters": [ + { + "name": "sample_type", + "description": "sample type of the output raster.", + "schema": { + "type": "string", + "enum": [ + "UINT16", + "UINT8" + ] + }, + }, + ], + "pricing": { + "searching": null, + "ordering": { + "description": "Minimum area per order is 0.25 km2. The price is calculated based on a 6-months sliding window.", + } + }, + "links": [ + { + "title": "Airbus Pleiades pricing", + "rel": "pricing_info", + "href": "https://www.sentinel-hub.com/pricing/#tpd_pricing" + }, + ... + ] +} +``` + +### Filtering parameters discovery + +Searching for products can support refining the search by filtering with general or collection-specific attributes. Backends should implement a top level `/queryables` endpoint for attributes available for all collections, and collection-specific attributes should be provided at `/collections/{collection_id}/queryables` according to [OGC Queryables specification](https://portal.ogc.org/files/96288#filter-queryables) and [STAC Filter extension](https://github.com/radiantearth/stac-api-spec/tree/v1.0.0-rc.1/fragments/filter). + +#### Example + +Example response from `GET /collections/PLEIADES/queryables`: +```json +{ + "$schema":"http://json-schema.org/draft-07/schema#", + "$id":"http://openeo.example/collections/PLEIADES/queryables", + "type":"object", + "title":"Queryables of Airbus Pleiades collection.", + "description":"Available properties for CQL filtering of products.", + "properties":{ + "processing_level":{ + "title":"Processing level", + "description":"Limit search to only Living Library images with 'SENSOR' or access all images with 'ALBUM'.", + "type":"string", + "enum":[ + "SENSOR", + "ALBUM" + ] + }, + "max_snow_coverage":{ + "title":"Maximum snow coverage", + "description":"The maximum allowable snow coverage in percent.", + "type":"number", + "minimum":0, + "maximum":100, + "default":100 + }, + "max_incidence_angle":{ + "title":"Maximum incidence angle", + "description":"The maximum allowable incidence angle in degrees.", + "minimum":0, + "maximum":90, + "default":90 + } + } +} +``` + +### Searching available products + +Backends should implement the top-level `GET /search` endpoint as specified in the [STAC Item Search API specification](https://github.com/radiantearth/stac-api-spec/tree/v1.0.0-rc.1/item-search). This should include the [Filter Extension](https://github.com/radiantearth/stac-api-spec/tree/v1.0.0-rc.1/fragments/filter), which enables filtering the available products by attributes specified in `GET /queryables` and `GET /collections/{collection-id}/queryables`. +The endpoint returns a list of [STAC Items](https://github.com/radiantearth/stac-spec/blob/master/item-spec/item-spec.md) that match the criteria. The products should be aligned with the STAC specification, utilising the existing [STAC extensions](https://github.com/radiantearth/stac-spec/blob/v1.0.0/extensions/README.md) as much as possible, and trying avoiding custom attributes, if a generally accepted definition does not exist. + +#### Example + +Example request payload to `GET /search` for `PLEIADES` products from "Living Library" with no snow coverage. + +```json +{ + "bbox": [3, 15, 4, 16], + "datetime": ["01-01-2022", "01-02-2022"], + "collections": ["PLEIADES"], + "filter": { + "op": "and", + "args": [ + { + "op": "=", + "args": [{"property": "processing_level"}, "SENSOR"] + }, + { + "op": "=", + "args": [{"property": "max_snow_coverage"}, 0] + } + ] + } +} +``` + +### Ordering products + +Backends should implement the following endpoints: + +- `GET /orders`: Get a list of all created orders +- `POST /orders`: Create an order +- `GET /orders/{order_id}`: Get full metadata of a specific order +- `POST /orders/{order_id}`: Confirm a created order + +Optionally, they can also implement: +- `DELETE /orders/{order_id}`: Delete an order + +See the [OpenAPI document](openapi.yaml) for details. + +### Product metadata + +The backend can provide full product metadata as STAC Items following [STAC API Features specification](https://github.com/radiantearth/stac-api-spec/tree/main/ogcapi-features). This requires implementing two additional endpoints, `/collections/{collection_id}/items` and `/collections/{collection_id}/items/{item_id}`. + +`/collections/{collection_id}/items/{item_id}` may return an error if the data has not been ingested yet. + +Items should contain links to the respective orders that made them available using relation type `parent_order`. + +### Payment + +Payment should be done in the currency used by the backend, listed at `GET /` under `billing`. When an order is created, the backend should return the full final cost of the order. + +### Example usage with Python client + +Python client could be extented to support commercial data. Here an example of a possible workflow is provided. + +```python +>>> import openeo +>>> connection = openeo.connect("openeo.sentinel-hub.com") +>>> connection.list_collection_ids(status="orderable") +["PLEIADES", "SPOT", ...] +``` + +We can fetch queryables and hold them in a class that validates user's parameters against the schema and constructs the payload. +```python +>>> pleiades_queryables = connection.get_queryables(collection_id="PLEIADES") +>>> pleiades_queryables.list() +[{'name': 'processing_level', 'type': 'string', 'enum': ['SENSOR', 'ALBUM']}, {'name': 'max_snow_coverage', 'type': 'number', 'minimum': 0, 'maximum': 100, 'default': 100}, {'name': 'max_incidence_angle', 'type': 'number', 'minimum': 0, 'maximum': 90, 'default': 90}] +``` + +Setting the values. +```python +>>> pleiades_queryables.set('processing_level', 'SENSOR') +>>> pleiades_queryables.set('max_snow_coverage', 0) +>>> pleiades_queryables.generate_cql_filter() +{'op': 'and', 'args': [{'op': '=', 'args': [{'property': 'processing_level'}, 'SENSOR']}, {'op': '=', 'args': [{'property': 'max_snow_coverage'}, 0]}]} +``` + +Searching the products: +```python +>>> connection.search_items(collection_id="PLEIADES", bbox=(1,2,3,4), filter=pleiades_queryables.generate_cql_filter()) +{'type': 'FeatureCollection', 'features': [{'id': 'c8a1f88d-89cf-4933-9118-45e9c1a5df20','type': 'Feature', 'stac_version': '1.0.0', "stac_extensions": ["https://stac-extensions.github.io/projection/v1.0.0/schema.json", "https://stac-extensions.github.io/eo/v1.0.0/schema.json", "https://stac-extensions.github.io/view/v1.0.0/schema.json", "https://stac-extensions.github.io/processing/v1.1.0/schema.json"], 'geometry': {'type': 'Polygon', 'coordinates': [[[12.36555287044679, 41.94403289260048]], [12.36571746774068, 41.86399361096971], [12.60746759743069, 41.86372776276345], [12.60758647471871, 41.94379931812686], [12.36555287044679, 41.94403289260048]]}, 'properties': {'constellation': 'PHR', 'datetime': '2022-03-21T10:11:15.055Z', 'view:azimuth': 179.9852862071639, 'eo:cloud_cover': 0, 'proj:centroid': {'lat': 41.903935647240964, 'lon': 12.486569672582828}, 'processing:level': 'SENSOR', 'sensorType': 'OPTICAL', 'spectralRange': 'VISIBLE'}, 'assets': {}, 'links': []}, ...], 'links': []} +``` + +Create and confirm and order: +```python +>>> order = connection.create_order(collection_id="PLEIADES", products=["c8a1f88d-89cf-4933-9118-45e9c1a5df20"]) +>>> order.costs +42 +>>> order.status +'orderable' +>>> order.confirm_order() +>>> order.status +'ordered' +``` + +When the order has finished, you can process the data as with a normal collection. + +```python +>>> order = connection.get_order(id="40264b5-c3ae-46f4-a907-0f612d763d97") +>>> order.status +'succeeded' +>>> pleiades_cube = connection.load_collection(order.target_collection_id) +``` \ No newline at end of file diff --git a/extensions/commercial-data/openapi.yaml b/extensions/commercial-data/openapi.yaml new file mode 100644 index 00000000..c2c2d1a2 --- /dev/null +++ b/extensions/commercial-data/openapi.yaml @@ -0,0 +1,358 @@ +openapi: 3.0.2 +info: + title: openEO Commercial Data API extension + version: 0.1.0 + description: >- + The Commercial Data API extension provides an interface for discovering, + ordering and using commercial data in the openEO API. + contact: + name: openEO Consortium + url: 'https://openeo.org' + email: openeo.psc@uni-muenster.de + license: + name: Apache 2.0 + url: 'http://www.apache.org/licenses/LICENSE-2.0.html' +externalDocs: + url: https://github.com/Open-EO/openeo-api/blob/draft/extensions/federation/README.md +tags: + - name: Orders + description: Management of commercial data orders +servers: + - url: 'https://openeo.example/api/{version}' + description: >- + The URL of the API MAY freely be chosen by the back-end providers. The + path, including API versioning, is a *recommendation* only. Nevertheless, + all servers MUST support HTTPS as the authentication methods are not + secure with HTTP only! + variables: + version: + default: v1 + description: >- + API versioning is RECOMMENDED. As the openEO API is following + [SemVer](https://semver.org/) only the MAJOR part of the stable + version numbers (i.e. versions >= 1.0.0) SHOULD be used for API + versioning in the URL. The reason is that backward-incompatible + changes are usually introduced by major changes. Therefore, the + version number in the URL MUST not be used by the clients to detect + the version number of the API. Use the version number returned from + `GET /` instead. +paths: + /orders: + get: + summary: List all commercial data orders + operationId: list-orders + description: |- + Lists all created orders submitted by a user, regardless of the status + or the collection. + + It is **strongly RECOMMENDED** to keep the response size small by + omitting all optional non-scalar values from objects in `orders` (e.g. `parameters`). + To get the full metadata for an order clients MUST request `GET /orders/{order_id}`. + tags: + - Orders + security: + - Bearer: [] + parameters: + - $ref: '../../openapi.yaml#/components/parameters/pagination_limit' + responses: + '200': + description: List of orders and related links. + content: + application/json: + schema: + title: Orders + type: object + required: + - orders + - links + properties: + orders: + type: array + items: + $ref: '#/components/schemas/order' + links: + $ref: '../../openapi.yaml#/components/schemas/links_pagination' + 4XX: + $ref: '../../openapi.yaml#/components/responses/client_error_auth' + 5XX: + $ref: '../../openapi.yaml#/components/responses/server_error' + post: + summary: Create a new order + operationId: create-order + description: |- + Create an order for selected items (products). + + When an order is created through through this endpoint, the data isn't yet ordered from the commercial data provider. The client MUST explicitly confirm the order through `POST /orders/{order_id}` whereupon the order is executed. + + The order can contain additional parameters that specify how the items should be delivered. + For example, it might be possible to set the projection, resampling method, bit depth etc. of the delivered data. + + Backends SHOULD expose the available ordering parameters in `GET /collections/{collection_id}` in the `order_parameters` field, following the `process_parameters` schema of [`GET /service_types`](https://openeo.org/documentation/1.0/developers/api/reference.html#tag/Secondary-Services/operation/list-service-types). + + Returns `Location` and `OpenEO-Identifier` header with the link to the detailed information about the order. + tags: + - Orders + security: + - Bearer: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - source_collection_id + - items + - parameters + properties: + source_collection_id: + type: string + description: Unique identifier of the collection. + items: + type: array + description: Array of items IDs to order. + items: + $ref: '#/components/schemas/order_id' + parameters: + $ref: '#/components/schemas/order_parameters' + responses: + '201': + description: The order has been created successfully. + headers: + Location: + required: true + schema: + description: |- + Absolute URL to the newly created order. + + The URL points to the metadata endpoint + `GET /orders/{order_id}` with the `{order_id}` being the + unique identifier (ID) of the created order. + format: uri + type: string + example: 'https://openeo.example/api/v1/orders/40264b5-c3ae-46f4-a907-0f612d763d97' + OpenEO-Identifier: + required: true + schema: + $ref: '#/components/schemas/order_id' + 4XX: + $ref: '../../openapi.yaml#/components/responses/client_error_auth' + 5XX: + $ref: '../../openapi.yaml#/components/responses/server_error' + '/orders/{order_id}': + parameters: + - $ref: '#/components/parameters/order_id' + get: + summary: Full metadata for an order + operationId: describe-order + description: |- + Get full metadata of the order. + + Backends can optionally link to the spatial and temporal extent information and other metadata about the items using the relation type `item`, preferrably by implementing and linking to `GET /collections/{collection_id}/items/{item_id}`. + tags: + - Orders + security: + - Bearer: [] + responses: + '200': + description: Full order information. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/order' + - type: object + required: + - items + 4XX: + $ref: '../../openapi.yaml#/components/responses/client_error_auth' + 5XX: + $ref: '../../openapi.yaml#/components/responses/server_error' + post: + summary: Confirm an order + operationId: confirm-order + description: |- + Confirm the order, execute the purchase and ingest the data into a target collection. + + When an order is created through `POST /order`, the data isn't yet ordered from the commercial data provider. The client MUST explicitly confirm the order whereupon the order is executed, the costs are deducted from the client's account and the data is ingested in the target collection. + + The target collection is the collection through which the ordered data is made available. The source and the target collection can be the same or different, it's up to the backend if the ordered data id ingested into a new target collection or the existing source collection. Additionally, if the backend creates new target collections, it can provide access to the union of all purchased products through the source collection. + + This endpoint only has an effect if `order:status` is `orderable`. + + If the user doesn't have sufficient funds, the endpoint should return an error and `order:status` should not change. + + Otherwise, the `order:status` changes from `orderable` to `ordered` until a new order status (e.g. `succeeded` or `failed`) becomes available. + tags: + - Orders + security: + - Bearer: [] + responses: + '202': + description: The order has been confirmed successfully. + 4XX: + $ref: '../../openapi.yaml#/components/responses/client_error_auth' + 5XX: + $ref: '../../openapi.yaml#/components/responses/server_error' + delete: + summary: Delete an order + operationId: delete-order + description: |- + Removes the order and all ordered items from the back-ends. + + If an order is still in progress, it cancels the order. + Costs MAY still occur. + tags: + - Orders + security: + - Bearer: [] + responses: + '204': + description: The order and data has been successfully deleted. + 4XX: + $ref: '../../openapi.yaml#/components/responses/client_error_auth' + 5XX: + $ref: '../../openapi.yaml#/components/responses/server_error' +components: + schemas: + order_id: + type: string + description: >- + Unique identifier of the order at the back-end, which MUST match the specified pattern. + pattern: '^[\w\-\.~]+$' + example: fb6799ab + item_id: + type: string + description: >- + Unique identifier of the item. Must be unique within a collection. + example: c8a1f88d-89cf-4933-9118-45e9c1a5df20 + order_parameters: + type: object + description: >- + Key-value pairs of available `order_parameters` as listed at + `GET /collections/{collection_id}` for filtering available items. + additionalProperties: + x-additionalPropertiesName: Order Parameter Name + description: Value of the order parameter for the request. + example: + resamplingKernel: 'NN' + order: + type: object + title: Order + description: >- + Information about an order. + + The properties with the `order:` prefix follow the fields defined in the + [STAC Order Extension](https://github.com/stac-extensions/order/tree/v1.0.0). + required: + - id + - order:status + - order:date + - source_collection_id + - target_collection_id + - costs + properties: + id: + $ref: '#/components/schemas/order_id' + order:id: + type: string + description: >- + Identifier of the order at the data provider. + example: 40264b5-c3ae-46f4-a907-0f612d763d97 + order:status: + type: string + description: |- + The status of the order. + * `orderable`: The item or asset is orderable via the provider scenario. + * `ordered`: The item or asset is ordered and the provider is preparing to make it available. + * `pending`: The item or asset is ordered but wait for an activation before being able for shipping. + * `shipping` The item or asset order are being processed by the provider to provide you with the asset(s). + * `succeeded`: The provider has delivered your order and asset(s) are available. + * `failed`: The provider is not able to deliver the order. + * `canceled` The order has been canceled. + enum: + - orderable + - ordered + - pending + - shipping + - succeeded + - failed + - canceled + order:date: + type: string + format: date-time + description: The order time. Formatted as a + [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339.html) date-time. + example: '2017-01-01T09:32:12Z' + order:expiration_date: + type: string + format: date-time + description: The validity time of the order. Formatted as a + [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339.html) date-time. + example: '2999-01-01T00:00:00Z' + source_collection_id: + type: string + description: Unique identifier of the source collection. + pattern: '^[\w\-\.~\/]+$' + example: 'PLEIADES' + target_collection_id: + type: string + description: >- + Unique identifier of the target collection. + Can be the same as `source_collection_id`. + pattern: '^[\w\-\.~\/]+$' + example: 'PLEIADES' + costs: + $ref: '../../openapi.yaml#/components/schemas/money' + parameters: + $ref: '#/components/schemas/order_parameters' + items: + type: array + description: List of ordered item IDs. + items: + $ref: '#/components/schemas/item_id' + links: + type: array + description: |- + Links related to this order, e.g. to metadata for ordered items + listed in `items`. + + It is highly RECOMMENDED to provide links with the + following `rel` (relation) types: + + 1. `item`: A link back to a valid STAC Item that has been ordered. + Could be a link to `GET /collections/{collection_id}/items/{item_id}`. + + 2. `order`: A link pointing to a dcoument describing the ordering + terms and conditions of the data provider. + + For additional relation types see also the lists of + [common relation types in openEO](#section/API-Principles/Web-Linking). + items: + $ref: '../../openapi.yaml#/components/schemas/link' + parameters: + order_id: + name: order_id + in: path + description: >- + Unique identifier of an order. + + This corresponds to the `id` property of an order. + required: true + schema: + $ref: '#/components/schemas/order_id' + securitySchemes: + Bearer: + type: http + scheme: bearer + bearerFormat: >- + The Bearer Token MUST consist of the authentication method, a provider + ID (if available) and the token itself. All separated by a forward slash + `/`. Examples (replace `TOKEN` with the actual access token): (1) Basic + authentication (no provider ID available): `basic//TOKEN` (2) OpenID + Connect (provider ID is `ms`): `oidc/ms/TOKEN`. For OpenID Connect, the + provider ID corresponds to the value specified for `id` for each + provider in `GET /credentials/oidc`. + Basic: + type: http + scheme: basic diff --git a/extensions/commercial-data/package.json b/extensions/commercial-data/package.json new file mode 100644 index 00000000..0fd067ed --- /dev/null +++ b/extensions/commercial-data/package.json @@ -0,0 +1,24 @@ +{ + "name": "@openeo/api-extension-commercial-data", + "version": "0.1.0", + "author": "openEO Consortium", + "license": "Apache-2.0", + "description": "The openEO API specification.", + "homepage": "https://openeo.org", + "bugs": { + "url": "https://github.com/Open-EO/openeo-api/issues" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Open-EO/openeo-api.git" + }, + "devDependencies": { + "@stoplight/spectral": "^5.9.1", + "redoc-cli": "^0.13.18" + }, + "scripts": { + "start": "redoc-cli serve openapi.yaml --watch --options.expandResponses \"200,201,202,203,204\" --options.pathInMiddlePanel true", + "build": "redoc-cli bundle openapi.yaml -o redoc.html --title \"openEO API\" --cdn --options.expandResponses \"200,201,202,203,204\" --options.pathInMiddlePanel true", + "test": "spectral lint openapi.yaml" + } +} diff --git a/extensions/federation/README.md b/extensions/federation/README.md new file mode 100644 index 00000000..16e0d2ae --- /dev/null +++ b/extensions/federation/README.md @@ -0,0 +1,216 @@ +# Federation Extension + +The openEO API is a specification for interoperable cloud-based processing of large Earth observation datasets. + +This is an extension for federation aspects, i.e. where multiple back-ends are exposed as a single API. + +- Version: **0.1.0** +- Stability: **experimental** +- Conformance class: `https://api.openeo.org/extensions/federation/0.1.0` + +**Note:** This document only documents the additions to the specification. +Extensions can not change or break existing behavior of the openEO API. + +## Backend details + +A new required field `federation` is added to `GET /` to enable federation. + +### OpenAPI fragment + +```yaml +schema: + type: object + required: + - 'federation' + properties: + 'federation': + description: >- + Lists all back-ends that are part of this federation with details. + They keys of the object are the unique identifiers for the back-ends that are returned in sub-sequent requests (see below). + type: object + minProperties: 2 + additionalProperties: + type: object + required: + - url + properties: + url: + type: string + format: uri + description: >- + URL to the versioned API endpoint of the back-end, + so a URL that is available through well-known discovery on the back-end. + example: https://openeo.provider.org/api/v1/ + title: + type: string + description: Name of the back-end. + description: + type: string + description: A description of the back-end and its specifics. + status: + type: string + enum: + - online + - offline + description: Current status of the back-ends. + default: online + last_status_check: + type: string + format: date-time + description: The time at which the status of the back-end was checked last. + last_successful_check: + type: string + format: date-time + description: >- + If the `status` is `offline`: The time at which the back-end was checked and available the last time. + Otherwise, this is equal to the property `last_status_check`. + experimental: + type: boolean + description: >- + Declares the back-end to be experimental, which means that + it is likely to change or may produce unpredictable behaviour. + default: false + deprecated: + type: boolean + description: |- + Declares the back-end to be deprecated with the potential + to be removed in any of the next versions. + default: false +``` + +### Example + +```json +{ + "api_version": "1.2.0", + "federation": { + "vito": { + "title": "VITO", + "url": "https://openeo.vito.be" + }, + "eodc": { + "title": "EODC", + "url": "https://openeo.eodc.eu" + }, + "wwu": { + "title": "WWU Münster", + "url": "https://openeo.wwu.de", + "status": "offline", + "description": "Experimental integration of the WWU HPC", + "experimental": true + } + }, + ... +} +``` + +## Lists of resources + +Clients will assume that all lists of resources are the a combination of all back-ends listed in `GET /`. +Federated APIs can expose if any of the back-ends is not available and thus is not part of the response. + +Applies to: + +- `GET /collections` +- `GET /processes` +- `GET /file_formats` +- `GET /process_graphs` +- `GET /jobs` +- `GET /jobs/{job_id}` +- `GET /jobs/{job_id}/results` +- `GET /services` + +The following endpoints define the resources (UDF runtimes / service types) at the top level of their response as key-value pairs. +Consequently, they are not extensible with additional properties for federation purposes. + +- `GET /udf_runtimes` +- `GET /service_types` + +### OpenAPI fragment + +```yaml +schema: + type: object + properties: + 'federation:missing': + description: >- + Lists all back-ends that were not considered in the response (e.g. because they were not accessible). + If not given or empty, all back-ends were considered for creating the response. + Back-ends that were listed as offline in the capabilities still need to be listed here. + type: array + items: + type: string + description: The ID of a back-end. +``` + +### Example + +```json +{ + "federation:missing": ["wwu"], + "collections": [...], + "links": [...] +} +``` + +## Resources supported only by a subset of back-ends + +Every discoverable resource that is defined as an object and allows to contain additional properties, can list the backends that support or host the exposed resource/functionality. +This can also be embeded deeply into a hierarchical structure, e.g. for process or file format parameters. + +```yaml +schema: + type: object + properties: + 'federation:backends': + description: >- + Lists all back-ends that support or host the resource. + If not given, all back-ends support the resource. + type: array + minItems: 1 + items: + type: string + description: The ID of a back-end. +``` + +**Note:** In Collections this should generally be provided on the top-level of the object. + +### Examples + +#### Process + +```json +{ + "process_id": "example", + "federation:backends": ["vito", "eodc"], + "parameters": [ + { + "name": "parameter1", + "description": "A parameter supported by both back-ends...", + "schema": {} + }, + { + "name": "proprietary_parameter", + "description": "A parameter supported only by EODC.", + "federation:backends": ["eodc"], + "schema": {} + } + ] + ... +} +``` + +#### Collection + +```json +{ + "stac_version": "1.0.0", + "id": "example", + "description": "...", + "summaries": { + "federation:backends": ["vito", "eodc"], + ... + }, + ... +} +``` \ No newline at end of file diff --git a/openapi.yaml b/openapi.yaml index 45dcf7a2..b3917a07 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1,10 +1,12 @@ openapi: 3.0.2 info: title: openEO API - version: 1.1.0 + version: 1.2.0 description: |- The openEO API specification for interoperable cloud-based processing of large Earth observation datasets. + **Conformance class:** `https://api.openeo.org/1.2.0` + # API Principles ## Language @@ -15,7 +17,7 @@ info: Unless otherwise stated the API works **case sensitive**. - All names SHOULD be written in snake case, i.e. words are separated with one underscore character (`_`) and no spaces, with all letters lower-cased. Example: `hello_world`. This applies particularly to endpoints and JSON property names. HTTP header fields follow their respective casing conventions, e.g. `Content-Type` or `OpenEO-Costs`, despite being case-insensitive according to [RFC 7230](https://www.rfc-editor.org/rfc/rfc7230.html#section-3.2). + All names SHOULD be written in snake case, i.e. words are separated with one underscore character (`_`) and no spaces, with all letters lower-cased. Example: `hello_world`. This applies particularly to endpoints and JSON property names. HTTP header fields are generally case-insensitive according to [RFC 7230](https://www.rfc-editor.org/rfc/rfc7230.html#section-3.2) and in the specification we follow their respective casing conventions, e.g. `Content-Type` or `OpenEO-Costs`, for better readability and consistency. ## HTTP / REST @@ -27,9 +29,16 @@ info: Naming of endpoints follow the REST principles. Therefore, endpoints are centered around resources. Resource identifiers MUST be named with a noun in plural form except for single actions that can not be modelled with the regular HTTP verbs. Single actions MUST be single endpoints with a single HTTP verb (POST is RECOMMENDED) and no other endpoints beneath it. - ## JSON + The openEO API makes use of [HTTP Content Negotiation](https://www.rfc-editor.org/rfc/rfc9110.html#name-content-negotiation), + including, but not limited to, the request headers `Accept`, `Accept-Charset` and `Accept-Language`. + + ### JSON + + The API uses JSON for request and response bodies whenever feasible. Services use JSON as the default encoding. Other encodings can be requested using HTTP Content Negotiation ([`Accept` header](https://www.rfc-editor.org/rfc/rfc9110.html#name-accept)). Clients and servers MUST NOT rely on the order in which properties appear in JSON. To keep the response size small, lists of resources (e.g. the list of batch jobs) usually should not include nested JSON objects, if this information can be requested from the individual resource endpoints (e.g. the metadata for a single batch job). + + ### Charset - The API uses JSON for request and response bodies whenever feasible. Services use JSON as the default encoding. Other encodings can be requested using [Content Negotiation](https://www.w3.org/Protocols/rfc2616/rfc2616-sec12.html). Clients and servers MUST NOT rely on the order in which properties appears in JSON. Collections usually don't include nested JSON objects if those information can be requested from the individual resources. + Services use [UTF-8](https://en.wikipedia.org/wiki/UTF-8) as the default charset if not negotiated otherwise with HTTP Content Negotiation ([`Accept-Charset` header](https://www.rfc-editor.org/rfc/rfc9110.html#name-accept-charset)). ## Web Linking @@ -46,6 +55,14 @@ info: 3. `about`: A resource that is related or further explains the resource, e.g. a user guide. + 4. `canonical`: This relation type usually points to a publicly accessible and more long-lived URL for a resource that otherwise often requires (Bearer) authentication with a short-lived token. + This way the the exposed resources can be used by non-openEO clients without additional authentication steps. + For example, a shared user-defined process or batch job results could be exposed via a canonical link. + If a URL should be publicly available to everyone, it can simply a user-specific URL, e.g. `https://openeo.example/processes/john_doe/ndvi`. + For resources that should only be accessible to a certain group of user, a signed URL could be given, e.g. `https://openeo.example/processes/81zjh1tc2pt52gbx/ndvi`. + + Generally, it is RECOMMENDED to add descriptive titles (propertty `title`) and media type information (propertty `type`) for a better user experience. + ## Error Handling The success of requests MUST be indicated using [HTTP status codes](https://www.rfc-editor.org/rfc/rfc7231.html#section-6) according to [RFC 7231](https://www.rfc-editor.org/rfc/rfc7231.html). @@ -65,7 +82,7 @@ info: "id": "936DA01F-9ABD-4D9D-80C7-02AF85C822A8", "code": "SampleError", "message": "A sample error message.", - "url": "https://example.openeo.org/docs/errors/SampleError" + "url": "https://openeo.example/docs/errors/SampleError" } ``` @@ -104,11 +121,15 @@ info: - **404 Not Found**: The resource specified by the path does not exist, i.e. one of the resources belonging to the specified identifiers are not available at the back-end. - *Note:* Unsupported endpoints MUST use HTTP status code 501. + *Note:* Unsupported endpoints MAY also return HTTP status code 501. - **500 Internal Server Error**: The error has its origin on server side and no other status code in the 500 range is suitable. + - **501 Not Implemented**: + The requested endpoint is specified by the openEO API, but is not implemented (yet) by the back-end. + *Note:* Unsupported endpoints MAY also return HTTP status code 404. + If a HTTP status code in the 400 range is returned, the client SHOULD NOT repeat the request without modifications. For HTTP status code in the 500 range, the client MAY repeat the same request later. @@ -130,6 +151,9 @@ info: + **Note:** Although it is possible to request several public endpoints for capabilities and discovery that don't require authorization, it is RECOMMENDED that clients (re-)request the public endpoints that support Bearer authentication with the Bearer token once available to also retrieve any private data that is made available specifically for the authenticated user. + This may require that clients clear any cached data they retrieved from public endpoints before. + # Cross-Origin Resource Sharing (CORS) > Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources [...] on a web page to be requested from another domain outside the domain from which the first resource was served. [...] @@ -158,8 +182,8 @@ info: ```http POST /api/v1/jobs HTTP/1.1 - Host: openeo.cloudprovider.com - Origin: https://client.org:8080 + Host: openeo.example + Origin: https://company.example:8080 Authorization: Bearer basic//ZXhhbXBsZTpleGFtcGxl ``` @@ -170,7 +194,7 @@ info: Access-Control-Allow-Origin: * Access-Control-Expose-Headers: Location, OpenEO-Identifier, OpenEO-Costs, Link Content-Type: application/json - Location: https://openeo.cloudprovider.com/api/v1/jobs/abc123 + Location: https://openeo.example/api/v1/jobs/abc123 OpenEO-Identifier: abc123 ``` @@ -191,8 +215,8 @@ info: ```http OPTIONS /api/v1/jobs HTTP/1.1 - Host: openeo.cloudprovider.com - Origin: https://client.org:8080 + Host: openeo.example + Origin: https://company.example:8080 Access-Control-Request-Method: POST Access-Control-Request-Headers: Authorization, Content-Type ``` @@ -214,12 +238,12 @@ info: A **process** is an operation that performs a specific task on a set of parameters and returns a result. An example is computing a statistical operation, such as mean or median, on selected EO data. A process is similar to a function or method in programming languages. In openEO, processes are used to build a chain of processes ([process graph](#section/Processes/Process-Graphs)), which can be applied to EO data to derive your own findings from the data. - A **pre-defined process** is a process provided by the *back-end*. There is a set of predefined processes by openEO to improve interoperability between back-ends. - Back-ends SHOULD follow these specifications whenever possible. Not all processes need to be implemented by all back-ends. See the **[process reference](https://processes.openeo.org)** for pre-defined processes. + A **predefined process** is a process provided by the *back-end*. There is a set of predefined processes by openEO to improve interoperability between back-ends. + Back-ends SHOULD follow these specifications whenever possible. Not all processes need to be implemented by all back-ends. See the **[process reference](https://processes.openeo.org)** for predefined processes. - A **user-defined process** is a process defined by the *user*. It can directly be part of another process graph or be stored as custom process on a back-end. Internally it is a *process graph* with optional additional metadata. + A **user-defined process** is a process defined by the *user*. It can directly be part of another process graph or be stored as custom process on a back-end. Internally, it is a *process graph* with a variety of additional metadata. - A **process graph** chains specific process calls from the set of pre-defined and user-defined processes together. A process graph itself can be stored as a (user-defined) process again. Similarly to scripts in the context of programming, process graphs organize and automate the execution of one or more processes that could alternatively be executed individually. In a process graph, processes need to be specific, i.e. concrete values or "placeholders" for input parameters need to be specified. These values can be scalars, arrays, objects, references to parameters or previous computations or other process graphs. + A **process graph** chains specific process calls from the set of predefined and user-defined processes together. A process graph itself can be stored as a (user-defined) process again. Similarly to scripts in the context of programming, process graphs organize and automate the execution of one or more processes that could alternatively be executed individually. In a process graph, processes need to be specific, i.e. concrete values or "placeholders" for input parameters need to be specified. These values can be scalars, arrays, objects, references to parameters or previous computations or other process graphs. ## Defining Processes @@ -227,7 +251,7 @@ info: **Back-end providers** MUST follow the schema for predefined processes as in [`GET /processes`](#operation/list-processes) to define new processes. This includes: - * Choosing a intuitive process id, consisting of only letters (a-z), numbers and underscores. It MUST be unique across the pre-defined processes. + * Choosing a intuitive process id, consisting of only letters (a-z), numbers and underscores. It MUST be unique across the predefined processes. * Defining the parameters and their exact (JSON) schemes. * Specifying the return value of a process also with a (JSON) schema. * Providing examples or compliance tests. @@ -235,20 +259,21 @@ info: **Users** MUST follow the schema for user-defined processes as in [`GET /process_graphs/{process_graph_id}`](#operation/describe-custom-process) to define new processes. This includes: - * Choosing a intuitive name as process id, consisting of only letters (a-z), numbers and underscores. It MUST be unique across the user-defined processes. + * Choosing a intuitive name as process id, consisting of only letters (a-z), numbers and underscores. It MUST be unique per user across the user-defined processes. * Defining the algorithm as a process graph. * Optionally, specifying the additional metadata for processes. - If new process are potentially useful for other back-ends the openEO consortium is happily accepting [pull requests](https://github.com/Open-EO/openeo-processes/pulls) to include them in the list of pre-defined processes. + If new process are potentially useful for other back-ends the openEO consortium is happily accepting [pull requests](https://github.com/Open-EO/openeo-processes/pulls) to include them in the list of predefined processes. ### Schemas Each process parameter and the return values of a process define a schema that the value MUST comply to. The schemas are based on [JSON Schema draft-07](http://json-schema.org/). - Three custom keywords have been defined: + Multiple custom keywords have been defined: * `subtype` for more fine-grained data-types than JSON Schema supports. - * `parameters` to specify the parameters of a process graph (object with subtype `process-graph`). - * `returns` to describe the return value of a process graph (object with subtype `process-graph`). + * `dimensions` to further define the dimension types required if the `subtype` is `datacube`. + * `parameters` to specify the parameters of a process graph if the `subtype` is `process-graph`. + * `returns` to describe the return value of a process graph if the `subtype` is `process-graph`. ### Subtypes @@ -258,7 +283,7 @@ info: and standardizes a number of openEO related data types that extend the native data types, for example: `bounding-box` (object with at least `west`, `south`, `east` and `north` properties), `date-time` (string representation of date and time following RFC 3339), - `raster-cube` (the type of data cubes), etc. + `datacube` (a datacube with dimensions), etc. The subtypes should be re-used in process schema definitions whenever suitable. If a general data type such as `string` or `number` is used in a schema, all subtypes with the same parent data type can be passed, too. @@ -300,7 +325,7 @@ info: One of the nodes in a map of processes (the final one) MUST have the `result` flag set to `true`, all the other nodes can omit it as the default value is `false`. Having such a node is important as multiple end nodes are possible, but in most use cases it is important to exactly specify the return value to be used by other processes. Each child process graph must also specify a result node similar to the "main" process graph. - `process_id` MUST be a valid process ID in the `namespace` given. Clients SHOULD warn the user if a user-defined process is added with the same identifier as one of the pre-defined process. + `process_id` MUST be a valid process ID in the `namespace` given. Clients SHOULD warn the user if a user-defined process is added with the same identifier as one of the predefined process. ### Arguments @@ -336,18 +361,20 @@ info: This tells the back-end that the process expects the result (i.e. the return value) from another process node to be passed as argument. The `` is strictly scoped and can only reference nodes from within the same process graph, not child or parent process graphs. - ### User-defined process + ### Child processes + + Some processes can run child processes, which is similar to the concept that other programming languages call + [callbacks](https://en.wikipedia.org/wiki/Callback_(computer_programming)) or lambda functions. + Each child process is simply a user-defined process again and can in theory be arbritarily complex. - A user-defined process in a process graph is a child process graph, to be evaluated as part of another process. + A very simple example would be to calculate the absolute value of each pixel in a data cube. + This can be achieved in openEO by using the `apply` process which gets the `absolute` process passed as child process. + In this example, the "child" processes consists of a single process `absolute`, but it can also be a more complex computation such as an NDVI or a prediciton based on a machine learning model. - **Example**: You want to calculate the absolute value of each pixel in a data cube. - This can be achieved in openEO by executing the `apply` process and pass it - a user-defined process as the "operator" to apply to each pixel. - In this simple example, the "child" process graph defining the user-defined process - consists of a single process `absolute`, but it can be arbitrary complex in general. + **Example**: A `` argument MUST at least consist of an object with a key `process_graph`. - Optionally, it can also be described with the same additional properties available for pre-defined processes such as an id, parameters, return values etc. + Optionally, it can also be described with the same additional properties available for predefined processes such as an id, parameters, return values etc. When embedded in a process graph, these additional properties of a user-defined process are usually not used, except for validation purposes. ``` @@ -359,7 +386,7 @@ info: ### Accessing process parameters - A "parent" process that works with a user-defined process can make so called *process graph parameters* + A "parent" process that works with a child process can make so called *process graph parameters* available to the "child" logic. Processes in the "child" process graph can access these parameters by passing a `ParameterReference` object as argument. It is an object with key `from_parameter` specifying the name of the process graph parameter: @@ -472,7 +499,7 @@ tags: Therefore, the API leaves some aspects open that have to be handled by the back-ends separately, including - * credential recovery, e.g. retrieving a forgotten password + * credentials recovery, e.g. retrieving a forgotten password * user data management, e.g. changing the users payment details or email address * payments, i.e. topping up credits for pre-paid services or paying for post-paid services * other accounting related tasks, e.g. creating invoices, @@ -483,12 +510,12 @@ tags: ## STAC - For data discovery of Earth Observation Collections at the back-ends, openEO strives for compatibility with the specifications [SpatioTemporal Asset Catalog (STAC)](https://stacspec.org/) and [OGC API - Features - Part 1: Core](http://docs.opengeospatial.org/is/17-069r3/17-069r3.html) as far as possible. Implementing the data discovery endpoints of openEO should also produce valid STAC API 0.9.0 and OGC API - Features 1.0 responses, including ([partial](#provide-data-for-download)) compatibility with their APIs. + For data discovery of Earth Observation Collections at the back-ends, openEO strives for compatibility with the specifications [SpatioTemporal Asset Catalog (STAC)](https://stacspec.org/) and [OGC API - Features - Part 1: Core](http://docs.opengeospatial.org/is/17-069r3/17-069r3.html) as far as possible. Implementing the data discovery endpoints of openEO also produced valid STAC API 1.0 and OGC API - Features 1.0 responses, including ([partial](#provide-data-for-download)) compatibility with their APIs. The data discovery endpoints `GET /collections` and `GET /collections/{collection_id}` are compatible with OGC API - Features and STAC. Both specifications define additional endpoints that need to be implemented to be fully compatible. The additional endpoints can easily be integrated into an openEO API implementation. A rough list of actions for compatibility is available below, but please refer to their specifications to find out the full details. **Important:** [STAC specification](https://github.com/radiantearth/stac-spec) and [STAC API](https://github.com/radiantearth/stac-api-spec) are different specifications and have different version numbers after version 0.9.0. - The openEO API only implements [STAC API version 0.9.0](https://github.com/radiantearth/stac-spec/blob/v0.9.0/api-spec/README.md), which allows to serve all STAC specification versions in the range of 0.9.x and 1.x.x (see the `stac_version` property). + The openEO API implements STAC API versions >= 0.9.0 (preferrably [STAC API version 1.0.0](https://github.com/radiantearth/stac-api-spec/blob/v1.0.0/README.md), but [0.9.0](https://github.com/radiantearth/stac-spec/blob/v0.9.0/api-spec/README.md) is allowed for backward compatibility), which allows to serve all STAC specification versions in the range of 0.9.x and 1.x.x (see the `stac_version` property). ### Content Extensions @@ -507,6 +534,10 @@ tags: ### Provide data for download If you'd like to provide your data for download in addition to offering the cloud processing service, you can implement the full STAC API. Therefore you can implement the endpoints `GET /collections/{collection_id}/items` and `GET /collections/{collection_id}/items/{feature_id}` to support retrieval of individual items. To benefit from the STAC ecosystem and allow searching for items you can also implement `POST /search` and `GET /search`. Further information can be found in the [STAC API repository](https://github.com/radiantearth/stac-spec/tree/v0.9.0/api-spec). + + ### API Extensions + + STAC API has several [extensions](https://stac-api-extensions.github.io) that can be implemented on top of the openEO API to enrich the API functionality, e.g. for searching. - name: Process Discovery description: |- These endpoints allow to list the predefined processes that are available at the back-end. To list user-defined processes see '[User-Defined Processes](#tag/User-Defined-Processes)'. @@ -521,7 +552,7 @@ tags: - name: File Storage description: Management of user-uploaded assets and processed data. servers: - - url: 'https://localhost/api/{version}' + - url: 'https://openeo.example/api/{version}' description: >- The URL of the API MAY freely be chosen by the back-end providers. The path, including API versioning, is a *recommendation* only. Nevertheless, @@ -529,16 +560,23 @@ servers: secure with HTTP only! variables: version: - default: v1.0 - description: >- + default: v1 + description: |- API versioning is RECOMMENDED. As the openEO API is following - [SemVer](https://semver.org/) only the MAJOR part of the stable - version numbers (i.e. versions >= 1.0.0) SHOULD be used for API - versioning in the URL. The reason is that backward-incompatible - changes are usually introduced by major changes. Therefore, the - version number in the URL MUST not be used by the clients to detect - the version number of the API. Use the version number returned from - `GET /` instead. + [SemVer](https://semver.org/) only the **major** part of the version + numbers SHOULD be used for API versioning in the URL. To make clear + that it is a version number, it is RECOMMENDED to add the prefix `v`. + + Example: API version `1.2.3` is recommended to use `v1`. + + The reason to only consider the major part is that backward-incompatible + changes are introduced by major changes only. All changes from minor + and patch releases can usually be integrated without breakages and thus + a change in the URL is not really needed. + + The version number in the URL MUST not be used by the clients to detect + the version number of the API. Use the version number returned in the + property `api_version` from `GET /` instead. paths: /: get: @@ -580,7 +618,7 @@ paths: Version number of the openEO specification this back-end implements. enum: - - 1.1.0 + - 1.2.0 backend_version: type: string description: >- @@ -608,7 +646,7 @@ paths: title: type: string description: The name of the service. - example: Cool EO Cloud + example: Example Cloud Corp. description: type: string format: commonmark @@ -619,23 +657,26 @@ paths: [CommonMark 0.29](http://commonmark.org/) syntax MAY be used for rich text representation. example: |- - This service is provided to you by [Cool EO Cloud Corp.](http://cool-eo-cloud-corp.com). It implements the full openEO API and allows to process a range of 999 EO data sets, including + This service is provided to you by [Example Cloud Corp.](https://cloud.example). It implements the full openEO API and allows to process a range of 999 EO data sets, including * Sentinel 1/2/3 and 5 * Landsat 7/8 - A free plan is available to test the service. For further information please contact our customer service at [support@cool-eo-cloud-corp.com](mailto:support@cool-eo-cloud-corp.com). + A free plan is available to test the service. For further information please contact our customer service at [support@cloud.example](mailto:support@cloud.example). + conformsTo: + $ref: '#/components/schemas/conformsTo' production: $ref: '#/components/schemas/production' endpoints: type: array description: >- Lists all supported endpoints. Supported are all - endpoints, which are implemented, return a 2XX or 3XX HTTP - status code and are fully compatible to the API - specification. + endpoints, which are implemented, return usually + a 2XX or 3XX HTTP status code and are fully compatible + to the API specification. An entry for this endpoint (path `/` with method `GET`) SHOULD NOT be listed. + Each path MUST only be listed once in the array. items: title: Endpoint type: object @@ -709,20 +750,29 @@ paths: description: >- The currency the back-end is billing in. The currency MUST be either a valid currency code as defined in - ISO-4217 or a proprietary currency, e.g. tiles or - back-end specific credits. If set to the default value - `null`, budget and costs are not supported by the - back-end and users can't be charged. + ISO-4217 or a back-end specific unit that is used for + billing such as credits, tiles or CPU hours. + If set to `null`, budget and costs are not supported + by the back-end and users can't be charged. type: string nullable: true - default: null example: USD default_plan: type: string - description: >- - Name of the default plan to use when the user doesn't - specify a plan or has no default plan has been assigned - for the user. + description: |- + Name of the plan the back-end uses for billing in case + 1. the user has not subscribed to a specific plan + (see `default_plan` in `GET /me`) and + 2. also did not provide a specific plan with the + processing request. + + If a free plan is available at the back-end, it is + probably most useful to provide this as the back-end + wide default plan and override it with paid plans through + the user-specific default plan in `GET /me`. + Otherwise, users that have not set up payment yet MAY + receive an error for each processing requests where + they did not provide a free plan specifically. example: free plans: description: Array of plans @@ -763,19 +813,19 @@ paths: URL to a web page with more details about the plan. format: uri - example: 'http://cool-cloud-corp.com/plans/free-plan' + example: 'https://cloud.example/plans/free-plan' example: - name: free description: >- Free plan. Calculates one tile per second and a maximum amount of 100 tiles per hour. - url: 'http://cool-cloud-corp.com/plans/free-plan' + url: 'https://cloud.example/plans/free-plan' paid: false - name: premium description: >- Premium plan. Calculates unlimited tiles and each calculated tile costs 0.003 USD. - url: 'http://cool-cloud-corp.com/plans/premium-plan' + url: 'https://cloud.example/plans/premium-plan' paid: true links: description: |- @@ -786,8 +836,8 @@ paths: following `rel` (relation) types: 1. `version-history`: A link back to the Well-Known URL - (see `/.well-known/openeo`) to allow clients to work on - the most recent version. + (including `/.well-known/openeo`, see the corresponding endpoint for details) + to allow clients to work on the most recent version. 2. `terms-of-service`: A link to the terms of service. If a back-end provides a link to the terms of service, the @@ -817,33 +867,47 @@ paths: 6. `data`: A link to the collections (see `/collections`). Required if full OGC API compatibility is desired. + 7. `create-form`: A link to a user registration page. + + 8. `recovery-form`: A link to a page where a user can + recover a user account (e.g. to reset the password or send + a reminder about the username to the user's email account). + For additional relation types see also the lists of [common relation types in openEO](#section/API-Principles/Web-Linking). type: array items: $ref: '#/components/schemas/link' example: - - href: 'http://www.cool-cloud-corp.com' + - href: 'https://cloud.example' rel: about type: text/html title: Homepage of the service provider - - href: 'https://www.cool-cloud-corp.com/tos' + - href: 'https://cloud.example/tos' rel: terms-of-service type: text/html title: Terms of Service - - href: 'https://www.cool-cloud-corp.com/privacy' + - href: 'https://cloud.example/privacy' rel: privacy-policy type: text/html title: Privacy Policy - - href: 'http://www.cool-cloud-corp.com/.well-known/openeo' + - href: 'https://cloud.example/register' + rel: create-form + type: text/html + title: User Registration + - href: 'https://cloud.example/lost-password' + rel: recovery-form + type: text/html + title: Reset Password + - href: 'https://cloud.example/.well-known/openeo' rel: version-history type: application/json title: List of supported openEO versions - - href: 'http://www.cool-cloud-corp.com/api/v1.0/conformance' + - href: 'https://cloud.example/api/v1/conformance' rel: conformance type: application/json title: OGC Conformance Classes - - href: 'http://www.cool-cloud-corp.com/api/v1.0/collections' + - href: 'https://cloud.example/api/v1/collections' rel: data type: application/json title: List of Datasets @@ -873,17 +937,27 @@ paths: The Well-Known URI is the entry point for clients and users, so make sure it is permanent and easy to use and remember. Clients MUST NOT - require the well-known path (`./well-known/openeo`) in the URL that is - specified by a user to connect to the back-end. A client MUST request - `https://example.com/.well-known/openeo` if a user tries to connect to - `https://example.com`. If the request to the well-known URI fails, the - client SHOULD try to request the capabilities at `/` from - `https://example.com`. - - **This URI MUST NOT be versioned as the other endpoints.** If your API - is available at `https://example.com/api/v1.0`, the Well-Known URI - SHOULD be located at `https://example.com/.well-known/openeo` and the - URI users connect to SHOULD be `https://example.com`. + require the well-known path (`/.well-known/openeo`) in the URL that is + specified by a user to connect to the back-end. + + For clients, the usual behavior SHOULD follow these steps: + 1. The user provides a URI, which may consist of a scheme (protocol), + an authority (host, port) and a path. + 2. The client parses the URI and appends `/.well-knwon/openeo` to the + path. Make sure to correctly handle leading/trailing slashes. + 3. Send a request to the new URI. + A. On success: Detect the most suitable API instance/version (see above) + and read the [capabilites](#tag/Capabilities/operation/capabilities) + from there. + B. On failure: Directly try to read the capabilities from the original URI + given by the user. + + **This URI MUST NOT be versioned as the other endpoints.** + If your API is available at `https://openeo.example/api/v1`, and + you instruct your API users to use `https://openeo.example` as connection URI, + the Well-Known URI SHOULD be located at `https://openeo.example/.well-known/openeo`. + The Well-Known URI is usually directly located at the top-level, but it is not a + requirement. For example, `https://openeo.example/eo/.well-known/openeo` is also allowed. Clients MAY get additional information (e.g. title or description) about a back-end from the most recent version that has the `production` flag @@ -893,7 +967,7 @@ paths: security: - {} servers: - - url: 'https://localhost' + - url: 'https://openeo.example' description: >- The Well-Known URI SHOULD be available directly at `https://{{domain}}/.well-known/openeo` in contrast to the other @@ -925,7 +999,7 @@ paths: type: string format: uri description: '*Absolute* URLs to the service.' - example: 'https://example.com/api/v1.0' + example: 'https://openeo.example/api/v1' production: $ref: '#/components/schemas/production' api_version: @@ -935,13 +1009,13 @@ paths: back-end implements. example: versions: - - url: 'https://example.openeo.org/api/v0.5' + - url: 'https://openeo.example/api/v0' api_version: 0.5.1 - - url: 'https://example.openeo.org/api/v1.0' - api_version: 1.0.0 - - url: 'https://example.openeo.org/api/v1.1' + - url: 'https://openeo.example/api/v1' + api_version: 1.2.0 + - url: 'https://dev.openeo.example/api/v2' production: false - api_version: 1.1.0-beta + api_version: 2.0.0-beta 4XX: $ref: '#/components/responses/client_error' 5XX: @@ -962,8 +1036,8 @@ paths: **Note**: Format names and parameters MUST be fully aligned with the GDAL codes if available, see [GDAL Raster - Formats](http://www.gdal.org/formats_list.html) and [OGR Vector - Formats](http://www.gdal.org/ogr_formats.html). It is OPTIONAL to + Formats](https://gdal.org/drivers/raster/index.html) and [OGR Vector + Formats](https://gdal.org/drivers/vector/index.html). It is OPTIONAL to support all output format parameters supported by GDAL. Some file formats not available through GDAL may be defined centrally for openEO. Custom file formats or parameters MAY be defined. @@ -1042,7 +1116,7 @@ paths: compress: type: string description: Set the compression to use. - default: none + default: NONE enum: - JPEG - LZW @@ -1055,7 +1129,7 @@ paths: maximum: 100 default: 75 links: - - href: 'https://www.gdal.org/frmt_gtiff.html' + - href: 'https://gdal.org/drivers/raster/gtiff.html' rel: about title: GDAL on the GeoTiff file format and storage options GPKG: @@ -1076,10 +1150,10 @@ paths: - '1.2' default: auto links: - - href: 'https://www.gdal.org/drv_geopackage_raster.html' + - href: 'https://gdal.org/drivers/raster/gpkg.html' rel: about title: GDAL on GeoPackage for raster data - - href: 'https://www.gdal.org/drv_geopackage.html' + - href: 'https://gdal.org/drivers/vector/gpkg.html' rel: about title: GDAL on GeoPackage for vector data input: @@ -1097,10 +1171,10 @@ paths: table, this option is not necessary. Otherwise, it is required. links: - - href: 'https://www.gdal.org/drv_geopackage_raster.html' + - href: 'https://gdal.org/drivers/raster/gpkg.html' rel: about title: GDAL on GeoPackage for raster data - - href: 'https://www.gdal.org/drv_geopackage.html' + - href: 'https://gdal.org/drivers/vector/gpkg.html' rel: about title: GDAL on GeoPackage for vector data 4XX: @@ -1109,14 +1183,25 @@ paths: $ref: '#/components/responses/server_error' /conformance: get: - summary: OGC specifications this API conforms to + summary: Conformance classes this API implements operationId: conformance - description: >- - Lists all conformance classes specified in OGC standards that the - server conforms to. - - This endpoint is only required if full compliance with OGC API standards is desired. - Therefore, openEO back-ends MAY implement it for compatibility with OGC API clients and openEO clients don't need to request it. + description: |- + Lists all conformance classes specified in various standards that the + implementation conforms to. Conformance classes are commonly used in + all OGC APIs and the STAC API specification. openEO adds relatively + broadly defined conformance classes, especially for the extensions. + Otherwise, the implemented functionality can usually be retrieved from + the [capabilties](#tag/Capabilities/operation/capabilities) in openEO. + + The general openEO conformance class is `https://api.openeo.org/1.2.0`. + See the individual openEO API extensions for their conformance classes. + + The conformance classes listed at this endpoint and listed in the + corresponding `conformsTo` property in `GET /` MUST be equal. + + More details: + - [STAC API](https://github.com/radiantearth/stac-api-spec), especially the conformance class "STAC API - Collections" + - [OGC APIs](https://ogcapi.ogc.org/) tags: - Capabilities responses: @@ -1131,14 +1216,7 @@ paths: - conformsTo properties: conformsTo: - type: array - items: - type: string - format: uri - example: http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/core - example: - conformsTo: - - 'http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/core' + $ref: '#/components/schemas/conformsTo' 5XX: $ref: '#/components/responses/server_error' /collections: @@ -1154,12 +1232,15 @@ paths: To get the full metadata for a collection clients MUST request `GET /collections/{collection_id}`. - This endpoint is compatible with [STAC API 0.9.0](https://stacspec.org) and - [OGC API - Features](http://docs.opengeospatial.org/is/17-069r3/17-069r3.html). - [STAC API](https://github.com/radiantearth/stac-spec/tree/v0.9.0/api-spec) - features / extensions and + This endpoint is compatible with [STAC API 0.9.0 and later](https://stacspec.org) and + [OGC API - Features 1.0](http://docs.opengeospatial.org/is/17-069r3/17-069r3.html). + [STAC API extensions](https://stac-api-extensions.github.io) and [STAC extensions](https://stac-extensions.github.io) can be implemented in addition to what is documented here. + + Note: Although it is possible to request public collections without + authorization, it is RECOMMENDED that clients (re-)request the collections + with the Bearer token once available to also retrieve any private collections. tags: - EO Data Discovery security: @@ -1187,7 +1268,7 @@ paths: $ref: '#/components/schemas/links_pagination' example: collections: - - stac_version: 1.0.0-rc.2 + - stac_version: 1.0.0 type: Collection id: Sentinel-2A title: Sentinel-2A MSI L1C @@ -1230,7 +1311,7 @@ paths: - rel: license href: >- https://scihub.copernicus.eu/twiki/pub/SciHubWebPortal/TermsConditions/Sentinel_Data_Terms_and_Conditions.pdf - - stac_version: 1.0.0-rc.2 + - stac_version: 1.0.0 type: Collection id: MOD09Q1 title: >- @@ -1264,10 +1345,10 @@ paths: - null links: - rel: license - href: 'https://example.openeo.org/api/collections/MOD09Q1/license' + href: 'https://openeo.example/api/v1/collections/MOD09Q1/license' links: - rel: alternate - href: 'https://example.openeo.org/csw' + href: 'https://openeo.example/csw' title: openEO catalog (OGC Catalogue Services 3.0) 4XX: $ref: '#/components/responses/client_error_auth' @@ -1281,24 +1362,20 @@ paths: Lists **all** information about a specific collection specified by the identifier `collection_id`. - This endpoint is compatible with [STAC API 0.9.0](https://stacspec.org) and - [OGC API - Features](http://docs.opengeospatial.org/is/17-069r3/17-069r3.html). - [STAC API](https://github.com/radiantearth/stac-spec/tree/v0.9.0/api-spec) - features / extensions and + This endpoint is compatible with [STAC API 0.9.0 and later](https://stacspec.org) and + [OGC API - Features 1.0](http://docs.opengeospatial.org/is/17-069r3/17-069r3.html). + [STAC API extensions](https://stac-api-extensions.github.io) and [STAC extensions](https://stac-extensions.github.io) can be implemented in addition to what is documented here. + + Note: Providing the Bearer token is REQUIRED for private collections. tags: - EO Data Discovery security: - {} - Bearer: [] parameters: - - name: collection_id - in: path - description: Collection identifier - required: true - schema: - $ref: '#/components/schemas/collection_id' + - $ref: '#/components/parameters/collection_id' responses: '200': description: JSON object with the full collection metadata. @@ -1312,9 +1389,9 @@ paths: allOf: - $ref: '#/components/schemas/collection' example: - stac_version: 1.0.0-rc.2 + stac_version: 1.0.0 stac_extensions: - - https://stac-extensions.github.io/datacube/v1.0.0/schema.json + - https://stac-extensions.github.io/datacube/v2.2.0/schema.json type: Collection id: Sentinel-2 title: Sentinel-2 MSI L2A @@ -1355,16 +1432,19 @@ paths: - rel: license href: https://scihub.copernicus.eu/twiki/pub/SciHubWebPortal/TermsConditions/Sentinel_Data_Terms_and_Conditions.pdf type: application/pdf + - rel: http://www.opengis.net/def/rel/ogc/1.0/queryables + href: https://openeo.example/api/v1/collections/Sentinel-2A/queryables + type: application/schema+json - rel: about href: https://earth.esa.int/web/sentinel/user-guides/sentinel-2-msi/product-types/level-1c type: text/html title: ESA Sentinel-2 MSI Level-1C User Guide - rel: example - href: 'https://example.openeo.org/api/collections/Sentinel-2/examples/true-color.json' + href: 'https://openeo.example/api/v1/collections/Sentinel-2/examples/true-color.json' type: application/json title: Example Process for True-Color Visualization - rel: example - href: 'https://example.openeo.org/api/collections/Sentinel-2/examples/ndvi.json' + href: 'https://openeo.example/api/v1/collections/Sentinel-2/examples/ndvi.json' type: application/json title: Example Process for NDVI Calculation and Visualization 'cube:dimensions': @@ -1418,7 +1498,7 @@ paths: 'sat:orbit_state': - ascending - descending - 'eo:gsd': + 'gsd': - 10 - 20 - 60 @@ -1477,13 +1557,13 @@ paths: max: 32660 assets: thumbnail: - href: 'https://example.openeo.org/api/collections/Sentinel-2/thumbnail.png' + href: 'https://openeo.example/api/v1/collections/Sentinel-2/thumbnail.png' type: image/png title: Preview roles: - thumbnail inspire: - href: 'https://example.openeo.org/api/collections/Sentinel-2/inspire.xml' + href: 'https://openeo.example/api/v1/collections/Sentinel-2/inspire.xml' type: application/xml title: INSPIRE metadata description: INSPIRE compliant XML metadata @@ -1493,6 +1573,67 @@ paths: $ref: '#/components/responses/client_error_auth' 5XX: $ref: '#/components/responses/server_error' + '/collections/{collection_id}/queryables': + get: + summary: Metadata filters for a specific dataset + operationId: list-collection-queryables + description: |- + Lists **all** supported metadata filters (also called "queryables") for + a specific collection. + + This endpoint is compatible with endpoint defined in the STAC API extension + [`filter`](https://github.com/stac-api-extensions/filter#queryables) and + [OGC API - Features - Part 3: Filtering](https://github.com/opengeospatial/ogcapi-features/tree/master/extensions/filtering). + For a precise definition please follow those specifications. + + This endpoints provides a JSON Schema for each queryable that openEO + users can use in multiple scenarios: + 1. For loading data from the collection, e.g. in the process `load_collection`. + 2. For filtering items using CQL2 on the `/collections/{collection_id}/items` endpoint + (if [STAC API - Features is implemented in addition to the openEO API](#tag/EO-Data-Discovery/STAC)). + + Note: Providing the Bearer token is REQUIRED for private collections. + tags: + - EO Data Discovery + security: + - {} + - Bearer: [] + parameters: + - $ref: '#/components/parameters/collection_id' + responses: + '200': + description: |- + A JSON Schema defining the queryables. + + It is RECOMMENDED to dereference all "$refs". + content: + application/schema+json: + schema: + $ref: '#/components/schemas/json_schema' + example: + $schema: https://json-schema.org/draft/2019-09/schema + $id: https://openeo.example/api/v1/collections/Sentinel-2A/queryables + type: object + title: Sentinel 2A + properties: + 'eo:cloud_cover': + title: Cloud Cover + type: number + minimum: 0 + maximum: 100 + platform: + title: Platform + description: The satellite platform. + type: string + enum: + - sentinel-2a + - sentinel-2b + additionalProperties: false + + 4XX: + $ref: '#/components/responses/client_error_auth' + 5XX: + $ref: '#/components/responses/server_error' /processes: get: summary: Supported predefined processes @@ -1522,8 +1663,8 @@ paths: processes: type: array items: - title: Pre-Defined Process - description: A pre-defined process made available by the back-end. + title: Predefined Process + description: A predefined process made available by the back-end. type: object required: - id @@ -1547,7 +1688,7 @@ paths: description: A data cube. schema: type: object - subtype: raster-cube + subtype: datacube - name: process description: 'A unary process to be applied on each value, may consist of multiple sub-processes.' schema: @@ -1562,7 +1703,7 @@ paths: description: 'A data cube with the newly computed values. The resolution, cardinality and the number of dimensions are the same as for the original data cube.' schema: type: object - subtype: raster-cube + subtype: datacube - id: multiply summary: Multiplication of two numbers description: |- @@ -1617,7 +1758,7 @@ paths: title: IEEE Standard 754-2019 for Floating-Point Arithmetic links: - rel: alternate - href: 'https://provider.com/processes' + href: 'https://openeo.example/processes' type: text/html title: HTML version of the processes 4XX: @@ -1646,19 +1787,24 @@ paths: schema: title: UDF Runtimes type: object - description: >- - Map of available runtime environments. Each runtime - environment has a unique name, which is used as the property - key. The name is used in processes to select the runtime - environment for UDFs, so the names should be stable and - meaningful (see example). Runtime environments can be either a - programming language environment or Docker-based. + description: |- + Map of available runtime environments. Runtime environments + can be either a programming language environment or Docker-based. + + Each runtime environment has a unique name, which is used as + the property key. The name is used in processes to select the + runtime environment for UDFs, so the names should be stable and + meaningful. + It is RECOMMENDED to use the following naming and casing: + * For programming langauge environments use the names as provided + in in the [Scriptol List of Programming Languages](https://www.scriptol.com/programming/list-programming-languages.php). + * For docker images use the docker image identifier excluding the registry path. additionalProperties: x-additionalPropertiesName: UDF Runtime name allOf: - $ref: '#/components/schemas/udf_runtime' example: - PHP7: + PHP: title: PHP v7.x description: Just an example how to reference a docker image. experimental: true @@ -1778,7 +1924,7 @@ paths: id: type: string description: >- - A **unique** identifier for the OpenID Connect Provider to + A per-backend **unique** identifier for the OpenID Connect Provider to be as prefix for the Bearer token. pattern: '[\d\w]{1,20}' issuer: @@ -1803,7 +1949,9 @@ paths: scopes: type: array description: >- - A list of OpenID Connect scopes that the client MUST include when requesting authorization. + A list of OpenID Connect scopes that the client MUST at least include when requesting authorization. + Clients MAY add additional scopes such as the `offline_access` scope to retrieve a refresh token. + If scopes are specified, the list MUST at least contain the `openid` scope. items: type: string @@ -1830,13 +1978,13 @@ paths: List of default OpenID Connect clients that can be used by an openEO client for OpenID Connect based authentication. - A default OpenID Connect client is managed by the backend implementer. + A default OpenID Connect client is managed by the back-end implementer. It MUST be configured to be usable without a client secret, which limits its applicability to OpenID Connect grant types like "Authorization Code Grant with PKCE" and "Device Authorization Grant with PKCE" A default OpenID Connect client is provided without availability guarantees. - The backend implementer CAN revoke, reset or update it any time. + The back-end implementer CAN revoke, reset or update it any time. As such, openEO clients SHOULD NOT store or cache default OpenID Connect client information for long term usage. A default OpenID Connect client is intended to simplify authentication for novice users. @@ -1863,8 +2011,8 @@ paths: Allowed values: - `implicit`: Implicit Grant as specified in [RFC 6749, sec. 1.3.2](https://www.rfc-editor.org/rfc/rfc6749.html#section-1.3.2) - - `authorization_code+pkce`: Authorization Code Grant as specified in [RFC 6749, sec. 1.3.1](https://www.rfc-editor.org/rfc/rfc6749.html#section-1.3.1), with PKCE extension. - - `urn:ietf:params:oauth:grant-type:device_code+pkce`: Device Authorization Grant (aka Device Code Flow) as specified in [RFC 8628](https://www.rfc-editor.org/rfc/rfc8628.html), with PKCE extension. Note that the combination of this grant with the PKCE extension is *not standardized* yet. + - `authorization_code` / `authorization_code+pkce`: Authorization Code Grant as specified in [RFC 6749, sec. 1.3.1](https://www.rfc-editor.org/rfc/rfc6749.html#section-1.3.1), with or without PKCE extension. + - `urn:ietf:params:oauth:grant-type:device_code` / `urn:ietf:params:oauth:grant-type:device_code+pkce`: Device Authorization Grant (aka Device Code Flow) as specified in [RFC 8628](https://www.rfc-editor.org/rfc/rfc8628.html), with or without PKCE extension. Note that the combination of this grant with the PKCE extension is *not standardized* yet. - `refresh_token`: Refresh Token as specified in [RFC 6749, sec. 1.5](https://www.rfc-editor.org/rfc/rfc6749.html#section-1.5) minItems: 1 uniqueItems: true @@ -1872,7 +2020,9 @@ paths: type: string enum: - 'implicit' + - 'authorization_code' - 'authorization_code+pkce' + - 'urn:ietf:params:oauth:grant-type:device_code' - 'urn:ietf:params:oauth:grant-type:device_code+pkce' - 'refresh_token' redirect_urls: @@ -1880,7 +2030,7 @@ paths: description: |- List of redirect URLs that are whitelisted by the OpenID Connect client. Redirect URLs MUST be provided when the OpenID Connect client supports - the `implicit` or `authorization_code+pkce` authorization flows. + the Implicit Grant or the Authorization Code Grant (with or without PKCE extension). uniqueItems: true items: type: string @@ -2106,7 +2256,7 @@ paths: schema: type: string pattern: ^<[^>]+>;\s?rel="monitor" - example: ; rel="monitor" + example: ; rel="monitor" 4XX: $ref: '#/components/responses/client_error_auth' 5XX: @@ -2128,6 +2278,10 @@ paths: $ref: '#/components/schemas/budget' plan: $ref: '#/components/schemas/billing_plan_null_default' + log_level: + $ref: '#/components/schemas/min_log_level_default' + additionalProperties: + description: You can add additional back-end specific properties here. /process_graphs: get: summary: List all user-defined processes @@ -2215,7 +2369,7 @@ paths: parameters: - name: process_graph_id in: path - description: Unique identifier for a user-defined process. + description: Per-user unique identifier for a user-defined process. required: true schema: $ref: '#/components/schemas/process_id' @@ -2253,12 +2407,11 @@ paths: operationId: store-custom-process description: |- Stores a provided user-defined process with process graph that can be - reused in other processes. If a process with the specified - `process_graph_id` exists, the process is fully replaced. The id can't - be changed for stored user-defined processes. - - The id MUST be unique for the authenticated user, including all - pre-defined processes by the back-end. + reused in other processes. + + If a process with the specified `process_graph_id` exists, the process + is fully replaced. The id can't be changed for existing user-defined + processes. The id MUST be unique across its namespace. Partially updating user-defined processes is not supported. @@ -2379,7 +2532,7 @@ paths: description: List of parameters made available to user-defined processes. type: array items: - $ref: '#/components/schemas/parameter' + $ref: '#/components/schemas/process_parameter' links: description: |- Links related to this service type, e.g. more @@ -2407,22 +2560,28 @@ paths: schema: type: string default: roads - - name: spatial_extent_west - description: The lower left corner for coordinate axis 1 of the extent currently shown to the consumer. - schema: - type: number - - name: spatial_extent_south - description: The lower left corner for coordinate axis 2 of the extent currently shown to the consumer. - schema: - type: number - - name: spatial_extent_east - description: The upper right corner for coordinate axis 1 of the extent currently shown to the consumer. - schema: - type: number - - name: spatial_extent_north - description: The upper right corner for coordinate axis 2 of the extent currently shown to the consumer. + - name: spatial_extent + description: A bounding box in WGS84. schema: - type: number + type: object + required: + - west + - south + - east + - north + properties: + west: + description: West (lower left corner, coordinate axis 1). + type: number + south: + description: South (lower left corner, coordinate axis 2). + type: number + east: + description: East (upper right corner, coordinate axis 1). + type: number + north: + description: North (upper right corner, coordinate axis 2). + type: number links: - href: 'https://www.opengeospatial.org/standards/wms' rel: about @@ -2466,8 +2625,8 @@ paths: description: |- Lists all secondary web services submitted by a user. - It is **strongly RECOMMENDED** to keep the response size small by - omitting all optional non-scalar values from objects in`services` + It is **strongly RECOMMENDED** to keep the response size small by omitting + all optional non-scalar values (i.e. arrays and objects) from objects in `services` (i.e. the `process`, `configuration` and `attributes` properties). To get the full metadata for a secondary web service clients MUST request `GET /services/{service_id}`. @@ -2541,7 +2700,7 @@ paths: metadata endpoint in the property `url`. format: uri type: string - example: 'https://example.openeo.org/api/services/123' + example: 'https://openeo.example/api/v1/services/123' OpenEO-Identifier: required: true schema: @@ -2570,13 +2729,19 @@ paths: type: $ref: '#/components/schemas/service_type' enabled: - $ref: '#/components/schemas/service_enabled_default' + allOf: + - $ref: '#/components/schemas/service_enabled' + - default: true configuration: $ref: '#/components/schemas/service_configuration' plan: $ref: '#/components/schemas/billing_plan_null_default' budget: $ref: '#/components/schemas/budget' + log_level: + $ref: '#/components/schemas/min_log_level_default' + additionalProperties: + description: You can add additional back-end specific properties here. description: The base data for the secondary web service to create '/services/{service_id}': parameters: @@ -2584,11 +2749,10 @@ paths: patch: summary: Modify a service operationId: update-service - description: >- + description: |- Modifies an existing secondary web service at the back-end, but maintain the identifier. Changes can be grouped in a single request. - User have to create a new service to change the service type. tags: - Secondary Services @@ -2623,6 +2787,8 @@ paths: $ref: '#/components/schemas/billing_plan_null' budget: $ref: '#/components/schemas/budget_update' + log_level: + $ref: '#/components/schemas/min_log_level_update' description: The data to change for the specified secondary web service. get: summary: Full metadata for a service @@ -2677,7 +2843,7 @@ paths: Back-ends can log any information that may be relevant for a user. Users can log information during data processing using respective - processes such as `debug`. + processes such as `inspect`. If requested consecutively while the secondary service is enabled, it is RECOMMENDED that clients use the offset parameter to get only the entries @@ -2692,6 +2858,7 @@ paths: parameters: - $ref: '#/components/parameters/service_id' - $ref: '#/components/parameters/log_offset' + - $ref: '#/components/parameters/log_level' - $ref: '#/components/parameters/pagination_limit' responses: '200': @@ -2708,7 +2875,8 @@ paths: Lists all batch jobs submitted by a user. It is **strongly RECOMMENDED** to keep the response size small by - omitting all optional non-scalar values from objects in `jobs` (i.e. the `process` property). + omitting all optional non-scalar values (i.e. arrays and objects) from + objects in `jobs` (i.e. the `process` property). To get the full metadata for a job clients MUST request `GET /jobs/{job_id}`. tags: - Data Processing @@ -2768,7 +2936,7 @@ paths: unique identifier (ID) of the created batch job. format: uri type: string - example: 'https://example.openeo.org/api/jobs/123' + example: 'https://openeo.example/api/v1/jobs/123' OpenEO-Identifier: required: true schema: @@ -2797,6 +2965,10 @@ paths: $ref: '#/components/schemas/billing_plan_null_default' budget: $ref: '#/components/schemas/budget' + log_level: + $ref: '#/components/schemas/min_log_level_default' + additionalProperties: + description: You can add additional back-end specific properties here. description: 'Specifies the job details, e.g. the user-defined process and billing details.' '/jobs/{job_id}': parameters: @@ -2804,13 +2976,14 @@ paths: patch: summary: Modify a batch job operationId: update-job - description: >- + description: |- Modifies an existing job at the back-end, but maintains the identifier. Changes can be grouped in a single request. + The job status does not change. - Jobs can only be modified when the job is not queued or running. - Otherwise requests to this endpoint MUST be rejected with openEO error + Jobs can only be modified when the job is not queued and not running. + Otherwise, requests to this endpoint MUST be rejected with openEO error `JobLocked`. tags: - Data Processing @@ -2842,6 +3015,8 @@ paths: $ref: '#/components/schemas/billing_plan_null' budget: $ref: '#/components/schemas/budget_update' + log_level: + $ref: '#/components/schemas/min_log_level_update' description: Specifies the job details to update. get: summary: Full metadata for a batch job @@ -2893,12 +3068,20 @@ paths: description: >- Calculates an estimate for a batch job. Back-ends can decide to either calculate the duration, the costs, the size or a combination of - them. This MUST be the upper limit of the incurring costs. Clients can - be charged less than specified, but never more. Back-end providers MAY - specify an expiry time for the estimate. Starting to process data - afterwards MAY be charged at a higher cost. Costs MAY NOT include - downloading costs. This can be indicated with the `downloads_included` - flag. + them. + + Back-end providers MAY specify an expiry time for the estimate. + Starting to process data afterwards MAY be charged at a higher cost. + Costs do often not include download costs. Whether download costs are included or not can be indicated explicitly with the + `downloads_included` flag. + + The estimate SHOULD be the upper limit of the costs, but back-end are + free to use the field according to their terms of service. + + For some batch jobs it is not (easily) possible to estimate the costs + reliably, e.g. if a UDF or ML model is part of the process. + In this case, the server SHOULD return a `EstimateComplexity` error + with HTTP status code 500. tags: - Data Processing - Batch Jobs @@ -2969,7 +3152,7 @@ paths: Back-ends can log any information that may be relevant for a user at any stage (status) of the batch job. Users can log information during data processing using respective - processes such as `debug`. + processes such as `inspect`. If requested consecutively, it is RECOMMENDED that clients use the offset parameter to get only the entries they have not received yet. @@ -2984,6 +3167,7 @@ paths: parameters: - $ref: '#/components/parameters/job_id' - $ref: '#/components/parameters/log_offset' + - $ref: '#/components/parameters/log_level' - $ref: '#/components/parameters/pagination_limit' responses: '200': @@ -2996,17 +3180,17 @@ paths: parameters: - $ref: '#/components/parameters/job_id' get: - summary: Download results for a completed batch job + summary: List batch job results operationId: list-results description: |- - Lists signed URLs pointing to the processed files after the batch job + Lists signed URLs pointing to the processed files, usually after the batch job has finished. Back-ends may also point to intermediate results after the - job has stopped due to an error. + job has stopped due to an error or if the `partial` parameter has been set. The response includes additional metadata. It is a valid - [STAC Item](https://github.com/radiantearth/stac-spec/tree/v1.0.0-rc.2/item-spec) + [STAC Item](https://github.com/radiantearth/stac-spec/tree/v1.0.0/item-spec) (if it has spatial and temporal references included) or a valid - [STAC Collection](https://github.com/radiantearth/stac-spec/tree/v1.0.0-rc.2/collection-spec) + [STAC Collection](https://github.com/radiantearth/stac-spec/tree/v1.0.0/collection-spec) (supported since openEO API version 1.1.0). The assets to download are in both cases available in the property `assets` and have the same structure. All additional metadata is not strictly required @@ -3014,10 +3198,10 @@ paths: STAC Collections can either (1) add all assets as collection-level assets or (2) link to STAC Catalogs and STAC Items with signed URLs, which will provide a full - STAC catalog structure a client has to go through. While (2) is overall the better + STAC catalog structure a client has to go through. Option 2 is overall the better architectural choice and allows a fine-grained description of the processed data, - (1) is not compliant with previous versions of the openEO API. - **To maintain backward compatibility, it is REQUIRED for (2) to still copy + but it is not compliant with previous versions of the openEO API. + **To maintain backward compatibility, it is REQUIRED to still copy all assets in the STAC catalog structure into the collection-level assets.** This requirement is planned to be removed in openEO API version 2.0.0. A client can enforce that the server returns a GeoJSON through content negotiation @@ -3041,13 +3225,29 @@ paths: but regenerated with new expiration time. Signed URLs that expired MAY return the openEO error `ResultLinkExpired`. - If processing has not finished yet requests to this endpoint MUST be - rejected with openEO error `JobNotFinished`. + It is **strongly recommended** to add a link with relation type `canonical` + to the STAC Item or STAC Collection (see the `links` property for details). + + If processing has not finished yet and the `partial` parameter is not set to `true` + requests to this endpoint MUST be rejected with openEO error `JobNotFinished`. tags: - Data Processing - Batch Jobs security: - Bearer: [] + parameters: + - name: partial + description: >- + If set to `true`, the results endpoint returns incomplete results while + still running. + + Enabling this parameter requires to indicate the status of the batch job + in the STAC metadata by setting the `openeo:status`. + in: query + allowEmptyValue: true + schema: + type: boolean + default: false responses: '200': description: >- @@ -3061,7 +3261,8 @@ paths: to `0` if the requester is the owner of the job and still has free downloads included in his processing charges estimated by `GET /jobs/{job_id}/estimate`. - If a requester other than the owner is requesting the data of a shared job this header indicates the costs for the requester. + If a requester other than the owner is requesting the data of a + shared job this header indicates the costs for the requester. schema: $ref: '#/components/schemas/money' content: @@ -3073,22 +3274,25 @@ paths: type: object required: - assets + properties: + 'openeo:status': + $ref: '#/components/schemas/result_status' allOf: - $ref: '#/components/schemas/collection' example: - stac_version: 1.0.0-rc.2 + stac_version: 1.0.0 id: a3cca2b2aa1e3b5b title: NDVI based on Sentinel 2 description: Deriving minimum NDVI measurements over pixel time series of Sentinel 2 license: Apache-2.0 providers: - - name: Cool EO Cloud Corp + - name: Example Cloud Corp. description: No further processing applied. roles: - producer - licensor - host - url: http://cool-eo-cloud-corp.com + url: https://cloud.example extent: temporal: interval: @@ -3102,42 +3306,45 @@ paths: - 90 assets: preview.png: - href: 'https://example.openeo.org/api/download/583fba8b2ce583fba8b2ce/preview.png' + href: 'https://openeo.example/api/v1/download/583fba8b2ce583fba8b2ce/preview.png' type: image/png title: Thumbnail roles: - thumbnail process.json: - href: 'https://example.openeo.org/api/download/583fba8b2ce583fba8b2ce/process.json' + href: 'https://openeo.example/api/v1/download/583fba8b2ce583fba8b2ce/process.json' type: application/json title: Original Process roles: - process - reproduction 1.tif: - href: 'https://example.openeo.org/api/download/583fba8b2ce583fba8b2ce/1.tif' + href: 'https://openeo.example/api/v1/download/583fba8b2ce583fba8b2ce/1.tif' type: image/tiff; application=geotiff roles: - data 2.tif: - href: 'https://example.openeo.org/api/download/583fba8b2ce583fba8b2ce/2.tif' + href: 'https://openeo.example/api/v1/download/583fba8b2ce583fba8b2ce/2.tif' type: image/tiff; application=geotiff roles: - data inspire.xml: - href: 'https://example.openeo.org/api/download/583fba8b2ce583fba8b2ce/inspire.xml' + href: 'https://openeo.example/api/v1/download/583fba8b2ce583fba8b2ce/inspire.xml' type: application/xml title: INSPIRE metadata description: INSPIRE compliant XML metadata roles: - metadata links: - - rel: item + - rel: canonical type: application/json - href: https://example.openeo.org/api/download/583fba8b2ce583fba8b2ce/item_1.json + href: https://openeo.example/api/v1/download/583fba8b2ce583fba8b2ce/collection.json - rel: item - type: application/json - href: https://example.openeo.org/api/download/583fba8b2ce583fba8b2ce/item_2.json + type: application/geo+json + href: https://openeo.example/api/v1/download/583fba8b2ce583fba8b2ce/item_1.json + - rel: item + type: application/geo+json + href: https://openeo.example/api/v1/download/583fba8b2ce583fba8b2ce/item_2.json application/geo+json: schema: $ref: '#/components/schemas/batch_job_result' @@ -3165,12 +3372,12 @@ paths: The result will be stored in the format specified in the process. To specify the format use a process such as `save_result`. - This endpoint has no effect if the job status is already `queued` or - `running`. In particular, it doesn't restart a running job. Processing - MUST be canceled before to restart it. - The job status is set to `queued`, if processing doesn't start - instantly. + instantly. The same applies if the job status is `canceled`, `finished`, + or `error`, which restarts the job and discards previous results if the + back-end doesn't reject the request with an error. + Clients SHOULD warn users and ask for confirmation if results may get + discarded. * Once the processing starts the status is set to `running`. * Once the data is available to download the status is set to @@ -3178,6 +3385,10 @@ paths: * Whenever an error occurs during processing, the status MUST be set to `error`. + This endpoint has no effect if the job status is already `queued` or + `running`. In particular, it doesn't restart a running job. To restart + a queued or running job, processing MUST have been canceled before. + Back-ends SHOULD reject queueing jobs with openEO error `PaymentRequired`, if the back-end is able to detect that the budget is too low to fully process the request. Alternatively, back-ends MAY provide partial results @@ -3199,20 +3410,20 @@ paths: delete: summary: Cancel processing a batch job operationId: stop-job - description: >- + description: |- Cancels all related computations for this job at the back-end. It will stop generating additional costs for processing. - A subset of processed results may be available for downloading depending - on the state of the job as it was canceled. Finished results MUST NOT be - deleted until the job is deleted or job processing is started again. + on the state of the job at the time it was canceled. + Results MUST NOT be deleted until the job processing is started again or + the job is completely deleted through a request to + `DELETE /jobs/{job_id}`. This endpoint only has an effect if the job status is `queued` or `running`. - The job status is set to `canceled` if the status was `running` beforehand and partial or preliminary results are available to be downloaded. Otherwise the status is set to `created`. @@ -3422,7 +3633,13 @@ paths: - user_id properties: user_id: - $ref: '#/components/schemas/user_id' + type: string + description: >- + A unique user identifier specific to the back-end, which could either be chosen by a user or is automatically generated by the back-end during the registration process at the back-end. + + It is meant to be used as an identifier in URIs (e.g. for sharing purposes), which is primarily used in machine-to-machine communication. Preferrably use the human-readable property `name` to display the user's name in user interfaces instead of the user identifier. + pattern: '^[\w\-\.~]+$' + example: john_doe name: type: string description: >- @@ -3430,14 +3647,7 @@ paths: the user's real name or a nickname. default_plan: type: string - nullable: true - description: |- - Name of the plan the user has subscribed to. - - Overrides the default plan of the back-end, but back-ends - MAY also allow overriding this plan for each individual - processing request (e.g. job or service) with the - corresponding `plan` property. + description: Name of the single plan the user is currently subscribed to if any. example: free storage: title: User Storage @@ -3463,7 +3673,12 @@ paths: to the user. example: 1073741824 budget: - $ref: '#/components/schemas/budget' + type: number + nullable: true + description: |- + The remaining budget a user has available. + The value MUST be specified in the currency of the back-end. + The value SHOULD be set to `null` if no explicit limit applies. links: description: |- Links related to the user profile, e.g. where payments @@ -3475,30 +3690,61 @@ paths: 2. `edit-form`: Points to a page where the user can edit his user profile. + 3. `alternate`: Any other representation of these (and potentially additional) + user information, e.g. the (public) user profile page. + It is RECOMMENDED to add descriptive titles for a better user experience. + + 4. `related`: Any other user-specific links to be shown in clients, + e.g. to user-specific settings, invoices, etc. It is RECOMMENDED to + add descriptive titles for a better user experience. + For additional relation types see also the lists of [common relation types in openEO](#section/API-Principles/Web-Linking). type: array items: $ref: '#/components/schemas/link' example: - - href: 'https://example.openeo.org/john_doe/payment/' + - href: 'https://openeo.example/john_doe/payment/' rel: payment - - href: 'https://example.openeo.org/john_doe/edit/' + - href: 'https://openeo.example/john_doe/edit/' rel: edit-form - - href: 'https://example.openeo.org/john_doe/' + - href: 'https://openeo.example/john_doe/' rel: alternate type: text/html title: User profile - - href: 'https://example.openeo.org/john_doe.vcf' + - href: 'https://openeo.example/john_doe.vcf' rel: alternate type: text/vcard title: vCard of John Doe + - href: 'https://openeo.example/john_doe/invoices' + rel: related + type: text/html + title: Invoices 4XX: $ref: '#/components/responses/client_error_auth' 5XX: $ref: '#/components/responses/server_error' components: schemas: + conformsTo: + description: |- + Lists all conformance classes specified in various standards that the + implementation conforms to. Conformance classes are commonly used in + all OGC APIs and the STAC API specification. + + The general openEO conformance class is `https://api.openeo.org/1.2.0`. + See the individual openEO API extensions for their conformance classes. + + This property is REQUIRED for STAC API versions 1.0.0-beta.1 and later. + type: array + items: + type: string + format: uri + example: + - https://api.openeo.org/1.2.0 + - https://api.openeo.org/extensions/commercial-data/0.1.0 + - https://api.openeo.org/extensions/federation/0.1.0 + - https://api.stacspec.org/v1.0.0/collections udf_runtime: type: object required: @@ -3514,7 +3760,7 @@ components: description: |- The type of the UDF runtime. - Pre-defined types are: + Predefined types are: * `language` for Programming Languages and * `docker` for Docker Containers. @@ -3534,7 +3780,8 @@ components: the following `rel` (relation) types: 1. `about`: A resource that further explains the runtime, - e.g. a user guide or the documentation. + e.g. a user guide or the documentation. It is RECOMMENDED to + add descriptive titles for a better user experience. For additional relation types see also the lists of [common relation types in openEO](#section/API-Principles/Web-Linking). @@ -3599,7 +3846,8 @@ components: the following `rel` (relation) types: 1. `about`: A resource that further explains the library, - e.g. a user guide or the documentation. + e.g. a user guide or the documentation. It is RECOMMENDED to + add descriptive titles for a better user experience. 2. `latest-version`: If a library has been marked as deprecated, a link SHOULD point to either a new library replacing the deprecated @@ -3620,8 +3868,10 @@ components: docker: type: string description: >- - Identifier of a Docker image on Docker Hub or a - private repository, i.e. the docker image name. + Identifier of a Docker image on Docker Hub or a private repository, + which can run openEO UDFs. + This is what is used in the `docker pull` command excluding the tag, + e.g. `php`, `mcr.microsoft.com/dotnet/runtime` or `myregistry.local:5000/testing/test-image`. default: type: string description: The default tag. MUST be one of the values in the `tags` array. @@ -3631,8 +3881,27 @@ components: minItems: 1 items: type: string + result_status: + type: string + enum: + - running + - canceled + - finished + - error + description: |- + The status of a batch job. + + This field is REQUIRED if the `partial` parameter is given. + This field is strongly RECOMMENDED if the job has stopped due to an error. + default: finished batch_job_result: title: Batch Job Results Response as STAC Item + description: + The STAC specification should be the main guidance for implementing this. + + Specifying the `bbox` is strongly RECOMMENDED for STAC compliance, + but can be omitted if the result is unlocated and the `geometry` + is set to `null`. type: object required: - stac_version @@ -3659,41 +3928,7 @@ components: enum: - Feature bbox: - description: |- - Potential *spatial extent* covered by the data. - - The bounding box is provided as four or six numbers. Six numbers are - specified, if the coordinate reference system includes a vertical axis - (height or depth). The order of the elements in the array: - - - West (lower left corner, coordinate axis 1) - - South (lower left corner, coordinate axis 2) - - Base (optional, lower left corner, coordinate axis 3) - - East (upper right corner, coordinate axis 1) - - North (upper right corner, coordinate axis 2) - - Height (optional, upper right corner, coordinate axis 3) - - The coordinate reference system of the values is WGS84 - longitude/latitude. - - Specifying the `bbox` is strongly RECOMMENDED for STAC compliance, - but can be omitted if the result is unlocated and the `geometry` - is set to `null`. - type: array - oneOf: - - title: 4 elements - minItems: 4 - maxItems: 4 - - title: 6 elements - minItems: 6 - maxItems: 6 - items: - type: number - example: - - -180 - - -90 - - 180 - - 90 + $ref: '#/components/schemas/bbox' geometry: description: |- Defines the full footprint of the asset represented by this item as @@ -3772,11 +4007,13 @@ components: Time until which the assets are accessible, in UTC. Formatted as a [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339.html) date-time. example: '2020-11-01T00:00:00Z' + 'openeo:status': + $ref: '#/components/schemas/result_status' assets: $ref: '#/components/schemas/stac_assets' links: type: array - description: >- + description: |- Links related to this batch job result, e.g. a link to an invoice, additional log files or external documentation. @@ -3785,10 +4022,19 @@ components: Clients MUST NOT download the data referenced in the links by default. + It is **strongly recommended** to add a link with relation type + `canonical`, which points to this STAC document using a signed URL. + This way the STAC metadata can be used by non-openEO clients + without additional authentication steps. + For relation types see the lists of [common relation types in openEO](#section/API-Principles/Web-Linking). items: $ref: '#/components/schemas/link' + example: + - rel: canonical + type: application/geo+json + href: https://openeo.example/api/v1/download/583fba8b2ce583fba8b2ce/item.json file_format: x-additionalPropertiesName: File Format Name title: File Format @@ -3816,6 +4062,7 @@ components: - raster - vector - table + - pointcloud - other deprecated: $ref: '#/components/schemas/deprecated' @@ -3891,7 +4138,7 @@ components: type: string description: The value MUST be a valid URL. format: uri - example: 'https://example.openeo.org' + example: 'https://openeo.example' type: type: string description: >- @@ -3953,11 +4200,13 @@ components: currency the back-end is working with. The currency can be retrieved by calling `GET /`. If no currency is set, this field MUST be `null`. type: number + minimum: 0 example: 12.98 nullable: true default: null budget: type: number + minimum: 0 nullable: true description: |- Maximum amount of costs the request is allowed to produce. @@ -3968,6 +4217,7 @@ components: default: null budget_update: type: number + minimum: 0 nullable: true description: |- Maximum amount of costs the request is allowed to produce. @@ -3979,7 +4229,7 @@ components: description: |- The billing plan to process and charge the job or service with. - Billing plans MUST be accepted in a *case insensitive* manner. + Billing plans MUST be handled in a *case insensitive* manner. The plans can be retrieved from `GET /`, but the value returned here may not be in the list of plans any longer. @@ -3990,14 +4240,11 @@ components: The billing plan to process and charge the job or service with. Billing plans MUST be accepted in a *case insensitive* manner. - If `null` is specified by the client explicitly, - the server MUST store the default plan and persist it regardless of any - changes to the default billing plan in the future. If given, the default - plan specific to the user has higher priority than the default plan of - the back-end. - - The list of plans and the default plan for the back-end can be retrieved - from `GET /`. The default plan for the user can be retrieved from `GET /me`. + Back-ends MUST resolve the billing plan in the following way if billing is supported: + + * If a value is given and it is not `null`: Persist the `plan` that has been provided in the request. + * Otherwise, don't change the billing plan. + Billing plans not on the list of available plans MUST be rejected with openEO error `BillingPlanInvalid`. example: free @@ -4008,14 +4255,18 @@ components: The billing plan to process and charge the job or service with. Billing plans MUST be accepted in a *case insensitive* manner. - If `null` is given implicitly (through the default value) or explicitly by the client, - the server MUST store the default plan and persist it regardless of any - changes to the default billing plan in the future. If given, the default - plan specific to the user has higher priority than the default plan of - the back-end. - - The list of plans and the default plan for the back-end can be retrieved - from `GET /`. The default plan for the user can be retrieved from `GET /me`. + Back-ends MUST resolve the billing plan in the following way: + + * If a non-`null` value is given: Persist the `plan` that has been provided in the request. + * Otherwise: + 1. Persist the `default_plan` exposed through `GET /me`, if available. + 2. Persist the `default_plan` exposed through `GET /`, if available. + 3. If a single plan is exposed by the back-end, persist it. + 4. Otherwise, the back-end MUST throw a `BillingPlanMissing` error. + + The resolved plan MUST be persisted permanently, regardless of any + changes to the exposed billing plans in `GET /` in the future. + Billing plans not on the list of available plans MUST be rejected with openEO error `BillingPlanInvalid`. example: free @@ -4067,7 +4318,7 @@ components: Version of the collection. This property REQUIRES to add `version` (STAC < 1.0.0-rc.1) or - `https://stac-extensions.github.io/version/v1.0.0/schema.json` (STAC >= 1.0.0-rc.1) + `https://stac-extensions.github.io/version/v1.2.0/schema.json` (STAC >= 1.0.0-rc.1) to the list of `stac_extensions`. deprecated: type: boolean @@ -4081,7 +4332,7 @@ components: links and MUST refer to the collection that can be used instead. This property REQUIRES to add `version` (STAC < 1.0.0-rc.1) or - `https://stac-extensions.github.io/version/v1.0.0/schema.json` (STAC >= 1.0.0-rc.1) + `https://stac-extensions.github.io/version/v1.2.0/schema.json` (STAC >= 1.0.0-rc.1) to the list of `stac_extensions`. license: $ref: '#/components/schemas/stac_license' @@ -4124,46 +4375,7 @@ components: type: array minItems: 1 items: - description: |- - Each bounding box is provided as four or six numbers, - depending on whether the coordinate reference system - includes a vertical axis (height or depth): - - * West (lower left corner, coordinate axis 1) - * South (lower left corner, coordinate axis 2) - * Base (optional, minimum value, coordinate axis 3) - * East (upper right corner, coordinate axis 1) - * North (upper right corner, coordinate axis 2) - * Height (optional, maximum value, coordinate axis 3) - - The coordinate reference system of the values is WGS 84 - longitude/latitude (http://www.opengis.net/def/crs/OGC/1.3/CRS84). - - For WGS 84 longitude/latitude the values are in most cases - the sequence of minimum longitude, minimum latitude, maximum - longitude and maximum latitude. - - However, in cases where the box spans the antimeridian the - first value (west-most box edge) is larger than the third value - (east-most box edge). - - If the vertical axis is included, the third and the sixth - number are the bottom and the top of the 3-dimensional bounding box. - type: array - oneOf: - - title: 4 elements - minItems: 4 - maxItems: 4 - - title: 6 elements - minItems: 6 - maxItems: 6 - items: - type: number - example: - - -180 - - -90 - - 180 - - 90 + $ref: '#/components/schemas/bbox' temporal: title: Collection Temporal Extent description: >- @@ -4201,7 +4413,7 @@ components: - '2011-11-11T12:22:11Z' - null links: - description: >- + description: |- Links related to this collection. Could reference to licensing information, other meta data formats with additional information or a preview image. @@ -4226,6 +4438,10 @@ components: catalog service such as OGC CSW, a human-readable HTML version or a metadata document following another standard such as ISO 19115 or DCAT. + 6. `http://www.opengis.net/def/rel/ogc/1.0/queryables`: URL to the + queryables endpoint at `/collections/{collection_id}/queryables`. + For JSON Schema documents, the `type` field must be set to `application/schema+json`. + For additional relation types see also the lists of [common relation types in openEO](#section/API-Principles/Web-Linking) and the STAC specification for Collections. @@ -4235,7 +4451,8 @@ components: 'cube:dimensions': title: STAC Collection Cube Dimensions description: |- - Uniquely named dimensions of the data cube. + The named default dimensions of the data cube. + Names must be unique per collection. The keys of the object are the dimension names. For interoperability, it is RECOMMENDED to use the @@ -4247,9 +4464,10 @@ components: * `z` for the dimension of type `spatial` with the axis set to `z` * `t` for the dimension of type `temporal` * `bands` for dimensions of type `bands` + * `geometry` for dimensions of type `geometry` - This property REQUIRES to add `datacube` to the list - of `stac_extensions`. + This property REQUIRES to add a version of the data cube extension to the list + of `stac_extensions`, e.g. `https://stac-extensions.github.io/datacube/v2.2.0/schema.json`. type: object additionalProperties: x-additionalPropertiesName: Dimension Name @@ -4262,9 +4480,9 @@ components: SAR, Satellite or Scientific) or even custom extensions. Summaries are either a unique set of all available - values *or* statistics. Statistics by default only - specify the range (minimum and maximum values), but - can optionally be accompanied by additional + values, statistics *or* a JSON Schema. Statistics only + specify the range (minimum and maximum values) by default, + but can optionally be accompanied by additional statistical values. The range can specify the potential range of values, but it is recommended to be as precise as possible. The set of values MUST contain @@ -4278,9 +4496,9 @@ components: Potential fields for the summaries can be found here: - * **[STAC Common Metadata](https://github.com/radiantearth/stac-spec/blob/v1.0.0-rc.2/item-spec/common-metadata.md)**: + * **[STAC Common Metadata](https://github.com/radiantearth/stac-spec/blob/v1.0.0/item-spec/common-metadata.md)**: A list of commonly used fields throughout all domains - * **[Content Extensions](https://github.com/radiantearth/stac-spec/blob/v1.0.0-rc.2/extensions/README.md#list-of-content-extensions)**: + * **[Content Extensions](https://github.com/radiantearth/stac-spec/blob/v1.0.0/extensions/README.md#list-of-content-extensions)**: Domain-specific fields for domains such as EO, SAR and point clouds. * **Custom Properties**: It is generally allowed to add custom fields. @@ -4292,6 +4510,7 @@ components: items: description: A value of any type. - $ref: '#/components/schemas/collection_summary_stats' + - $ref: '#/components/schemas/json_schema' assets: description: |- Dictionary of asset objects for data that can be downloaded, @@ -4306,9 +4525,10 @@ components: type: string description: >- The [version of the STAC specification](https://github.com/radiantearth/stac-spec/releases), - which MAY not be equal to the [STAC API version](#section/STAC). + which MAY not be equal to the [STAC API version](#tag/EO-Data-Discovery/STAC). Supports versions 0.9.x and 1.x.x. pattern: '^(0\.9.\d+|1\.\d+.\d+)' + example: 1.0.0 stac_extensions: type: array description: >- @@ -4321,7 +4541,7 @@ components: - title: Reference to a JSON Schema type: string format: uri - example: 'https://www.example.com/stac/custom-extemsion/v1.0/schema.json' + example: 'https://openeo.example/stac/custom-extemsion/v1.0.0/schema.json' - title: Reference to a core extension (STAC < 1.0.0-rc.1 only) type: string example: datacube @@ -4355,7 +4575,7 @@ components: name: description: The name of the organization or the individual. type: string - example: Cool EO Cloud Corp + example: Example Cloud Corp. description: description: >- Multi-line description to add further provider information such as @@ -4367,24 +4587,19 @@ components: type: string example: No further processing applied. roles: - description: >- + description: |- Roles of the provider. - The provider's role(s) can be one or more of the following elements: - - * licensor: The organization that is licensing the dataset under + * `licensor`: The organization that is licensing the dataset under the license specified in the collection's license field. - - * producer: The producer of the data is the provider that + * `producer`: The producer of the data is the provider that initially captured and processed the source data, e.g. ESA for Sentinel-2 data. - - * processor: A processor is any provider who processed data to a + * `processor`: A processor is any provider who processed data to a derived product. - - * host: The host is the actual provider offering the data on their + * `host`: The host is the actual provider offering the data on their storage. There SHOULD be no more than one host, specified as last element of the list. type: array @@ -4405,7 +4620,7 @@ components: contact information. type: string format: uri - example: http://cool-eo-cloud-corp.com + example: https://cloud.example stac_assets: type: object title: Assets @@ -4416,32 +4631,32 @@ components: $ref: '#/components/schemas/asset' example: preview.png: - href: 'https://example.openeo.org/api/download/583fba8b2ce583fba8b2ce/preview.png' + href: 'https://openeo.example/api/v1/download/583fba8b2ce583fba8b2ce/preview.png' type: image/png title: Thumbnail roles: - thumbnail process.json: - href: 'https://example.openeo.org/api/download/583fba8b2ce583fba8b2ce/process.json' + href: 'https://openeo.example/api/v1/download/583fba8b2ce583fba8b2ce/process.json' type: application/json title: Original Process roles: - process - reproduction 1.tif: - href: 'https://example.openeo.org/api/download/583fba8b2ce583fba8b2ce/1.tif' + href: 'https://openeo.example/api/v1/download/583fba8b2ce583fba8b2ce/1.tif' type: image/tiff; application=geotiff title: Band 1 roles: - data 2.tif: - href: 'https://example.openeo.org/api/download/583fba8b2ce583fba8b2ce/2.tif' + href: 'https://openeo.example/api/v1/download/583fba8b2ce583fba8b2ce/2.tif' type: image/tiff; application=geotiff title: Band 2 roles: - data inspire.xml: - href: 'https://example.openeo.org/api/download/583fba8b2ce583fba8b2ce/inspire.xml' + href: 'https://openeo.example/api/v1/download/583fba8b2ce583fba8b2ce/inspire.xml' type: application/xml title: INSPIRE metadata description: INSPIRE compliant XML metadata @@ -4449,7 +4664,7 @@ components: - metadata collection_summary_stats: type: object - title: Statistics + title: Statistics / Range description: >- By default, only ranges with a minimum and a maximum value can be specified. Ranges can be @@ -4461,17 +4676,60 @@ components: to add other derived statistical values to the object, for example `mean` or `stddev`. required: - - min - - max + - minimum + - maximum properties: - min: + minimum: + description: The minimum value (inclusive). anyOf: - type: string - type: number - max: + maximum: + description: The maximum value (inclusive). anyOf: - type: string - type: number + bbox: + description: |- + Each bounding box is provided as four or six numbers, + depending on whether the coordinate reference system + includes a vertical axis (height or depth): + + * West (lower left corner, coordinate axis 1) + * South (lower left corner, coordinate axis 2) + * Base (optional, minimum value, coordinate axis 3) + * East (upper right corner, coordinate axis 1) + * North (upper right corner, coordinate axis 2) + * Height (optional, maximum value, coordinate axis 3) + + The coordinate reference system of the values is WGS 84 + longitude/latitude (http://www.opengis.net/def/crs/OGC/1.3/CRS84). + + For WGS 84 longitude/latitude the values are in most cases + the sequence of minimum longitude, minimum latitude, maximum + longitude and maximum latitude. + + However, in cases where the box spans the antimeridian the + first value (west-most box edge) is larger than the third value + (east-most box edge). + + If the vertical axis is included, the third and the sixth + number are the bottom and the top of the 3-dimensional bounding box. + type: array + oneOf: + - title: 4 elements + minItems: 4 + maxItems: 4 + - title: 6 elements + minItems: 6 + maxItems: 6 + items: + type: number + example: + - -180 + - -90 + - 180 + - 90 collection_id: type: string description: >- @@ -4481,17 +4739,19 @@ components: example: Sentinel-2A dimension: title: Dimension + description: A dimension, each object represents a distinct dimension with the key being the dimension name. type: object required: - type properties: type: - description: 'Type of the dimension.' + description: Type of the dimension. type: string enum: - spatial - temporal - bands + - geometry - other description: $ref: '#/components/schemas/description' @@ -4501,12 +4761,21 @@ components: spatial: '#/components/schemas/dimension_spatial' temporal: '#/components/schemas/dimension_temporal' bands: '#/components/schemas/dimension_bands' + geometry: '#/components/schemas/dimension_geometry' other: '#/components/schemas/dimension_other' dimension_other: allOf: - $ref: '#/components/schemas/dimension' - title: Additional Dimension type: object +# This is not supported by ReDoc yet: +# oneOf: +# - title: Additional Dimension with Extent +# required: +# - extent +# - title: Additional Dimension with Values +# required: +# - values properties: extent: $ref: '#/components/schemas/collection_dimension_extent_open' @@ -4517,8 +4786,40 @@ components: unit: $ref: '#/components/schemas/collection_dimension_unit' reference_system: - description: The reference system for the data. + description: The reference system for the dimension. type: string + dimension_geometry: + allOf: + - $ref: '#/components/schemas/dimension' + - title: Geometry Dimension + type: object + required: + - bbox + properties: + axes: + description: Axes of the vector dimension as an ordered set of `x`, `y` and `z`. Defaults to `x` and `y`. + default: + - 'x' + - 'y' + type: array + uniqueItems: true + items: + $ref: '#/components/schemas/dimension_axis_xyz' + bbox: + $ref: '#/components/schemas/bbox' + values: + description: Optionally, a representation of the vectors. This can be a list of WKT string or other free-form identifiers. + type: array + items: + type: string + geometry_types: + description: A set of all geometry types included in this dimension. If not present, mixed geometry types must be assumed. + type: array + uniqueItems: true + items: + $ref: '#/components/schemas/geometry_type' + reference_system: + $ref: '#/components/schemas/collection_dimension_srs' dimension_bands: allOf: - $ref: '#/components/schemas/dimension' @@ -4540,18 +4841,13 @@ components: allOf: - $ref: '#/components/schemas/dimension' - title: Spatial Dimension - description: A spatial dimension in one of the horizontal (x or y) or vertical (z) directions. + description: A spatial (raster) dimension in one of the horizontal (x or y) or vertical (z) directions. type: object required: - axis properties: axis: - description: 'Axis of the spatial dimension (`x`, `y` or `z`).' - type: string - enum: - - 'x' - - 'y' - - 'z' + $ref: '#/components/schemas/dimension_axis_xyz' extent: description: >- Extent (lower and upper bounds) of the @@ -4571,20 +4867,21 @@ components: step: $ref: '#/components/schemas/collection_dimension_step' reference_system: - description: >- - The spatial reference system for the data, specified as [EPSG code](http://www.epsg-registry.org/), [WKT2 (ISO 19162) string](http://docs.opengeospatial.org/is/18-010r7/18-010r7.html) or [PROJ definition (deprecated)](https://proj.org/usage/quickstart.html). Defaults to EPSG code 4326. - oneOf: - - type: string - description: WKT2 or PROJ definition - - type: number - default: 4326 - description: EPSG code + $ref: '#/components/schemas/collection_dimension_srs' discriminator: propertyName: axis mapping: x: '#/components/schemas/dimension_spatial_horizontal' y: '#/components/schemas/dimension_spatial_horizontal' z: '#/components/schemas/dimension_spatial_vertical' + dimension_axis_xyz: + title: Axis + description: Axis of a geometry or dimension (`x`, `y` or `z`) + type: string + enum: + - 'x' + - 'y' + - 'z' dimension_spatial_horizontal: allOf: - $ref: '#/components/schemas/dimension_spatial' @@ -4652,6 +4949,18 @@ components: spaced steps. type: string nullable: true + collection_dimension_srs: + title: Spatial reference system + description: >- + The spatial reference system for the data, specified as [EPSG code](http://www.epsg-registry.org/), [WKT2 (ISO 19162) string](http://docs.opengeospatial.org/is/18-010r7/18-010r7.html), [PROJJSON object](https://proj.org/specifications/projjson.html) or [PROJ definition (deprecated)](https://proj.org/usage/quickstart.html). Defaults to EPSG code 4326. + default: 4326 + oneOf: + - type: number + title: EPSG code + - type: string + title: WKT2 or PROJ definition (deprecated) + - type: object + title: PROJJSON collection_dimension_extent_open: description: >- If the dimension consists of @@ -4932,10 +5241,10 @@ components: arguments: $ref: '#/components/schemas/process_arguments' returns: - nullable: true + description: The return value which can by of any data type. links: type: array - description: >- + description: |- Links related to this process, e.g. additional external documentation. It is RECOMMENDED to provide links with the following `rel` (relation) types: @@ -4964,12 +5273,16 @@ components: - id properties: summary: + type: string nullable: true description: + type: string nullable: true parameters: + type: array nullable: true returns: + type: object nullable: true allOf: - $ref: '#/components/schemas/process' @@ -4981,14 +5294,19 @@ components: - process_graph properties: id: + type: string nullable: true summary: + type: string nullable: true description: + type: string nullable: true parameters: + type: array nullable: true returns: + type: object nullable: true allOf: - $ref: '#/components/schemas/process' @@ -5000,16 +5318,16 @@ components: description: |- The namespace the `process_id` is valid for. - The following options are pre-defined by the openEO API, but additional + The following options are predefined by the openEO API, but additional namespaces may be introduced by back-ends or in a future version of the API. - * `null` (default): Checks both user-defined and pre-defined processes, + * `null` (default): Checks both user-defined and predefined processes, but prefers user-defined processes if both are available. - This allows users to add missing pre-defined processes for portability, + This allows users to add missing predefined processes for portability, e.g. common processes from [processes.openeo.org](https://processes.openeo.org) that have a process graph included. It is RECOMMENDED to log the namespace selected by the back-end for debugging purposes. - * `backend`: Uses exclusively the pre-defined processes listed at `GET /processes`. + * `backend`: Uses exclusively the predefined processes listed at `GET /processes`. * `user`: Uses exclusively the user-defined processes listed at `GET /process_graphs`. If multiple processes with the same identifier exist, Clients SHOULD @@ -5018,10 +5336,10 @@ components: type: string description: |- The identifier for the process. It MUST be unique across its namespace - (e.g. pre-defined processes or user-defined processes). + (e.g. predefined processes or user-defined processes). Clients SHOULD warn the user if a user-defined process is added with the - same identifier as one of the pre-defined process. + same identifier as one of the predefined process. pattern: '^\w+$' example: ndvi process_summary: @@ -5043,7 +5361,7 @@ components: description: $ref: '#/components/schemas/process_description' schema: - $ref: '#/components/schemas/data_type_schema' + $ref: '#/components/schemas/process_schema' experimental: type: boolean description: >- @@ -5163,7 +5481,6 @@ components: description: >- The default value for this parameter. Required parameters SHOULD NOT specify a default value. Optional parameters SHOULD always specify a default value. - nullable: true parameter: title: Parameter type: object @@ -5181,7 +5498,7 @@ components: - schema properties: schema: - $ref: '#/components/schemas/parameter_schema' + $ref: '#/components/schemas/process_schema' allOf: - $ref: '#/components/schemas/base_parameter' batch_job: @@ -5258,16 +5575,50 @@ components: Metrics about the resource usage of the batch job. Back-ends are not expected to update the metrics while processing data, - so the metrics can only be available after the job has been finished - or has errored. + so the metrics can only be available after the job has finished + or has stopped due to an error. For usage metrics during processing, metrics can better be added to the logs (e.g. `GET /jobs/{job_id}/logs`) with the same schema. allOf: - $ref: '#/components/schemas/usage' + log_level: + $ref: '#/components/schemas/min_log_level_default' + links: + type: array + description: |- + Links related to this batch job, e.g. a links to + invoices, log files or results. + + It is RECOMMENDED to provide links with the following `rel` (relation) types: + + 1. `monitor`: If logs are available, a link to the [logs endpoint](#tag/Batch-Jobs/operation/debug-job). + 2. `result`: If batch job results are available, a link to the [results endpoint](#tag/Batch-Jobs/operation/list-results). + + The relation types `monitor` and `result` may occur for various batch job states: + + 1. `created`: When the batch job was executed before and has been reset to `created` after an + [update](#tag/Batch-Jobs/operation/update-job) there could still be results and logs available + until they get discarded by [queueing the batch job again](#tag/Batch-Jobs/operation/start-job). + 2. `finished`: The full log and results are expected to be available. + 3. `error` / `canceled`: Partial results and logs may be available. + + For more relation types see the lists of + [common relation types in openEO](#section/API-Principles/Web-Linking). + items: + $ref: '#/components/schemas/link' + example: + - rel: result + type: application/json + title: Batch Job Results + href: https://openeo.example/api/v1/jobs/123/logs + - rel: result + type: application/json + title: Batch Job Logs + href: https://openeo.example/api/v1/jobs/123/logs job_id: type: string description: >- - Unique identifier of the batch job, generated by the + Per-backend unique identifier of the batch job, generated by the back-end during creation. MUST match the specified pattern. pattern: '^[\w\-\.~]+$' example: a3cca2b2aa1e3b5b @@ -5285,14 +5636,6 @@ components: Date and time of the last status change, formatted as a [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339.html) date-time. example: '2017-01-01T09:36:18Z' - user_id: - type: string - description: >- - Unique identifier of the user. MUST match the specified pattern. - This is usually a randomly generated internal identifier from the provider - not meant for displaying purposes. - pattern: '^[\w\-\.~]+$' - example: john_doe description: type: string format: commonmark @@ -5363,11 +5706,11 @@ components: description: >- URL at which the secondary web service is accessible. Doesn't necessarily need to be located within the API. - example: 'https://example.openeo.org/wms/wms-a3cca9' + example: 'https://openeo.example/wms/wms-a3cca9' type: $ref: '#/components/schemas/service_type' enabled: - $ref: '#/components/schemas/service_enabled_default' + $ref: '#/components/schemas/service_enabled' process: $ref: '#/components/schemas/process_graph_with_metadata' configuration: @@ -5401,6 +5744,8 @@ components: same schema. allOf: - $ref: '#/components/schemas/usage' + log_level: + $ref: '#/components/schemas/min_log_level_default' service_type: description: >- Definition of the service type to access result data. All available @@ -5419,12 +5764,6 @@ components: any other service dependant configuration. example: version: 1.3.0 - service_enabled_default: - type: boolean - description: >- - Describes whether a secondary web service is responding to requests - (true) or not (false). Disabled services don't produce any costs. - default: true service_enabled: type: boolean description: >- @@ -5433,8 +5772,8 @@ components: service_id: type: string description: >- - Unique identifier of the secondary web service, generated by the - back-end during creation. MUST match the specified pattern. + A per-backend unique identifier of the secondary web service, generated + by the back-end during creation. MUST match the specified pattern. pattern: '^[\w\-\.~]+$' example: wms-a3cca9 resource_parameter: @@ -5473,9 +5812,8 @@ components: value MUST conform to the defined type for the parameter defined at the same level. For example, if type is string, then default can be "foo" but cannot be 1. See [JSON Schema draft-07](https://json-schema.org/draft-07/json-schema-validation.html#rfc.section.10.2). - nullable: true allOf: - - $ref: '#/components/schemas/json_schema' + - $ref: '#/components/schemas/process_json_schema' error: title: General Error description: >- @@ -5512,7 +5850,7 @@ components: type: string description: >- The code is either one of the standardized error codes or a custom code, - for example specified by a user in the `debug` process. + for example specified by a user in the `inspect` process. example: SampleError log_links: description: |- @@ -5525,36 +5863,114 @@ components: items: $ref: '#/components/schemas/link' example: - - href: 'https://example.openeo.org/docs/errors/SampleError' + - href: 'https://openeo.example/docs/errors/SampleError' rel: about + log_level: + description: |- + The severity level of the log entry. + + The order of the levels is as follows (from low to high severity): `debug`, `info`, `warning`, `error`. + + The level `error` usually corresponds with critical issues that usually terminate the data processing. + type: string + enum: + - error + - warning + - info + - debug + example: error + min_log_level_default: + description: |- + The minimum severity level for log entries that the back-end stores for the processing request. + + The order of the levels is as follows (from low to high severity): `debug`, `info`, `warning`, `error`. + That means if `warning` is set, the back-end will only store log entries with the level `warning` and `error`. + + The default minimum log level is `info`. Users need to specifically set this property to `debug` to get *all* log entries. + It is RECOMMENDED that users set the level at least to "warning" in production workflows. + type: string + enum: + - error + - warning + - info + - debug + default: info + example: warning + min_log_level_update: + description: |- + Updates the minimum severity level for log entries that the back-end stores for the processing requests. + + The back-end doesn't need to update existing log entries. + type: string + enum: + - error + - warning + - info + - debug + example: warning data_type_schema: title: Data Types description: Either a single data type or a list of data types. oneOf: - - $ref: '#/components/schemas/json_schema' + - $ref: '#/components/schemas/process_json_schema' - title: Multiple data types description: A list of data types this parameter supports, specified as JSON Schemas. type: array minItems: 1 uniqueItems: true items: - $ref: '#/components/schemas/json_schema' - parameter_schema: - title: Parameter Data Types - description: Either a single data type or a list of data types. + $ref: '#/components/schemas/process_json_schema' + process_schema: + title: Process Data types + description: Either a single data type or a list of data types for process parameter or process return values. oneOf: - - $ref: '#/components/schemas/parameter_json_schema' + - $ref: '#/components/schemas/process_json_schema' - title: Multiple data types description: A list of data types supported, specified as JSON Schemas. type: array minItems: 1 uniqueItems: true items: - $ref: '#/components/schemas/parameter_json_schema' - parameter_json_schema: + $ref: '#/components/schemas/process_json_schema' + process_json_schema: + type: object title: Single Data Type + description: |- + Specifies a data type supported by a parameter or return value. + + The data types are specified according to the [JSON Schema draft-07](http://json-schema.org/) specification. + See the chapter ['Schemas' in 'Defining Processes'](#section/Processes/Defining-Processes) for more information. + + JSON Schemas SHOULD NOT contain `default`, `anyOf`, `oneOf`, `allOf` or `not` at the top-level of the schema. + Instead specify each data type in a separate array element. + + The following more complex JSON Schema keywords SHOULD NOT be used: + `if`, `then`, `else`, `readOnly`, `writeOnly`, `dependencies`, `minProperties`, `maxProperties`, `patternProperties`. + + JSON Schemas SHOULD always be dereferenced (i.e. all `$refs` should be resolved). This allows clients to consume the schemas much better. + Clients are not expected to support dereferencing `$refs`. + + Note: The specified schema is only a common subset of JSON Schema. Additional keywords MAY be used. + properties: + subtype: + type: string + description: The allowed sub data type for a value. See the chapter on [subtypes](#section/Processes/Defining-Processes) for more information. + deprecated: + $ref: '#/components/schemas/deprecated' + allOf: + - $ref: '#/components/schemas/json_schema' + oneOf: + - title: Generic + - $ref: '#/components/schemas/process_graph_json_schema' + - $ref: '#/components/schemas/datacube_json_schema' + process_graph_json_schema: + title: Process Graph type: object properties: + subtype: + type: string + enum: + - process-graph parameters: type: array title: Process Graph Parameters @@ -5568,7 +5984,8 @@ components: returns: type: object title: Process Graph Return Value - description: Description of the data that is returned by the child process graph. + description: |- + Description of the data that is returned by the child process graph. required: - schema properties: @@ -5577,32 +5994,88 @@ components: schema: $ref: '#/components/schemas/data_type_schema' allOf: - - $ref: '#/components/schemas/json_schema' - allOf: - - $ref: '#/components/schemas/json_schema' + - $ref: '#/components/schemas/process_json_schema' + datacube_json_schema: + title: Datacube + properties: + subtype: + type: string + enum: + - datacube + dimensions: + title: Datacube constraints + description: |- + Allows to specify requirements the data cube has to fulfill. + Right now, it only allows to specify the dimension types and + adds for specific dimension types: + * axes for `spatial` dimensions in raster datacubes + * geometry types for `geometry` dimensions in vector datacubes + type: array + items: + type: object + required: + - type + oneOf: + - title: Spatial (raster) + properties: + type: + type: string + enum: + - spatial + axis: + type: array + minItems: 1 + items: + $ref: '#/components/schemas/dimension_axis_xyz' + - title: Spatial (vector) + properties: + type: + type: string + enum: + - geometry + geometry_type: + type: array + minItems: 1 + items: + $ref: '#/components/schemas/geometry_type' + - title: Other + properties: + type: + type: string + enum: + - bands + - temporal + - other json_schema: type: object - title: Single data type + title: JSON Schema description: |- - Specifies a data type supported by a parameter or return value. - - The data types are specified according to the [JSON Schema draft-07](http://json-schema.org/) specification. - See the chapter ['Schemas' in 'Defining Processes'](#section/Processes/Defining-Processes) for more information. - - JSON Schemas SHOULD NOT contain `default`, `anyOf`, `oneOf`, `allOf` or `not` at the top-level of the schema. - Instead specify each data type in a separate array element. + A JSON Schema compliant to [JSON Schema draft-07](https://json-schema.org/draft-07/json-schema-validation.html) or later. - The following more complex JSON Schema keywords SHOULD NOT be used: - `if`, `then`, `else`, `readOnly`, `writeOnly`, `dependencies`, `minProperties`, `maxProperties`, `patternProperties`. - - JSON Schemas SHOULD always be dereferenced (i.e. all `$refs` should be resolved). This allows clients to consume the schemas much better. + JSON Schemas SHOULD always be dereferenced (i.e. all `$refs` should be resolved). + This allows clients to consume the schemas much better. Clients are not expected to support dereferencing `$refs`. - Note: The specified schema is only a common subset of JSON Schema. Additional keywords MAY be used. + Note: The specified schema in the OpenAPI document is only a common subset of JSON Schema. + Additional keywords from the JSON Schema specification MAY be used. properties: + $schema: + description: |- + The JSON Schema version. If not given in the context of openEO, + defaults to `draft-07`. + + You may need to add the default value for `$schema` property explicitly to the JSON Schema + object before passing it to a JSON Schema validator. + type: string + format: uri + default: http://json-schema.org/draft-07/schema# + $id: + description: ID of your JSON Schema. + type: string + format: uri type: description: |- - The allowed basic data type(s) for a value according to [JSON Schema draft-07](https://json-schema.org/draft-07/json-schema-validation.html#rfc.section.6.1.1). + The allowed basic data type(s) for a value. If this property is not present, all data types are allowed. oneOf: @@ -5612,43 +6085,41 @@ components: uniqueItems: true items: $ref: '#/components/schemas/json_schema_type' - subtype: - type: string - description: The allowed sub data type for a value. See the chapter on [subtypes](#section/Processes/Defining-Processes) for more information. pattern: type: "string" format: "regex" - description: The regular expression a string value must match against. See [JSON Schema draft-07](https://json-schema.org/draft-07/json-schema-validation.html#rfc.section.6.3.3). + description: The regular expression a string value must match against. enum: type: array items: {} - description: An exclusive list of allowed values. See [JSON Schema draft-07](https://json-schema.org/draft-07/json-schema-validation.html#rfc.section.6.1.2). + description: An exclusive list of allowed values. minimum: type: number - description: The minimum value (inclusive) allowed for a numerical value. See [JSON Schema draft-07](https://json-schema.org/draft-07/json-schema-validation.html#rfc.section.6.2.4). + description: The minimum value (inclusive) allowed for a numerical value. maximum: type: number - description: The maximum value (inclusive) allowed for a numerical value. See [JSON Schema draft-07](https://json-schema.org/draft-07/json-schema-validation.html#rfc.section.6.2.2). + description: The maximum value (inclusive) allowed for a numerical value. minItems: type: number minimum: 0 default: 0 - description: The minimum number of items required in an array. See [JSON Schema draft-07](https://json-schema.org/draft-07/json-schema-validation.html#rfc.section.6.4.4). + description: The minimum number of items required in an array. maxItems: type: number minimum: 0 - description: The maximum number of items required in an array. See [JSON Schema draft-07](https://json-schema.org/draft-07/json-schema-validation.html#rfc.section.6.4.3). + description: The maximum number of items required in an array. items: - description: Specifies schemas for the items in an array according to [JSON Schema draft-07](https://json-schema.org/draft-07/json-schema-validation.html#rfc.section.6.4.1). + description: Specifies schemas for the items in an array. anyOf: - type: array minItems: 1 items: $ref: '#/components/schemas/json_schema' - $ref: '#/components/schemas/json_schema' - deprecated: - $ref: '#/components/schemas/deprecated' - additionalProperties: true + additionalProperties: + description: >- + You can add any other property supported by the JSON Schema version that is given through the property `$schema`, + so either [draft-07](https://json-schema.org/draft-07/json-schema-validation.html) or any later version. json_schema_type: type: string enum: @@ -5689,6 +6160,17 @@ components: Date and time the file has lastly been modified, formatted as a [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339.html) date-time. example: '2018-01-03T10:55:29Z' + geometry_type: + title: Geometry type + type: string + enum: + - Point + - MultiPoint + - LineString + - MultiLineString + - Polygon + - MultiPolygon + - GeometryCollection GeoJsonPoint3D: type: array description: Point in 3D space @@ -5709,22 +6191,50 @@ components: - Point coordinates: $ref: '#/components/schemas/GeoJsonPoint3D' - GeoJsonGeometry: - title: GeoJSON Geometry + GeoJsonFeatureCollection: type: object required: - type + - features properties: type: type: string enum: - - Point - - LineString - - Polygon - - MultiPoint - - MultiLineString - - MultiPolygon - - GeometryCollection + - FeatureCollection + features: + type: array + items: + $ref: '#/components/schemas/GeoJsonFeature' + GeoJsonFeature: + type: object + required: + - type + - geometry + - properties + properties: + type: + type: string + enum: + - Feature + geometry: + $ref: '#/components/schemas/GeoJsonGeometry' + properties: + type: object + nullable: true + GeoJson: + title: GeoJSON + oneOf: + - $ref: '#/components/schemas/GeoJsonFeatureCollection' + - $ref: '#/components/schemas/GeoJsonFeature' + - $ref: '#/components/schemas/GeoJsonGeometry' + GeoJsonGeometry: + title: GeoJSON Geometry + type: object + required: + - type + properties: + type: + $ref: '#/components/schemas/geometry_type' discriminator: propertyName: type mapping: @@ -5833,24 +6343,19 @@ components: code: $ref: '#/components/schemas/log_code' level: - description: |- - The severity level of the log entry. - - The order of the levels is as follows (from high to low severity): `error`, `warning`, `info`, `debug`. - - The level `error` usually stops processing the data. - type: string - enum: - - error - - warning - - info - - debug - example: error + $ref: '#/components/schemas/log_level' message: type: string - description: A message explaining the log entry. + description: >- + A concise message explaining the log entry. + + Messages do *not* explicitly support [CommonMark 0.29](http://commonmark.org/) + syntax as other descriptive fields in the openEO API do, + but the messages MAY contain line breaks or indentation. + + It is NOT RECOMMENDED to add stacktraces to the `message`. example: >- - Can't load the UDF file from the URL `https://example.com/invalid/file.txt`. + Can't load the UDF file from the URL `https://openeo.example/invalid/file.txt`. Server responded with error 404. time: type: string @@ -5864,9 +6369,9 @@ components: Data of any type. It is the back-ends task to decide how to best present passed data to a user. - For example, a raster-cube passed to the `debug` SHOULD return the + For example, a datacube passed to the `inspect` SHOULD return the metadata similar to the collection metadata, including `cube:dimensions`. - nullable: true + There are implementation guidelines available for the `inspect` process. path: description: |- Describes where the log entry originates from. @@ -5975,7 +6480,25 @@ components: - logs - links properties: + level: + description: |- + The minimum severity level for log entries that the back-end returns. + This property MUST reflect the effective lowest `level` that may appear in the document, + which is (if implemented) the highest level of: + 1. the `log_level` specified by the user for the processing request. + 2. the `level` specified by the user for the log request. + + The order of the levels is as follows (from low to high severity): `debug`, `info`, `warning`, `error`. + That means if `warning` is set, the logs will only contain entries with the level `warning` and `error`. + type: string + enum: + - error + - warning + - info + - debug + default: debug logs: + description: A chronological list of logs. type: array items: $ref: '#/components/schemas/log_entry' @@ -6055,9 +6578,9 @@ components: pagination MUST return all resources. If the response is paginated, the `links` array MUST be used to communicate the - links for browsing the pagination with pre-defined `rel` types. See the `links` array schema + links for browsing the pagination with predefined `rel` types. See the `links` array schema for supported `rel` types. - Backend implementations can, unless specified otherwise, use all kind of pagination techniques, + Back-end implementations can, unless specified otherwise, use all kind of pagination techniques, depending on what is supported best by their infrastructure: page-based, offset-based, token-based or something else. The clients SHOULD use whatever is specified in the links with the corresponding `rel` types. @@ -6072,23 +6595,50 @@ components: description: The last identifier (property `id` of a log entry) the client has received. If provided, the back-ends only sends the entries that occurred after the specified identifier. If not provided or empty, start with the first entry. in: query allowEmptyValue: true - example: "log1234" + example: log1234 schema: type: string + log_level: + name: level + description: |- + The minimum severity level for log entries that the back-end returns. + + The order of the levels is as follows (from low to high severity): `debug`, `info`, `warning`, `error`. + That means if `warning` is set, the back-end will only return log entries with the level `warning` and `error`. + + The default minimum log level is `debug`, which returns all log levels. + in: query + allowEmptyValue: true + example: error + schema: + type: string + enum: + - error + - warning + - info + - debug + default: info service_id: name: service_id in: path - description: Unique secondary web service identifier. + description: Identifier of the secondary web service. required: true schema: $ref: '#/components/schemas/service_id' job_id: name: job_id in: path - description: Unique job identifier. + description: Identifier of the batch job. required: true schema: $ref: '#/components/schemas/job_id' + collection_id: + name: collection_id + in: path + description: Collection identifier + required: true + schema: + $ref: '#/components/schemas/collection_id' examples: evi_user_defined_process: description: A user-defined process that computes the EVI. diff --git a/package.json b/package.json index 1d0cac7f..8a19865b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@openeo/api", - "version": "1.1.0", + "version": "1.2.0", "author": "openEO Consortium", "license": "Apache-2.0", "description": "The openEO API specification.", @@ -13,12 +13,12 @@ "url": "git+https://github.com/Open-EO/openeo-api.git" }, "devDependencies": { - "@stoplight/spectral": "^5.9.1", + "@stoplight/spectral-cli": "^6.6.0", "redoc-cli": "^0.13.18" }, "scripts": { "start": "redoc-cli serve openapi.yaml --watch --options.expandResponses \"200,201,202,203,204\" --options.pathInMiddlePanel true", - "build": "redoc-cli bundle openapi.yaml -o redoc.html --title \"openEO API\" --cdn --options.expandResponses \"200,201,202,203,204\" --options.pathInMiddlePanel true", + "build": "redoc-cli build openapi.yaml -o redoc.html --title \"openEO API\" --cdn --options.expandResponses \"200,201,202,203,204\" --options.pathInMiddlePanel true", "test": "spectral lint openapi.yaml" } }