Enhancements of REST-based E2 subscription interface
[ric-plt/xapp-frame.git] / pkg / restapi / embedded_spec.go
index dd67843..5fcc66f 100644 (file)
@@ -64,7 +64,7 @@ func init() {
           "application/json"
         ],
         "tags": [
-          "query"
+          "common"
         ],
         "summary": "Returns list of subscriptions",
         "operationId": "getAllSubscriptions",
@@ -79,48 +79,7 @@ func init() {
             "description": "Internal error"
           }
         }
-      }
-    },
-    "/subscriptions/policy": {
-      "post": {
-        "consumes": [
-          "application/json"
-        ],
-        "produces": [
-          "application/json"
-        ],
-        "tags": [
-          "policy"
-        ],
-        "summary": "Subscribe and send \"POLICY\" message to RAN to execute a specific POLICY during call processing in RAN after each occurrence of a defined SUBSCRIPTION",
-        "operationId": "subscribePolicy",
-        "parameters": [
-          {
-            "description": "Subscription policy parameters",
-            "name": "PolicyParams",
-            "in": "body",
-            "schema": {
-              "$ref": "#/definitions/PolicyParams"
-            }
-          }
-        ],
-        "responses": {
-          "201": {
-            "description": "Subscription successfully created",
-            "schema": {
-              "$ref": "#/definitions/SubscriptionResponse"
-            }
-          },
-          "400": {
-            "description": "Invalid input"
-          },
-          "500": {
-            "description": "Internal error"
-          }
-        }
-      }
-    },
-    "/subscriptions/report": {
+      },
       "post": {
         "consumes": [
           "application/json"
@@ -129,17 +88,17 @@ func init() {
           "application/json"
         ],
         "tags": [
-          "report"
+          "common"
         ],
-        "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",
+        "summary": "Subscribe a list of X2AP event triggers to receive messages sent by RAN",
+        "operationId": "Subscribe",
         "parameters": [
           {
-            "description": "Subscription report parameters",
-            "name": "ReportParams",
+            "description": "Subscription parameters",
+            "name": "SubscriptionParams",
             "in": "body",
             "schema": {
-              "$ref": "#/definitions/ReportParams"
+              "$ref": "#/definitions/SubscriptionParams"
             }
           }
         ],
@@ -196,21 +155,48 @@ func init() {
     }
   },
   "definitions": {
-    "ActionParameters": {
+    "ActionDefinition": {
+      "description": "E2SM Octet string. ActionDefinition is an OPTIONAL IE",
+      "type": "object",
+      "properties": {
+        "OctetString": {
+          "type": "string"
+        }
+      }
+    },
+    "ActionToBeSetup": {
       "type": "object",
       "required": [
-        "ActionParameterID",
-        "ActionParameterValue"
+        "ActionID",
+        "ActionType"
       ],
       "properties": {
-        "ActionParameterID": {
-          "type": "integer"
+        "ActionDefinition": {
+          "$ref": "#/definitions/ActionDefinition"
+        },
+        "ActionID": {
+          "type": "integer",
+          "maximum": 255
         },
-        "ActionParameterValue": {
-          "type": "boolean"
+        "ActionType": {
+          "type": "string",
+          "enum": [
+            "insert",
+            "policy",
+            "report"
+          ]
+        },
+        "SubsequentAction": {
+          "$ref": "#/definitions/SubsequentAction"
         }
       }
     },
+    "ActionsToBeSetup": {
+      "type": "array",
+      "items": {
+        "$ref": "#/definitions/ActionToBeSetup"
+      }
+    },
     "ConfigMetadata": {
       "type": "object",
       "required": [
@@ -233,237 +219,128 @@ func init() {
         }
       }
     },
-    "EventTrigger": {
+    "EventTriggerDefinition": {
+      "description": "E2SM Octet string",
       "type": "object",
       "properties": {
-        "ENBId": {
+        "OctetString": {
           "type": "string"
-        },
-        "InterfaceDirection": {
-          "type": "integer"
-        },
-        "PlmnId": {
-          "type": "string"
-        },
-        "ProcedureCode": {
-          "type": "integer"
-        },
-        "TriggerNature": {
-          "type": "string",
-          "enum": [
-            "now",
-            "on change"
-          ]
-        },
-        "TypeOfMessage": {
-          "type": "integer"
-        }
-      }
-    },
-    "EventTriggerList": {
-      "type": "array",
-      "items": {
-        "$ref": "#/definitions/EventTrigger"
-      }
-    },
-    "Format1ActionDefinition": {
-      "type": "object",
-      "required": [
-        "StyleID",
-        "ActionParameters"
-      ],
-      "properties": {
-        "ActionParameters": {
-          "type": "array",
-          "items": {
-            "$ref": "#/definitions/ActionParameters"
-          }
-        },
-        "StyleID": {
-          "type": "integer"
         }
       }
     },
-    "Format2ActionDefinition": {
+    "SubscriptionData": {
       "type": "object",
-      "required": [
-        "RANUeGroupParameters"
-      ],
       "properties": {
-        "RANUeGroupParameters": {
+        "Endpoint": {
           "type": "array",
           "items": {
-            "$ref": "#/definitions/RANUeGroupList"
+            "type": "string"
           }
-        }
-      }
-    },
-    "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"
-        },
-        "EventTriggers": {
-          "$ref": "#/definitions/EventTriggerList"
         },
         "Meid": {
           "type": "string"
         },
-        "PolicyActionDefinitions": {
-          "$ref": "#/definitions/PolicyActionDefinition"
-        },
-        "RANFunctionID": {
+        "SubscriptionId": {
           "type": "integer"
         }
       }
     },
-    "RANUeGroupList": {
+    "SubscriptionDetails": {
       "type": "object",
       "required": [
-        "RANUeGroupID",
-        "RANUeGroupDefinition",
-        "RANImperativePolicy"
+        "EventTriggerList",
+        "ActionToBeSetupList"
       ],
       "properties": {
-        "RANImperativePolicy": {
-          "$ref": "#/definitions/ImperativePolicyDefinition"
+        "ActionToBeSetupList": {
+          "$ref": "#/definitions/ActionsToBeSetup"
         },
-        "RANUeGroupDefinition": {
-          "$ref": "#/definitions/RANUeGroupParams"
-        },
-        "RANUeGroupID": {
-          "type": "integer"
+        "EventTriggerList": {
+          "$ref": "#/definitions/EventTriggerDefinition"
         }
       }
     },
-    "RANUeGroupParams": {
+    "SubscriptionDetailsList": {
+      "type": "array",
+      "items": {
+        "$ref": "#/definitions/SubscriptionDetails"
+      }
+    },
+    "SubscriptionInstance": {
       "type": "object",
       "required": [
-        "RANParameterID",
-        "RANParameterValue"
+        "RequestorId",
+        "InstanceId",
+        "ErrorCause"
       ],
       "properties": {
-        "RANParameterID": {
-          "type": "integer"
+        "ErrorCause": {
+          "description": "Empty string when no error.",
+          "type": "string"
         },
-        "RANParameterTestCondition": {
-          "type": "string",
-          "enum": [
-            "equal",
-            "greaterthan",
-            "lessthan",
-            "contains",
-            "present"
-          ]
+        "InstanceId": {
+          "type": "integer",
+          "maximum": 65535
         },
-        "RANParameterValue": {
-          "type": "integer"
+        "RequestorId": {
+          "type": "integer",
+          "maximum": 65535
         }
       }
     },
-    "ReportActionDefinition": {
-      "type": "object",
-      "properties": {
-        "ActionDefinitionFormat1": {
-          "$ref": "#/definitions/Format1ActionDefinition"
-        }
+    "SubscriptionList": {
+      "description": "A list of subscriptions",
+      "type": "array",
+      "items": {
+        "$ref": "#/definitions/SubscriptionData"
       }
     },
-    "ReportParams": {
+    "SubscriptionParams": {
       "type": "object",
       "required": [
-        "RANFunctionID",
         "ClientEndpoint",
-        "EventTriggers"
+        "Meid",
+        "RequestorId",
+        "InstanceId",
+        "RANFunctionID",
+        "SubscriptionDetails"
       ],
       "properties": {
         "ClientEndpoint": {
-          "type": "string"
+          "description": "xApp service address and port",
+          "type": "object",
+          "properties": {
+            "Port": {
+              "description": "xApp service address port",
+              "type": "integer",
+              "maximum": 65535
+            },
+            "ServiceName": {
+              "description": "xApp service address name like 'service-ricxapp-xappname-http.ricxapp'",
+              "type": "string"
+            }
+          }
         },
-        "EventTriggers": {
-          "$ref": "#/definitions/EventTriggerList"
+        "InstanceId": {
+          "type": "integer",
+          "maximum": 65535
         },
         "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"
+          "type": "integer",
+          "maximum": 4095
         },
         "RequestorId": {
-          "type": "integer"
+          "type": "integer",
+          "maximum": 65535
+        },
+        "SubscriptionDetails": {
+          "$ref": "#/definitions/SubscriptionDetailsList"
         }
       }
     },
-    "SubscriptionList": {
-      "description": "A list of subscriptions",
-      "type": "array",
-      "items": {
-        "$ref": "#/definitions/SubscriptionData"
-      }
-    },
     "SubscriptionResponse": {
       "type": "object",
       "required": [
@@ -482,13 +359,45 @@ func init() {
         }
       }
     },
-    "SubscriptionType": {
-      "type": "string",
-      "enum": [
-        "insert",
-        "policy",
-        "report"
-      ]
+    "SubsequentAction": {
+      "description": "SubsequentAction is an OPTIONAL IE",
+      "type": "object",
+      "required": [
+        "SubsequentActionType",
+        "TimeToWait"
+      ],
+      "properties": {
+        "SubsequentActionType": {
+          "type": "string",
+          "enum": [
+            "continue",
+            "wait"
+          ]
+        },
+        "TimeToWait": {
+          "type": "string",
+          "enum": [
+            "zero",
+            "w1ms",
+            "w2ms",
+            "w5ms",
+            "w10ms",
+            "w20ms",
+            "w30ms",
+            "w40ms",
+            "w50ms",
+            "w100ms",
+            "w200ms",
+            "w500ms",
+            "w1s",
+            "w2s",
+            "w5s",
+            "w10s",
+            "w20s",
+            "w60s"
+          ]
+        }
+      }
     },
     "XAppConfig": {
       "type": "object",
@@ -561,7 +470,7 @@ func init() {
           "application/json"
         ],
         "tags": [
-          "query"
+          "common"
         ],
         "summary": "Returns list of subscriptions",
         "operationId": "getAllSubscriptions",
@@ -576,48 +485,7 @@ func init() {
             "description": "Internal error"
           }
         }
-      }
-    },
-    "/subscriptions/policy": {
-      "post": {
-        "consumes": [
-          "application/json"
-        ],
-        "produces": [
-          "application/json"
-        ],
-        "tags": [
-          "policy"
-        ],
-        "summary": "Subscribe and send \"POLICY\" message to RAN to execute a specific POLICY during call processing in RAN after each occurrence of a defined SUBSCRIPTION",
-        "operationId": "subscribePolicy",
-        "parameters": [
-          {
-            "description": "Subscription policy parameters",
-            "name": "PolicyParams",
-            "in": "body",
-            "schema": {
-              "$ref": "#/definitions/PolicyParams"
-            }
-          }
-        ],
-        "responses": {
-          "201": {
-            "description": "Subscription successfully created",
-            "schema": {
-              "$ref": "#/definitions/SubscriptionResponse"
-            }
-          },
-          "400": {
-            "description": "Invalid input"
-          },
-          "500": {
-            "description": "Internal error"
-          }
-        }
-      }
-    },
-    "/subscriptions/report": {
+      },
       "post": {
         "consumes": [
           "application/json"
@@ -626,17 +494,17 @@ func init() {
           "application/json"
         ],
         "tags": [
-          "report"
+          "common"
         ],
-        "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",
+        "summary": "Subscribe a list of X2AP event triggers to receive messages sent by RAN",
+        "operationId": "Subscribe",
         "parameters": [
           {
-            "description": "Subscription report parameters",
-            "name": "ReportParams",
+            "description": "Subscription parameters",
+            "name": "SubscriptionParams",
             "in": "body",
             "schema": {
-              "$ref": "#/definitions/ReportParams"
+              "$ref": "#/definitions/SubscriptionParams"
             }
           }
         ],
@@ -693,21 +561,49 @@ func init() {
     }
   },
   "definitions": {
-    "ActionParameters": {
+    "ActionDefinition": {
+      "description": "E2SM Octet string. ActionDefinition is an OPTIONAL IE",
+      "type": "object",
+      "properties": {
+        "OctetString": {
+          "type": "string"
+        }
+      }
+    },
+    "ActionToBeSetup": {
       "type": "object",
       "required": [
-        "ActionParameterID",
-        "ActionParameterValue"
+        "ActionID",
+        "ActionType"
       ],
       "properties": {
-        "ActionParameterID": {
-          "type": "integer"
+        "ActionDefinition": {
+          "$ref": "#/definitions/ActionDefinition"
+        },
+        "ActionID": {
+          "type": "integer",
+          "maximum": 255,
+          "minimum": 0
         },
-        "ActionParameterValue": {
-          "type": "boolean"
+        "ActionType": {
+          "type": "string",
+          "enum": [
+            "insert",
+            "policy",
+            "report"
+          ]
+        },
+        "SubsequentAction": {
+          "$ref": "#/definitions/SubsequentAction"
         }
       }
     },
+    "ActionsToBeSetup": {
+      "type": "array",
+      "items": {
+        "$ref": "#/definitions/ActionToBeSetup"
+      }
+    },
     "ConfigMetadata": {
       "type": "object",
       "required": [
@@ -730,237 +626,134 @@ func init() {
         }
       }
     },
-    "EventTrigger": {
+    "EventTriggerDefinition": {
+      "description": "E2SM Octet string",
       "type": "object",
       "properties": {
-        "ENBId": {
+        "OctetString": {
           "type": "string"
-        },
-        "InterfaceDirection": {
-          "type": "integer"
-        },
-        "PlmnId": {
-          "type": "string"
-        },
-        "ProcedureCode": {
-          "type": "integer"
-        },
-        "TriggerNature": {
-          "type": "string",
-          "enum": [
-            "now",
-            "on change"
-          ]
-        },
-        "TypeOfMessage": {
-          "type": "integer"
-        }
-      }
-    },
-    "EventTriggerList": {
-      "type": "array",
-      "items": {
-        "$ref": "#/definitions/EventTrigger"
-      }
-    },
-    "Format1ActionDefinition": {
-      "type": "object",
-      "required": [
-        "StyleID",
-        "ActionParameters"
-      ],
-      "properties": {
-        "ActionParameters": {
-          "type": "array",
-          "items": {
-            "$ref": "#/definitions/ActionParameters"
-          }
-        },
-        "StyleID": {
-          "type": "integer"
         }
       }
     },
-    "Format2ActionDefinition": {
+    "SubscriptionData": {
       "type": "object",
-      "required": [
-        "RANUeGroupParameters"
-      ],
       "properties": {
-        "RANUeGroupParameters": {
+        "Endpoint": {
           "type": "array",
           "items": {
-            "$ref": "#/definitions/RANUeGroupList"
+            "type": "string"
           }
-        }
-      }
-    },
-    "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"
-        },
-        "EventTriggers": {
-          "$ref": "#/definitions/EventTriggerList"
         },
         "Meid": {
           "type": "string"
         },
-        "PolicyActionDefinitions": {
-          "$ref": "#/definitions/PolicyActionDefinition"
-        },
-        "RANFunctionID": {
+        "SubscriptionId": {
           "type": "integer"
         }
       }
     },
-    "RANUeGroupList": {
+    "SubscriptionDetails": {
       "type": "object",
       "required": [
-        "RANUeGroupID",
-        "RANUeGroupDefinition",
-        "RANImperativePolicy"
+        "EventTriggerList",
+        "ActionToBeSetupList"
       ],
       "properties": {
-        "RANImperativePolicy": {
-          "$ref": "#/definitions/ImperativePolicyDefinition"
+        "ActionToBeSetupList": {
+          "$ref": "#/definitions/ActionsToBeSetup"
         },
-        "RANUeGroupDefinition": {
-          "$ref": "#/definitions/RANUeGroupParams"
-        },
-        "RANUeGroupID": {
-          "type": "integer"
+        "EventTriggerList": {
+          "$ref": "#/definitions/EventTriggerDefinition"
         }
       }
     },
-    "RANUeGroupParams": {
+    "SubscriptionDetailsList": {
+      "type": "array",
+      "items": {
+        "$ref": "#/definitions/SubscriptionDetails"
+      }
+    },
+    "SubscriptionInstance": {
       "type": "object",
       "required": [
-        "RANParameterID",
-        "RANParameterValue"
+        "RequestorId",
+        "InstanceId",
+        "ErrorCause"
       ],
       "properties": {
-        "RANParameterID": {
-          "type": "integer"
+        "ErrorCause": {
+          "description": "Empty string when no error.",
+          "type": "string"
         },
-        "RANParameterTestCondition": {
-          "type": "string",
-          "enum": [
-            "equal",
-            "greaterthan",
-            "lessthan",
-            "contains",
-            "present"
-          ]
+        "InstanceId": {
+          "type": "integer",
+          "maximum": 65535,
+          "minimum": 0
         },
-        "RANParameterValue": {
-          "type": "integer"
+        "RequestorId": {
+          "type": "integer",
+          "maximum": 65535,
+          "minimum": 0
         }
       }
     },
-    "ReportActionDefinition": {
-      "type": "object",
-      "properties": {
-        "ActionDefinitionFormat1": {
-          "$ref": "#/definitions/Format1ActionDefinition"
-        }
+    "SubscriptionList": {
+      "description": "A list of subscriptions",
+      "type": "array",
+      "items": {
+        "$ref": "#/definitions/SubscriptionData"
       }
     },
-    "ReportParams": {
+    "SubscriptionParams": {
       "type": "object",
       "required": [
-        "RANFunctionID",
         "ClientEndpoint",
-        "EventTriggers"
+        "Meid",
+        "RequestorId",
+        "InstanceId",
+        "RANFunctionID",
+        "SubscriptionDetails"
       ],
       "properties": {
         "ClientEndpoint": {
-          "type": "string"
+          "description": "xApp service address and port",
+          "type": "object",
+          "properties": {
+            "Port": {
+              "description": "xApp service address port",
+              "type": "integer",
+              "maximum": 65535,
+              "minimum": 0
+            },
+            "ServiceName": {
+              "description": "xApp service address name like 'service-ricxapp-xappname-http.ricxapp'",
+              "type": "string"
+            }
+          }
         },
-        "EventTriggers": {
-          "$ref": "#/definitions/EventTriggerList"
+        "InstanceId": {
+          "type": "integer",
+          "maximum": 65535,
+          "minimum": 0
         },
         "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"
+          "type": "integer",
+          "maximum": 4095,
+          "minimum": 0
         },
         "RequestorId": {
-          "type": "integer"
+          "type": "integer",
+          "maximum": 65535,
+          "minimum": 0
+        },
+        "SubscriptionDetails": {
+          "$ref": "#/definitions/SubscriptionDetailsList"
         }
       }
     },
-    "SubscriptionList": {
-      "description": "A list of subscriptions",
-      "type": "array",
-      "items": {
-        "$ref": "#/definitions/SubscriptionData"
-      }
-    },
     "SubscriptionResponse": {
       "type": "object",
       "required": [
@@ -979,13 +772,45 @@ func init() {
         }
       }
     },
-    "SubscriptionType": {
-      "type": "string",
-      "enum": [
-        "insert",
-        "policy",
-        "report"
-      ]
+    "SubsequentAction": {
+      "description": "SubsequentAction is an OPTIONAL IE",
+      "type": "object",
+      "required": [
+        "SubsequentActionType",
+        "TimeToWait"
+      ],
+      "properties": {
+        "SubsequentActionType": {
+          "type": "string",
+          "enum": [
+            "continue",
+            "wait"
+          ]
+        },
+        "TimeToWait": {
+          "type": "string",
+          "enum": [
+            "zero",
+            "w1ms",
+            "w2ms",
+            "w5ms",
+            "w10ms",
+            "w20ms",
+            "w30ms",
+            "w40ms",
+            "w50ms",
+            "w100ms",
+            "w200ms",
+            "w500ms",
+            "w1s",
+            "w2s",
+            "w5s",
+            "w10s",
+            "w20s",
+            "w60s"
+          ]
+        }
+      }
     },
     "XAppConfig": {
       "type": "object",