From 919ef9dc0a2f392868533e498897b12fe0faa321 Mon Sep 17 00:00:00 2001 From: sebdet Date: Mon, 8 Apr 2019 18:32:26 +0200 Subject: Create submit route Create required components for Submit route in camel + unit tests + Policy payload generation + emulator feature for new policy api Issue-ID: CLAMP-303 Change-Id: If9033cfa3f4e346e2cbd7f891baff1f2c04a40a2 Signed-off-by: sebdet --- .../onap/clamp/clds/config/CamelConfiguration.java | 6 + .../sdc/controller/installer/BlueprintParser.java | 2 +- .../policy/operational/OperationalPolicy.java | 14 +- .../resources/clds/camel/rest/clamp-api-v2.xml | 81 ++++++++--- .../resources/clds/camel/routes/flexible-flow.xml | 149 +++++++++++++++++++-- .../controller/installer/BlueprintParserTest.java | 6 +- .../microservice/OperationalPolicyPayloadTest.java | 8 +- .../resources/example/sdc/blueprint-dcae/tca.yaml | 2 +- .../example/sdc/blueprint-dcae/tca_2.yaml | 2 +- .../example/sdc/blueprint-dcae/tca_3.yaml | 2 +- src/test/resources/http-cache/third_party_proxy.py | 26 +++- 11 files changed, 251 insertions(+), 47 deletions(-) (limited to 'src') diff --git a/src/main/java/org/onap/clamp/clds/config/CamelConfiguration.java b/src/main/java/org/onap/clamp/clds/config/CamelConfiguration.java index f10565049..c3b24bc81 100644 --- a/src/main/java/org/onap/clamp/clds/config/CamelConfiguration.java +++ b/src/main/java/org/onap/clamp/clds/config/CamelConfiguration.java @@ -21,14 +21,19 @@ */ package org.onap.clamp.clds.config; +import org.apache.camel.CamelContext; import org.apache.camel.builder.RouteBuilder; import org.apache.camel.model.rest.RestBindingMode; import org.onap.clamp.clds.util.ClampVersioning; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class CamelConfiguration extends RouteBuilder { + @Autowired + CamelContext camelContext; + @Override public void configure() { restConfiguration().component("servlet").bindingMode(RestBindingMode.json).jsonDataFormat("json-gson") @@ -38,5 +43,6 @@ public class CamelConfiguration extends RouteBuilder { .apiProperty("api.version", ClampVersioning.getCldsVersionFromProps()) .apiProperty("base.path", "/restservices/clds/"); // .apiProperty("cors", "true"); + camelContext.setTracing(true); } } diff --git a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java index 93374fe11..5a8ccca91 100644 --- a/src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java +++ b/src/main/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParser.java @@ -88,7 +88,7 @@ public class BlueprintParser { } String msName = theBiggestMicroServiceKey.toLowerCase().contains(HOLMES_PREFIX) ? HOLMES : TCA; return Collections - .singletonList(new MicroService(msName, "onap.policy.monitoring.cdap.tca.hi.lo.ap", "", "", "")); + .singletonList(new MicroService(msName, "onap.policy.monitoring.cdap.tca.hi.lo.app", "", "", "")); } String getName(Entry entry) { diff --git a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java index b6b591db2..1859a4d6e 100644 --- a/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java +++ b/src/main/java/org/onap/clamp/policy/operational/OperationalPolicy.java @@ -31,8 +31,7 @@ import com.google.gson.JsonObject; import com.google.gson.annotations.Expose; import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; +import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; @@ -182,15 +181,20 @@ public class OperationalPolicy implements Serializable, Policy { return (new Yaml()).dump(jsonMap); } - public List createGuardPolicyPayloads() { - List result = new ArrayList<>(); + /** + * Return a map containing all Guard policies indexed by Guard policy Name. + * + * @return The Guards map + */ + public Map createGuardPolicyPayloads() { + Map result = new HashMap<>(); JsonObject guard = new JsonObject(); JsonElement guardsList = this.getConfigurationsJson().get("guard_policies"); for (Entry guardElem : guardsList.getAsJsonObject().entrySet()) { guard.addProperty("policy-id", guardElem.getKey()); guard.add("contents", guardElem.getValue()); - result.add(new GsonBuilder().create().toJson(guard)); + result.put(guardElem.getKey(), new GsonBuilder().create().toJson(guard)); } return result; } diff --git a/src/main/resources/clds/camel/rest/clamp-api-v2.xml b/src/main/resources/clds/camel/rest/clamp-api-v2.xml index c17595e18..76f45881a 100644 --- a/src/main/resources/clds/camel/rest/clamp-api-v2.xml +++ b/src/main/resources/clds/camel/rest/clamp-api-v2.xml @@ -102,35 +102,82 @@ + message="Receive SUBMIT request for loop: ${body}" /> - - - - + + + ${header.LoopObject.getMicroServicePolicies()} - + + ${body} + + + + false + + + + + true + + + + + + + ${header.LoopObject.getOperationalPolicies()} + + + ${body} + + + false - - - + + + true - - ${body.createPolicyPayload()} - - + + + + ${header.operationalPolicy.createGuardPolicyPayloads().entrySet()} + + + ${body} + + + + + false + + + + + true + + + - + diff --git a/src/main/resources/clds/camel/routes/flexible-flow.xml b/src/main/resources/clds/camel/routes/flexible-flow.xml index b8244990b..15a247b5d 100644 --- a/src/main/resources/clds/camel/routes/flexible-flow.xml +++ b/src/main/resources/clds/camel/routes/flexible-flow.xml @@ -75,43 +75,168 @@ - - + + + + + + + + ${header.LoopObject} == null + + 404 + + + + + + + + + + + + ${header.microServicePolicy.createPolicyPayload()} + + - DELETE + POST + + + application/json - {{clamp.config.policy.url}}/policyTypes/${body.getModelType()}/versions/1.0.0/policies/${body.getName()} + {{clamp.config.policy.url}}/policyTypes/${header.microServicePolicy.getModelType()}/versions/1.0.0/policies + + + + + + null - + + DELETE + + + {{clamp.config.policy.url}}/policyTypes/${header.microServicePolicy.getModelType()}/versions/1.0.0/policies/${header.microServicePolicy.getName()} + + + uri="http4://policyhost:8085?throwExceptionOnFailure=${header.HttpQueryExceptionFlag}&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false" /> + + + + + + + ${header.operationalPolicy.createPolicyPayload()} + + + + POST + + + application/json + + + {{clamp.config.policy.url}}/policyTypes/onap.policies.controloop.operational/versions/1.0.0/policies + + + + + + + + + + null + + + DELETE + + + {{clamp.config.policy.url}}/policyTypes/onap.policies.controloop.operational/versions/1.0.0/policies/${header.operationalPolicy.getName()} + + + + - - + + + + + ${header.guardPolicy.getValue()} + + POST + + application/json + - {{clamp.config.policy.url}}/policyTypes/${body.getModelType()}/versions/1.0.0/policies + {{clamp.config.policy.url}}/policyTypes/onap.policies.controlloop.Guard/versions/1.0.0/policies - + message="Policy Endpoint for operational ${header.CamelHttpMethod} ${header.CamelHttpUri}"> + + + + + + + null + + + DELETE + + + {{clamp.config.policy.url}}/policyTypes/onap.policies.controlloop.Guard/versions/1.0.0/policies/${header.guardPolicy.getKey()} + + + + uri="http4://policyhost:8085?throwExceptionOnFailure=${header.HttpQueryExceptionFlag}&deleteWithBody=false&mapHttpMessageBody=false&mapHttpMessageFormUrlEncodedBody=false" /> \ No newline at end of file diff --git a/src/test/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParserTest.java b/src/test/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParserTest.java index 93d71663e..e86fb27d0 100644 --- a/src/test/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParserTest.java +++ b/src/test/java/org/onap/clamp/clds/sdc/controller/installer/BlueprintParserTest.java @@ -163,7 +163,7 @@ public class BlueprintParserTest { @Test public void fallBackToOneMicroServiceTCATest() { - MicroService tcaMS = new MicroService(BlueprintParser.TCA, "onap.policy.monitoring.cdap.tca.hi.lo.ap", "", "", + MicroService tcaMS = new MicroService(BlueprintParser.TCA, "onap.policy.monitoring.cdap.tca.hi.lo.app", "", "", ""); List expected = Collections.singletonList(tcaMS); @@ -174,8 +174,8 @@ public class BlueprintParserTest { @Test public void fallBackToOneMicroServiceHolmesTest() { - MicroService holmesMS = new MicroService(BlueprintParser.HOLMES, "onap.policy.monitoring.cdap.tca.hi.lo.ap", "", - "", ""); + MicroService holmesMS = new MicroService(BlueprintParser.HOLMES, "onap.policy.monitoring.cdap.tca.hi.lo.app", + "", "", ""); List expected = Collections.singletonList(holmesMS); List actual = new BlueprintParser() diff --git a/src/test/java/org/onap/clamp/policy/microservice/OperationalPolicyPayloadTest.java b/src/test/java/org/onap/clamp/policy/microservice/OperationalPolicyPayloadTest.java index 1f57422c5..739708ca7 100644 --- a/src/test/java/org/onap/clamp/policy/microservice/OperationalPolicyPayloadTest.java +++ b/src/test/java/org/onap/clamp/policy/microservice/OperationalPolicyPayloadTest.java @@ -29,7 +29,7 @@ import com.google.gson.GsonBuilder; import com.google.gson.JsonObject; import java.io.IOException; -import java.util.List; +import java.util.Map; import org.junit.Test; import org.onap.clamp.clds.util.ResourceFileUtil; @@ -53,12 +53,12 @@ public class OperationalPolicyPayloadTest { ResourceFileUtil.getResourceAsString("tosca/operational-policy-properties.json"), JsonObject.class); OperationalPolicy policy = new OperationalPolicy("testPolicy", null, jsonConfig); - List guardsList = policy.createGuardPolicyPayloads(); + Map guardsList = policy.createGuardPolicyPayloads(); JSONAssert.assertEquals(ResourceFileUtil.getResourceAsString("tosca/guard1-policy-payload.json"), - guardsList.get(0), false); + guardsList.get("guard1"), false); JSONAssert.assertEquals(ResourceFileUtil.getResourceAsString("tosca/guard2-policy-payload.json"), - guardsList.get(1), false); + guardsList.get("guard2"), false); } } diff --git a/src/test/resources/example/sdc/blueprint-dcae/tca.yaml b/src/test/resources/example/sdc/blueprint-dcae/tca.yaml index b1659073a..b2bf8bb96 100644 --- a/src/test/resources/example/sdc/blueprint-dcae/tca.yaml +++ b/src/test/resources/example/sdc/blueprint-dcae/tca.yaml @@ -17,7 +17,7 @@ node_templates: properties: policy_id: get_input: policy_id - policy_type_id: onap.policy.monitoring.cdap.tca.hi.lo.ap + policy_type_id: onap.policy.monitoring.cdap.tca.hi.lo.app cdap_host_host: type: dcae.nodes.StreamingAnalytics.SelectedCDAPInfrastructure properties: diff --git a/src/test/resources/example/sdc/blueprint-dcae/tca_2.yaml b/src/test/resources/example/sdc/blueprint-dcae/tca_2.yaml index 55901368b..fb042575b 100644 --- a/src/test/resources/example/sdc/blueprint-dcae/tca_2.yaml +++ b/src/test/resources/example/sdc/blueprint-dcae/tca_2.yaml @@ -166,5 +166,5 @@ node_templates: properties: policy_id: get_input: policy_id - policy_type_id: onap.policy.monitoring.cdap.tca.hi.lo.ap + policy_type_id: onap.policy.monitoring.cdap.tca.hi.lo.app diff --git a/src/test/resources/example/sdc/blueprint-dcae/tca_3.yaml b/src/test/resources/example/sdc/blueprint-dcae/tca_3.yaml index b1659073a..b2bf8bb96 100644 --- a/src/test/resources/example/sdc/blueprint-dcae/tca_3.yaml +++ b/src/test/resources/example/sdc/blueprint-dcae/tca_3.yaml @@ -17,7 +17,7 @@ node_templates: properties: policy_id: get_input: policy_id - policy_type_id: onap.policy.monitoring.cdap.tca.hi.lo.ap + policy_type_id: onap.policy.monitoring.cdap.tca.hi.lo.app cdap_host_host: type: dcae.nodes.StreamingAnalytics.SelectedCDAPInfrastructure properties: diff --git a/src/test/resources/http-cache/third_party_proxy.py b/src/test/resources/http-cache/third_party_proxy.py index 30f510752..f19aa0da4 100755 --- a/src/test/resources/http-cache/third_party_proxy.py +++ b/src/test/resources/http-cache/third_party_proxy.py @@ -171,7 +171,7 @@ class Proxy(SimpleHTTPServer.SimpleHTTPRequestHandler): with open(cached_file_content, 'w') as f: f.write(jsonGenerated) return True - elif (self.path.startswith("/pdp/api/") and http_type == "PUT" or http_type == "DELETE") or (self.path.startswith("/pdp/api/policyEngineImport") and http_type == "POST"): + elif (self.path.startswith("/pdp/api/") and (http_type == "PUT" or http_type == "DELETE")) or (self.path.startswith("/pdp/api/policyEngineImport") and http_type == "POST"): print "self.path start with /pdp/api/, copying body to response ..." if not os.path.exists(cached_file_folder): os.makedirs(cached_file_folder, 0777) @@ -180,6 +180,25 @@ class Proxy(SimpleHTTPServer.SimpleHTTPRequestHandler): with open(cached_file_content, 'w+') as f: f.write(self.data_string) return True + elif self.path.startswith("/policy/api/v1/policyTypes/") and http_type == "POST": + print "self.path start with POST new policy API /pdp/api/, copying body to response ..." + if not os.path.exists(cached_file_folder): + os.makedirs(cached_file_folder, 0777) + with open(cached_file_header, 'w+') as f: + f.write("{\"Content-Length\": \"" + str(len(self.data_string)) + "\", \"Content-Type\": \""+str(self.headers['Content-Type'])+"\"}") + with open(cached_file_content, 'w+') as f: + f.write(self.data_string) + return True + elif self.path.startswith("/policy/api/v1/policyTypes/") and http_type == "DELETE": + print "self.path start with DELETE new policy API /policy/api/v1/policyTypes/ ..." + if not os.path.exists(cached_file_folder): + os.makedirs(cached_file_folder, 0777) + + with open(cached_file_header, 'w+') as f: + f.write("{\"Content-Length\": \"" + str(len("")) + "\", \"Content-Type\": \""+str("")+"\"}") + with open(cached_file_content, 'w+') as f: + f.write(self.data_string) + return True else: return False @@ -337,7 +356,10 @@ class Proxy(SimpleHTTPServer.SimpleHTTPRequestHandler): cached_file_header="" print("\n\n\nGot a DELETE for %s " % self.path) self.check_credentials() - self.data_string = self.rfile.read(int(self.headers['Content-Length'])) + if self.headers.get('Content-Length') is not None: + self.data_string = self.rfile.read(int(self.headers['Content-Length'])) + else: + self.data_string = "empty generated" print("self.headers:\n %s" % self.headers) is_special = self._execute_content_generated_cases("DELETE") -- cgit 1.2.3-korg From 969094201a96eae9eaa32ac9fd19f4d0351af86d Mon Sep 17 00:00:00 2001 From: sebdet Date: Tue, 9 Apr 2019 10:11:55 +0200 Subject: Update sql files Update sql files to provision the new database and new loop model Issue-ID: CLAMP-276 Change-Id: Idfa005ff5eb431abea02a0ceea6c6a65f57b3f29 Signed-off-by: sebdet --- src/test/resources/sql/four_templates_only.sql | 62 ------- src/test/resources/sql/loop-examples.sql | 217 +++++++++++++++++++++++++ 2 files changed, 217 insertions(+), 62 deletions(-) delete mode 100755 src/test/resources/sql/four_templates_only.sql create mode 100644 src/test/resources/sql/loop-examples.sql (limited to 'src') diff --git a/src/test/resources/sql/four_templates_only.sql b/src/test/resources/sql/four_templates_only.sql deleted file mode 100755 index 862e3601d..000000000 --- a/src/test/resources/sql/four_templates_only.sql +++ /dev/null @@ -1,62 +0,0 @@ --- MySQL dump 10.16 Distrib 10.1.11-MariaDB, for debian-linux-gnu (x86_64) --- --- Host: localhost Database: cldsdb4 --- ------------------------------------------------------ --- Server version 10.1.11-MariaDB-1~jessie-log - -/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; -/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; -/*!40101 SET NAMES utf8 */; -/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; -/*!40103 SET TIME_ZONE='+00:00' */; -/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; -/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; -/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; - --- --- Current Database: `cldsdb4` --- - -USE `cldsdb4`; - --- --- Dumping data for table `template` --- - -LOCK TABLES `template` WRITE; -/*!40000 ALTER TABLE `template` DISABLE KEYS */; -INSERT INTO `template` VALUES ('04e43cfa-17eb-11e8-b63b-0242ac130002','templateHolmes2','04e6dbd1-17eb-11e8-b63b-0242ac130002','04e8852e-17eb-11e8-b63b-0242ac130002','04ebec9b-17eb-11e8-b63b-0242ac130002'),('27aa4250-17eb-11e8-b63b-0242ac130002','templateTCA1','27ac1c6f-17eb-11e8-b63b-0242ac130002','27adc7b8-17eb-11e8-b63b-0242ac130002','27b1a0c9-17eb-11e8-b63b-0242ac130002'),('3c02f310-17eb-11e8-b63b-0242ac130002','templateTCA2','3c04b3d9-17eb-11e8-b63b-0242ac130002','3c06ce66-17eb-11e8-b63b-0242ac130002','3c0d7849-17eb-11e8-b63b-0242ac130002'),('eb98db1e-17ea-11e8-b63b-0242ac130002','templateHolmes1','eb9b167a-17ea-11e8-b63b-0242ac130002','eb9d6280-17ea-11e8-b63b-0242ac130002','eb9f5d1c-17ea-11e8-b63b-0242ac130002'); -/*!40000 ALTER TABLE `template` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Dumping data for table `template_bpmn` --- - -LOCK TABLES `template_bpmn` WRITE; -/*!40000 ALTER TABLE `template_bpmn` DISABLE KEYS */; -INSERT INTO `template_bpmn` VALUES ('04e6dbd1-17eb-11e8-b63b-0242ac130002','04e43cfa-17eb-11e8-b63b-0242ac130002','\n\n \n \n SequenceFlow_1c9hzec\n \n \n SequenceFlow_1ig3gix\n SequenceFlow_0zwbn2r\n \n \n SequenceFlow_1c9hzec\n SequenceFlow_1ig3gix\n \n \n SequenceFlow_0zwbn2r\n SequenceFlow_0ox6r95\n \n \n SequenceFlow_0ox6r95\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n',NULL,'2018-02-22 16:11:20'),('27ac1c6f-17eb-11e8-b63b-0242ac130002','27aa4250-17eb-11e8-b63b-0242ac130002','\n\n \n \n SequenceFlow_1ahk7jg\n \n \n SequenceFlow_1ahk7jg\n SequenceFlow_18ahat1\n \n \n SequenceFlow_18ahat1\n SequenceFlow_1mo9gxb\n \n \n SequenceFlow_1mo9gxb\n SequenceFlow_1dgtrrq\n \n \n SequenceFlow_1dgtrrq\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n',NULL,'2018-02-22 16:12:18'),('3c04b3d9-17eb-11e8-b63b-0242ac130002','3c02f310-17eb-11e8-b63b-0242ac130002','\n\n \n \n SequenceFlow_0y4m01s\n \n \n SequenceFlow_0y4m01s\n SequenceFlow_10vqotq\n \n \n SequenceFlow_10vqotq\n SequenceFlow_0fpkygk\n \n \n SequenceFlow_0fpkygk\n SequenceFlow_0jsvuvu\n \n \n SequenceFlow_0jsvuvu\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n',NULL,'2018-02-22 16:12:52'),('eb9b167a-17ea-11e8-b63b-0242ac130002','eb98db1e-17ea-11e8-b63b-0242ac130002','\n\n \n \n SequenceFlow_1d9v6ya\n \n \n SequenceFlow_1d9v6ya\n SequenceFlow_01q83h9\n \n \n SequenceFlow_01q83h9\n SequenceFlow_1gw4hg3\n \n \n SequenceFlow_1gw4hg3\n SequenceFlow_07go3oi\n \n \n SequenceFlow_07go3oi\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n',NULL,'2018-02-22 16:10:37'); -/*!40000 ALTER TABLE `template_bpmn` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Dumping data for table `template_doc` --- - -LOCK TABLES `template_doc` WRITE; -/*!40000 ALTER TABLE `template_doc` DISABLE KEYS */; -INSERT INTO `template_doc` VALUES ('04ebec9b-17eb-11e8-b63b-0242ac130002','04e43cfa-17eb-11e8-b63b-0242ac130002','{}',NULL,'2018-02-22 16:11:20'),('27b1a0c9-17eb-11e8-b63b-0242ac130002','27aa4250-17eb-11e8-b63b-0242ac130002','{\"global\":[{\"name\":\"service\",\"value\":[\"tosca_definitions_version: cloudify_dsl_1_3\\r\\nimports:\\r\\n- http://www.getcloudify.org/spec/cloudify/3.4/types.yaml\\r\\n- https://test.onap.org:8443/repository/solutioning01-mte2-raw/type_files/docker/2.2.0/node-type.yaml\\r\\n- https://test.onap.org:8443/repository/solutioning01-mte2-raw/type_files/relationship/1.0.0/node-type.yaml\\r\\n- http://test.onap.org:8081/repository/solutioning01-mte2-raw/type_files/dmaap/dmaap_mr.yaml\\r\\ninputs:\\r\\n location_id:\\r\\n type: string\\r\\n service_id:\\r\\n type: string\\r\\nnode_templates:\\r\\n cdap_host_host:\\r\\n type: dcae.nodes.StreamingAnalytics.SelectedCDAPInfrastructure\\r\\n properties:\\r\\n location_id:\\r\\n get_input: location_id\\r\\n scn_override: cdap_broker.solutioning-central.dcae.onap.org\\r\\n interfaces:\\r\\n cloudify.interfaces.lifecycle: {}\\r\\n tca_tca:\\r\\n type: dcae.nodes.MicroService.cdap\\r\\n properties:\\r\\n app_config:\\r\\n appDescription: DCAE Analytics Threshold Crossing Alert Application\\r\\n appName: dcae-tca\\r\\n tcaSubscriberOutputStreamName: TCASubscriberOutputStream\\r\\n tcaVESAlertsTableName: TCAVESAlertsTable\\r\\n tcaVESAlertsTableTTLSeconds: \'1728000\'\\r\\n tcaVESMessageStatusTableName: TCAVESMessageStatusTable\\r\\n tcaVESMessageStatusTableTTLSeconds: \'86400\'\\r\\n thresholdCalculatorFlowletInstances: \'2\'\\r\\n app_preferences:\\r\\n publisherContentType: application/json\\r\\n publisherHostName: test.onap.org\\r\\n publisherHostPort: \'3905\'\\r\\n publisherMaxBatchSize: \'10\'\\r\\n publisherMaxRecoveryQueueSize: \'100000\'\\r\\n publisherPollingInterval: \'20000\'\\r\\n publisherProtocol: https\\r\\n publisherTopicName: org.onap.dcae.dmaap.DcaeTestVESPub\\r\\n publisherUserName: user@onap.org\\r\\n publisherUserPassword: password\\r\\n subscriberConsumerGroup: OpenDCAE-c12\\r\\n subscriberConsumerId: c12\\r\\n subscriberContentType: application/json\\r\\n subscriberHostName: test.onap.org\\r\\n subscriberHostPort: \'3905\'\\r\\n subscriberMessageLimit: \'-1\'\\r\\n subscriberPollingInterval: \'20000\'\\r\\n subscriberProtocol: https\\r\\n subscriberTimeoutMS: \'-1\'\\r\\n subscriberTopicName: org.onap.dcae.dmaap.mtnje2.DcaeTestVESSub\\r\\n subscriberUserName: user@test.onap.org\\r\\n subscriberUserPasswordpasswordbc\\r\\n tca_policy: \\r\\n artifact_name: dcae-analytics-tca\\r\\n artifact_version: 1.0.0\\r\\n connections:\\r\\n streams_publishes: []\\r\\n streams_subscribes: []\\r\\n jar_url: http://somejar\\r\\n location_id:\\r\\n get_input: location_id\\r\\n namespace: cdap_tca_hi_lo\\r\\n programs:\\r\\n - program_id: TCAVESCollectorFlow\\r\\n program_type: flows\\r\\n - program_id: TCADMaaPMRSubscriberWorker\\r\\n program_type: workers\\r\\n - program_id: TCADMaaPMRPublisherWorker\\r\\n program_type: workers\\r\\n service_component_type: cdap_app_tca\\r\\n service_id:\\r\\n get_input: service_id\\r\\n streamname: TCASubscriberOutputStream\\r\\n relationships:\\r\\n - target: cdap_host_host\\r\\n type: dcae.relationships.component_contained_in\\r\\n\"]}]}',NULL,'2018-02-22 16:12:18'),('3c0d7849-17eb-11e8-b63b-0242ac130002','3c02f310-17eb-11e8-b63b-0242ac130002','{\"global\":[{\"name\":\"service\",\"value\":[\"tosca_definitions_version: cloudify_dsl_1_3\\r\\nimports:\\r\\n- http://www.getcloudify.org/spec/cloudify/3.4/types.yaml\\r\\n- https://test.onap.org:8443/repository/solutioning01-mte2-raw/type_files/docker/2.2.0/node-type.yaml\\r\\n- https://test.onap.org:8443/repository/solutioning01-mte2-raw/type_files/relationship/1.0.0/node-type.yaml\\r\\n- http://test.onap.org:8081/repository/solutioning01-mte2-raw/type_files/dmaap/dmaap_mr.yaml\\r\\ninputs:\\r\\n location_id:\\r\\n type: string\\r\\n service_id:\\r\\n type: string\\r\\nnode_templates:\\r\\n cdap_host_host:\\r\\n type: dcae.nodes.StreamingAnalytics.SelectedCDAPInfrastructure\\r\\n properties:\\r\\n location_id:\\r\\n get_input: location_id\\r\\n scn_override: cdap_broker.solutioning-central.dcae.onap.org\\r\\n interfaces:\\r\\n cloudify.interfaces.lifecycle: {}\\r\\n tca_tca:\\r\\n type: dcae.nodes.MicroService.cdap\\r\\n properties:\\r\\n app_config:\\r\\n appDescription: DCAE Analytics Threshold Crossing Alert Application\\r\\n appName: dcae-tca\\r\\n tcaSubscriberOutputStreamName: TCASubscriberOutputStream\\r\\n tcaVESAlertsTableName: TCAVESAlertsTable\\r\\n tcaVESAlertsTableTTLSeconds: \'1728000\'\\r\\n tcaVESMessageStatusTableName: TCAVESMessageStatusTable\\r\\n tcaVESMessageStatusTableTTLSeconds: \'86400\'\\r\\n thresholdCalculatorFlowletInstances: \'2\'\\r\\n app_preferences:\\r\\n publisherContentType: application/json\\r\\n publisherHostName: test.homer.onap.org\\r\\n publisherHostPort: \'3905\'\\r\\n publisherMaxBatchSize: \'10\'\\r\\n publisherMaxRecoveryQueueSize: \'100000\'\\r\\n publisherPollingInterval: \'20000\'\\r\\n publisherProtocol: https\\r\\n publisherTopicName: org.onap.dcae.dmaap.mtnje2.DcaeTestVESPub\\r\\n publisherUserName: user@tca.af.dcae.onap.org\\r\\n publisherUserPasswordpasswordbc\\r\\n subscriberConsumerGroup: OpenDCAE-c12\\r\\n subscriberConsumerId: c12\\r\\n subscriberContentType: application/json\\r\\n subscriberHostName: test.homer.onap.org\\r\\n subscriberHostPort: \'3905\'\\r\\n subscriberMessageLimit: \'-1\'\\r\\n subscriberPollingInterval: \'20000\'\\r\\n subscriberProtocol: https\\r\\n subscriberTimeoutMS: \'-1\'\\r\\n subscriberTopicName: org.onap.dcae.dmaap.mtnje2.DcaeTestVESSub\\r\\n subscriberUserName: user@tca.af.dcae.onap.org\\r\\n subscriberUserPasswordpasswordbc\\r\\n tca_policy: \\r\\n artifact_name: dcae-analytics-tca\\r\\n artifact_version: 1.0.0\\r\\n connections:\\r\\n streams_publishes: []\\r\\n streams_subscribes: []\\r\\n jar_url: http://somejar\\r\\n location_id:\\r\\n get_input: location_id\\r\\n namespace: cdap_tca_hi_lo\\r\\n programs:\\r\\n - program_id: TCAVESCollectorFlow\\r\\n program_type: flows\\r\\n - program_id: TCADMaaPMRSubscriberWorker\\r\\n program_type: workers\\r\\n - program_id: TCADMaaPMRPublisherWorker\\r\\n program_type: workers\\r\\n service_component_type: cdap_app_tca\\r\\n service_id:\\r\\n get_input: service_id\\r\\n streamname: TCASubscriberOutputStream\\r\\n relationships:\\r\\n - target: cdap_host_host\\r\\n type: dcae.relationships.component_contained_in\\r\\n\"]}]}',NULL,'2018-02-22 16:12:52'),('eb9f5d1c-17ea-11e8-b63b-0242ac130002','eb98db1e-17ea-11e8-b63b-0242ac130002','{}',NULL,'2018-02-22 16:10:37'); -/*!40000 ALTER TABLE `template_doc` ENABLE KEYS */; -UNLOCK TABLES; - --- --- Dumping data for table `template_image` --- - -LOCK TABLES `template_image` WRITE; -/*!40000 ALTER TABLE `template_image` DISABLE KEYS */; -INSERT INTO `template_image` VALUES ('04e8852e-17eb-11e8-b63b-0242ac130002','04e43cfa-17eb-11e8-b63b-0242ac130002','\n\n\nHHolmesVESVesCollectorPolicy',NULL,'2018-02-22 16:11:20'),('27adc7b8-17eb-11e8-b63b-0242ac130002','27aa4250-17eb-11e8-b63b-0242ac130002','\n\n\nVESVesCollectorTCAPolicy',NULL,'2018-02-22 16:12:18'),('3c06ce66-17eb-11e8-b63b-0242ac130002','3c02f310-17eb-11e8-b63b-0242ac130002','\n\n\nVESVesCollectorTCAPolicy',NULL,'2018-02-22 16:12:52'),('eb9d6280-17ea-11e8-b63b-0242ac130002','eb98db1e-17ea-11e8-b63b-0242ac130002','\n\n\nVESVesCollectorHHolmesPolicy',NULL,'2018-02-22 16:10:37'); -/*!40000 ALTER TABLE `template_image` ENABLE KEYS */; -UNLOCK TABLES; diff --git a/src/test/resources/sql/loop-examples.sql b/src/test/resources/sql/loop-examples.sql new file mode 100644 index 000000000..895f2b36b --- /dev/null +++ b/src/test/resources/sql/loop-examples.sql @@ -0,0 +1,217 @@ +-- MySQL dump 10.17 Distrib 10.3.12-MariaDB, for debian-linux-gnu (x86_64) +-- +-- Host: localhost Database: cldsdb4 +-- ------------------------------------------------------ +-- Server version 10.3.12-MariaDB-1:10.3.12+maria~bionic-log + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Current Database: `cldsdb4` +-- + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `cldsdb4` /*!40100 DEFAULT CHARACTER SET latin1 */; + +USE `cldsdb4`; + +-- +-- Dumping data for table `dictionary` +-- + +LOCK TABLES `dictionary` WRITE; +/*!40000 ALTER TABLE `dictionary` DISABLE KEYS */; +/*!40000 ALTER TABLE `dictionary` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `dictionary_elements` +-- + +LOCK TABLES `dictionary_elements` WRITE; +/*!40000 ALTER TABLE `dictionary_elements` DISABLE KEYS */; +/*!40000 ALTER TABLE `dictionary_elements` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `event` +-- + +LOCK TABLES `event` WRITE; +/*!40000 ALTER TABLE `event` DISABLE KEYS */; +/*!40000 ALTER TABLE `event` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `hibernate_sequence` +-- + +LOCK TABLES `hibernate_sequence` WRITE; +/*!40000 ALTER TABLE `hibernate_sequence` DISABLE KEYS */; +INSERT INTO `hibernate_sequence` VALUES (1); +/*!40000 ALTER TABLE `hibernate_sequence` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `loop_logs` +-- + +LOCK TABLES `loop_logs` WRITE; +/*!40000 ALTER TABLE `loop_logs` DISABLE KEYS */; +/*!40000 ALTER TABLE `loop_logs` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `loops` +-- + +LOCK TABLES `loops` WRITE; +/*!40000 ALTER TABLE `loops` DISABLE KEYS */; +INSERT INTO `loops` VALUES ('LOOP_iYTIP_v1_0_ResourceInstanceName1_tca','tosca_definitions_version: cloudify_dsl_1_3\nimports:\n- http://www.getcloudify.org/spec/cloudify/3.4/types.yaml\n- https://onap.org:8443/repository/solutioning01-mte2-raw/type_files/docker/2.2.0/node-type.yaml\n- https://onap.org:8443/repository/solutioning01-mte2-raw/type_files/relationship/1.0.0/node-type.yaml\n- http://onap.org:8081/repository/solutioning01-mte2-raw/type_files/dmaap/dmaap_mr.yaml\ninputs:\n location_id:\n type: string\n service_id:\n type: string\n policy_id:\n type: string\nnode_templates:\n policy_0:\n type: dcae.nodes.policy\n properties:\n policy_id: \n get_input: policy_id\n policy_type_id: onap.policy.monitoring.cdap.tca.hi.lo.app\n cdap_host_host:\n type: dcae.nodes.StreamingAnalytics.SelectedCDAPInfrastructure\n properties:\n location_id:\n get_input: location_id\n scn_override: cdap_broker.solutioning-central.dcae.onap.org\n interfaces:\n cloudify.interfaces.lifecycle: {\n }\n tca_tca:\n type: dcae.nodes.MicroService.cdap\n properties:\n app_config:\n appDescription: DCAE Analytics Threshold Crossing Alert Application\n appName: dcae-tca\n tcaSubscriberOutputStreamName: TCASubscriberOutputStream\n tcaVESAlertsTableName: TCAVESAlertsTable\n tcaVESAlertsTableTTLSeconds: \'1728000\'\n tcaVESMessageStatusTableName: TCAVESMessageStatusTable\n tcaVESMessageStatusTableTTLSeconds: \'86400\'\n thresholdCalculatorFlowletInstances: \'2\'\n app_preferences:\n publisherContentType: application/json\n publisherHostName: mrlocal-mtnjftle01.onap.org\n publisherHostPort: \'3905\'\n publisherMaxBatchSize: \'10\'\n publisherMaxRecoveryQueueSize: \'100000\'\n publisherPollingInterval: \'20000\'\n publisherProtocol: https\n publisherTopicName: org.onap.dcae.dmaap.mtnje2.DcaeTestVESPub\n publisherUserName: test@tca.af.dcae.onap.org\n publisherUserPassword: password\n subscriberConsumerGroup: OpenDCAE-c12\n subscriberConsumerId: c12\n subscriberContentType: application/json\n subscriberHostName: mrlocal-mtnjftle01.onap.org\n subscriberHostPort: \'3905\'\n subscriberMessageLimit: \'-1\'\n subscriberPollingInterval: \'20000\'\n subscriberProtocol: https\n subscriberTimeoutMS: \'-1\'\n subscriberTopicName: org.onap.dcae.dmaap.mtnje2.DcaeTestVESSub\n subscriberUserName: test@tca.af.dcae.onap.org\n subscriberUserPassword: password\n tca_policy: null\n artifact_name: dcae-analytics-tca\n artifact_version: 1.0.0\n connections:\n streams_publishes: [\n ]\n streams_subscribes: [\n ]\n jar_url: http://somejar\n location_id:\n get_input: location_id\n namespace: cdap_tca_hi_lo\n programs:\n - program_id: TCAVESCollectorFlow\n program_type: flows\n - program_id: TCADMaaPMRSubscriberWorker\n program_type: workers\n - program_id: TCADMaaPMRPublisherWorker\n program_type: workers\n service_component_type: cdap_app_tca\n service_id:\n get_input: service_id\n streamname: TCASubscriberOutputStream\n relationships:\n - target: topic0\n type: dcae.relationships.subscribe_to_events\n - target: topic1\n type: dcae.relationships.publish_events\n - target: cdap_host_host\n type: dcae.relationships.component_contained_in\n - target: policy_0\n type: dcae.relationships.depends_on\n topic0:\n type: dcae.nodes.Topic\n properties:\n topic_name: \'\'\n topic1:\n type: dcae.nodes.Topic\n properties:\n topic_name: \'\'\n \n','typeId-d2787a29-d52f-4b28-8006-6d51422fbf0f',NULL,NULL,'{\n \"dcaeDeployParameters\": {\n \"location_id\": \"\",\n \"service_id\": \"\",\n \"policy_id\": \"AUTO_GENERATED_POLICY_ID_AT_SUBMIT\"\n }\n}','DESIGN','{\n \"serviceDetails\": {\n \"serviceType\": \"\",\n \"namingPolicy\": \"\",\n \"environmentContext\": \"General_Revenue-Bearing\",\n \"serviceEcompNaming\": \"true\",\n \"serviceRole\": \"\",\n \"name\": \"vLoadBalancerMS\",\n \"description\": \"vLBMS\",\n \"invariantUUID\": \"ba4c03be-7859-4197-9c8b-415d0c1378aa\",\n \"ecompGeneratedNaming\": \"true\",\n \"category\": \"Network L4+\",\n \"type\": \"Service\",\n \"UUID\": \"7e8a3d64-1475-4928-b02d-2c27530b755f\",\n \"instantiationType\": \"A-la-carte\"\n },\n \"resourceDetails\": {\n \"CP\": {},\n \"VL\": {},\n \"VF\": {\n \"LoadBalancerMS 0\": {\n \"resourceVendor\": \"Test License\",\n \"resourceVendorModelNumber\": \"\",\n \"name\": \"LoadBalancerMS\",\n \"description\": \"vLBMS\",\n \"invariantUUID\": \"1a40cbb0-fbe1-492e-b204-39aba30f02e3\",\n \"subcategory\": \"Load Balancer\",\n \"category\": \"Application L4+\",\n \"type\": \"VF\",\n \"UUID\": \"8d7d126d-623f-4e7c-9a16-132bd89e814a\",\n \"version\": \"1.0\",\n \"resourceVendorRelease\": \"1.0\",\n \"customizationUUID\": \"310ce108-c3b5-4c90-b262-4a11c70366a3\"\n }\n },\n \"CR\": {},\n \"VFC\": {},\n \"PNF\": {},\n \"Service\": {},\n \"CVFC\": {},\n \"Service Proxy\": {},\n \"Configuration\": {},\n \"AllottedResource\": {}\n }\n}','VESTCAPolicy'); +INSERT INTO `loops` VALUES ('LOOP_iYTIP_v1_0_ResourceInstanceName1_tca_3','tosca_definitions_version: cloudify_dsl_1_3\nimports:\n- http://www.getcloudify.org/spec/cloudify/3.4/types.yaml\n- https://onap.org:8443/repository/solutioning01-mte2-raw/type_files/docker/2.2.0/node-type.yaml\n- https://onap.org:8443/repository/solutioning01-mte2-raw/type_files/relationship/1.0.0/node-type.yaml\n- http://onap.org:8081/repository/solutioning01-mte2-raw/type_files/dmaap/dmaap_mr.yaml\ninputs:\n location_id:\n type: string\n service_id:\n type: string\n policy_id:\n type: string\nnode_templates:\n policy_0:\n type: dcae.nodes.policy\n properties:\n policy_id: \n get_input: policy_id\n policy_type_id: onap.policy.monitoring.cdap.tca.hi.lo.app\n cdap_host_host:\n type: dcae.nodes.StreamingAnalytics.SelectedCDAPInfrastructure\n properties:\n location_id:\n get_input: location_id\n scn_override: cdap_broker.solutioning-central.dcae.onap.org\n interfaces:\n cloudify.interfaces.lifecycle: {\n }\n tca_tca:\n type: dcae.nodes.MicroService.cdap\n properties:\n app_config:\n appDescription: DCAE Analytics Threshold Crossing Alert Application\n appName: dcae-tca\n tcaSubscriberOutputStreamName: TCASubscriberOutputStream\n tcaVESAlertsTableName: TCAVESAlertsTable\n tcaVESAlertsTableTTLSeconds: \'1728000\'\n tcaVESMessageStatusTableName: TCAVESMessageStatusTable\n tcaVESMessageStatusTableTTLSeconds: \'86400\'\n thresholdCalculatorFlowletInstances: \'2\'\n app_preferences:\n publisherContentType: application/json\n publisherHostName: mrlocal-mtnjftle01.onap.org\n publisherHostPort: \'3905\'\n publisherMaxBatchSize: \'10\'\n publisherMaxRecoveryQueueSize: \'100000\'\n publisherPollingInterval: \'20000\'\n publisherProtocol: https\n publisherTopicName: org.onap.dcae.dmaap.mtnje2.DcaeTestVESPub\n publisherUserName: test@tca.af.dcae.onap.org\n publisherUserPassword: password\n subscriberConsumerGroup: OpenDCAE-c12\n subscriberConsumerId: c12\n subscriberContentType: application/json\n subscriberHostName: mrlocal-mtnjftle01.onap.org\n subscriberHostPort: \'3905\'\n subscriberMessageLimit: \'-1\'\n subscriberPollingInterval: \'20000\'\n subscriberProtocol: https\n subscriberTimeoutMS: \'-1\'\n subscriberTopicName: org.onap.dcae.dmaap.mtnje2.DcaeTestVESSub\n subscriberUserName: test@tca.af.dcae.onap.org\n subscriberUserPassword: password\n tca_policy: null\n artifact_name: dcae-analytics-tca\n artifact_version: 1.0.0\n connections:\n streams_publishes: [\n ]\n streams_subscribes: [\n ]\n jar_url: http://somejar\n location_id:\n get_input: location_id\n namespace: cdap_tca_hi_lo\n programs:\n - program_id: TCAVESCollectorFlow\n program_type: flows\n - program_id: TCADMaaPMRSubscriberWorker\n program_type: workers\n - program_id: TCADMaaPMRPublisherWorker\n program_type: workers\n service_component_type: cdap_app_tca\n service_id:\n get_input: service_id\n streamname: TCASubscriberOutputStream\n relationships:\n - target: topic0\n type: dcae.relationships.subscribe_to_events\n - target: topic1\n type: dcae.relationships.publish_events\n - target: cdap_host_host\n type: dcae.relationships.component_contained_in\n - target: policy_0\n type: dcae.relationships.depends_on\n topic0:\n type: dcae.nodes.Topic\n properties:\n topic_name: \'\'\n topic1:\n type: dcae.nodes.Topic\n properties:\n topic_name: \'\'\n \n','typeId-7af051f7-c8c4-4a81-ab66-b55ac816c2b0',NULL,NULL,'{\n \"dcaeDeployParameters\": {\n \"location_id\": \"\",\n \"service_id\": \"\",\n \"policy_id\": \"AUTO_GENERATED_POLICY_ID_AT_SUBMIT\"\n }\n}','DESIGN','{\n \"serviceDetails\": {\n \"serviceType\": \"\",\n \"namingPolicy\": \"\",\n \"environmentContext\": \"General_Revenue-Bearing\",\n \"serviceEcompNaming\": \"true\",\n \"serviceRole\": \"\",\n \"name\": \"vLoadBalancerMS\",\n \"description\": \"vLBMS\",\n \"invariantUUID\": \"ba4c03be-7859-4197-9c8b-415d0c1378aa\",\n \"ecompGeneratedNaming\": \"true\",\n \"category\": \"Network L4+\",\n \"type\": \"Service\",\n \"UUID\": \"7e8a3d64-1475-4928-b02d-2c27530b755f\",\n \"instantiationType\": \"A-la-carte\"\n },\n \"resourceDetails\": {\n \"CP\": {},\n \"VL\": {},\n \"VF\": {\n \"LoadBalancerMS 0\": {\n \"resourceVendor\": \"Test License\",\n \"resourceVendorModelNumber\": \"\",\n \"name\": \"LoadBalancerMS\",\n \"description\": \"vLBMS\",\n \"invariantUUID\": \"1a40cbb0-fbe1-492e-b204-39aba30f02e3\",\n \"subcategory\": \"Load Balancer\",\n \"category\": \"Application L4+\",\n \"type\": \"VF\",\n \"UUID\": \"8d7d126d-623f-4e7c-9a16-132bd89e814a\",\n \"version\": \"1.0\",\n \"resourceVendorRelease\": \"1.0\",\n \"customizationUUID\": \"310ce108-c3b5-4c90-b262-4a11c70366a3\"\n }\n },\n \"CR\": {},\n \"VFC\": {},\n \"PNF\": {},\n \"Service\": {},\n \"CVFC\": {},\n \"Service Proxy\": {},\n \"Configuration\": {},\n \"AllottedResource\": {}\n }\n}','VESTCAPolicy'); +INSERT INTO `loops` VALUES ('LOOP_iYTIP_v1_0_ResourceInstanceName2_tca_2','tosca_definitions_version: cloudify_dsl_1_3\nimports:\n - \"http://www.getcloudify.org/spec/cloudify/3.4/types.yaml\"\n - https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R2/dockerplugin/3.2.0/dockerplugin_types.yaml\n - https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R2/relationshipplugin/1.0.0/relationshipplugin_types.yaml\n - https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R2/dcaepolicyplugin/2.3.0/dcaepolicyplugin_types.yaml\n\ninputs:\n dh_override:\n type: string\n default: \"component_dockerhost\"\n dh_location_id:\n type: string\n default: \"zone1\"\n aaiEnrichmentHost:\n type: string\n default: \"none\"\n aaiEnrichmentPort:\n type: string \n default: 8443\n enableAAIEnrichment:\n type: string\n default: false\n dmaap_host:\n type: string\n default: dmaap.onap-message-router \n dmaap_port:\n type: string\n default: 3904 \n enableRedisCaching:\n type: string\n default: false \n redisHosts:\n type: string \n tag_version:\n type: string\n default: \"nexus3.onap.org:10001/onap//onap/org.onap.dcaegen2.deployments.tca-cdap-container:1.0.0\"\n consul_host:\n type: string\n default: consul-server.onap-consul\n consul_port:\n type: string\n default: \"8500\"\n cbs_host:\n type: string\n default: \"config-binding-service.dcae\"\n cbs_port:\n type: string\n default: \"10000\"\n policy_id:\n type: string\n default: \"none\"\n external_port:\n type: string\n description: \"Port for CDAPgui to be exposed\"\n default: \"32010\"\n\nnode_templates:\n docker_service_host:\n properties:\n docker_host_override:\n get_input: dh_override\n location_id:\n get_input: dh_location_id\n type: dcae.nodes.SelectedDockerHost\n tca_docker:\n relationships:\n - type: dcae.relationships.component_contained_in\n target: docker_service_host\n - target: tca_policy\n type: cloudify.relationships.depends_on \n type: dcae.nodes.DockerContainerForComponentsUsingDmaap\n properties:\n application_config:\n app_config:\n appDescription: DCAE Analytics Threshold Crossing Alert Application\n appName: dcae-tca\n tcaAlertsAbatementTableName: TCAAlertsAbatementTable\n tcaAlertsAbatementTableTTLSeconds: \'1728000\'\n tcaSubscriberOutputStreamName: TCASubscriberOutputStream\n tcaVESAlertsTableName: TCAVESAlertsTable\n tcaVESAlertsTableTTLSeconds: \'1728000\'\n tcaVESMessageStatusTableName: TCAVESMessageStatusTable\n tcaVESMessageStatusTableTTLSeconds: \'86400\'\n thresholdCalculatorFlowletInstances: \'2\'\n app_preferences:\n aaiEnrichmentHost: \n get_input: aaiEnrichmentHost\n aaiEnrichmentIgnoreSSLCertificateErrors: \'true\'\n aaiEnrichmentPortNumber: \'8443\'\n aaiEnrichmentProtocol: https\n aaiEnrichmentUserName: DCAE\n aaiEnrichmentUserPassword: DCAE\n aaiVMEnrichmentAPIPath: /aai/v11/search/nodes-query\n aaiVNFEnrichmentAPIPath: /aai/v11/network/generic-vnfs/generic-vnf\n enableAAIEnrichment: \n get_input: enableAAIEnrichment\n enableRedisCaching: \n get_input: enableRedisCaching\n redisHosts: \n get_input: redisHosts\n enableAlertCEFFormat: \'false\'\n publisherContentType: application/json\n publisherHostName: \n get_input: dmaap_host\n publisherHostPort: \n get_input: dmaap_port \n publisherMaxBatchSize: \'1\'\n publisherMaxRecoveryQueueSize: \'100000\'\n publisherPollingInterval: \'20000\'\n publisherProtocol: http\n publisherTopicName: unauthenticated.DCAE_CL_OUTPUT\n subscriberConsumerGroup: OpenDCAE-c12\n subscriberConsumerId: c12\n subscriberContentType: application/json\n subscriberHostName: \n get_input: dmaap_host\n subscriberHostPort:\n get_input: dmaap_port \n subscriberMessageLimit: \'-1\'\n subscriberPollingInterval: \'30000\'\n subscriberProtocol: http\n subscriberTimeoutMS: \'-1\'\n subscriberTopicName: unauthenticated.SEC_MEASUREMENT_OUTPUT\n tca_policy_default: \'{\"domain\":\"measurementsForVfScaling\",\"metricsPerEventName\":[{\"eventName\":\"vFirewallBroadcastPackets\",\"controlLoopSchemaType\":\"VNF\",\"policyScope\":\"DCAE\",\"policyName\":\"DCAE.Config_tca-hi-lo\",\"policyVersion\":\"v0.0.1\",\"thresholds\":[{\"closedLoopControlName\":\"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a\",\"version\":\"1.0.2\",\"fieldPath\":\"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta\",\"thresholdValue\":300,\"direction\":\"LESS_OR_EQUAL\",\"severity\":\"MAJOR\",\"closedLoopEventStatus\":\"ONSET\"},{\"closedLoopControlName\":\"ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a\",\"version\":\"1.0.2\",\"fieldPath\":\"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta\",\"thresholdValue\":700,\"direction\":\"GREATER_OR_EQUAL\",\"severity\":\"CRITICAL\",\"closedLoopEventStatus\":\"ONSET\"}]},{\"eventName\":\"vLoadBalancer\",\"controlLoopSchemaType\":\"VM\",\"policyScope\":\"DCAE\",\"policyName\":\"DCAE.Config_tca-hi-lo\",\"policyVersion\":\"v0.0.1\",\"thresholds\":[{\"closedLoopControlName\":\"ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3\",\"version\":\"1.0.2\",\"fieldPath\":\"$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta\",\"thresholdValue\":300,\"direction\":\"GREATER_OR_EQUAL\",\"severity\":\"CRITICAL\",\"closedLoopEventStatus\":\"ONSET\"}]},{\"eventName\":\"Measurement_vGMUX\",\"controlLoopSchemaType\":\"VNF\",\"policyScope\":\"DCAE\",\"policyName\":\"DCAE.Config_tca-hi-lo\",\"policyVersion\":\"v0.0.1\",\"thresholds\":[{\"closedLoopControlName\":\"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e\",\"version\":\"1.0.2\",\"fieldPath\":\"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value\",\"thresholdValue\":0,\"direction\":\"EQUAL\",\"severity\":\"MAJOR\",\"closedLoopEventStatus\":\"ABATED\"},{\"closedLoopControlName\":\"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e\",\"version\":\"1.0.2\",\"fieldPath\":\"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value\",\"thresholdValue\":0,\"direction\":\"GREATER\",\"severity\":\"CRITICAL\",\"closedLoopEventStatus\":\"ONSET\"}]}]}\'\n service_component_type: dcaegen2-analytics_tca \n docker_config:\n healthcheck:\n endpoint: /healthcheck\n interval: 15s\n timeout: 1s\n type: http\n image:\n get_input: tag_version \n interfaces:\n cloudify.interfaces.lifecycle:\n start:\n inputs:\n envs:\n DMAAPHOST: \n { get_input: dmaap_host }\n DMAAPPORT:\n { get_input: dmaap_port }\n DMAAPPUBTOPIC: \"unauthenticated.DCAE_CL_OUTPUT\"\n DMAAPSUBTOPIC: \"unauthenticated.SEC_MEASUREMENT_OUTPUT\"\n AAIHOST: \n { get_input: aaiEnrichmentHost }\n AAIPORT: \n { get_input: aaiEnrichmentPort }\n CONSUL_HOST: \n { get_input: consul_host }\n CONSUL_PORT: \n { get_input: consul_port }\n CBS_HOST: \n { get_input: cbs_host }\n CBS_PORT: \n { get_input: cbs_port }\n CONFIG_BINDING_SERVICE: \"config_binding_service\" \n ports:\n - concat: [\"11011:\", { get_input: external_port }] \n stop:\n inputs:\n cleanup_image: true \n tca_policy:\n type: dcae.nodes.policy\n properties:\n policy_id:\n get_input: policy_id\n policy_type_id: onap.policy.monitoring.cdap.tca.hi.lo.app\n\n','typeId-538accad-2c56-492b-953e-db0f4483cd2e',NULL,NULL,'{\n \"dcaeDeployParameters\": {\n \"dh_override\": \"component_dockerhost\",\n \"dh_location_id\": \"zone1\",\n \"aaiEnrichmentHost\": \"none\",\n \"aaiEnrichmentPort\": 8443,\n \"enableAAIEnrichment\": false,\n \"dmaap_host\": \"dmaap.onap-message-router\",\n \"dmaap_port\": 3904,\n \"enableRedisCaching\": false,\n \"redisHosts\": \"\",\n \"tag_version\": \"nexus3.onap.org:10001/onap//onap/org.onap.dcaegen2.deployments.tca-cdap-container:1.0.0\",\n \"consul_host\": \"consul-server.onap-consul\",\n \"consul_port\": \"8500\",\n \"cbs_host\": \"config-binding-service.dcae\",\n \"cbs_port\": \"10000\",\n \"external_port\": \"32010\",\n \"policy_id\": \"AUTO_GENERATED_POLICY_ID_AT_SUBMIT\"\n }\n}','DESIGN','{\n \"serviceDetails\": {\n \"serviceType\": \"\",\n \"namingPolicy\": \"\",\n \"environmentContext\": \"General_Revenue-Bearing\",\n \"serviceEcompNaming\": \"true\",\n \"serviceRole\": \"\",\n \"name\": \"vLoadBalancerMS\",\n \"description\": \"vLBMS\",\n \"invariantUUID\": \"ba4c03be-7859-4197-9c8b-415d0c1378aa\",\n \"ecompGeneratedNaming\": \"true\",\n \"category\": \"Network L4+\",\n \"type\": \"Service\",\n \"UUID\": \"7e8a3d64-1475-4928-b02d-2c27530b755f\",\n \"instantiationType\": \"A-la-carte\"\n },\n \"resourceDetails\": {\n \"CP\": {},\n \"VL\": {},\n \"VF\": {\n \"LoadBalancerMS 0\": {\n \"resourceVendor\": \"Test License\",\n \"resourceVendorModelNumber\": \"\",\n \"name\": \"LoadBalancerMS\",\n \"description\": \"vLBMS\",\n \"invariantUUID\": \"1a40cbb0-fbe1-492e-b204-39aba30f02e3\",\n \"subcategory\": \"Load Balancer\",\n \"category\": \"Application L4+\",\n \"type\": \"VF\",\n \"UUID\": \"8d7d126d-623f-4e7c-9a16-132bd89e814a\",\n \"version\": \"1.0\",\n \"resourceVendorRelease\": \"1.0\",\n \"customizationUUID\": \"310ce108-c3b5-4c90-b262-4a11c70366a3\"\n }\n },\n \"CR\": {},\n \"VFC\": {},\n \"PNF\": {},\n \"Service\": {},\n \"CVFC\": {},\n \"Service Proxy\": {},\n \"Configuration\": {},\n \"AllottedResource\": {}\n }\n}','VESTCAPolicy'); +/*!40000 ALTER TABLE `loops` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `loops_microservicepolicies` +-- + +LOCK TABLES `loops_microservicepolicies` WRITE; +/*!40000 ALTER TABLE `loops_microservicepolicies` DISABLE KEYS */; +INSERT INTO `loops_microservicepolicies` VALUES ('LOOP_iYTIP_v1_0_ResourceInstanceName1_tca','TCA_iYTIP_v1_0_ResourceInstanceName1_tca'); +INSERT INTO `loops_microservicepolicies` VALUES ('LOOP_iYTIP_v1_0_ResourceInstanceName1_tca_3','TCA_iYTIP_v1_0_ResourceInstanceName1_tca_3'); +INSERT INTO `loops_microservicepolicies` VALUES ('LOOP_iYTIP_v1_0_ResourceInstanceName2_tca_2','TCA_iYTIP_v1_0_ResourceInstanceName2_tca_2'); +/*!40000 ALTER TABLE `loops_microservicepolicies` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `micro_service_policies` +-- + +LOCK TABLES `micro_service_policies` WRITE; +/*!40000 ALTER TABLE `micro_service_policies` DISABLE KEYS */; +INSERT INTO `micro_service_policies` VALUES ('TCA_iYTIP_v1_0_ResourceInstanceName1_tca','{\n \"schema\": {\n \"uniqueItems\": \"true\",\n \"format\": \"tabs-top\",\n \"type\": \"array\",\n \"title\": \"TCA Policy JSON\",\n \"items\": {\n \"type\": \"object\",\n \"title\": \"TCA Policy JSON\",\n \"required\": [\n \"domain\",\n \"metricsPerEventName\"\n ],\n \"properties\": {\n \"domain\": {\n \"propertyOrder\": 1001,\n \"default\": \"measurementsForVfScaling\",\n \"title\": \"Domain name to which TCA needs to be applied\",\n \"type\": \"string\"\n },\n \"metricsPerEventName\": {\n \"propertyOrder\": 1002,\n \"uniqueItems\": \"true\",\n \"format\": \"tabs-top\",\n \"title\": \"Contains eventName and threshold details that need to be applied to given eventName\",\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\n \"controlLoopSchemaType\",\n \"eventName\",\n \"policyName\",\n \"policyScope\",\n \"policyVersion\",\n \"thresholds\"\n ],\n \"properties\": {\n \"policyVersion\": {\n \"propertyOrder\": 1007,\n \"title\": \"TCA Policy Scope Version\",\n \"type\": \"string\"\n },\n \"thresholds\": {\n \"propertyOrder\": 1008,\n \"uniqueItems\": \"true\",\n \"format\": \"tabs-top\",\n \"title\": \"Thresholds associated with eventName\",\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\n \"closedLoopControlName\",\n \"closedLoopEventStatus\",\n \"direction\",\n \"fieldPath\",\n \"severity\",\n \"thresholdValue\",\n \"version\"\n ],\n \"properties\": {\n \"severity\": {\n \"propertyOrder\": 1013,\n \"title\": \"Threshold Event Severity\",\n \"type\": \"string\",\n \"enum\": [\n \"CRITICAL\",\n \"MAJOR\",\n \"MINOR\",\n \"WARNING\",\n \"NORMAL\"\n ]\n },\n \"fieldPath\": {\n \"propertyOrder\": 1012,\n \"title\": \"Json field Path as per CEF message which needs to be analyzed for TCA\",\n \"type\": \"string\",\n \"enum\": [\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuIdle\",\n \"$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageInterrupt\",\n \"$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageNice\",\n \"$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSoftIrq\",\n \"$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSteal\",\n \"$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSystem\",\n \"$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuWait\",\n \"$.event.measurementsForVfScalingFields.cpuUsageArray[*].percentUsage\",\n \"$.event.measurementsForVfScalingFields.meanRequestLatency\",\n \"$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryBuffered\",\n \"$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryCached\",\n \"$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryConfigured\",\n \"$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryFree\",\n \"$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryUsed\",\n \"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value\"\n ]\n },\n \"thresholdValue\": {\n \"propertyOrder\": 1014,\n \"title\": \"Threshold value for the field Path inside CEF message\",\n \"type\": \"integer\"\n },\n \"closedLoopEventStatus\": {\n \"propertyOrder\": 1010,\n \"title\": \"Closed Loop Event Status of the threshold\",\n \"type\": \"string\",\n \"enum\": [\n \"ONSET\",\n \"ABATED\"\n ]\n },\n \"closedLoopControlName\": {\n \"propertyOrder\": 1009,\n \"title\": \"Closed Loop Control Name associated with the threshold\",\n \"type\": \"string\"\n },\n \"version\": {\n \"propertyOrder\": 1015,\n \"title\": \"Version number associated with the threshold\",\n \"type\": \"string\"\n },\n \"direction\": {\n \"propertyOrder\": 1011,\n \"title\": \"Direction of the threshold\",\n \"type\": \"string\",\n \"enum\": [\n \"LESS\",\n \"LESS_OR_EQUAL\",\n \"GREATER\",\n \"GREATER_OR_EQUAL\",\n \"EQUAL\"\n ]\n }\n }\n }\n },\n \"policyName\": {\n \"propertyOrder\": 1005,\n \"title\": \"TCA Policy Scope Name\",\n \"type\": \"string\"\n },\n \"controlLoopSchemaType\": {\n \"propertyOrder\": 1003,\n \"title\": \"Specifies Control Loop Schema Type for the event Name e.g. VNF, VM\",\n \"type\": \"string\",\n \"enum\": [\n \"VM\",\n \"VNF\"\n ]\n },\n \"policyScope\": {\n \"propertyOrder\": 1006,\n \"title\": \"TCA Policy Scope\",\n \"type\": \"string\"\n },\n \"eventName\": {\n \"propertyOrder\": 1004,\n \"title\": \"Event name to which thresholds need to be applied\",\n \"type\": \"string\"\n }\n }\n }\n }\n }\n }\n }\n}','onap.policy.monitoring.cdap.tca.hi.lo.app','tosca_definitions_version: tosca_simple_yaml_1_0_0\npolicy_types:\n onap.policies.Monitoring:\n derived_from: tosca.policies.Root\n description: a base policy type for all policies that governs monitoring provisioning\n onap.policy.monitoring.cdap.tca.hi.lo.app:\n derived_from: onap.policies.Monitoring\n version: 1.0.0\n properties:\n tca_policy:\n type: map\n description: TCA Policy JSON\n entry_schema:\n type: onap.datatypes.monitoring.tca_policy\ndata_types:\n onap.datatypes.monitoring.metricsPerEventName:\n derived_from: tosca.datatypes.Root\n properties:\n controlLoopSchemaType:\n type: string\n required: true\n description: Specifies Control Loop Schema Type for the event Name e.g. VNF, VM\n constraints:\n - valid_values:\n - VM\n - VNF\n eventName:\n type: string\n required: true\n description: Event name to which thresholds need to be applied\n policyName:\n type: string\n required: true\n description: TCA Policy Scope Name\n policyScope:\n type: string\n required: true\n description: TCA Policy Scope\n policyVersion:\n type: string\n required: true\n description: TCA Policy Scope Version\n thresholds:\n type: list\n required: true\n description: Thresholds associated with eventName\n entry_schema:\n type: onap.datatypes.monitoring.thresholds\n onap.datatypes.monitoring.tca_policy:\n derived_from: tosca.datatypes.Root\n properties:\n domain:\n type: string\n required: true\n description: Domain name to which TCA needs to be applied\n default: measurementsForVfScaling\n constraints:\n - equal: measurementsForVfScaling\n metricsPerEventName:\n type: list\n required: true\n description: Contains eventName and threshold details that need to be applied to given eventName\n entry_schema:\n type: onap.datatypes.monitoring.metricsPerEventName\n onap.datatypes.monitoring.thresholds:\n derived_from: tosca.datatypes.Root\n properties:\n closedLoopControlName:\n type: string\n required: true\n description: Closed Loop Control Name associated with the threshold\n closedLoopEventStatus:\n type: string\n required: true\n description: Closed Loop Event Status of the threshold\n constraints:\n - valid_values:\n - ONSET\n - ABATED\n direction:\n type: string\n required: true\n description: Direction of the threshold\n constraints:\n - valid_values:\n - LESS\n - LESS_OR_EQUAL\n - GREATER\n - GREATER_OR_EQUAL\n - EQUAL\n fieldPath:\n type: string\n required: true\n description: Json field Path as per CEF message which needs to be analyzed for TCA\n constraints:\n - valid_values:\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsAccumulated\n - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuIdle\n - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageInterrupt\n - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageNice\n - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSoftIrq\n - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSteal\n - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSystem\n - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuWait\n - $.event.measurementsForVfScalingFields.cpuUsageArray[*].percentUsage\n - $.event.measurementsForVfScalingFields.meanRequestLatency\n - $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryBuffered\n - $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryCached\n - $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryConfigured\n - $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryFree\n - $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryUsed\n - $.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value\n severity:\n type: string\n required: true\n description: Threshold Event Severity\n constraints:\n - valid_values:\n - CRITICAL\n - MAJOR\n - MINOR\n - WARNING\n - NORMAL\n thresholdValue:\n type: integer\n required: true\n description: Threshold value for the field Path inside CEF message\n version:\n type: string\n required: true\n description: Version number associated with the threshold\n',NULL,'\0'); +INSERT INTO `micro_service_policies` VALUES ('TCA_iYTIP_v1_0_ResourceInstanceName1_tca_3','{\n \"schema\": {\n \"uniqueItems\": \"true\",\n \"format\": \"tabs-top\",\n \"type\": \"array\",\n \"title\": \"TCA Policy JSON\",\n \"items\": {\n \"type\": \"object\",\n \"title\": \"TCA Policy JSON\",\n \"required\": [\n \"domain\",\n \"metricsPerEventName\"\n ],\n \"properties\": {\n \"domain\": {\n \"propertyOrder\": 1001,\n \"default\": \"measurementsForVfScaling\",\n \"title\": \"Domain name to which TCA needs to be applied\",\n \"type\": \"string\"\n },\n \"metricsPerEventName\": {\n \"propertyOrder\": 1002,\n \"uniqueItems\": \"true\",\n \"format\": \"tabs-top\",\n \"title\": \"Contains eventName and threshold details that need to be applied to given eventName\",\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\n \"controlLoopSchemaType\",\n \"eventName\",\n \"policyName\",\n \"policyScope\",\n \"policyVersion\",\n \"thresholds\"\n ],\n \"properties\": {\n \"policyVersion\": {\n \"propertyOrder\": 1007,\n \"title\": \"TCA Policy Scope Version\",\n \"type\": \"string\"\n },\n \"thresholds\": {\n \"propertyOrder\": 1008,\n \"uniqueItems\": \"true\",\n \"format\": \"tabs-top\",\n \"title\": \"Thresholds associated with eventName\",\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\n \"closedLoopControlName\",\n \"closedLoopEventStatus\",\n \"direction\",\n \"fieldPath\",\n \"severity\",\n \"thresholdValue\",\n \"version\"\n ],\n \"properties\": {\n \"severity\": {\n \"propertyOrder\": 1013,\n \"title\": \"Threshold Event Severity\",\n \"type\": \"string\",\n \"enum\": [\n \"CRITICAL\",\n \"MAJOR\",\n \"MINOR\",\n \"WARNING\",\n \"NORMAL\"\n ]\n },\n \"fieldPath\": {\n \"propertyOrder\": 1012,\n \"title\": \"Json field Path as per CEF message which needs to be analyzed for TCA\",\n \"type\": \"string\",\n \"enum\": [\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuIdle\",\n \"$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageInterrupt\",\n \"$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageNice\",\n \"$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSoftIrq\",\n \"$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSteal\",\n \"$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSystem\",\n \"$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuWait\",\n \"$.event.measurementsForVfScalingFields.cpuUsageArray[*].percentUsage\",\n \"$.event.measurementsForVfScalingFields.meanRequestLatency\",\n \"$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryBuffered\",\n \"$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryCached\",\n \"$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryConfigured\",\n \"$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryFree\",\n \"$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryUsed\",\n \"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value\"\n ]\n },\n \"thresholdValue\": {\n \"propertyOrder\": 1014,\n \"title\": \"Threshold value for the field Path inside CEF message\",\n \"type\": \"integer\"\n },\n \"closedLoopEventStatus\": {\n \"propertyOrder\": 1010,\n \"title\": \"Closed Loop Event Status of the threshold\",\n \"type\": \"string\",\n \"enum\": [\n \"ONSET\",\n \"ABATED\"\n ]\n },\n \"closedLoopControlName\": {\n \"propertyOrder\": 1009,\n \"title\": \"Closed Loop Control Name associated with the threshold\",\n \"type\": \"string\"\n },\n \"version\": {\n \"propertyOrder\": 1015,\n \"title\": \"Version number associated with the threshold\",\n \"type\": \"string\"\n },\n \"direction\": {\n \"propertyOrder\": 1011,\n \"title\": \"Direction of the threshold\",\n \"type\": \"string\",\n \"enum\": [\n \"LESS\",\n \"LESS_OR_EQUAL\",\n \"GREATER\",\n \"GREATER_OR_EQUAL\",\n \"EQUAL\"\n ]\n }\n }\n }\n },\n \"policyName\": {\n \"propertyOrder\": 1005,\n \"title\": \"TCA Policy Scope Name\",\n \"type\": \"string\"\n },\n \"controlLoopSchemaType\": {\n \"propertyOrder\": 1003,\n \"title\": \"Specifies Control Loop Schema Type for the event Name e.g. VNF, VM\",\n \"type\": \"string\",\n \"enum\": [\n \"VM\",\n \"VNF\"\n ]\n },\n \"policyScope\": {\n \"propertyOrder\": 1006,\n \"title\": \"TCA Policy Scope\",\n \"type\": \"string\"\n },\n \"eventName\": {\n \"propertyOrder\": 1004,\n \"title\": \"Event name to which thresholds need to be applied\",\n \"type\": \"string\"\n }\n }\n }\n }\n }\n }\n }\n}','onap.policy.monitoring.cdap.tca.hi.lo.app','tosca_definitions_version: tosca_simple_yaml_1_0_0\npolicy_types:\n onap.policies.Monitoring:\n derived_from: tosca.policies.Root\n description: a base policy type for all policies that governs monitoring provisioning\n onap.policy.monitoring.cdap.tca.hi.lo.app:\n derived_from: onap.policies.Monitoring\n version: 1.0.0\n properties:\n tca_policy:\n type: map\n description: TCA Policy JSON\n entry_schema:\n type: onap.datatypes.monitoring.tca_policy\ndata_types:\n onap.datatypes.monitoring.metricsPerEventName:\n derived_from: tosca.datatypes.Root\n properties:\n controlLoopSchemaType:\n type: string\n required: true\n description: Specifies Control Loop Schema Type for the event Name e.g. VNF, VM\n constraints:\n - valid_values:\n - VM\n - VNF\n eventName:\n type: string\n required: true\n description: Event name to which thresholds need to be applied\n policyName:\n type: string\n required: true\n description: TCA Policy Scope Name\n policyScope:\n type: string\n required: true\n description: TCA Policy Scope\n policyVersion:\n type: string\n required: true\n description: TCA Policy Scope Version\n thresholds:\n type: list\n required: true\n description: Thresholds associated with eventName\n entry_schema:\n type: onap.datatypes.monitoring.thresholds\n onap.datatypes.monitoring.tca_policy:\n derived_from: tosca.datatypes.Root\n properties:\n domain:\n type: string\n required: true\n description: Domain name to which TCA needs to be applied\n default: measurementsForVfScaling\n constraints:\n - equal: measurementsForVfScaling\n metricsPerEventName:\n type: list\n required: true\n description: Contains eventName and threshold details that need to be applied to given eventName\n entry_schema:\n type: onap.datatypes.monitoring.metricsPerEventName\n onap.datatypes.monitoring.thresholds:\n derived_from: tosca.datatypes.Root\n properties:\n closedLoopControlName:\n type: string\n required: true\n description: Closed Loop Control Name associated with the threshold\n closedLoopEventStatus:\n type: string\n required: true\n description: Closed Loop Event Status of the threshold\n constraints:\n - valid_values:\n - ONSET\n - ABATED\n direction:\n type: string\n required: true\n description: Direction of the threshold\n constraints:\n - valid_values:\n - LESS\n - LESS_OR_EQUAL\n - GREATER\n - GREATER_OR_EQUAL\n - EQUAL\n fieldPath:\n type: string\n required: true\n description: Json field Path as per CEF message which needs to be analyzed for TCA\n constraints:\n - valid_values:\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsAccumulated\n - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuIdle\n - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageInterrupt\n - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageNice\n - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSoftIrq\n - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSteal\n - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSystem\n - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuWait\n - $.event.measurementsForVfScalingFields.cpuUsageArray[*].percentUsage\n - $.event.measurementsForVfScalingFields.meanRequestLatency\n - $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryBuffered\n - $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryCached\n - $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryConfigured\n - $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryFree\n - $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryUsed\n - $.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value\n severity:\n type: string\n required: true\n description: Threshold Event Severity\n constraints:\n - valid_values:\n - CRITICAL\n - MAJOR\n - MINOR\n - WARNING\n - NORMAL\n thresholdValue:\n type: integer\n required: true\n description: Threshold value for the field Path inside CEF message\n version:\n type: string\n required: true\n description: Version number associated with the threshold\n',NULL,'\0'); +INSERT INTO `micro_service_policies` VALUES ('TCA_iYTIP_v1_0_ResourceInstanceName2_tca_2','{\n \"schema\": {\n \"uniqueItems\": \"true\",\n \"format\": \"tabs-top\",\n \"type\": \"array\",\n \"title\": \"TCA Policy JSON\",\n \"items\": {\n \"type\": \"object\",\n \"title\": \"TCA Policy JSON\",\n \"required\": [\n \"domain\",\n \"metricsPerEventName\"\n ],\n \"properties\": {\n \"domain\": {\n \"propertyOrder\": 1001,\n \"default\": \"measurementsForVfScaling\",\n \"title\": \"Domain name to which TCA needs to be applied\",\n \"type\": \"string\"\n },\n \"metricsPerEventName\": {\n \"propertyOrder\": 1002,\n \"uniqueItems\": \"true\",\n \"format\": \"tabs-top\",\n \"title\": \"Contains eventName and threshold details that need to be applied to given eventName\",\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\n \"controlLoopSchemaType\",\n \"eventName\",\n \"policyName\",\n \"policyScope\",\n \"policyVersion\",\n \"thresholds\"\n ],\n \"properties\": {\n \"policyVersion\": {\n \"propertyOrder\": 1007,\n \"title\": \"TCA Policy Scope Version\",\n \"type\": \"string\"\n },\n \"thresholds\": {\n \"propertyOrder\": 1008,\n \"uniqueItems\": \"true\",\n \"format\": \"tabs-top\",\n \"title\": \"Thresholds associated with eventName\",\n \"type\": \"array\",\n \"items\": {\n \"type\": \"object\",\n \"required\": [\n \"closedLoopControlName\",\n \"closedLoopEventStatus\",\n \"direction\",\n \"fieldPath\",\n \"severity\",\n \"thresholdValue\",\n \"version\"\n ],\n \"properties\": {\n \"severity\": {\n \"propertyOrder\": 1013,\n \"title\": \"Threshold Event Severity\",\n \"type\": \"string\",\n \"enum\": [\n \"CRITICAL\",\n \"MAJOR\",\n \"MINOR\",\n \"WARNING\",\n \"NORMAL\"\n ]\n },\n \"fieldPath\": {\n \"propertyOrder\": 1012,\n \"title\": \"Json field Path as per CEF message which needs to be analyzed for TCA\",\n \"type\": \"string\",\n \"enum\": [\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsDelta\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsAccumulated\",\n \"$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuIdle\",\n \"$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageInterrupt\",\n \"$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageNice\",\n \"$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSoftIrq\",\n \"$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSteal\",\n \"$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSystem\",\n \"$.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuWait\",\n \"$.event.measurementsForVfScalingFields.cpuUsageArray[*].percentUsage\",\n \"$.event.measurementsForVfScalingFields.meanRequestLatency\",\n \"$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryBuffered\",\n \"$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryCached\",\n \"$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryConfigured\",\n \"$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryFree\",\n \"$.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryUsed\",\n \"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value\"\n ]\n },\n \"thresholdValue\": {\n \"propertyOrder\": 1014,\n \"title\": \"Threshold value for the field Path inside CEF message\",\n \"type\": \"integer\"\n },\n \"closedLoopEventStatus\": {\n \"propertyOrder\": 1010,\n \"title\": \"Closed Loop Event Status of the threshold\",\n \"type\": \"string\",\n \"enum\": [\n \"ONSET\",\n \"ABATED\"\n ]\n },\n \"closedLoopControlName\": {\n \"propertyOrder\": 1009,\n \"title\": \"Closed Loop Control Name associated with the threshold\",\n \"type\": \"string\"\n },\n \"version\": {\n \"propertyOrder\": 1015,\n \"title\": \"Version number associated with the threshold\",\n \"type\": \"string\"\n },\n \"direction\": {\n \"propertyOrder\": 1011,\n \"title\": \"Direction of the threshold\",\n \"type\": \"string\",\n \"enum\": [\n \"LESS\",\n \"LESS_OR_EQUAL\",\n \"GREATER\",\n \"GREATER_OR_EQUAL\",\n \"EQUAL\"\n ]\n }\n }\n }\n },\n \"policyName\": {\n \"propertyOrder\": 1005,\n \"title\": \"TCA Policy Scope Name\",\n \"type\": \"string\"\n },\n \"controlLoopSchemaType\": {\n \"propertyOrder\": 1003,\n \"title\": \"Specifies Control Loop Schema Type for the event Name e.g. VNF, VM\",\n \"type\": \"string\",\n \"enum\": [\n \"VM\",\n \"VNF\"\n ]\n },\n \"policyScope\": {\n \"propertyOrder\": 1006,\n \"title\": \"TCA Policy Scope\",\n \"type\": \"string\"\n },\n \"eventName\": {\n \"propertyOrder\": 1004,\n \"title\": \"Event name to which thresholds need to be applied\",\n \"type\": \"string\"\n }\n }\n }\n }\n }\n }\n }\n}','onap.policy.monitoring.cdap.tca.hi.lo.app','tosca_definitions_version: tosca_simple_yaml_1_0_0\npolicy_types:\n onap.policies.Monitoring:\n derived_from: tosca.policies.Root\n description: a base policy type for all policies that governs monitoring provisioning\n onap.policy.monitoring.cdap.tca.hi.lo.app:\n derived_from: onap.policies.Monitoring\n version: 1.0.0\n properties:\n tca_policy:\n type: map\n description: TCA Policy JSON\n entry_schema:\n type: onap.datatypes.monitoring.tca_policy\ndata_types:\n onap.datatypes.monitoring.metricsPerEventName:\n derived_from: tosca.datatypes.Root\n properties:\n controlLoopSchemaType:\n type: string\n required: true\n description: Specifies Control Loop Schema Type for the event Name e.g. VNF, VM\n constraints:\n - valid_values:\n - VM\n - VNF\n eventName:\n type: string\n required: true\n description: Event name to which thresholds need to be applied\n policyName:\n type: string\n required: true\n description: TCA Policy Scope Name\n policyScope:\n type: string\n required: true\n description: TCA Policy Scope\n policyVersion:\n type: string\n required: true\n description: TCA Policy Scope Version\n thresholds:\n type: list\n required: true\n description: Thresholds associated with eventName\n entry_schema:\n type: onap.datatypes.monitoring.thresholds\n onap.datatypes.monitoring.tca_policy:\n derived_from: tosca.datatypes.Root\n properties:\n domain:\n type: string\n required: true\n description: Domain name to which TCA needs to be applied\n default: measurementsForVfScaling\n constraints:\n - equal: measurementsForVfScaling\n metricsPerEventName:\n type: list\n required: true\n description: Contains eventName and threshold details that need to be applied to given eventName\n entry_schema:\n type: onap.datatypes.monitoring.metricsPerEventName\n onap.datatypes.monitoring.thresholds:\n derived_from: tosca.datatypes.Root\n properties:\n closedLoopControlName:\n type: string\n required: true\n description: Closed Loop Control Name associated with the threshold\n closedLoopEventStatus:\n type: string\n required: true\n description: Closed Loop Event Status of the threshold\n constraints:\n - valid_values:\n - ONSET\n - ABATED\n direction:\n type: string\n required: true\n description: Direction of the threshold\n constraints:\n - valid_values:\n - LESS\n - LESS_OR_EQUAL\n - GREATER\n - GREATER_OR_EQUAL\n - EQUAL\n fieldPath:\n type: string\n required: true\n description: Json field Path as per CEF message which needs to be analyzed for TCA\n constraints:\n - valid_values:\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsDelta\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsAccumulated\n - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsAccumulated\n - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuIdle\n - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageInterrupt\n - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageNice\n - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSoftIrq\n - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSteal\n - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSystem\n - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuWait\n - $.event.measurementsForVfScalingFields.cpuUsageArray[*].percentUsage\n - $.event.measurementsForVfScalingFields.meanRequestLatency\n - $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryBuffered\n - $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryCached\n - $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryConfigured\n - $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryFree\n - $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryUsed\n - $.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value\n severity:\n type: string\n required: true\n description: Threshold Event Severity\n constraints:\n - valid_values:\n - CRITICAL\n - MAJOR\n - MINOR\n - WARNING\n - NORMAL\n thresholdValue:\n type: integer\n required: true\n description: Threshold value for the field Path inside CEF message\n version:\n type: string\n required: true\n description: Version number associated with the threshold\n',NULL,'\0'); +/*!40000 ALTER TABLE `micro_service_policies` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `model` +-- + +LOCK TABLES `model` WRITE; +/*!40000 ALTER TABLE `model` DISABLE KEYS */; +/*!40000 ALTER TABLE `model` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `model_blueprint` +-- + +LOCK TABLES `model_blueprint` WRITE; +/*!40000 ALTER TABLE `model_blueprint` DISABLE KEYS */; +/*!40000 ALTER TABLE `model_blueprint` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `model_instance` +-- + +LOCK TABLES `model_instance` WRITE; +/*!40000 ALTER TABLE `model_instance` DISABLE KEYS */; +/*!40000 ALTER TABLE `model_instance` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `model_properties` +-- + +LOCK TABLES `model_properties` WRITE; +/*!40000 ALTER TABLE `model_properties` DISABLE KEYS */; +/*!40000 ALTER TABLE `model_properties` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `operational_policies` +-- + +LOCK TABLES `operational_policies` WRITE; +/*!40000 ALTER TABLE `operational_policies` DISABLE KEYS */; +INSERT INTO `operational_policies` VALUES ('OPERATIONAL_iYTIP_v1_0_ResourceInstanceName1_tca','{}','LOOP_iYTIP_v1_0_ResourceInstanceName1_tca'); +INSERT INTO `operational_policies` VALUES ('OPERATIONAL_iYTIP_v1_0_ResourceInstanceName1_tca_3','{}','LOOP_iYTIP_v1_0_ResourceInstanceName1_tca_3'); +INSERT INTO `operational_policies` VALUES ('OPERATIONAL_iYTIP_v1_0_ResourceInstanceName2_tca_2','{}','LOOP_iYTIP_v1_0_ResourceInstanceName2_tca_2'); +/*!40000 ALTER TABLE `operational_policies` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `template` +-- + +LOCK TABLES `template` WRITE; +/*!40000 ALTER TABLE `template` DISABLE KEYS */; +/*!40000 ALTER TABLE `template` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `template_bpmn` +-- + +LOCK TABLES `template_bpmn` WRITE; +/*!40000 ALTER TABLE `template_bpmn` DISABLE KEYS */; +/*!40000 ALTER TABLE `template_bpmn` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `template_doc` +-- + +LOCK TABLES `template_doc` WRITE; +/*!40000 ALTER TABLE `template_doc` DISABLE KEYS */; +/*!40000 ALTER TABLE `template_doc` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `template_image` +-- + +LOCK TABLES `template_image` WRITE; +/*!40000 ALTER TABLE `template_image` DISABLE KEYS */; +/*!40000 ALTER TABLE `template_image` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `tosca_model` +-- + +LOCK TABLES `tosca_model` WRITE; +/*!40000 ALTER TABLE `tosca_model` DISABLE KEYS */; +/*!40000 ALTER TABLE `tosca_model` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `tosca_model_revision` +-- + +LOCK TABLES `tosca_model_revision` WRITE; +/*!40000 ALTER TABLE `tosca_model_revision` DISABLE KEYS */; +/*!40000 ALTER TABLE `tosca_model_revision` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2019-04-09 8:06:05 -- cgit 1.2.3-korg