Bug 1170 API for NS Subcription
[osm/SOL005.git] / osm-openapi.yaml
index 958b39f..4478965 100644 (file)
@@ -2085,6 +2085,174 @@ paths:
           $ref: '#/components/responses/UnexpectedError'
         default:
           $ref: '#/components/responses/UnexpectedError'
+  /nslcm/v1/subscriptions:
+    get:
+      tags:
+        - NS instances
+      summary: Query information about multiple NS instance subscription
+      description: Query information about multiple NS instance subscription
+      operationId: getNsSubcriptions
+      responses:
+        '200':
+          description: OK
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/ArrayOfNslcmSubscriptionInfo'
+            application/yaml:
+              schema:
+                $ref: '#/components/schemas/ArrayOfNslcmSubscriptionInfo'
+        '400':
+          $ref: '#/components/responses/BadRequest'
+        '401':
+          $ref: '#/components/responses/Unauthorized'
+        '403':
+          $ref: '#/components/responses/Forbidden'
+        '404':
+          $ref: '#/components/responses/NotFound'
+        '405':
+          $ref: '#/components/responses/MethodNotAllowed'
+        '406':
+          $ref: '#/components/responses/NotAcceptable'
+        '409':
+          $ref: '#/components/responses/Conflict'
+        '422':
+          $ref: '#/components/responses/UnprocessableEntity'
+        '500':
+          $ref: '#/components/responses/InternalServerError'
+        '503':
+          $ref: '#/components/responses/ServiceUnavailable'
+        5XX:
+          $ref: '#/components/responses/UnexpectedError'
+        default:
+          $ref: '#/components/responses/UnexpectedError'
+    post:
+      tags:
+        - NS instances
+      summary: Create a new subscription for the Network service
+      description: Create a new subscription for the Network service
+      operationId: addNsSubcriptions
+      requestBody:
+        $ref: '#/components/requestBodies/NslcmSubscriptionRequest'
+      responses:
+        '201':
+          description: Created
+          headers:
+            Location:
+              schema:
+                type: object
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/NslcmSubscriptionResponse'
+            application/yaml:
+              schema:
+                $ref: '#/components/schemas/NslcmSubscriptionResponse'
+        '400':
+          $ref: '#/components/responses/BadRequest'
+        '401':
+          $ref: '#/components/responses/Unauthorized'
+        '403':
+          $ref: '#/components/responses/Forbidden'
+        '404':
+          $ref: '#/components/responses/NotFound'
+        '405':
+          $ref: '#/components/responses/MethodNotAllowed'
+        '406':
+          $ref: '#/components/responses/NotAcceptable'
+        '409':
+          $ref: '#/components/responses/Conflict'
+        '422':
+          $ref: '#/components/responses/UnprocessableEntity'
+        '500':
+          $ref: '#/components/responses/InternalServerError'
+        '503':
+          $ref: '#/components/responses/ServiceUnavailable'
+        5XX:
+          $ref: '#/components/responses/UnexpectedError'
+        default:
+          $ref: '#/components/responses/UnexpectedError'
+  '/nslcm/v1/subscriptions/{nsSubscriptionsId}':
+    parameters:
+      - name: nsSubscriptionsId
+        in: path
+        required: true
+        description: Network Service Subscription ID
+        schema:
+          type: string
+    get:
+      tags:
+        - NS instances
+      summary: Read information about an individual Network Service Subscription
+      description: Read information about an individual Network Service Subscription
+      operationId: getNsSubcriptionId
+      responses:
+        '200':
+          description: OK
+          content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/NslcmSubscriptionInfo'
+            application/yaml:
+              schema:
+                $ref: '#/components/schemas/NslcmSubscriptionInfo'
+        '400':
+          $ref: '#/components/responses/BadRequest'
+        '401':
+          $ref: '#/components/responses/Unauthorized'
+        '403':
+          $ref: '#/components/responses/Forbidden'
+        '404':
+          $ref: '#/components/responses/NotFound'
+        '405':
+          $ref: '#/components/responses/MethodNotAllowed'
+        '406':
+          $ref: '#/components/responses/NotAcceptable'
+        '409':
+          $ref: '#/components/responses/Conflict'
+        '422':
+          $ref: '#/components/responses/UnprocessableEntity'
+        '500':
+          $ref: '#/components/responses/InternalServerError'
+        '503':
+          $ref: '#/components/responses/ServiceUnavailable'
+        5XX:
+          $ref: '#/components/responses/UnexpectedError'
+        default:
+          $ref: '#/components/responses/UnexpectedError'
+    delete:
+      tags:
+        - NS instances
+      summary: Delete an individual Network Service Subscription
+      description: Delete an individual Network Service Subscription
+      operationId: deleteNsSubcriptionId
+      responses:
+        '204':
+          description: No Content
+        '400':
+          $ref: '#/components/responses/BadRequest'
+        '401':
+          $ref: '#/components/responses/Unauthorized'
+        '403':
+          $ref: '#/components/responses/Forbidden'
+        '404':
+          $ref: '#/components/responses/NotFound'
+        '405':
+          $ref: '#/components/responses/MethodNotAllowed'
+        '406':
+          $ref: '#/components/responses/NotAcceptable'
+        '409':
+          $ref: '#/components/responses/Conflict'
+        '422':
+          $ref: '#/components/responses/UnprocessableEntity'
+        '500':
+          $ref: '#/components/responses/InternalServerError'
+        '503':
+          $ref: '#/components/responses/ServiceUnavailable'
+        5XX:
+          $ref: '#/components/responses/UnexpectedError'
+        default:
+          $ref: '#/components/responses/UnexpectedError'
 # END NS Instances
 
 # BEGIN NetSlice Templates
@@ -5765,6 +5933,15 @@ components:
         application/zip:
           schema:
             $ref: '#/components/schemas/NetSlicePackage'
+    NslcmSubscriptionResponse:
+      description: NslcmSubscriptionResponse
+      content:
+        application/json:
+          schema:
+            $ref: '#/components/schemas/NslcmSubscriptionResponse'
+        application/yaml:
+          schema:
+            $ref: '#/components/schemas/NslcmSubscriptionResponse'
   # END RESPONSES
 
   schemas:
@@ -5983,7 +6160,7 @@ components:
         additionalParamsForNs:
           type: object
           additionalProperties: true
-        additionalParamsForVnf:
+        additionalParamsForVnf: &additionalparamsforvnf
           type: array
           items:
             type: object
@@ -5993,6 +6170,11 @@ components:
               additionalParams:
                 type: object
                 additionalProperties: true
+              k8s-namespace:
+                type: string
+                description: |
+                  use this namespace for all the KDU deployed in this VNF
+                  (if any). By default it is used the id of the project
               additionalParamsForVdu:
                 type: array
                 items:
@@ -6014,12 +6196,17 @@ components:
                   properties:
                     kdu_name:
                       type: string
+                    k8s-namespace:
+                      type: string
+                      description: use this namespace for this KDU
+                    kdu_model:
+                      type: string
                     additionalParams:
                       type: object
                       additionalProperties: true
                   required:
                     - kdu_name
-                    - additionalParams
+                  minProperties: 2
                   additionalProperties: false
             required:
               - member-vnf-index
@@ -6034,6 +6221,18 @@ components:
           format: uuid
         vduImage:
           type: string
+        placement-engine:
+          type: string
+          description: |
+           To compute automatically the target VIM for each VNF based on 
+           constrains, e.g. latency. Currently only 'PLA' is supported
+        placement-constraints:
+          type: object
+          additionalProperties: true
+        k8s-namespace:
+          type: string
+        timeout_ns_deploy:
+          type: integer
         vnf:
           type: array
           items:
@@ -6149,6 +6348,30 @@ components:
                           type: string
                         segmentation-id:
                           type: string
+                        network-type:
+                          type: string
+                        sdn-ports:
+                          description: |
+                            connect additional ports to the created underlay SDN connectivity.
+                            Normally for external connectivy.
+                          type: array
+                          items:
+                            type: object
+                            properties:
+                              switch_id:
+                                type: string
+                              switch_port:
+                                type: string
+                              mac_address:
+                                type: string
+                                format: mac_address
+                              vlan:
+                                type: integer
+                            additionalProperties: true
+                            required:
+                              - switch_id
+                              - switch_port
+                          minItems: 1
                       additionalProperties: false
                     internal-connection-point:
                       type: array
@@ -6243,6 +6466,9 @@ components:
           type: string
           enum:
             - SCALE_VNF
+        timeout_ns_scale:
+          description: timeout for the scale operation
+          type: integer
         scaleVnfData:
           type: object
           properties:
@@ -6256,21 +6482,35 @@ components:
               properties:
                 scaling-group-descriptor:
                   type: string
+                scaling-policy:
+                  type: string
                 member-vnf-index:
                   type: string
-              additionalProperties: true
-          additionalProperties: true
-      additionalProperties: true
+              required:
+                - scaling-group-descriptor
+                - member-vnf-index
+              additionalProperties: false
+          required:
+            - scaleVnfType
+            - scaleByStepData
+          additionalProperties: false
+      required:
+        - scaleType
+        - scaleVnfData
+      additionalProperties: false
     TerminateNsRequest:
       type: object
       properties:
-        terminationTime:
-          description: |
-            Timestamp indicating the end time of the NS, i.e. the NS will be terminated
-            automatically at this timestamp. Cardinality "0" indicates the NS termination
-            takes place immediately.
-          type: string
-          format: date-time
+        timeout_ns_terminate:
+          description: timeout for terminate operation
+          type: integer
+        autoremove:
+          description: remove network service if termination end without error
+          type: boolean
+        skip_terminate_primitives:
+          description: Do not execute network service termination primitives
+          type: boolean
+      additionalProperties: false
     ArrayOfNsInstance:
       type: array
       items:
@@ -6280,19 +6520,26 @@ components:
       properties:
         primitive:
           type: string
+          description: |
+            name of the primitive in the 'config-descriptor'. If the target is
+            a kdu it can be also 'status', 'rollback' or 'upgrade'
         primitive_params:
+          description: parameters of this primitive
           $ref: '#/components/schemas/KeyValuePairs'
-        lcmOperationType:
-          type: string
-        nsInstanceId:
-          type: string
-          format: uuid
         member_vnf_index:
           type: string
+          description: provide if the target action is for a vnf, vdu or kdu
         vdu_id:
           type: string
+          description: provide if the target action is for a vdu
+        kdu_name:
+          type: string
+          description: provide if the target action is for a kdu
         vdu_count_index:
           type: integer
+        timeout_ns_action:
+          description: timeout for the day 1/2 operation
+          type: integer
       required:
         - primitive
         - primitive_params
@@ -6528,48 +6775,7 @@ components:
               additionalParamsForNs:
                 type: object
                 additionalProperties: true
-              additionalParamsForVnf:
-                type: array
-                items:
-                  type: object
-                  properties:
-                    member-vnf-index:
-                      type: string
-                    additionalParams:
-                      type: object
-                      additionalProperties: true
-                    additionalParamsForVdu:
-                      type: array
-                      items:
-                        type: object
-                        properties:
-                          vdu_id:
-                            type: string
-                          additionalParams:
-                            type: object
-                            additionalProperties: true
-                        required:
-                          - vdu_id
-                          - additionalParams
-                        additionalProperties: false
-                    additionalParamsForKdu:
-                      type: array
-                      items:
-                        type: object
-                        properties:
-                          kdu_name:
-                            type: string
-                          additionalParams:
-                            type: object
-                            additionalProperties: true
-                        required:
-                          - kdu_name
-                          - additionalParams
-                        additionalProperties: false
-                  required:
-                    - member-vnf-index
-                  minProperties: 2
-                  additionalProperties: false
+              additionalParamsForVnf: *additionalparamsforvnf
               ssh_keys:
                 type: array
                 items:
@@ -7073,19 +7279,19 @@ components:
           type: integer
           minimum: 0
           nullable: false
-        nsts:
+        slice_templates:
           type: integer
           minimum: 0
           nullable: false
-        pdus:
+        pduds:
           type: integer
           minimum: 0
           nullable: false
-        nsrs:
+        ns_instances:
           type: integer
           minimum: 0
           nullable: false
-        nsis:
+        slice_instances:
           type: integer
           minimum: 0
           nullable: false
@@ -7097,7 +7303,19 @@ components:
           type: integer
           minimum: 0
           nullable: false
-        sdns:
+        sdn_controllers:
+          type: integer
+          minimum: 0
+          nullable: false
+        k8sclusters:
+          type: integer
+          minimum: 0
+          nullable: false
+        k8srepos:
+          type: integer
+          minimum: 0
+          nullable: false
+        osmrepos:
           type: integer
           minimum: 0
           nullable: false
@@ -7113,19 +7331,19 @@ components:
           type: integer
           minimum: 0
           nullable: true
-        nsts:
+        slice_templates:
           type: integer
           minimum: 0
           nullable: true
-        pdus:
+        pduds:
           type: integer
           minimum: 0
           nullable: true
-        nsrs:
+        ns_instances:
           type: integer
           minimum: 0
           nullable: true
-        nsis:
+        slice_instances:
           type: integer
           minimum: 0
           nullable: true
@@ -7137,7 +7355,19 @@ components:
           type: integer
           minimum: 0
           nullable: true
-        sdns:
+        sdn_controllers:
+          type: integer
+          minimum: 0
+          nullable: true
+        k8sclusters:
+          type: integer
+          minimum: 0
+          nullable: true
+        k8srepos:
+          type: integer
+          minimum: 0
+          nullable: true
+        osmrepos:
           type: integer
           minimum: 0
           nullable: true
@@ -7776,6 +8006,172 @@ components:
         - type
         - url
       additionalProperties: false
+    NslcmSubscriptionResponse:
+      type: object
+      properties:
+        id:
+          type: string
+          format: uuid
+        filter:
+          type: object
+        CallbackUri:
+          type: string
+          format: uri
+        _links:
+          type: object
+    NslcmSubscriptionInfo:
+      type: object
+      properties:
+        _id:
+          type: string
+          format: uuid
+        _admin:
+          type: object
+        schema_version:
+          type: string
+          format: 'X.Y[.Z]'
+        CallbackUri:
+          type: string
+          format: uri
+        filter:
+          type: object
+        authentication:
+          $ref: '#/components/schemas/Authenticationschema'
+    ArrayOfNslcmSubscriptionInfo:
+      type: array
+      items:
+        $ref: '#/components/schemas/NslcmSubscriptionInfo'
+    NsInstanceSubscriptionFilter:
+      description: |
+        used to identify the network service
+      type: object
+      oneOf:
+        - $ref: '#/components/schemas/nsdIds'
+        - $ref: '#/components/schemas/vnfdIds'
+        - $ref: '#/components/schemas/pnfdIds'
+        - $ref: '#/components/schemas/nsInstanceIds'
+        - $ref: '#/components/schemas/nsInstanceNames'
+    nsdIds:
+      type: array
+      items:
+        type: string
+    vnfdIds:
+      type: array
+      items:
+        type: string
+    pnfdIds:
+      type: array
+      items:
+        type: string
+    nsInstanceIds:
+      type: array
+      items:
+        type: string
+    nsInstanceNames:
+      type: array
+      items:
+        type: string
+    Nslcmsubschema:
+      type: object
+      properties:
+        nsInstanceSubscriptionFilter:
+           $ref: '#/components/schemas/NsInstanceSubscriptionFilter'
+        notificationTypes:
+          description: |
+            If NsLcmOperationOccurrenceNotification is selected then at least operationTypes or states is required. If NsLcmOperationOccurrenceNotification is selected then at least nsComponentTypes, lcmOpName and lcmOpOccStatus is required
+          type: array
+          items:
+            type: string
+            enum:
+              - NsIdentifierCreationNotification
+              - NsIdentifierDeletionNotification
+              - NsLcmOperationOccurrenceNotification
+              - NsChangeNotification
+        operationTypes:
+          type: array
+          items:
+            type: string
+            enum:
+              - INSTANTIATE
+              - SCALE
+              - TERMINATE
+              - UPDATE
+              - HEAL
+        operationStates:
+          type: array
+          items:
+            type: string
+            enum:
+              - PROCESSING
+              - COMPLETED
+              - PARTIALLY_COMPLETED
+              - FAILED
+              - FAILED_TEMP
+              - ROLLING_BACK
+              - ROLLED_BACK
+        nsComponentTypes:
+          type: array
+          items:
+            type: string
+            enum:
+              - VNF
+              - NS
+              - PNF
+        lcmOpNameImpactingNsComponent:
+          type: array
+          items:
+            type: string
+            enum:
+              - VNF_INSTANTIATE
+              - VNF_SCALE
+              - VNF_SCALE_TO_LEVEL
+              - VNF_CHANGE_FLAVOUR
+              - VNF_TERMINATE
+              - VNF_HEAL
+              - VNF_OPERATE
+              - VNF_CHANGE_EXT_CONN
+              - VNF_MODIFY_INFO
+              - NS_INSTANTIATE
+              - NS_SCALE
+              - NS_UPDATE
+              - NS_TERMINATE
+              - NS_HEAL
+        lcmOpOccStatusImpactingNsComponent:
+          type: array
+          items:
+            type: string
+            enum:
+              - START
+              - COMPLETED
+              - PARTIALLY_COMPLETED
+              - FAILED
+              - ROLLED_BACK
+    Authenticationschema:
+      type: object
+      properties:
+        authType:
+          type: string
+          enum:
+            - basic
+        paramsBasic:
+          type: object
+          properties:
+            userName:
+              type: string
+            password:
+              type: string
+    NslcmSubscriptionRequest:
+      type: object
+      properties:
+        filter:
+          $ref: '#/components/schemas/Nslcmsubschema'
+        CallbackUri:
+          type: string
+          format: uri
+        authentication:
+          $ref: '#/components/schemas/Authenticationschema'
+      required:
+        - CallbackUri
   # END SCHEMAS
 
   requestBodies:
@@ -8057,6 +8453,14 @@ components:
         application/yaml:
           schema:
             $ref: '#/components/schemas/CreateK8sRepoRequest'
+    NslcmSubscriptionRequest:
+      content:
+        application/json:
+          schema:
+            $ref: '#/components/schemas/NslcmSubscriptionRequest'
+        application/yaml:
+          schema:
+            $ref: '#/components/schemas/NslcmSubscriptionRequest'
   # END REQUEST BODIES
 
   securitySchemes: