aboutsummaryrefslogtreecommitdiffstats
path: root/sdnr/wt/odlux/apps/connectApp/src/services
diff options
context:
space:
mode:
Diffstat (limited to 'sdnr/wt/odlux/apps/connectApp/src/services')
-rw-r--r--sdnr/wt/odlux/apps/connectApp/src/services/connectService.ts16
-rw-r--r--sdnr/wt/odlux/apps/connectApp/src/services/connectionStatusCountService.ts54
2 files changed, 8 insertions, 62 deletions
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<NetworkElementConnection | null> {
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<NetworkElementConnection | null> {
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<NetworkElementConnection | null> {
const query = {
@@ -70,7 +70,7 @@ class ConnectService {
return result || null;
}
- /** Mounts network element. */
+ /** Mounts network element/node */
public async mountNetworkElement(networkElement: NetworkElementConnection): Promise<boolean> {
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<TopologyNode | null> {
const path = this.getNetworkElementUri(nodeId);
const topologyRequestPomise = requestRest<Topology>(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<Module[] | null | undefined> {
const path = this.getNetworkElementYangLibraryFeature(nodeId);
const topologyRequestPomise = requestRest<FeatureTopology>(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<ConnectionStatusCountType | null> => {
- const path = 'rests/operations/data-provider:read-status';
- const result = await requestRest<Result<ConnectionStatusCount>>(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;
-}