Client CLI¶
Similar to the Python API client, the CLI client provides the following capabilities:
s2gos-client list-processes: list existing processes,s2gos-client get-process: get the details about a process,s2gos-client validate-request: validate a given process execution request,s2gos-client execute-process: execute a given process execution request,s2gos-client list-jobs: list the jobs resulting from process executions, and finallys2gos-client get-job: get a job's details,s2gos-client get-job-results: get a successful job's results, and finallys2gos-client dismiss-job: cancel a successful job.
In the following, we visit all the features by example.
The client expects a running server that conforms to the OGC API - Processes: Part 1, Version 1.0. If you don't have one available, you can also run the project's server with a test configuration:
s2gos-server run -- wraptile.services.local.testing:service
In [1]:
Copied!
!s2gos-client --help
!s2gos-client --help
Usage: s2gos-client [OPTIONS] COMMAND [ARGS]...
Interact with the ESA DTE S2GOS processing service.
`s2gos-client` can be used to get the available processes, get process
details, execute processes, and manage the jobs originating from the latter.
It
herewith resembles the core functionality of the OGC API - Processes, Part 1.
For details see https://ogcapi.ogc.org/processes/.
You can use shorter command name aliases, e.g., use command name `vr`
for `validate-request`, or `lp` for `list-processes`.
The tool's exit codes are as follows:
* `0` - normal exit
* `1` - user errors, argument errors
* `2` - remote API errors
* `3` - local network transport errors
If the `--traceback` flag is set, the original Python exception traceback
will be shown and the exit code will always be `1`.
Otherwise, only the error message is shown.
+- Options -------------------------------------------------------------------+
| --version Show version and exit. |
| --traceback,--tb Show server exception traceback, if any. |
| --install-completion Install completion for the current shell. |
| --show-completion Show completion for the current shell, to |
| copy it or customize the installation. |
| --help Show this message and exit. |
+-----------------------------------------------------------------------------+
+- Commands ------------------------------------------------------------------+
| configure Configure the client tool. |
| list-processes List available processes. |
| get-process Get process details. |
| create-request Create an execution request (template) for a given |
| process. |
| validate-request Validate a process execution request. |
| execute-process Execute a process in asynchronous mode. |
| list-jobs List all jobs. |
| get-job Get job details. |
| dismiss-job Cancel a running or delete a finished job. |
| get-job-results Get job results. |
+-----------------------------------------------------------------------------+
In [2]:
Copied!
!s2gos-client configure -s http://127.0.0.1:8008 -u bibo -t 1234
!s2gos-client configure -s http://127.0.0.1:8008 -u bibo -t 1234
Client configuration written to C:\Users\Norman\.eozilla\config
In [3]:
Copied!
!s2gos-client list-processes
!s2gos-client list-processes
links:
- href: http://127.0.0.1:8008/processes
hreflang: en
rel: self
title: get_processes
type: application/json
processes:
- description: Sleeps for `duration` seconds. Fails on purpose if `fail` is `True`.
Returns the effective amount of sleep in seconds.
id: sleep_a_while
title: Sleep Processor
version: 0.0.0
- description: Returns the list of prime numbers between a `min_val` and `max_val`.
id: primes_between
title: Prime Processor
version: 0.0.0
- description: Simulate a set scene images slices for testing. Creates an xarray dataset
with `periodicity` time slices and writes it as Zarr into a temporary location.
Requires installed `dask`, `xarray`, and `zarr` packages.
id: simulate_scene
title: Generate scene for testing
version: 0.0.0
- id: return_base_model
title: BaseModel Test
version: 0.0.0
In [4]:
Copied!
!s2gos-client get-process primes_between
!s2gos-client get-process primes_between
description: Returns the list of prime numbers between a `min_val` and `max_val`.
id: primes_between
inputs:
max_val:
minOccurs: 0
schema:
default: 100
maximum: 100.0
type: integer
title: Max Val
min_val:
minOccurs: 0
schema:
default: 0
minimum: 0.0
type: integer
title: Min Val
outputs:
return_value:
schema:
items:
type: integer
type: array
title: Return Value
title: Prime Processor
version: 0.0.0
In [5]:
Copied!
!s2gos-client execute-process primes_between -i min_val=10 -i max_val=80
!s2gos-client execute-process primes_between -i min_val=10 -i max_val=80
created: '2025-11-13T18:02:35.468838Z' jobID: job_5 processID: primes_between status: accepted type: process
In [6]:
Copied!
!s2gos-client list-jobs
!s2gos-client list-jobs
jobs:
- created: '2025-11-13T17:58:50.670036Z'
finished: '2025-11-13T17:59:00.820523Z'
jobID: job_0
processID: sleep_a_while
progress: 100
started: '2025-11-13T17:58:50.670374Z'
status: successful
type: process
updated: '2025-11-13T17:59:00.720409Z'
- created: '2025-11-13T17:58:56.296245Z'
finished: '2025-11-13T17:59:11.321416Z'
jobID: job_1
message: Woke up too early
processID: sleep_a_while
progress: 50
started: '2025-11-13T17:58:56.296554Z'
status: failed
traceback:
- 'Traceback (most recent call last):
'
- " File \"C:\\Users\\Norman\\Projects\\s2gos-controller\\.pixi\\envs\\default\\\
Lib\\site-packages\\procodile\\job.py\", line 263, in run\n function_result\
\ = self.process.function(**function_kwargs)\n"
- " File \"C:\\Users\\Norman\\Projects\\s2gos-controller\\.pixi\\envs\\default\\\
Lib\\site-packages\\wraptile\\services\\local\\testing.py\", line 42, in sleep_a_while\n\
\ raise RuntimeError(\"Woke up too early\")\n"
- 'RuntimeError: Woke up too early
'
type: process
updated: '2025-11-13T17:59:11.321345Z'
- created: '2025-11-13T17:59:17.898138Z'
finished: '2025-11-13T17:59:38.153405Z'
jobID: job_2
processID: sleep_a_while
progress: 100
started: '2025-11-13T17:59:17.898503Z'
status: successful
type: process
updated: '2025-11-13T17:59:37.952697Z'
- created: '2025-11-13T18:01:10.775835Z'
finished: '2025-11-13T18:01:13.176371Z'
jobID: job_3
processID: simulate_scene
started: '2025-11-13T18:01:10.776288Z'
status: successful
type: process
- created: '2025-11-13T18:01:20.568455Z'
finished: '2025-11-13T18:01:20.648477Z'
jobID: job_4
processID: simulate_scene
started: '2025-11-13T18:01:20.568998Z'
status: successful
type: process
- created: '2025-11-13T18:02:35.468838Z'
finished: '2025-11-13T18:02:35.469317Z'
jobID: job_5
message: Done
processID: primes_between
started: '2025-11-13T18:02:35.469254Z'
status: successful
type: process
updated: '2025-11-13T18:02:35.469310Z'
links:
- href: http://127.0.0.1:8008/jobs
hreflang: en
rel: self
title: get_jobs
type: application/json
In [7]:
Copied!
!s2gos-client get-job job_0
!s2gos-client get-job job_0
created: '2025-11-13T17:58:50.670036Z' finished: '2025-11-13T17:59:00.820523Z' jobID: job_0 processID: sleep_a_while progress: 100 started: '2025-11-13T17:58:50.670374Z' status: successful type: process updated: '2025-11-13T17:59:00.720409Z'
In [8]:
Copied!
!s2gos-client get-job-results job_0
!s2gos-client get-job-results job_0
return_value: 10.150075912475586
In [ ]:
Copied!
In [ ]:
Copied!
In [ ]:
Copied!
In [ ]:
Copied!