Rejecting EI types with no schema
[nonrtric.git] / enrichment-coordinator-service / api / ecs-api.yaml
index ac49e5a..d7d5eb3 100644 (file)
@@ -8,19 +8,19 @@ servers:
 tags:
 - name: A1-EI (enrichment information)
   description: Consumer Controller
-- name: Consumer Callbacks
+- name: A1-EI (enrichment information) callbacks
   description: Consumer Simulator Controller
-- name: Enrichment Data Producer API
-  description: Producer Controller
-- name: Producer Callbacks
+- name: Data Producer Job Control (example producer)
   description: Producer Simulator Controller
+- name: Data Producer Registry API
+  description: Producer Controller
 - name: Service status
   description: Status Controller
 paths:
   /producer_simulator/ei_job:
     post:
       tags:
-      - Producer Callbacks
+      - Data Producer Job Control (example producer)
       summary: Callback for EI job creation
       operationId: jobCreatedCallbackUsingPOST
       requestBody:
@@ -83,7 +83,7 @@ paths:
   /consumer_simulator/eijobs/{eiJobId}/status:
     post:
       tags:
-      - Consumer Callbacks
+      - A1-EI (enrichment information) callbacks
       summary: Callback for EI job status
       operationId: jobStatusCallbackUsingPOST
       parameters:
@@ -120,7 +120,7 @@ paths:
   /ei-producer/v1/eitypes:
     get:
       tags:
-      - Enrichment Data Producer API
+      - Data Producer Registry API
       summary: EI type identifiers
       operationId: getEiTypeIdentifiersUsingGET_1
       responses:
@@ -170,7 +170,7 @@ paths:
   /ei-producer/v1/eiproducers/{eiProducerId}/status:
     get:
       tags:
-      - Enrichment Data Producer API
+      - Data Producer Registry API
       summary: EI producer status
       operationId: getEiProducerStatusUsingGET
       parameters:
@@ -203,7 +203,7 @@ paths:
   /producer_simulator/ei_job/{eiJobId}:
     delete:
       tags:
-      - Producer Callbacks
+      - Data Producer Job Control (example producer)
       summary: Callback for EI job deletion
       operationId: jobDeletedCallbackUsingDELETE
       parameters:
@@ -230,9 +230,16 @@ paths:
   /ei-producer/v1/eiproducers:
     get:
       tags:
-      - Enrichment Data Producer API
+      - Data Producer Registry API
       summary: EI producer identifiers
       operationId: getEiProducerIdentifiersUsingGET
+      parameters:
+      - name: ei_type_id
+        in: query
+        description: If given, only the producers for the EI Data type is returned.
+        allowEmptyValue: false
+        schema:
+          type: string
       responses:
         200:
           description: EI producer identifiers
@@ -255,7 +262,7 @@ paths:
   /ei-producer/v1/eitypes/{eiTypeId}:
     get:
       tags:
-      - Enrichment Data Producer API
+      - Data Producer Registry API
       summary: Individual EI type
       operationId: getEiTypeUsingGET_1
       parameters:
@@ -285,6 +292,86 @@ paths:
               schema:
                 $ref: '#/components/schemas/ProblemDetails'
       deprecated: false
+    put:
+      tags:
+      - Data Producer Registry API
+      summary: Individual EI type
+      operationId: putEiTypeUsingPUT
+      parameters:
+      - name: eiTypeId
+        in: path
+        description: eiTypeId
+        required: true
+        schema:
+          type: string
+      requestBody:
+        description: registrationInfo
+        content:
+          application/json:
+            schema:
+              $ref: '#/components/schemas/producer_ei_type_info'
+        required: true
+      responses:
+        200:
+          description: OK
+          content: {}
+        201:
+          description: Created
+          content: {}
+        400:
+          description: Bad request
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/ProblemDetails'
+        401:
+          description: Unauthorized
+          content: {}
+        403:
+          description: Forbidden
+          content: {}
+        404:
+          description: Not Found
+          content: {}
+      deprecated: false
+    delete:
+      tags:
+      - Data Producer Registry API
+      summary: Individual EI type
+      operationId: deleteEiTypeUsingDELETE
+      parameters:
+      - name: eiTypeId
+        in: path
+        description: eiTypeId
+        required: true
+        schema:
+          type: string
+      responses:
+        200:
+          description: Not used
+          content: {}
+        204:
+          description: Producer deleted
+          content: {}
+        401:
+          description: Unauthorized
+          content: {}
+        403:
+          description: Forbidden
+          content: {}
+        404:
+          description: Enrichment Information type is not found
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/ProblemDetails'
+        406:
+          description: The Enrichment Information type has one or several active producers
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/ProblemDetails'
+      deprecated: false
   /status:
     get:
       tags:
@@ -415,7 +502,7 @@ paths:
   /ei-producer/v1/eiproducers/{eiProducerId}:
     get:
       tags:
-      - Enrichment Data Producer API
+      - Data Producer Registry API
       summary: Individual EI producer
       operationId: getEiProducerUsingGET
       parameters:
@@ -447,7 +534,7 @@ paths:
       deprecated: false
     put:
       tags:
-      - Enrichment Data Producer API
+      - Data Producer Registry API
       summary: Individual EI producer
       operationId: putEiProducerUsingPUT
       parameters:
@@ -483,7 +570,7 @@ paths:
       deprecated: false
     delete:
       tags:
-      - Enrichment Data Producer API
+      - Data Producer Registry API
       summary: Individual EI producer
       operationId: deleteEiProducerUsingDELETE
       parameters:
@@ -516,7 +603,7 @@ paths:
   /producer_simulator/health_check:
     get:
       tags:
-      - Producer Callbacks
+      - Data Producer Job Control (example producer)
       summary: Producer supervision
       operationId: producerSupervisionUsingGET
       responses:
@@ -539,7 +626,7 @@ paths:
   /ei-producer/v1/eiproducers/{eiProducerId}/eijobs:
     get:
       tags:
-      - Enrichment Data Producer API
+      - Data Producer Registry API
       summary: EI job definitions
       description: EI job definitions for one EI producer
       operationId: getEiProducerJobsUsingGET
@@ -661,6 +748,9 @@ components:
         ei_job_identity:
           type: string
           description: Idenitity of the EI job
+        last_updated:
+          type: string
+          description: The time when the job was last updated or created (ISO-8601)
         ei_job_data:
           type: object
           properties: {}
@@ -676,20 +766,6 @@ components:
       title: EiTypeObject
       type: object
       description: Information for an EI type
-    producer_ei_type_registration_info:
-      title: producer_ei_type_registration_info
-      required:
-      - ei_type_identity
-      type: object
-      properties:
-        ei_type_identity:
-          type: string
-          description: EI type identity
-        ei_job_data_schema:
-          type: object
-          properties: {}
-          description: Json schema for the job data
-      description: Information for an EI type
     status_info:
       title: status_info
       type: object
@@ -714,13 +790,10 @@ components:
       type: object
     producer_ei_type_info:
       title: producer_ei_type_info
+      required:
+      - ei_job_data_schema
       type: object
       properties:
-        ei_producer_ids:
-          type: array
-          description: Registered producers
-          items:
-            type: string
         ei_job_data_schema:
           type: object
           properties: {}
@@ -736,9 +809,9 @@ components:
       properties:
         supported_ei_types:
           type: array
-          description: Supported EI types
+          description: Supported EI type IDs
           items:
-            $ref: '#/components/schemas/producer_ei_type_registration_info'
+            type: string
         ei_producer_supervision_callback_url:
           type: string
           description: callback for producer supervision