From 50aee48c8b79e3b43b3da0eb471d8db84a361fff Mon Sep 17 00:00:00 2001 From: "Lott, Christopher (cl778h)" Date: Tue, 11 Jun 2019 14:08:19 -0400 Subject: [PATCH] Upgrade E2 to API spec 20190611 This adds new endpoint getNb() but does not yet add a way to discover all connections and/or statuses. Change-Id: I355d1834394ea1533a8e8ccf14818e5426c37d50 Signed-off-by: Lott, Christopher (cl778h) --- docs/release-notes.rst | 7 +- e2-mgr-client/pom.xml | 4 +- .../main/resources/E2_Manager_API_2019-06-11.yaml | 750 +++++++++++++++++++++ .../src/main/resources/e2_manager_2019-05-15.yaml | 118 ---- webapp-backend/pom.xml | 2 +- .../config/E2ManagerMockConfiguration.java | 8 + .../dashboard/controller/E2ManagerController.java | 16 +- 7 files changed, 779 insertions(+), 126 deletions(-) create mode 100644 e2-mgr-client/src/main/resources/E2_Manager_API_2019-06-11.yaml delete mode 100644 e2-mgr-client/src/main/resources/e2_manager_2019-05-15.yaml diff --git a/docs/release-notes.rst b/docs/release-notes.rst index 0b76d824..6fa37592 100644 --- a/docs/release-notes.rst +++ b/docs/release-notes.rst @@ -20,14 +20,15 @@ RIC Dashboard Release Notes =========================== -Version 1.0.4, 4 June 2019 --------------------------- +Version 1.0.4, 11 June 2019 +--------------------------- * Add AC xApp neighbor control screen * Add ANR xApp neighbor cell relation table * Drop the pendulum xApp control screen -* Add column sorting on xApp catalog, xApp control, ANR +* Add column sorting on xApp catalog, xApp control, ANR * Add disconnect-all button to RAN connection screen * Update ANR xApp client to spec version 0.0.8 +* Update E2 manager client to spec version 20190611 Version 1.0.3, 28 May 2019 -------------------------- diff --git a/e2-mgr-client/pom.xml b/e2-mgr-client/pom.xml index 997c90bd..a3fd0f28 100644 --- a/e2-mgr-client/pom.xml +++ b/e2-mgr-client/pom.xml @@ -31,7 +31,7 @@ limitations under the License. org.o-ran-sc.ric.e2mgr.client e2-mgr-client RIC E2 Manager client - 20190515-SNAPSHOT + 20190611-SNAPSHOT UTF-8 UTF-8 @@ -104,7 +104,7 @@ limitations under the License. generate - ${project.basedir}/src/main/resources/e2_manager_2019-05-15.yaml + ${project.basedir}/src/main/resources/E2_Manager_API_2019-06-11.yaml java ${client.base.package.name} ${client.base.package.name}.model diff --git a/e2-mgr-client/src/main/resources/E2_Manager_API_2019-06-11.yaml b/e2-mgr-client/src/main/resources/E2_Manager_API_2019-06-11.yaml new file mode 100644 index 00000000..b6381eb7 --- /dev/null +++ b/e2-mgr-client/src/main/resources/E2_Manager_API_2019-06-11.yaml @@ -0,0 +1,750 @@ +# ========================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=================================== +openapi: 3.0.0 +info: + title: E2 Manager Service + description: E2 Manager Service APIs + version: 1.0.0 +servers: + - url: 'http://{apiRoot}/v1' + variables: + apiRoot: + default: 'localhost:3800' +paths: + /nodeb/x2-setup: + post: + summary: X2 Setup + tags: + - nodeb + operationId: x2Setup + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SetupRequest' + required: true + responses: + '200': + description: Success + '400': + description: Invalid input + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '500': + description: Internal error + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ErrorResponse' + /nodeb/endc-setup: + post: + tags: + - nodeb + summary: ENDC Setup + operationId: endcSetup + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SetupRequest' + required: true + responses: + '200': + description: Success + '400': + description: Invalid input + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '500': + description: Internal Error + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '/nodeb/{ranName}': + get: + tags: + - nodeb + summary: Get RAN by name + operationId: getNb + parameters: + - name: ranName + in: path + required: true + description: Name of RAN to return + schema: + type: string + responses: + '200': + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/GetNodebResponse' + '400': + description: The specified RAN name is invalid + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '404': + description: A RAN with the specified name was not found + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '500': + description: Internal Error + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ErrorResponse' + /health: + get: + tags: + - Health Check + summary: E2 Manager Service Health Check + responses: + '200': + description: OK +components: + schemas: + SetupRequest: + type: object + required: + - ranIp + - ranPort + - ranName + properties: + ranIp: + type: string + ranPort: + type: integer + format: uint16 + ranName: + type: string + GetNodebResponse: + properties: + connectionStatus: + oneOf: + - type: string + - type: integer + enb: + properties: + enbType: + oneOf: + - type: string + - type: integer + guGroupIds: + items: + type: string + type: array + servedCells: + items: + properties: + bandwidthReducedSi: + oneOf: + - type: string + - type: integer + broadcastPlmns: + items: + type: string + type: array + cellId: + type: string + choiceEutraMode: + properties: + fdd: + properties: + dlTransmissionBandwidth: + oneOf: + - type: string + - type: integer + dlearFcn: + type: integer + ulTransmissionBandwidth: + oneOf: + - type: string + - type: integer + ulearFcn: + type: integer + additionalProperties: false + type: object + tdd: + properties: + additionalSpecialSubframeExtensionInfo: + properties: + additionalSpecialSubframePatternsExtension: + oneOf: + - type: string + - type: integer + cyclicPrefixDl: + oneOf: + - type: string + - type: integer + cyclicPrefixUl: + oneOf: + - type: string + - type: integer + additionalProperties: false + type: object + additionalSpecialSubframeInfo: + properties: + additionalSpecialSubframePatterns: + oneOf: + - type: string + - type: integer + cyclicPrefixDl: + oneOf: + - type: string + - type: integer + cyclicPrefixUl: + oneOf: + - type: string + - type: integer + additionalProperties: false + type: object + earFcn: + type: integer + specialSubframeInfo: + properties: + cyclicPrefixDl: + oneOf: + - type: string + - type: integer + cyclicPrefixUl: + oneOf: + - type: string + - type: integer + specialSubframePatterns: + oneOf: + - type: string + - type: integer + additionalProperties: false + type: object + subframeAssignment: + oneOf: + - type: string + - type: integer + transmissionBandwidth: + oneOf: + - type: string + - type: integer + additionalProperties: false + type: object + additionalProperties: false + type: object + csgId: + type: string + eutraMode: + oneOf: + - type: string + - type: integer + freqBandIndicatorPriority: + oneOf: + - type: string + - type: integer + mbmsServiceAreaIdentities: + items: + type: string + type: array + mbsfnSubframeInfos: + items: + properties: + radioframeAllocationOffset: + type: integer + radioframeAllocationPeriod: + oneOf: + - type: string + - type: integer + subframeAllocation: + type: string + subframeAllocationType: + oneOf: + - type: string + - type: integer + additionalProperties: false + type: object + type: array + multibandInfos: + items: + type: integer + type: array + neighbourInfos: + items: + properties: + earFcn: + type: integer + ecgi: + type: string + pci: + type: integer + tac: + type: string + additionalProperties: false + type: object + type: array + numberOfAntennaPorts: + oneOf: + - type: string + - type: integer + pci: + type: integer + prachConfiguration: + properties: + highSpeedFlag: + type: boolean + prachConfigurationIndex: + type: integer + prachFrequencyOffset: + type: integer + rootSequenceIndex: + type: integer + zeroCorrelationZoneConfiguration: + type: integer + additionalProperties: false + type: object + tac: + type: string + additionalProperties: false + type: object + type: array + additionalProperties: false + type: object + failureType: + oneOf: + - type: string + - type: integer + gnb: + properties: + servedNrCells: + items: + properties: + nrNeighbourInfos: + items: + properties: + choiceNrMode: + properties: + fdd: + properties: + dlarFcnFreqInfo: + properties: + frequencyBands: + items: + properties: + nrFrequencyBand: + type: integer + supportedSulBands: + items: + type: integer + type: array + additionalProperties: false + type: object + type: array + nrArFcn: + oneOf: + - type: integer + sulInformation: + properties: + sulArFcn: + oneOf: + - type: integer + sulTransmissionBandwidth: + properties: + ncnrb: + oneOf: + - type: string + - type: integer + nrscs: + oneOf: + - type: string + - type: integer + additionalProperties: false + type: object + additionalProperties: false + type: object + additionalProperties: false + type: object + ularFcnFreqInfo: + properties: + frequencyBands: + items: + properties: + nrFrequencyBand: + type: integer + supportedSulBands: + items: + type: integer + type: array + additionalProperties: false + type: object + type: array + nrArFcn: + oneOf: + - type: integer + sulInformation: + properties: + sulArFcn: + oneOf: + - type: integer + sulTransmissionBandwidth: + properties: + ncnrb: + oneOf: + - type: string + - type: integer + nrscs: + oneOf: + - type: string + - type: integer + additionalProperties: false + type: object + additionalProperties: false + type: object + additionalProperties: false + type: object + additionalProperties: false + type: object + tdd: + properties: + arFcnNrFreqInfo: + properties: + frequencyBands: + items: + properties: + nrFrequencyBand: + type: integer + supportedSulBands: + items: + type: integer + type: array + additionalProperties: false + type: object + type: array + nrArFcn: + oneOf: + - type: integer + sulInformation: + properties: + sulArFcn: + oneOf: + - type: integer + sulTransmissionBandwidth: + properties: + ncnrb: + oneOf: + - type: string + - type: integer + nrscs: + oneOf: + - type: string + - type: integer + additionalProperties: false + type: object + additionalProperties: false + type: object + additionalProperties: false + type: object + additionalProperties: false + type: object + additionalProperties: false + type: object + configuredStac: + type: string + nrCgi: + type: string + nrMode: + oneOf: + - type: string + - type: integer + nrPci: + type: integer + stac5g: + type: string + additionalProperties: false + type: object + type: array + servedNrCellInformation: + properties: + cellId: + type: string + choiceNrMode: + properties: + fdd: + properties: + dlFreqInfo: + properties: + frequencyBands: + items: + properties: + nrFrequencyBand: + type: integer + supportedSulBands: + items: + type: integer + type: array + additionalProperties: false + type: object + type: array + nrArFcn: + oneOf: + - type: integer + sulInformation: + properties: + sulArFcn: + oneOf: + - type: integer + sulTransmissionBandwidth: + properties: + ncnrb: + oneOf: + - type: string + - type: integer + nrscs: + oneOf: + - type: string + - type: integer + additionalProperties: false + type: object + additionalProperties: false + type: object + additionalProperties: false + type: object + dlTransmissionBandwidth: + properties: + ncnrb: + oneOf: + - type: string + - type: integer + nrscs: + oneOf: + - type: string + - type: integer + additionalProperties: false + type: object + ulFreqInfo: + properties: + frequencyBands: + items: + properties: + nrFrequencyBand: + type: integer + supportedSulBands: + items: + type: integer + type: array + additionalProperties: false + type: object + type: array + nrArFcn: + oneOf: + - type: integer + sulInformation: + properties: + sulArFcn: + oneOf: + - type: integer + sulTransmissionBandwidth: + properties: + ncnrb: + oneOf: + - type: string + - type: integer + nrscs: + oneOf: + - type: string + - type: integer + additionalProperties: false + type: object + additionalProperties: false + type: object + additionalProperties: false + type: object + ulTransmissionBandwidth: + properties: + ncnrb: + oneOf: + - type: string + - type: integer + nrscs: + oneOf: + - type: string + - type: integer + additionalProperties: false + type: object + additionalProperties: false + type: object + tdd: + properties: + nrFreqInfo: + properties: + frequencyBands: + items: + properties: + nrFrequencyBand: + type: integer + supportedSulBands: + items: + type: integer + type: array + additionalProperties: false + type: object + type: array + nrArFcn: + oneOf: + - type: integer + sulInformation: + properties: + sulArFcn: + oneOf: + - type: integer + sulTransmissionBandwidth: + properties: + ncnrb: + oneOf: + - type: string + - type: integer + nrscs: + oneOf: + - type: string + - type: integer + additionalProperties: false + type: object + additionalProperties: false + type: object + additionalProperties: false + type: object + transmissionBandwidth: + properties: + ncnrb: + oneOf: + - type: string + - type: integer + nrscs: + oneOf: + - type: string + - type: integer + additionalProperties: false + type: object + additionalProperties: false + type: object + additionalProperties: false + type: object + configuredStac: + type: string + nrMode: + oneOf: + - type: string + - type: integer + nrPci: + type: integer + servedPlmns: + items: + type: string + type: array + stac5g: + type: string + additionalProperties: false + type: object + additionalProperties: false + type: object + type: array + additionalProperties: false + type: object + ip: + type: string + nodeType: + oneOf: + - type: string + - type: integer + port: + type: integer + ranName: + type: string + setupFailure: + properties: + criticalityDiagnostics: + properties: + informationElementCriticalityDiagnostics: + items: + properties: + ieCriticality: + oneOf: + - type: string + - type: integer + ieId: + type: integer + typeOfError: + oneOf: + - type: string + - type: integer + additionalProperties: false + type: object + type: array + procedureCode: + type: integer + procedureCriticality: + oneOf: + - type: string + - type: integer + triggeringMessage: + oneOf: + - type: string + - type: integer + additionalProperties: false + type: object + miscellaneousCause: + oneOf: + - type: string + - type: integer + networkLayerCause: + oneOf: + - type: string + - type: integer + protocolCause: + oneOf: + - type: string + - type: integer + timeToWait: + oneOf: + - type: string + - type: integer + transportLayerCause: + oneOf: + - type: string + - type: integer + additionalProperties: false + type: object + additionalProperties: false + type: object + ErrorResponse: + type: object + required: + - errorCode + - errorMessage + properties: + errorCode: + type: string + description: '401 - corrupted json, 402 - validation error, 501 - internal problem' + errorMessage: + type: string + description: Human readable text diff --git a/e2-mgr-client/src/main/resources/e2_manager_2019-05-15.yaml b/e2-mgr-client/src/main/resources/e2_manager_2019-05-15.yaml deleted file mode 100644 index 20c4ec9d..00000000 --- a/e2-mgr-client/src/main/resources/e2_manager_2019-05-15.yaml +++ /dev/null @@ -1,118 +0,0 @@ -# ========================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=================================== -openapi: 3.0.0 -info: - title: E2 Manager Service - description: E2 Manager Service APIs - version: 1.0.0 -servers: - - url: 'http://{apiRoot}/v1' - variables: - apiRoot: - default: 'localhost:3800' -paths: - /nodeb/x2-setup: - post: - summary: X2 Setup - tags: - - nodeb - operationId: x2Setup - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SetupRequest' - required: true - responses: - '200': - description: Success - '400': - description: Invalid input - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ErrorResponse' - '500': - description: Internal error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ErrorResponse' - /nodeb/endc-setup: - post: - tags: - - nodeb - summary: ENDC Setup - operationId: endcSetup - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SetupRequest' - required: true - responses: - '200': - description: Success - '400': - description: Invalid input - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - '500': - description: Internal Error - content: - application/problem+json: - schema: - $ref: '#/components/schemas/ErrorResponse' - /health: - get: - tags: - - Health Check - summary: E2 Manager Service Health Check - responses: - '200': - description: OK -components: - schemas: - SetupRequest: - type: object - required: - - ranIp - - ranPort - - ranName - properties: - ranIp: - type: string - ranPort: - type: integer - format: uint16 - ranName: - type: string - ErrorResponse: - type: object - required: - - errorCode - - errorMessage - properties: - errorCode: - type: string - description: '401 - corrupted json, 402 - validation error, 501 - internal problem' - errorMessage: - type: string - description: Human readable text diff --git a/webapp-backend/pom.xml b/webapp-backend/pom.xml index c9ebdaaf..37a85953 100644 --- a/webapp-backend/pom.xml +++ b/webapp-backend/pom.xml @@ -47,7 +47,7 @@ limitations under the License. org.o-ran-sc.ric.e2mgr.client e2-mgr-client - 20190515-SNAPSHOT + 20190611-SNAPSHOT org.o-ran-sc.ric.xappmgr.client diff --git a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/E2ManagerMockConfiguration.java b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/E2ManagerMockConfiguration.java index d6ff9b8e..b05d8174 100644 --- a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/E2ManagerMockConfiguration.java +++ b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/config/E2ManagerMockConfiguration.java @@ -29,6 +29,7 @@ import java.lang.invoke.MethodHandles; import org.oransc.ric.e2mgr.client.api.HealthCheckApi; import org.oransc.ric.e2mgr.client.api.NodebApi; import org.oransc.ric.e2mgr.client.invoker.ApiClient; +import org.oransc.ric.e2mgr.client.model.GetNodebResponse; import org.oransc.ric.e2mgr.client.model.SetupRequest; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -47,8 +48,11 @@ public class E2ManagerMockConfiguration { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + private final GetNodebResponse nodebResponse; + public E2ManagerMockConfiguration() { logger.info("Configuring mock E2 Manager"); + nodebResponse = new GetNodebResponse().ip("1.2.3.4").port(123).ranName("myRan"); } private ApiClient apiClient() { @@ -76,6 +80,10 @@ public class E2ManagerMockConfiguration { NodebApi mockApi = mock(NodebApi.class); when(mockApi.getApiClient()).thenReturn(apiClient); + doAnswer(i -> { + return nodebResponse; + }).when(mockApi).getNb(any(String.class)); + doAnswer(i -> { return null; }).when(mockApi).endcSetup(any(SetupRequest.class)); diff --git a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/E2ManagerController.java b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/E2ManagerController.java index 97604a4e..f4888fc7 100644 --- a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/E2ManagerController.java +++ b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/controller/E2ManagerController.java @@ -27,6 +27,7 @@ import javax.servlet.http.HttpServletResponse; import org.oransc.ric.e2mgr.client.api.HealthCheckApi; import org.oransc.ric.e2mgr.client.api.NodebApi; +import org.oransc.ric.e2mgr.client.model.GetNodebResponse; import org.oransc.ric.e2mgr.client.model.SetupRequest; import org.oransc.ric.portal.dashboard.DashboardApplication; import org.oransc.ric.portal.dashboard.DashboardConstants; @@ -40,6 +41,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Configuration; import org.springframework.http.MediaType; import org.springframework.util.Assert; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; @@ -51,8 +53,8 @@ import io.swagger.annotations.ApiOperation; * Provides methods to contact the E2 Manager. * * As of this writing the E2 interface only supports setup connection and check - * health actions; it does not support query or close operations on existing - * connections. So this class mocks up some of that functionality. + * health actions, and query by RAN name. But it does not support get-all, oo + * this class mocks up some of that functionality. */ @Configuration @RestController @@ -61,6 +63,9 @@ public class E2ManagerController { private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + // Path parameters + private static final String PP_RANNAME = "ranName"; + // Populated by the autowired constructor private final HealthCheckApi e2HealthCheckApi; private final NodebApi e2NodebApi; @@ -108,6 +113,13 @@ public class E2ManagerController { return responses; } + @ApiOperation(value = "Get RAN by name.", response = GetNodebResponse.class) + @RequestMapping(value = "/nodeb/{" + PP_RANNAME + "}", method = RequestMethod.GET) + public GetNodebResponse getNb(@PathVariable(PP_RANNAME) String ranName) { + logger.debug("getNb {}", ranName); + return e2NodebApi.getNb(ranName); + } + // TODO replace with actual delete all RAN connections functionality @ApiOperation(value = "Disconnect all RAN Connections.") @RequestMapping(value = "/disconnectAllRAN", method = RequestMethod.DELETE) -- 2.16.6