RIC:1060: Change in PTL
[ric-plt/submgr.git] / api / routing_manager.yaml
index 8fabfb4..fc93ab5 100644 (file)
@@ -1,4 +1,3 @@
-#
 #==================================================================================
 #   Copyright (c) 2019 AT&T Intellectual Property.
 #   Copyright (c) 2019 Nokia
 #
 #
 #   Abstract:   Routing Manager's RESTful API definition
-#   Date:      29 March 2019
+#   Date:       28 August 2019
 #
 swagger: "2.0"
 info:
   title: Routing Manager
   description: "This is the Swagger/OpenAPI 2.0 definition of Routing Manager's Northbound API."
-  version: "0.3.0"
+  version: "0.4.0"
   license:
     name: "Apache 2.0"
     url: "http://www.apache.org/licenses/LICENSE-2.0.html"
@@ -38,6 +37,8 @@ tags:
 #    url: "http://127.0.0.1"
 - name: "health"
   description: "Health of the system"
+- name: "debug"
+  description: "Debug Information"
 schemes:
 #- "https"
 - "http"
@@ -60,6 +61,24 @@ paths:
           description: "The health of the system"
           schema:
             "$ref": "#/definitions/health-status"
+  /getdebuginfo:
+    get:
+      tags:
+      - "debug"
+      summary: "Get Information for debugging"
+      description: "By performing a GET method, API caller is able to get the dump of routes tables, subcription list and E2T's"
+      operationId: "get_debuginfo"
+      consumes:
+      - "application/json"
+      produces:
+      - "application/json"
+      responses:
+        200:
+          description: "Debug Info from routing manager"
+          schema:
+            "$ref": "#/definitions/debuginfo"
+        201:
+          description: "Error while fetching Debug data"    
   /handles:
     get:
       tags:
@@ -126,8 +145,203 @@ paths:
           description: "Invalid data"
         201:
           description: "Xapp Subscription data received"
+    delete:
+      tags:
+      - "handle"
+      summary: "API for deleting an xapp subscription"
+      description: "By performing the delete operation on xapp-subscription-handle resource, the API caller will be able to update routing manager about the deletion of an xapp's subscription"
+      operationId: "delete_xapp_subscription_handle"
+      consumes:
+      - "application/json"
+      parameters:
+      - in: "body"
+        name: "xapp-subscription-data"
+        description: "xApp related subscription data"
+        required: true
+        schema:
+          $ref: "#/definitions/xapp-subscription-data"
+      responses:
+        204:
+          description: "Content not found"
+        200:
+          description: "Xapp Subscription deleted"
+  /handles/xapp-subscription-handle/{subscription_id}:
+    put:
+      tags:
+      - "handle"
+      summary: "API for updating the subscriber xApp list"
+      description: "By performing a PUT method on a xapp-subscription-handle/{subscription_id} resource, the API caller is able to update the Routing manager about the list of subscriber xApps related to the subscription denoted by the {subsription_id}."
+      operationId: "update_xapp_subscription_handle"
+      consumes:
+      - "application/json"
+#      - "application/yaml"
+      produces:
+      - "application/json"
+#      - "application/yaml"
+      parameters:
+        - in: path
+          name: subscription_id
+          required: true
+          type: integer
+          format: "uint16"
+          description: "Subscription ID"
+        - in: body
+          name: xapp-list
+          description: "xApp list"
+          required: true
           schema:
-            $ref: "#/definitions/xapp-subscription-data-response"
+           $ref: "#/definitions/xapp-list"
+      responses:
+        400:
+          description: "Invalid data"
+        201:
+          description: "Xapp list received"
+  /handles/e2t:
+    post:
+      tags:
+      - "handle"
+      summary: "API for establishing platform routes when a new e2t instance gets added to platform"
+      description: "E2T updates its FQDN to E2M  during its initialisation, hence after E2M informs routing manager about new E2T instances FQDN. At this point Routing Mgr would establish platform routes"
+      operationId: "create_new_e2t_handle"
+      consumes:
+      - "application/json"
+#      - "application/yaml"
+      produces:
+      - "application/json"
+#      - "application/yaml"
+      parameters:
+        - in: body
+          name: e2t-data
+          description: "FQDN of the newly joined E2T instance"
+          required: true
+          schema:
+           $ref: "#/definitions/e2t-data"
+      responses:
+        400:
+          description: "Invalid data"
+        201:
+          description: "new e2t instance is considered and platform routes are established"
+    delete:
+      tags:
+      - "handle"
+      summary: "API for clearing routes specific to a particular e2T instance"
+      description: "E2M would monitor E2T instances using its keep alive based mechanism during this time if an E2T instance is detected to be dead, E2M would distribute already associated ran's to other available/healthy E2T instances. Here E2M would share E2T instance address to be removed OR which is unhealthy and list of RAN instances to be dissociated and an association list which contains E2T FQDN and associated RAN names"
+      operationId: "delete_e2t_handle"
+      consumes:
+      - "application/json"
+#      - "application/yaml"
+      produces:
+      - "application/json"
+#      - "application/yaml"
+      parameters:
+        - in: body
+          name: e2t-data
+          description: "FQDN of the newly joined E2T instance"
+          required: true
+          schema:
+           $ref: "#/definitions/e2t-delete-data"
+      responses:
+        400:
+          description: "Invalid data"
+        201:
+          description: "new e2t instance is considered and platform routes are established"
+  /handles/associate-ran-to-e2t:
+    post:
+      tags:
+      - "handle"
+      summary: "API for associating a ran to e2t instance"
+      description: "By performing a POST method on rane2tmapping, the API caller is able to update the Routing manager about the ran to e2t mapping which would be finally used to distribute routes to corresponding xApp and E2T instance"
+      operationId: "associate_ran_to_e2t_handle"
+      consumes:
+      - "application/json"
+#      - "application/yaml"
+      produces:
+      - "application/json"
+#      - "application/yaml"
+      parameters:
+        - in: body
+          name: ran-e2t-list
+          description: "ran to e2t mapping"
+          required: true
+          schema:
+           $ref: "#/definitions/ran-e2t-map"
+      responses:
+        400:
+          description: "Invalid data"
+        201:
+          description: "e2t ran mapping recieved, platform routes"
+  /handles/dissociate-ran:
+    post:
+      tags:
+      - "handle"
+      summary: "API to dissociate ran from e2t"
+      description: "By performing a POST method on rane2tmapping, routing manager will dissociate ran name from e2t instance by updating or clearing routes"
+      operationId: "dissociate_ran"
+      consumes:
+      - "application/json"
+#      - "application/yaml"
+      produces:
+      - "application/json"
+#      - "application/yaml"
+      parameters:
+        - in: body
+          name: dissociate-list
+          description: "list of RAN to dissociate"
+          required: true
+          schema:
+           $ref: "#/definitions/ran-e2t-map"
+      responses:
+        400:
+          description: "Invalid data"
+        201:
+          description: "ran instances disociated"
+  /handles/addrmrroute:
+    post:
+      tags:
+      - "handle"
+      summary: "API to add RMR routes"
+      description: "By performing a POST method to add RMR routes"
+      operationId: "add_rmr_route"
+      consumes:
+      - "application/json"
+      produces:
+      - "application/json"
+      parameters:
+        - in: body
+          name: routes-list
+          description: "list of routes to add"
+          required: true
+          schema:
+           $ref: "#/definitions/routelist"
+      responses:
+        400:
+          description: "Invalid data"
+        201:
+          description: "rmr routes added"     
+          
+  /handles/delrmrroute:
+    delete:
+      tags:
+      - "handle"
+      summary: "API to delete RMR routes"
+      description: "By performing a DELETE method to add RMR routes"
+      operationId: "del_rmr_route"
+      consumes:
+      - "application/json"
+      produces:
+      - "application/json"
+      parameters:
+        - in: body
+          name: routes-list
+          description: "list of routes to delete"
+          required: true
+          schema:
+           $ref: "#/definitions/routelist"
+      responses:
+        400:
+          description: "Invalid data"
+        201:
+          description: "rmr routes added" 
 definitions:
   health-status:
     type: "object"
@@ -141,8 +355,7 @@ definitions:
     type: "object"
     properties:
       id:
-        type: "integer"
-        format: "int64"
+        type: "string"
       event:
         type: "string"
       version:
@@ -166,16 +379,108 @@ definitions:
         maximum: 65535
       subscription_id: #subscription sequence number
         type: "integer"
-        format: "int32" 
-  xapp-subscription-data-response:
+        format: "int32"
+  xapp-list:
+    type: "array"
+    items:
+      $ref: '#/definitions/xapp-element'
+  xapp-element:
+    type: "object"
+    required:
+      - "address"
+      - "port"
+    properties:
+      address:
+        type: "string" #This is the xapp instance hostname or ip address
+      port: #xapp instance port address
+        type: "integer"
+        format: "uint16"
+        minimum: 0
+        maximum: 65535
+  ran-e2t-map:
+    type: "array"
+    items:
+      $ref: '#/definitions/ran-e2t-element'
+  ran-e2t-element:
+    type: "object"
+    required:
+      - "E2TAddress"
+    properties:
+      E2TAddress:
+        type: "string" #This is the ideally E2T FQDN or IP:PORT
+      ranNamelist: #list of RAN Names
+        $ref: '#/definitions/ranNamelist'
+  ranNamelist:
+    type: "array"
+    items:
+      type: "string" #This could be FQDN or this needs to be an object?
+  e2t-data:
+    type: "object"
+    required:
+      - "E2TAddress"
+    properties:
+      E2TAddress:
+        type: "string" #This is FQDN or IP of E2T instance
+      ranNamelist:
+        $ref: '#/definitions/ranNamelist'
+  e2t-delete-data:
+    type: "object"
+    required:
+      - "E2TAddress"
+    properties:
+      E2TAddress:
+        type: "string" #This E2T instances FQDN or 
+      ranNamelistTobeDissociated: #xapp instance port address
+        $ref: '#/definitions/ranNamelist'
+      ranAssocList:
+        $ref: "#/definitions/ran-e2t-map"
+  endpoint:
+    type: "object"
+    properties:
+      EndPointName:
+        type: "string"
+      EndPointFqdn:
+        type: "string"
+      EndPointPort:
+        type: "integer"
+        format: "uint16"
+        minimum: 0
+        maximum: 65535
+    
+  debuginfo:
     type: "object"
     required:
-      - "location"
+      - "RouteTable"
     properties:
-      location:
+      RouteTable:
+        type: "array"
+        items:
+          type: "string"
+      RouteConfigs:
         type: "string"
 
+  add-rmr-route:
+    type: "object"
+    required:
+      - "TargetEndPoint"
+      - "MessageType"
+    properties:
+      TargetEndPoint:
+        type: "string"
+      MessageType:
+        type: "integer"
+        format: "uint32"      
+      SenderEndPoint:
+        type: "string"
+      SubscriptionID:
+        type: "integer"
+        format: "int32"      
+  
+  routelist:
+    type: "array"
+    items:
+      $ref: '#/definitions/add-rmr-route'
+        
 externalDocs:
   description: "Routing Manager"
   url: "http://placeholder"
-