From f1b2fa6e4218b8ac188a66b113488dfc00cb1155 Mon Sep 17 00:00:00 2001 From: "Lott, Christopher (cl778h)" Date: Tue, 7 May 2019 13:01:33 -0400 Subject: [PATCH] Add ANR spec and client-code generator Upgrade xapp client spec to ver 0.1.1. Add mock xApp instances Drop unneeded javadoc plugin invocation from clients Change-Id: If2e5664efa3b43cd4aee34cc7a8d7014f9bd51f1 Issue-Id: RICPLT-1251 Signed-off-by: Lott, Christopher (cl778h) --- a1-med-client/pom.xml | 14 - anr-xapp-client/.gitignore | 4 + anr-xapp-client/README.md | 29 ++ anr-xapp-client/pom.xml | 192 ++++++++ .../src/main/resources/anr_swagger_0.0.3.yaml | 277 +++++++++++ .../anrxapp/client/test/AnrXappClientTest.java | 47 ++ docs/release-notes.rst | 1 + e2-mgr-client/pom.xml | 14 - pom.xml | 1 + webapp-backend/pom.xml | 7 +- .../config/XappManagerMockConfiguration.java | 17 +- xapp-mgr-client/pom.xml | 18 +- xapp-mgr-client/src/main/resources/.gitignore | 1 - .../resources/xapp_manager_rest_api_v0_1_1.yaml | 507 +++++++++++++++++++++ 14 files changed, 1079 insertions(+), 50 deletions(-) create mode 100644 anr-xapp-client/.gitignore create mode 100644 anr-xapp-client/README.md create mode 100644 anr-xapp-client/pom.xml create mode 100644 anr-xapp-client/src/main/resources/anr_swagger_0.0.3.yaml create mode 100644 anr-xapp-client/src/test/java/org/oransc/ric/portal/dashboard/anrxapp/client/test/AnrXappClientTest.java delete mode 100644 xapp-mgr-client/src/main/resources/.gitignore create mode 100644 xapp-mgr-client/src/main/resources/xapp_manager_rest_api_v0_1_1.yaml diff --git a/a1-med-client/pom.xml b/a1-med-client/pom.xml index a7a936ad..0709cc89 100644 --- a/a1-med-client/pom.xml +++ b/a1-med-client/pom.xml @@ -131,20 +131,6 @@ limitations under the License. 1.8 - - - org.apache.maven.plugins - maven-javadoc-plugin - - - - attach-javadocs - - jar - - - - org.apache.maven.plugins diff --git a/anr-xapp-client/.gitignore b/anr-xapp-client/.gitignore new file mode 100644 index 00000000..10d81e8c --- /dev/null +++ b/anr-xapp-client/.gitignore @@ -0,0 +1,4 @@ +/.classpath +/.project +/.settings/ +/target/ diff --git a/anr-xapp-client/README.md b/anr-xapp-client/README.md new file mode 100644 index 00000000..f3c0af2c --- /dev/null +++ b/anr-xapp-client/README.md @@ -0,0 +1,29 @@ +# ANR xApp Client Generator + +This projects generates a REST client library from the Swagger specification +file stored here and packages it in a jar. + +## Eclipse and STS Users + +The Swagger Codegen maven plugin is not supported in Eclipse/STS. You can +limp along by taking these steps: + +1. Generate the code using maven: + mvn install +2. Add this folder to the project build path: + target/generated-sources/swagger/src/main/java + +## License + +Copyright (C) 2019 AT&T Intellectual Property & Nokia. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/anr-xapp-client/pom.xml b/anr-xapp-client/pom.xml new file mode 100644 index 00000000..25608bd3 --- /dev/null +++ b/anr-xapp-client/pom.xml @@ -0,0 +1,192 @@ + + + + 4.0.0 + + org.o-ran-sc.portal.ric-dashboard + ric-dash-parent + 1.0.1-SNAPSHOT + + + org.o-ran-sc.ric.anrxapp.client + anr-xapp-client + RIC ANR xApp client + 0.0.3-SNAPSHOT + + UTF-8 + UTF-8 + + org.oransc.ric.anrxapp.client + + + + + io.swagger + swagger-annotations + 1.5.15 + + + org.springframework + spring-context + + + + org.springframework + spring-web + + + + + com.fasterxml.jackson.core + jackson-core + + + + com.fasterxml.jackson.core + jackson-annotations + + + + com.fasterxml.jackson.core + jackson-databind + + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + + + + org.junit.jupiter + junit-jupiter-api + + test + + + + + + + io.swagger + swagger-codegen-maven-plugin + 2.4.5 + + + + generate + + + ${project.basedir}/src/main/resources/anr_swagger_0.0.3.yaml + java + + ${project.groupId} + ${project.artifactId} + ${project.version} + www.O-RAN-SC.org + ANR xApp client library + resttemplate + true + java8 + Apache 2.0 + https://www.apache.org/licenses/LICENSE-2.0 + + ${client.base.package.name} + ${client.base.package.name}.model + ${client.base.package.name}.api + ${client.base.package.name}.invoker + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + 1.8 + 1.8 + + + + + org.apache.maven.plugins + maven-source-plugin + + + + attach-sources + + jar + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + + true + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + io.swagger + swagger-codegen-maven-plugin + [1.0,) + + generate + + + + + + + + + + + + + + diff --git a/anr-xapp-client/src/main/resources/anr_swagger_0.0.3.yaml b/anr-xapp-client/src/main/resources/anr_swagger_0.0.3.yaml new file mode 100644 index 00000000..9b0bbd70 --- /dev/null +++ b/anr-xapp-client/src/main/resources/anr_swagger_0.0.3.yaml @@ -0,0 +1,277 @@ +# ========================LICENSE_START================================= +# O-RAN-SC +# %% +# Copyright (C) 2019 AT&T Intellectual Property and Nokia +# %% +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ========================LICENSE_END=================================== +swagger : '2.0' +info : + description : REST API specification for RIC ANR closed xAPP + version : 0.0.3 + title : RIC ANR + license: + name : Nokia Closed App + url : 'http://www.nokia.com' +host : anr-service +basePath : /ric/v1 +schemes : + - http +paths : + /health/alive : + get : + summary : Health check of ANR - Liveness probe + tags : + - health + operationId : getHealthAlive + responses : + '200' : + description : Status of ANR xApp is ok + /health/ready : + get : + summary : Health check of ANR - Readiness probe + tags : + - health + operationId : getHealthReady + responses : + '200': + description : Status of ANR xApp is ok + /ncrt/cell : + parameters : + - $ref : '#/parameters/ggnbId' + - $ref : '#/parameters/startIndex' + - $ref : '#/parameters/limit' + get : + summary : Returns neighbor cell relation table for all gnodeBs or based on query string + tags : + - ncrt + operationId : getNcrtInfo + produces : + - application/json + responses : + '200' : + description : successful operation + schema : + $ref : '#/definitions/neighborCellRelationTable' + '400' : + description : Non-existant identifier {ggnbId | neighborCellIdentifier | start Index} in request + /ncrt/cell/{cellIdentifier} : + parameters : + - $ref : '#/parameters/cellIdentifier' + - $ref : '#/parameters/startIndex' + - $ref : '#/parameters/limit' + - $ref : '#/parameters/neighborCellIdentifierNrpci' + - $ref : '#/parameters/neighborCellIdentifierNrcgi' + get : + summary : Returns neighbor cell relation table for a Source Cell (NR CGI) and optionally a neighbor cell based on query string + tags : + - ncrt + operationId : getCellNcrtInfo + produces : + - application/json + responses : + '200' : + description : successful operation + schema : + $ref : '#/definitions/neighborCellRelationTable' + '400' : + description : Non-existant identifier {cellIdentifier | neighborCellIdentifierNrpci | neighborCellIdentifierNrcgi} in request + put : + summary : Modify neighbor cell relation based on Source Cell NR CGI and Target Cell NR PCI / NR CGI + tags : + - ncrt + operationId : modifyNCRT + consumes : + - application/json + produces : + - application/json + parameters : + - name : NCRTModificationParameters + in : body + description : Parameters to modify neighbor cell relation + required : true + schema : + $ref : '#/definitions/neighborCellRelationModTable' + responses : + '200' : + description : Successfully modified neighbor cell relation + '400' : + description : Modification failed. + { Identifier neighborCellIdentifierNrpci / neighborCellIdentifierNrcgi not provided | + Non-existant identifier {cellIdentifier | neighborCellIdentifierNrpci | neighborCellIdentifierNrcgi} in request | + Invalid data in body + } + delete : + summary : Delete neighbor cell relation based on Source Cell NR CGI and Target Cell NR PCI / NR CGI + tags : + - ncrt + operationId : deleteNcrt + parameters : + - name : NCRTDeletionParameters + in : body + description : Parameters to delete neighbor cell relation + required : true + schema : + $ref : '#/definitions/neighborCellRelationDelTable' + responses : + '204' : + description : Successfully deleted neighbor cell relation + '400' : + description : Deletion failed. + { Identifier neighborCellIdentifierNrpci / neighborCellIdentifierNrcgi not provided | + Non-existant identifier {cellIdentifier | neighborCellIdentifierNrpci | neighborCellIdentifierNrcgi} in request + } +parameters : + ggnbId : + type : string + name : ggnbId + description : Global gNodeB Identifier + in : query + startIndex : + type : string + name : startIndex + description : Pagination Index + in : query + limit : + type : integer + name : limit + description : Limit of results that client can handle + in : query + cellIdentifier : + type : string + name : cellIdentifier + description : Source Cell Identifier (NR CGI) + in : path + required : true + neighborCellIdentifierNrpci : + type : string + name : neighborCellIdentifierNrpci + description : Neighbor Cell Identifier (NR PCI) + in : query + neighborCellIdentifierNrcgi : + type : string + name : neighborCellIdentifierNrcgi + description : Neigbhor Cell Identifier (NR CGI) + in : query +definitions : + neighborCellRelationTable : + type : object + properties : + ncrtRelations : + type : array + items : + $ref : '#/definitions/neighborCellRelation' + startIndex : + type : string + description : Index to use in REST API to process multipage results + example : 1245A:6740B + neighborCellRelationModTable : + type : array + items : + $ref : '#/definitions/neighborCellRelationMod' + neighborCellRelationDelTable : + type : array + items : + $ref : '#/definitions/neighborCellRelationDel' + neighborCellRelation : + type : object + required : + - cellIdentifierNrcgi + - neighborCellIdentifierNrpci + - neighborCellIdentifierNrcgi + - flagNoHo + - flagNoXn + - flagNoRemove + properties : + cellIdentifierNrcgi : + type : string + description : Source / Serving Cell Identifier (NR CGI) + example : E12345 + neighborCellIdentifierNrpci : + type : string + description : Neighbor Cell Identifier (NR PCI) + example : E12345 + neighborCellIdentifierNrcgi : + type : string + description : Neighbor Cell Identifier (NR CGI) + example : E12345 + flagNoHo : + type : boolean + description : Flag for HANDOVER NOT ALLOWED + example : True + flagNoXn : + type : boolean + description : Flag for Xn CONNECTION NOT ALLOWED + example : True + flagNoRemove : + type : boolean + description : Flag for DELETION NOT ALLOWED + example : True + neighborCellRelationMod : + type : object + required : + - neighbourCellIdentifierType + - action + properties : + neighbourCellIdentifierType : + type : string + description : Neighbor Cell Identifier Type + enum : + - nrpci + - nrcgi + action : + type : string + description : Modification action to be performed + enum : + - nrpciToNrcgiMapping + - flagUpdates + - nrcgiMappingAndFlagUpdates + neighborCellIdentifierNrpci : + type : string + description : Neighbor Cell Identifier (NR PCI) + example : E12345 + neighborCellIdentifierNrcgi : + type : string + description : Neighbor Cell Identifier (NR CGI) + example : E12345 + flagNoHo : + type : boolean + description : Flag for HANDOVER NOT ALLOWED + example : True + flagNoXn : + type : boolean + description : Flag for Xn CONNECTION NOT ALLOWED + example : True + flagNoRemove : + type : boolean + description : Flag for DELETION NOT ALLOWED + example : True + neighborCellRelationDel : + type : object + required : + - idType + properties : + idType : + type : string + description : Modification action to be performed + enum : + - nrpci + - nrcgi + neighborCellIdentifierNrpci : + type : string + description : Neighbor Cell Identifier (NR PCI) + example : E12345 + neighborCellIdentifierNrcgi : + type : string + description : Neighbor Cell Identifier (NR PCI) + example : E12345 diff --git a/anr-xapp-client/src/test/java/org/oransc/ric/portal/dashboard/anrxapp/client/test/AnrXappClientTest.java b/anr-xapp-client/src/test/java/org/oransc/ric/portal/dashboard/anrxapp/client/test/AnrXappClientTest.java new file mode 100644 index 00000000..eee796e9 --- /dev/null +++ b/anr-xapp-client/src/test/java/org/oransc/ric/portal/dashboard/anrxapp/client/test/AnrXappClientTest.java @@ -0,0 +1,47 @@ +/*- + * ========================LICENSE_START================================= + * O-RAN-SC + * %% + * Copyright (C) 2019 AT&T Intellectual Property and Nokia + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================LICENSE_END=================================== + */ +package org.oransc.ric.portal.dashboard.anrxapp.client.test; + +import org.junit.jupiter.api.Test; +import org.oransc.ric.anrxapp.client.api.HealthApi; +import org.oransc.ric.anrxapp.client.invoker.ApiClient; +import org.springframework.web.client.RestClientException; + +/** + * Demonstrates use of the generated ANR xApp client. + * + * The test fails because no server is available. + */ +public class AnrXappClientTest { + + @Test + public void demo() { + ApiClient apiClient = new ApiClient(); + apiClient.setBasePath("http://localhost:30099/"); + HealthApi healthApi = new HealthApi(apiClient); + try { + healthApi.getHealthAlive(); + System.out.println("getHealthAlive answered: " + apiClient.getStatusCode().toString()); + } catch (RestClientException e) { + System.err.println("getHealthAlive failed: " + e.toString()); + } + } + +} diff --git a/docs/release-notes.rst b/docs/release-notes.rst index 7ae55e5e..f36b11d3 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -25,6 +25,7 @@ Version 1.0.1, 6 May 2019 * Add draft A1 Mediator API definition * Use E2 Manager API definition dated 2 May 2019, with tag modifications * Adjust group IDs and packages for name O-RAN-SC; drop ORAN-OSC +* Add ANR API spec and client code generator Version 1.0.0, 30 Apr 2019 -------------------------- diff --git a/e2-mgr-client/pom.xml b/e2-mgr-client/pom.xml index e558cc8d..eaf961c3 100644 --- a/e2-mgr-client/pom.xml +++ b/e2-mgr-client/pom.xml @@ -131,20 +131,6 @@ limitations under the License. 1.8 - - - org.apache.maven.plugins - maven-javadoc-plugin - - - - attach-javadocs - - jar - - - - org.apache.maven.plugins diff --git a/pom.xml b/pom.xml index 2d24455c..d4dc5a09 100644 --- a/pom.xml +++ b/pom.xml @@ -44,6 +44,7 @@ limitations under the License. a1-med-client + anr-xapp-client e2-mgr-client xapp-mgr-client webapp-frontend diff --git a/webapp-backend/pom.xml b/webapp-backend/pom.xml index fb4406f9..df8f18c8 100644 --- a/webapp-backend/pom.xml +++ b/webapp-backend/pom.xml @@ -39,6 +39,11 @@ limitations under the License. a1-med-client 0.3.0-SNAPSHOT + + org.o-ran-sc.ric.anrxapp.client + anr-xapp-client + 0.0.3-SNAPSHOT + org.o-ran-sc.ric.e2mgr.client e2-mgr-client @@ -47,7 +52,7 @@ limitations under the License. org.o-ran-sc.ric.xappmgr.client xapp-mgr-client - 0.0.10-SNAPSHOT + 0.1.1-SNAPSHOT org.springframework.boot diff --git a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/XappManagerMockConfiguration.java b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/XappManagerMockConfiguration.java index 8f6cf6fc..bbc1160c 100644 --- a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/XappManagerMockConfiguration.java +++ b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/XappManagerMockConfiguration.java @@ -34,6 +34,7 @@ import org.oransc.ric.xappmgr.client.model.SubscriptionResponse; import org.oransc.ric.xappmgr.client.model.XAppInfo; import org.oransc.ric.xappmgr.client.model.Xapp; import org.oransc.ric.xappmgr.client.model.Xapp.StatusEnum; +import org.oransc.ric.xappmgr.client.model.XappInstance; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.annotation.Bean; @@ -55,11 +56,19 @@ public class XappManagerMockConfiguration { public XappManagerMockConfiguration() { logger.info("Configuring mock xApp Manager"); + Xapp ac = new Xapp().name("Admission Control").version("v3").status(StatusEnum.FAILED); + ac.addInstancesItem(new XappInstance().name("cdef-3456").ip("3.4.5.6").port(200).status(XappInstance.StatusEnum.RUNNING)); + Xapp an = new Xapp().name("ANR Control").version("v0").status(StatusEnum.SUPERSEDED); + an.addInstancesItem(new XappInstance().name("fedc-8765").ip("8.7.6.5").port(400).status(XappInstance.StatusEnum.RUNNING)); + Xapp dc = new Xapp().name("Dual Connectivity").version("v2").status(StatusEnum.DELETED); + dc.addInstancesItem(new XappInstance().name("def0-6789").ip("6.7.8.9").port(300).status(XappInstance.StatusEnum.COMPLETED)); + Xapp pc = new Xapp().name("Pendulum Control").version("v1").status(StatusEnum.DEPLOYED); + pc.addInstancesItem(new XappInstance().name("abcd-1234").ip("1.2.3.4").port(100).status(XappInstance.StatusEnum.RUNNING)); allXapps = new AllXapps(); - allXapps.add(new Xapp().name("Pendulum Control").version("v1").status(StatusEnum.DEPLOYED)); - allXapps.add(new Xapp().name("Dual Connectivity").version("v2").status(StatusEnum.DELETED)); - allXapps.add(new Xapp().name("Admission Control").version("v3").status(StatusEnum.FAILED)); - allXapps.add(new Xapp().name("ANR Control").version("v0").status(StatusEnum.SUPERSEDED)); + allXapps.add(ac); + allXapps.add(an); + allXapps.add(dc); + allXapps.add(pc); } @Bean diff --git a/xapp-mgr-client/pom.xml b/xapp-mgr-client/pom.xml index 6e27cbec..06afbbef 100644 --- a/xapp-mgr-client/pom.xml +++ b/xapp-mgr-client/pom.xml @@ -31,7 +31,7 @@ limitations under the License. org.o-ran-sc.ric.xappmgr.client xapp-mgr-client RIC xApp Manager client - 0.0.10-SNAPSHOT + 0.1.1-SNAPSHOT UTF-8 UTF-8 @@ -101,7 +101,7 @@ limitations under the License. generate - ${project.basedir}/src/main/resources/xapp_manager_rest_api_v0_0_10.json + ${project.basedir}/src/main/resources/xapp_manager_rest_api_v0_1_1.yaml java ${project.groupId} @@ -133,20 +133,6 @@ limitations under the License. 1.8 - - - org.apache.maven.plugins - maven-javadoc-plugin - - - - attach-javadocs - - jar - - - - org.apache.maven.plugins diff --git a/xapp-mgr-client/src/main/resources/.gitignore b/xapp-mgr-client/src/main/resources/.gitignore deleted file mode 100644 index de73726a..00000000 --- a/xapp-mgr-client/src/main/resources/.gitignore +++ /dev/null @@ -1 +0,0 @@ -xapp_manager_rest_api_v0_0_10.yaml diff --git a/xapp-mgr-client/src/main/resources/xapp_manager_rest_api_v0_1_1.yaml b/xapp-mgr-client/src/main/resources/xapp_manager_rest_api_v0_1_1.yaml new file mode 100644 index 00000000..140b2a2e --- /dev/null +++ b/xapp-mgr-client/src/main/resources/xapp_manager_rest_api_v0_1_1.yaml @@ -0,0 +1,507 @@ +# ========================LICENSE_START================================= +# O-RAN-SC +# %% +# Copyright (C) 2019 AT&T Intellectual Property and Nokia +# %% +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ========================LICENSE_END=================================== +swagger: '2.0' +info: + description: This is a draft API for RIC appmgr + version: 0.1.1 + title: RIC appmgr + license: + name: Apache 2.0 + url: 'http://www.apache.org/licenses/LICENSE-2.0.html' +host: hostname +basePath: /ric/v1 +schemes: + - https + - http +paths: + /health: + get: + summary: Health check of xApp Manager + operationId: getHealth + responses: + '200': + description: Status of xApp Manager is ok + /xapps: + post: + summary: Deploy a xapp + operationId: deployXapp + consumes: + - application/json + produces: + - application/json + parameters: + - name: xAppInfo + in: body + description: xApp information + schema: + type: object + required: + - xAppName + properties: + xAppName: + type: string + description: Name of the xApp + example: xapp-dummy + responses: + '201': + description: xApp successfully created + schema: + $ref: '#/definitions/Xapp' + '400': + description: Invalid input + '500': + description: Internal error + get: + summary: Returns the status of all xapps + operationId: getAllXapps + produces: + - application/json + responses: + '200': + description: successful query of xApps + schema: + $ref: '#/definitions/AllXapps' + '500': + description: Internal error + '/xapps/{xAppName}': + get: + summary: Returns the status of a given xapp + operationId: getXappByName + produces: + - application/json + parameters: + - name: xAppName + in: path + description: Name of xApp + required: true + type: string + responses: + '200': + description: successful operation + schema: + $ref: '#/definitions/Xapp' + '400': + description: Invalid ID supplied + '404': + description: Xapp not found + '500': + description: Internal error + delete: + summary: Undeploy an existing xapp + operationId: undeployXapp + parameters: + - name: xAppName + in: path + description: Xapp to be undeployed + required: true + type: string + responses: + '204': + description: Successful deletion of xApp + '400': + description: Invalid xApp name supplied + '500': + description: Internal error + '/xapps/{xAppName}/instances/{xAppInstanceName}': + get: + summary: Returns the status of a given xapp + operationId: getXappInstanceByName + produces: + - application/json + parameters: + - name: xAppName + in: path + description: Name of xApp + required: true + type: string + - name: xAppInstanceName + in: path + description: Name of xApp instance to get information + required: true + type: string + responses: + '200': + description: successful operation + schema: + $ref: '#/definitions/XappInstance' + '400': + description: Invalid name supplied + '404': + description: Xapp not found + '500': + description: Internal error + /config: + post: + summary: Create xApp config + operationId: createXappConfig + consumes: + - application/json + produces: + - application/json + parameters: + - name: xAppConfig + in: body + description: xApp config + schema: + $ref: '#/definitions/xAppConfig' + responses: + '201': + description: xApp config successfully created + schema: + $ref: '#/definitions/xAppConfig' + '400': + description: Invalid input + '500': + description: Internal error + put: + summary: Modify xApp config + operationId: ModifyXappConfig + consumes: + - application/json + produces: + - application/json + parameters: + - name: xAppConfig + in: body + description: xApp config + schema: + $ref: '#/definitions/xAppConfig' + responses: + '200': + description: xApp config successfully modified + schema: + $ref: '#/definitions/xAppConfig' + '400': + description: Invalid input + '500': + description: Internal error + get: + summary: Returns the configuration of all xapps + operationId: getAllXappConfig + produces: + - application/json + responses: + '200': + description: successful query of xApp config + schema: + $ref: '#/definitions/AllXappConfig' + '500': + description: Internal error + delete: + summary: Delete xApp configuration + operationId: deleteXappConfig + parameters: + - name: xAppConfigInfo + in: body + description: xApp configuration information + schema: + $ref: '#/definitions/xAppConfigInfo' + responses: + '204': + description: Successful deletion of xApp + '400': + description: Invalid parameters supplied + '500': + description: Internal error + /subscriptions: + post: + summary: Subscribe event + operationId: addSubscription + consumes: + - application/json + produces: + - application/json + parameters: + - name: subscriptionRequest + in: body + description: New subscription + required: true + schema: + $ref: '#/definitions/subscriptionRequest' + responses: + '200': + description: Subscription successful + schema: + $ref: '#/definitions/subscriptionResponse' + '400': + description: Invalid input + get: + summary: Returns all subscriptions + operationId: getSubscriptions + produces: + - application/json + responses: + '200': + description: successful query of subscriptions + schema: + $ref: '#/definitions/allSubscriptions' + '/subscriptions/{subscriptionId}': + get: + summary: Returns the information of subscription + operationId: getSubscriptionById + produces: + - application/json + parameters: + - name: subscriptionId + in: path + description: ID of subscription + required: true + type: integer + responses: + '200': + description: successful operation + schema: + $ref: '#/definitions/subscription' + '400': + description: Invalid ID supplied + '404': + description: Subscription not found + put: + summary: Modify event subscription + operationId: modifySubscription + consumes: + - application/json + produces: + - application/json + parameters: + - name: subscriptionId + in: path + description: ID of subscription + required: true + type: integer + - in: body + name: subscriptionRequest + description: Modified subscription + required: true + schema: + $ref: '#/definitions/subscriptionRequest' + responses: + '200': + description: Subscription modification successful + schema: + $ref: '#/definitions/subscriptionResponse' + '400': + description: Invalid input + delete: + summary: Unsubscribe event + description: '' + operationId: deleteSubscription + parameters: + - name: subscriptionId + in: path + description: ID of subscription + required: true + type: integer + responses: + '204': + description: Successful deletion of subscription + '400': + description: Invalid subscription supplied +definitions: + AllXapps: + type: array + items: + $ref: '#/definitions/Xapp' + Xapp: + type: object + required: + - name + properties: + name: + type: string + example: xapp-dummy + status: + type: string + description: xapp status in the RIC + enum: + - unknown + - deployed + - deleted + - superseded + - failed + - deleting + version: + type: string + example: 1.2.3 + instances: + type: array + items: + $ref: '#/definitions/XappInstance' + XappInstance: + type: object + required: + - name + properties: + name: + type: string + example: xapp-dummy-6cd577d9-4v255 + status: + type: string + description: xapp instance status + enum: + - pending + - running + - succeeded + - failed + - unknown + - completed + - crashLoopBackOff + ip: + type: string + example: 192.168.0.1 + port: + type: integer + example: 32300 + txMessages: + type: array + items: + type: string + example: ControlIndication + rxMessages: + type: array + items: + type: string + example: LoadIndication + xAppConfigInfo: + type: object + required: + - xAppName + - configMapName + - namespace + properties: + xAppName: + type: string + description: Name of the xApp + example: xapp-dummy + configMapName: + type: string + description: Name of the config map + example: xapp-dummy-config-map + namespace: + type: string + description: Name of the namespace + example: ricxapp + xAppConfig: + type: object + required: + - xAppConfigInfo + - configSchema + - configMap + properties: + xAppConfigInfo: + $ref: '#/definitions/xAppConfigInfo' + configSchema: + type: object + description: Schema of configuration in JSON format + configMap: + type: object + description: Configuration in JSON format + AllXappConfig: + type: array + items: + $ref: '#/definitions/xAppConfig' + subscriptionRequest: + type: object + required: + - targetUrl + - eventType + - maxRetries + - retryTimer + properties: + targetUrl: + type: string + example: 'http://localhost:11111/apps/webhook/' + eventType: + type: string + description: Event which is subscribed + enum: + - created + - deleted + - all + maxRetries: + type: integer + description: Maximum number of retries + example: 11 + retryTimer: + type: integer + description: Time in seconds to wait before next retry + example: 22 + subscriptionResponse: + type: object + properties: + id: + type: string + example: 1ILBltYYzEGzWRrVPZKmuUmhwcc + version: + type: integer + example: 2 + eventType: + type: string + description: Event which is subscribed + enum: + - created + - deleted + - updated + - all + allSubscriptions: + type: array + items: + $ref: '#/definitions/subscription' + subscription: + type: object + properties: + id: + type: string + example: 1ILBltYYzEGzWRrVPZKmuUmhwcc + targetUrl: + type: string + example: 'http://localhost:11111/apps/webhook/' + eventType: + type: string + description: Event which is subscribed + enum: + - created + - deleted + - updated + - all + maxRetries: + type: integer + description: Maximum number of retries + example: 11 + retryTimer: + type: integer + description: Time in seconds to wait before next retry + example: 22 + subscriptionNotification: + type: object + properties: + id: + type: string + example: 1ILBltYYzEGzWRrVPZKmuUmhwcc + version: + type: integer + example: 2 + eventType: + type: string + description: Event to be notified + enum: + - created + - deleted + - updated + xApps: + $ref: '#/definitions/AllXapps' -- 2.16.6