Skip to content

Commit fbb2e02

Browse files
authored
Merge pull request #261 from Open-EO/put-process-graphs
PUT /process_graphs/{id}
2 parents 430a252 + 10c399e commit fbb2e02

File tree

2 files changed

+45
-70
lines changed

2 files changed

+45
-70
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
## Unreleased / Draft
88

99
### Added
10+
- `PUT /process_graphs/{process_graph_id}` to store and replace custom process-graphs. [#260](https://github.com/Open-EO/openeo-api/issues/260)
1011
- `/jobs/{job_id}/logs` and `GET /services/{service_id}/logs`: Reintroduced the missing `offset` parameter.
1112

1213
### Changed
1314
- `GET /process_graphs`: Field `id` is required for each process.
1415
- For batch jobs (`/jobs`), services (`/services`) and sync. processing (`/result`) the property `process_graph` got replaced by `process`. It contains a process graph and optionally all process metadata. [#260](https://github.com/Open-EO/openeo-api/issues/260)
1516

17+
### Removed
18+
- `POST /process_graphs` and `PATCH /process_graphs/{process_graph_id}`. Use `PUT /process_graphs/{process_graph_id}` instead. [#260](https://github.com/Open-EO/openeo-api/issues/260)
19+
1620
### Fixed
1721
- Added `$id` to JSON Schema file for subtypes.
1822
- Fixed invalid EPSG code example.

openapi.yaml

Lines changed: 41 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,7 +1716,15 @@ paths:
17161716
processes:
17171717
type: array
17181718
items:
1719-
$ref: '#/components/schemas/predefined_process'
1719+
title: Pre-Defined Process
1720+
description: A pre-defined process made available by the back-end.
1721+
allOf:
1722+
- $ref: '#/components/schemas/process'
1723+
- required:
1724+
- id
1725+
- description
1726+
- parameters
1727+
- returns
17201728
links:
17211729
$ref: '#/components/schemas/links_pagination'
17221730
example:
@@ -2415,36 +2423,6 @@ paths:
24152423
$ref: '#/components/responses/client_error_auth'
24162424
5XX:
24172425
$ref: '#/components/responses/server_error'
2418-
post:
2419-
summary: Store a user-defined process
2420-
operationId: create-custom-process
2421-
description: |-
2422-
Stores a provided user-defined process with process graph that can be
2423-
reused in other process graphs.
2424-
2425-
The process id must be unique for the authenticated user,
2426-
including all pre-defined processes by the back-end.
2427-
tags:
2428-
- User-Defined Processes
2429-
security:
2430-
- Bearer: []
2431-
responses:
2432-
'201':
2433-
$ref: '#/components/responses/created'
2434-
4XX:
2435-
$ref: '#/components/responses/client_error_auth'
2436-
5XX:
2437-
$ref: '#/components/responses/server_error'
2438-
requestBody:
2439-
required: true
2440-
description: Specifies the process graph with its meta data.
2441-
content:
2442-
application/json:
2443-
schema:
2444-
$ref: '#/components/schemas/user_defined_process'
2445-
examples:
2446-
evi_user_defined_process:
2447-
$ref: '#/components/examples/evi_user_defined_process'
24482426
'/process_graphs/{process_graph_id}':
24492427
parameters:
24502428
- $ref: '#/components/parameters/process_graph_id'
@@ -2463,39 +2441,56 @@ paths:
24632441
content:
24642442
application/json:
24652443
schema:
2466-
$ref: '#/components/schemas/user_defined_process'
2444+
title: User-Defined Process
2445+
description: A user-defined process with processing instructions as process graph.
2446+
allOf:
2447+
- $ref: '#/components/schemas/process'
2448+
- required:
2449+
- id
2450+
- process_graph
24672451
examples:
24682452
evi_user_defined_process:
24692453
$ref: '#/components/examples/evi_user_defined_process'
24702454
4XX:
24712455
$ref: '#/components/responses/client_error_auth'
24722456
5XX:
24732457
$ref: '#/components/responses/server_error'
2474-
patch:
2475-
summary: Modify a user-defined process
2476-
operationId: update-custom-process
2477-
description: >-
2478-
Fully or partially replaces a user-defined process (process graph).
2458+
put:
2459+
summary: Store a user-defined process
2460+
operationId: store-custom-process
2461+
description: |-
2462+
Stores a provided user-defined process with process graph that can be
2463+
reused in other process graphs. If a process with the specified
2464+
`process_graph_id` exists, the process is fully replaced. The id can't
2465+
be changed for stored user-defined processes.
2466+
2467+
The id must be unique for the authenticated user, including all
2468+
pre-defined processes by the back-end.
2469+
2470+
Partially updating user-defined processes is not supported.
24792471
2480-
The process id must still be unique for the authenticated user,
2481-
including all pre-defined processes by the back-end.
2472+
To simplify exchanging process graphs, the property `id` can be part of
2473+
the request body. If the values don't match, the value for `id` gets
2474+
replaced with the value from the `process_graph_id` parameter in the
2475+
path.
24822476
tags:
24832477
- User-Defined Processes
24842478
security:
24852479
- Bearer: []
24862480
responses:
2487-
'204':
2488-
description: The process graph data has been updated successfully.
2481+
'200':
2482+
description: The user-defined process has been stored successfully.
24892483
4XX:
24902484
$ref: '#/components/responses/client_error_auth'
24912485
5XX:
24922486
$ref: '#/components/responses/server_error'
24932487
requestBody:
24942488
required: true
2489+
description: Specifies the process graph with its meta data.
24952490
content:
24962491
application/json:
24972492
schema:
2498-
$ref: '#/components/schemas/process_metadata'
2493+
$ref: '#/components/schemas/process_graph_with_metadata'
24992494
examples:
25002495
evi_user_defined_process:
25012496
$ref: '#/components/examples/evi_user_defined_process'
@@ -4560,8 +4555,8 @@ components:
45604555
from_node: mintime
45614556
format: GTiff
45624557
result: true
4563-
process_metadata:
4564-
title: Process Metadata
4558+
process:
4559+
title: Process
45654560
type: object
45664561
properties:
45674562
id:
@@ -4630,32 +4625,8 @@ components:
46304625
[common relation types in openEO](#section/API-Principles/Web-Linking).
46314626
items:
46324627
$ref: '#/components/schemas/link'
4633-
process:
4634-
title: Process
4635-
allOf:
4636-
- $ref: '#/components/schemas/process_metadata'
4637-
- type: object
4638-
properties:
4639-
process_graph:
4640-
$ref: '#/components/schemas/process_graph'
4641-
predefined_process:
4642-
title: Pre-Defined Process
4643-
description: A pre-defined process made available by the back-end.
4644-
allOf:
4645-
- $ref: '#/components/schemas/process'
4646-
- required:
4647-
- id
4648-
- description
4649-
- parameters
4650-
- returns
4651-
user_defined_process:
4652-
title: User-Defined Process
4653-
description: A user-defined process with processing instructions as process graph.
4654-
allOf:
4655-
- $ref: '#/components/schemas/process'
4656-
- required:
4657-
- id
4658-
- process_graph
4628+
process_graph:
4629+
$ref: '#/components/schemas/process_graph'
46594630
process_graph_with_metadata:
46604631
title: Process Graph with metadata
46614632
description: A process graph, optionally enriched with process metadata.

0 commit comments

Comments
 (0)