Merge "Added STD sim 2.0.0 tests"
[nonrtric.git] / policy-agent / docs / api.yaml
index 1416298..ec9bbce 100644 (file)
 swagger: '2.0'
 info:
-  description: This page lists all the rest apis for Policy server.
+  description: This page lists all the rest apis for the service.
   version: '1.0'
-  title: Policy server
+  title: A1 Policy management service
 host: 'localhost:8081'
 basePath: /
 tags:
-  - name: operation-handler
-    description: Operation Handler
-  - name: policy-controller
+  - name: A1 Policy Management
     description: Policy Controller
-  - name: ric-repository-controller
+  - name: Health check
+    description: Status Controller
+  - name: RIC Repository
     description: Ric Repository Controller
-  - name: service-controller
+  - name: Service registry and supervision
     description: Service Controller
-  - name: status-controller
-    description: Status Controller
-  - name: web-mvc-links-handler
-    description: Web Mvc Links Handler
 paths:
-  /actuator:
-    get:
-      tags:
-        - web-mvc-links-handler
-      summary: links
-      operationId: linksUsingGET
-      produces:
-        - application/vnd.spring-boot.actuator.v3+json
-        - application/json
-        - application/vnd.spring-boot.actuator.v2+json
-      responses:
-        '200':
-          description: OK
-          schema:
-            type: object
-            additionalProperties:
-              type: object
-              additionalProperties:
-                $ref: '#/definitions/Link'
-        '401':
-          description: Unauthorized
-        '403':
-          description: Forbidden
-        '404':
-          description: Not Found
-      deprecated: false
-  /actuator/health:
-    get:
-      tags:
-        - operation-handler
-      summary: handle
-      operationId: handleUsingGET_1
-      produces:
-        - application/vnd.spring-boot.actuator.v3+json
-        - application/json
-        - application/vnd.spring-boot.actuator.v2+json
-      parameters:
-        - in: body
-          name: body
-          description: body
-          required: false
-          schema:
-            type: object
-            additionalProperties:
-              type: string
-      responses:
-        '200':
-          description: OK
-          schema:
-            type: object
-        '401':
-          description: Unauthorized
-        '403':
-          description: Forbidden
-        '404':
-          description: Not Found
-      deprecated: false
-  /actuator/health/**:
-    get:
-      tags:
-        - operation-handler
-      summary: handle
-      operationId: handleUsingGET
-      produces:
-        - application/vnd.spring-boot.actuator.v3+json
-        - application/json
-        - application/vnd.spring-boot.actuator.v2+json
-      parameters:
-        - in: body
-          name: body
-          description: body
-          required: false
-          schema:
-            type: object
-            additionalProperties:
-              type: string
-      responses:
-        '200':
-          description: OK
-          schema:
-            type: object
-        '401':
-          description: Unauthorized
-        '403':
-          description: Forbidden
-        '404':
-          description: Not Found
-      deprecated: false
-  /actuator/info:
-    get:
-      tags:
-        - operation-handler
-      summary: handle
-      operationId: handleUsingGET_2
-      produces:
-        - application/vnd.spring-boot.actuator.v3+json
-        - application/json
-        - application/vnd.spring-boot.actuator.v2+json
-      parameters:
-        - in: body
-          name: body
-          description: body
-          required: false
-          schema:
-            type: object
-            additionalProperties:
-              type: string
-      responses:
-        '200':
-          description: OK
-          schema:
-            type: object
-        '401':
-          description: Unauthorized
-        '403':
-          description: Forbidden
-        '404':
-          description: Not Found
-      deprecated: false
-  /actuator/logfile:
-    get:
-      tags:
-        - operation-handler
-      summary: handle
-      operationId: handleUsingGET_3
-      produces:
-        - text/plain;charset=UTF-8
-      parameters:
-        - in: body
-          name: body
-          description: body
-          required: false
-          schema:
-            type: object
-            additionalProperties:
-              type: string
-      responses:
-        '200':
-          description: OK
-          schema:
-            type: object
-        '401':
-          description: Unauthorized
-        '403':
-          description: Forbidden
-        '404':
-          description: Not Found
-      deprecated: false
-  /actuator/loggers:
-    get:
-      tags:
-        - operation-handler
-      summary: handle
-      operationId: handleUsingGET_5
-      produces:
-        - application/vnd.spring-boot.actuator.v3+json
-        - application/json
-        - application/vnd.spring-boot.actuator.v2+json
-      parameters:
-        - in: body
-          name: body
-          description: body
-          required: false
-          schema:
-            type: object
-            additionalProperties:
-              type: string
-      responses:
-        '200':
-          description: OK
-          schema:
-            type: object
-        '401':
-          description: Unauthorized
-        '403':
-          description: Forbidden
-        '404':
-          description: Not Found
-      deprecated: false
-  '/actuator/loggers/{name}':
-    get:
-      tags:
-        - operation-handler
-      summary: handle
-      operationId: handleUsingGET_4
-      produces:
-        - application/vnd.spring-boot.actuator.v3+json
-        - application/json
-        - application/vnd.spring-boot.actuator.v2+json
-      parameters:
-        - in: body
-          name: body
-          description: body
-          required: false
-          schema:
-            type: object
-            additionalProperties:
-              type: string
-      responses:
-        '200':
-          description: OK
-          schema:
-            type: object
-        '401':
-          description: Unauthorized
-        '403':
-          description: Forbidden
-        '404':
-          description: Not Found
-      deprecated: false
-    post:
-      tags:
-        - operation-handler
-      summary: handle
-      operationId: handleUsingPOST
-      consumes:
-        - application/vnd.spring-boot.actuator.v3+json
-        - application/json
-        - application/vnd.spring-boot.actuator.v2+json
-      produces:
-        - '*/*'
-      parameters:
-        - in: body
-          name: body
-          description: body
-          required: false
-          schema:
-            type: object
-            additionalProperties:
-              type: string
-      responses:
-        '200':
-          description: OK
-          schema:
-            type: object
-        '201':
-          description: Created
-        '401':
-          description: Unauthorized
-        '403':
-          description: Forbidden
-        '404':
-          description: Not Found
-      deprecated: false
-  /actuator/metrics:
-    get:
-      tags:
-        - operation-handler
-      summary: handle
-      operationId: handleUsingGET_7
-      produces:
-        - application/vnd.spring-boot.actuator.v3+json
-        - application/json
-        - application/vnd.spring-boot.actuator.v2+json
-      parameters:
-        - in: body
-          name: body
-          description: body
-          required: false
-          schema:
-            type: object
-            additionalProperties:
-              type: string
-      responses:
-        '200':
-          description: OK
-          schema:
-            type: object
-        '401':
-          description: Unauthorized
-        '403':
-          description: Forbidden
-        '404':
-          description: Not Found
-      deprecated: false
-  '/actuator/metrics/{requiredMetricName}':
-    get:
-      tags:
-        - operation-handler
-      summary: handle
-      operationId: handleUsingGET_6
-      produces:
-        - application/vnd.spring-boot.actuator.v3+json
-        - application/json
-        - application/vnd.spring-boot.actuator.v2+json
-      parameters:
-        - in: body
-          name: body
-          description: body
-          required: false
-          schema:
-            type: object
-            additionalProperties:
-              type: string
-      responses:
-        '200':
-          description: OK
-          schema:
-            type: object
-        '401':
-          description: Unauthorized
-        '403':
-          description: Forbidden
-        '404':
-          description: Not Found
-      deprecated: false
   /policies:
     get:
       tags:
-        - policy-controller
+        - A1 Policy Management
       summary: Query policies
       operationId: getPoliciesUsingGET
       produces:
@@ -336,19 +26,22 @@ paths:
       parameters:
         - name: ric
           in: query
-          description: ric
+          description: The name of the Near-RT RIC to get policies for.
           required: false
           type: string
+          allowEmptyValue: false
         - name: service
           in: query
-          description: service
+          description: The name of the service to get policies for.
           required: false
           type: string
+          allowEmptyValue: false
         - name: type
           in: query
-          description: type
+          description: The name of the policy type to get policies for.
           required: false
           type: string
+          allowEmptyValue: false
       responses:
         '200':
           description: Policies
@@ -361,41 +54,40 @@ paths:
         '403':
           description: Forbidden
         '404':
-          description: Not Found
+          description: RIC or type not found
+          schema:
+            type: string
       deprecated: false
   /policy:
     get:
       tags:
-        - policy-controller
+        - A1 Policy Management
       summary: Returns a policy configuration
       operationId: getPolicyUsingGET
       produces:
         - '*/*'
       parameters:
-        - name: instance
+        - name: id
           in: query
-          description: instance
+          description: The ID of the policy instance.
           required: true
           type: string
+          allowEmptyValue: false
       responses:
         '200':
           description: Policy found
           schema:
             type: object
-        '204':
-          description: Policy is not found
-          schema:
-            type: string
         '401':
           description: Unauthorized
         '403':
           description: Forbidden
         '404':
-          description: Not Found
+          description: Policy is not found
       deprecated: false
     put:
       tags:
-        - policy-controller
+        - A1 Policy Management
       summary: Put a policy
       operationId: putPolicyUsingPUT
       consumes:
@@ -403,11 +95,12 @@ paths:
       produces:
         - '*/*'
       parameters:
-        - name: instance
+        - name: id
           in: query
-          description: instance
+          description: The ID of the policy instance.
           required: true
           type: string
+          allowEmptyValue: false
         - in: body
           name: jsonBody
           description: jsonBody
@@ -416,46 +109,66 @@ paths:
             type: object
         - name: ric
           in: query
-          description: ric
+          description: The name of the Near-RT RIC where the policy will be created.
           required: true
           type: string
+          allowEmptyValue: false
         - name: service
           in: query
-          description: service
+          description: The name of the service creating the policy.
           required: true
           type: string
+          allowEmptyValue: false
+        - name: transient
+          in: query
+          description: If the policy is transient or not (boolean defaulted to false). A policy is transient if it will be forgotten when the service needs to reconnect to the Near-RT RIC.
+          required: false
+          type: boolean
+          default: false
+          allowEmptyValue: false
+          x-example: false
         - name: type
           in: query
-          description: type
-          required: true
+          description: The name of the policy type.
+          required: false
           type: string
+          allowEmptyValue: false
       responses:
         '200':
-          description: Policy created or updated
+          description: Policy updated
           schema:
-            type: string
+            type: object
         '201':
-          description: Created
+          description: Policy created
+          schema:
+            type: object
         '401':
           description: Unauthorized
         '403':
           description: Forbidden
         '404':
-          description: Not Found
+          description: RIC or policy type is not found
+          schema:
+            type: string
+        '423':
+          description: RIC is not operational
+          schema:
+            type: string
       deprecated: false
     delete:
       tags:
-        - policy-controller
+        - A1 Policy Management
       summary: Delete a policy
       operationId: deletePolicyUsingDELETE
       produces:
         - '*/*'
       parameters:
-        - name: instance
+        - name: id
           in: query
-          description: instance
+          description: The ID of the policy instance.
           required: true
           type: string
+          allowEmptyValue: false
       responses:
         '200':
           description: OK
@@ -469,11 +182,62 @@ paths:
           description: Unauthorized
         '403':
           description: Forbidden
+        '404':
+          description: Policy is not found
+          schema:
+            type: string
+        '423':
+          description: RIC is not operational
+          schema:
+            type: string
+      deprecated: false
+  /policy_ids:
+    get:
+      tags:
+        - A1 Policy Management
+      summary: 'Query policies, only IDs returned'
+      operationId: getPolicyIdsUsingGET
+      produces:
+        - '*/*'
+      parameters:
+        - name: ric
+          in: query
+          description: The name of the Near-RT RIC to get policies for.
+          required: false
+          type: string
+          allowEmptyValue: false
+        - name: service
+          in: query
+          description: The name of the service to get policies for.
+          required: false
+          type: string
+          allowEmptyValue: false
+        - name: type
+          in: query
+          description: The name of the policy type to get policies for.
+          required: false
+          type: string
+          allowEmptyValue: false
+      responses:
+        '200':
+          description: Policy ids
+          schema:
+            type: array
+            items:
+              type: string
+        '401':
+          description: Unauthorized
+        '403':
+          description: Forbidden
+        '404':
+          description: RIC or type not found
+          schema:
+            type: string
       deprecated: false
   /policy_schema:
     get:
       tags:
-        - policy-controller
+        - A1 Policy Management
       summary: Returns one policy type schema definition
       operationId: getPolicySchemaUsingGET
       produces:
@@ -481,9 +245,10 @@ paths:
       parameters:
         - name: id
           in: query
-          description: id
+          description: The ID of the policy type to get the definition for.
           required: true
           type: string
+          allowEmptyValue: false
       responses:
         '200':
           description: Policy schema
@@ -494,12 +259,14 @@ paths:
         '403':
           description: Forbidden
         '404':
-          description: Not Found
+          description: RIC is not found
+          schema:
+            type: string
       deprecated: false
   /policy_schemas:
     get:
       tags:
-        - policy-controller
+        - A1 Policy Management
       summary: Returns policy type schema definitions
       operationId: getPolicySchemasUsingGET
       produces:
@@ -507,57 +274,59 @@ paths:
       parameters:
         - name: ric
           in: query
-          description: ric
+          description: The name of the Near-RT RIC to get the definitions for.
           required: false
           type: string
+          allowEmptyValue: false
       responses:
         '200':
           description: Policy schemas
           schema:
             type: array
             items:
-              type: string
+              type: object
         '401':
           description: Unauthorized
         '403':
           description: Forbidden
         '404':
-          description: Not Found
+          description: RIC is not found
+          schema:
+            type: string
       deprecated: false
   /policy_status:
     get:
       tags:
-        - policy-controller
+        - A1 Policy Management
       summary: Returns a policy status
       operationId: getPolicyStatusUsingGET
       produces:
         - '*/*'
       parameters:
-        - name: instance
+        - name: id
           in: query
-          description: instance
+          description: The ID of the policy.
           required: true
           type: string
+          allowEmptyValue: false
       responses:
         '200':
           description: Policy status
           schema:
             type: object
-        '204':
-          description: Policy is not found
-          schema:
-            type: string
         '401':
           description: Unauthorized
         '403':
           description: Forbidden
         '404':
-          description: Not Found
+          description: Policy is not found
+          schema:
+            type: string
       deprecated: false
   /policy_types:
     get:
       tags:
-        - policy-controller
+        - A1 Policy Management
       summary: Query policy type names
       operationId: getPolicyTypesUsingGET
       produces:
@@ -565,9 +334,10 @@ paths:
       parameters:
         - name: ric
           in: query
-          description: ric
+          description: The name of the Near-RT RIC to get types for.
           required: false
           type: string
+          allowEmptyValue: false
       responses:
         '200':
           description: Policy type names
@@ -580,12 +350,14 @@ paths:
         '403':
           description: Forbidden
         '404':
-          description: Not Found
+          description: RIC is not found
+          schema:
+            type: string
       deprecated: false
   /ric:
     get:
       tags:
-        - ric-repository-controller
+        - RIC Repository
       summary: Returns the name of a RIC managing one Mananged Element
       operationId: getRicUsingGET
       produces:
@@ -593,12 +365,13 @@ paths:
       parameters:
         - name: managedElementId
           in: query
-          description: managedElementId
-          required: false
+          description: The ID of the Managed Element
+          required: true
           type: string
+          allowEmptyValue: false
       responses:
         '200':
-          description: RIC is fond
+          description: RIC is found
           schema:
             type: string
         '401':
@@ -606,24 +379,25 @@ paths:
         '403':
           description: Forbidden
         '404':
-          description: RIC is not fond
+          description: RIC is not found
           schema:
             type: string
       deprecated: false
   /rics:
     get:
       tags:
-        - ric-repository-controller
-      summary: Query NearRT RIC information
+        - RIC Repository
+      summary: Query Near-RT RIC information
       operationId: getRicsUsingGET
       produces:
         - '*/*'
       parameters:
         - name: policyType
           in: query
-          description: policyType
+          description: The name of the policy type
           required: false
           type: string
+          allowEmptyValue: false
       responses:
         '200':
           description: OK
@@ -636,12 +410,14 @@ paths:
         '403':
           description: Forbidden
         '404':
-          description: Not Found
+          description: Policy type is not found
+          schema:
+            type: string
       deprecated: false
   /service:
     put:
       tags:
-        - service-controller
+        - Service registry and supervision
       summary: Register a service
       operationId: putServiceUsingPUT
       consumes:
@@ -657,11 +433,17 @@ paths:
             $ref: '#/definitions/ServiceRegistrationInfo'
       responses:
         '200':
-          description: OK
+          description: Service updated
           schema:
             type: string
         '201':
-          description: Created
+          description: Service created
+          schema:
+            type: string
+        '400':
+          description: The ServiceRegistrationInfo is not accepted
+          schema:
+            type: string
         '401':
           description: Unauthorized
         '403':
@@ -672,7 +454,7 @@ paths:
   /services:
     get:
       tags:
-        - service-controller
+        - Service registry and supervision
       summary: Returns service information
       operationId: getServicesUsingGET
       produces:
@@ -680,9 +462,10 @@ paths:
       parameters:
         - name: name
           in: query
-          description: name
+          description: The name of the service
           required: false
           type: string
+          allowEmptyValue: false
       responses:
         '200':
           description: OK
@@ -695,11 +478,13 @@ paths:
         '403':
           description: Forbidden
         '404':
-          description: Not Found
+          description: Service is not found
+          schema:
+            type: string
       deprecated: false
     delete:
       tags:
-        - service-controller
+        - Service registry and supervision
       summary: Delete a service
       operationId: deleteServiceUsingDELETE
       produces:
@@ -707,27 +492,34 @@ paths:
       parameters:
         - name: name
           in: query
-          description: name
+          description: The name of the service
           required: true
           type: string
+          allowEmptyValue: false
       responses:
         '200':
           description: OK
           schema:
             type: string
         '204':
-          description: No Content
+          description: OK
+          schema:
+            type: string
         '401':
           description: Unauthorized
         '403':
           description: Forbidden
+        '404':
+          description: Service not found
+          schema:
+            type: string
       deprecated: false
   /services/keepalive:
-    post:
+    put:
       tags:
-        - service-controller
-      summary: Keep the poilicies alive for a service
-      operationId: keepAliveServiceUsingPOST
+        - Service registry and supervision
+      summary: Heartbeat from a serice
+      operationId: keepAliveServiceUsingPUT
       consumes:
         - application/json
       produces:
@@ -735,12 +527,13 @@ paths:
       parameters:
         - name: name
           in: query
-          description: name
+          description: The name of the service
           required: true
           type: string
+          allowEmptyValue: false
       responses:
         '200':
-          description: Policies timeout supervision refreshed
+          description: 'Service supervision timer refreshed, OK'
           schema:
             type: string
         '201':
@@ -755,8 +548,8 @@ paths:
   /status:
     get:
       tags:
-        - status-controller
-      summary: Returns status and statistics of the service
+        - Health check
+      summary: Returns status and statistics of this service
       operationId: getStatusUsingGET
       produces:
         - '*/*'
@@ -773,22 +566,9 @@ paths:
           description: Not Found
       deprecated: false
 definitions:
-  Link:
-    type: object
-    properties:
-      href:
-        type: string
-      templated:
-        type: boolean
-    title: Link
-  'Map«string,Link»':
-    type: object
-    title: 'Map«string,Link»'
-    additionalProperties:
-      $ref: '#/definitions/Link'
-  Mono«ResponseEntity«Void»»:
+  Mono«ResponseEntity«object»»:
     type: object
-    title: Mono«ResponseEntity«Void»»
+    title: Mono«ResponseEntity«object»»
   Mono«ResponseEntity«string»»:
     type: object
     title: Mono«ResponseEntity«string»»
@@ -799,14 +579,14 @@ definitions:
         type: string
         description: identity of the policy
       json:
-        type: string
+        type: object
         description: the configuration of the policy
       lastModified:
         type: string
         description: 'timestamp, last modification time'
       ric:
         type: string
-        description: identity the target NearRT RIC
+        description: identity of the target Near-RT RIC
       service:
         type: string
         description: the name of the service owning the policy
@@ -822,42 +602,49 @@ definitions:
         description: O1 identities for managed entities
         items:
           type: string
-      name:
-        type: string
-        description: identity of the ric
       policyTypes:
         type: array
         description: supported policy types
         items:
           type: string
+      ricName:
+        type: string
+        description: identity of the ric
+      state:
+        type: string
+        description: state info
     title: RicInfo
   ServiceRegistrationInfo:
     type: object
+    required:
+      - serviceName
     properties:
       callbackUrl:
         type: string
-        description: callback for notifying of RIC recovery
+        description: callback for notifying of RIC synchronization
       keepAliveIntervalSeconds:
         type: integer
         format: int64
-        description: keep alive interval for policies owned by the service. 0 means no timeout supervision. Polcies that are not refreshed within this time are removed
-      name:
+        description: 'keep alive interval for the service. This is a heartbeat supervision of the service, which in regular intevals must invoke a ''keepAlive'' REST call. When a service does not invoke this call within the given time, it is considered unavailble. An unavailable service will be automatically deregistered and its policies will be deleted. Value 0 means no timeout supervision.'
+      serviceName:
         type: string
         description: identity of the service
     title: ServiceRegistrationInfo
   ServiceStatus:
     type: object
     properties:
+      callbackUrl:
+        type: string
+        description: callback for notifying of RIC synchronization
       keepAliveIntervalSeconds:
         type: integer
         format: int64
         description: policy keep alive timeout
-      name:
+      serviceName:
         type: string
         description: identity of the service
-      timeSincePingSeconds:
+      timeSinceLastActivitySeconds:
         type: integer
         format: int64
         description: time since last invocation by the service
     title: ServiceStatus
-