<parent>
<groupId>org.o-ran-sc.portal.ric-dashboard</groupId>
<artifactId>ric-dash-parent</artifactId>
- <version>1.0.1-SNAPSHOT</version>
+ <version>1.0.2-SNAPSHOT</version>
</parent>
<!-- This groupId will NOT allow deployment in LF -->
<groupId>org.o-ran-sc.ric.a1med.client</groupId>
<parent>
<groupId>org.o-ran-sc.portal.ric-dashboard</groupId>
<artifactId>ric-dash-parent</artifactId>
- <version>1.0.1-SNAPSHOT</version>
+ <version>1.0.2-SNAPSHOT</version>
</parent>
<!-- This groupId will NOT allow deployment in LF -->
<groupId>org.o-ran-sc.ric.anrxapp.client</groupId>
RIC Dashboard Release Notes
===========================
-Version 1.0.1, 9 May 2019
+Version 1.0.2, 9 May 2019
+-------------------------
+* Add E2 response message with timestamp and status code
+
+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
<parent>
<groupId>org.o-ran-sc.portal.ric-dashboard</groupId>
<artifactId>ric-dash-parent</artifactId>
- <version>1.0.1-SNAPSHOT</version>
+ <version>1.0.2-SNAPSHOT</version>
</parent>
<!-- This groupId will NOT allow deployment in LF -->
<groupId>org.o-ran-sc.ric.e2mgr.client</groupId>
<artifactId>ric-dash-parent</artifactId>
<name>RIC Dashboard project</name>
<packaging>pom</packaging>
- <version>1.0.1-SNAPSHOT</version>
+ <version>1.0.2-SNAPSHOT</version>
<!-- Properties for the license-maven-plugin in child POMs -->
<properties>
<lmp.organization.name>AT&T Intellectual Property and Nokia</lmp.organization.name>
<parent>
<groupId>org.o-ran-sc.portal.ric-dashboard</groupId>
<artifactId>ric-dash-parent</artifactId>
- <version>1.0.1-SNAPSHOT</version>
+ <version>1.0.2-SNAPSHOT</version>
</parent>
<artifactId>ric-dash-be</artifactId>
<name>RIC Dashboard Webapp backend</name>
import org.springframework.web.client.RestTemplate;
/**
- * Creates an A1 mediator client as a bean to be managed by the Spring container.
+ * Creates an A1 mediator client as a bean to be managed by the Spring
+ * container.
*/
@Configuration
@Profile("!mock")
import org.springframework.http.HttpStatus;
/**
- * Creates a mock implementation of the E2 manager client API.
+ * Creates a mock implementation of the E2 manager client API. This version
+ * answers only status codes, no data, so the mock implementations are trivial.
*/
@Profile("mock")
@Configuration
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));
+ 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));
+ 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));
+ 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));
+ pc.addInstancesItem(
+ new XappInstance().name("abcd-1234").ip("1.2.3.4").port(100).status(XappInstance.StatusEnum.RUNNING));
allXapps = new AllXapps();
allXapps.add(ac);
allXapps.add(an);
import org.oransc.ric.e2mgr.client.api.E2ManagerApi;
import org.oransc.ric.e2mgr.client.model.SetupRequest;
import org.oransc.ric.portal.dashboard.DashboardConstants;
+import org.oransc.ric.portal.dashboard.model.E2SetupRequestType;
+import org.oransc.ric.portal.dashboard.model.E2SetupResponse;
+import org.oransc.ric.portal.dashboard.model.IDashboardResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
*
* 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 needed functionality.
+ * connections. So this class mocks up some of that functionality.
*/
@Configuration
@RestController
// Populated by the autowired constructor
private final E2ManagerApi e2ManagerApi;
- // Tracks the requests previously submitted.
+ // Stores the requests and results.
// TODO remove when the E2 manager is extended.
- private Set<SetupRequest> requests = new HashSet<>();
+ private Set<E2SetupResponse> responses = new HashSet<>();
@Autowired
public E2ManagerController(final E2ManagerApi e2ManagerApi) {
response.setStatus(e2ManagerApi.getApiClient().getStatusCode().value());
}
- @ApiOperation(value = "Gets the unique requests submitted to the E2 manager.", response = SetupRequest.class, responseContainer = "List")
+ @ApiOperation(value = "Gets the unique requests submitted to the E2 manager.", response = E2SetupResponse.class, responseContainer = "List")
@RequestMapping(value = "/setup", method = RequestMethod.GET)
- public Iterable<SetupRequest> getRequests() {
+ public Iterable<E2SetupResponse> getRequests() {
logger.debug("getRequests");
- return requests;
+ return responses;
}
- @ApiOperation(value = "Sets up a RAN connection via the E2 manager.")
- @RequestMapping(value = "/setup", method = RequestMethod.POST)
- public void setup(@RequestBody SetupRequest setupRequest, HttpServletResponse response) {
- logger.debug("setup {}", setupRequest);
+ @ApiOperation(value = "Sets up an EN-DC RAN connection via the E2 manager.", response = E2SetupResponse.class)
+ @RequestMapping(value = "/endcSetup", method = RequestMethod.POST)
+ public E2SetupResponse endcSetup(@RequestBody SetupRequest setupRequest, HttpServletResponse response) {
+ logger.debug("endcSetup {}", setupRequest);
+ int responseCode = -1;
try {
assertNotEmpty(setupRequest.getRanIp());
assertNotEmpty(setupRequest.getRanName());
assertNotNull(setupRequest.getRanPort());
+ e2ManagerApi.endcSetup(setupRequest);
+ responseCode = e2ManagerApi.getApiClient().getStatusCode().value();
} catch (Exception ex) {
- logger.error("Bad request", ex);
+ logger.warn("endcSetup failed", ex);
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+ responseCode = HttpServletResponse.SC_BAD_REQUEST;
}
+ E2SetupResponse r = new E2SetupResponse(E2SetupRequestType.ENDC, setupRequest, responseCode);
+ responses.add(r);
+ return r;
+ }
+
+ @ApiOperation(value = "Sets up an X2 RAN connection via the E2 manager.", response = E2SetupResponse.class)
+ @RequestMapping(value = "/x2Setup", method = RequestMethod.POST)
+ public IDashboardResponse x2Setup(@RequestBody SetupRequest setupRequest, HttpServletResponse response) {
+ logger.debug("x2Setup {}", setupRequest);
+ int responseCode = -1;
try {
- requests.add(setupRequest);
+ assertNotEmpty(setupRequest.getRanIp());
+ assertNotEmpty(setupRequest.getRanName());
+ assertNotNull(setupRequest.getRanPort());
e2ManagerApi.setup(setupRequest);
+ responseCode = e2ManagerApi.getApiClient().getStatusCode().value();
} catch (Exception ex) {
- logger.error("Failed", ex);
- response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ logger.warn("x2Setup failed", ex);
+ response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+ responseCode = HttpServletResponse.SC_BAD_REQUEST;
}
+ E2SetupResponse r = new E2SetupResponse(E2SetupRequestType.X2, setupRequest, responseCode);
+ responses.add(r);
+ return r;
}
}
--- /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===================================
+ */
+
+package org.oransc.ric.portal.dashboard.model;
+
+public enum E2SetupRequestType {
+ ENDC, X2;
+}
--- /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===================================
+ */
+package org.oransc.ric.portal.dashboard.model;
+
+import java.time.Instant;
+
+import org.oransc.ric.e2mgr.client.model.SetupRequest;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * Response to an E2 Manager setupRequest message carries the original
+ * information plus request type, timestamp and HTTP response code.
+ */
+public class E2SetupResponse extends SetupRequest implements IDashboardResponse {
+
+ public E2SetupResponse() {
+ }
+
+ public E2SetupResponse(E2SetupRequestType type, SetupRequest request, int responseCode) {
+ super.ranName(request.getRanName()).ranIp(request.getRanIp()).ranPort(request.getRanPort());
+ this.requestType = type;
+ this.timeStamp = Instant.now();
+ this.responseCode = responseCode;
+ }
+
+ @JsonProperty("requestType")
+ private E2SetupRequestType requestType = null;
+
+ public SetupRequest requestType(E2SetupRequestType type) {
+ this.requestType = type;
+ return this;
+ }
+
+ /**
+ * Get requestType
+ *
+ * @return requestType
+ **/
+ public E2SetupRequestType getRequestType() {
+ return requestType;
+ }
+
+ public void setRequestType(E2SetupRequestType type) {
+ this.requestType = type;
+ }
+
+ @JsonProperty("timeStamp")
+ private Instant timeStamp = null;
+
+ public SetupRequest timeStamp(Instant timeStamp) {
+ this.timeStamp = timeStamp;
+ return this;
+ }
+
+ /**
+ * Get timeStamp
+ *
+ * @return timeStamp
+ **/
+ public Instant getTimeStamp() {
+ return timeStamp;
+ }
+
+ public void setTimeStamp(Instant timeStamp) {
+ this.timeStamp = timeStamp;
+ }
+
+ @JsonProperty("responseCode")
+ private Integer responseCode = null;
+
+ public SetupRequest responseCode(Integer responseCode) {
+ this.responseCode = responseCode;
+ return this;
+ }
+
+ /**
+ * Get responseCode
+ *
+ * @return responseCode
+ **/
+ public Integer getResponseCode() {
+ return responseCode;
+ }
+
+ public void setResponseCode(Integer responseCode) {
+ this.responseCode = responseCode;
+ }
+
+}
<parent>
<groupId>org.o-ran-sc.portal.ric-dashboard</groupId>
<artifactId>ric-dash-parent</artifactId>
- <version>1.0.1-SNAPSHOT</version>
+ <version>1.0.2-SNAPSHOT</version>
</parent>
<artifactId>ric-dash-fe</artifactId>
<name>RIC Dashboard Webapp frontend</name>
<parent>
<groupId>org.o-ran-sc.portal.ric-dashboard</groupId>
<artifactId>ric-dash-parent</artifactId>
- <version>1.0.1-SNAPSHOT</version>
+ <version>1.0.2-SNAPSHOT</version>
</parent>
<!-- This groupId will NOT allow deployment in LF -->
<groupId>org.o-ran-sc.ric.xappmgr.client</groupId>