Skip to content

Commit ceee8ab

Browse files
authored
Merge pull request #206 from ecmwf-projects/COPDS-797-inject-endpoints-doc
Define custom endpoints description
2 parents 354104e + faeaa4a commit ceee8ab

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

cads_processing_api_service/clients.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,16 @@ class DatabaseClient(ogc_api_processes_fastapi.clients.BaseClient):
7070
process_data_table = cads_catalogue.database.ResourceData
7171
job_table = cads_broker.database.SystemRequest
7272

73+
endpoints_description = {
74+
"GetProcesses": "Get the list of available processes' summaries.",
75+
"GetProcess": "Get the description of the process identified by `process_id`.",
76+
"PostProcessExecution": "Request execution of a process.",
77+
"GetJobs": "Get the list of submitted jobs, alongside information on their status.",
78+
"GetJob": "Get status information for the job identifed by `job_id`.",
79+
"GetJobResults": "Get results for the job identifed by `job_id`.",
80+
"DeleteJob": "Dismiss the job identifed by `job_id`.",
81+
}
82+
7383
def get_processes(
7484
self,
7585
limit: int | None = fastapi.Query(10, ge=1, le=10000),

cads_processing_api_service/main.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,19 @@ async def lifespan(application: fastapi.FastAPI) -> AsyncGenerator[Any, None]:
6565
app.router.add_api_route(
6666
"/processes/{process_id}/constraints",
6767
constraints.apply_constraints,
68+
description="Apply constraints to the submitted process execution.",
6869
methods=["POST"],
6970
)
7071
app.router.add_api_route(
7172
"/processes/{process_id}/costing",
7273
costing.estimate_costs,
74+
description="Estimate costs of the submitted process execution.",
7375
methods=["POST"],
7476
)
7577
app.router.add_api_route(
7678
"/processes/{process_id}/api-request",
7779
translators.get_api_request,
80+
description="Get API request equivalent to the submitted prrocess execution json.",
7881
methods=["POST"],
7982
)
8083

0 commit comments

Comments
 (0)