From 0cf967c0239a8ab9c8b8831b700b72d9a08f7b03 Mon Sep 17 00:00:00 2001 From: liamfallon Date: Fri, 16 Oct 2020 13:09:11 +0100 Subject: Remove apex asciidoc documents Apex documentation has now all been ported to use the ONAP recommended rst format. This review removes the old asciidoc documents. Issue-ID: POLICY-2824 Change-Id: I562bd344cb7d6ff36e7d54bdb8f95e3b656468f8 Signed-off-by: liamfallon --- .../site-docs/adoc/fragments/AnswerInitTask.adoc | 20 - .../adoc/fragments/AnswerInitiationEvents.adoc | 20 - .../adoc/fragments/ApexConfigRESTClient.adoc | 20 - .../adoc/fragments/ApexConfigRESTServer.adoc | 20 - .../adoc/fragments/DecisionMakerPolicyModel.adoc | 20 - .../adoc/fragments/DitheringAnswerTask.adoc | 20 - .../fragments/MakeDecisionExtraMode_Client.adoc | 20 - .../fragments/MakeDecisionExtraMode_Server.adoc | 20 - .../adoc/fragments/MakeDecisionStateTSL.adoc | 20 - .../adoc/fragments/MakeDecision_Client.adoc | 20 - .../adoc/fragments/MakeDecision_Server.adoc | 20 - .../adoc/fragments/OptimisticAnswerTask.adoc | 20 - .../adoc/fragments/PessimisticAnswerTask.adoc | 20 - .../site-docs/adoc/fragments/RandomAnswerTask.adoc | 20 - .../adoc/fragments/RoundRobinAnswerTask.adoc | 20 - .../site-docs/adoc/fragments/01-introduction.adoc | 25 - .../site-docs/adoc/fragments/02-data-models.adoc | 106 - .../site-docs/adoc/fragments/03-policy-step1.adoc | 23 - .../site-docs/adoc/fragments/031-s1-new-model.adoc | 26 - .../adoc/fragments/032-s1-new-events.adoc | 127 - .../adoc/fragments/033-s1-new-policy.adoc | 141 - .../adoc/fragments/034-s1-test-policy.adoc | 76 - .../site-docs/adoc/fragments/035-s1-clieditor.adoc | 23 - .../site-docs/adoc/fragments/04-policy-step2.adoc | 23 - .../adoc/fragments/041-s2-extend-model.adoc | 92 - .../adoc/fragments/042-s2-test-policy.adoc | 92 - .../site-docs/adoc/fragments/043-s2-clieditor.adoc | 23 - .../mfp/MyFirstPolicy_P1_exportPolicyModel1.png | Bin 8703 -> 0 bytes .../images/mfp/MyFirstPolicy_P1_newEvent1.png | Bin 15574 -> 0 bytes .../images/mfp/MyFirstPolicy_P1_newEvent2.png | Bin 22460 -> 0 bytes .../images/mfp/MyFirstPolicy_P1_newEvent3.png | Bin 26489 -> 0 bytes .../images/mfp/MyFirstPolicy_P1_newItemSchema1.png | Bin 14500 -> 0 bytes .../images/mfp/MyFirstPolicy_P1_newItemSchema2.png | Bin 23052 -> 0 bytes .../images/mfp/MyFirstPolicy_P1_newPolicy1.png | Bin 31495 -> 0 bytes .../mfp/MyFirstPolicy_P1_newPolicyModel1.png | Bin 8490 -> 0 bytes .../mfp/MyFirstPolicy_P1_newPolicyModel2.png | Bin 12696 -> 0 bytes .../images/mfp/MyFirstPolicy_P1_newState1.png | Bin 41125 -> 0 bytes .../images/mfp/MyFirstPolicy_P1_newState2.png | Bin 50884 -> 0 bytes .../images/mfp/MyFirstPolicy_P1_newTask1.png | Bin 22442 -> 0 bytes .../images/mfp/MyFirstPolicy_P1_newTask2.png | Bin 27079 -> 0 bytes .../images/mfp/MyFirstPolicy_P1_newTask3.png | Bin 37331 -> 0 bytes .../mfp/MyFirstPolicy_P1_validatePolicyModel.png | Bin 9031 -> 0 bytes .../images/mfp/MyFirstPolicy_P2_editPolicy1.png | Bin 26097 -> 0 bytes .../images/mfp/MyFirstPolicy_P2_editState1.png | Bin 97378 -> 0 bytes .../images/mfp/MyFirstPolicy_P2_newTask1.png | Bin 113275 -> 0 bytes .../src/site-docs/adoc/fragments/install.adoc | 133 - .../src/site-docs/adoc/fragments/introduction.adoc | 24 - .../src/site-docs/adoc/fragments/vpnsla.adoc | 165 - .../site-docs/adoc/fragments/vpnsla/avro-ctxt.adoc | 36 - .../adoc/fragments/vpnsla/avro-internal.adoc | 32 - .../adoc/fragments/vpnsla/avro-trigger.adoc | 24 - .../site-docs/adoc/fragments/vpnsla/cli-spec.adoc | 25 - .../fragments/vpnsla/ctxt-events-customers.adoc | 23 - .../adoc/fragments/vpnsla/ctxt-events-edges.adoc | 23 - .../adoc/fragments/vpnsla/ctxt-events-nodes.adoc | 23 - .../adoc/fragments/vpnsla/ctxt-logic-customer.adoc | 23 - .../adoc/fragments/vpnsla/ctxt-logic-edges.adoc | 22 - .../adoc/fragments/vpnsla/ctxt-logic-nodes.adoc | 22 - .../adoc/fragments/vpnsla/events-trigger.adoc | 23 - .../site-docs/adoc/fragments/vpnsla/logic-act.adoc | 23 - .../adoc/fragments/vpnsla/logic-decide-none.adoc | 20 - .../fragments/vpnsla/logic-decide-priority.adoc | 20 - .../adoc/fragments/vpnsla/logic-decide-sla.adoc | 20 - .../adoc/fragments/vpnsla/logic-decide-solved.adoc | 20 - .../adoc/fragments/vpnsla/logic-decide.adoc | 26 - .../adoc/fragments/vpnsla/logic-establish.adoc | 29 - .../adoc/fragments/vpnsla/logic-match.adoc | 25 - .../site-docs/adoc/fragments/vpnsla/policy.adoc | 28 - .../adoc/fragments/vpnsla/python-linkmonitor.adoc | 24 - .../adoc/fragments/vpnsla/python-mininet.adoc | 23 - .../adoc/resources/image-src/vpnsla-arch.svg | 10199 ------------------- .../adoc/resources/images/pcvs/vpnsla-arch.png | Bin 118373 -> 0 bytes .../adoc/fragments/apex-configuration.adoc | 20 - .../src/site-docs/adoc/fragments/apex-model.adoc | 20 - .../adoc/fragments/logic-task-output.adoc | 20 - .../adoc/fragments/logic-task-periodic.adoc | 20 - 76 files changed, 12212 deletions(-) delete mode 100644 examples/examples-decisionmaker/src/site-docs/adoc/fragments/AnswerInitTask.adoc delete mode 100644 examples/examples-decisionmaker/src/site-docs/adoc/fragments/AnswerInitiationEvents.adoc delete mode 100644 examples/examples-decisionmaker/src/site-docs/adoc/fragments/ApexConfigRESTClient.adoc delete mode 100644 examples/examples-decisionmaker/src/site-docs/adoc/fragments/ApexConfigRESTServer.adoc delete mode 100644 examples/examples-decisionmaker/src/site-docs/adoc/fragments/DecisionMakerPolicyModel.adoc delete mode 100644 examples/examples-decisionmaker/src/site-docs/adoc/fragments/DitheringAnswerTask.adoc delete mode 100644 examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecisionExtraMode_Client.adoc delete mode 100644 examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecisionExtraMode_Server.adoc delete mode 100644 examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecisionStateTSL.adoc delete mode 100644 examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecision_Client.adoc delete mode 100644 examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecision_Server.adoc delete mode 100644 examples/examples-decisionmaker/src/site-docs/adoc/fragments/OptimisticAnswerTask.adoc delete mode 100644 examples/examples-decisionmaker/src/site-docs/adoc/fragments/PessimisticAnswerTask.adoc delete mode 100644 examples/examples-decisionmaker/src/site-docs/adoc/fragments/RandomAnswerTask.adoc delete mode 100644 examples/examples-decisionmaker/src/site-docs/adoc/fragments/RoundRobinAnswerTask.adoc delete mode 100644 examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/01-introduction.adoc delete mode 100644 examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/02-data-models.adoc delete mode 100644 examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/03-policy-step1.adoc delete mode 100644 examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/031-s1-new-model.adoc delete mode 100644 examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/032-s1-new-events.adoc delete mode 100644 examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/033-s1-new-policy.adoc delete mode 100644 examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/034-s1-test-policy.adoc delete mode 100644 examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/035-s1-clieditor.adoc delete mode 100644 examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/04-policy-step2.adoc delete mode 100644 examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/041-s2-extend-model.adoc delete mode 100644 examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/042-s2-test-policy.adoc delete mode 100644 examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/043-s2-clieditor.adoc delete mode 100644 examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_exportPolicyModel1.png delete mode 100644 examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newEvent1.png delete mode 100644 examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newEvent2.png delete mode 100644 examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newEvent3.png delete mode 100644 examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newItemSchema1.png delete mode 100644 examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newItemSchema2.png delete mode 100644 examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newPolicy1.png delete mode 100644 examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newPolicyModel1.png delete mode 100644 examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newPolicyModel2.png delete mode 100644 examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newState1.png delete mode 100644 examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newState2.png delete mode 100644 examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newTask1.png delete mode 100644 examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newTask2.png delete mode 100644 examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newTask3.png delete mode 100644 examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_validatePolicyModel.png delete mode 100644 examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P2_editPolicy1.png delete mode 100644 examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P2_editState1.png delete mode 100644 examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P2_newTask1.png delete mode 100644 examples/examples-pcvs/src/site-docs/adoc/fragments/install.adoc delete mode 100644 examples/examples-pcvs/src/site-docs/adoc/fragments/introduction.adoc delete mode 100644 examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla.adoc delete mode 100644 examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/avro-ctxt.adoc delete mode 100644 examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/avro-internal.adoc delete mode 100644 examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/avro-trigger.adoc delete mode 100644 examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/cli-spec.adoc delete mode 100644 examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/ctxt-events-customers.adoc delete mode 100644 examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/ctxt-events-edges.adoc delete mode 100644 examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/ctxt-events-nodes.adoc delete mode 100644 examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/ctxt-logic-customer.adoc delete mode 100644 examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/ctxt-logic-edges.adoc delete mode 100644 examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/ctxt-logic-nodes.adoc delete mode 100644 examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/events-trigger.adoc delete mode 100644 examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/logic-act.adoc delete mode 100644 examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/logic-decide-none.adoc delete mode 100644 examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/logic-decide-priority.adoc delete mode 100644 examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/logic-decide-sla.adoc delete mode 100644 examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/logic-decide-solved.adoc delete mode 100644 examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/logic-decide.adoc delete mode 100644 examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/logic-establish.adoc delete mode 100644 examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/logic-match.adoc delete mode 100644 examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/policy.adoc delete mode 100644 examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/python-linkmonitor.adoc delete mode 100644 examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/python-mininet.adoc delete mode 100644 examples/examples-pcvs/src/site-docs/adoc/resources/image-src/vpnsla-arch.svg delete mode 100644 examples/examples-pcvs/src/site-docs/adoc/resources/images/pcvs/vpnsla-arch.png delete mode 100644 examples/examples-periodic/src/site-docs/adoc/fragments/apex-configuration.adoc delete mode 100644 examples/examples-periodic/src/site-docs/adoc/fragments/apex-model.adoc delete mode 100644 examples/examples-periodic/src/site-docs/adoc/fragments/logic-task-output.adoc delete mode 100644 examples/examples-periodic/src/site-docs/adoc/fragments/logic-task-periodic.adoc (limited to 'examples') diff --git a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/AnswerInitTask.adoc b/examples/examples-decisionmaker/src/site-docs/adoc/fragments/AnswerInitTask.adoc deleted file mode 100644 index 802fe7fb4..000000000 --- a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/AnswerInitTask.adoc +++ /dev/null @@ -1,20 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Task Logic: Answer Init - -.Task Logic, Answer Init -[source,javascript,options="nowrap"] ----- -include::{adsite-examples-decisionmaker-dir}/main/resources/logic/AnswerInitTask.js[Task Logic: Answer Init] ----- \ No newline at end of file diff --git a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/AnswerInitiationEvents.adoc b/examples/examples-decisionmaker/src/site-docs/adoc/fragments/AnswerInitiationEvents.adoc deleted file mode 100644 index a6a3d582e..000000000 --- a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/AnswerInitiationEvents.adoc +++ /dev/null @@ -1,20 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Initiation Event - -.Initiation Event -[source,json,options="nowrap"] ----- -include::{adsite-examples-decisionmaker-dir}/main/resources/examples/config/DecisionMaker/AnswerInitiationEvent.json[Initiation Event] ----- \ No newline at end of file diff --git a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/ApexConfigRESTClient.adoc b/examples/examples-decisionmaker/src/site-docs/adoc/fragments/ApexConfigRESTClient.adoc deleted file mode 100644 index 74bbfb6c7..000000000 --- a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/ApexConfigRESTClient.adoc +++ /dev/null @@ -1,20 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== APEX Configuration: Rest Client - -.Config REst Client -[source,json,options="nowrap"] ----- -include::{adsite-examples-decisionmaker-dir}/main/resources/examples/config/DecisionMaker/ApexConfigRESTClient.json[Config Rest Client] ----- \ No newline at end of file diff --git a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/ApexConfigRESTServer.adoc b/examples/examples-decisionmaker/src/site-docs/adoc/fragments/ApexConfigRESTServer.adoc deleted file mode 100644 index 89aa91bf1..000000000 --- a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/ApexConfigRESTServer.adoc +++ /dev/null @@ -1,20 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== APEX Config: REST Server - -.Config REST Server -[source,json,options="nowrap"] ----- -include::{adsite-examples-decisionmaker-dir}/main/resources/examples/config/DecisionMaker/ApexConfigRESTServer.json[Config REST Server] ----- \ No newline at end of file diff --git a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/DecisionMakerPolicyModel.adoc b/examples/examples-decisionmaker/src/site-docs/adoc/fragments/DecisionMakerPolicyModel.adoc deleted file mode 100644 index 7051abc7d..000000000 --- a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/DecisionMakerPolicyModel.adoc +++ /dev/null @@ -1,20 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== APEX Model (Policies) - -.APEX Model, Policies -[source,bash,options="nowrap"] ----- -include::{adsite-examples-decisionmaker-dir}/main/resources/policy/DecisionMakerPolicyModel.apex[APEX Model, Policies] ----- \ No newline at end of file diff --git a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/DitheringAnswerTask.adoc b/examples/examples-decisionmaker/src/site-docs/adoc/fragments/DitheringAnswerTask.adoc deleted file mode 100644 index c9322f837..000000000 --- a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/DitheringAnswerTask.adoc +++ /dev/null @@ -1,20 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Task Logic: Dithering Answer - -.Task Logic, Dithering Answer -[source,javascript,options="nowrap"] ----- -include::{adsite-examples-decisionmaker-dir}/main/resources/logic/DitheringAnswerTask.js[Task Logic: Dithering Answer] ----- \ No newline at end of file diff --git a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecisionExtraMode_Client.adoc b/examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecisionExtraMode_Client.adoc deleted file mode 100644 index ee88f5fca..000000000 --- a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecisionExtraMode_Client.adoc +++ /dev/null @@ -1,20 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== HTML Client: Extra Mode - -.HTML Client, Extra Mode -[source,html,options="nowrap"] ----- -include::{adsite-examples-decisionmaker-dir}/main/resources/examples/html/DecisionMaker/MakeDecisionExtraMode_Client.html[HTML Client, Extra Mode] ----- \ No newline at end of file diff --git a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecisionExtraMode_Server.adoc b/examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecisionExtraMode_Server.adoc deleted file mode 100644 index 50673161a..000000000 --- a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecisionExtraMode_Server.adoc +++ /dev/null @@ -1,20 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== HTML Server: Extra Mode - -.HTML Server, Extra Mode -[source,html,options="nowrap"] ----- -include::{adsite-examples-decisionmaker-dir}/main/resources/examples/html/DecisionMaker/MakeDecisionExtraMode_Server.html[HTML Server, Extra Mode] ----- \ No newline at end of file diff --git a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecisionStateTSL.adoc b/examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecisionStateTSL.adoc deleted file mode 100644 index a74cc929d..000000000 --- a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecisionStateTSL.adoc +++ /dev/null @@ -1,20 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Task Selection Logic: Make Decision State - -.Task Selection Logic, Make Decision State -[source,javascript,options="nowrap"] ----- -include::{adsite-examples-decisionmaker-dir}/main/resources/logic/MakeDecisionStateTSL.js[Task Selection Logic: Make Decision State] ----- \ No newline at end of file diff --git a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecision_Client.adoc b/examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecision_Client.adoc deleted file mode 100644 index c3d1bd7ab..000000000 --- a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecision_Client.adoc +++ /dev/null @@ -1,20 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== HTML Client - -.HTML Client -[source,html,options="nowrap"] ----- -include::{adsite-examples-decisionmaker-dir}/main/resources/examples/html/DecisionMaker/MakeDecision_Client.html[HTML Client] ----- \ No newline at end of file diff --git a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecision_Server.adoc b/examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecision_Server.adoc deleted file mode 100644 index f805d6148..000000000 --- a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/MakeDecision_Server.adoc +++ /dev/null @@ -1,20 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== HTML Server - -.HTML Server -[source,html,options="nowrap"] ----- -include::{adsite-examples-decisionmaker-dir}/main/resources/examples/html/DecisionMaker/MakeDecision_Server.html[HTML Server] ----- \ No newline at end of file diff --git a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/OptimisticAnswerTask.adoc b/examples/examples-decisionmaker/src/site-docs/adoc/fragments/OptimisticAnswerTask.adoc deleted file mode 100644 index 8e889ed78..000000000 --- a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/OptimisticAnswerTask.adoc +++ /dev/null @@ -1,20 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Task Logic: Optimistic Answer - -.Task Logic, Optimistic Answer -[source,javascript,options="nowrap"] ----- -include::{adsite-examples-decisionmaker-dir}/main/resources/logic/OptimisticAnswerTask.js[Task Logic: Optimistic Answer] ----- \ No newline at end of file diff --git a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/PessimisticAnswerTask.adoc b/examples/examples-decisionmaker/src/site-docs/adoc/fragments/PessimisticAnswerTask.adoc deleted file mode 100644 index 8bb8c8a08..000000000 --- a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/PessimisticAnswerTask.adoc +++ /dev/null @@ -1,20 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Task Logic: Pessimistic Answer - -.Task Logic, Pessimistic Answer -[source,javascript,options="nowrap"] ----- -include::{adsite-examples-decisionmaker-dir}/main/resources/logic/PessimisticAnswerTask.js[Task Logic: Pessimistic Answer] ----- \ No newline at end of file diff --git a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/RandomAnswerTask.adoc b/examples/examples-decisionmaker/src/site-docs/adoc/fragments/RandomAnswerTask.adoc deleted file mode 100644 index e75102e8d..000000000 --- a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/RandomAnswerTask.adoc +++ /dev/null @@ -1,20 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Task Logic: Random Answer - -.Task Logic, Random Answer -[source,javascript,options="nowrap"] ----- -include::{adsite-examples-decisionmaker-dir}/main/resources/logic/RandomAnswerTask.js[Task Logic: Random Answer] ----- \ No newline at end of file diff --git a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/RoundRobinAnswerTask.adoc b/examples/examples-decisionmaker/src/site-docs/adoc/fragments/RoundRobinAnswerTask.adoc deleted file mode 100644 index f25e74c0a..000000000 --- a/examples/examples-decisionmaker/src/site-docs/adoc/fragments/RoundRobinAnswerTask.adoc +++ /dev/null @@ -1,20 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Task Logic: RoundRobin Answer - -.Task Logic, RoundRobin Answer -[source,javascript,options="nowrap"] ----- -include::{adsite-examples-decisionmaker-dir}/main/resources/logic/RoundRobinAnswerTask.js[Task Logic: RoundRobin Answer] ----- \ No newline at end of file diff --git a/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/01-introduction.adoc b/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/01-introduction.adoc deleted file mode 100644 index 02a7a0e76..000000000 --- a/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/01-introduction.adoc +++ /dev/null @@ -1,25 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Introduction - -Consider a scenario where a supermarket chain called _HyperM_ controls how it sells items in a policy-based manner. -Each time an item is processed by _HyperM_'s point-of-sale (PoS) system an event is generated and published about that item of stock being sold. -This event can then be used to update stock levels, etc.. - -__HyperM__ want to extend this approach to allow some checks to be performed before the sale can be completed. -This can be achieved by requesting a policy-controlled decision as each item is processed by for sale by each PoS system. -The decision process is integrated with __HyperM__'s other IT systems that manage stock control, sourcing and purchasing, personnel systems, etc. - -In this document we will show how APEX and APEX Policies can be used to achieve this, starting with a simple policy, building up to more complicated policy that demonstrates the features of APEX. - diff --git a/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/02-data-models.adoc b/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/02-data-models.adoc deleted file mode 100644 index b07c67226..000000000 --- a/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/02-data-models.adoc +++ /dev/null @@ -1,106 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// Modifications Copyright (C) 2020 Nordix Foundation. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Data Models - -=== Sales Input Event -Each time a PoS system processes a sales item an event with the following format is triggered: - -.Sale Input Event -[width="100%",options="header"] -|==================== -|Event| Fields | Description -| SALE_INPUT | time, sale_ID, amount, item_ID, quantity, assistant_ID, branch_ID, notes, ... | Event indicating a sale of an item is occurring -|==================== - -In each `SALE_INPUT` event the `sale_ID` field is a unique ID generated by the PoS system. -A timestamp for the event is stored in the `time` field. -The `amount` field refers to the value of the item(s) to be sold (in cents). -The `item_ID` field is a unique identifier for each item type, and can be used to retrieve more information about the item from _HyperM_'s stock control system. -The `quantity` field refers to the quantity of the item to be sold. -The `assistant_ID` field is a unique identifier for the PoS operator, and can be used to retrieve more information about the operator from the _HyperM_'s personnel system. -Since __HyperM__ has many branches the `branch_ID` identifies the shop. -The `notes` field contains arbitrary notes about the sale. - - -=== Sales Decision Event -After a `SALE_INPUT` event is triggered by the PoS system _HyperM_'s policy-based controlled sales checking system triggers a Sale Authorization Event indicating whether the sale is authorized or denied. -The PoS system can then listen for this event before continuing with the sale. - -.Sale Authorisation Event -[width="100%",options="header"] -|==================== -|Event| Fields | Description -| SALE_AUTH | sale_ID, time, authorized, amount, item_ID, quantity, assistant_ID, branch_ID, notes, message... | Event indicating if the sale of an item is authorized or denied -|==================== - -In each `SALE_AUTH` event the `sale_ID` field is copied from the `SALE_INPUT` event that trigger the decision request. -The `SALE_AUTH` event is also timestamped using the `time` field, and a field called `authorised` is set to `true` or `false` depending on whether the sale is authorized or denied. -The `message` field carries an optional message about why a sale was not authorized. -The other fields from the `SALE_INPUT` event are also included for completeness. - - -=== Stock Control: Items -_HyperM_ maintains information about each item for sale in a database table called `ITEMS`. - -.Items Database -[width="100%",options="header"] -|==================== -|Table| Fields | Description -| ITEMS | item_ID, description, cost_price, barcode, supplier_ID, category, ... | Database table describing each item for sale -|==================== - -The database table `ITEMS` has a row for each items that _HyperM_ sells. -Each item is identified by an `item_ID` value. -The `description` field stores a description of the item. -The cost price of the item is given in `cost_price`. -The barcode of the item is encoded in `barcode`, while the item supplier is identified by `supplier_ID`. -Items may also be classified into categories using the `category` field. -Useful categories might include: `soft drinks`, `alcoholic drinks`, `cigarettes`, `knives`, `confectionery`, `bakery`, `fruit&vegetables`, `meat`, etc.. - - -=== Personnel System: Assistants - -.Assistants Database -[width="100%",options="header"] -|==================== -|Table| Fields | Description -| ASSISTANTS | assistant_ID, surname, firstname, middlename, age, grade, phone_number, ... | Database table describing each _HyperM_ sales assistant -|==================== - -The database table `ASSISTANTS` has a row for each sales assistant employed by _HyperM_. -Each assistant is identified by an `assistant_ID` value, with their name given in the `firstname`, `middlename` and `surname` fields. -The assistant's age in years is given in `age`, while their phone number is contained in the `phone_number` field. -The assistant's grade is encoded in `grade`. -Useful values for `grade` might include: `trainee`, `operator`, `supervisor`, etc.. - - -=== Locations: Branches - -.Branches Database -[width="100%",options="header"] -|==================== -|Table| Fields | Description -| BRANCHES | branch_ID, branch_Name, category, street, city, country, postcode, ... | Database table describing each _HyperM_ branch -|==================== - -_HyperM_ operates a number of branches. -Each branch is described in the `BRANCHES` database table. -Each branch is identified by a `branch_ID`, with a branch name given in `branch_Name`. -The address for the branch is encoded in `street`, `city`, `country` and `postcode`. -The branch category is given in the `category` field. -Useful values for `category` might include: `Small`, `Large`, `Super`, `Hyper`, etc.. - - - diff --git a/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/03-policy-step1.adoc b/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/03-policy-step1.adoc deleted file mode 100644 index cf124d2b1..000000000 --- a/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/03-policy-step1.adoc +++ /dev/null @@ -1,23 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Policy Step 1 - -=== Scenario -For the first version of our policy, let's start with something simple. -Let us assume that there exists some restriction that alcohol products cannot be sold before 11:30am. -In this section we will go through the necessary steps to define a policy that can enforce this for _HyperM_. - -* Alcohol cannot be sold before 11:30am. - - diff --git a/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/031-s1-new-model.adoc b/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/031-s1-new-model.adoc deleted file mode 100644 index 182c024ae..000000000 --- a/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/031-s1-new-model.adoc +++ /dev/null @@ -1,26 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// Modifications Copyright (C) 2020 Nordix Foundation. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -=== Create an empty Policy Model `MyFirstPolicyModel` - -Since an organisation like _HyperM_ may have many policies covering many different domains, policies should be grouped into policy sets. In order to edit or deploy a policy, or policy set, the definition of the policy(ies) and all required events, tasks, states, etc., are grouped together into a 'Policy Model'. An organization might define many Policy Models, each containing a different set of policies. - -So the first step is to create an empty Policy Model called `MyFirstPolicyModel`. Using the APEX Policy Editor, click on the 'File' menus and select 'New'. Then define our new policy model called `MyFirstPolicyModel`. Use the 'Generate UUID' button to create a new unique ID for the policy model, and fill in a description for the policy model. Press the `Submit` button to save your changes. - -.Create a new Policy Model 1/2 -image::mfp/MyFirstPolicy_P1_newPolicyModel1.png[File > New to create a new Policy Model] - -.Create a new Policy Model 2/2 -image::mfp/MyFirstPolicy_P1_newPolicyModel2.png[Create a new Policy Model] - diff --git a/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/032-s1-new-events.adoc b/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/032-s1-new-events.adoc deleted file mode 100644 index a8711dd3a..000000000 --- a/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/032-s1-new-events.adoc +++ /dev/null @@ -1,127 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// Modifications Copyright (C) 2020 Nordix Foundation. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -=== APEX Context Item Schemas - -We must first define APEX Context Item Schemas that can be used as parameter fields to an event. - -To create new item schemas, click on the 'Context Item Schemas' tab. In that 'Context Item Schemas' pane, right click and select 'Create new ContextSchema'. - -.Create new Data Types -image::mfp/MyFirstPolicy_P1_newItemSchema1.png["Right click to create a new Item Schema"] - -Create item schemas with the following characteristics, each with its own unique UUID: - -.Item Schemas -[width="100%",options="header"] -|==================== -| Name | Schema Flavour | Schema Definition | Description -| timestamp_type | Java | java.lang.Long | A type for `time` values -| sale_ID_type | Java | java.lang.Long | A type for `sale_ID` values -| price_type | Java | java.lang.Long | A type for `amount`/`price` values -| item_ID_type | Java | java.lang.Long | A type for `item_ID` values -| assistant_ID_type | Java | java.lang.Long | A type for `assistant_ID` values -| quantity_type | Java | java.lang.Integer | A type for `quantity` values -| branch_ID_type | Java | java.lang.Long | A type for `branch_ID` values -| notes_type | Java | java.lang.String | A type for `notes` values -| authorised_type | Java | java.lang.Boolean | A type for `authorised` values -| message_type | Java | java.lang.String | A type for `message` values -|==================== - -.Create new Item Schemas -image::mfp/MyFirstPolicy_P1_newItemSchema2.png["Create a new Item Schema"] - -The item schemas can now be seen on the 'Context Item Schemas' tab, and can be updated at any time by right-clicking on the item schemas on the 'Context Item Schemas' tab. - -[TIP] -.Field Schema types -================================ -APEX natively supports schema definitions in `Java` and `Avro`. - -`Java` schema definitions are simply the name of a Java Class. There are some restrictions: - -* the class must be instantiatable, i.e. not an Java interface or abstract class - -* primitive types are not supported, i.e. use `java.lang.Integer` instead of `int`, etc. - -* it must be possible to find the class, i.e. the class must be contained in the Java classpath. - -`Avro` schema definitions can be any valid https://avro.apache.org/docs/current/spec.html[Avro] schema. For events using fields defined with `Avro` schemas, any incoming event containing that field must contain a value that conforms to the Avro schema. -================================ - -=== Create the input event `SALE_INPUT` and the output event `SALE_AUTH` - -Using the APEX Policy Editor, click on the 'Events' tab. In the 'Events' pane, right click and select 'Create new Event': - -.Create a new Event type -image::mfp/MyFirstPolicy_P1_newEvent1.png[Right click to create a new event] - -Create a new event type called `SALE_INPUT`. Use the 'Generate UUID' button to create a new unique ID for the event type, and fill in a description for the event. Add a namespace, e.g. `com.hyperm`. We can add hard-coded strings for the `Source` and `Target`, e.g. `POS` and `APEX`. At this stage we will not add any parameter fields, we will leave this until later. Use the `Submit` button to create the event. - -.Populate the `SALE_INPUT` event -image::mfp/MyFirstPolicy_P1_newEvent2.png["Fill in the necessary information for the 'SALE_INPUT' event and click 'Submit'"] - -To add a new event parameter use the 'Add Event Parameter' button at the bottom of the screen. For the `SALE_INPUT` event add the following event parameters: - -.Event Parameter Fields for the `SALE_INPUT` Event -[width="100%",options="header"] -|==================== -| Parameter Name | Parameter Type | Optional -| time | timestamp_type | no -| sale_ID | sale_ID_type | no -| amount | price_type | no -| item_ID | item_ID_type | no -| quantity | quantity_type | no -| assistant_ID | assistant_ID_type | no -| branch_ID | branch_ID_type | no -| notes | notes_type | _yes_ -|==================== - -Remember to click the 'Submit' button at the bottom of the event definition pane. - -[TIP] -.Optional Fields in APEX Events -================================ -Parameter fields can be _optional_ in events. If a parameter is not marked as _optional_ then by default it is _mandatory_, so it must appear in any input event passed to APEX. If an _optional_ field is not set for an output event then value will be set to `null`. -================================ - -.Add typed parameter fields to an event -image::mfp/MyFirstPolicy_P1_newEvent3.png["Add new event parameters to an event"] - - -Repeat the same steps for a new event type called `SALE_AUTH`. -Just use `APEX` as source and `POS` as target, since this is the output event coming from APEX going to the sales point. - - -Add the following event parameters: - -.Event Parameter Fields for the `SALE_AUTH` Event -[width="100%",options="header"] -|==================== -| Parameter Name | Parameter Type | no -| sale_ID | sale_ID_type | no -| time | timestamp_type | no -| authorised | authorised_type | no -| message | message_type | _yes_ -| amount | price_type | no -| item_ID | item_ID_type | no -| assistant_ID | assistant_ID_type | no -| quantity | quantity_type | no -| branch_ID | branch_ID_type | no -| notes | notes_type | _yes_ -|==================== -Remember to click the 'Submit' button at the bottom of the event definition pane. - -The events for our policy are now defined. - diff --git a/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/033-s1-new-policy.adoc b/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/033-s1-new-policy.adoc deleted file mode 100644 index 89325a53e..000000000 --- a/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/033-s1-new-policy.adoc +++ /dev/null @@ -1,141 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -=== Create a new Policy and add the _"No Booze before 11:30"_ check - -APEX policies are defined using a state-machine model. Each policy comprises one or more _states_ that can be individually executed. Where there is more than one _state_ the states are chained together to form a https://en.wikipedia.org/wiki/Directed_acyclic_graph[Directed Acyclic Graph (DAG)] of states. A _state_ is triggered by passing it a single input (or 'trigger') event and once executed each state then emits an output event. For each _state_ the logic for the _state_ is embedded in one or more _tasks_. Each _task_ contains specific _task logic_ that is executed by the APEX execution environment each time the _task_ is invoked. Where there is more than one _task_ in a _state_ then the _state_ also defines some _task selection logic_ to select an appropriate task each time the _state_ is executed. - -Therefore, to create a new policy we must first define one or more tasks. - -To create a new Task click on the 'Tasks' tab. In the 'Tasks' pane, right click and select 'Create new Task'. Create a new Task called `MorningBoozeCheck`. Use the 'Generate UUID' button to create a new unique ID for the task, and fill in a description for the task. - -.Create a new Task -image::mfp/MyFirstPolicy_P1_newTask1.png["Right click to create a new task"] - -Tasks are configured with a set of _input fields_ and a set of _output fields_. To add new input/output fields for a task use the 'Add Task Input Field' and 'Add Task Output Field' button. The list of input and out fields to add for the `MorningBoozeCheck` task are given below. The input fields are drawn from the parameters in the state's input event, and the task's output fields are used to populate the state's output event. The task's input and output fields must be a subset of the event parameters defined for the input and output events for any state that uses that task. (You may have noticed that the input and output fields for the `MorningBoozeCheck` task have the exact same names and reuse the item schemas that we used for the parameters in the `SALE_INPUT` and `SALE_AUTH` events respectively). - -.Input fields for `MorningBoozeCheck` task -[width="100%",options="header"] -|==================== -| Parameter Name | Parameter Type -| time | timestamp_type -| sale_ID | sale_ID_type -| amount | price_type -| item_ID | item_ID_type -| quantity | quantity_type -| assistant_ID | assistant_ID_type -| branch_ID | branch_ID_type -| notes | notes_type -|==================== - -.Output fields for `MorningBoozeCheck` task -[width="100%",options="header"] -|==================== -| Parameter Name | Parameter Type -| sale_ID | sale_ID_type -| time | timestamp_type -| authorised | authorised_type -| message | message_type -| amount | price_type -| item_ID | item_ID_type -| assistant_ID | assistant_ID_type -| quantity | quantity_type -| branch_ID | branch_ID_type -| notes | notes_type -|==================== - -.Add input and out fields for the Task -image::mfp/MyFirstPolicy_P1_newTask2.png["Add input and out fields for the task"] - -Each task must include some 'Task Logic' that implements the behaviour for the task. Task logic can be defined in a number of different ways using a choice of languages. For this task we will author the logic using the Java-like scripting language called https://en.wikipedia.org/wiki/MVEL[`MVEL`]. - -For simplicity use the following code for the task logic. Paste the script text into the 'Task Logic' box, and use "MVEL" as the 'Task Logic Type / Flavour'. - -This logic assumes that all items with `item_ID` between 1000 and 2000 contain alcohol, which is not very realistic, but we will see a better approach for this later. It also uses the standard `Java` time utilities to check if the current time is between `00:00:00 GMT` and `11:30:00 GMT`. For a detailed guide to how to write your own logic in https://en.wikipedia.org/wiki/JavaScript[`JavaScript`], https://en.wikipedia.org/wiki/MVEL[`MVEL`] or one of the other supported languages please refer to APEX Programmers Guide. - -.MVEL code for the `MorningBoozeCheck` task -[source,java,options="nowrap"] ----- -include::{adsite-examples-myfirstpolicy-dir}/main/resources/examples/models/MyFirstPolicy/1/MorningBoozeCheck.mvel[`MorningBoozeCheck` task logic (`MVEL`)] ----- - - -.Add Task Logic the Task -image::mfp/MyFirstPolicy_P1_newTask3.png["Add task logic the task"] - -An alternative version of the same logic is available in JavaScript. -Just use "JAVASCRIPT" as the 'Task Logic Type / Flavour' instead. - -.Javascript alternative for the `MorningBoozeCheck` task -[source,javascript,options="nowrap"] ----- -include::{adsite-examples-myfirstpolicy-dir}/main/resources/examples/models/MyFirstPolicy/1/MorningBoozeCheck.js[`MorningBoozeCheck` task logic (`Javascript`)] ----- - - -The task definition is now complete so click the 'Submit' button to save the task. The task can now be seen on the 'Tasks' tab, and can be updated at any time by right-clicking on the task on the 'Task' tab. Now that we have created our task, we can can create a policy that uses that task. - -To create a new Policy click on the 'Policies' tab. In the 'Policies' pane, right click and select 'Create new Policy': - -Create a new Policy called `MyFirstPolicy`. Use the 'Generate UUID' button to create a new unique ID for the policy, and fill in a description for the policy. Use 'FREEFORM' as the 'Policy Flavour'. - -Each policy must have at least one state. Since this is 'freeform' policy we can add as many states as we wish. Let's start with one state. Add a new state called `BoozeAuthDecide` to this `MyFirstPolicy` policy using the 'Add new State' button after filling in the name of our new state. - -.Create a new Policy -image::mfp/MyFirstPolicy_P1_newPolicy1.png["Create a new policy"] - -Each state must uses one input event type. For this new state select the `SALE_INPUT` event as the input event. - -Each policy must define a 'First State' and a 'Policy Trigger Event'. The 'Policy Trigger Event' is the input event for the policy as a whole. This event is then passed to the first state in the chain of states in the policy, therefore the 'Policy Trigger Event' will be the input event for the first state. Each policy can only have one 'First State'. For our `MyFirstPolicy` policy, select `BoozeAuthDecide` as the 'First State'. This will automatically select `SALE_INPUT` as the 'Policy Trigger Event' for our policy. - -.Create a new State -image::mfp/MyFirstPolicy_P1_newState1.png["Create a state"] - -In this case we will create a reference the pre-existing `MorningBoozeCheck` task that we defined above using the 'Add New Task' button. Select the `MorningBoozeCheck` task, and use the name of the task as the 'Local Name' for the task. - -in the case where a state references more than one task, a 'Default Task' must be selected for the state and some logic ('Task Selection Logic') must be specified to select the appropriate task at execution time. Since our new state `BoozeAuthDecide` only has one task the default task is automatically selected and no 'Task Selection Logic' is required. - -[NOTE] -.State Output Mappings -==== -In a 'Policy' 'State' a 'State Output Mapping' has 3 roles: 1) Select which 'State' should be executed next, 2) Select the type of the state's 'Outgoing Event', and 3) Populate the state's 'Outgoing Event'. This is how states are chained together to form a (https://en.wikipedia.org/wiki/Directed_acyclic_graph[Directed Acyclic Graph (DAG)]) of states. The final state(s) of a policy are those that do not select any 'next' state. Since a 'State' can only accept a single type of event, the type of the event emitted by a previous 'State' must be match the incoming event type of the next 'State'. This is also how the last state(s) in a policy can emit events of different types. The 'State Output Mapping' is also responsible for taking the fields that are output by the task executed in the state and populating the state's output event before it is emitted. - -Each 'Task' referenced in 'State' must have a defined 'Output Mapping' to take the output of the task, select an 'Outgoing Event' type for the state, populate the state's outgoing event, and then select the next state to be executed (if any). - -There are 2 basic types of output mappings: - -. *Direct Output Mappings* have a single value for 'Next State' and a single value for 'State Output Event'. The outgoing event for the state is automatically created, any outgoing event parameters that were present in the incoming event are copied into the outgoing event, then any task output fields that have the same name and type as parameters in the outgoing event are automatically copied into the outgoing event. -. *Logic-based State Output Mappings / Finalizers* have some logic defined that dynamically selects and creates the 'State Outgoing Event', manages the population of the outgoing event parameters (perhaps changing or adding to the outputs from the task), and then dynamically selects the next state to be executed (if any). -==== - -Each task reference must also have an associated 'Output State Mapping' so we need an 'Output State Mapping' for the `BoozeAuthDecide` state to use when the `MorningBoozeCheck` task is executed. The simplest type of output mapping is a 'Direct Output Mapping'. - -Create a new 'Direct Output Mapping' for the state called `MorningBoozeCheck_Output_Direct` using the 'Add New Direct State Output Mapping' button. Select `SALE_AUTH` as the output event and select `None` for the next state value. We can then select this output mapping for use when the the `MorningBoozeCheck` task is executed. Since there is only state, and only one task for that state, this output mapping ensures that the `BoozeAuthDecide` state is the only state executed and the state (and the policy) can only emit events of type `SALE_AUTH`. (You may remember that the output fields for the `MorningBoozeCheck` task have the exact same names and reuse the item schemas that we used for the parameters in `SALE_AUTH` event. The `MorningBoozeCheck_Output_Direct` direct output mapping can now automatically copy the values from the `MorningBoozeCheck` task directly into outgoing `SALE_AUTH` events.) - -.Add a Task and Output Mapping -image::mfp/MyFirstPolicy_P1_newState2.png["Add a Task and Output Mapping"] - -Click the 'Submit' button to complete the definition of our `MyFirstPolicy` policy. The policy `MyFirstPolicy` can now be seen in the list of policies on the 'Policies' tab, and can be updated at any time by right-clicking on the policy on the 'Policies' tab. - -The `MyFirstPolicyModel`, including our `MyFirstPolicy` policy can now be checked for errors. Click on the 'Model' menu and select 'Validate'. The model should validate without any 'Warning' or 'Error' messages. If you see any 'Error' or 'Warning' messages, carefully read the message as a hint to find where you might have made a mistake when defining some aspect of your policy model. - -.Validate a Policy Model -image::mfp/MyFirstPolicy_P1_validatePolicyModel.png["Validate the policy model for error using the 'Model' > 'Validate' menu item"] - -Congratulations, you have now completed your first APEX policy. The policy model containing our new policy can now be exported from the editor and saved. Click on the 'File' menu and select 'Download' to save the policy model in JSON format. -The exported policy model is then available in the directory you selected, for instance `$APEX_HOME/examples/models/MyFirstPolicy/1/MyFirstPolicyModel_0.0.1.json`. -The exported policy can now be loaded into the APEX Policy Engine, or can be re-loaded and edited by the APEX Policy Editor. - -.Export a Policy Model -image::mfp/MyFirstPolicy_P1_exportPolicyModel1.png["Download the completed policy model using the 'File' > 'Download' menu item"] - diff --git a/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/034-s1-test-policy.adoc b/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/034-s1-test-policy.adoc deleted file mode 100644 index a93940d85..000000000 --- a/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/034-s1-test-policy.adoc +++ /dev/null @@ -1,76 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// Modifications Copyright (C) 2020 Nordix Foundation. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -=== Test Policy Step 1 - -To start a new APEX Engine you can use the following configuration. -In a full APEX installation you can find this configuration in `$APEX_HOME/examples/config/MyFirstPolicy/1/MyFirstPolicyConfigStdin2StdoutJsonEvent.json`. -This configuration expects incoming events to be in `JSON` format and to be passed into the APEX Engine from `stdin`, and result events will be printed in `JSON` format to `stdout`. This configuration loads the policy model stored in the file 'MyFirstPolicyModel_0.0.1.json' as exported from the APEX Editor. Note, you may need to edit this file to provide the full path to wherever you stored the exported policy model file. - -.JSON to load and execute _My First Policy_, read input JSON events from `stdin`, and emit output events to `stdout` -[source,json,options="nowrap"] ----- -include::{adsite-examples-myfirstpolicy-dir}/main/resources/examples/config/myfirstpolicy/1/MyFirstPolicyConfigStdin2StdoutJsonEvent.json[configuration file] ----- - -To test the policy try paste the following events into the console as the APEX engine executes: - -.Inputs and Outputs when testing _My First Policy_ -[width="100%",options="header",cols="4a,6a,2d"] -|==================== -| Input Event (JSON) | Output Event (JSON) | comment -| -[source,json,options="nowrap"] ----- -include::{adsite-examples-myfirstpolicy-dir}/main/resources/examples/events/MyFirstPolicy/1/EventIn_NonBoozeItem_101309GMT.json[Input (`JSON`)] ----- -| -[source,json,options="nowrap"] ----- -include::{adsite-examples-myfirstpolicy-dir}/main/resources/examples/events/MyFirstPolicy/1/EventOut_NonBoozeItem_101309GMT.json[Output (`JSON`)] ----- -| Request to buy a non-alcoholic item (`item_ID=5123`) at _10:13:09_ on _Tuesday, 10 January 2017_. - -Sale is authorized. - -| -[source,json,options="nowrap"] ----- -include::{adsite-examples-myfirstpolicy-dir}/main/resources/examples/events/MyFirstPolicy/1/EventIn_BoozeItem_084106GMT.json[Input (`JSON`)] ----- -| -[source,json,options="nowrap"] ----- -include::{adsite-examples-myfirstpolicy-dir}/main/resources/examples/events/MyFirstPolicy/1/EventOut_BoozeItem_084106GMT.json[Output (`JSON`)] ----- -| Request to buy alcohol item (`item_ID=1249`) at _08:41:06_ on _Monday, 02 January 2017_. - -Sale is not authorized. - -| -[source,json,options="nowrap"] ----- -include::{adsite-examples-myfirstpolicy-dir}/main/resources/examples/events/MyFirstPolicy/1/EventIn_BoozeItem_201713GMT.json[Input (`JSON`)] ----- -| -[source,json,options="nowrap"] ----- -include::{adsite-examples-myfirstpolicy-dir}/main/resources/examples/events/MyFirstPolicy/1/EventOut_BoozeItem_201713GMT.json[Output (`JSON`)] ----- -| Request to buy alcohol (`item_ID=1943`) at _20:17:13_ on _Tuesday, 20 December 2016_. - -Sale is authorized. - -|==================== - diff --git a/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/035-s1-clieditor.adoc b/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/035-s1-clieditor.adoc deleted file mode 100644 index 4f870c381..000000000 --- a/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/035-s1-clieditor.adoc +++ /dev/null @@ -1,23 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -=== Policy 1 in CLI Editor - -An equivalent version of the `MyFirstPolicyModel` policy model can again be generated using the APEX CLI editor. -A sample APEX CLI script is shown below: - -.APEX CLI Editor code for Policy 1 -[source,apex,options="nowrap"] ----- -include::{adsite-examples-myfirstpolicy-dir}/main/resources/examples/models/MyFirstPolicy/1/MyFirstPolicyModel_0.0.1.apex[APEX CLI Editor code for Policy 1] ----- diff --git a/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/04-policy-step2.adoc b/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/04-policy-step2.adoc deleted file mode 100644 index 212e786b6..000000000 --- a/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/04-policy-step2.adoc +++ /dev/null @@ -1,23 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Policy Step 2 - -=== Scenario -_HyperM_ have just opened a new branch in a different country, but that country has different rules about when alcohol can be sold! In this section we will go through the necessary steps to extend our policy to enforce this for _HyperM_. - -* In some branches alcohol cannot be sold before 1pm, and not at all on Sundays. - -Although there are a number of ways to accomplish this the easiest approach for us is to define another task and then select which task is appropriate at runtime depending on the branch identifier in the incoming event. - - diff --git a/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/041-s2-extend-model.adoc b/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/041-s2-extend-model.adoc deleted file mode 100644 index e3654b572..000000000 --- a/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/041-s2-extend-model.adoc +++ /dev/null @@ -1,92 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -=== Extend the Policy with the new Scenario - -To create a new Task click on the 'Tasks' tab. In the 'Tasks' pane, right click and select 'Create new Task': - -Create a new Task called `MorningBoozeCheckAlt1`. Use the 'Generate UUID' button to create a new unique ID for the task, and fill in a description for the task. Select the same input and output fields that we used earlier when we defined the `MorningBoozeCheck` task earlier. - -.Input fields for `MorningBoozeCheckAlt1` task -[width="100%",options="header"] -|==================== -| Parameter Name | Parameter Type -| time | timestamp_type -| sale_ID | sale_ID_type -| amount | price_type -| item_ID | item_ID_type -| quantity | quantity_type -| assistant_ID | assistant_ID_type -| branch_ID | branch_ID_type -| notes | notes_type -|==================== - -.Output fields for `MorningBoozeCheckAlt1` task -[width="100%",options="header"] -|==================== -| Parameter Name | Parameter Type -| sale_ID | sale_ID_type -| time | timestamp_type -| authorised | authorised_type -| message | message_type -| amount | price_type -| item_ID | item_ID_type -| assistant_ID | assistant_ID_type -| quantity | quantity_type -| branch_ID | branch_ID_type -| notes | notes_type -|==================== - -This task also requires some 'Task Logic' to implement the new behaviour for this task. - -For simplicity use the following code for the task logic. It again assumes that all items with `item_ID` between 1000 and 2000 contain alcohol. We again use the standard `Java` time utilities to check if the current time is between `00:00:00 CET` and `13:00:00 CET` or if it is `Sunday`. - -For this task we will again author the logic using the https://en.wikipedia.org/wiki/MVEL[`MVEL`] scripting language. Sample task logic code (specified in https://en.wikipedia.org/wiki/MVEL[`MVEL`]) is given below. For a detailed guide to how to write your own logic in https://en.wikipedia.org/wiki/JavaScript[`JavaScript`], https://en.wikipedia.org/wiki/MVEL[`MVEL`] or one of the other supported languages please refer to APEX Programmers Guide. - -.MVEL code for the `MorningBoozeCheckAlt1` task -[source,java,options="nowrap"] ----- -include::{adsite-examples-myfirstpolicy-dir}/main/resources/examples/models/MyFirstPolicy/2/MorningBoozeCheckAlt1.mvel[`MorningBoozeCheckAlt1` task logic (`MVEL`)] ----- - -.Create a new Task -image::mfp/MyFirstPolicy_P2_newTask1.png["Create a new alternative task `MorningBoozeCheckAlt1`"] - -The task definition is now complete so click the 'Submit' button to save the task. Now that we have created our task, we can can add this task to the single pre-existing state (`BoozeAuthDecide`) in our policy. - -To edit the `BoozeAuthDecide` state in our policy click on the 'Policies' tab. In the 'Policies' pane, right click on our `MyFirstPolicy` policy and select 'Edit'. Navigate to the `BoozeAuthDecide` state in the 'states' section at the bottom of the policy definition pane. - -.Edit a Policy -image::mfp/MyFirstPolicy_P2_editPolicy1.png["Right click to edit a policy"] - -To add our new task `MorningBoozeCheckAlt1`, scroll down to the `BoozeAuthDecide` state in the 'States' section. In the 'State Tasks' section for `BoozeAuthDecide` use the 'Add new task' button. Select our new `MorningBoozeCheckAlt1` task, and use the name of the task as the 'Local Name' for the task. The `MorningBoozeCheckAlt1` task can reuse the same `MorningBoozeCheck_Output_Direct` 'Direct State Output Mapping' that we used for the `MorningBoozeCheck` task. (Recall that the role of the 'State Output Mapping' is to select the output event for the state, and select the next state to be executed. These both remain the same as before.) - -Since our state has more than one task we must define some logic to determine which task should be used each time the state is executed. This _task selection logic_ is defined in the state definition. For our `BoozeAuthDecide` state we want the choice of which task to use to be based on the `branch_ID` from which the `SALE_INPUT` event originated. For simplicity sake let us assume that branches with `branch_ID` between `0` and `999` should use the `MorningBoozeCheck` task, and the branches with with `branch_ID` between `1000` and `1999` should use the `MorningBoozeCheckAlt1` task. - -This time, for variety, we will author the task selection logic using the https://en.wikipedia.org/wiki/JavaScript[`JavaScript`] scripting language. Sample task selection logic code (specified in https://en.wikipedia.org/wiki/JavaScript[`JavaScript`]) is given below. Paste the script text into the 'Task Selection Logic' box, and use "JAVASCRIPT" as the 'Task Selection Logic Type / Flavour'. It is necessary to mark one of the tasks as the 'Default Task' so that the task selection logic always has a fallback default option in cases where a particular task cannot be selected. In this case the `MorningBoozeCheck` task can be the default task. - -.JavaScript code for the `BoozeAuthDecide` task selection logic -[source,javascript,options="nowrap"] ----- -include::{adsite-examples-myfirstpolicy-dir}/main/resources/examples/models/MyFirstPolicy/2/MyFirstPolicy_BoozeAuthDecideTSL.js[`BoozeAuthDecide` task selection logic (`JavaScript`)] ----- - -.State definition with 2 Tasks and Task Selection Logic -image::mfp/MyFirstPolicy_P2_editState1.png["State definition with 2 Tasks and Task Selection Logic"] - -When complete don't forget to click the 'Submit' button at the bottom of 'Policies' pane for our `MyFirstPolicy` policy after updating the `BoozeAuthDecide` state. - -Congratulations, you have now completed the second step towards your first APEX policy. The policy model containing our new policy can again be validated and exported from the editor and saved as shown in Step 1. - -The exported policy model is then available in the directory you selected, as link:files/mfp-files/2/MyFirstPolicyModel_0.0.1.json[_MyFirstPolicyModel_0.0.1.json_]. The exported policy can now be loaded into the APEX Policy Engine, or can be re-loaded and edited by the APEX Policy Editor. - diff --git a/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/042-s2-test-policy.adoc b/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/042-s2-test-policy.adoc deleted file mode 100644 index 285d54e80..000000000 --- a/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/042-s2-test-policy.adoc +++ /dev/null @@ -1,92 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// Modifications Copyright (C) 2020 Nordix Foundation. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -=== Test Policy Step 2 - -To start a new APEX Engine you can use the following configuration. -In a full APEX installation you can find this configuration in `$APEX_HOME/examples/config/MyFirstPolicy/2/MyFirstPolicyConfigStdin2StdoutJsonEvent.json`. -Note, this has changed from the configuration file in Step 1 to enable the `JAVASCRIPT` executor for our new 'Task Selection Logic'. - -.JSON to load and execute _My First Policy_, read input JSON events from `stdin`, and emit output events to `stdout` -[source,json,options="nowrap"] ----- -include::{adsite-examples-myfirstpolicy-dir}/main/resources/examples/config/myfirstpolicy/2/MyFirstPolicyConfigStdin2StdoutJsonEvent.json[configuration file] ----- - -To test the policy try paste the following events into the console as the APEX engine executes. Note, all tests from Step 1 will still work perfectly since none of those events originate from a branch with `branch_ID` between `1000` and `2000`. The 'Task Selection Logic' will therefore pick the `MorningBoozeCheck` task as expected, and will therefore give the same results. - -.Inputs and Outputs when testing _My First Policy_ -[width="100%",options="header",cols="3a,5a,3d"] -|==================== -| Input Event (JSON) | Output Event (JSON) | comment -| -[source,json,options="nowrap"] ----- -include::{adsite-examples-myfirstpolicy-dir}/main/resources/examples/events/MyFirstPolicy/1/EventIn_BoozeItem_084106GMT.json[Input (`JSON`)] ----- -| -[source,json,options="nowrap"] ----- -include::{adsite-examples-myfirstpolicy-dir}/main/resources/examples/events/MyFirstPolicy/1/EventOut_BoozeItem_084106GMT.json[Output (`JSON`)] ----- -| Request to buy alcohol item (`item_ID=1249`) at _08:41:06 GMT_ on _Monday, 02 January 2017_. - -Sale is not authorized. Uses the `MorningBoozeCheck` task. - -Note this test is copied from Step 1 above, and demonstrates that the original `MorningBoozeCheck` task is executed. - -| -[source,json,options="nowrap"] ----- -include::{adsite-examples-myfirstpolicy-dir}/main/resources/examples/events/MyFirstPolicy/2/EventIn_BoozeItem_101433CET_thurs.json[Input (`JSON`)] ----- -| -[source,json,options="nowrap"] ----- -include::{adsite-examples-myfirstpolicy-dir}/main/resources/examples/events/MyFirstPolicy/2/EventOut_BoozeItem_101433CET_thurs.json[Output (`JSON`)] ----- -| Request to buy alcohol (`item_ID=1047`) at _10:14:33_ on _Thursday, 22 December 2016_. - -Sale is not authorized. Uses the `MorningBoozeCheckAlt1` task. - -| -[source,json,options="nowrap"] ----- -include::{adsite-examples-myfirstpolicy-dir}/main/resources/examples/events/MyFirstPolicy/2/EventIn_BoozeItem_171937CET_sun.json[Input (`JSON`)] ----- -| -[source,json,options="nowrap"] ----- -include::{adsite-examples-myfirstpolicy-dir}/main/resources/examples/events/MyFirstPolicy/2/EventOut_BoozeItem_171937CET_sun.json[Output (`JSON`)] ----- -| Request to buy alcohol (`item_ID=1443`) at _17:19:37_ on _Sunday, 18 December 2016_. - -Sale is not authorized. Uses the `MorningBoozeCheckAlt1` task. - -| -[source,json,options="nowrap"] ----- -include::{adsite-examples-myfirstpolicy-dir}/main/resources/examples/events/MyFirstPolicy/2/EventIn_NonBoozeItem_111309CET_mon.json[Input (`JSON`)] ----- -| -[source,json,options="nowrap"] ----- -include::{adsite-examples-myfirstpolicy-dir}/main/resources/examples/events/MyFirstPolicy/2/EventOut_NonBoozeItem_111309CET_mon.json[Output (`JSON`)] ----- -| Request to buy non-alcoholic item (`item_ID=5321`) at _11:13:09_ on _Monday, 2 January 2017_. - -Sale is authorized. Uses the `MorningBoozeCheckAlt1` task. - -|==================== - diff --git a/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/043-s2-clieditor.adoc b/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/043-s2-clieditor.adoc deleted file mode 100644 index 9b2951ceb..000000000 --- a/examples/examples-myfirstpolicy/src/site-docs/adoc/fragments/043-s2-clieditor.adoc +++ /dev/null @@ -1,23 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -=== Policy 2 in CLI Editor - -An equivalent version of the `MyFirstPolicyModel` policy model can again be generated using the APEX CLI editor. -A sample APEX CLI script is shown below: - -.APEX CLI Editor code for Policy 2 -[source,apex,options="nowrap"] ----- -include::{adsite-examples-myfirstpolicy-dir}/main/resources/examples/models/MyFirstPolicy/2/MyFirstPolicyModel_0.0.1.apex[APEX CLI Editor code for Policy 2] ----- \ No newline at end of file diff --git a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_exportPolicyModel1.png b/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_exportPolicyModel1.png deleted file mode 100644 index fb646f40f..000000000 Binary files a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_exportPolicyModel1.png and /dev/null differ diff --git a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newEvent1.png b/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newEvent1.png deleted file mode 100644 index d67ac82df..000000000 Binary files a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newEvent1.png and /dev/null differ diff --git a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newEvent2.png b/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newEvent2.png deleted file mode 100644 index 0cc4a4215..000000000 Binary files a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newEvent2.png and /dev/null differ diff --git a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newEvent3.png b/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newEvent3.png deleted file mode 100644 index 7a75049ef..000000000 Binary files a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newEvent3.png and /dev/null differ diff --git a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newItemSchema1.png b/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newItemSchema1.png deleted file mode 100644 index 0a6b5b06a..000000000 Binary files a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newItemSchema1.png and /dev/null differ diff --git a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newItemSchema2.png b/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newItemSchema2.png deleted file mode 100644 index dbeba702a..000000000 Binary files a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newItemSchema2.png and /dev/null differ diff --git a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newPolicy1.png b/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newPolicy1.png deleted file mode 100644 index 0a1b34fa1..000000000 Binary files a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newPolicy1.png and /dev/null differ diff --git a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newPolicyModel1.png b/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newPolicyModel1.png deleted file mode 100644 index 168e82deb..000000000 Binary files a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newPolicyModel1.png and /dev/null differ diff --git a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newPolicyModel2.png b/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newPolicyModel2.png deleted file mode 100644 index 858911d6f..000000000 Binary files a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newPolicyModel2.png and /dev/null differ diff --git a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newState1.png b/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newState1.png deleted file mode 100644 index 559a7cc37..000000000 Binary files a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newState1.png and /dev/null differ diff --git a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newState2.png b/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newState2.png deleted file mode 100644 index 806bc0eb8..000000000 Binary files a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newState2.png and /dev/null differ diff --git a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newTask1.png b/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newTask1.png deleted file mode 100644 index 911ae02b7..000000000 Binary files a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newTask1.png and /dev/null differ diff --git a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newTask2.png b/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newTask2.png deleted file mode 100644 index 46dc6c781..000000000 Binary files a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newTask2.png and /dev/null differ diff --git a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newTask3.png b/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newTask3.png deleted file mode 100644 index 1805c14e9..000000000 Binary files a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_newTask3.png and /dev/null differ diff --git a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_validatePolicyModel.png b/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_validatePolicyModel.png deleted file mode 100644 index 2029b1856..000000000 Binary files a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P1_validatePolicyModel.png and /dev/null differ diff --git a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P2_editPolicy1.png b/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P2_editPolicy1.png deleted file mode 100644 index be16f5a4d..000000000 Binary files a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P2_editPolicy1.png and /dev/null differ diff --git a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P2_editState1.png b/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P2_editState1.png deleted file mode 100644 index 83c28b0e4..000000000 Binary files a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P2_editState1.png and /dev/null differ diff --git a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P2_newTask1.png b/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P2_newTask1.png deleted file mode 100644 index 036a4ad96..000000000 Binary files a/examples/examples-myfirstpolicy/src/site-docs/adoc/resources/images/mfp/MyFirstPolicy_P2_newTask1.png and /dev/null differ diff --git a/examples/examples-pcvs/src/site-docs/adoc/fragments/install.adoc b/examples/examples-pcvs/src/site-docs/adoc/fragments/install.adoc deleted file mode 100644 index f849c43ab..000000000 --- a/examples/examples-pcvs/src/site-docs/adoc/fragments/install.adoc +++ /dev/null @@ -1,133 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Install Demo - -Requirements: - -* Ubuntu server: 1.4 GB -* Ubuntu with Xubuntu Desktop, git, Firefox: 2.3 GB -* Ubuntu with all, system updated: 3 GB -* With ZK, Kafka, VLC, Mininet, Floodlight, Python: 4.4 GB -* APEX Build (M2 and built): M2 ~ 2 GB, APEX ~3.5 GB -* APEX install (not build locally): ~ 300 MB - - -On a Ubuntu OS (install a stable or LTS server first) - ----- -# pre for Ubuntu, tools and X -sudo apt-get -y install --no-install-recommends software-properties-common -sudo apt-get -y install --no-install-recommends build-essential -sudo apt-get -y install --no-install-recommends git -sudo aptitude -y install --no-install-recommends xubuntu-desktop -sudo apt-get -y install --no-install-recommends firefox - - -# install Java -sudo add-apt-repository ppa:webupd8team/java -sudo apt-get update -sudo apt-get -y install --no-install-recommends oracle-java8-installer -java -version - - -# reboot system, run system update, then continue - -# if VBox additions are needed, install and reboot -sudo (cd /usr/local/share; wget https://www.virtualbox.org/download/testcase/VBoxGuestAdditions_5.2.7-120528.iso) -sudo mount /usr/local/share/VBoxGuestAdditions_5.2.7-120528.iso /media/cdrom -sudo (cd /media/cdrom;VBoxLinuxAdditions.run) - - -# update apt-get DB -sudo apt-get update - -# if APEX is build from source, install maven and rpm -sudo apt-get install maven rpm - -# install ZooKeeper -sudo apt-get install zookeeperd - -# install Kafka -(cd /tmp;wget http://ftp.heanet.ie/mirrors/www.apache.org/dist/kafka/1.0.0/kafka_2.12-1.0.0.tgz --show-progress) -sudo mkdir /opt/Kafka -sudo tar -xvf /tmp/kafka_2.12-1.0.0.tgz -C /opt/Kafka/ - -# install mininet -cd /usr/local/src -sudo git clone https://github.com/mininet/mininet.git -(cd mininet;util/install.sh -a) - -# install floodlight, requires ant -sudo apt-get install ant -cd /usr/local/src -sudo wget --no-check-certificate https://github.com/floodlight/floodlight/archive/master.zip -sudo unzip master.zip -cd floodlight-master -sudo ant -sudo mkdir /var/lib/floodlight -sudo chmod 777 /var/lib/floodlight - -# install python pip -sudo apt-get install python-pip - -# install kafka-python (need newer version from github) -cd /usr/local/src -sudo git clone https://github.com/dpkp/kafka-python -sudo pip install ./kafka-python - -# install vlc -sudo apt-get install vlc ----- - -Install APEX either from source or from a distribution package. -See the APEX documentation for details. -We assume that APEX is installed in `/opt/ericsson/apex/apex` - -Copy the LinkMonitor file to Kafka-Python - ----- -sudo cp /opt/ericsson/apex/apex/examples/scripts/pcvs/vpnsla/LinkMonitor.py /usr/local/src/kafka-python ----- - -Change the Logback configuration in APEX to logic logging - ----- -(cd /opt/ericsson/apex/apex/etc; sudo cp logback-logic.xml logback.xml) ----- - - -== Get the Demo Video - -* For all download options of the movie please visit link:http://bbb3d.renderfarming.net/download.html[] -* For lower-res downloads and mirrors see link:https://peach.blender.org/download[] - ----- -sudo mkdir /usr/local/src/videos ----- - - -Standard 720p (recommended) - ----- -(cd /usr/local/src/videos; sudo curl -o big_buck_bunny_480p_surround.avi http://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_480p_surround-fix.avi) ----- - - -Full HD video - ----- -(cd videos; sudo curl -o bbb_sunflower_1080p_60fps_normal.mp4 http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1080p_60fps_normal.mp4) ----- - - diff --git a/examples/examples-pcvs/src/site-docs/adoc/fragments/introduction.adoc b/examples/examples-pcvs/src/site-docs/adoc/fragments/introduction.adoc deleted file mode 100644 index 5b4fc1206..000000000 --- a/examples/examples-pcvs/src/site-docs/adoc/fragments/introduction.adoc +++ /dev/null @@ -1,24 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -This module contains several demos for Policy-controlled Video Streaming (PCVS). -Each demo defines a policy using AVRO and Javascript (or other scripting languages for the policy logic). -To run the demo, a vanilla Ubuntu server with some extra software packages is required: - -* Mininet as network simulator -* Floodlight as SDN controller -* Kafka as messaging system -* Zookeeper for Kafka configuration -* APEX for policy control - - diff --git a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla.adoc b/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla.adoc deleted file mode 100644 index 80b43a7dd..000000000 --- a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla.adoc +++ /dev/null @@ -1,165 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== VPN SLA Demo - -This demo uses a network with several central office and core switches, over which two VPNs are run. -A customer `A` has two location `A1` and `A2` and a VPN between them. -A customer `B` has two location `B1` and `B2` and a VPN between them. - -.VPN SLA Architecture -image::pcvs/vpnsla-arch.png[VPN SLA Architecture] - -The architecture above shows the scenario. -The components are realized in this demo as follows: - -* _CEP / Analytics_ - a simple Python script taking events from Kafka and sending them to APEX -* _APEX / Policy_ - the APEX engine running the VPA SLA policy -* _Controller_ - A vanilla Floodlight controller taking events from the Link Monitor and configuring Mininet -* _Network_ - A network created using Mininet - -The demo requires to start some software (detailed below). -To show actual video streams, we use `VLC`. -If you do not want to show video streams, but only the policy, skip the `VLC` section. - -All shown scripts are available in a full APEX installation in `$APEX_HOME/examples/scripts/pcvs/vpnsla`. - -=== Start all Software - -Create environment variables in a file, say `env.sh`. -In each new Xterm - -* Source these environment settings, e.g. `. ./env.sh` -* Run the commands below as root (`sudo` per command or `sudo -i` for interactive mode as shown below) - ----- -#!/usr/bin/env bash - -export src_dir=/usr/local/src -export APEX_HOME=/opt/ericsson/apex/apex -export APEX_USER=apexuser ----- - -In a new Xterm, start Floodlight - ----- -sudo -i -. ./env.sh -cd $src_dir/floodlight-master && java -jar target/floodlight.jar ----- - -In a new Xterm start Mininet - ----- -sudo -i -. ./env.sh -mn -c && python $APEX_HOME/examples/scripts/pcvs/vpnsla/MininetTopology.py ----- - -In a new Xterm, start Kafka - ----- -sudo -i -. ./env.sh -/opt/Kafka/kafka_2.12-1.0.0/bin/kafka-server-start.sh /opt/Kafka/kafka_2.12-1.0.0/config/server.properties ----- - -In a new Xerm start APEX with the Kafka configuration for this demo - ----- -cd $APEX_HOME -./bin/apexApps.sh engine -c examples/config/pcvs/vpnsla/kafka2kafka.json ----- - -In a new Xterm start the Link Monitor. -The Link Monitor has a 30 second sleep to slow down the demonstration. -So the first action of it comes 30 seconds after start. -Every new action in 30 second intervals. - ----- -sudo -i -. ./env.sh -cd $src_dir -xterm -hold -e 'python3 $src_dir/kafka-python/LinkMonitor.py' & ----- - -Now all software should be started and the demo is running. -The Link Monitor will send link up events, picked up by APEX which triggers the policy. -Since there is no problem, the policy will do nothing. - - - -=== Create 2 Video Streams with VLC - -In the Mininet console, type `xterm A1 A2` and `xterm B1 B2` to open terminals on these nodes. - -`A2` and `B2` are the receiving nodes. -In these terminals, run `vlc-wrapper`. -In each opened VLC window do - -* Click Media -> Open Network Stream -* Give the URL as `rtp://@:5004` - -`A1` and `B1` are the sending nodes (sending the video stream) -In these terminals, run `vlc-wrapper`. -In each opened VLC window do - -* Click Media -> Stream -* Add the video (from `/usr/local/src/videos`) -* Click `Stream` -* Click `Next` -* Change the destination `RTP / MPEG Transport Stream` and click `Add` -* Change the address and type to `10.0.0.2` in `A1` and to `10.0.0.4` in `B1` -* Turn off `Active Transcoding` (this is important to minimize CPU load) -* Click `Next` -* Click `Stream` - -The video should be streaming across the network from `A1` to `A2` and from `B1` to `B2`. -If the video streams a slow or interrupted the CPU load is too high. -In these cases either try a better machine or use a different (lower quality) video stream. - -=== Take out L09 and let the Policy do it's Magic - -Now it is time to take out the link `L09`. -This will be picked up by the Link Monitor, which sends a new event (L09 DOWN) to the policy. -The policy then will calculate which customer should be impeded (throttled). -This will continue, until SLAs are violated, then a priority calculation will kick in (Customer `A` is prioritized in the setup). - -To initiate this, simply type `link s5 s6 down` in the Mininet console followed by `exit`. - -If you have the video streams running, you will see one or the other struggeling, depending on the policy decision. - -=== Reset the Demo - -If you want to reset the demo, simple stop (in this order) the following process - -* Link Monitor -* APEX -* Mininet -* Floodlight - -Then restart them in this order - -* Floodlight -* Mininet -* APEX -* Link Monitor - - -=== Monitor the Demo - -Floodlight and APEX provide REST interfaces for monitoring. - -* Floodlight: see link:https://floodlight.atlassian.net/wiki/spaces/floodlightcontroller/pages/40403023/Web+GUI[Floodlight Docs] for details on how to access the monitoring. In a standard installation as we use here, pointing browser to the URL `http://localhost:8080/ui/pages/index.html` should work on the same host -* APEX please see the APEX documentation for link:https://ericsson.github.io/apex-docs/user-manual/engine-apps/um-engapps-eng-monitoring.html[Monitoring Client] or link:https://ericsson.github.io/apex-docs/user-manual/engine-apps/um-engapps-full-client.html[Full Client] for details on how to monitor APEX. - diff --git a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/avro-ctxt.adoc b/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/avro-ctxt.adoc deleted file mode 100644 index 608d5851e..000000000 --- a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/avro-ctxt.adoc +++ /dev/null @@ -1,36 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Context Schemas - -The context schemas are for the local context. -We model edges and nodes for the topology, customers, and problems with all information on detected problems. - -.AVRO Schema Edges -[source,json,options="nowrap"] ----- -include::{adsite-examples-pcvs-dir}/main/resources/org/onap/policy/apex/examples/pcvs/vpnsla/avro/topology-edges.avsc[AVRO Schema Edges] ----- - - -.AVRO Schema Nodes -[source,json,options="nowrap"] ----- -include::{adsite-examples-pcvs-dir}/main/resources/org/onap/policy/apex/examples/pcvs/vpnsla/avro/topology-nodes.avsc[AVRO Schema Nodes] ----- - -.AVRO Schema Customers -[source,json,options="nowrap"] ----- -include::{adsite-examples-pcvs-dir}/main/resources/org/onap/policy/apex/examples/pcvs/vpnsla/avro/customers.avsc[AVRO Schema Customers] ----- diff --git a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/avro-internal.adoc b/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/avro-internal.adoc deleted file mode 100644 index 8133fc428..000000000 --- a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/avro-internal.adoc +++ /dev/null @@ -1,32 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Internal Event Schemas - -For the communication between some of the policy states we are also using Avro schemas, namely: - -* Establish -> Decide: a schema for the established situation -* Decide -> Act: a schema for the taken decision - -.AVRO Schema Situation -[source,json,options="nowrap"] ----- -include::{adsite-examples-pcvs-dir}/main/resources/org/onap/policy/apex/examples/pcvs/vpnsla/avro/situation.avsc[AVRO Schema Situation] ----- - - -.AVRO Schema Decision -[source,json,options="nowrap"] ----- -include::{adsite-examples-pcvs-dir}/main/resources/org/onap/policy/apex/examples/pcvs/vpnsla/avro/decision.avsc[AVRO Schema Decision] ----- diff --git a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/avro-trigger.adoc b/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/avro-trigger.adoc deleted file mode 100644 index 051972957..000000000 --- a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/avro-trigger.adoc +++ /dev/null @@ -1,24 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Schema for Trigger Event Status - -The trigger event provides a status as `UP` or `DOWN`. -To avoid tests for these strings in the logic, we defined an Avro schema for an enumeration. -This does not impact the trigger system (it can still send the strings), but makes the task logic simpler. - -.AVRO Schema Link Status -[source,json,options="nowrap"] ----- -include::{adsite-examples-pcvs-dir}/main/resources/org/onap/policy/apex/examples/pcvs/vpnsla/avro/link-status.avsc[AVRO Schema Link Status] ----- diff --git a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/cli-spec.adoc b/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/cli-spec.adoc deleted file mode 100644 index 96d1b0cb3..000000000 --- a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/cli-spec.adoc +++ /dev/null @@ -1,25 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Complete Policy Definition - -The complete policy definition is realized using the APEX CLI Editor. -The script below shows the actual policy specification. -All logic and schemas are included (as macro file). - -.APEX VPN SLA Policy Specification -[source,javascript,options="nowrap"] ----- -include::{adsite-examples-pcvs-dir}/main/resources/org/onap/policy/apex/examples/pcvs/vpnsla/vpnsla.apex[APEX VPN SLA Policy Specification] ----- - diff --git a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/ctxt-events-customers.adoc b/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/ctxt-events-customers.adoc deleted file mode 100644 index c430621e4..000000000 --- a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/ctxt-events-customers.adoc +++ /dev/null @@ -1,23 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Context Events: Customers - -The following events create all customers of the topology. - -.Context Events Customers -[source,json,options="nowrap"] ----- -include::{adsite-examples-pcvs-dir}/main/resources/examples/events/pcvs/vpnsla/CtxtCustomers.json[Context Events Customers] ----- - diff --git a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/ctxt-events-edges.adoc b/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/ctxt-events-edges.adoc deleted file mode 100644 index fa4282cd9..000000000 --- a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/ctxt-events-edges.adoc +++ /dev/null @@ -1,23 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Context Events: Edges - -The following events create all edges of the topology. - -.Context Events Edges -[source,json,options="nowrap"] ----- -include::{adsite-examples-pcvs-dir}/main/resources/examples/events/pcvs/vpnsla/CtxtEdges.json[Context Events Edges] ----- - diff --git a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/ctxt-events-nodes.adoc b/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/ctxt-events-nodes.adoc deleted file mode 100644 index 980aef088..000000000 --- a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/ctxt-events-nodes.adoc +++ /dev/null @@ -1,23 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Context Events: Nodes - -The following events create all nodes of the topology. - -.Context Events Nodes -[source,json,options="nowrap"] ----- -include::{adsite-examples-pcvs-dir}/main/resources/examples/events/pcvs/vpnsla/CtxtNodes.json[Context Events Nodes] ----- - diff --git a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/ctxt-logic-customer.adoc b/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/ctxt-logic-customer.adoc deleted file mode 100644 index 42bd6eb91..000000000 --- a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/ctxt-logic-customer.adoc +++ /dev/null @@ -1,23 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Logic: Customer Context - -The customer context logic simply takes the trigger event (for context) and creates a new customer in the local context topology. - -.JS Logic Customer Context -[source,javascript,options="nowrap"] ----- -include::{adsite-examples-pcvs-dir}/main/resources/org/onap/policy/apex/examples/pcvs/vpnsla/logic/ctxt-customer.js[JS Logic Customer Context] ----- - diff --git a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/ctxt-logic-edges.adoc b/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/ctxt-logic-edges.adoc deleted file mode 100644 index ad70df50f..000000000 --- a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/ctxt-logic-edges.adoc +++ /dev/null @@ -1,22 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Logic: Edge Context - -The edge context logic simply takes the trigger event (for context) and creates a new edge in the local context topology. - -.JS Logic Edge Context -[source,javascript,options="nowrap"] ----- -include::{adsite-examples-pcvs-dir}/main/resources/org/onap/policy/apex/examples/pcvs/vpnsla/logic/ctxt-edges.js[JS Logic Edge Context] ----- diff --git a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/ctxt-logic-nodes.adoc b/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/ctxt-logic-nodes.adoc deleted file mode 100644 index ba8d3f76d..000000000 --- a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/ctxt-logic-nodes.adoc +++ /dev/null @@ -1,22 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Logic: Node Context - -The node context logic simply takes the trigger event (for context) and creates a new node in the local context topology. - -.JS Logic Node Context -[source,javascript,options="nowrap"] ----- -include::{adsite-examples-pcvs-dir}/main/resources/org/onap/policy/apex/examples/pcvs/vpnsla/logic/ctxt-nodes.js[JS Logic Node Context] ----- diff --git a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/events-trigger.adoc b/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/events-trigger.adoc deleted file mode 100644 index 687936c16..000000000 --- a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/events-trigger.adoc +++ /dev/null @@ -1,23 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Example Trigger Events - -The following events are examples for trigger events - -.Trigger Examples -[source,json,options="nowrap"] ----- -include::{adsite-examples-pcvs-dir}/main/resources/examples/events/pcvs/vpnsla/Trigger_Edge09.json[Trigger Examples] ----- - diff --git a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/logic-act.adoc b/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/logic-act.adoc deleted file mode 100644 index 6dc9e5caa..000000000 --- a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/logic-act.adoc +++ /dev/null @@ -1,23 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Logic: Policy Act State - -This is the logic for the act state. -It is simply selecting an action, and creating the repsonse event for the orchestrator (the output of the policy). - -.JS Logic Policy Act State -[source,javascript,options="nowrap"] ----- -include::{adsite-examples-pcvs-dir}/main/resources/org/onap/policy/apex/examples/pcvs/vpnsla/logic/task-act.js[JS Logic Policy Act State] ----- diff --git a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/logic-decide-none.adoc b/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/logic-decide-none.adoc deleted file mode 100644 index e5e8f0119..000000000 --- a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/logic-decide-none.adoc +++ /dev/null @@ -1,20 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Logic: Decide None - -.JS Logic Policy Decide State - None -[source,javascript,options="nowrap"] ----- -include::{adsite-examples-pcvs-dir}/main/resources/org/onap/policy/apex/examples/pcvs/vpnsla/logic/task-decide-none.js[JS Logic Policy Decide State - None] ----- diff --git a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/logic-decide-priority.adoc b/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/logic-decide-priority.adoc deleted file mode 100644 index f2373afbe..000000000 --- a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/logic-decide-priority.adoc +++ /dev/null @@ -1,20 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -=== Logic: Decide Priority - -.JS Logic Policy Decide State - Priority -[source,javascript,options="nowrap"] ----- -include::{adsite-examples-pcvs-dir}/main/resources/org/onap/policy/apex/examples/pcvs/vpnsla/logic/task-decide-priority.js[JS Logic Policy Decide State - Priority] ----- diff --git a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/logic-decide-sla.adoc b/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/logic-decide-sla.adoc deleted file mode 100644 index 8f4c2df5e..000000000 --- a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/logic-decide-sla.adoc +++ /dev/null @@ -1,20 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Logic: Decide SLA - -.JS Logic Policy Decide State - SLA -[source,javascript,options="nowrap"] ----- -include::{adsite-examples-pcvs-dir}/main/resources/org/onap/policy/apex/examples/pcvs/vpnsla/logic/task-decide-sla.js[JS Logic Policy Decide State - SLA] ----- diff --git a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/logic-decide-solved.adoc b/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/logic-decide-solved.adoc deleted file mode 100644 index 538153340..000000000 --- a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/logic-decide-solved.adoc +++ /dev/null @@ -1,20 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Logic: Decide Solved - -.JS Logic Policy Decide State - Solved -[source,javascript,options="nowrap"] ----- -include::{adsite-examples-pcvs-dir}/main/resources/org/onap/policy/apex/examples/pcvs/vpnsla/logic/task-decide-solved.js[JS Logic Policy Decide State - Solved] ----- diff --git a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/logic-decide.adoc b/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/logic-decide.adoc deleted file mode 100644 index 7b4e9dd82..000000000 --- a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/logic-decide.adoc +++ /dev/null @@ -1,26 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Logic: Policy Decide State - -The decide state can select between different algorithms depending on the situation. -So it needs a Task Selection Logic (TSL). -This TSL select a task in the current policy execution (i.e. potentially a different one per execution). - -.JS Logic Policy Decide State - TSL -[source,javascript,options="nowrap"] ----- -include::{adsite-examples-pcvs-dir}/main/resources/org/onap/policy/apex/examples/pcvs/vpnsla/logic/tsl-decide.js[JS Logic Policy Decide State - TSL] ----- - -The actual task logic are then `none`, `solved`, `sla`, and `priority`. diff --git a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/logic-establish.adoc b/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/logic-establish.adoc deleted file mode 100644 index 0e6e7e093..000000000 --- a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/logic-establish.adoc +++ /dev/null @@ -1,29 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Logic: Policy Establish State - -This is the logic for the establish state. -It is the most complicated logic, since establishing a situation for a decision is the most important part of any policy. -First, the policy describes what we find (the switch block), in terms of 8 normal situations and 1 extreme error case. - -If required, it creates local context information for the problem (if it is new) or updates it (if the problem still exists). -It also calculates customer SLA downtime and checks for any SLA violations. -Finally, it creates a situation object. - -.JS Logic Policy Establish State -[source,javascript,options="nowrap"] ----- -include::{adsite-examples-pcvs-dir}/main/resources/org/onap/policy/apex/examples/pcvs/vpnsla/logic/task-establish.js[JS Logic Policy Establish State] ----- - diff --git a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/logic-match.adoc b/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/logic-match.adoc deleted file mode 100644 index de0baabb7..000000000 --- a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/logic-match.adoc +++ /dev/null @@ -1,25 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Logic: Policy Match State - -This is the logic for the match state. -It is kept very simple. -Beside taking the trigger event, it also creates a timestamp. -This timestamp is later used for SLA and downtime calculations as well as for some performance information of the policy. - -.JS Logic Policy Match State -[source,javascript,options="nowrap"] ----- -include::{adsite-examples-pcvs-dir}/main/resources/org/onap/policy/apex/examples/pcvs/vpnsla/logic/task-match.js[JS Logic Policy Match State] ----- diff --git a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/policy.adoc b/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/policy.adoc deleted file mode 100644 index b5bfcc5ab..000000000 --- a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/policy.adoc +++ /dev/null @@ -1,28 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== VPN SLA Policy - -The VPN SLA policy is designed as a MEDA policy. -The first state (M = Match) takes the trigger event (a link up or down) and checks if this is a change to the known topology. -The second state (E = Establish) takes all available information (trigger event, local context) and defines what situation we have. -The third state (D = Decide) takes the situation and selects which algorithm is best to process it. -This state can select between `none` (nothing to do), `solved` (a problem is solved now), `sla` (compare the current customer SLA situation and select one to impede), and `priority` (impede non-priority customers). -The fourth and final state (A = Act) selects the right action for the taken decision and creates the response event sent to the orchestrator. - -We have added three more policies to set the local context: one for adding nodes, one for adding edges (links), and one for adding customers. -These policies do not realize any action, they are only here for updating the local context. -This mechanism is the fasted way to update local context, and it is independent of any context plugin. - -The policy uses data defined in Avro, so we have a number of Avro schema definitions. - diff --git a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/python-linkmonitor.adoc b/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/python-linkmonitor.adoc deleted file mode 100644 index 592dda3b2..000000000 --- a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/python-linkmonitor.adoc +++ /dev/null @@ -1,24 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Link Monitor - -The Link Monitor is a Python script. -At startup, it sends the context events to APEX to initialize the topology and the customers. -Then it takes events from Kafka and sends them to APEX. - -.Link Monitor -[source,python,options="nowrap"] ----- -include::{adsite-examples-pcvs-dir}/main/resources/examples/scripts/pcvs/vpnsla/LinkMonitor.py[Link Monitor] ----- diff --git a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/python-mininet.adoc b/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/python-mininet.adoc deleted file mode 100644 index cdcf525fc..000000000 --- a/examples/examples-pcvs/src/site-docs/adoc/fragments/vpnsla/python-mininet.adoc +++ /dev/null @@ -1,23 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Mininet Topology - -The topology is realized using Mininet. -The following script is use to estalish the topology and to realize network configurations. - -.Mininet Topology -[source,python,options="nowrap"] ----- -include::{adsite-examples-pcvs-dir}/main/resources/examples/scripts/pcvs/vpnsla/MininetTopology.py[Mininet Topology] ----- diff --git a/examples/examples-pcvs/src/site-docs/adoc/resources/image-src/vpnsla-arch.svg b/examples/examples-pcvs/src/site-docs/adoc/resources/image-src/vpnsla-arch.svg deleted file mode 100644 index ffb06a857..000000000 --- a/examples/examples-pcvs/src/site-docs/adoc/resources/image-src/vpnsla-arch.svg +++ /dev/null @@ -1,10199 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Customer A - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Customer B - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Customer A - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Customer B - - - - - - - - - CEP /Analytics - - - - APEX /Policy - - - - Controller - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - A1 - A1-CO - B1 - B1-CO - L02 - L01 - BB-L - L05 - L06 - L10 - L09 - BB-R - L07 - L08 - A2 - A2-CO - L03 - B2 - B2-CO - L04 - - - - - diff --git a/examples/examples-pcvs/src/site-docs/adoc/resources/images/pcvs/vpnsla-arch.png b/examples/examples-pcvs/src/site-docs/adoc/resources/images/pcvs/vpnsla-arch.png deleted file mode 100644 index 0aa391379..000000000 Binary files a/examples/examples-pcvs/src/site-docs/adoc/resources/images/pcvs/vpnsla-arch.png and /dev/null differ diff --git a/examples/examples-periodic/src/site-docs/adoc/fragments/apex-configuration.adoc b/examples/examples-periodic/src/site-docs/adoc/fragments/apex-configuration.adoc deleted file mode 100644 index 5540f1591..000000000 --- a/examples/examples-periodic/src/site-docs/adoc/fragments/apex-configuration.adoc +++ /dev/null @@ -1,20 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== APEX Configuration - -.APEX configuration -[source,json,options="nowrap"] ----- -include::{adsite-examples-periodic-dir}/main/resources/examples/config/Periodic/ApexConfigPeriodic.json[APEX configuration] ----- diff --git a/examples/examples-periodic/src/site-docs/adoc/fragments/apex-model.adoc b/examples/examples-periodic/src/site-docs/adoc/fragments/apex-model.adoc deleted file mode 100644 index 52550bbd6..000000000 --- a/examples/examples-periodic/src/site-docs/adoc/fragments/apex-model.adoc +++ /dev/null @@ -1,20 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== APEX Configuration - -.APEX Model -[source,bash,options="nowrap"] ----- -include::{adsite-examples-periodic-dir}/main/resources/policy/PeriodicPolicyModel.apex[APEX Model] ----- diff --git a/examples/examples-periodic/src/site-docs/adoc/fragments/logic-task-output.adoc b/examples/examples-periodic/src/site-docs/adoc/fragments/logic-task-output.adoc deleted file mode 100644 index f31f5a9ad..000000000 --- a/examples/examples-periodic/src/site-docs/adoc/fragments/logic-task-output.adoc +++ /dev/null @@ -1,20 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Logic: Output Task - -.Output Task Logic -[source,javascript,options="nowrap"] ----- -include::{adsite-examples-periodic-dir}/main/resources/logic/OutputTask.js[Output Task Logic] ----- diff --git a/examples/examples-periodic/src/site-docs/adoc/fragments/logic-task-periodic.adoc b/examples/examples-periodic/src/site-docs/adoc/fragments/logic-task-periodic.adoc deleted file mode 100644 index 1cc318f42..000000000 --- a/examples/examples-periodic/src/site-docs/adoc/fragments/logic-task-periodic.adoc +++ /dev/null @@ -1,20 +0,0 @@ -// -// ============LICENSE_START======================================================= -// Copyright (C) 2016-2018 Ericsson. All rights reserved. -// ================================================================================ -// This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE -// Full license text at https://creativecommons.org/licenses/by/4.0/legalcode -// -// SPDX-License-Identifier: CC-BY-4.0 -// ============LICENSE_END========================================================= -// -// @author Sven van der Meer (sven.van.der.meer@ericsson.com) -// - -== Logic: Periodic Task - -.Periodic Task Logic -[source,javascript,options="nowrap"] ----- -include::{adsite-examples-periodic-dir}/main/resources/logic/PeriodicTask.js[Periodic Task Logic] ----- -- cgit 1.2.3-korg