New alarm library v0.5.0
[ric-plt/xapp-frame.git] / pkg / restapi / embedded_spec.go
index 4498b5b..8cb57e1 100644 (file)
@@ -34,39 +34,23 @@ func init() {
   "host": "hostname",
   "basePath": "/ric/v1",
   "paths": {
-    "/subscriptions/control": {
-      "post": {
-        "consumes": [
-          "application/json"
-        ],
+    "/subscriptions": {
+      "get": {
         "produces": [
           "application/json"
         ],
         "tags": [
-          "control"
-        ],
-        "summary": "Subscribe and send \"CONTROL\" message to RAN to initiate or resume call processing in RAN",
-        "operationId": "subscribeControl",
-        "parameters": [
-          {
-            "description": "Subscription control parameters",
-            "name": "ControlParams",
-            "in": "body",
-            "schema": {
-              "$ref": "#/definitions/ControlParams"
-            }
-          }
+          "query"
         ],
+        "summary": "Returns list of subscriptions",
+        "operationId": "getAllSubscriptions",
         "responses": {
-          "201": {
-            "description": "Subscription successfully created",
+          "200": {
+            "description": "successful query of subscriptions",
             "schema": {
-              "$ref": "#/definitions/SubscriptionResult"
+              "$ref": "#/definitions/SubscriptionList"
             }
           },
-          "400": {
-            "description": "Invalid input"
-          },
           "500": {
             "description": "Internal error"
           }
@@ -100,7 +84,7 @@ func init() {
           "201": {
             "description": "Subscription successfully created",
             "schema": {
-              "$ref": "#/definitions/SubscriptionResult"
+              "$ref": "#/definitions/SubscriptionResponse"
             }
           },
           "400": {
@@ -123,7 +107,7 @@ func init() {
         "tags": [
           "report"
         ],
-        "summary": "Subscribe a list of X2AP event triggers to receive \"REPORT\" messages sent by RAN",
+        "summary": "Subscribe a list of X2AP event triggers to receive \"REPORT\" messages sent by RAN or Subscribe to receive the content of gNB NRT table in REPORT message sent by RAN",
         "operationId": "subscribeReport",
         "parameters": [
           {
@@ -139,7 +123,7 @@ func init() {
           "201": {
             "description": "Subscription successfully created",
             "schema": {
-              "$ref": "#/definitions/SubscriptionResult"
+              "$ref": "#/definitions/SubscriptionResponse"
             }
           },
           "400": {
@@ -153,6 +137,12 @@ func init() {
     },
     "/subscriptions/{subscriptionId}": {
       "delete": {
+        "consumes": [
+          "application/json"
+        ],
+        "produces": [
+          "application/json"
+        ],
         "tags": [
           "common"
         ],
@@ -160,8 +150,8 @@ func init() {
         "operationId": "Unsubscribe",
         "parameters": [
           {
-            "type": "integer",
-            "description": "The subscriptionId to be unsubscribed",
+            "type": "string",
+            "description": "The subscriptionId received in the Subscription Response",
             "name": "subscriptionId",
             "in": "path",
             "required": true
@@ -172,7 +162,7 @@ func init() {
             "description": "Operation done successfully"
           },
           "400": {
-            "description": "Invalid requestorId supplied"
+            "description": "Invalid subscriptionId supplied"
           },
           "500": {
             "description": "Internal error"
@@ -182,27 +172,26 @@ func init() {
     }
   },
   "definitions": {
-    "ControlParams": {
+    "ActionParameters": {
       "type": "object",
+      "required": [
+        "ActionParameterID",
+        "ActionParameterValue"
+      ],
       "properties": {
-        "RequestorId": {
+        "ActionParameterID": {
           "type": "integer"
         },
-        "TBD": {
-          "type": "string"
+        "ActionParameterValue": {
+          "type": "boolean"
         }
       }
     },
     "EventTrigger": {
       "type": "object",
-      "required": [
-        "InterfaceDirection",
-        "ProcedureCode",
-        "TypeOfMessage"
-      ],
       "properties": {
         "ENBId": {
-          "type": "integer"
+          "type": "string"
         },
         "InterfaceDirection": {
           "type": "integer"
@@ -213,6 +202,13 @@ func init() {
         "ProcedureCode": {
           "type": "integer"
         },
+        "TriggerNature": {
+          "type": "string",
+          "enum": [
+            "now",
+            "on change"
+          ]
+        },
         "TypeOfMessage": {
           "type": "integer"
         }
@@ -224,43 +220,225 @@ func init() {
         "$ref": "#/definitions/EventTrigger"
       }
     },
-    "PolicyParams": {
+    "Format1ActionDefinition": {
       "type": "object",
+      "required": [
+        "StyleID",
+        "ActionParameters"
+      ],
       "properties": {
-        "RequestorId": {
+        "ActionParameters": {
+          "type": "array",
+          "items": {
+            "$ref": "#/definitions/ActionParameters"
+          }
+        },
+        "StyleID": {
+          "type": "integer"
+        }
+      }
+    },
+    "Format2ActionDefinition": {
+      "type": "object",
+      "required": [
+        "RANUeGroupParameters"
+      ],
+      "properties": {
+        "RANUeGroupParameters": {
+          "type": "array",
+          "items": {
+            "$ref": "#/definitions/RANUeGroupList"
+          }
+        }
+      }
+    },
+    "ImperativePolicyDefinition": {
+      "type": "object",
+      "required": [
+        "PolicyParameterID",
+        "PolicyParameterValue"
+      ],
+      "properties": {
+        "PolicyParameterID": {
+          "type": "integer"
+        },
+        "PolicyParameterValue": {
           "type": "integer"
+        }
+      }
+    },
+    "PolicyActionDefinition": {
+      "type": "object",
+      "properties": {
+        "ActionDefinitionFormat2": {
+          "$ref": "#/definitions/Format2ActionDefinition"
+        }
+      }
+    },
+    "PolicyParams": {
+      "type": "object",
+      "required": [
+        "Meid",
+        "RANFunctionID",
+        "ClientEndpoint",
+        "EventTriggers",
+        "PolicyActionDefinitions"
+      ],
+      "properties": {
+        "ClientEndpoint": {
+          "type": "string"
         },
-        "TBD": {
+        "EventTriggers": {
+          "$ref": "#/definitions/EventTriggerList"
+        },
+        "Meid": {
           "type": "string"
+        },
+        "PolicyActionDefinitions": {
+          "$ref": "#/definitions/PolicyActionDefinition"
+        },
+        "RANFunctionID": {
+          "type": "integer"
+        }
+      }
+    },
+    "RANUeGroupList": {
+      "type": "object",
+      "required": [
+        "RANUeGroupID",
+        "RANUeGroupDefinition",
+        "RANImperativePolicy"
+      ],
+      "properties": {
+        "RANImperativePolicy": {
+          "$ref": "#/definitions/ImperativePolicyDefinition"
+        },
+        "RANUeGroupDefinition": {
+          "$ref": "#/definitions/RANUeGroupParams"
+        },
+        "RANUeGroupID": {
+          "type": "integer"
+        }
+      }
+    },
+    "RANUeGroupParams": {
+      "type": "object",
+      "required": [
+        "RANParameterID",
+        "RANParameterValue"
+      ],
+      "properties": {
+        "RANParameterID": {
+          "type": "integer"
+        },
+        "RANParameterTestCondition": {
+          "type": "string",
+          "enum": [
+            "equal",
+            "greaterthan",
+            "lessthan",
+            "contains",
+            "present"
+          ]
+        },
+        "RANParameterValue": {
+          "type": "integer"
+        }
+      }
+    },
+    "ReportActionDefinition": {
+      "type": "object",
+      "properties": {
+        "ActionDefinitionFormat1": {
+          "$ref": "#/definitions/Format1ActionDefinition"
         }
       }
     },
     "ReportParams": {
       "type": "object",
       "required": [
-        "RequestorId",
+        "RANFunctionID",
+        "ClientEndpoint",
         "EventTriggers"
       ],
       "properties": {
+        "ClientEndpoint": {
+          "type": "string"
+        },
         "EventTriggers": {
           "$ref": "#/definitions/EventTriggerList"
         },
+        "Meid": {
+          "type": "string"
+        },
+        "RANFunctionID": {
+          "type": "integer"
+        },
+        "ReportActionDefinitions": {
+          "$ref": "#/definitions/ReportActionDefinition"
+        }
+      }
+    },
+    "SubscriptionData": {
+      "type": "object",
+      "properties": {
+        "Endpoint": {
+          "type": "array",
+          "items": {
+            "type": "string"
+          }
+        },
+        "Meid": {
+          "type": "string"
+        },
+        "SubscriptionId": {
+          "type": "integer"
+        }
+      }
+    },
+    "SubscriptionInstance": {
+      "type": "object",
+      "required": [
+        "RequestorId",
+        "InstanceId"
+      ],
+      "properties": {
+        "InstanceId": {
+          "type": "integer"
+        },
         "RequestorId": {
           "type": "integer"
         }
       }
     },
-    "SubscriptionResult": {
-      "description": "A list of unique IDs",
+    "SubscriptionList": {
+      "description": "A list of subscriptions",
       "type": "array",
       "items": {
-        "type": "integer"
+        "$ref": "#/definitions/SubscriptionData"
+      }
+    },
+    "SubscriptionResponse": {
+      "type": "object",
+      "required": [
+        "SubscriptionId",
+        "SubscriptionInstances"
+      ],
+      "properties": {
+        "SubscriptionId": {
+          "type": "string"
+        },
+        "SubscriptionInstances": {
+          "type": "array",
+          "items": {
+            "$ref": "#/definitions/SubscriptionInstance"
+          }
+        }
       }
     },
     "SubscriptionType": {
       "type": "string",
       "enum": [
-        "control",
         "insert",
         "policy",
         "report"
@@ -285,39 +463,23 @@ func init() {
   "host": "hostname",
   "basePath": "/ric/v1",
   "paths": {
-    "/subscriptions/control": {
-      "post": {
-        "consumes": [
-          "application/json"
-        ],
+    "/subscriptions": {
+      "get": {
         "produces": [
           "application/json"
         ],
         "tags": [
-          "control"
-        ],
-        "summary": "Subscribe and send \"CONTROL\" message to RAN to initiate or resume call processing in RAN",
-        "operationId": "subscribeControl",
-        "parameters": [
-          {
-            "description": "Subscription control parameters",
-            "name": "ControlParams",
-            "in": "body",
-            "schema": {
-              "$ref": "#/definitions/ControlParams"
-            }
-          }
+          "query"
         ],
+        "summary": "Returns list of subscriptions",
+        "operationId": "getAllSubscriptions",
         "responses": {
-          "201": {
-            "description": "Subscription successfully created",
+          "200": {
+            "description": "successful query of subscriptions",
             "schema": {
-              "$ref": "#/definitions/SubscriptionResult"
+              "$ref": "#/definitions/SubscriptionList"
             }
           },
-          "400": {
-            "description": "Invalid input"
-          },
           "500": {
             "description": "Internal error"
           }
@@ -351,7 +513,7 @@ func init() {
           "201": {
             "description": "Subscription successfully created",
             "schema": {
-              "$ref": "#/definitions/SubscriptionResult"
+              "$ref": "#/definitions/SubscriptionResponse"
             }
           },
           "400": {
@@ -374,7 +536,7 @@ func init() {
         "tags": [
           "report"
         ],
-        "summary": "Subscribe a list of X2AP event triggers to receive \"REPORT\" messages sent by RAN",
+        "summary": "Subscribe a list of X2AP event triggers to receive \"REPORT\" messages sent by RAN or Subscribe to receive the content of gNB NRT table in REPORT message sent by RAN",
         "operationId": "subscribeReport",
         "parameters": [
           {
@@ -390,7 +552,7 @@ func init() {
           "201": {
             "description": "Subscription successfully created",
             "schema": {
-              "$ref": "#/definitions/SubscriptionResult"
+              "$ref": "#/definitions/SubscriptionResponse"
             }
           },
           "400": {
@@ -404,6 +566,12 @@ func init() {
     },
     "/subscriptions/{subscriptionId}": {
       "delete": {
+        "consumes": [
+          "application/json"
+        ],
+        "produces": [
+          "application/json"
+        ],
         "tags": [
           "common"
         ],
@@ -411,8 +579,8 @@ func init() {
         "operationId": "Unsubscribe",
         "parameters": [
           {
-            "type": "integer",
-            "description": "The subscriptionId to be unsubscribed",
+            "type": "string",
+            "description": "The subscriptionId received in the Subscription Response",
             "name": "subscriptionId",
             "in": "path",
             "required": true
@@ -423,7 +591,7 @@ func init() {
             "description": "Operation done successfully"
           },
           "400": {
-            "description": "Invalid requestorId supplied"
+            "description": "Invalid subscriptionId supplied"
           },
           "500": {
             "description": "Internal error"
@@ -433,27 +601,26 @@ func init() {
     }
   },
   "definitions": {
-    "ControlParams": {
+    "ActionParameters": {
       "type": "object",
+      "required": [
+        "ActionParameterID",
+        "ActionParameterValue"
+      ],
       "properties": {
-        "RequestorId": {
+        "ActionParameterID": {
           "type": "integer"
         },
-        "TBD": {
-          "type": "string"
+        "ActionParameterValue": {
+          "type": "boolean"
         }
       }
     },
     "EventTrigger": {
       "type": "object",
-      "required": [
-        "InterfaceDirection",
-        "ProcedureCode",
-        "TypeOfMessage"
-      ],
       "properties": {
         "ENBId": {
-          "type": "integer"
+          "type": "string"
         },
         "InterfaceDirection": {
           "type": "integer"
@@ -464,6 +631,13 @@ func init() {
         "ProcedureCode": {
           "type": "integer"
         },
+        "TriggerNature": {
+          "type": "string",
+          "enum": [
+            "now",
+            "on change"
+          ]
+        },
         "TypeOfMessage": {
           "type": "integer"
         }
@@ -475,43 +649,225 @@ func init() {
         "$ref": "#/definitions/EventTrigger"
       }
     },
-    "PolicyParams": {
+    "Format1ActionDefinition": {
       "type": "object",
+      "required": [
+        "StyleID",
+        "ActionParameters"
+      ],
       "properties": {
-        "RequestorId": {
+        "ActionParameters": {
+          "type": "array",
+          "items": {
+            "$ref": "#/definitions/ActionParameters"
+          }
+        },
+        "StyleID": {
+          "type": "integer"
+        }
+      }
+    },
+    "Format2ActionDefinition": {
+      "type": "object",
+      "required": [
+        "RANUeGroupParameters"
+      ],
+      "properties": {
+        "RANUeGroupParameters": {
+          "type": "array",
+          "items": {
+            "$ref": "#/definitions/RANUeGroupList"
+          }
+        }
+      }
+    },
+    "ImperativePolicyDefinition": {
+      "type": "object",
+      "required": [
+        "PolicyParameterID",
+        "PolicyParameterValue"
+      ],
+      "properties": {
+        "PolicyParameterID": {
+          "type": "integer"
+        },
+        "PolicyParameterValue": {
           "type": "integer"
+        }
+      }
+    },
+    "PolicyActionDefinition": {
+      "type": "object",
+      "properties": {
+        "ActionDefinitionFormat2": {
+          "$ref": "#/definitions/Format2ActionDefinition"
+        }
+      }
+    },
+    "PolicyParams": {
+      "type": "object",
+      "required": [
+        "Meid",
+        "RANFunctionID",
+        "ClientEndpoint",
+        "EventTriggers",
+        "PolicyActionDefinitions"
+      ],
+      "properties": {
+        "ClientEndpoint": {
+          "type": "string"
         },
-        "TBD": {
+        "EventTriggers": {
+          "$ref": "#/definitions/EventTriggerList"
+        },
+        "Meid": {
           "type": "string"
+        },
+        "PolicyActionDefinitions": {
+          "$ref": "#/definitions/PolicyActionDefinition"
+        },
+        "RANFunctionID": {
+          "type": "integer"
+        }
+      }
+    },
+    "RANUeGroupList": {
+      "type": "object",
+      "required": [
+        "RANUeGroupID",
+        "RANUeGroupDefinition",
+        "RANImperativePolicy"
+      ],
+      "properties": {
+        "RANImperativePolicy": {
+          "$ref": "#/definitions/ImperativePolicyDefinition"
+        },
+        "RANUeGroupDefinition": {
+          "$ref": "#/definitions/RANUeGroupParams"
+        },
+        "RANUeGroupID": {
+          "type": "integer"
+        }
+      }
+    },
+    "RANUeGroupParams": {
+      "type": "object",
+      "required": [
+        "RANParameterID",
+        "RANParameterValue"
+      ],
+      "properties": {
+        "RANParameterID": {
+          "type": "integer"
+        },
+        "RANParameterTestCondition": {
+          "type": "string",
+          "enum": [
+            "equal",
+            "greaterthan",
+            "lessthan",
+            "contains",
+            "present"
+          ]
+        },
+        "RANParameterValue": {
+          "type": "integer"
+        }
+      }
+    },
+    "ReportActionDefinition": {
+      "type": "object",
+      "properties": {
+        "ActionDefinitionFormat1": {
+          "$ref": "#/definitions/Format1ActionDefinition"
         }
       }
     },
     "ReportParams": {
       "type": "object",
       "required": [
-        "RequestorId",
+        "RANFunctionID",
+        "ClientEndpoint",
         "EventTriggers"
       ],
       "properties": {
+        "ClientEndpoint": {
+          "type": "string"
+        },
         "EventTriggers": {
           "$ref": "#/definitions/EventTriggerList"
         },
+        "Meid": {
+          "type": "string"
+        },
+        "RANFunctionID": {
+          "type": "integer"
+        },
+        "ReportActionDefinitions": {
+          "$ref": "#/definitions/ReportActionDefinition"
+        }
+      }
+    },
+    "SubscriptionData": {
+      "type": "object",
+      "properties": {
+        "Endpoint": {
+          "type": "array",
+          "items": {
+            "type": "string"
+          }
+        },
+        "Meid": {
+          "type": "string"
+        },
+        "SubscriptionId": {
+          "type": "integer"
+        }
+      }
+    },
+    "SubscriptionInstance": {
+      "type": "object",
+      "required": [
+        "RequestorId",
+        "InstanceId"
+      ],
+      "properties": {
+        "InstanceId": {
+          "type": "integer"
+        },
         "RequestorId": {
           "type": "integer"
         }
       }
     },
-    "SubscriptionResult": {
-      "description": "A list of unique IDs",
+    "SubscriptionList": {
+      "description": "A list of subscriptions",
       "type": "array",
       "items": {
-        "type": "integer"
+        "$ref": "#/definitions/SubscriptionData"
+      }
+    },
+    "SubscriptionResponse": {
+      "type": "object",
+      "required": [
+        "SubscriptionId",
+        "SubscriptionInstances"
+      ],
+      "properties": {
+        "SubscriptionId": {
+          "type": "string"
+        },
+        "SubscriptionInstances": {
+          "type": "array",
+          "items": {
+            "$ref": "#/definitions/SubscriptionInstance"
+          }
+        }
       }
     },
     "SubscriptionType": {
       "type": "string",
       "enum": [
-        "control",
         "insert",
         "policy",
         "report"