X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Frestapi%2Fembedded_spec.go;h=4506519874ac91d736fc1722308da746f60cd4bf;hb=40bc000e6cafe3a7eea32e4361268574050c12c4;hp=4498b5b036ca5696b136599e2857964dc60eeed4;hpb=3895a8c8775ef96652e6473414fdd7366c59f404;p=ric-plt%2Fxapp-frame.git diff --git a/pkg/restapi/embedded_spec.go b/pkg/restapi/embedded_spec.go index 4498b5b..4506519 100644 --- a/pkg/restapi/embedded_spec.go +++ b/pkg/restapi/embedded_spec.go @@ -29,90 +29,57 @@ 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/control": { - "post": { - "consumes": [ - "application/json" - ], + "/config": { + "get": { "produces": [ - "application/json" + "application/json", + "application/xml" ], "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" - } - } + "xapp" ], + "summary": "Returns the configuration of all xapps", + "operationId": "getXappConfigList", "responses": { - "201": { - "description": "Subscription successfully created", + "200": { + "description": "successful query of xApp config", "schema": { - "$ref": "#/definitions/SubscriptionResult" + "$ref": "#/definitions/XappConfigList" } }, - "400": { - "description": "Invalid input" - }, "500": { "description": "Internal error" } } } }, - "/subscriptions/policy": { - "post": { - "consumes": [ - "application/json" - ], + "/subscriptions": { + "get": { "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" - } - } + "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/report": { + }, "post": { "consumes": [ "application/json" @@ -121,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", - "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" } } ], @@ -139,7 +106,7 @@ func init() { "201": { "description": "Subscription successfully created", "schema": { - "$ref": "#/definitions/SubscriptionResult" + "$ref": "#/definitions/SubscriptionResponse" } }, "400": { @@ -153,6 +120,12 @@ func init() { }, "/subscriptions/{subscriptionId}": { "delete": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], "tags": [ "common" ], @@ -160,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 @@ -172,7 +145,7 @@ func init() { "description": "Operation done successfully" }, "400": { - "description": "Invalid requestorId supplied" + "description": "Invalid subscriptionId supplied" }, "500": { "description": "Internal error" @@ -182,89 +155,277 @@ 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" + "configType": { + "description": "The type of the content", + "type": "string", + "enum": [ + "json", + "xml", + "other" + ] }, - "InterfaceDirection": { - "type": "integer" + "xappName": { + "description": "Name of the xApp", + "type": "string" + } + } + }, + "EventTriggerDefinition": { + "description": "E2SM byte array", + "type": "array", + "items": { + "type": "integer" + } + }, + "SubscriptionData": { + "type": "object", + "properties": { + "ClientEndpoint": { + "type": "array", + "items": { + "type": "string" + } }, - "PlmnId": { + "Meid": { "type": "string" }, - "ProcedureCode": { + "SubscriptionId": { "type": "integer" }, - "TypeOfMessage": { - "type": "integer" + "SubscriptionInstances": { + "type": "array", + "items": { + "$ref": "#/definitions/SubscriptionInstance" + } + } + } + }, + "SubscriptionDetail": { + "type": "object", + "required": [ + "XappEventInstanceId", + "EventTriggers", + "ActionToBeSetupList" + ], + "properties": { + "ActionToBeSetupList": { + "$ref": "#/definitions/ActionsToBeSetup" + }, + "EventTriggers": { + "$ref": "#/definitions/EventTriggerDefinition" + }, + "XappEventInstanceId": { + "type": "integer", + "maximum": 65535 } } }, - "EventTriggerList": { + "SubscriptionDetailsList": { "type": "array", "items": { - "$ref": "#/definitions/EventTrigger" + "$ref": "#/definitions/SubscriptionDetail" } }, - "PolicyParams": { + "SubscriptionInstance": { "type": "object", + "required": [ + "XappEventInstanceId", + "E2EventInstanceId", + "ErrorCause" + ], "properties": { - "RequestorId": { - "type": "integer" + "E2EventInstanceId": { + "type": "integer", + "maximum": 65535 }, - "TBD": { + "ErrorCause": { + "description": "Empty string when no error.", "type": "string" + }, + "XappEventInstanceId": { + "type": "integer", + "maximum": 65535 } } }, - "ReportParams": { + "SubscriptionList": { + "description": "A list of subscriptions", + "type": "array", + "items": { + "$ref": "#/definitions/SubscriptionData" + } + }, + "SubscriptionParams": { "type": "object", "required": [ - "RequestorId", - "EventTriggers" + "ClientEndpoint", + "Meid", + "RANFunctionID", + "SubscriptionDetails" ], "properties": { - "EventTriggers": { - "$ref": "#/definitions/EventTriggerList" + "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 + } + } }, - "RequestorId": { - "type": "integer" + "Meid": { + "type": "string" + }, + "RANFunctionID": { + "type": "integer", + "maximum": 4095 + }, + "SubscriptionDetails": { + "$ref": "#/definitions/SubscriptionDetailsList" + }, + "SubscriptionId": { + "description": "Optional subscription ID (Submgr allocates if not given)", + "type": "string" } } }, - "SubscriptionResult": { - "description": "A list of unique IDs", + "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" - ] } } }`)) @@ -280,90 +441,57 @@ 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/control": { - "post": { - "consumes": [ - "application/json" - ], + "/config": { + "get": { "produces": [ - "application/json" + "application/json", + "application/xml" ], "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" - } - } + "xapp" ], + "summary": "Returns the configuration of all xapps", + "operationId": "getXappConfigList", "responses": { - "201": { - "description": "Subscription successfully created", + "200": { + "description": "successful query of xApp config", "schema": { - "$ref": "#/definitions/SubscriptionResult" + "$ref": "#/definitions/XappConfigList" } }, - "400": { - "description": "Invalid input" - }, "500": { "description": "Internal error" } } } }, - "/subscriptions/policy": { - "post": { - "consumes": [ - "application/json" - ], + "/subscriptions": { + "get": { "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" - } - } + "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/report": { + }, "post": { "consumes": [ "application/json" @@ -372,17 +500,17 @@ func init() { "application/json" ], "tags": [ - "report" + "common" ], - "summary": "Subscribe a list of X2AP event triggers to receive \"REPORT\" messages 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" } } ], @@ -390,7 +518,7 @@ func init() { "201": { "description": "Subscription successfully created", "schema": { - "$ref": "#/definitions/SubscriptionResult" + "$ref": "#/definitions/SubscriptionResponse" } }, "400": { @@ -404,6 +532,12 @@ func init() { }, "/subscriptions/{subscriptionId}": { "delete": { + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], "tags": [ "common" ], @@ -411,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 @@ -423,7 +557,7 @@ func init() { "description": "Operation done successfully" }, "400": { - "description": "Invalid requestorId supplied" + "description": "Invalid subscriptionId supplied" }, "500": { "description": "Internal error" @@ -433,89 +567,306 @@ 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" + "xappName": { + "description": "Name of the xApp", + "type": "string" + } + } + }, + "EventTriggerDefinition": { + "description": "E2SM byte array", + "type": "array", + "items": { + "type": "integer" + } + }, + "SubscriptionData": { + "type": "object", + "properties": { + "ClientEndpoint": { + "type": "array", + "items": { + "type": "string" + } }, - "PlmnId": { + "Meid": { "type": "string" }, - "ProcedureCode": { + "SubscriptionId": { "type": "integer" }, - "TypeOfMessage": { - "type": "integer" + "SubscriptionInstances": { + "type": "array", + "items": { + "$ref": "#/definitions/SubscriptionInstance" + } } } }, - "EventTriggerList": { + "SubscriptionDetail": { + "type": "object", + "required": [ + "XappEventInstanceId", + "EventTriggers", + "ActionToBeSetupList" + ], + "properties": { + "ActionToBeSetupList": { + "$ref": "#/definitions/ActionsToBeSetup" + }, + "EventTriggers": { + "$ref": "#/definitions/EventTriggerDefinition" + }, + "XappEventInstanceId": { + "type": "integer", + "maximum": 65535, + "minimum": 0 + } + } + }, + "SubscriptionDetailsList": { "type": "array", "items": { - "$ref": "#/definitions/EventTrigger" + "$ref": "#/definitions/SubscriptionDetail" } }, - "PolicyParams": { + "SubscriptionInstance": { "type": "object", + "required": [ + "XappEventInstanceId", + "E2EventInstanceId", + "ErrorCause" + ], "properties": { - "RequestorId": { - "type": "integer" + "E2EventInstanceId": { + "type": "integer", + "maximum": 65535, + "minimum": 0 }, - "TBD": { + "ErrorCause": { + "description": "Empty string when no error.", "type": "string" + }, + "XappEventInstanceId": { + "type": "integer", + "maximum": 65535, + "minimum": 0 } } }, - "ReportParams": { + "SubscriptionList": { + "description": "A list of subscriptions", + "type": "array", + "items": { + "$ref": "#/definitions/SubscriptionData" + } + }, + "SubscriptionParams": { "type": "object", "required": [ - "RequestorId", - "EventTriggers" + "ClientEndpoint", + "Meid", + "RANFunctionID", + "SubscriptionDetails" ], "properties": { - "EventTriggers": { - "$ref": "#/definitions/EventTriggerList" + "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 + } + } }, - "RequestorId": { - "type": "integer" + "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 } } }, - "SubscriptionResult": { - "description": "A list of unique IDs", + "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" - ] } } }`))