### visual studio ###
.vs
+**/.vscode
# OSx cruft
**/.DS_Store
* Add AC xapp controller
* Add RAN type radio selector to connection setup
* Update ANR xApp client to spec version 0.0.5
+* Update E2 manager client to spec version 20190515
* Add get-version methods to all controllers
* Add simple page footer with copyright and version
<groupId>org.o-ran-sc.ric.e2mgr.client</groupId>
<artifactId>e2-mgr-client</artifactId>
<name>RIC E2 Manager client</name>
- <version>02052019-SNAPSHOT</version>
+ <version>20190515-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<goal>generate</goal>
</goals>
<configuration>
- <inputSpec>${project.basedir}/src/main/resources/e2_manager_02052019_2.yaml</inputSpec>
+ <inputSpec>${project.basedir}/src/main/resources/e2_manager_2019-05-15.yaml</inputSpec>
<language>java</language>
<packageName>${client.base.package.name}</packageName>
<modelPackage>${client.base.package.name}.model</modelPackage>
+++ /dev/null
-# ========================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: This is a description of E2 manager service APIs
- version: 1.0.0
-servers:
- - url: http://{apiRoot}/nodeb/v1
- variables:
- apiRoot:
- default: localhost:3800
- description: >-
- E2 manager
-paths:
- /setup:
- post:
- summary: X2 Setup Request
- tags:
- - E2 Manager
- operationId: setup
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/SetupRequest'
- required: true
- responses:
- '200':
- description: Request was handled successfuly
- '400':
- description: Invalid input
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ErrorResponse'
- '404':
- description: Resource not found
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ErrorResponse'
- '500':
- description: Internal server error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ErrorResponse'
- default:
- description: Unexpected error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ErrorResponse'
-
- /endcSetup:
- post:
- tags:
- - E2 Manager
- summary: ENDC Setup Request
- operationId: endcSetup
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/SetupRequest'
- required: true
- responses:
- '200':
- description: Request was handled successfuly
- '400':
- description: Invalid input
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ErrorResponse'
- '404':
- description: Resource not found
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ErrorResponse'
- '500':
- description: Internal server error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ErrorResponse'
- default:
- description: Unexpected error
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ErrorResponse'
-
- /health:
- get:
- tags:
- - E2 Manager
- summary: E2 Manager Service Health Check
- operationId: healthCheck
- 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
openapi: 3.0.0
info:
title: E2 Manager Service
- description: This is a description of E2 manager service APIs
+ description: E2 Manager Service APIs
version: 1.0.0
servers:
- - url: http://{apiRoot}/nodeb/v1
+ - url: 'http://{apiRoot}/v1'
variables:
apiRoot:
- default: localhost:3800
- description: >-
- E2 manager
+ default: 'localhost:3800'
paths:
- /setup:
+ /nodeb/x2-setup:
post:
- summary: X2 Setup Request
+ summary: X2 Setup
tags:
- - X2 Setup Request
- operationId: setup
+ - nodeb
+ operationId: x2Setup
requestBody:
content:
application/json:
required: true
responses:
'200':
- description: Request was handled successfuly
+ description: Success
'400':
description: Invalid input
content:
- application/json:
- schema:
- $ref: '#/components/schemas/ErrorResponse'
- '404':
- description: Resource not found
- content:
- application/json:
+ application/problem+json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
- description: Internal server error
+ description: Internal error
content:
- application/json:
- schema:
- $ref: '#/components/schemas/ErrorResponse'
- default:
- description: Unexpected error
- content:
- application/json:
+ application/problem+json:
schema:
$ref: '#/components/schemas/ErrorResponse'
-
- /endcSetup:
+ /nodeb/endc-setup:
post:
tags:
- - ENDC Setup Request
- summary: ENDC Setup Request
+ - nodeb
+ summary: ENDC Setup
operationId: endcSetup
requestBody:
content:
required: true
responses:
'200':
- description: Request was handled successfuly
+ description: Success
'400':
description: Invalid input
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
- '404':
- description: Resource not found
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/ErrorResponse'
'500':
- description: Internal server error
+ description: Internal Error
content:
- application/json:
- schema:
- $ref: '#/components/schemas/ErrorResponse'
- default:
- description: Unexpected error
- content:
- application/json:
+ application/problem+json:
schema:
$ref: '#/components/schemas/ErrorResponse'
-
/health:
get:
tags:
- Health Check
summary: E2 Manager Service Health Check
- operationId: healthCheck
responses:
'200':
description: OK
properties:
errorCode:
type: string
- description: 401 - corrupted json, 402 - validation error, 501 - internal problem
+ description: '401 - corrupted json, 402 - validation error, 501 - internal problem'
errorMessage:
type: string
description: Human readable text
+++ /dev/null
-###
-# ========================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: "Draft API for RIC e2-manager"
- version: "0.0.1"
- title: "RIC e2-manager"
- license:
- name: "Apache 2.0"
- url: "http://www.apache.org/licenses/LICENSE-2.0.html"
-host: "localhost"
-basePath: "/e2/v1"
-schemes:
- - "http"
-paths:
- /e2/v1/health:
- get:
- summary: "Health check of E2 Manager"
- operationId: "getHealth"
- responses:
- 200:
- description: "Health is good"
- 500:
- description: "Health is poor"
- /e2/v1/setup:
- post:
- summary: "Set up connection to a RAN element"
- operationId: "setupRan"
- consumes:
- - "application/json"
- produces:
- - "application/json"
- parameters:
- - in: "body"
- name: "ranSetupRequest"
- description: "Setup request with host and port"
- required: true
- schema:
- $ref: "#/definitions/ranSetupRequest"
- responses:
- 200:
- description: "Setup successful"
- 400:
- description: "Invalid input"
-definitions:
- ranSetupRequest:
- type: "object"
- properties:
- ranIp:
- type: "string"
- description: "IPv4/IPv6 address"
- ranPort:
- type: "integer"
- format: "int32"
- example: 80
- ranName:
- type: "string"
- description: "eNodeB/gNodeB name"
package org.oransc.ric.portal.dashboard.e2mgr.client.test;
import org.junit.jupiter.api.Test;
-import org.oransc.ric.e2mgr.client.api.E2ManagerApi;
+import org.oransc.ric.e2mgr.client.api.HealthCheckApi;
import org.oransc.ric.e2mgr.client.invoker.ApiClient;
import org.springframework.web.client.RestClientException;
public void demo() {
ApiClient apiClient = new ApiClient();
apiClient.setBasePath("http://localhost:30099/");
- E2ManagerApi e2Api = new E2ManagerApi(apiClient);
+ HealthCheckApi healthApi = new HealthCheckApi(apiClient);
try {
- e2Api.healthCheck();
+ healthApi.healthGet();
System.out.println("getHealth answered: " + apiClient.getStatusCode().toString());
} catch (RestClientException e) {
System.err.println("getHealth failed: " + e.toString());
<dependency>
<groupId>org.o-ran-sc.ric.e2mgr.client</groupId>
<artifactId>e2-mgr-client</artifactId>
- <version>02052019-SNAPSHOT</version>
+ <version>20190515-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.o-ran-sc.ric.xappmgr.client</groupId>
import java.lang.invoke.MethodHandles;
-import org.oransc.ric.e2mgr.client.api.E2ManagerApi;
+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.slf4j.Logger;
import org.slf4j.LoggerFactory;
}
@Bean
- public E2ManagerApi e2ManagerApi() {
- return new E2ManagerApi(apiClient());
+ public HealthCheckApi e2HealthCheckApi() {
+ return new HealthCheckApi(apiClient());
+ }
+
+ @Bean
+ public NodebApi e2NodebApi() {
+ return new NodebApi(apiClient());
}
}
import java.lang.invoke.MethodHandles;
-import org.oransc.ric.e2mgr.client.api.E2ManagerApi;
+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.SetupRequest;
import org.slf4j.Logger;
}
@Bean
- public E2ManagerApi e2ManagerApi() {
+ public HealthCheckApi e2HealthCheckApi() {
ApiClient apiClient = apiClient();
- E2ManagerApi mockApi = mock(E2ManagerApi.class);
+ HealthCheckApi mockApi = mock(HealthCheckApi.class);
when(mockApi.getApiClient()).thenReturn(apiClient);
doAnswer(i -> {
return null;
- }).when(mockApi).healthCheck();
+ }).when(mockApi).healthGet();
+
+ return mockApi;
+ }
+
+ @Bean
+ public NodebApi e2NodebApi() {
+ ApiClient apiClient = apiClient();
+ NodebApi mockApi = mock(NodebApi.class);
+ when(mockApi.getApiClient()).thenReturn(apiClient);
doAnswer(i -> {
return null;
doAnswer(i -> {
return null;
- }).when(mockApi).setup(any(SetupRequest.class));
+ }).when(mockApi).x2Setup(any(SetupRequest.class));
return mockApi;
}
import javax.servlet.http.HttpServletResponse;
-import org.oransc.ric.e2mgr.client.api.E2ManagerApi;
+import org.oransc.ric.e2mgr.client.api.HealthCheckApi;
+import org.oransc.ric.e2mgr.client.api.NodebApi;
import org.oransc.ric.e2mgr.client.model.SetupRequest;
import org.oransc.ric.portal.dashboard.DashboardApplication;
import org.oransc.ric.portal.dashboard.DashboardConstants;
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
// Populated by the autowired constructor
- private final E2ManagerApi e2ManagerApi;
+ private final HealthCheckApi e2HealthCheckApi;
+ private final NodebApi e2NodebApi;
// Stores the requests and results.
// TODO remove when the E2 manager is extended.
private Set<E2SetupResponse> responses = new HashSet<>();
@Autowired
- public E2ManagerController(final E2ManagerApi e2ManagerApi) {
- Assert.notNull(e2ManagerApi, "API must not be null");
- this.e2ManagerApi = e2ManagerApi;
+ public E2ManagerController(final HealthCheckApi e2HealthCheckApi, final NodebApi e2NodebApi) {
+ Assert.notNull(e2HealthCheckApi, "API must not be null");
+ Assert.notNull(e2NodebApi, "API must not be null");
+ this.e2HealthCheckApi = e2HealthCheckApi;
+ this.e2NodebApi = e2NodebApi;
}
private void assertNotNull(Object o) {
@RequestMapping(value = DashboardConstants.VERSION_PATH, method = RequestMethod.GET)
public SuccessTransport getVersion() {
logger.debug("getVersion enter");
- return new SuccessTransport(200, DashboardApplication.getImplementationVersion(E2ManagerApi.class));
+ return new SuccessTransport(200, DashboardApplication.getImplementationVersion(HealthCheckApi.class));
}
@ApiOperation(value = "Gets the health from the E2 manager, expressed as the response code.")
@RequestMapping(value = "/health", method = RequestMethod.GET)
public void getHealth(HttpServletResponse response) {
logger.debug("getHealth");
- e2ManagerApi.healthCheck();
- response.setStatus(e2ManagerApi.getApiClient().getStatusCode().value());
+ e2HealthCheckApi.healthGet();
+ response.setStatus(e2HealthCheckApi.getApiClient().getStatusCode().value());
}
@ApiOperation(value = "Gets the unique requests submitted to the E2 manager.", response = E2SetupResponse.class, responseContainer = "List")
assertNotEmpty(setupRequest.getRanIp());
assertNotEmpty(setupRequest.getRanName());
assertNotNull(setupRequest.getRanPort());
- e2ManagerApi.endcSetup(setupRequest);
- responseCode = e2ManagerApi.getApiClient().getStatusCode().value();
+ e2NodebApi.endcSetup(setupRequest);
+ responseCode = e2NodebApi.getApiClient().getStatusCode().value();
} catch (Exception ex) {
logger.warn("endcSetup failed", ex);
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
assertNotEmpty(setupRequest.getRanIp());
assertNotEmpty(setupRequest.getRanName());
assertNotNull(setupRequest.getRanPort());
- e2ManagerApi.setup(setupRequest);
- responseCode = e2ManagerApi.getApiClient().getStatusCode().value();
+ e2NodebApi.x2Setup(setupRequest);
+ responseCode = e2NodebApi.getApiClient().getStatusCode().value();
} catch (Exception ex) {
logger.warn("x2Setup failed", ex);
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);