ECS, support for notification of available information types
[nonrtric.git] / enrichment-coordinator-service / api / ecs-api.yaml
index 6318ee1..3f2a1cd 100644 (file)
@@ -20,8 +20,9 @@ info:
     by the Non-RT RIC platform and is intended to be part of the O-RAN R1 interface.  The
     API is for use by different kinds of data consumers and provides support for:<ul><li>Querying
     of available types of data to consume.</li><li>Management of data subscription
-    jobs</li></ul></p><h4>Service status</h4><p>  This API provides a means to monitor
-    the health of this service.</p>
+    jobs</li><li>Optional callback API provided by consumers to get notification on
+    added and removed information types.</li></ul></p><h4>Service status</h4><p>  This
+    API provides a means to monitor the health of this service.</p>
   license:
     name: Copyright (C) 2020 Nordix Foundation. Licensed under the Apache License.
     url: http://www.apache.org/licenses/LICENSE-2.0
@@ -42,6 +43,29 @@ tags:
 - name: Data consumer
   description: API for data consumers
 paths:
+  /example_dataproducer/info_job/{infoJobId}:
+    delete:
+      tags:
+      - Data producer (callbacks)
+      summary: Callback for Information Job deletion
+      description: The call is invoked to terminate a data subscription. The endpoint
+        is provided by the Information Producer.
+      operationId: jobDeletedCallback
+      parameters:
+      - name: infoJobId
+        in: path
+        required: true
+        style: simple
+        explode: false
+        schema:
+          type: string
+      responses:
+        200:
+          description: OK
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/Void'
   /data-producer/v1/info-types:
     get:
       tags:
@@ -84,6 +108,27 @@ paths:
             application/json:
               schema:
                 $ref: '#/components/schemas/ProblemDetails'
+  /example_dataproducer/info_job:
+    post:
+      tags:
+      - Data producer (callbacks)
+      summary: Callback for Information Job creation/modification
+      description: The call is invoked to activate or to modify a data subscription.
+        The endpoint is provided by the Information Producer.
+      operationId: jobCreatedCallback
+      requestBody:
+        content:
+          application/json:
+            schema:
+              $ref: '#/components/schemas/producer_info_job_request'
+        required: true
+      responses:
+        200:
+          description: OK
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/Void'
   /data-producer/v1/info-types/{infoTypeId}:
     get:
       tags:
@@ -187,6 +232,114 @@ paths:
             application/json:
               schema:
                 $ref: '#/components/schemas/ProblemDetails'
+  /data-consumer/v1/info-type-subscription/{subscriptionId}:
+    get:
+      tags:
+      - Data consumer
+      summary: Individual subscription for information types (registration/deregistration)
+      operationId: getIndividualTypeSubscription
+      parameters:
+      - name: subscriptionId
+        in: path
+        required: true
+        style: simple
+        explode: false
+        schema:
+          type: string
+      responses:
+        200:
+          description: Type subscription
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/consumer_type_subscription_info'
+        404:
+          description: Subscription is not found
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/ProblemDetails'
+    put:
+      tags:
+      - Data consumer
+      summary: Individual subscription for information types (registration/deregistration)
+      description: This service operation is used to subscribe to notifications for
+        changes in the availability of data types.
+      operationId: putIndividualTypeSubscription
+      parameters:
+      - name: subscriptionId
+        in: path
+        required: true
+        style: simple
+        explode: false
+        schema:
+          type: string
+      requestBody:
+        content:
+          application/json:
+            schema:
+              $ref: '#/components/schemas/consumer_type_subscription_info'
+        required: true
+      responses:
+        200:
+          description: Subscription updated
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/Void'
+        201:
+          description: Subscription created
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/Void'
+    delete:
+      tags:
+      - Data consumer
+      summary: Individual subscription for information types (registration/deregistration)
+      operationId: deleteIndividualTypeSubscription
+      parameters:
+      - name: subscriptionId
+        in: path
+        required: true
+        style: simple
+        explode: false
+        schema:
+          type: string
+      responses:
+        200:
+          description: Not used
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/Void'
+        204:
+          description: Subscription deleted
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/Void'
+        404:
+          description: Subscription is not found
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/ProblemDetails'
+  /example_dataproducer/health_check:
+    get:
+      tags:
+      - Data producer (callbacks)
+      summary: Producer supervision
+      description: The endpoint is provided by the Information Producer and is used
+        for supervision of the producer.
+      operationId: producerSupervision
+      responses:
+        200:
+          description: The producer is OK
+          content:
+            application/json:
+              schema:
+                type: string
   /A1-EI/v1/eitypes:
     get:
       tags:
@@ -314,42 +467,44 @@ paths:
             application/json:
               schema:
                 $ref: '#/components/schemas/ProblemDetails'
-  /producer_simulator/info_job/{infoJobId}:
-    delete:
+  /status:
+    get:
       tags:
-      - Data producer (callbacks)
-      summary: Callback for Information Job deletion
-      description: The call is invoked to terminate a data subscription. The endpoint
-        is provided by the Information Producer.
-      operationId: jobDeletedCallback
-      parameters:
-      - name: infoJobId
-        in: path
-        required: true
-        style: simple
-        explode: false
-        schema:
-          type: string
+      - Service status
+      summary: Returns status and statistics of this service
+      operationId: getStatus
       responses:
         200:
-          description: OK
+          description: Service is living
           content:
             application/json:
               schema:
-                $ref: '#/components/schemas/Void'
-  /status:
+                $ref: '#/components/schemas/service_status_info'
+  /data-consumer/v1/info-type-subscription:
     get:
       tags:
-      - Service status
-      summary: Returns status and statistics of this service
-      operationId: getStatus
+      - Data consumer
+      summary: Information type subscription identifiers
+      description: query for information type subscription identifiers
+      operationId: getInfoTypeSubscriptions
+      parameters:
+      - name: owner
+        in: query
+        description: selects result for one owner
+        required: false
+        style: form
+        explode: true
+        schema:
+          type: string
       responses:
         200:
-          description: Service is living
+          description: Information type subscription identifiers
           content:
             application/json:
               schema:
-                $ref: '#/components/schemas/status_info'
+                type: array
+                items:
+                  type: string
   /A1-EI/v1/eijobs/{eiJobId}:
     get:
       tags:
@@ -447,21 +602,6 @@ paths:
             application/json:
               schema:
                 $ref: '#/components/schemas/ProblemDetails'
-  /producer_simulator/health_check:
-    get:
-      tags:
-      - Data producer (callbacks)
-      summary: Producer supervision
-      description: The endpoint is provided by the Information Producer and is used
-        for supervision of the producer.
-      operationId: producerSupervision
-      responses:
-        200:
-          description: The producer is OK
-          content:
-            application/json:
-              schema:
-                type: string
   /data-consumer/v1/info-jobs:
     get:
       tags:
@@ -480,7 +620,7 @@ paths:
           type: string
       - name: owner
         in: query
-        description: selects subscription jobs for one job owner
+        description: selects result for one owner
         required: false
         style: form
         explode: true
@@ -660,27 +800,6 @@ paths:
             application/json:
               schema:
                 $ref: '#/components/schemas/ProblemDetails'
-  /producer_simulator/info_job:
-    post:
-      tags:
-      - Data producer (callbacks)
-      summary: Callback for Information Job creation/modification
-      description: The call is invoked to activate or to modify a data subscription.
-        The endpoint is provided by the Information Producer.
-      operationId: jobCreatedCallback
-      requestBody:
-        content:
-          application/json:
-            schema:
-              $ref: '#/components/schemas/producer_info_job_request'
-        required: true
-      responses:
-        200:
-          description: OK
-          content:
-            application/json:
-              schema:
-                $ref: '#/components/schemas/Void'
   /example_dataconsumer/info_jobs/{infoJobId}/status:
     post:
       tags:
@@ -860,13 +979,49 @@ paths:
             application/json:
               schema:
                 $ref: '#/components/schemas/ProblemDetails'
+  /example_dataconsumer/info_type_status:
+    post:
+      tags:
+      - Data consumer (callbacks)
+      summary: Callback for changed Information type registration status
+      description: The primitive is implemented by the data consumer and is invoked
+        when a Information type status has been changed. <br/>Subscription are managed
+        by primitives in 'Data consumer'
+      operationId: typeStatusCallback
+      requestBody:
+        content:
+          application/json:
+            schema:
+              $ref: '#/components/schemas/consumer_type_registration_info'
+        required: true
+      responses:
+        200:
+          description: OK
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/Void'
 components:
   schemas:
     consumer_information_type:
       required:
       - job_data_schema
+      - no_of_producers
+      - type_status
       type: object
       properties:
+        no_of_producers:
+          type: integer
+          description: The number of registered producers for the type
+          format: int32
+        type_status:
+          type: string
+          description: 'Allowed values: <br/>ENABLED: one or several producers for
+            the information type are available <br/>DISABLED: no producers for the
+            information type are available'
+          enum:
+          - ENABLED
+          - DISABLED
         job_data_schema:
           type: object
           description: Json schema for the job data
@@ -874,7 +1029,7 @@ components:
     EiTypeObject:
       type: object
       description: Information for an EI type
-    status_info:
+    service_status_info:
       required:
       - no_of_jobs
       - no_of_producers
@@ -917,6 +1072,27 @@ components:
           type: string
           description: callback for Information Job
       description: Information for an Information Producer
+    consumer_type_registration_info:
+      required:
+      - info_type_id
+      - job_data_schema
+      - status
+      type: object
+      properties:
+        info_type_id:
+          type: string
+          description: Information type identifier
+        job_data_schema:
+          type: object
+          description: Json schema for the job data
+        status:
+          type: string
+          description: 'Allowed values: <br/>REGISTERED: the information type has
+            been registered <br/>DEREGISTERED: the information type has been removed'
+          enum:
+          - REGISTERED
+          - DEREGISTERED
+      description: Information for an Information type
     ProblemDetails:
       type: object
       properties:
@@ -940,7 +1116,9 @@ components:
       properties:
         eiJobStatus:
           type: string
-          description: Allowed values for EI job status
+          description: 'Allowed values for EI job status: <br/>ENABLED: the A1-EI
+            producer is able to deliver EI result for the EI job <br/>DISABLED: the
+            A1-EI producer is unable to deliver EI result for the EI job'
           enum:
           - ENABLED
           - DISABLED
@@ -953,16 +1131,18 @@ components:
       properties:
         info_job_status:
           type: string
-          description: Allowed values for Information Job status
+          description: 'Allowed values: <br/>ENABLED: the A1-Information producer
+            is able to deliver result for the Information Job <br/>DISABLED: the A1-Information
+            producer is unable to deliver result for the Information Job'
           enum:
           - ENABLED
           - DISABLED
         producers:
           type: array
-          description: An array of all registerred Information Producer Identifiers.
+          description: An array of all registered Information Producer Identifiers.
           items:
             type: string
-            description: An array of all registerred Information Producer Identifiers.
+            description: An array of all registered Information Producer Identifiers.
       description: Status for an Information Job
     EiJobObject:
       required:
@@ -1045,7 +1225,7 @@ components:
         status_notification_uri:
           type: string
           description: The target of Information subscription job status notifications
-      description: Information for an Enrichment  Information Job
+      description: Information for an Enrichment Information Job
     producer_status:
       required:
       - operational_state
@@ -1061,3 +1241,16 @@ components:
     Void:
       type: object
       description: 'Void/empty '
+    consumer_type_subscription_info:
+      required:
+      - owner
+      - status_result_uri
+      type: object
+      properties:
+        owner:
+          type: string
+          description: Identity of the owner of the subscription
+        status_result_uri:
+          type: string
+          description: The target URI of the subscribed information
+      description: Information for an information type subscription