summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
f1b2fa6)
Change-Id: Ic381073fdef6da78637cb9ac9eb83af9873a66a3
Issue-Id: RICPLT-1235
Signed-off-by: Lott, Christopher (cl778h) <cl778h@att.com>
RIC Dashboard Release Notes
===========================
RIC Dashboard Release Notes
===========================
-Version 1.0.1, 6 May 2019
+Version 1.0.1, 9 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
-------------------------
* 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
+* Update xApp Manager API spec to version 0.1.2
Version 1.0.0, 30 Apr 2019
--------------------------
Version 1.0.0, 30 Apr 2019
--------------------------
<dependency>
<groupId>org.o-ran-sc.ric.xappmgr.client</groupId>
<artifactId>xapp-mgr-client</artifactId>
<dependency>
<groupId>org.o-ran-sc.ric.xappmgr.client</groupId>
<artifactId>xapp-mgr-client</artifactId>
- <version>0.1.1-SNAPSHOT</version>
+ <version>0.1.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodHandles;
-import org.oransc.ric.xappmgr.client.api.DefaultApi;
+import org.oransc.ric.xappmgr.client.api.HealthApi;
+import org.oransc.ric.xappmgr.client.api.XappApi;
import org.oransc.ric.xappmgr.client.invoker.ApiClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.oransc.ric.xappmgr.client.invoker.ApiClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
- * @return A DefaultApi with an ApiClient configured from properties
+ * @return A HealthApi with an ApiClient configured from properties
- public DefaultApi xappClient() {
+ public HealthApi xappHealthApi() {
ApiClient apiClient = new ApiClient(new RestTemplate());
apiClient.setBasePath(xappMgrBasepath);
ApiClient apiClient = new ApiClient(new RestTemplate());
apiClient.setBasePath(xappMgrBasepath);
- return new DefaultApi(apiClient);
+ return new HealthApi(apiClient);
+ }
+ /**
+ * @return An XappApi with an ApiClient configured from properties
+ */
+ @Bean
+ public XappApi xappMgrApi() {
+ ApiClient apiClient = new ApiClient(new RestTemplate());
+ apiClient.setBasePath(xappMgrBasepath);
+ return new XappApi(apiClient);
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodHandles;
-import org.oransc.ric.xappmgr.client.api.DefaultApi;
+import org.oransc.ric.xappmgr.client.api.HealthApi;
+import org.oransc.ric.xappmgr.client.api.XappApi;
import org.oransc.ric.xappmgr.client.invoker.ApiClient;
import org.oransc.ric.xappmgr.client.model.AllXapps;
import org.oransc.ric.xappmgr.client.model.SubscriptionRequest;
import org.oransc.ric.xappmgr.client.invoker.ApiClient;
import org.oransc.ric.xappmgr.client.model.AllXapps;
import org.oransc.ric.xappmgr.client.model.SubscriptionRequest;
- public DefaultApi xappManagerMockClient() {
+ public HealthApi xappHealthMockApi() {
ApiClient mockClient = mock(ApiClient.class);
when(mockClient.getStatusCode()).thenReturn(HttpStatus.OK);
ApiClient mockClient = mock(ApiClient.class);
when(mockClient.getStatusCode()).thenReturn(HttpStatus.OK);
+ HealthApi mockApi = mock(HealthApi.class);
+ when(mockApi.getApiClient()).thenReturn(mockClient);
+ doAnswer(i -> {
+ return null;
+ }).when(mockApi).getHealth();
+ return mockApi;
+ }
- DefaultApi mockApi = mock(DefaultApi.class);
+ @Bean
+ public XappApi xappMgrMockApi() {
+ ApiClient mockClient = mock(ApiClient.class);
+ when(mockClient.getStatusCode()).thenReturn(HttpStatus.OK);
+
+ XappApi mockApi = mock(XappApi.class);
when(mockApi.getApiClient()).thenReturn(mockClient);
SubscriptionResponse subRes = new SubscriptionResponse().eventType(SubscriptionResponse.EventTypeEnum.ALL)
when(mockApi.getApiClient()).thenReturn(mockClient);
SubscriptionResponse subRes = new SubscriptionResponse().eventType(SubscriptionResponse.EventTypeEnum.ALL)
when(mockApi.getAllXapps()).thenReturn(allXapps);
when(mockApi.getAllXapps()).thenReturn(allXapps);
- doAnswer(i -> {
- return null;
- }).when(mockApi).getHealth();
Xapp xappByName = new Xapp().name("name").status(StatusEnum.UNKNOWN).version("v1");
when(mockApi.getXappByName(any(String.class))).thenReturn(xappByName);
Xapp xappByName = new Xapp().name("name").status(StatusEnum.UNKNOWN).version("v1");
when(mockApi.getXappByName(any(String.class))).thenReturn(xappByName);
import org.oransc.ric.portal.dashboard.DashboardConstants;
import org.oransc.ric.portal.dashboard.model.ErrorTransport;
import org.oransc.ric.portal.dashboard.DashboardConstants;
import org.oransc.ric.portal.dashboard.model.ErrorTransport;
-import org.oransc.ric.xappmgr.client.api.DefaultApi;
+import org.oransc.ric.xappmgr.client.api.HealthApi;
+import org.oransc.ric.xappmgr.client.api.XappApi;
import org.oransc.ric.xappmgr.client.model.AllXapps;
import org.oransc.ric.xappmgr.client.model.XAppInfo;
import org.oransc.ric.xappmgr.client.model.Xapp;
import org.oransc.ric.xappmgr.client.model.AllXapps;
import org.oransc.ric.xappmgr.client.model.XAppInfo;
import org.oransc.ric.xappmgr.client.model.Xapp;
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
// Populated by the autowired constructor
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
// Populated by the autowired constructor
- private final DefaultApi xappMgrClient;
+ private final HealthApi healthApi;
+ private final XappApi xappApi;
- public XappManagerController(final DefaultApi xappMgrClient) {
- Assert.notNull(xappMgrClient, "client must not be null");
+ public XappManagerController(final HealthApi healthApi, final XappApi xappApi) {
+ Assert.notNull(healthApi, "health API must not be null");
+ Assert.notNull(xappApi, "xapp API must not be null");
if (logger.isDebugEnabled())
if (logger.isDebugEnabled())
- logger.debug("ctor: configured with client type {}", xappMgrClient.getClass().getName());
- this.xappMgrClient = xappMgrClient;
+ logger.debug("ctor: configured with client types {} and {}", healthApi.getClass().getName(),
+ xappApi.getClass().getName());
+ this.healthApi = healthApi;
+ this.xappApi = xappApi;
}
@ApiOperation(value = "Calls the xApp Manager health check.")
@RequestMapping(value = "/health", method = RequestMethod.GET)
public void getHealth(HttpServletResponse response) {
}
@ApiOperation(value = "Calls the xApp Manager health check.")
@RequestMapping(value = "/health", method = RequestMethod.GET)
public void getHealth(HttpServletResponse response) {
- logger.debug("getHealth");
- xappMgrClient.getHealth();
- response.setStatus(xappMgrClient.getApiClient().getStatusCode().value());
+ logger.debug("getHealt");
+ healthApi.getHealth();
+ response.setStatus(healthApi.getApiClient().getStatusCode().value());
}
@ApiOperation(value = "Calls the xApp Manager to get the list of xApps.", response = AllXapps.class)
@RequestMapping(value = "/xapps", method = RequestMethod.GET)
public AllXapps getAllXapps() {
if (logger.isDebugEnabled())
}
@ApiOperation(value = "Calls the xApp Manager to get the list of xApps.", response = AllXapps.class)
@RequestMapping(value = "/xapps", method = RequestMethod.GET)
public AllXapps getAllXapps() {
if (logger.isDebugEnabled())
- logger.debug("getAllXapps via {}", xappMgrClient.getApiClient().getBasePath());
- return xappMgrClient.getAllXapps();
+ logger.debug("getAllXapps via {}", xappApi.getApiClient().getBasePath());
+ return xappApi.getAllXapps();
}
@ApiOperation(value = "Calls the xApp Manager to get the named xApp.", response = Xapp.class)
@RequestMapping(value = "/xapps/{xAppName}", method = RequestMethod.GET)
public Xapp getXapp(@PathVariable("xAppName") String xAppName) {
logger.debug("getXapp {}", xAppName);
}
@ApiOperation(value = "Calls the xApp Manager to get the named xApp.", response = Xapp.class)
@RequestMapping(value = "/xapps/{xAppName}", method = RequestMethod.GET)
public Xapp getXapp(@PathVariable("xAppName") String xAppName) {
logger.debug("getXapp {}", xAppName);
- return xappMgrClient.getXappByName(xAppName);
+ return xappApi.getXappByName(xAppName);
}
@ApiOperation(value = "Calls the xApp Manager to deploy the specified Xapp.", response = Xapp.class)
}
@ApiOperation(value = "Calls the xApp Manager to deploy the specified Xapp.", response = Xapp.class)
public Object deployXapp(@RequestBody XAppInfo xAppInfo, HttpServletResponse response) {
logger.debug("deployXapp {}", xAppInfo);
try {
public Object deployXapp(@RequestBody XAppInfo xAppInfo, HttpServletResponse response) {
logger.debug("deployXapp {}", xAppInfo);
try {
- return xappMgrClient.deployXapp(xAppInfo);
+ return xappApi.deployXapp(xAppInfo);
} catch (Exception ex) {
logger.error("deployXapp failed", ex);
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
} catch (Exception ex) {
logger.error("deployXapp failed", ex);
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
public void undeployXapp(@PathVariable("xAppName") String xAppName, HttpServletResponse response) {
logger.debug("undeployXapp {}", xAppName);
try {
public void undeployXapp(@PathVariable("xAppName") String xAppName, HttpServletResponse response) {
logger.debug("undeployXapp {}", xAppName);
try {
- xappMgrClient.undeployXapp(xAppName);
+ xappApi.undeployXapp(xAppName);
} catch (Exception ex) {
logger.error("deployXapp failed", ex);
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
} catch (Exception ex) {
logger.error("deployXapp failed", ex);
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
<groupId>org.o-ran-sc.ric.xappmgr.client</groupId>
<artifactId>xapp-mgr-client</artifactId>
<name>RIC xApp Manager client</name>
<groupId>org.o-ran-sc.ric.xappmgr.client</groupId>
<artifactId>xapp-mgr-client</artifactId>
<name>RIC xApp Manager client</name>
- <version>0.1.1-SNAPSHOT</version>
+ <version>0.1.2-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<goal>generate</goal>
</goals>
<configuration>
<goal>generate</goal>
</goals>
<configuration>
- <inputSpec>${project.basedir}/src/main/resources/xapp_manager_rest_api_v0_1_1.yaml</inputSpec>
+ <inputSpec>${project.basedir}/src/main/resources/xapp_manager_rest_api_v0_1_2.yaml</inputSpec>
<language>java</language>
<configOptions>
<groupId>${project.groupId}</groupId>
<language>java</language>
<configOptions>
<groupId>${project.groupId}</groupId>
swagger: '2.0'
info:
description: This is a draft API for RIC appmgr
swagger: '2.0'
info:
description: This is a draft API for RIC appmgr
title: RIC appmgr
license:
name: Apache 2.0
title: RIC appmgr
license:
name: Apache 2.0
/health:
get:
summary: Health check of xApp Manager
/health:
get:
summary: Health check of xApp Manager
operationId: getHealth
responses:
'200':
operationId: getHealth
responses:
'200':
/xapps:
post:
summary: Deploy a xapp
/xapps:
post:
summary: Deploy a xapp
operationId: deployXapp
consumes:
- application/json
operationId: deployXapp
consumes:
- application/json
description: Internal error
get:
summary: Returns the status of all xapps
description: Internal error
get:
summary: Returns the status of all xapps
operationId: getAllXapps
produces:
- application/json
operationId: getAllXapps
produces:
- application/json
'/xapps/{xAppName}':
get:
summary: Returns the status of a given xapp
'/xapps/{xAppName}':
get:
summary: Returns the status of a given xapp
operationId: getXappByName
produces:
- application/json
operationId: getXappByName
produces:
- application/json
description: Internal error
delete:
summary: Undeploy an existing xapp
description: Internal error
delete:
summary: Undeploy an existing xapp
operationId: undeployXapp
parameters:
- name: xAppName
operationId: undeployXapp
parameters:
- name: xAppName
'/xapps/{xAppName}/instances/{xAppInstanceName}':
get:
summary: Returns the status of a given xapp
'/xapps/{xAppName}/instances/{xAppInstanceName}':
get:
summary: Returns the status of a given xapp
operationId: getXappInstanceByName
produces:
- application/json
operationId: getXappInstanceByName
produces:
- application/json
/config:
post:
summary: Create xApp config
/config:
post:
summary: Create xApp config
operationId: createXappConfig
consumes:
- application/json
operationId: createXappConfig
consumes:
- application/json
$ref: '#/definitions/xAppConfig'
'400':
description: Invalid input
$ref: '#/definitions/xAppConfig'
'400':
description: Invalid input
+ '422':
+ description: Validation of configuration failed
'500':
description: Internal error
put:
summary: Modify xApp config
'500':
description: Internal error
put:
summary: Modify xApp config
operationId: ModifyXappConfig
consumes:
- application/json
operationId: ModifyXappConfig
consumes:
- application/json
$ref: '#/definitions/xAppConfig'
'400':
description: Invalid input
$ref: '#/definitions/xAppConfig'
'400':
description: Invalid input
+ '422':
+ description: Validation of configuration failed
'500':
description: Internal error
get:
summary: Returns the configuration of all xapps
'500':
description: Internal error
get:
summary: Returns the configuration of all xapps
operationId: getAllXappConfig
produces:
- application/json
operationId: getAllXappConfig
produces:
- application/json
description: Internal error
delete:
summary: Delete xApp configuration
description: Internal error
delete:
summary: Delete xApp configuration
operationId: deleteXappConfig
parameters:
- name: xAppConfigInfo
operationId: deleteXappConfig
parameters:
- name: xAppConfigInfo
/subscriptions:
post:
summary: Subscribe event
/subscriptions:
post:
summary: Subscribe event
+ tags:
+ - xapp
+ - subscriptions
operationId: addSubscription
consumes:
- application/json
operationId: addSubscription
consumes:
- application/json
description: Invalid input
get:
summary: Returns all subscriptions
description: Invalid input
get:
summary: Returns all subscriptions
+ tags:
+ - xapp
+ - subscriptions
operationId: getSubscriptions
produces:
- application/json
operationId: getSubscriptions
produces:
- application/json
'/subscriptions/{subscriptionId}':
get:
summary: Returns the information of subscription
'/subscriptions/{subscriptionId}':
get:
summary: Returns the information of subscription
+ tags:
+ - xapp
+ - subscriptions
operationId: getSubscriptionById
produces:
- application/json
operationId: getSubscriptionById
produces:
- application/json
description: Subscription not found
put:
summary: Modify event subscription
description: Subscription not found
put:
summary: Modify event subscription
+ tags:
+ - xapp
+ - subscriptions
operationId: modifySubscription
consumes:
- application/json
operationId: modifySubscription
consumes:
- application/json
description: Invalid input
delete:
summary: Unsubscribe event
description: Invalid input
delete:
summary: Unsubscribe event
+ tags:
+ - xapp
+ - subscriptions
description: ''
operationId: deleteSubscription
parameters:
description: ''
operationId: deleteSubscription
parameters:
package org.oransc.ric.portal.dashboard.xappmgr.client.test;
import org.junit.jupiter.api.Test;
package org.oransc.ric.portal.dashboard.xappmgr.client.test;
import org.junit.jupiter.api.Test;
-import org.oransc.ric.xappmgr.client.api.DefaultApi;
+import org.oransc.ric.xappmgr.client.api.HealthApi;
+import org.oransc.ric.xappmgr.client.api.XappApi;
import org.oransc.ric.xappmgr.client.invoker.ApiClient;
import org.oransc.ric.xappmgr.client.model.AllXapps;
import org.oransc.ric.xappmgr.client.model.Xapp;
import org.oransc.ric.xappmgr.client.invoker.ApiClient;
import org.oransc.ric.xappmgr.client.model.AllXapps;
import org.oransc.ric.xappmgr.client.model.Xapp;
* Demonstrates use of the generated xApp manager client.
*
* The test fails because no server is available.
* Demonstrates use of the generated xApp manager client.
*
* The test fails because no server is available.
- *
- * The ugly name "DefaultApi" is generated because the spec lacks appropriate
- * tags on the operation, also see
- * https://stackoverflow.com/questions/38293236/swagger-swagger-codegen-maven-plugin-generate-default-api-interface
*/
public class XappManagerClientTest {
*/
public class XappManagerClientTest {
public void demo() {
ApiClient apiClient = new ApiClient();
apiClient.setBasePath("http://localhost:30099/");
public void demo() {
ApiClient apiClient = new ApiClient();
apiClient.setBasePath("http://localhost:30099/");
- DefaultApi apiInstance = new DefaultApi(apiClient);
- apiInstance.getHealth();
+ HealthApi healthApi = new HealthApi(apiClient);
+ healthApi.getHealth();
System.out.println("getHealth answered: " + apiClient.getStatusCode().toString());
} catch (RestClientException e) {
System.err.println("getHealth failed: " + e.toString());
}
try {
System.out.println("getHealth answered: " + apiClient.getStatusCode().toString());
} catch (RestClientException e) {
System.err.println("getHealth failed: " + e.toString());
}
try {
- AllXapps allXapps = apiInstance.getAllXapps();
+ XappApi xappApi = new XappApi(apiClient);
+ AllXapps allXapps = xappApi.getAllXapps();
System.out.println("getAllXapps answered: " + apiClient.getStatusCode().toString());
System.out.println("xApp count: " + allXapps.size());
for (Xapp x : allXapps)
System.out.println("getAllXapps answered: " + apiClient.getStatusCode().toString());
System.out.println("xApp count: " + allXapps.size());
for (Xapp x : allXapps)