X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=xapp-mgr-client%2FXappManagerClientDemo.java;fp=xapp-mgr-client%2FXappManagerClientDemo.java;h=bb5a58ada271ce881597968f20d38b7a0f39377b;hb=e2cbc4d0304646febf7e2cbe0dccdf9840189222;hp=0000000000000000000000000000000000000000;hpb=dcf725626b3f7c67dda3655da048370f00b75cc3;p=portal%2Fric-dashboard.git diff --git a/xapp-mgr-client/XappManagerClientDemo.java b/xapp-mgr-client/XappManagerClientDemo.java new file mode 100644 index 00000000..bb5a58ad --- /dev/null +++ b/xapp-mgr-client/XappManagerClientDemo.java @@ -0,0 +1,51 @@ +/*- + * ========================LICENSE_START================================= + * ORAN-OSC + * %% + * 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.oranosc.ric.portal.dashboard.xmc.demo; + +import org.oranosc.ric.portal.dashboard.api.DefaultApi; +import org.oranosc.ric.portal.dashboard.model.AllXapps; +import org.oranosc.ric.portal.dashboard.invoker.ApiClient; +import org.oranosc.ric.portal.dashboard.model.Xapp; +import org.springframework.web.client.RestClientException; + +public class XappManagerClientDemo { + + public static void main(String[] args) { + ApiClient apiClient = new ApiClient(); + apiClient.setBasePath("http://localhost:30099/"); + DefaultApi apiInstance = new DefaultApi(apiClient); + try { + apiInstance.getHealth(); + System.out.println("Healthcheck answered " + apiClient.getStatusCode().toString()); + } catch (RestClientException e) { + System.err.println("Failed on DefaultApi#getHealth: " + e.toString()); + } + try { + AllXapps allXapps = apiInstance.getAllXapps(); + System.out.println("getAllXapps answered " + apiClient.getStatusCode().toString()); + System.out.println("xApp count: " + allXapps.size()); + for (Xapp x : allXapps) + System.out.println("xApp: " + x.toString()); + } catch (RestClientException e) { + System.err.println("Failed on DefaultApi#getAllXapps: " + e.toString()); + } + } + +}