From a9d62a727c8cf9b5d636129f3eac37c2e8034d4b Mon Sep 17 00:00:00 2001 From: David Wiessner Date: Thu, 21 Nov 2024 12:46:57 +0000 Subject: [PATCH 1/2] Extended openapi: extractor, schema, health --- api/openapi.yaml | 127 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 126 insertions(+), 1 deletion(-) diff --git a/api/openapi.yaml b/api/openapi.yaml index b8d8c4c..124acd8 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -12,6 +12,10 @@ tags: description: Operations related to datasets - name: transfer description: Operations related to data transfers + - name: extractor + description: Operations related to metadata extraction + - name: schema + description: Operations related to schemas - name: other description: Further operations for general information @@ -111,6 +115,20 @@ paths: schema: type: string + /health: + get: + tags: + - other + summary: Get the health status. + description: Retrieve information about the status of openEm components. + operationId: OtherController_getHealth + responses: + "200": + description: Health status retrieved successfully + content: + application/json: + schema: + $ref: "#/components/schemas/IngestorUiOtherHealthResponse" /version: get: tags: @@ -125,7 +143,71 @@ paths: application/json: schema: $ref: "#/components/schemas/IngestorUiOtherVersionResponse" - + /extractor: + get: + tags: + - extractor + summary: Get available extractors + description: 'Retrieve the available extractors configured in the ingestor.' + operationId: ExtractorController_getExtractors + responses: + '200': + description: Avilable extractors retrieved sucessfully + content: + application/json: + schema: + $ref: "#/components/schemas/IngestorUiOtherVersionResponse" + post: + tags: + - extractor + summary: Start a new metadata extraction + description: Start a new metadata extraction on the specified data set with the selected method. + operationId: ExtractorController_startExtraction + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/IngestorUiPostExtractionRequest" + responses: + "200": + description: Dataset ingestion successful + content: + application/json: + schema: + $ref: "#/components/schemas/IngestorUiPostDatasetResponse" + "400": + description: Invalid request + content: + text/plain: + schema: + type: string + /schema: + get: + tags: + - schema + summary: Get schema for selected method + description: 'Retrieve the right schema for the selected extractor.' + operationId: SchemaController_getSchema + parameters: + - name: methodName + in: query + required: true + schema: + type: string + responses: + '200': + description: Schema retrieved sucessfully + content: + application/json: + schema: + $ref: "#/components/schemas/IngestorUiGetSchemaRequest" + "400": + description: Invalid request + content: + text/plain: + schema: + type: string components: schemas: IngestorUiPostDatasetRequest: @@ -181,3 +263,46 @@ components: version: type: string description: Version of the ingestor. + IngestorUiOtherHealthResponse: + type: object + properties: + ingestorStatus: + type: string + description: Status of the ingestor. + scicatStatus: + type: string + description: Status of SciCat. + globusStatus: + type: string + description: Status of Globus. + IngestorUiGetExtractorItem: + type: object + properties: + methodName: + type: string + description: Available method names of the extractor configurered in the ingestor. + IngestorUiGetExtractorResponse: + type: object + properties: + extractors: + type: array + items: + $ref: "#/components/schemas/IngestorUiGetExtractorItem" + total: + type: integer + description: Total number of transfers. + IngestorUiPostExtractionRequest: + type: object + properties: + filePath: + type: string + description: The file path of the selected data record. + methodName: + type: string + description: The selected methodName for data extraction. + IngestorUiGetSchemaRequest: + type: object + properties: + schema: + type: string + description: Schema which belongs to an extractor method. From 967eef611d8f2f0f17d3a56d59b9b7b7a258823b Mon Sep 17 00:00:00 2001 From: David Wiessner Date: Thu, 21 Nov 2024 12:52:53 +0000 Subject: [PATCH 2/2] add get for dataset --- api/openapi.yaml | 54 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/api/openapi.yaml b/api/openapi.yaml index 124acd8..2056b33 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -26,6 +26,25 @@ tags: paths: /dataset: + get: + tags: + - dataset + summary: Get the available datasets. + description: Retrieve the folder structure of the available datasets. + operationId: DatasetController_getDataset + responses: + "200": + description: Dataset successfully retrieved. + content: + application/json: + schema: + $ref: "#/components/schemas/IngestorUiGetDatasetResponse" + "400": + description: Invalid request + content: + text/plain: + schema: + type: string post: tags: - dataset @@ -129,6 +148,12 @@ paths: application/json: schema: $ref: "#/components/schemas/IngestorUiOtherHealthResponse" + "400": + description: Invalid request + content: + text/plain: + schema: + type: string /version: get: tags: @@ -143,6 +168,12 @@ paths: application/json: schema: $ref: "#/components/schemas/IngestorUiOtherVersionResponse" + "400": + description: Invalid request + content: + text/plain: + schema: + type: string /extractor: get: tags: @@ -157,6 +188,12 @@ paths: application/json: schema: $ref: "#/components/schemas/IngestorUiOtherVersionResponse" + "400": + description: Invalid request + content: + text/plain: + schema: + type: string post: tags: - extractor @@ -290,7 +327,7 @@ components: $ref: "#/components/schemas/IngestorUiGetExtractorItem" total: type: integer - description: Total number of transfers. + description: Total number of extractors. IngestorUiPostExtractionRequest: type: object properties: @@ -306,3 +343,18 @@ components: schema: type: string description: Schema which belongs to an extractor method. + IngestorUiGetDatasetItem: + type: object + properties: + dataset: + type: string + IngestorUiGetDatasetResponse: + type: object + properties: + datasets: + type: array + items: + $ref: "#/components/schemas/IngestorUiGetDatasetItem" + total: + type: integer + description: Total number of datasets.