From a2b6dd34d73bf432846dc59c6f57dd59a03aff9b Mon Sep 17 00:00:00 2001 From: Michael Dürre Date: Thu, 8 Sep 2022 09:45:06 +0200 Subject: update odlux sources MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit update basic odlux functionality for kohn Issue-ID: CCSDK-3765 Signed-off-by: Michael Dürre Change-Id: I3723c9c2f35b9012ba537920b294a54bb556cbc6 Signed-off-by: Michael Dürre --- .../apps/connectApp/src/services/connectService.ts | 16 +++---- .../src/services/connectionStatusCountService.ts | 54 ---------------------- 2 files changed, 8 insertions(+), 62 deletions(-) delete mode 100644 sdnr/wt/odlux/apps/connectApp/src/services/connectionStatusCountService.ts (limited to 'sdnr/wt/odlux/apps/connectApp/src/services') diff --git a/sdnr/wt/odlux/apps/connectApp/src/services/connectService.ts b/sdnr/wt/odlux/apps/connectApp/src/services/connectService.ts index 427acd3ec..08cc58056 100644 --- a/sdnr/wt/odlux/apps/connectApp/src/services/connectService.ts +++ b/sdnr/wt/odlux/apps/connectApp/src/services/connectService.ts @@ -26,7 +26,7 @@ import { FeatureTopology, Topology, TopologyNode, Module } from '../models/topol import { guiCutThrough } from '../models/guiCutTrough'; /** -* Represents a web api accessor service for all Network Elements actions. +* Represents a web api accessor service for all network element/node actions. */ class ConnectService { public getNetworkElementUri = (nodeId: string) => '/rests/data/network-topology:network-topology/topology=topology-netconf/node=' + nodeId; @@ -35,7 +35,7 @@ class ConnectService { public getNetworkElementYangLibraryFeature = (nodeId: string) => '/rests/data/network-topology:network-topology/topology=topology-netconf/node=' + nodeId + '/yang-ext:mount/ietf-yang-library:yang-library?content=nonconfig' /** - * Inserts a network elements. + * Inserts a network element/node. */ public async createNetworkElement(element: NetworkElementConnection): Promise { const path = this.getNetworkElementConnectDataProviderUri("create"); @@ -46,7 +46,7 @@ class ConnectService { } /** - * Updates a network element. + * Updates a network element/node. */ public async updateNetworkElement(element: UpdateNetworkElement): Promise { const path = this.getNetworkElementConnectDataProviderUri("update"); @@ -57,7 +57,7 @@ class ConnectService { } /** - * Deletes a network element. + * Deletes a network element/node. */ public async deleteNetworkElement(element: UpdateNetworkElement): Promise { const query = { @@ -70,7 +70,7 @@ class ConnectService { return result || null; } - /** Mounts network element. */ + /** Mounts network element/node */ public async mountNetworkElement(networkElement: NetworkElementConnection): Promise { const path = this.getNetworkElementUri(networkElement.nodeId); const mountXml = [ @@ -152,7 +152,7 @@ class ConnectService { } }; - /** Yang capabilities of the selected network elements. */ + /** Yang capabilities of the selected network element/node */ public async infoNetworkElement(nodeId: string): Promise { const path = this.getNetworkElementUri(nodeId); const topologyRequestPomise = requestRest(path, { method: "GET" }); @@ -163,7 +163,7 @@ class ConnectService { } - /** Yang features of the selected network element module. */ + /** Yang features of the selected network element/node module */ public async infoNetworkElementFeatures(nodeId: string): Promise { const path = this.getNetworkElementYangLibraryFeature(nodeId); const topologyRequestPomise = requestRest(path, { method: "GET" }); @@ -180,7 +180,7 @@ class ConnectService { /** - * Get the connection state of the network element. + * Get the connection state of the network element/ node */ public async getNetworkElementConnectionStatus(element: string): Promise<(ConnectionStatus)[] | null> { const path = `/rests/operations/data-provider:read-network-element-connection-list`; diff --git a/sdnr/wt/odlux/apps/connectApp/src/services/connectionStatusCountService.ts b/sdnr/wt/odlux/apps/connectApp/src/services/connectionStatusCountService.ts deleted file mode 100644 index 519c965c4..000000000 --- a/sdnr/wt/odlux/apps/connectApp/src/services/connectionStatusCountService.ts +++ /dev/null @@ -1,54 +0,0 @@ -/** - * ============LICENSE_START======================================================================== - * ONAP : ccsdk feature sdnr wt odlux - * ================================================================================================= - * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. - * ================================================================================================= - * 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========================================================================== - */ - -import { requestRest } from "../../../../framework/src/services/restService"; -import { Result } from "../../../../framework/src/models/elasticSearch"; -import { ConnectionStatusCountType, ConnectionStatusCount } from "../models/connectionStatusCount"; - - - -export const getConnectionStatusCountStateFromDatabase = async (): Promise => { - const path = 'rests/operations/data-provider:read-status'; - const result = await requestRest>(path, { method: "POST" }); - let connectionStatusCountType: ConnectionStatusCountType = { - Connected: 0, - Connecting: 0, - Disconnected: 0, - Mounted: 0, - UnableToConnect: 0, - Undefined: 0, - Unmounted: 0, - total: 0 - } - let connectionStatusCount: ConnectionStatusCount[] | null = null; - - if (result && result["data-provider:output"] && result["data-provider:output"].data) { - connectionStatusCount = result["data-provider:output"].data; - connectionStatusCountType = { - Connected: connectionStatusCount[0]["network-element-connections"].Connected, - Connecting: connectionStatusCount[0]["network-element-connections"].Connecting, - Disconnected: connectionStatusCount[0]["network-element-connections"].Disconnected, - Mounted: connectionStatusCount[0]["network-element-connections"].Mounted, - UnableToConnect: connectionStatusCount[0]["network-element-connections"].UnableToConnect, - Undefined: connectionStatusCount[0]["network-element-connections"].Undefined, - Unmounted: connectionStatusCount[0]["network-element-connections"].Unmounted, - total: connectionStatusCount[0]["network-element-connections"].total, - } - } - return connectionStatusCountType; -} -- cgit 1.2.3-korg