summaryrefslogtreecommitdiffstats
path: root/sdnr/wt/odlux/apps/connectApp/src/handlers/infoNetworkElementHandler.ts
blob: d67a81ec48817e53552e3ac6a6c3069d71bbf7dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/**
 * ============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 { IActionHandler } from '../../../../framework/src/flux/action';

import { AllElementInfoLoadedAction, LoadAllElementInfoAction } from '../actions/infoNetworkElementActions';

import { TopologyNode } from '../models/topologyNetconf';

export interface IInfoNetworkElementsState {
  elementInfo: TopologyNode;
  busy: boolean;
}

const infoNetworkElementsStateInit: IInfoNetworkElementsState = {
  elementInfo: {
    "node-id": "",
    "netconf-node-topology:available-capabilities": {
      "available-capability": []
    }
  },
  busy: false
};

export const infoNetworkElementsActionHandler: IActionHandler<IInfoNetworkElementsState> = (state = infoNetworkElementsStateInit, action) => {
  if (action instanceof LoadAllElementInfoAction) {
    state = {
      ...state,
      busy: true
    };
  } else if (action instanceof AllElementInfoLoadedAction) {
    if (!action.error && action.elementInfo) {
      state = {
        ...state,
        elementInfo: action.elementInfo,
        busy: false
      };
    } else {
      state = {
        ...state,
        busy: false
      };
    }
  }
  return state;
};
bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
[
    {
        "id": "2827b574.5d0a5a",
        "type": "dgstart",
        "name": "DGSTART",
        "outputs": 1,
        "x": 88.75,
        "y": 77,
        "z": "db4a8a9e.7821b8",
        "wires": [
            [
                "140d5ce7.fff6d3"
            ]
        ]
    },
    {
        "id": "140d5ce7.fff6d3",
        "type": "service-logic",
        "name": "GENERIC-RESOURCE-API ${project.version}",
        "module": "GENERIC-RESOURCE-API",
        "version": "${project.version}",
        "comments": "",
        "xml": "<service-logic xmlns='http://www.onap.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>",
        "outputs": 1,
        "x": 396.74964904785156,
        "y": 77.00002193450928,
        "z": "db4a8a9e.7821b8",
        "wires": [
            [
                "a22a267b.703cc"
            ]
        ]
    },
    {
        "id": "a22a267b.703cc",
        "type": "method",
        "name": "method:bbs-internet-profile-vnf-topology-operation-change-huawei",
        "xml": "<method rpc='bbs-internet-profile-vnf-topology-operation-change-huawei' mode='sync'>\n",
        "comments": "",
        "outputs": 1,
        "x": 394.74964904785156,
        "y": 273.00006198883057,
        "z": "db4a8a9e.7821b8",
        "wires": [
            [
                "ff51862c.680cf"
            ]
        ]
    },
    {
        "id": "ff51862c.680cf",
        "type": "block",
        "name": "block : atomic",
        "xml": "<block atomic=\"true\">\n",
        "atomic": "false",
        "comments": "",
        "outputs": 1,
        "x": 801.7498626708984,
        "y": 274.00006198883057,
        "z": "db4a8a9e.7821b8",
        "wires": [
            [
                "4bd5e314.3dca5c",
                "eb68bb85.4ef888",
                "21691e47.3dfbe2",
                "5fb0bbe8.44e5cc",
                "1dfe4746.2621f9"
            ]
        ]
    },
    {
        "id": "1dfe4746.2621f9",
        "type": "execute",
        "name": "execute:ChangeInternetProfileInstance",
        "xml": "<execute plugin=\"org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode\" method=\"sendRequest\">\n    <parameter name=\"templateFileName\" value=\"`$prop.restapi.templateDir + '/bbs-internet-profile-operation.json'`\" />\n    <parameter name=\"restapiUrl\" value=\"`$prop.sdncRestApi.thirdpartySdnc.url + '/ChangeInternetProfileInstance'`\" />\n    <parameter name=\"contentType\" value=\"application/json\"/>\n    <parameter name=\"httpMethod\" value=\"post\"/>\n    <parameter name=\"responsePrefix\" value=\"service-result\"/>",
        "comments": "",
        "outputs": 1,
        "x": 1119.75,
        "y": 272,
        "z": "db4a8a9e.7821b8",
        "wires": [
            [
                "8f54d9cf.14791",
                "cb1b12c0.cbc068"
            ]
        ]
    },
    {
        "id": "cb1b12c0.cbc068",
        "type": "outcome",
        "name": "failure",
        "xml": "<outcome value='failure'>\n",
        "comments": "",
        "outputs": 1,
        "x": 1430.0829811096191,
        "y": 275,
        "z": "db4a8a9e.7821b8",
        "wires": [
            [
                "64b06154.bbf13"
            ]
        ]
    },
    {
        "id": "8f54d9cf.14791",
        "type": "outcome",
        "name": "success",
        "xml": "<outcome value='success'>\n",
        "comments": "",
        "outputs": 1,
        "x": 1439.082893371582,
        "y": 350.00000190734863,
        "z": "db4a8a9e.7821b8",
        "wires": [
            [
                "da2a9799.3fd878"
            ]
        ]
    },
    {
        "id": "64b06154.bbf13",
        "type": "returnFailure",
        "name": "return failure",
        "xml": "<return status='failure'>\n<parameter name='ack-final' value='Y'/>\n<parameter name=\"error-code\" value=\"500\" />\n<parameter name=\"error-message\" value=\"Error failed to call ChangeInternetProfileInstance\" />\n",
        "comments": "",
        "x": 1939.0165939331055,
        "y": 275.28954792022705,
        "z": "db4a8a9e.7821b8",
        "wires": []
    },
    {
        "id": "eb68bb85.4ef888",
        "type": "returnSuccess",
        "name": "return success",
        "xml": "<return status='success'>\n<parameter name=\"ack-final-indicator\" value=\"Y\" />\n<parameter name=\"error-code\" value=\"200\" />\n<parameter name=\"error-message\" value=\"`$error-message`\" />\n",
        "comments": "",
        "x": 1051.598876953125,
        "y": 608.039306640625,
        "z": "db4a8a9e.7821b8",
        "wires": []
    },
    {
        "id": "4bd5e314.3dca5c",
        "type": "call",
        "name": "call:bbs-internet-profile-vnf-topology-operation-common-huawei",
        "xml": "<call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-vnf-topology-operation-common-huawei' mode='sync' >\n",
        "comments": "",
        "outputs": 1,
        "x": 1210.765869140625,
        "y": 191.03915405273438,
        "z": "db4a8a9e.7821b8",
        "wires": [
            []
        ]
    },
    {
        "id": "21691e47.3dfbe2",
        "type": "call",
        "name": "call bbs-internet-profile-vnf-topology-operation-delete-huawei",
        "xml": "<call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-vnf-topology-operation-delete-huawei' mode='sync'>\n",
        "comments": "",
        "outputs": 1,
        "x": 1208.75,
        "y": 406.75,
        "z": "db4a8a9e.7821b8",
        "wires": [
            []
        ]
    },
    {
        "id": "5fb0bbe8.44e5cc",
        "type": "call",
        "name": "call bbs-internet-profile-vnf-topology-operation-create-huawei",
        "xml": "<call module='GENERIC-RESOURCE-API' rpc='bbs-internet-profile-vnf-topology-operation-create-huawei' mode='sync'>\n",
        "comments": "",
        "outputs": 1,
        "x": 1208,
        "y": 491.75,
        "z": "db4a8a9e.7821b8",
        "wires": [
            []
        ]
    },
    {
        "id": "da2a9799.3fd878",
        "type": "switchNode",
        "name": "switch:service-result",
        "xml": "<switch test=\"`$service-result.status`\">\n",
        "comments": "",
        "outputs": 1,
        "x": 1641.75,
        "y": 345.75,
        "z": "db4a8a9e.7821b8",
        "wires": [
            [
                "648e2996.26021",
                "d5ee3d66.d58ce"
            ]
        ]
    },
    {
        "id": "648e2996.26021",
        "type": "outcome",
        "name": "Other",
        "xml": "<outcome value='Other'>\n",
        "comments": "",
        "outputs": 1,
        "x": 1867.7503395080566,
        "y": 346.750093460083,
        "z": "db4a8a9e.7821b8",
        "wires": [
            [
                "357ad26f.f6abce"
            ]
        ]
    },
    {
        "id": "d5ee3d66.d58ce",
        "type": "outcome",
        "name": "ok",
        "xml": "<outcome value='ok'>\n",
        "comments": "",
        "outputs": 1,
        "x": 1876.7501068115234,
        "y": 432.7499485015869,
        "z": "db4a8a9e.7821b8",
        "wires": [
            [
                "88d9f41b.15a318"
            ]
        ]
    },
    {
        "id": "357ad26f.f6abce",
        "type": "returnFailure",
        "name": "return failure",
        "xml": "<return status='failure'>\n<parameter name='ack-final' value='Y'/>\n<parameter name=\"error-code\" value=\"500\" />\n<parameter name=\"error-message\" value=\"`'Error ChangeInternetProfileInstance return: '+$service-result.status`\" />\n\n",
        "comments": "",
        "x": 2054.2500076293945,
        "y": 346.7499303817749,
        "z": "db4a8a9e.7821b8",
        "wires": []
    },
    {
        "id": "88d9f41b.15a318",
        "type": "block",
        "name": "block",
        "xml": "<block>\n",
        "atomic": "false",
        "comments": "",
        "outputs": 1,
        "x": 2151.9166107177734,
        "y": 429.7499485015869,
        "z": "db4a8a9e.7821b8",
        "wires": [
            []
        ]
    },
    {
        "id": "19293418.3b3464",
        "type": "record",
        "name": "log file",
        "xml": " <record plugin='org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder'>\n    <parameter name='logger' value='message-log'/>\n        <parameter name='field1' value='my status`'/>\n        <parameter name='field2' value='status ok'/>\n\n\n\n <!--<record plugin=\"org.onap.ccsdk.sli.core.sli.recording.FileRecorder\">-->\n <!--   <parameter name=\"file\" value=\"/root/logx.txt\" />-->\n <!--   <parameter name=\"field1\" value=\"deleteAccessConnectivityService success!\" />-->\n <!--       <parameter name=\"field2\" value='`$topology.networks.network[0].network-types`' />-->\n    ",
        "comments": "",
        "outputs": 1,
        "x": 2155.6509857177734,
        "y": 519.4607028961182,
        "z": "db4a8a9e.7821b8",
        "wires": [
            []
        ]
    }
]