aboutsummaryrefslogtreecommitdiffstats
path: root/tools/model-generator/src/test/resources/models/AvroModel.json
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@ericsson.com>2018-11-06 12:02:46 +0000
committerliamfallon <liam.fallon@ericsson.com>2018-11-07 12:41:09 +0000
commit53d8916cc60d97e2ce7ae345f8cc25f5602567da (patch)
treeee2f3a8e543c31993c51a58257354ccffb648dfe /tools/model-generator/src/test/resources/models/AvroModel.json
parent9dc414a0cabc9074e87a7c9cd5c3e5ceee733e5a (diff)
Refactor unit test data
There were many copies of test policies and examples strewn through the Apex unit tests. This change cleans up the unit tests so that a single version of all example policies is used in all tests. Also added a new relative file root command line parameter to Apex to allow the root of relative paths in configuration files to be set. Apologies for the size of this review but unfortunately all of this must be done in one shot. Issue-ID: POLICY-1252 Change-Id: Ibbb18fbf18e3897a1c61301d0a65e62bc643a0e9 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
Diffstat (limited to 'tools/model-generator/src/test/resources/models/AvroModel.json')
-rw-r--r--tools/model-generator/src/test/resources/models/AvroModel.json3009
1 files changed, 0 insertions, 3009 deletions
diff --git a/tools/model-generator/src/test/resources/models/AvroModel.json b/tools/model-generator/src/test/resources/models/AvroModel.json
deleted file mode 100644
index 81563c64c..000000000
--- a/tools/model-generator/src/test/resources/models/AvroModel.json
+++ /dev/null
@@ -1,3009 +0,0 @@
-{
- "apexPolicyModel" : {
- "key" : {
- "name" : "PCVS-VpnSla",
- "version" : "1.0.0"
- },
- "keyInformation" : {
- "key" : {
- "name" : "PCVS-VpnSla_KeyInfo",
- "version" : "1.0.0"
- },
- "keyInfoMap" : {
- "entry" : [ {
- "key" : {
- "name" : "CustomerContextEventIn",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "CustomerContextEventIn",
- "version" : "1.0.0"
- },
- "UUID" : "1ce15f63-7c90-3a13-96d9-e3964f76aa0e",
- "description" : "Event to add Customers to engine Context"
- }
- }, {
- "key" : {
- "name" : "CustomerContextPolicy",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "CustomerContextPolicy",
- "version" : "1.0.0"
- },
- "UUID" : "91854e6d-868b-3d1a-aff1-a9390173f144",
- "description" : "Policy that adds Customer information to engine context"
- }
- }, {
- "key" : {
- "name" : "CustomerContextTask",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "CustomerContextTask",
- "version" : "1.0.0"
- },
- "UUID" : "c43c4cdc-71ef-3e0e-90a2-e36f4f355e3e",
- "description" : "This task adds event context to customer context"
- }
- }, {
- "key" : {
- "name" : "EdgeContextEventIn",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "EdgeContextEventIn",
- "version" : "1.0.0"
- },
- "UUID" : "1817ee7e-d91a-33cb-b9e3-fa60e5c2f340",
- "description" : "Event to add an Edge to engine Context"
- }
- }, {
- "key" : {
- "name" : "EdgeContextPolicy",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "EdgeContextPolicy",
- "version" : "1.0.0"
- },
- "UUID" : "652dc1e9-1030-3fe1-8e6e-f7758c68959f",
- "description" : "Policy that adds an edge to context"
- }
- }, {
- "key" : {
- "name" : "EdgeContextTask",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "EdgeContextTask",
- "version" : "1.0.0"
- },
- "UUID" : "bb3dd70d-ab5c-3ea4-81ca-92f578e9808b",
- "description" : "This task adds event context to edge context"
- }
- }, {
- "key" : {
- "name" : "NodeContextEventIn",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "NodeContextEventIn",
- "version" : "1.0.0"
- },
- "UUID" : "38bb48b4-07fd-3e53-976d-651fd0bbf5e1",
- "description" : "Event to add Node to engine Context"
- }
- }, {
- "key" : {
- "name" : "NodeContextPolicy",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "NodeContextPolicy",
- "version" : "1.0.0"
- },
- "UUID" : "6dd58709-d4b7-31d6-8230-ab91e548985a",
- "description" : "Policy that adds an node to context"
- }
- }, {
- "key" : {
- "name" : "NodeContextTask",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "NodeContextTask",
- "version" : "1.0.0"
- },
- "UUID" : "32ffcbca-fee6-3cb4-b311-fa3ba6a3b9b7",
- "description" : "This task adds event context to node context"
- }
- }, {
- "key" : {
- "name" : "PCVS-VpnSla",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "PCVS-VpnSla",
- "version" : "1.0.0"
- },
- "UUID" : "fc0d1be0-fc4f-3758-b530-6435d279951e",
- "description" : "Policies-Controlled Video Streaming, VPN SLA Policy Model"
- }
- }, {
- "key" : {
- "name" : "PCVS-VpnSla_Albums",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "PCVS-VpnSla_Albums",
- "version" : "1.0.0"
- },
- "UUID" : "2e34f18e-37e6-35d2-ba11-e20f96e113d5",
- "description" : "Generated description for concept referred to by key \"PCVS-VpnSla_Albums:1.0.0\""
- }
- }, {
- "key" : {
- "name" : "PCVS-VpnSla_Events",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "PCVS-VpnSla_Events",
- "version" : "1.0.0"
- },
- "UUID" : "0c04d3b3-86aa-39c2-938e-b44224cb0798",
- "description" : "Generated description for concept referred to by key \"PCVS-VpnSla_Events:1.0.0\""
- }
- }, {
- "key" : {
- "name" : "PCVS-VpnSla_KeyInfo",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "PCVS-VpnSla_KeyInfo",
- "version" : "1.0.0"
- },
- "UUID" : "6f257a91-576d-3e49-92ca-9c9a92994cff",
- "description" : "Generated description for concept referred to by key \"PCVS-VpnSla_KeyInfo:1.0.0\""
- }
- }, {
- "key" : {
- "name" : "PCVS-VpnSla_Policies",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "PCVS-VpnSla_Policies",
- "version" : "1.0.0"
- },
- "UUID" : "af00d5d2-f584-37eb-a539-db10284828d8",
- "description" : "Generated description for concept referred to by key \"PCVS-VpnSla_Policies:1.0.0\""
- }
- }, {
- "key" : {
- "name" : "PCVS-VpnSla_Schemas",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "PCVS-VpnSla_Schemas",
- "version" : "1.0.0"
- },
- "UUID" : "390c3e62-0455-330c-8bdc-c835322cca9c",
- "description" : "Generated description for concept referred to by key \"PCVS-VpnSla_Schemas:1.0.0\""
- }
- }, {
- "key" : {
- "name" : "PCVS-VpnSla_Tasks",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "PCVS-VpnSla_Tasks",
- "version" : "1.0.0"
- },
- "UUID" : "5834101d-d5e7-323e-8bd2-595ed4618f07",
- "description" : "Generated description for concept referred to by key \"PCVS-VpnSla_Tasks:1.0.0\""
- }
- }, {
- "key" : {
- "name" : "ReportOut",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "ReportOut",
- "version" : "1.0.0"
- },
- "UUID" : "29b332dc-e8b6-390e-8b41-3edbba45da44",
- "description" : "Report of a policy (issued by a task)"
- }
- }, {
- "key" : {
- "name" : "VpnSlaActOut",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "VpnSlaActOut",
- "version" : "1.0.0"
- },
- "UUID" : "37d5dfba-d6e0-35a5-958b-21f77cb78a0c",
- "description" : "Event action"
- }
- }, {
- "key" : {
- "name" : "VpnSlaDecideOut",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "VpnSlaDecideOut",
- "version" : "1.0.0"
- },
- "UUID" : "8d4ea7ed-ed7a-3f34-8ecc-56f6f192357c",
- "description" : "Event with a decision for the SLA policy"
- }
- }, {
- "key" : {
- "name" : "VpnSlaEstablishOut",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "VpnSlaEstablishOut",
- "version" : "1.0.0"
- },
- "UUID" : "e3fde4f3-338a-3759-a2d8-f23c6fd390ac",
- "description" : "Event with situation for the SLA policy"
- }
- }, {
- "key" : {
- "name" : "VpnSlaMatchOut",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "VpnSlaMatchOut",
- "version" : "1.0.0"
- },
- "UUID" : "40aa223f-4689-3de1-bfb5-7889a07f6045",
- "description" : "Event with matched trigger for the VPN SLA policy"
- }
- }, {
- "key" : {
- "name" : "VpnSlaPolicy",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "VpnSlaPolicy",
- "version" : "1.0.0"
- },
- "UUID" : "cd75105c-4cdb-312d-9372-aa508f4c400c",
- "description" : "Policy deciding customer treatment based on SLAs as MEDA policy"
- }
- }, {
- "key" : {
- "name" : "VpnSlaPolicyActTask",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "VpnSlaPolicyActTask",
- "version" : "1.0.0"
- },
- "UUID" : "c6ff32e6-261b-35cc-a8e8-ba87ecf555e6",
- "description" : "Task issueing an action for taken decision"
- }
- }, {
- "key" : {
- "name" : "VpnSlaPolicyDecideNoneTask",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "VpnSlaPolicyDecideNoneTask",
- "version" : "1.0.0"
- },
- "UUID" : "360c7f52-0930-38e5-ab54-59e4f3930c1e",
- "description" : "Decide task for a 'none' problem"
- }
- }, {
- "key" : {
- "name" : "VpnSlaPolicyDecidePriorityTask",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "VpnSlaPolicyDecidePriorityTask",
- "version" : "1.0.0"
- },
- "UUID" : "f5226370-98b2-322d-9eb9-a17dfd834104",
- "description" : "Decide task solving the problem by using customer priorities"
- }
- }, {
- "key" : {
- "name" : "VpnSlaPolicyDecideSlaTask",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "VpnSlaPolicyDecideSlaTask",
- "version" : "1.0.0"
- },
- "UUID" : "c231c338-fda7-3cc3-b282-382c0ace4015",
- "description" : "Decide task solving the problem by balancing SLAs"
- }
- }, {
- "key" : {
- "name" : "VpnSlaPolicyDecideSolvedTask",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "VpnSlaPolicyDecideSolvedTask",
- "version" : "1.0.0"
- },
- "UUID" : "5e5b3951-a4c3-387d-9b75-ad1197372695",
- "description" : "Decide task solving the problem by using customer priorities"
- }
- }, {
- "key" : {
- "name" : "VpnSlaPolicyEstablishTask",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "VpnSlaPolicyEstablishTask",
- "version" : "1.0.0"
- },
- "UUID" : "83774c6c-73dd-3ce6-98ed-6c9295da9562",
- "description" : "Task taking a match event and establishing a situation"
- }
- }, {
- "key" : {
- "name" : "VpnSlaPolicyMatchTask",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "VpnSlaPolicyMatchTask",
- "version" : "1.0.0"
- },
- "UUID" : "bb6c7e85-b5de-3f02-96c6-34c85ae174e3",
- "description" : "Pre-process an edge event"
- }
- }, {
- "key" : {
- "name" : "VpnSlaTrigger",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "VpnSlaTrigger",
- "version" : "1.0.0"
- },
- "UUID" : "7224a6d5-02cf-3fa0-803e-f930120c14d3",
- "description" : "Event triggering the VPN SLA policy"
- }
- }, {
- "key" : {
- "name" : "actionDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "actionDecl",
- "version" : "1.0.0"
- },
- "UUID" : "9818146b-f42c-378b-8818-519d5e16ea2b",
- "description" : "An action for the actioning system"
- }
- }, {
- "key" : {
- "name" : "albumCustomerMap",
- "version" : "0.0.1"
- },
- "value" : {
- "key" : {
- "name" : "albumCustomerMap",
- "version" : "0.0.1"
- },
- "UUID" : "dde24214-9a5b-3995-a942-81e5c509af7d",
- "description" : "Generated description for concept referred to by key \"albumCustomerMap:0.0.1\""
- }
- }, {
- "key" : {
- "name" : "albumProblemMap",
- "version" : "0.0.1"
- },
- "value" : {
- "key" : {
- "name" : "albumProblemMap",
- "version" : "0.0.1"
- },
- "UUID" : "681ed388-d70e-3a87-a322-a11813fb4cd5",
- "description" : "Generated description for concept referred to by key \"albumProblemMap:0.0.1\""
- }
- }, {
- "key" : {
- "name" : "albumTopoEdges",
- "version" : "0.0.1"
- },
- "value" : {
- "key" : {
- "name" : "albumTopoEdges",
- "version" : "0.0.1"
- },
- "UUID" : "4ac38510-3a01-33cc-9015-334408041b53",
- "description" : "Generated description for concept referred to by key \"albumTopoEdges:0.0.1\""
- }
- }, {
- "key" : {
- "name" : "albumTopoNodes",
- "version" : "0.0.1"
- },
- "value" : {
- "key" : {
- "name" : "albumTopoNodes",
- "version" : "0.0.1"
- },
- "UUID" : "0ca9d9c1-073f-3183-af0c-c5f02cbdb26b",
- "description" : "Generated description for concept referred to by key \"albumTopoNodes:0.0.1\""
- }
- }, {
- "key" : {
- "name" : "ctxtCustomerDowntimeSLADecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "ctxtCustomerDowntimeSLADecl",
- "version" : "1.0.0"
- },
- "UUID" : "dd0d2302-58f2-3904-a5b2-60e950c7db9f",
- "description" : "Customer Context: contracted downtime as per SLA"
- }
- }, {
- "key" : {
- "name" : "ctxtCustomerDowntimeYTDDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "ctxtCustomerDowntimeYTDDecl",
- "version" : "1.0.0"
- },
- "UUID" : "dc75514e-19dc-307e-9de9-c07317197b17",
- "description" : "Customer Context: year-to-date downtime experienced"
- }
- }, {
- "key" : {
- "name" : "ctxtCustomerLinksDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "ctxtCustomerLinksDecl",
- "version" : "1.0.0"
- },
- "UUID" : "49c6b6e3-d987-3612-a846-9305fc5369f2",
- "description" : "Customer Context: links a customer uses (for events/task)"
- }
- }, {
- "key" : {
- "name" : "ctxtCustomerMapDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "ctxtCustomerMapDecl",
- "version" : "1.0.0"
- },
- "UUID" : "a32fe8e8-f626-3ad6-a979-6dc0897d0435",
- "description" : "Map of customers with all known information"
- }
- }, {
- "key" : {
- "name" : "ctxtCustomerNameDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "ctxtCustomerNameDecl",
- "version" : "1.0.0"
- },
- "UUID" : "38151d46-be2d-354b-8142-994d880314a0",
- "description" : "Customer Context: customer name"
- }
- }, {
- "key" : {
- "name" : "ctxtCustomerPriorityDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "ctxtCustomerPriorityDecl",
- "version" : "1.0.0"
- },
- "UUID" : "8c4d86b6-58fa-38a8-a86c-1498701a08fa",
- "description" : "Customer Context: priority flag"
- }
- }, {
- "key" : {
- "name" : "ctxtCustomerSatisfactionDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "ctxtCustomerSatisfactionDecl",
- "version" : "1.0.0"
- },
- "UUID" : "5d995fbe-f60a-3e6a-b60e-ed46dba0fc28",
- "description" : "Customer Context: satisfaction in percent"
- }
- }, {
- "key" : {
- "name" : "ctxtEdgeEndDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "ctxtEdgeEndDecl",
- "version" : "1.0.0"
- },
- "UUID" : "a68eab04-4297-369b-85ac-2968e418fcbd",
- "description" : "Topology Edges: edge endpoint (end)"
- }
- }, {
- "key" : {
- "name" : "ctxtEdgeNameDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "ctxtEdgeNameDecl",
- "version" : "1.0.0"
- },
- "UUID" : "7688d4e1-bb1f-30f3-92a6-f3eef9816236",
- "description" : "Topology Edges: edge (link) name"
- }
- }, {
- "key" : {
- "name" : "ctxtEdgeStartDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "ctxtEdgeStartDecl",
- "version" : "1.0.0"
- },
- "UUID" : "c20605f1-5b90-38a5-8782-d2d23309007a",
- "description" : "Topology Edges: edge endpoint (start)"
- }
- }, {
- "key" : {
- "name" : "ctxtEdgeStatusDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "ctxtEdgeStatusDecl",
- "version" : "1.0.0"
- },
- "UUID" : "785e1b75-5389-35b6-b4a1-e9ec49891155",
- "description" : "Topology Edges: edge status as up (true) or down (false)"
- }
- }, {
- "key" : {
- "name" : "ctxtNodeMininetNameDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "ctxtNodeMininetNameDecl",
- "version" : "1.0.0"
- },
- "UUID" : "ecfd3326-1425-3793-b4fb-54d5ca58324c",
- "description" : "Topology Nodes: node name in Mininet"
- }
- }, {
- "key" : {
- "name" : "ctxtNodeNameDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "ctxtNodeNameDecl",
- "version" : "1.0.0"
- },
- "UUID" : "80654d36-82eb-3dc6-b411-1442341946fb",
- "description" : "Topology Nodes: node name"
- }
- }, {
- "key" : {
- "name" : "ctxtTopologyEdgesDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "ctxtTopologyEdgesDecl",
- "version" : "1.0.0"
- },
- "UUID" : "d2561824-0bf1-3923-b779-89d2e527c507",
- "description" : "Topology Edges Context Map"
- }
- }, {
- "key" : {
- "name" : "ctxtTopologyNodesDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "ctxtTopologyNodesDecl",
- "version" : "1.0.0"
- },
- "UUID" : "0ee08c50-b09e-36d5-8fb0-ec97c5be8b20",
- "description" : "Topology Nodes Context Map"
- }
- }, {
- "key" : {
- "name" : "decideDecisionDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "decideDecisionDecl",
- "version" : "1.0.0"
- },
- "UUID" : "8f9a3a78-1807-3be5-b70a-e084d638f1f2",
- "description" : "Decide: the taken decision"
- }
- }, {
- "key" : {
- "name" : "edgeChangedDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "edgeChangedDecl",
- "version" : "1.0.0"
- },
- "UUID" : "d21f8db2-1ac0-345a-b328-9227b47628fd",
- "description" : "Status Change (true:change, false:no change)"
- }
- }, {
- "key" : {
- "name" : "edgeNameDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "edgeNameDecl",
- "version" : "1.0.0"
- },
- "UUID" : "bd8f33d8-b7a5-3fae-82b8-783b84bc7e17",
- "description" : "Edge name"
- }
- }, {
- "key" : {
- "name" : "edgeStatusDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "edgeStatusDecl",
- "version" : "1.0.0"
- },
- "UUID" : "ba935212-80f1-3ac1-96d9-6e2519773b9c",
- "description" : "Statuf of the edge (UP, DOWN)"
- }
- }, {
- "key" : {
- "name" : "establishSituationDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "establishSituationDecl",
- "version" : "1.0.0"
- },
- "UUID" : "206ffbd0-cb07-329a-93fe-990961e3f92c",
- "description" : "Establish: the situation that was established"
- }
- }, {
- "key" : {
- "name" : "problemMapDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "problemMapDecl",
- "version" : "1.0.0"
- },
- "UUID" : "260c46a5-4e27-3575-9076-0ff72c9bf32a",
- "description" : "Map of problems with all known Information"
- }
- }, {
- "key" : {
- "name" : "reportDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "reportDecl",
- "version" : "1.0.0"
- },
- "UUID" : "788e86c5-26d6-3af1-b1ab-2d530a0a45fb",
- "description" : "Report of activities of a policy/task"
- }
- }, {
- "key" : {
- "name" : "timestampDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "timestampDecl",
- "version" : "1.0.0"
- },
- "UUID" : "4d385841-1db1-3ddc-bb7b-8b67b3c701ad",
- "description" : "Timestamp"
- }
- } ]
- }
- },
- "policies" : {
- "key" : {
- "name" : "PCVS-VpnSla_Policies",
- "version" : "1.0.0"
- },
- "policyMap" : {
- "entry" : [ {
- "key" : {
- "name" : "CustomerContextPolicy",
- "version" : "1.0.0"
- },
- "value" : {
- "policyKey" : {
- "name" : "CustomerContextPolicy",
- "version" : "1.0.0"
- },
- "template" : "FREEFORM",
- "state" : {
- "entry" : [ {
- "key" : "CustomerContextState",
- "value" : {
- "stateKey" : {
- "parentKeyName" : "CustomerContextPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "NULL",
- "localName" : "CustomerContextState"
- },
- "trigger" : {
- "name" : "CustomerContextEventIn",
- "version" : "1.0.0"
- },
- "stateOutputs" : {
- "entry" : [ {
- "key" : "CustomerContextState_Output_Direct",
- "value" : {
- "key" : {
- "parentKeyName" : "CustomerContextPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "CustomerContextState",
- "localName" : "CustomerContextState_Output_Direct"
- },
- "outgoingEvent" : {
- "name" : "ReportOut",
- "version" : "1.0.0"
- },
- "nextState" : {
- "parentKeyName" : "NULL",
- "parentKeyVersion" : "0.0.0",
- "parentLocalName" : "NULL",
- "localName" : "NULL"
- }
- }
- } ]
- },
- "contextAlbumReference" : [ ],
- "taskSelectionLogic" : {
- "key" : "NULL",
- "logicFlavour" : "UNDEFINED",
- "logic" : ""
- },
- "stateFinalizerLogicMap" : {
- "entry" : [ ]
- },
- "defaultTask" : {
- "name" : "CustomerContextTask",
- "version" : "1.0.0"
- },
- "taskReferences" : {
- "entry" : [ {
- "key" : {
- "name" : "CustomerContextTask",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "parentKeyName" : "CustomerContextPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "CustomerContextState",
- "localName" : "doContext"
- },
- "outputType" : "DIRECT",
- "output" : {
- "parentKeyName" : "CustomerContextPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "CustomerContextState",
- "localName" : "CustomerContextState_Output_Direct"
- }
- }
- } ]
- }
- }
- } ]
- },
- "firstState" : "CustomerContextState"
- }
- }, {
- "key" : {
- "name" : "EdgeContextPolicy",
- "version" : "1.0.0"
- },
- "value" : {
- "policyKey" : {
- "name" : "EdgeContextPolicy",
- "version" : "1.0.0"
- },
- "template" : "FREEFORM",
- "state" : {
- "entry" : [ {
- "key" : "EdgeContextState",
- "value" : {
- "stateKey" : {
- "parentKeyName" : "EdgeContextPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "NULL",
- "localName" : "EdgeContextState"
- },
- "trigger" : {
- "name" : "EdgeContextEventIn",
- "version" : "1.0.0"
- },
- "stateOutputs" : {
- "entry" : [ {
- "key" : "EdgeContextState_Output_Direct",
- "value" : {
- "key" : {
- "parentKeyName" : "EdgeContextPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "EdgeContextState",
- "localName" : "EdgeContextState_Output_Direct"
- },
- "outgoingEvent" : {
- "name" : "ReportOut",
- "version" : "1.0.0"
- },
- "nextState" : {
- "parentKeyName" : "NULL",
- "parentKeyVersion" : "0.0.0",
- "parentLocalName" : "NULL",
- "localName" : "NULL"
- }
- }
- } ]
- },
- "contextAlbumReference" : [ ],
- "taskSelectionLogic" : {
- "key" : "NULL",
- "logicFlavour" : "UNDEFINED",
- "logic" : ""
- },
- "stateFinalizerLogicMap" : {
- "entry" : [ ]
- },
- "defaultTask" : {
- "name" : "EdgeContextTask",
- "version" : "1.0.0"
- },
- "taskReferences" : {
- "entry" : [ {
- "key" : {
- "name" : "EdgeContextTask",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "parentKeyName" : "EdgeContextPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "EdgeContextState",
- "localName" : "doContext"
- },
- "outputType" : "DIRECT",
- "output" : {
- "parentKeyName" : "EdgeContextPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "EdgeContextState",
- "localName" : "EdgeContextState_Output_Direct"
- }
- }
- } ]
- }
- }
- } ]
- },
- "firstState" : "EdgeContextState"
- }
- }, {
- "key" : {
- "name" : "NodeContextPolicy",
- "version" : "1.0.0"
- },
- "value" : {
- "policyKey" : {
- "name" : "NodeContextPolicy",
- "version" : "1.0.0"
- },
- "template" : "FREEFORM",
- "state" : {
- "entry" : [ {
- "key" : "NodeContextState",
- "value" : {
- "stateKey" : {
- "parentKeyName" : "NodeContextPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "NULL",
- "localName" : "NodeContextState"
- },
- "trigger" : {
- "name" : "NodeContextEventIn",
- "version" : "1.0.0"
- },
- "stateOutputs" : {
- "entry" : [ {
- "key" : "NodeContextState_Output_Direct",
- "value" : {
- "key" : {
- "parentKeyName" : "NodeContextPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "NodeContextState",
- "localName" : "NodeContextState_Output_Direct"
- },
- "outgoingEvent" : {
- "name" : "ReportOut",
- "version" : "1.0.0"
- },
- "nextState" : {
- "parentKeyName" : "NULL",
- "parentKeyVersion" : "0.0.0",
- "parentLocalName" : "NULL",
- "localName" : "NULL"
- }
- }
- } ]
- },
- "contextAlbumReference" : [ ],
- "taskSelectionLogic" : {
- "key" : "NULL",
- "logicFlavour" : "UNDEFINED",
- "logic" : ""
- },
- "stateFinalizerLogicMap" : {
- "entry" : [ ]
- },
- "defaultTask" : {
- "name" : "NodeContextTask",
- "version" : "1.0.0"
- },
- "taskReferences" : {
- "entry" : [ {
- "key" : {
- "name" : "NodeContextTask",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "parentKeyName" : "NodeContextPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "NodeContextState",
- "localName" : "doContext"
- },
- "outputType" : "DIRECT",
- "output" : {
- "parentKeyName" : "NodeContextPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "NodeContextState",
- "localName" : "NodeContextState_Output_Direct"
- }
- }
- } ]
- }
- }
- } ]
- },
- "firstState" : "NodeContextState"
- }
- }, {
- "key" : {
- "name" : "VpnSlaPolicy",
- "version" : "1.0.0"
- },
- "value" : {
- "policyKey" : {
- "name" : "VpnSlaPolicy",
- "version" : "1.0.0"
- },
- "template" : "FREEFORM",
- "state" : {
- "entry" : [ {
- "key" : "VpnSlaPolicyActState",
- "value" : {
- "stateKey" : {
- "parentKeyName" : "VpnSlaPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "NULL",
- "localName" : "VpnSlaPolicyActState"
- },
- "trigger" : {
- "name" : "VpnSlaDecideOut",
- "version" : "1.0.0"
- },
- "stateOutputs" : {
- "entry" : [ {
- "key" : "SlaPolicyAct_Output_Direct",
- "value" : {
- "key" : {
- "parentKeyName" : "VpnSlaPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "VpnSlaPolicyActState",
- "localName" : "SlaPolicyAct_Output_Direct"
- },
- "outgoingEvent" : {
- "name" : "VpnSlaActOut",
- "version" : "1.0.0"
- },
- "nextState" : {
- "parentKeyName" : "NULL",
- "parentKeyVersion" : "0.0.0",
- "parentLocalName" : "NULL",
- "localName" : "NULL"
- }
- }
- } ]
- },
- "contextAlbumReference" : [ ],
- "taskSelectionLogic" : {
- "key" : "NULL",
- "logicFlavour" : "UNDEFINED",
- "logic" : ""
- },
- "stateFinalizerLogicMap" : {
- "entry" : [ ]
- },
- "defaultTask" : {
- "name" : "VpnSlaPolicyActTask",
- "version" : "1.0.0"
- },
- "taskReferences" : {
- "entry" : [ {
- "key" : {
- "name" : "VpnSlaPolicyActTask",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "parentKeyName" : "VpnSlaPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "VpnSlaPolicyActState",
- "localName" : "act"
- },
- "outputType" : "DIRECT",
- "output" : {
- "parentKeyName" : "VpnSlaPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "VpnSlaPolicyActState",
- "localName" : "SlaPolicyAct_Output_Direct"
- }
- }
- } ]
- }
- }
- }, {
- "key" : "VpnSlaPolicyDecideState",
- "value" : {
- "stateKey" : {
- "parentKeyName" : "VpnSlaPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "NULL",
- "localName" : "VpnSlaPolicyDecideState"
- },
- "trigger" : {
- "name" : "VpnSlaEstablishOut",
- "version" : "1.0.0"
- },
- "stateOutputs" : {
- "entry" : [ {
- "key" : "VpnSlaPolicyDecide_Output_Direct",
- "value" : {
- "key" : {
- "parentKeyName" : "VpnSlaPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "VpnSlaPolicyDecideState",
- "localName" : "VpnSlaPolicyDecide_Output_Direct"
- },
- "outgoingEvent" : {
- "name" : "VpnSlaDecideOut",
- "version" : "1.0.0"
- },
- "nextState" : {
- "parentKeyName" : "VpnSlaPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "NULL",
- "localName" : "VpnSlaPolicyActState"
- }
- }
- } ]
- },
- "contextAlbumReference" : [ {
- "name" : "albumProblemMap",
- "version" : "0.0.1"
- } ],
- "taskSelectionLogic" : {
- "key" : "TaskSelectionLogic",
- "logicFlavour" : "JAVASCRIPT",
- "logic" : "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nload(\"nashorn:mozilla_compat.js\");\nimportClass(org.slf4j.LoggerFactory);\n\nvar logger = executor.logger;\nlogger.trace(\"start: \" + executor.subject.id + \" - TSL\");\n\nvar rootLogger = LoggerFactory.getLogger(logger.ROOT_LOGGER_NAME);\n\nvar ifSituation = executor.inFields[\"situation\"];\n\nvar albumProblemMap = executor.getContextAlbum(\"albumProblemMap\");\n\nvar returnValueType = Java.type(\"java.lang.Boolean\");\nif (ifSituation.get(\"problemID\") == \"NONE\") {\n logger.trace(\"-- situation has no problem, selecting <VpnSlaPolicyDecideNoneTask>\");\n executor.subject.getTaskKey(\"VpnSlaPolicyDecideNoneTask\").copyTo(executor.selectedTask);\n var returnValue = new returnValueType(true);\n} else if (albumProblemMap.get(ifSituation.get(\"problemID\")).get(\"status\") == \"SOLVED\") {\n logger.trace(\"-- situation is solved, selecting <VpnSlaPolicyDecideSolvedTask>\");\n executor.subject.getTaskKey(\"VpnSlaPolicyDecideSolvedTask\").copyTo(executor.selectedTask);\n var returnValue = new returnValueType(true);\n} else if (ifSituation.get(\"violatedSLAs\") != null && ifSituation.get(\"violatedSLAs\").size() > 0) {\n logger.trace(\"-- situation is problem with violations, selecting <VpnSlaPolicyDecidePriorityTask>\");\n executor.subject.getTaskKey(\"VpnSlaPolicyDecidePriorityTask\").copyTo(executor.selectedTask);\n var returnValue = new returnValueType(true);\n} else if (ifSituation.get(\"violatedSLAs\") != null && ifSituation.get(\"violatedSLAs\").size() == 0) {\n logger.trace(\"-- situation is problem without violations, selecting <VpnSlaPolicyDecideSlaTask>\");\n executor.subject.getTaskKey(\"VpnSlaPolicyDecideSlaTask\").copyTo(executor.selectedTask);\n var returnValue = new returnValueType(true);\n} else {\n logger.error(\"-- detected unknown decision for situation <\" + ifSituation.get(\"problemID\") + \">\");\n rootLogger.error(executor.subject.id + \" \" + \"-- detected unknown decision for situation <\"\n + ifSituation.get(\"problemID\") + \">\");\n var returnValue = new returnValueType(false);\n}\n\nlogger.trace(\"finished: \" + executor.subject.id);\nlogger.debug(\".d-tsl\");"
- },
- "stateFinalizerLogicMap" : {
- "entry" : [ ]
- },
- "defaultTask" : {
- "name" : "VpnSlaPolicyDecideSlaTask",
- "version" : "1.0.0"
- },
- "taskReferences" : {
- "entry" : [ {
- "key" : {
- "name" : "VpnSlaPolicyDecideSlaTask",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "parentKeyName" : "VpnSlaPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "VpnSlaPolicyDecideState",
- "localName" : "decideSla"
- },
- "outputType" : "DIRECT",
- "output" : {
- "parentKeyName" : "VpnSlaPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "VpnSlaPolicyDecideState",
- "localName" : "VpnSlaPolicyDecide_Output_Direct"
- }
- }
- }, {
- "key" : {
- "name" : "VpnSlaPolicyDecidePriorityTask",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "parentKeyName" : "VpnSlaPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "VpnSlaPolicyDecideState",
- "localName" : "decidePriority"
- },
- "outputType" : "DIRECT",
- "output" : {
- "parentKeyName" : "VpnSlaPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "VpnSlaPolicyDecideState",
- "localName" : "VpnSlaPolicyDecide_Output_Direct"
- }
- }
- }, {
- "key" : {
- "name" : "VpnSlaPolicyDecideSolvedTask",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "parentKeyName" : "VpnSlaPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "VpnSlaPolicyDecideState",
- "localName" : "decideNone"
- },
- "outputType" : "DIRECT",
- "output" : {
- "parentKeyName" : "VpnSlaPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "VpnSlaPolicyDecideState",
- "localName" : "VpnSlaPolicyDecide_Output_Direct"
- }
- }
- }, {
- "key" : {
- "name" : "VpnSlaPolicyDecideNoneTask",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "parentKeyName" : "VpnSlaPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "VpnSlaPolicyDecideState",
- "localName" : "decideNone"
- },
- "outputType" : "DIRECT",
- "output" : {
- "parentKeyName" : "VpnSlaPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "VpnSlaPolicyDecideState",
- "localName" : "VpnSlaPolicyDecide_Output_Direct"
- }
- }
- } ]
- }
- }
- }, {
- "key" : "VpnSlaPolicyMatchState",
- "value" : {
- "stateKey" : {
- "parentKeyName" : "VpnSlaPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "NULL",
- "localName" : "VpnSlaPolicyMatchState"
- },
- "trigger" : {
- "name" : "VpnSlaTrigger",
- "version" : "1.0.0"
- },
- "stateOutputs" : {
- "entry" : [ {
- "key" : "VpnSlaPolicyMatch_Output_Direct",
- "value" : {
- "key" : {
- "parentKeyName" : "VpnSlaPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "VpnSlaPolicyMatchState",
- "localName" : "VpnSlaPolicyMatch_Output_Direct"
- },
- "outgoingEvent" : {
- "name" : "VpnSlaMatchOut",
- "version" : "1.0.0"
- },
- "nextState" : {
- "parentKeyName" : "VpnSlaPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "NULL",
- "localName" : "VpmSlaPolicyEstablishState"
- }
- }
- } ]
- },
- "contextAlbumReference" : [ ],
- "taskSelectionLogic" : {
- "key" : "NULL",
- "logicFlavour" : "UNDEFINED",
- "logic" : ""
- },
- "stateFinalizerLogicMap" : {
- "entry" : [ ]
- },
- "defaultTask" : {
- "name" : "VpnSlaPolicyMatchTask",
- "version" : "1.0.0"
- },
- "taskReferences" : {
- "entry" : [ {
- "key" : {
- "name" : "VpnSlaPolicyMatchTask",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "parentKeyName" : "VpnSlaPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "VpnSlaPolicyMatchState",
- "localName" : "match"
- },
- "outputType" : "DIRECT",
- "output" : {
- "parentKeyName" : "VpnSlaPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "VpnSlaPolicyMatchState",
- "localName" : "VpnSlaPolicyMatch_Output_Direct"
- }
- }
- } ]
- }
- }
- }, {
- "key" : "VpmSlaPolicyEstablishState",
- "value" : {
- "stateKey" : {
- "parentKeyName" : "VpnSlaPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "NULL",
- "localName" : "VpmSlaPolicyEstablishState"
- },
- "trigger" : {
- "name" : "VpnSlaMatchOut",
- "version" : "1.0.0"
- },
- "stateOutputs" : {
- "entry" : [ {
- "key" : "VpnSlaPolicyEstablish_Output_Direct",
- "value" : {
- "key" : {
- "parentKeyName" : "VpnSlaPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "VpmSlaPolicyEstablishState",
- "localName" : "VpnSlaPolicyEstablish_Output_Direct"
- },
- "outgoingEvent" : {
- "name" : "VpnSlaEstablishOut",
- "version" : "1.0.0"
- },
- "nextState" : {
- "parentKeyName" : "VpnSlaPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "NULL",
- "localName" : "VpnSlaPolicyDecideState"
- }
- }
- } ]
- },
- "contextAlbumReference" : [ ],
- "taskSelectionLogic" : {
- "key" : "NULL",
- "logicFlavour" : "UNDEFINED",
- "logic" : ""
- },
- "stateFinalizerLogicMap" : {
- "entry" : [ ]
- },
- "defaultTask" : {
- "name" : "VpnSlaPolicyEstablishTask",
- "version" : "1.0.0"
- },
- "taskReferences" : {
- "entry" : [ {
- "key" : {
- "name" : "VpnSlaPolicyEstablishTask",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "parentKeyName" : "VpnSlaPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "VpmSlaPolicyEstablishState",
- "localName" : "establish"
- },
- "outputType" : "DIRECT",
- "output" : {
- "parentKeyName" : "VpnSlaPolicy",
- "parentKeyVersion" : "1.0.0",
- "parentLocalName" : "VpmSlaPolicyEstablishState",
- "localName" : "VpnSlaPolicyEstablish_Output_Direct"
- }
- }
- } ]
- }
- }
- } ]
- },
- "firstState" : "VpnSlaPolicyMatchState"
- }
- } ]
- }
- },
- "tasks" : {
- "key" : {
- "name" : "PCVS-VpnSla_Tasks",
- "version" : "1.0.0"
- },
- "taskMap" : {
- "entry" : [ {
- "key" : {
- "name" : "CustomerContextTask",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "CustomerContextTask",
- "version" : "1.0.0"
- },
- "inputFields" : {
- "entry" : [ {
- "key" : "links",
- "value" : {
- "key" : "links",
- "fieldSchemaKey" : {
- "name" : "ctxtCustomerLinksDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "priority",
- "value" : {
- "key" : "priority",
- "fieldSchemaKey" : {
- "name" : "ctxtCustomerPriorityDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "satisfaction",
- "value" : {
- "key" : "satisfaction",
- "fieldSchemaKey" : {
- "name" : "ctxtCustomerSatisfactionDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "customerName",
- "value" : {
- "key" : "customerName",
- "fieldSchemaKey" : {
- "name" : "ctxtCustomerNameDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "dtYTD",
- "value" : {
- "key" : "dtYTD",
- "fieldSchemaKey" : {
- "name" : "ctxtCustomerDowntimeYTDDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "dtSLA",
- "value" : {
- "key" : "dtSLA",
- "fieldSchemaKey" : {
- "name" : "ctxtCustomerDowntimeSLADecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- } ]
- },
- "outputFields" : {
- "entry" : [ {
- "key" : "report",
- "value" : {
- "key" : "report",
- "fieldSchemaKey" : {
- "name" : "reportDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- } ]
- },
- "taskParameters" : {
- "entry" : [ ]
- },
- "contextAlbumReference" : [ {
- "name" : "albumCustomerMap",
- "version" : "0.0.1"
- }, {
- "name" : "albumTopoEdges",
- "version" : "0.0.1"
- } ],
- "taskLogic" : {
- "key" : "TaskLogic",
- "logicFlavour" : "JAVASCRIPT",
- "logic" : "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nload(\"nashorn:mozilla_compat.js\");\n\nvar logger = executor.logger;\nlogger.trace(\"start: \" + executor.subject.id);\nlogger.trace(\"-- infields: \" + executor.inFields);\n\nvar ifCustomerName = executor.inFields[\"customerName\"];\nvar ifLinks = executor.inFields[\"links\"];\n\nlogger.trace(\"-- got infields, testing existing customer\");\nvar ctxtCustomer = executor.getContextAlbum(\"albumCustomerMap\").get(ifCustomerName);\nif (ctxtCustomer != null) {\n executor.getContextAlbum(\"albumCustomerMap\").remove(ifCustomerName);\n logger.trace(\"-- removed customer: <\" + ifCustomerName + \">\");\n}\n\nlogger.trace(\"-- creating customer: <\" + ifCustomerName + \">\");\nvar links = new Array();\nfor (var i = 0; i < ifLinks.split(\" \").length; i++) {\n var link = executor.getContextAlbum(\"albumTopoEdges\").get(ifLinks.split(\" \")[i]);\n if (link != null) {\n logger.trace(\"-- link: <\" + ifLinks.split(\" \")[i] + \">\");\n links.push(ifLinks.split(\" \")[i]);\n } else {\n logger.trace(\"-- unknown link: <\" + ifLinks.split(\" \")[i] + \"> for customer <\" + ifCustomerName + \">\");\n }\n}\nlogger.trace(\"-- links: <\" + links + \">\");\nctxtCustomer = \"{customerName:\" + ifCustomerName + \", dtSLA:\" + executor.inFields[\"dtSLA\"] + \", dtYTD:\"\n + executor.inFields[\"dtYTD\"] + \", priority:\" + executor.inFields[\"priority\"] + \", satisfaction:\"\n + executor.inFields[\"satisfaction\"] + \", links:[\" + links + \"]}\";\n\nexecutor.getContextAlbum(\"albumCustomerMap\").put(ifCustomerName, ctxtCustomer);\n\nif (logger.isTraceEnabled()) {\n logger.trace(\" >> *** Customers ***\");\n if (executor.getContextAlbum(\"albumCustomerMap\") != null) {\n for (var i = 0; i < executor.getContextAlbum(\"albumCustomerMap\").values().size(); i++) {\n logger.trace(\" >> >> \" + executor.getContextAlbum(\"albumCustomerMap\").values().get(i).get(\"customerName\")\n + \" : \" + \"dtSLA=\" + executor.getContextAlbum(\"albumCustomerMap\").values().get(i).get(\"dtSLA\")\n + \" : \" + \"dtYTD=\" + executor.getContextAlbum(\"albumCustomerMap\").values().get(i).get(\"dtYTD\")\n + \" : \" + \"links=\" + executor.getContextAlbum(\"albumCustomerMap\").values().get(i).get(\"links\")\n + \" : \" + \"priority=\"\n + executor.getContextAlbum(\"albumCustomerMap\").values().get(i).get(\"priority\") + \" : \"\n + \"satisfaction=\"\n + executor.getContextAlbum(\"albumCustomerMap\").values().get(i).get(\"satisfaction\"));\n }\n } else {\n logger.trace(\" >> >> customer album is null\");\n }\n}\n\nexecutor.outFields[\"report\"] = \"customer ctxt :: added customer: \" + ifCustomerName;\n\nlogger.info(\"vpnsla: ctxt added customer \" + ifCustomerName);\n\nvar returnValueType = Java.type(\"java.lang.Boolean\");\nvar returnValue = new returnValueType(true);\nlogger.trace(\"finished: \" + executor.subject.id);\nlogger.debug(\".\");"
- }
- }
- }, {
- "key" : {
- "name" : "EdgeContextTask",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "EdgeContextTask",
- "version" : "1.0.0"
- },
- "inputFields" : {
- "entry" : [ {
- "key" : "edgeName",
- "value" : {
- "key" : "edgeName",
- "fieldSchemaKey" : {
- "name" : "ctxtEdgeNameDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "start",
- "value" : {
- "key" : "start",
- "fieldSchemaKey" : {
- "name" : "ctxtEdgeStartDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "end",
- "value" : {
- "key" : "end",
- "fieldSchemaKey" : {
- "name" : "ctxtEdgeEndDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "status",
- "value" : {
- "key" : "status",
- "fieldSchemaKey" : {
- "name" : "ctxtEdgeStatusDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- } ]
- },
- "outputFields" : {
- "entry" : [ {
- "key" : "report",
- "value" : {
- "key" : "report",
- "fieldSchemaKey" : {
- "name" : "reportDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- } ]
- },
- "taskParameters" : {
- "entry" : [ ]
- },
- "contextAlbumReference" : [ {
- "name" : "albumTopoEdges",
- "version" : "0.0.1"
- } ],
- "taskLogic" : {
- "key" : "TaskLogic",
- "logicFlavour" : "JAVASCRIPT",
- "logic" : "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nload(\"nashorn:mozilla_compat.js\");\n\nvar logger = executor.logger;\nlogger.trace(\"start: \" + executor.subject.id);\nlogger.trace(\"-- infields: \" + executor.inFields);\n\nvar ifEdgeName = executor.inFields[\"edgeName\"];\nvar ifEdgeStatus = executor.inFields[\"status\"];\n\nvar albumTopoEdges = executor.getContextAlbum(\"albumTopoEdges\");\n\nlogger.trace(\"-- got infields, testing existing edge\");\n\nvar ctxtEdge = albumTopoEdges.get(ifEdgeName);\nif (ctxtEdge != null) {\n albumTopoEdges.remove(ifEdgeName);\n logger.trace(\"-- removed edge: <\" + ifEdgeName + \">\");\n}\n\nlogger.trace(\"-- creating edge: <\" + ifEdgeName + \">\");\nctxtEdge = \"{name:\" + ifEdgeName + \", start:\" + executor.inFields[\"start\"] + \", end:\" + executor.inFields[\"end\"]\n + \", active:\" + ifEdgeStatus + \"}\";\nalbumTopoEdges.put(ifEdgeName, ctxtEdge);\n\nif (logger.isTraceEnabled()) {\n logger.trace(\" >> *** Edges ***\");\n if (albumTopoEdges != null) {\n for (var i = 0; i < albumTopoEdges.values().size(); i++) {\n logger.trace(\" >> >> \" + albumTopoEdges.values().get(i).get(\"name\") + \" \\t \"\n + albumTopoEdges.values().get(i).get(\"start\") + \" --> \" + albumTopoEdges.values().get(i).get(\"end\")\n + \" \\t \" + albumTopoEdges.values().get(i).get(\"active\"));\n }\n } else {\n logger.trace(\" >> >> edge album is null\");\n }\n}\n\nexecutor.outFields[\"report\"] = \"edge ctxt :: added edge \" + ifEdgeName;\n\nlogger.info(\"vpnsla: ctxt added edge \" + ifEdgeName);\n\nvar returnValueType = Java.type(\"java.lang.Boolean\");\nvar returnValue = new returnValueType(true);\nlogger.trace(\"finished: \" + executor.subject.id);\nlogger.debug(\".\");"
- }
- }
- }, {
- "key" : {
- "name" : "NodeContextTask",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "NodeContextTask",
- "version" : "1.0.0"
- },
- "inputFields" : {
- "entry" : [ {
- "key" : "mininetName",
- "value" : {
- "key" : "mininetName",
- "fieldSchemaKey" : {
- "name" : "ctxtNodeMininetNameDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "nodeName",
- "value" : {
- "key" : "nodeName",
- "fieldSchemaKey" : {
- "name" : "ctxtNodeNameDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- } ]
- },
- "outputFields" : {
- "entry" : [ {
- "key" : "report",
- "value" : {
- "key" : "report",
- "fieldSchemaKey" : {
- "name" : "reportDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- } ]
- },
- "taskParameters" : {
- "entry" : [ ]
- },
- "contextAlbumReference" : [ {
- "name" : "albumTopoNodes",
- "version" : "0.0.1"
- } ],
- "taskLogic" : {
- "key" : "TaskLogic",
- "logicFlavour" : "JAVASCRIPT",
- "logic" : "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nload(\"nashorn:mozilla_compat.js\");\n\nvar logger = executor.logger;\nlogger.trace(\"start: \" + executor.subject.id);\nlogger.trace(\"-- infields: \" + executor.inFields);\n\nvar ifNodeName = executor.inFields[\"nodeName\"];\nvar ifMininetName = executor.inFields[\"mininetName\"];\n\nvar albumTopoNodes = executor.getContextAlbum(\"albumTopoNodes\");\n\nlogger.trace(\"-- got infields, testing existing node\");\n\nvar ctxtNode = albumTopoNodes.get(ifNodeName);\nif (ctxtNode != null) {\n albumTopoNodes.remove(ifNodeName);\n logger.trace(\"-- removed node: <\" + ifNodeName + \">\");\n}\n\nlogger.trace(\"-- creating node: <\" + ifNodeName + \">\");\nctxtNode = \"{name:\" + ifNodeName + \", mnname:\" + ifMininetName + \"}\";\nalbumTopoNodes.put(ifNodeName, ctxtNode);\n\nif (logger.isTraceEnabled()) {\n logger.trace(\" >> *** Nodes ***\");\n if (albumTopoNodes != null) {\n for (var i = 0; i < albumTopoNodes.values().size(); i++) {\n logger.trace(\" >> >> \" + albumTopoNodes.values().get(i).get(\"name\") + \" : \"\n + albumTopoNodes.values().get(i).get(\"mnname\"));\n }\n } else {\n logger.trace(\" >> >> node album is null\");\n }\n}\n\nexecutor.outFields[\"report\"] = \"node ctxt :: added node \" + ifNodeName;\n\nlogger.info(\"vpnsla: ctxt added node \" + ifNodeName);\n\nvar returnValueType = Java.type(\"java.lang.Boolean\");\nvar returnValue = new returnValueType(true);\nlogger.trace(\"finished: \" + executor.subject.id);\nlogger.debug(\".\");"
- }
- }
- }, {
- "key" : {
- "name" : "VpnSlaPolicyActTask",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "VpnSlaPolicyActTask",
- "version" : "1.0.0"
- },
- "inputFields" : {
- "entry" : [ {
- "key" : "decision",
- "value" : {
- "key" : "decision",
- "fieldSchemaKey" : {
- "name" : "decideDecisionDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "matchStart",
- "value" : {
- "key" : "matchStart",
- "fieldSchemaKey" : {
- "name" : "timestampDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- } ]
- },
- "outputFields" : {
- "entry" : [ {
- "key" : "edgeName",
- "value" : {
- "key" : "edgeName",
- "fieldSchemaKey" : {
- "name" : "edgeNameDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "action",
- "value" : {
- "key" : "action",
- "fieldSchemaKey" : {
- "name" : "actionDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- } ]
- },
- "taskParameters" : {
- "entry" : [ ]
- },
- "contextAlbumReference" : [ {
- "name" : "albumCustomerMap",
- "version" : "0.0.1"
- }, {
- "name" : "albumProblemMap",
- "version" : "0.0.1"
- } ],
- "taskLogic" : {
- "key" : "TaskLogic",
- "logicFlavour" : "JAVASCRIPT",
- "logic" : "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nload(\"nashorn:mozilla_compat.js\");\n\nvar logger = executor.logger;\nlogger.trace(\"start: \" + executor.subject.id);\nlogger.trace(\"-- infields: \" + executor.inFields);\n\nvar ifDecision = executor.inFields[\"decision\"];\nvar ifMatchStart = executor.inFields[\"matchStart\"];\n\nvar albumCustomerMap = executor.getContextAlbum(\"albumCustomerMap\");\nvar albumProblemMap = executor.getContextAlbum(\"albumProblemMap\");\n\nswitch (ifDecision.get(\"decision\").toString()) {\ncase \"NONE\":\n executor.outFields[\"edgeName\"] = \"\";\n executor.outFields[\"action\"] = \"\";\n break;\ncase \"IMPEDE\":\n for (var i = 0; i < ifDecision.get(\"customers\").size(); i++) {\n customer = albumCustomerMap.get(ifDecision.get(\"customers\").get(i).toString());\n executor.outFields[\"edgeName\"] = customer.get(\"links\").get(0);\n executor.outFields[\"action\"] = \"firewall\";\n }\n break;\ncase \"REBUILD\":\n // finally solved, remove problem\n albumProblemMap.remove(ifDecision.get(\"problemID\"));\n executor.outFields[\"edgeName\"] = \"L10\"; // this is ###static###\n executor.outFields[\"action\"] = \"rebuild\"; // this is ###static###\n break;\ndefault:\n\n}\n\nvar returnValueType = Java.type(\"java.lang.Boolean\");\nvar returnValue = new returnValueType(true);\n\nif (executor.outFields[\"action\"] != \"\") {\n logger.info(\"vpnsla: action is to \" + executor.outFields[\"action\"] + \" \" + executor.outFields[\"edgeName\"]);\n} else {\n logger.info(\"vpnsla: no action required\");\n}\n\nlogger.trace(\"-- outfields: \" + executor.outFields);\nlogger.trace(\"finished: \" + executor.subject.id);\nlogger.debug(\".a\");\n\nvar now = new Date().getTime();\nlogger.info(\"VPN SLA finished in \" + (now - ifMatchStart) + \" ms\");"
- }
- }
- }, {
- "key" : {
- "name" : "VpnSlaPolicyDecideNoneTask",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "VpnSlaPolicyDecideNoneTask",
- "version" : "1.0.0"
- },
- "inputFields" : {
- "entry" : [ {
- "key" : "matchStart",
- "value" : {
- "key" : "matchStart",
- "fieldSchemaKey" : {
- "name" : "timestampDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "situation",
- "value" : {
- "key" : "situation",
- "fieldSchemaKey" : {
- "name" : "establishSituationDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- } ]
- },
- "outputFields" : {
- "entry" : [ {
- "key" : "decision",
- "value" : {
- "key" : "decision",
- "fieldSchemaKey" : {
- "name" : "decideDecisionDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "matchStart",
- "value" : {
- "key" : "matchStart",
- "fieldSchemaKey" : {
- "name" : "timestampDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- } ]
- },
- "taskParameters" : {
- "entry" : [ ]
- },
- "contextAlbumReference" : [ ],
- "taskLogic" : {
- "key" : "TaskLogic",
- "logicFlavour" : "JAVASCRIPT",
- "logic" : "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nload(\"nashorn:mozilla_compat.js\");\nimportClass(org.slf4j.LoggerFactory);\n\nimportClass(java.util.ArrayList);\n\nimportClass(org.apache.avro.generic.GenericData.Array);\nimportClass(org.apache.avro.generic.GenericRecord);\nimportClass(org.apache.avro.Schema);\n\nvar logger = executor.logger;\nlogger.trace(\"start: \" + executor.subject.id);\nlogger.trace(\"-- infields: \" + executor.inFields);\n\nvar rootLogger = LoggerFactory.getLogger(logger.ROOT_LOGGER_NAME);\n\nvar ifSituation = executor.inFields[\"situation\"];\n\n// create outfiled for decision\nvar decision = executor.subject.getOutFieldSchemaHelper(\"decision\").createNewInstance();\ndecision.put(\"description\", \"None, everything is ok\");\ndecision.put(\"decision\", \"NONE\");\ndecision.put(\"customers\", new ArrayList());\n\nvar returnValueType = Java.type(\"java.lang.Boolean\");\nif (ifSituation.get(\"problemID\") == \"NONE\") {\n logger.trace(\"-- no problem, everything ok\");\n var returnValue = new returnValueType(true);\n} else {\n logger.trace(\"-- wrong problemID <\" + problemID + \"> for NONE task, we should not be here\");\n rootLogger.error(executor.subject.id + \" \" + \"-- wrong problemID <\" + problemID\n + \"> for NONE task, we should not be here\");\n var returnValue = new returnValueType(false);\n}\n\nexecutor.outFields[\"decision\"] = decision;\n\nlogger.trace(\"finished: \" + executor.subject.id);\nlogger.debug(\".d-non\");"
- }
- }
- }, {
- "key" : {
- "name" : "VpnSlaPolicyDecidePriorityTask",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "VpnSlaPolicyDecidePriorityTask",
- "version" : "1.0.0"
- },
- "inputFields" : {
- "entry" : [ {
- "key" : "matchStart",
- "value" : {
- "key" : "matchStart",
- "fieldSchemaKey" : {
- "name" : "timestampDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "situation",
- "value" : {
- "key" : "situation",
- "fieldSchemaKey" : {
- "name" : "establishSituationDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- } ]
- },
- "outputFields" : {
- "entry" : [ {
- "key" : "decision",
- "value" : {
- "key" : "decision",
- "fieldSchemaKey" : {
- "name" : "decideDecisionDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "matchStart",
- "value" : {
- "key" : "matchStart",
- "fieldSchemaKey" : {
- "name" : "timestampDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- } ]
- },
- "taskParameters" : {
- "entry" : [ ]
- },
- "contextAlbumReference" : [ {
- "name" : "albumCustomerMap",
- "version" : "0.0.1"
- }, {
- "name" : "albumProblemMap",
- "version" : "0.0.1"
- } ],
- "taskLogic" : {
- "key" : "TaskLogic",
- "logicFlavour" : "JAVASCRIPT",
- "logic" : "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nload(\"nashorn:mozilla_compat.js\");\nimportClass(org.slf4j.LoggerFactory);\n\nimportClass(java.util.ArrayList);\n\nimportClass(org.apache.avro.generic.GenericData.Array);\nimportClass(org.apache.avro.generic.GenericRecord);\nimportClass(org.apache.avro.Schema);\n\nvar logger = executor.logger;\nlogger.trace(\"start: \" + executor.subject.id);\nlogger.trace(\"-- infields: \" + executor.inFields);\n\nvar rootLogger = LoggerFactory.getLogger(logger.ROOT_LOGGER_NAME);\n\nvar ifSituation = executor.inFields[\"situation\"];\n\nvar albumCustomerMap = executor.getContextAlbum(\"albumCustomerMap\");\nvar albumProblemMap = executor.getContextAlbum(\"albumProblemMap\");\n\n// create outfiled for decision\nvar decision = executor.subject.getOutFieldSchemaHelper(\"decision\").createNewInstance();\ndecision.put(\"description\", \"None, everything is ok\");\ndecision.put(\"decision\", \"IMPEDE\");\ndecision.put(\"problemID\", ifSituation.get(\"problemID\"));\ndecision.put(\"customers\", new ArrayList());\n\nvar problem = albumProblemMap.get(ifSituation.get(\"problemID\"));\nvar returnValueType = Java.type(\"java.lang.Boolean\");\nif (problem != null && ifSituation.get(\"violatedSLAs\").size() > 0) {\n logger.trace(\"-- impede by priority\");\n for (var i = 0; i < problem.get(\"edgeUsedBy\").size(); i++) {\n customerCtxt = albumCustomerMap.get(problem.get(\"edgeUsedBy\").get(i).toString());\n if (customerCtxt.get(\"priority\") == false) {\n decision.get(\"customers\").add(customerCtxt.get(\"customerName\"));\n }\n }\n var returnValue = new returnValueType(true);\n} else {\n logger.trace(\"-- wrong problemID <\" + ifSituation.get(\"problemID\") + \"> for PRIORITY task, we should not be here\");\n rootLogger.error(executor.subject.id + \" \" + \"-- wrong problemID <\" + ifSituation.get(\"problemID\")\n + \"> for PRIORITY task, we should not be here\");\n var returnValue = new returnValueType(false);\n}\n\n// set impededLast to decision[customers]\nproblem.get(\"impededLast\").clear();\nproblem.get(\"impededLast\").addAll(decision.get(\"customers\"));\n\nexecutor.outFields[\"decision\"] = decision;\nlogger.trace(\"-- decision: \" + decision);\n\nlogger.info(\"vpnsla: priority, impeding customers \" + decision.get(\"customers\"));\n\nlogger.trace(\"finished: \" + executor.subject.id);\nlogger.debug(\".d-pri\");"
- }
- }
- }, {
- "key" : {
- "name" : "VpnSlaPolicyDecideSlaTask",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "VpnSlaPolicyDecideSlaTask",
- "version" : "1.0.0"
- },
- "inputFields" : {
- "entry" : [ {
- "key" : "matchStart",
- "value" : {
- "key" : "matchStart",
- "fieldSchemaKey" : {
- "name" : "timestampDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "situation",
- "value" : {
- "key" : "situation",
- "fieldSchemaKey" : {
- "name" : "establishSituationDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- } ]
- },
- "outputFields" : {
- "entry" : [ {
- "key" : "decision",
- "value" : {
- "key" : "decision",
- "fieldSchemaKey" : {
- "name" : "decideDecisionDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "matchStart",
- "value" : {
- "key" : "matchStart",
- "fieldSchemaKey" : {
- "name" : "timestampDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- } ]
- },
- "taskParameters" : {
- "entry" : [ ]
- },
- "contextAlbumReference" : [ {
- "name" : "albumCustomerMap",
- "version" : "0.0.1"
- }, {
- "name" : "albumProblemMap",
- "version" : "0.0.1"
- } ],
- "taskLogic" : {
- "key" : "TaskLogic",
- "logicFlavour" : "JAVASCRIPT",
- "logic" : "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nload(\"nashorn:mozilla_compat.js\");\nimportClass(org.slf4j.LoggerFactory);\n\nimportClass(java.util.ArrayList);\n\nimportClass(org.apache.avro.generic.GenericData.Array);\nimportClass(org.apache.avro.generic.GenericRecord);\nimportClass(org.apache.avro.Schema);\n\nvar logger = executor.logger;\nlogger.trace(\"start: \" + executor.subject.id);\nlogger.trace(\"-- infields: \" + executor.inFields);\n\nvar rootLogger = LoggerFactory.getLogger(logger.ROOT_LOGGER_NAME);\n\nvar ifSituation = executor.inFields[\"situation\"];\n\nvar albumCustomerMap = executor.getContextAlbum(\"albumCustomerMap\");\nvar albumProblemMap = executor.getContextAlbum(\"albumProblemMap\");\n\n// create outfiled for decision\nvar decision = executor.subject.getOutFieldSchemaHelper(\"decision\").createNewInstance();\ndecision.put(\"description\", \"Impede given customers selected based on maximum SLA delta\");\ndecision.put(\"decision\", \"IMPEDE\");\ndecision.put(\"problemID\", ifSituation.get(\"problemID\"));\ndecision.put(\"customers\", new ArrayList());\n\nvar problem = albumProblemMap.get(ifSituation.get(\"problemID\"));\nvar returnValueType = Java.type(\"java.lang.Boolean\");\nif (problem != null && ifSituation.get(\"violatedSLAs\").size() == 0) {\n logger.trace(\"-- impede by maximum SLA\");\n var customer = \"\";\n var customerSla = 0;\n for (var i = 0; i < problem.get(\"edgeUsedBy\").size(); i++) {\n customerCtxt = albumCustomerMap.get(problem.get(\"edgeUsedBy\").get(i).toString());\n if (customerSla == 0) {\n customerSla = customerCtxt.get(\"dtSLA\") - customerCtxt.get(\"dtYTD\");\n }\n if ((customerCtxt.get(\"dtSLA\") - customerCtxt.get(\"dtYTD\")) >= customerSla) {\n customer = customerCtxt.get(\"customerName\");\n customerSla = (customerCtxt.get(\"dtSLA\") - customerCtxt.get(\"dtYTD\"));\n }\n }\n decision.get(\"customers\").add(customer);\n var returnValue = new returnValueType(true);\n} else {\n logger.trace(\"-- wrong problemID <\" + ifSituation.get(\"problemID\") + \"> for SLA task, we should not be here\");\n rootLogger.error(executor.subject.id + \" \" + \"-- wrong problemID <\" + ifSituation.get(\"problemID\")\n + \"> for SLA task, we should not be here\");\n var returnValue = new returnValueType(false);\n}\n\n// set impededLast to decision[customers]\nproblem.get(\"impededLast\").clear();\nproblem.get(\"impededLast\").addAll(decision.get(\"customers\"));\n\nexecutor.outFields[\"decision\"] = decision;\nlogger.trace(\"-- decision: \" + decision);\n\nlogger.info(\"vpnsla: sla balance, impeding customers \" + decision.get(\"customers\"));\n\nlogger.trace(\"finished: \" + executor.subject.id);\nlogger.debug(\".d-sla\");"
- }
- }
- }, {
- "key" : {
- "name" : "VpnSlaPolicyDecideSolvedTask",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "VpnSlaPolicyDecideSolvedTask",
- "version" : "1.0.0"
- },
- "inputFields" : {
- "entry" : [ {
- "key" : "matchStart",
- "value" : {
- "key" : "matchStart",
- "fieldSchemaKey" : {
- "name" : "timestampDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "situation",
- "value" : {
- "key" : "situation",
- "fieldSchemaKey" : {
- "name" : "establishSituationDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- } ]
- },
- "outputFields" : {
- "entry" : [ {
- "key" : "decision",
- "value" : {
- "key" : "decision",
- "fieldSchemaKey" : {
- "name" : "decideDecisionDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "matchStart",
- "value" : {
- "key" : "matchStart",
- "fieldSchemaKey" : {
- "name" : "timestampDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- } ]
- },
- "taskParameters" : {
- "entry" : [ ]
- },
- "contextAlbumReference" : [ {
- "name" : "albumProblemMap",
- "version" : "0.0.1"
- } ],
- "taskLogic" : {
- "key" : "TaskLogic",
- "logicFlavour" : "JAVASCRIPT",
- "logic" : "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nload(\"nashorn:mozilla_compat.js\");\nimportClass(org.slf4j.LoggerFactory);\n\nimportClass(java.util.ArrayList);\n\nimportClass(org.apache.avro.generic.GenericData.Array);\nimportClass(org.apache.avro.generic.GenericRecord);\nimportClass(org.apache.avro.Schema);\n\nvar logger = executor.logger;\nlogger.trace(\"start: \" + executor.subject.id);\nlogger.trace(\"-- infields: \" + executor.inFields);\n\nvar rootLogger = LoggerFactory.getLogger(logger.ROOT_LOGGER_NAME);\n\nvar ifSituation = executor.inFields[\"situation\"];\n\nvar albumProblemMap = executor.getContextAlbum(\"albumProblemMap\");\n\n// create outfiled for decision\nvar decision = executor.subject.getOutFieldSchemaHelper(\"decision\").createNewInstance();\ndecision.put(\"description\", \"None, everything is ok\");\ndecision.put(\"decision\", \"REBUILD\");\ndecision.put(\"customers\", new ArrayList());\ndecision.put(\"problemID\", ifSituation.get(\"problemID\"));\n\nvar returnValueType = Java.type(\"java.lang.Boolean\");\nif (albumProblemMap.get(ifSituation.get(\"problemID\")).get(\"status\") == \"SOLVED\") {\n logger.trace(\"-- problem solved\");\n var returnValue = new returnValueType(true);\n} else {\n logger.trace(\"-- wrong problemID <\" + problemID + \"> for SOLVED task, we should not be here\");\n rootLogger.error(executor.subject.id + \" \" + \"-- wrong problemID <\" + problemID\n + \"> for SOLVED task, we should not be here\");\n var returnValue = new returnValueType(false);\n}\n\nexecutor.outFields[\"decision\"] = decision;\n\nlogger.info(\"vpnsla: sla solved, problem solved\");\n\nlogger.trace(\"finished: \" + executor.subject.id);\nlogger.debug(\".d-non\");"
- }
- }
- }, {
- "key" : {
- "name" : "VpnSlaPolicyEstablishTask",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "VpnSlaPolicyEstablishTask",
- "version" : "1.0.0"
- },
- "inputFields" : {
- "entry" : [ {
- "key" : "edgeName",
- "value" : {
- "key" : "edgeName",
- "fieldSchemaKey" : {
- "name" : "edgeNameDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "hasChanged",
- "value" : {
- "key" : "hasChanged",
- "fieldSchemaKey" : {
- "name" : "edgeChangedDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "matchStart",
- "value" : {
- "key" : "matchStart",
- "fieldSchemaKey" : {
- "name" : "timestampDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "status",
- "value" : {
- "key" : "status",
- "fieldSchemaKey" : {
- "name" : "edgeStatusDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- } ]
- },
- "outputFields" : {
- "entry" : [ {
- "key" : "matchStart",
- "value" : {
- "key" : "matchStart",
- "fieldSchemaKey" : {
- "name" : "timestampDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "situation",
- "value" : {
- "key" : "situation",
- "fieldSchemaKey" : {
- "name" : "establishSituationDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- } ]
- },
- "taskParameters" : {
- "entry" : [ ]
- },
- "contextAlbumReference" : [ {
- "name" : "albumCustomerMap",
- "version" : "0.0.1"
- }, {
- "name" : "albumProblemMap",
- "version" : "0.0.1"
- } ],
- "taskLogic" : {
- "key" : "TaskLogic",
- "logicFlavour" : "JAVASCRIPT",
- "logic" : "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nload(\"nashorn:mozilla_compat.js\");\nimportClass(org.slf4j.LoggerFactory);\n\nimportClass(java.util.ArrayList);\n\nimportClass(org.apache.avro.generic.GenericData.Array);\nimportClass(org.apache.avro.generic.GenericRecord);\nimportClass(org.apache.avro.Schema);\n\nvar logger = executor.logger;\nlogger.trace(\"start: \" + executor.subject.id);\nlogger.trace(\"-- infields: \" + executor.inFields);\n\nvar rootLogger = LoggerFactory.getLogger(logger.ROOT_LOGGER_NAME);\n\nvar ifEdgeName = executor.inFields[\"edgeName\"];\nvar ifEdgeStatus = executor.inFields[\"status\"].toString();\nvar ifhasChanged = executor.inFields[\"hasChanged\"];\nvar ifMatchStart = executor.inFields[\"matchStart\"];\n\nvar albumCustomerMap = executor.getContextAlbum(\"albumCustomerMap\");\nvar albumProblemMap = executor.getContextAlbum(\"albumProblemMap\");\n\nvar linkProblem = albumProblemMap.get(ifEdgeName);\n\n// create outfiled for situation\nvar situation = executor.subject.getOutFieldSchemaHelper(\"situation\").createNewInstance();\nsituation.put(\"violatedSLAs\", new ArrayList());\n\n// create a string as states+hasChanged+linkProblem and switch over it\nvar switchTest = ifEdgeStatus + \":\" + ifhasChanged + \":\" + (linkProblem == null ? \"no\" : \"yes\");\nswitch (switchTest) {\ncase \"UP:false:no\":\n logger.trace(\"-- edge <\" + ifEdgeName + \"> UP:false:no => everything ok\");\n logger.info(\"vpnsla: everything ok\");\n situation.put(\"problemID\", \"NONE\");\n break;\ncase \"UP:false:yes\":\n logger.trace(\"-- edge <\" + ifEdgeName + \"> UP:false:yes ==> did we miss earlier up?, removing problem\");\n albumProblemMap.remove(ifEdgeName);\n linkProblem = null;\n situation.put(\"problemID\", \"NONE\");\n break;\ncase \"UP:true:no\":\n logger.trace(\"-- edge <\" + ifEdgeName + \"> UP:true:no ==> did we miss the earlier down?, creating new problem\");\n situation.put(\"problemID\", ifEdgeName);\n break;\ncase \"UP:true:yes\":\n logger.trace(\"-- edge <\" + ifEdgeName + \"> UP:true:yes ==> detected solution, link up again\");\n logger.info(\"vpnsla: problem solved\");\n linkProblem.put(\"endTime\", ifMatchStart);\n linkProblem.put(\"status\", \"SOLVED\");\n situation.put(\"problemID\", \"NONE\");\n break;\ncase \"DOWN:false:no\":\n logger.trace(\"-- edge <\" + ifEdgeName + \"> DOWN:false:no ==> did we miss an earlier down?, creating new problem\");\n situation.put(\"problemID\", ifEdgeName);\n break;\ncase \"DOWN:false:yes\":\n logger.trace(\"-- edge <\" + ifEdgeName + \"> DOWN:false:yes ==> problem STILL exists\");\n logger.info(\"vpnsla: problem still exists\");\n linkProblem.put(\"status\", \"STILL\");\n situation.put(\"problemID\", ifEdgeName);\n break;\ncase \"DOWN:true:no\":\n logger.trace(\"-- edge <\" + ifEdgeName + \"> DOWN:true:no ==> found NEW problem\");\n logger.info(\"vpnsla: this is a new problem\");\n situation.put(\"problemID\", ifEdgeName);\n break;\ncase \"DOWN:true:yes\":\n logger.trace(\"-- edge <\" + ifEdgeName\n + \"> DOWN:true:yes ==> did we miss to remove an earlier problem?, remove and create new problem\");\n linkProblem = null;\n situation.put(\"problemID\", ifEdgeName);\n break;\n\ndefault:\n logger.error(\"-- input wrong for edge\" + ifEdgeName + \": edge status <\" + ifEdgeStatus\n + \"> unknown or null on hasChanged <\" + ifhasChanged + \">\");\n rootLogger.error(\"-- input wrong for edge\" + ifEdgeName + \": edge status <\" + ifEdgeStatus\n + \"> unknown or null on hasChanged <\" + ifhasChanged + \">\");\n}\n\n// create new problem if situation requires it\nif (situation.get(\"problemID\").equals(ifEdgeName) && linkProblem == null) {\n logger.trace(\"-- edge <\" + ifEdgeName + \"> creating new problem\");\n linkProblem = albumProblemMap.getSchemaHelper().createNewInstance();\n linkProblem.put(\"edge\", ifEdgeName);\n linkProblem.put(\"startTime\", ifMatchStart);\n linkProblem.put(\"lastUpdate\", ifMatchStart);\n linkProblem.put(\"endTime\", 0);\n linkProblem.put(\"status\", \"NEW\");\n linkProblem.put(\"edgeUsedBy\", new ArrayList());\n linkProblem.put(\"impededLast\", new ArrayList());\n\n for (var i = 0; i < albumCustomerMap.values().size(); i++) {\n var customer = albumCustomerMap.values().get(i);\n var customerLinks = albumCustomerMap.values().get(i).get(\"links\");\n for (var k = 0; k < customerLinks.size(); k++) {\n if (customerLinks.get(k) == ifEdgeName) {\n linkProblem.get(\"edgeUsedBy\").add(customer.get(\"customerName\"));\n }\n }\n }\n albumProblemMap.put(ifEdgeName, linkProblem);\n logger.trace(\"-- edge <\" + ifEdgeName + \"> problem created as <\" + linkProblem + \">\");\n}\n\n// set dtYTD if situation requires it\nif (linkProblem != null && (linkProblem.get(\"status\") == \"STILL\" || linkProblem.get(\"status\") == \"SOLVED\")) {\n var linkDownTimeinSecs = (ifMatchStart - linkProblem.get(\"lastUpdate\")) / 1000;\n logger.trace(\"-- edge <\" + ifEdgeName + \"> down time: \" + linkDownTimeinSecs + \" s\");\n for (var k = 0; k < linkProblem.get(\"impededLast\").size(); k++) {\n for (var i = 0; i < albumCustomerMap.values().size(); i++) {\n var customer = albumCustomerMap.values().get(i);\n if (customer.get(\"customerName\").equals(linkProblem.get(\"impededLast\").get(k))) {\n logger.info(\"-- vpnsla: customer \" + customer.get(\"customerName\") + \" YDT downtime increased from \"\n + customer.get(\"dtYTD\") + \" to \" + (customer.get(\"dtYTD\") + linkDownTimeinSecs));\n customer.put(\"dtYTD\", (customer.get(\"dtYTD\") + linkDownTimeinSecs))\n }\n }\n }\n // set lastUpdate to this policy execution for next execution calculation\n linkProblem.put(\"lastUpdate\", ifMatchStart);\n}\n\n// check SLA violations if situation requires it\nif (linkProblem != null && linkProblem.get(\"status\") != \"SOLVED\") {\n logger.info(\">e> customer\\tDT SLA\\tDT YTD\\tviolation\");\n for (var i = 0; i < albumCustomerMap.values().size(); i++) {\n var customer = albumCustomerMap.values().get(i);\n if (customer.get(\"dtYTD\") > customer.get(\"dtSLA\")) {\n situation.get(\"violatedSLAs\").add(customer.get(\"customerName\"));\n logger.info(\">e> \" + customer.get(\"customerName\") + \"\\t\\t\" + customer.get(\"dtSLA\") + \"s\\t\"\n + customer.get(\"dtYTD\") + \"s\\t\" + \"!!\");\n } else {\n logger.info(\">e> \" + customer.get(\"customerName\") + \"\\t\\t\" + customer.get(\"dtSLA\") + \"s\\t\"\n + customer.get(\"dtYTD\") + \"s\");\n }\n }\n}\n\nexecutor.outFields[\"situation\"] = situation;\n\nlogger.trace(\"-- out fields <\" + executor.outFields + \">\");\n\nvar returnValueType = Java.type(\"java.lang.Boolean\");\nvar returnValue = new returnValueType(true);\nlogger.trace(\"finished: \" + executor.subject.id);\nlogger.debug(\".e\");"
- }
- }
- }, {
- "key" : {
- "name" : "VpnSlaPolicyMatchTask",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "VpnSlaPolicyMatchTask",
- "version" : "1.0.0"
- },
- "inputFields" : {
- "entry" : [ {
- "key" : "edgeName",
- "value" : {
- "key" : "edgeName",
- "fieldSchemaKey" : {
- "name" : "edgeNameDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "status",
- "value" : {
- "key" : "status",
- "fieldSchemaKey" : {
- "name" : "edgeStatusDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- } ]
- },
- "outputFields" : {
- "entry" : [ {
- "key" : "edgeName",
- "value" : {
- "key" : "edgeName",
- "fieldSchemaKey" : {
- "name" : "edgeNameDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "hasChanged",
- "value" : {
- "key" : "hasChanged",
- "fieldSchemaKey" : {
- "name" : "edgeChangedDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "matchStart",
- "value" : {
- "key" : "matchStart",
- "fieldSchemaKey" : {
- "name" : "timestampDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "status",
- "value" : {
- "key" : "status",
- "fieldSchemaKey" : {
- "name" : "edgeStatusDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- } ]
- },
- "taskParameters" : {
- "entry" : [ ]
- },
- "contextAlbumReference" : [ {
- "name" : "albumTopoEdges",
- "version" : "0.0.1"
- } ],
- "taskLogic" : {
- "key" : "TaskLogic",
- "logicFlavour" : "JAVASCRIPT",
- "logic" : "/*\n * ============LICENSE_START=======================================================\n * Copyright (C) 2016-2018 Ericsson. All rights reserved.\n * ================================================================================\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * \n * SPDX-License-Identifier: Apache-2.0\n * ============LICENSE_END=========================================================\n */\n\nload(\"nashorn:mozilla_compat.js\");\n\nvar now = new Date().getTime();\nexecutor.outFields[\"matchStart\"] = now;\n\nimportClass(org.slf4j.LoggerFactory);\n\nvar logger = executor.logger;\nlogger.trace(\"start: \" + executor.subject.id);\nlogger.trace(\"-- infields: \" + executor.inFields);\n\nvar rootLogger = LoggerFactory.getLogger(logger.ROOT_LOGGER_NAME);\n\nvar ifEdgeName = executor.inFields[\"edgeName\"];\nvar ifLinkStatus = executor.inFields[\"status\"];\n\nvar albumTopoEdges = executor.getContextAlbum(\"albumTopoEdges\");\n\nlogger.trace(\"-- got infields, checking albumTopoEdges changes\");\n\nvar active = false;\nswitch (ifLinkStatus.toString()) {\ncase \"UP\":\n active = true;\n break;\ncase \"DOWN\":\n active = false;\n break;\ndefault:\n active = false;\n logger.error(\"-- trigger sent unknown link status <\" + ifLinkStatus + \"> for link <\" + ifEdgeName + \">\");\n rootLogger.error(executor.subject.id + \" \" + \"-- trigger sent unknown link status <\" + ifLinkStatus\n + \"> for link <\" + ifEdgeName + \">\");\n}\n\nvar link = albumTopoEdges.get(ifEdgeName);\nif (link == null) {\n logger.trace(\"-- link <\" + ifEdgeName + \"> not in albumTopoEdges\");\n} else {\n logger.trace(\"-- found link <\" + link + \"> in albumTopoEdges\");\n logger.trace(\"-- active <\" + active + \"> : link.active <\" + link.get(\"active\") + \">\");\n if (active != link.get(\"active\")) {\n link.put(\"active\", active);\n logger.trace(\"-- link <\" + ifEdgeName + \"> status changed to <active:\" + link.get(\"active\") + \">\");\n executor.outFields[\"hasChanged\"] = true;\n } else {\n logger.trace(\"-- link <\" + ifEdgeName + \"> status not changed <active:\" + link.get(\"active\") + \">\");\n executor.outFields[\"hasChanged\"] = false;\n }\n}\n\nexecutor.outFields[\"edgeName\"] = ifEdgeName;\nexecutor.outFields[\"status\"] = ifLinkStatus;\n\nlogger.info(\"vpnsla: detected \" + ifEdgeName + \" as \" + ifLinkStatus);\n\nvar returnValueType = Java.type(\"java.lang.Boolean\");\nvar returnValue = new returnValueType(true);\nlogger.trace(\"finished: \" + executor.subject.id);\nlogger.debug(\".m\");"
- }
- }
- } ]
- }
- },
- "events" : {
- "key" : {
- "name" : "PCVS-VpnSla_Events",
- "version" : "1.0.0"
- },
- "eventMap" : {
- "entry" : [ {
- "key" : {
- "name" : "CustomerContextEventIn",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "CustomerContextEventIn",
- "version" : "1.0.0"
- },
- "nameSpace" : "org.onap.policy.apex.examples.pcvs.vpnsla",
- "source" : "CtxtManagement",
- "target" : "APEX",
- "parameter" : {
- "entry" : [ {
- "key" : "links",
- "value" : {
- "key" : "links",
- "fieldSchemaKey" : {
- "name" : "ctxtCustomerLinksDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "priority",
- "value" : {
- "key" : "priority",
- "fieldSchemaKey" : {
- "name" : "ctxtCustomerPriorityDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "satisfaction",
- "value" : {
- "key" : "satisfaction",
- "fieldSchemaKey" : {
- "name" : "ctxtCustomerSatisfactionDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "customerName",
- "value" : {
- "key" : "customerName",
- "fieldSchemaKey" : {
- "name" : "ctxtCustomerNameDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "dtYTD",
- "value" : {
- "key" : "dtYTD",
- "fieldSchemaKey" : {
- "name" : "ctxtCustomerDowntimeYTDDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "dtSLA",
- "value" : {
- "key" : "dtSLA",
- "fieldSchemaKey" : {
- "name" : "ctxtCustomerDowntimeSLADecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- } ]
- }
- }
- }, {
- "key" : {
- "name" : "EdgeContextEventIn",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "EdgeContextEventIn",
- "version" : "1.0.0"
- },
- "nameSpace" : "org.onap.policy.apex.examples.pcvs.vpnsla",
- "source" : "CtxtManagement",
- "target" : "APEX",
- "parameter" : {
- "entry" : [ {
- "key" : "edgeName",
- "value" : {
- "key" : "edgeName",
- "fieldSchemaKey" : {
- "name" : "ctxtEdgeNameDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "start",
- "value" : {
- "key" : "start",
- "fieldSchemaKey" : {
- "name" : "ctxtEdgeStartDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "end",
- "value" : {
- "key" : "end",
- "fieldSchemaKey" : {
- "name" : "ctxtEdgeEndDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "status",
- "value" : {
- "key" : "status",
- "fieldSchemaKey" : {
- "name" : "ctxtEdgeStatusDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- } ]
- }
- }
- }, {
- "key" : {
- "name" : "NodeContextEventIn",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "NodeContextEventIn",
- "version" : "1.0.0"
- },
- "nameSpace" : "org.onap.policy.apex.examples.pcvs.vpnsla",
- "source" : "CtxtManagement",
- "target" : "APEX",
- "parameter" : {
- "entry" : [ {
- "key" : "mininetName",
- "value" : {
- "key" : "mininetName",
- "fieldSchemaKey" : {
- "name" : "ctxtNodeMininetNameDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "nodeName",
- "value" : {
- "key" : "nodeName",
- "fieldSchemaKey" : {
- "name" : "ctxtNodeNameDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- } ]
- }
- }
- }, {
- "key" : {
- "name" : "ReportOut",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "ReportOut",
- "version" : "1.0.0"
- },
- "nameSpace" : "org.onap.policy.apex.examples.pcvs.vpnsla",
- "source" : "APEX",
- "target" : "CtxtManagement",
- "parameter" : {
- "entry" : [ {
- "key" : "report",
- "value" : {
- "key" : "report",
- "fieldSchemaKey" : {
- "name" : "reportDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- } ]
- }
- }
- }, {
- "key" : {
- "name" : "VpnSlaActOut",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "VpnSlaActOut",
- "version" : "1.0.0"
- },
- "nameSpace" : "org.onap.policy.apex.examples.pcvs.vpnsla",
- "source" : "SlaAct",
- "target" : "ActioningSystem",
- "parameter" : {
- "entry" : [ {
- "key" : "edgeName",
- "value" : {
- "key" : "edgeName",
- "fieldSchemaKey" : {
- "name" : "edgeNameDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "action",
- "value" : {
- "key" : "action",
- "fieldSchemaKey" : {
- "name" : "actionDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- } ]
- }
- }
- }, {
- "key" : {
- "name" : "VpnSlaDecideOut",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "VpnSlaDecideOut",
- "version" : "1.0.0"
- },
- "nameSpace" : "org.onap.policy.apex.examples.pcvs.vpnsla",
- "source" : "SlaDecide",
- "target" : "SlaAct",
- "parameter" : {
- "entry" : [ {
- "key" : "decision",
- "value" : {
- "key" : "decision",
- "fieldSchemaKey" : {
- "name" : "decideDecisionDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "matchStart",
- "value" : {
- "key" : "matchStart",
- "fieldSchemaKey" : {
- "name" : "timestampDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- } ]
- }
- }
- }, {
- "key" : {
- "name" : "VpnSlaEstablishOut",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "VpnSlaEstablishOut",
- "version" : "1.0.0"
- },
- "nameSpace" : "org.onap.policy.apex.examples.pcvs.vpnsla",
- "source" : "SlaEstablish",
- "target" : "SlaDecide",
- "parameter" : {
- "entry" : [ {
- "key" : "matchStart",
- "value" : {
- "key" : "matchStart",
- "fieldSchemaKey" : {
- "name" : "timestampDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "situation",
- "value" : {
- "key" : "situation",
- "fieldSchemaKey" : {
- "name" : "establishSituationDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- } ]
- }
- }
- }, {
- "key" : {
- "name" : "VpnSlaMatchOut",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "VpnSlaMatchOut",
- "version" : "1.0.0"
- },
- "nameSpace" : "org.onap.policy.apex.examples.pcvs.vpnsla",
- "source" : "VpnSlaMatch",
- "target" : "VpnSlaEstablish",
- "parameter" : {
- "entry" : [ {
- "key" : "edgeName",
- "value" : {
- "key" : "edgeName",
- "fieldSchemaKey" : {
- "name" : "edgeNameDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "hasChanged",
- "value" : {
- "key" : "hasChanged",
- "fieldSchemaKey" : {
- "name" : "edgeChangedDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "matchStart",
- "value" : {
- "key" : "matchStart",
- "fieldSchemaKey" : {
- "name" : "timestampDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "status",
- "value" : {
- "key" : "status",
- "fieldSchemaKey" : {
- "name" : "edgeStatusDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- } ]
- }
- }
- }, {
- "key" : {
- "name" : "VpnSlaTrigger",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "VpnSlaTrigger",
- "version" : "1.0.0"
- },
- "nameSpace" : "org.onap.policy.apex.examples.pcvs.vpnsla",
- "source" : "TriggerSys",
- "target" : "VpnSlaMatch",
- "parameter" : {
- "entry" : [ {
- "key" : "edgeName",
- "value" : {
- "key" : "edgeName",
- "fieldSchemaKey" : {
- "name" : "edgeNameDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- }, {
- "key" : "status",
- "value" : {
- "key" : "status",
- "fieldSchemaKey" : {
- "name" : "edgeStatusDecl",
- "version" : "1.0.0"
- },
- "optional" : false
- }
- } ]
- }
- }
- } ]
- }
- },
- "albums" : {
- "key" : {
- "name" : "PCVS-VpnSla_Albums",
- "version" : "1.0.0"
- },
- "albums" : {
- "entry" : [ {
- "key" : {
- "name" : "albumCustomerMap",
- "version" : "0.0.1"
- },
- "value" : {
- "key" : {
- "name" : "albumCustomerMap",
- "version" : "0.0.1"
- },
- "scope" : "global",
- "isWritable" : true,
- "itemSchema" : {
- "name" : "ctxtCustomerMapDecl",
- "version" : "1.0.0"
- }
- }
- }, {
- "key" : {
- "name" : "albumProblemMap",
- "version" : "0.0.1"
- },
- "value" : {
- "key" : {
- "name" : "albumProblemMap",
- "version" : "0.0.1"
- },
- "scope" : "global",
- "isWritable" : true,
- "itemSchema" : {
- "name" : "problemMapDecl",
- "version" : "1.0.0"
- }
- }
- }, {
- "key" : {
- "name" : "albumTopoEdges",
- "version" : "0.0.1"
- },
- "value" : {
- "key" : {
- "name" : "albumTopoEdges",
- "version" : "0.0.1"
- },
- "scope" : "global",
- "isWritable" : true,
- "itemSchema" : {
- "name" : "ctxtTopologyEdgesDecl",
- "version" : "1.0.0"
- }
- }
- }, {
- "key" : {
- "name" : "albumTopoNodes",
- "version" : "0.0.1"
- },
- "value" : {
- "key" : {
- "name" : "albumTopoNodes",
- "version" : "0.0.1"
- },
- "scope" : "global",
- "isWritable" : true,
- "itemSchema" : {
- "name" : "ctxtTopologyNodesDecl",
- "version" : "1.0.0"
- }
- }
- } ]
- }
- },
- "schemas" : {
- "key" : {
- "name" : "PCVS-VpnSla_Schemas",
- "version" : "1.0.0"
- },
- "schemas" : {
- "entry" : [ {
- "key" : {
- "name" : "actionDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "actionDecl",
- "version" : "1.0.0"
- },
- "schemaFlavour" : "Java",
- "schemaDefinition" : "java.lang.String"
- }
- }, {
- "key" : {
- "name" : "ctxtCustomerDowntimeSLADecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "ctxtCustomerDowntimeSLADecl",
- "version" : "1.0.0"
- },
- "schemaFlavour" : "Java",
- "schemaDefinition" : "java.lang.Integer"
- }
- }, {
- "key" : {
- "name" : "ctxtCustomerDowntimeYTDDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "ctxtCustomerDowntimeYTDDecl",
- "version" : "1.0.0"
- },
- "schemaFlavour" : "Java",
- "schemaDefinition" : "java.lang.Integer"
- }
- }, {
- "key" : {
- "name" : "ctxtCustomerLinksDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "ctxtCustomerLinksDecl",
- "version" : "1.0.0"
- },
- "schemaFlavour" : "Java",
- "schemaDefinition" : "java.lang.String"
- }
- }, {
- "key" : {
- "name" : "ctxtCustomerMapDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "ctxtCustomerMapDecl",
- "version" : "1.0.0"
- },
- "schemaFlavour" : "Avro",
- "schemaDefinition" : "{\n \"type\" : \"record\",\n \"name\" : \"Customer\",\n \"fields\" : [\n {\"name\" : \"customerName\", \"type\" : \"string\"},\n {\"name\" : \"dtSLA\" , \"type\" : \"int\"},\n {\"name\" : \"dtYTD\" , \"type\" : \"int\"},\n {\"name\" : \"priority\" , \"type\" : \"boolean\"},\n {\"name\" : \"satisfaction\", \"type\" : \"int\"},\n {\n \"name\": \"links\",\n \"doc\": \"Links used by this customer\",\n \"type\": {\"type\" : \"array\", \"items\" : \"string\"}\n }\n ]\n}"
- }
- }, {
- "key" : {
- "name" : "ctxtCustomerNameDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "ctxtCustomerNameDecl",
- "version" : "1.0.0"
- },
- "schemaFlavour" : "Java",
- "schemaDefinition" : "java.lang.String"
- }
- }, {
- "key" : {
- "name" : "ctxtCustomerPriorityDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "ctxtCustomerPriorityDecl",
- "version" : "1.0.0"
- },
- "schemaFlavour" : "Java",
- "schemaDefinition" : "java.lang.Boolean"
- }
- }, {
- "key" : {
- "name" : "ctxtCustomerSatisfactionDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "ctxtCustomerSatisfactionDecl",
- "version" : "1.0.0"
- },
- "schemaFlavour" : "Java",
- "schemaDefinition" : "java.lang.Integer"
- }
- }, {
- "key" : {
- "name" : "ctxtEdgeEndDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "ctxtEdgeEndDecl",
- "version" : "1.0.0"
- },
- "schemaFlavour" : "Java",
- "schemaDefinition" : "java.lang.String"
- }
- }, {
- "key" : {
- "name" : "ctxtEdgeNameDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "ctxtEdgeNameDecl",
- "version" : "1.0.0"
- },
- "schemaFlavour" : "Java",
- "schemaDefinition" : "java.lang.String"
- }
- }, {
- "key" : {
- "name" : "ctxtEdgeStartDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "ctxtEdgeStartDecl",
- "version" : "1.0.0"
- },
- "schemaFlavour" : "Java",
- "schemaDefinition" : "java.lang.String"
- }
- }, {
- "key" : {
- "name" : "ctxtEdgeStatusDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "ctxtEdgeStatusDecl",
- "version" : "1.0.0"
- },
- "schemaFlavour" : "Java",
- "schemaDefinition" : "java.lang.Boolean"
- }
- }, {
- "key" : {
- "name" : "ctxtNodeMininetNameDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "ctxtNodeMininetNameDecl",
- "version" : "1.0.0"
- },
- "schemaFlavour" : "Java",
- "schemaDefinition" : "java.lang.String"
- }
- }, {
- "key" : {
- "name" : "ctxtNodeNameDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "ctxtNodeNameDecl",
- "version" : "1.0.0"
- },
- "schemaFlavour" : "Java",
- "schemaDefinition" : "java.lang.String"
- }
- }, {
- "key" : {
- "name" : "ctxtTopologyEdgesDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "ctxtTopologyEdgesDecl",
- "version" : "1.0.0"
- },
- "schemaFlavour" : "Avro",
- "schemaDefinition" : "{\n \"type\" : \"record\",\n \"name\" : \"TopologyEdges\",\n \"fields\" : [\n {\"name\": \"name\", \"type\": \"string\", \"doc\": \"Name of the Edge, typically a link name\"},\n {\"name\": \"start\", \"type\": \"string\", \"doc\": \"Edge endpoint: start - a node name\"},\n {\"name\": \"end\", \"type\": \"string\", \"doc\": \"Edge endpoint: end - a node name\"},\n {\"name\": \"active\", \"type\": \"boolean\", \"doc\": \"Flag for active/inactive edges, inactive means a link is down\"}\n ]\n}"
- }
- }, {
- "key" : {
- "name" : "ctxtTopologyNodesDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "ctxtTopologyNodesDecl",
- "version" : "1.0.0"
- },
- "schemaFlavour" : "Avro",
- "schemaDefinition" : "{\n \"type\" : \"record\",\n \"name\" : \"TopologyNodes\",\n \"fields\" : [\n {\"name\" : \"name\", \"type\" : \"string\", \"doc\": \"The name of the node\"},\n {\"name\" : \"mnname\", \"type\" : \"string\", \"doc\": \"The name of the node in Mininet\"}\n ]\n}"
- }
- }, {
- "key" : {
- "name" : "decideDecisionDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "decideDecisionDecl",
- "version" : "1.0.0"
- },
- "schemaFlavour" : "Avro",
- "schemaDefinition" : "{\n \"type\" : \"record\",\n \"name\" : \"Situation\",\n \"fields\" : [\n {\"name\": \"description\", \"type\": \"string\", \"doc\": \"Description of the taken decision\"},\n {\n \"name\": \"decision\",\n \"doc\": \"taken decision\",\n \"type\": {\n \"type\": \"enum\",\n \"name\": \"decisionEnum\",\n \"symbols\" : [\n \"IMPEDE\",\n \"REBUILD\",\n \"NONE\"\n ]\n }\n },\n {\"name\": \"customers\", \"type\": {\"type\" : \"array\", \"items\" : \"string\"}, \"doc\": \"List of customers affected by the decision\"},\n {\"name\": \"problemID\", \"type\": \"string\", \"doc\": \"Identifier of the problem for lookup in problemMap\"}\n ]\n}"
- }
- }, {
- "key" : {
- "name" : "edgeChangedDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "edgeChangedDecl",
- "version" : "1.0.0"
- },
- "schemaFlavour" : "Java",
- "schemaDefinition" : "java.lang.Boolean"
- }
- }, {
- "key" : {
- "name" : "edgeNameDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "edgeNameDecl",
- "version" : "1.0.0"
- },
- "schemaFlavour" : "Java",
- "schemaDefinition" : "java.lang.String"
- }
- }, {
- "key" : {
- "name" : "edgeStatusDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "edgeStatusDecl",
- "version" : "1.0.0"
- },
- "schemaFlavour" : "Avro",
- "schemaDefinition" : "{\n \"type\": \"enum\",\n \"name\": \"Status\",\n \"symbols\" : [\n \"UP\",\n \"DOWN\"\n ]\n}"
- }
- }, {
- "key" : {
- "name" : "establishSituationDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "establishSituationDecl",
- "version" : "1.0.0"
- },
- "schemaFlavour" : "Avro",
- "schemaDefinition" : "{\n \"type\" : \"record\",\n \"name\" : \"Situation\",\n \"fields\" : [\n {\"name\": \"problemID\", \"type\": \"string\", \"doc\": \"Identifier of the problem for lookup in problemMap\"},\n {\"name\": \"violatedSLAs\", \"type\": {\"type\" : \"array\", \"items\" : \"string\"}, \"doc\": \"List of customers with SLA violations\"}\n ]\n}"
- }
- }, {
- "key" : {
- "name" : "problemMapDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "problemMapDecl",
- "version" : "1.0.0"
- },
- "schemaFlavour" : "Avro",
- "schemaDefinition" : "{\n \"type\" : \"record\",\n \"name\" : \"Problem\",\n \"fields\" : [\n {\"name\": \"edge\", \"type\": \"string\"},\n {\"name\": \"startTime\", \"type\": \"long\"},\n {\"name\": \"lastUpdate\", \"type\": \"long\"},\n {\"name\": \"endTime\", \"type\": \"long\"},\n {\n \"name\": \"status\",\n \"doc\": \"problem status\",\n \"type\": {\n \"type\": \"enum\",\n \"name\": \"statusEnum\",\n \"symbols\" : [\n \"NONE\",\n \"STILL\",\n \"SOLVED\",\n \"NEW\"\n ]\n }\n },\n {\n \"name\": \"edgeUsedBy\",\n \"doc\": \"customers using the edge\",\n \"type\": {\"type\" : \"array\", \"items\" : \"string\"}\n },\n {\n \"name\": \"impededLast\",\n \"doc\": \"customers last impeded\",\n \"type\": {\"type\" : \"array\", \"items\" : \"string\"}\n }\n ]\n}"
- }
- }, {
- "key" : {
- "name" : "reportDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "reportDecl",
- "version" : "1.0.0"
- },
- "schemaFlavour" : "Java",
- "schemaDefinition" : "java.lang.String"
- }
- }, {
- "key" : {
- "name" : "timestampDecl",
- "version" : "1.0.0"
- },
- "value" : {
- "key" : {
- "name" : "timestampDecl",
- "version" : "1.0.0"
- },
- "schemaFlavour" : "Java",
- "schemaDefinition" : "java.lang.Long"
- }
- } ]
- }
- }
- }
-} \ No newline at end of file