diff options
author | Herbert Eiselt <herbert.eiselt@highstreet-technologies.com> | 2019-02-28 15:23:42 +0100 |
---|---|---|
committer | Herbert Eiselt <herbert.eiselt@highstreet-technologies.com> | 2019-02-28 15:24:28 +0100 |
commit | 7446f23b3abc30d7c53f2eaa951742371c071171 (patch) | |
tree | b76a8d2e64c7aa850c09f8e69f01e7a262ab5cd5 /sdnr/wt/odlux/apps/connectApp/src/services | |
parent | 49b155ec687cdf58fb51fe8245a2f5f4582b68f0 (diff) |
UX extensions
UX Maintenance client and further changes
Change-Id: I7643661d17db5fc3d3f94b58cb42ed0be558c64f
Issue-ID: SDNC-583
Signed-off-by: Herbert Eiselt <herbert.eiselt@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/odlux/apps/connectApp/src/services')
-rw-r--r-- | sdnr/wt/odlux/apps/connectApp/src/services/connectService.ts | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/sdnr/wt/odlux/apps/connectApp/src/services/connectService.ts b/sdnr/wt/odlux/apps/connectApp/src/services/connectService.ts index 0adcd49c6..91891deb6 100644 --- a/sdnr/wt/odlux/apps/connectApp/src/services/connectService.ts +++ b/sdnr/wt/odlux/apps/connectApp/src/services/connectService.ts @@ -1,6 +1,6 @@ import { RequiredNetworkElementType } from '../models/requiredNetworkElements'; -import { MountedNetworkElementType } from 'models/mountedNetworkElements'; -import { Topology, TopologyNode } from 'models/topologyNetconf'; +import { MountedNetworkElementType } from '../models/mountedNetworkElements'; +import { Topology, TopologyNode } from '../models/topologyNetconf'; import { requestRest } from '../../../../framework/src/services/restService'; import { Result, HitEntry } from '../../../../framework/src/models/elasticSearch'; @@ -40,7 +40,6 @@ class ConnectService { username: result._source.username, password: result._source.password, } || null; - } /** @@ -61,13 +60,9 @@ class ConnectService { return result || null; } - - private static mapTopologyNode = (mountPoint: TopologyNode, required: boolean ) => { // handle onfCapabilities let onfCapabilities: { module: string, revision: string }[] | undefined = undefined; - let onfCoreModelRevision: string[] | undefined = undefined; - let onfAirInterfaceRevision: string[] | undefined = undefined; const capId = 'netconf-node-topology:available-capabilities'; if (mountPoint[capId] && mountPoint[capId]['available-capability']) { @@ -161,17 +156,16 @@ class ConnectService { '</node>'].join(''); try { - const result = await requestRest<{}>(path, { + const result = await requestRest<string>(path, { method: 'PUT', headers: { 'Content-Type': 'application/xml', - 'Accept': 'application/xml', - 'Authorization': 'Basic YWRtaW46YWRtaW4=' + 'Accept': 'application/xml' }, body: mountXml }, true); // expect an empty answer - return result === null; + return result !== null; } catch { return false; } @@ -182,16 +176,15 @@ class ConnectService { const path = 'restconf/config/network-topology:network-topology/topology/topology-netconf/node/' + mountId; try { - const result = await requestRest<{}>(path, { + const result = await requestRest<string>(path, { method: 'DELETE', headers: { 'Content-Type': 'application/xml', - 'Accept': 'application/xml', - 'Authorization': 'Basic YWRtaW46YWRtaW4=' + 'Accept': 'application/xml' }, }, true); // expect an empty answer - return result === null; + return result !== null; } catch { return false; |