X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Frestapi%2Fembedded_spec.go;h=4506519874ac91d736fc1722308da746f60cd4bf;hb=refs%2Fchanges%2F29%2F6729%2F2;hp=a4b2585ce322142ba79dcd55c52e66f465ae12b4;hpb=9568a2d73b96516b27f54650e309f0d157fb97d9;p=ric-plt%2Fxapp-frame.git diff --git a/pkg/restapi/embedded_spec.go b/pkg/restapi/embedded_spec.go index a4b2585..4506519 100644 --- a/pkg/restapi/embedded_spec.go +++ b/pkg/restapi/embedded_spec.go @@ -29,26 +29,27 @@ func init() { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" }, - "version": "0.0.1" + "version": "0.0.2" }, "host": "hostname", "basePath": "/ric/v1", "paths": { - "/subscriptions": { + "/config": { "get": { "produces": [ - "application/json" + "application/json", + "application/xml" ], "tags": [ - "query" + "xapp" ], - "summary": "Returns list of subscriptions", - "operationId": "getAllSubscriptions", + "summary": "Returns the configuration of all xapps", + "operationId": "getXappConfigList", "responses": { "200": { - "description": "successful query of subscriptions", + "description": "successful query of xApp config", "schema": { - "$ref": "#/definitions/SubscriptionList" + "$ref": "#/definitions/XappConfigList" } }, "500": { @@ -57,46 +58,28 @@ func init() { } } }, - "/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" - } - } + "common" ], + "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" } } - } - }, - "/subscriptions/policy": { + }, "post": { "consumes": [ "application/json" @@ -105,17 +88,17 @@ func init() { "application/json" ], "tags": [ - "policy" + "common" ], - "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", + "summary": "Subscribe a list of X2AP event triggers to receive messages sent by RAN", + "operationId": "Subscribe", "parameters": [ { - "description": "Subscription policy parameters", - "name": "PolicyParams", + "description": "Subscription parameters", + "name": "SubscriptionParams", "in": "body", "schema": { - "$ref": "#/definitions/PolicyParams" + "$ref": "#/definitions/SubscriptionParams" } } ], @@ -123,7 +106,7 @@ func init() { "201": { "description": "Subscription successfully created", "schema": { - "$ref": "#/definitions/SubscriptionResult" + "$ref": "#/definitions/SubscriptionResponse" } }, "400": { @@ -135,47 +118,14 @@ func init() { } } }, - "/subscriptions/report": { - "post": { + "/subscriptions/{subscriptionId}": { + "delete": { "consumes": [ "application/json" ], "produces": [ "application/json" ], - "tags": [ - "report" - ], - "summary": "Subscribe a list of X2AP event triggers to receive \"REPORT\" messages sent by RAN", - "operationId": "subscribeReport", - "parameters": [ - { - "description": "Subscription report parameters", - "name": "ReportParams", - "in": "body", - "schema": { - "$ref": "#/definitions/ReportParams" - } - } - ], - "responses": { - "201": { - "description": "Subscription successfully created", - "schema": { - "$ref": "#/definitions/SubscriptionResult" - } - }, - "400": { - "description": "Invalid input" - }, - "500": { - "description": "Internal error" - } - } - } - }, - "/subscriptions/{subscriptionId}": { - "delete": { "tags": [ "common" ], @@ -183,8 +133,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 @@ -195,7 +145,7 @@ func init() { "description": "Operation done successfully" }, "400": { - "description": "Invalid requestorId supplied" + "description": "Invalid subscriptionId supplied" }, "500": { "description": "Internal error" @@ -205,88 +155,143 @@ func init() { } }, "definitions": { - "ControlParams": { + "ActionDefinition": { + "description": "E2SM byte array. ActionDefinition is an OPTIONAL IE", + "type": "array", + "items": { + "type": "integer" + } + }, + "ActionToBeSetup": { "type": "object", + "required": [ + "ActionID", + "ActionType" + ], "properties": { - "RequestorId": { - "type": "integer" + "ActionDefinition": { + "$ref": "#/definitions/ActionDefinition" }, - "TBD": { - "type": "string" + "ActionID": { + "type": "integer", + "maximum": 255 + }, + "ActionType": { + "type": "string", + "enum": [ + "insert", + "policy", + "report" + ] + }, + "SubsequentAction": { + "$ref": "#/definitions/SubsequentAction" } } }, - "EventTrigger": { + "ActionsToBeSetup": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionToBeSetup" + } + }, + "ConfigMetadata": { "type": "object", "required": [ - "InterfaceDirection", - "ProcedureCode", - "TypeOfMessage" + "xappName", + "configType" ], "properties": { - "ENBId": { - "type": "integer" - }, - "InterfaceDirection": { - "type": "integer" + "configType": { + "description": "The type of the content", + "type": "string", + "enum": [ + "json", + "xml", + "other" + ] }, - "PlmnId": { + "xappName": { + "description": "Name of the xApp", "type": "string" - }, - "ProcedureCode": { - "type": "integer" - }, - "TypeOfMessage": { - "type": "integer" } } }, - "EventTriggerList": { + "EventTriggerDefinition": { + "description": "E2SM byte array", "type": "array", "items": { - "$ref": "#/definitions/EventTrigger" + "type": "integer" } }, - "PolicyParams": { + "SubscriptionData": { "type": "object", "properties": { - "RequestorId": { - "type": "integer" + "ClientEndpoint": { + "type": "array", + "items": { + "type": "string" + } }, - "TBD": { + "Meid": { "type": "string" + }, + "SubscriptionId": { + "type": "integer" + }, + "SubscriptionInstances": { + "type": "array", + "items": { + "$ref": "#/definitions/SubscriptionInstance" + } } } }, - "ReportParams": { + "SubscriptionDetail": { "type": "object", "required": [ - "RequestorId", - "EventTriggers" + "XappEventInstanceId", + "EventTriggers", + "ActionToBeSetupList" ], "properties": { + "ActionToBeSetupList": { + "$ref": "#/definitions/ActionsToBeSetup" + }, "EventTriggers": { - "$ref": "#/definitions/EventTriggerList" + "$ref": "#/definitions/EventTriggerDefinition" }, - "RequestorId": { - "type": "integer" + "XappEventInstanceId": { + "type": "integer", + "maximum": 65535 } } }, - "SubscriptionData": { + "SubscriptionDetailsList": { + "type": "array", + "items": { + "$ref": "#/definitions/SubscriptionDetail" + } + }, + "SubscriptionInstance": { "type": "object", + "required": [ + "XappEventInstanceId", + "E2EventInstanceId", + "ErrorCause" + ], "properties": { - "Endpoint": { - "type": "array", - "items": { - "type": "string" - } + "E2EventInstanceId": { + "type": "integer", + "maximum": 65535 }, - "Meid": { + "ErrorCause": { + "description": "Empty string when no error.", "type": "string" }, - "SubscriptionId": { - "type": "integer" + "XappEventInstanceId": { + "type": "integer", + "maximum": 65535 } } }, @@ -297,21 +302,130 @@ func init() { "$ref": "#/definitions/SubscriptionData" } }, - "SubscriptionResult": { - "description": "A list of unique IDs", + "SubscriptionParams": { + "type": "object", + "required": [ + "ClientEndpoint", + "Meid", + "RANFunctionID", + "SubscriptionDetails" + ], + "properties": { + "ClientEndpoint": { + "description": "xApp service address and port", + "type": "object", + "properties": { + "HTTPPort": { + "description": "xApp HTTP service address port", + "type": "integer", + "maximum": 65535 + }, + "Host": { + "description": "xApp service address name like 'service-ricxapp-xappname-http.ricxapp'", + "type": "string" + }, + "RMRPort": { + "description": "xApp RMR service address port", + "type": "integer", + "maximum": 65535 + } + } + }, + "Meid": { + "type": "string" + }, + "RANFunctionID": { + "type": "integer", + "maximum": 4095 + }, + "SubscriptionDetails": { + "$ref": "#/definitions/SubscriptionDetailsList" + }, + "SubscriptionId": { + "description": "Optional subscription ID (Submgr allocates if not given)", + "type": "string" + } + } + }, + "SubscriptionResponse": { + "type": "object", + "required": [ + "SubscriptionId", + "SubscriptionInstances" + ], + "properties": { + "SubscriptionId": { + "type": "string" + }, + "SubscriptionInstances": { + "type": "array", + "items": { + "$ref": "#/definitions/SubscriptionInstance" + } + } + } + }, + "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", + "required": [ + "metadata", + "config" + ], + "properties": { + "config": { + "description": "Configuration in JSON format", + "type": "object" + }, + "metadata": { + "$ref": "#/definitions/ConfigMetadata" + } + } + }, + "XappConfigList": { "type": "array", "items": { - "type": "integer" + "$ref": "#/definitions/XAppConfig" } - }, - "SubscriptionType": { - "type": "string", - "enum": [ - "control", - "insert", - "policy", - "report" - ] } } }`)) @@ -327,26 +441,27 @@ func init() { "name": "Apache 2.0", "url": "http://www.apache.org/licenses/LICENSE-2.0.html" }, - "version": "0.0.1" + "version": "0.0.2" }, "host": "hostname", "basePath": "/ric/v1", "paths": { - "/subscriptions": { + "/config": { "get": { "produces": [ - "application/json" + "application/json", + "application/xml" ], "tags": [ - "query" + "xapp" ], - "summary": "Returns list of subscriptions", - "operationId": "getAllSubscriptions", + "summary": "Returns the configuration of all xapps", + "operationId": "getXappConfigList", "responses": { "200": { - "description": "successful query of subscriptions", + "description": "successful query of xApp config", "schema": { - "$ref": "#/definitions/SubscriptionList" + "$ref": "#/definitions/XappConfigList" } }, "500": { @@ -355,46 +470,28 @@ func init() { } } }, - "/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" - } - } + "common" ], + "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" } } - } - }, - "/subscriptions/policy": { + }, "post": { "consumes": [ "application/json" @@ -403,17 +500,17 @@ func init() { "application/json" ], "tags": [ - "policy" + "common" ], - "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", + "summary": "Subscribe a list of X2AP event triggers to receive messages sent by RAN", + "operationId": "Subscribe", "parameters": [ { - "description": "Subscription policy parameters", - "name": "PolicyParams", + "description": "Subscription parameters", + "name": "SubscriptionParams", "in": "body", "schema": { - "$ref": "#/definitions/PolicyParams" + "$ref": "#/definitions/SubscriptionParams" } } ], @@ -421,7 +518,7 @@ func init() { "201": { "description": "Subscription successfully created", "schema": { - "$ref": "#/definitions/SubscriptionResult" + "$ref": "#/definitions/SubscriptionResponse" } }, "400": { @@ -433,47 +530,14 @@ func init() { } } }, - "/subscriptions/report": { - "post": { + "/subscriptions/{subscriptionId}": { + "delete": { "consumes": [ "application/json" ], "produces": [ "application/json" ], - "tags": [ - "report" - ], - "summary": "Subscribe a list of X2AP event triggers to receive \"REPORT\" messages sent by RAN", - "operationId": "subscribeReport", - "parameters": [ - { - "description": "Subscription report parameters", - "name": "ReportParams", - "in": "body", - "schema": { - "$ref": "#/definitions/ReportParams" - } - } - ], - "responses": { - "201": { - "description": "Subscription successfully created", - "schema": { - "$ref": "#/definitions/SubscriptionResult" - } - }, - "400": { - "description": "Invalid input" - }, - "500": { - "description": "Internal error" - } - } - } - }, - "/subscriptions/{subscriptionId}": { - "delete": { "tags": [ "common" ], @@ -481,8 +545,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 @@ -493,7 +557,7 @@ func init() { "description": "Operation done successfully" }, "400": { - "description": "Invalid requestorId supplied" + "description": "Invalid subscriptionId supplied" }, "500": { "description": "Internal error" @@ -503,88 +567,147 @@ func init() { } }, "definitions": { - "ControlParams": { + "ActionDefinition": { + "description": "E2SM byte array. ActionDefinition is an OPTIONAL IE", + "type": "array", + "items": { + "type": "integer" + } + }, + "ActionToBeSetup": { "type": "object", + "required": [ + "ActionID", + "ActionType" + ], "properties": { - "RequestorId": { - "type": "integer" + "ActionDefinition": { + "$ref": "#/definitions/ActionDefinition" }, - "TBD": { - "type": "string" + "ActionID": { + "type": "integer", + "maximum": 255, + "minimum": 0 + }, + "ActionType": { + "type": "string", + "enum": [ + "insert", + "policy", + "report" + ] + }, + "SubsequentAction": { + "$ref": "#/definitions/SubsequentAction" } } }, - "EventTrigger": { + "ActionsToBeSetup": { + "type": "array", + "items": { + "$ref": "#/definitions/ActionToBeSetup" + } + }, + "ConfigMetadata": { "type": "object", "required": [ - "InterfaceDirection", - "ProcedureCode", - "TypeOfMessage" + "xappName", + "configType" ], "properties": { - "ENBId": { - "type": "integer" + "configType": { + "description": "The type of the content", + "type": "string", + "enum": [ + "json", + "xml", + "other" + ] }, - "InterfaceDirection": { - "type": "integer" - }, - "PlmnId": { + "xappName": { + "description": "Name of the xApp", "type": "string" - }, - "ProcedureCode": { - "type": "integer" - }, - "TypeOfMessage": { - "type": "integer" } } }, - "EventTriggerList": { + "EventTriggerDefinition": { + "description": "E2SM byte array", "type": "array", "items": { - "$ref": "#/definitions/EventTrigger" + "type": "integer" } }, - "PolicyParams": { + "SubscriptionData": { "type": "object", "properties": { - "RequestorId": { - "type": "integer" + "ClientEndpoint": { + "type": "array", + "items": { + "type": "string" + } }, - "TBD": { + "Meid": { "type": "string" + }, + "SubscriptionId": { + "type": "integer" + }, + "SubscriptionInstances": { + "type": "array", + "items": { + "$ref": "#/definitions/SubscriptionInstance" + } } } }, - "ReportParams": { + "SubscriptionDetail": { "type": "object", "required": [ - "RequestorId", - "EventTriggers" + "XappEventInstanceId", + "EventTriggers", + "ActionToBeSetupList" ], "properties": { + "ActionToBeSetupList": { + "$ref": "#/definitions/ActionsToBeSetup" + }, "EventTriggers": { - "$ref": "#/definitions/EventTriggerList" + "$ref": "#/definitions/EventTriggerDefinition" }, - "RequestorId": { - "type": "integer" + "XappEventInstanceId": { + "type": "integer", + "maximum": 65535, + "minimum": 0 } } }, - "SubscriptionData": { + "SubscriptionDetailsList": { + "type": "array", + "items": { + "$ref": "#/definitions/SubscriptionDetail" + } + }, + "SubscriptionInstance": { "type": "object", + "required": [ + "XappEventInstanceId", + "E2EventInstanceId", + "ErrorCause" + ], "properties": { - "Endpoint": { - "type": "array", - "items": { - "type": "string" - } + "E2EventInstanceId": { + "type": "integer", + "maximum": 65535, + "minimum": 0 }, - "Meid": { + "ErrorCause": { + "description": "Empty string when no error.", "type": "string" }, - "SubscriptionId": { - "type": "integer" + "XappEventInstanceId": { + "type": "integer", + "maximum": 65535, + "minimum": 0 } } }, @@ -595,21 +718,155 @@ func init() { "$ref": "#/definitions/SubscriptionData" } }, - "SubscriptionResult": { - "description": "A list of unique IDs", + "SubscriptionParams": { + "type": "object", + "required": [ + "ClientEndpoint", + "Meid", + "RANFunctionID", + "SubscriptionDetails" + ], + "properties": { + "ClientEndpoint": { + "description": "xApp service address and port", + "type": "object", + "properties": { + "HTTPPort": { + "description": "xApp HTTP service address port", + "type": "integer", + "maximum": 65535, + "minimum": 0 + }, + "Host": { + "description": "xApp service address name like 'service-ricxapp-xappname-http.ricxapp'", + "type": "string" + }, + "RMRPort": { + "description": "xApp RMR service address port", + "type": "integer", + "maximum": 65535, + "minimum": 0 + } + } + }, + "Meid": { + "type": "string" + }, + "RANFunctionID": { + "type": "integer", + "maximum": 4095, + "minimum": 0 + }, + "SubscriptionDetails": { + "$ref": "#/definitions/SubscriptionDetailsList" + }, + "SubscriptionId": { + "description": "Optional subscription ID (Submgr allocates if not given)", + "type": "string" + } + } + }, + "SubscriptionParamsClientEndpoint": { + "description": "xApp service address and port", + "type": "object", + "properties": { + "HTTPPort": { + "description": "xApp HTTP service address port", + "type": "integer", + "maximum": 65535, + "minimum": 0 + }, + "Host": { + "description": "xApp service address name like 'service-ricxapp-xappname-http.ricxapp'", + "type": "string" + }, + "RMRPort": { + "description": "xApp RMR service address port", + "type": "integer", + "maximum": 65535, + "minimum": 0 + } + } + }, + "SubscriptionResponse": { + "type": "object", + "required": [ + "SubscriptionId", + "SubscriptionInstances" + ], + "properties": { + "SubscriptionId": { + "type": "string" + }, + "SubscriptionInstances": { + "type": "array", + "items": { + "$ref": "#/definitions/SubscriptionInstance" + } + } + } + }, + "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", + "required": [ + "metadata", + "config" + ], + "properties": { + "config": { + "description": "Configuration in JSON format", + "type": "object" + }, + "metadata": { + "$ref": "#/definitions/ConfigMetadata" + } + } + }, + "XappConfigList": { "type": "array", "items": { - "type": "integer" + "$ref": "#/definitions/XAppConfig" } - }, - "SubscriptionType": { - "type": "string", - "enum": [ - "control", - "insert", - "policy", - "report" - ] } } }`))