diff options
author | Gervais-Martial Ngueko <gervais-martial.ngueko@intl.att.com> | 2021-01-21 18:23:46 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-01-21 18:23:46 +0000 |
commit | 31f6f737a191455918a6e5bbf396ecc939d8b173 (patch) | |
tree | 0da2da3dd13ba65c7801a32fe9ce57e6ae732228 /src/test/resources/http-cache | |
parent | c2862f4ccd9e4a8c84aed9f10702a6548a365828 (diff) | |
parent | dabd6db614abf78508add7cdbef2120120ce3d9b (diff) |
Merge "Add policies list and PDP responses in the emulator"
Diffstat (limited to 'src/test/resources/http-cache')
6 files changed, 527 insertions, 2 deletions
diff --git a/src/test/resources/http-cache/example/policy/api/v1/policies/.file b/src/test/resources/http-cache/example/policy/api/v1/policies/.file new file mode 100644 index 000000000..431de3e7c --- /dev/null +++ b/src/test/resources/http-cache/example/policy/api/v1/policies/.file @@ -0,0 +1,197 @@ +{ + "tosca_definitions_version": "tosca_simple_yaml_1_1_0", + "topology_template": { + "policies": [ + { + "MICROSERVICE_vLoadBalancerMS_v1_0_tcagen2_1_0_0_AV0": { + "type": "onap.policies.monitoring.tcagen2", + "type_version": "1.0.0", + "properties": { + "tca.policy": { + "domain": "measurementsForVfScaling", + "metricsPerEventName": [ + { + "policyScope": "DCAE", + "thresholds": [ + { + "version": "1.0.2", + "severity": "MAJOR", + "thresholdValue": 200, + "closedLoopEventStatus": "ONSET", + "closedLoopControlName": "LOOP_test", + "direction": "LESS_OR_ElsQUAL", + "fieldPath": "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta" + } + ], + "eventName": "vLoadBalancer", + "policyVersion": "v0.0.1", + "controlLoopSchemaType": "VM", + "policyName": "DCAE.Config_tca-hi-lo" + } + ] + } + }, + "name": "MICROSERVICE_vLoadBalancerMS_v1_0_tcagen2_1_0_0_AV0", + "version": "1.0.0", + "metadata": { + "policy-id": "MICROSERVICE_vLoadBalancerMS_v1_0_tcagen2_1_0_0_AV0", + "policy-version": "1.0.0" + } + } + }, + { + "OPERATIONAL_vLoadBalancerMS_v1_0_Drools_1_0_0_7xd": { + "type": "onap.policies.controlloop.operational.common.Drools", + "type_version": "1.0.0", + "properties": { + "abatement": false, + "operations": [ + { + "failure_retries": "final_failure_retries", + "id": "test1", + "failure_timeout": "final_failure_timeout", + "failure": "final_failure", + "operation": { + "payload": { + "artifact_name": "baseconfiguration", + "artifact_version": "1.0.0", + "mode": "async", + "data": "{\"resource-assignment-properties\":{\"request-id\":\"\",\"service-instance-id\":\"\",\"hostname\":\"\",\"request-info\":{\"prop1\":\"\",\"prop2\":\"\"}}}" + }, + "target": { + "entityIds": { + "resourceID": "Vloadbalancerms..vdns..module-3", + "modelInvariantId": "4c10ba9b-f88f-415e-9de3-5d33336047fa", + "modelVersionId": "4fa73b49-8a6c-493e-816b-eb401567b720", + "modelName": "Vloadbalancerms..vdns..module-3", + "modelVersion": "1", + "modelCustomizationId": "bafcdab0-801d-4d81-9ead-f464640a38b1" + }, + "targetType": "VNF" + }, + "actor": "SDNR", + "operation": "BandwidthOnDemand" + }, + "failure_guard": "final_failure_guard", + "retries": 0, + "timeout": 0, + "failure_exception": "final_failure_exception", + "description": "test", + "success": "final_success" + } + ], + "trigger": "test1", + "timeout": 0, + "id": "LOOP_test" + }, + "name": "OPERATIONAL_vLoadBalancerMS_v1_0_Drools_1_0_0_7xd", + "version": "1.0.0", + "metadata": { + "policy-id": "OPERATIONAL_vLoadBalancerMS_v1_0_Drools_1_0_0_7xd", + "policy-version": "1.0.0" + } + } + }, + { + "SDNC_Policy.ONAP_NF_NAMING_TIMESTAMP": { + "type": "onap.policies.Naming", + "type_version": "1.0.0", + "properties": { + "naming-models": [ + { + "naming-type": "VNF", + "naming-recipe": "AIC_CLOUD_REGION|DELIMITER|CONSTANT|DELIMITER|TIMESTAMP", + "name-operation": "to_lower_case()", + "naming-properties": [ + { + "property-name": "AIC_CLOUD_REGION" + }, + { + "property-name": "CONSTANT", + "property-value": "onap-nf" + }, + { + "property-name": "TIMESTAMP" + }, + { + "property-value": "-", + "property-name": "DELIMITER" + } + ] + }, + { + "naming-type": "VNFC", + "naming-recipe": "VNF_NAME|DELIMITER|NFC_NAMING_CODE|DELIMITER|SEQUENCE", + "name-operation": "to_lower_case()", + "naming-properties": [ + { + "property-name": "VNF_NAME" + }, + { + "property-name": "SEQUENCE", + "increment-sequence": { + "max": "zzz", + "scope": "ENTIRETY", + "start-value": "1", + "length": "3", + "increment": "1", + "sequence-type": "alpha-numeric" + } + }, + { + "property-name": "NFC_NAMING_CODE" + }, + { + "property-value": "-", + "property-name": "DELIMITER" + } + ] + }, + { + "naming-type": "VF-MODULE", + "naming-recipe": "VNF_NAME|DELIMITER|VF_MODULE_LABEL|DELIMITER|VF_MODULE_TYPE|DELIMITER|SEQUENCE", + "name-operation": "to_lower_case()", + "naming-properties": [ + { + "property-name": "VNF_NAME" + }, + { + "property-value": "-", + "property-name": "DELIMITER" + }, + { + "property-name": "VF_MODULE_LABEL" + }, + { + "property-name": "VF_MODULE_TYPE" + }, + { + "property-name": "SEQUENCE", + "increment-sequence": { + "max": "zzz", + "scope": "PRECEEDING", + "start-value": "1", + "length": "3", + "increment": "1", + "sequence-type": "alpha-numeric" + } + } + ] + } + ], + "policy-instance-name": "ONAP_NF_NAMING_TIMESTAMP" + }, + "name": "SDNC_Policy.ONAP_NF_NAMING_TIMESTAMP", + "version": "1.0.0", + "metadata": { + "policy-id": "SDNC_Policy.ONAP_NF_NAMING_TIMESTAMP", + "policy-version": "1.0.0" + } + } + } + ] + }, + "name": "ToscaServiceTemplateSimple", + "version": "1.0.0", + "metadata": {} +}
\ No newline at end of file diff --git a/src/test/resources/http-cache/example/policy/api/v1/policies/.header b/src/test/resources/http-cache/example/policy/api/v1/policies/.header new file mode 100644 index 000000000..6a280d972 --- /dev/null +++ b/src/test/resources/http-cache/example/policy/api/v1/policies/.header @@ -0,0 +1 @@ +{"Transfer-Encoding": "chunked", "Set-Cookie": "JSESSIONID=158qxkdtdobkd1umr3ikkgrmlx;Path=/", "Expires": "Thu, 01 Jan 1970 00:00:00 GMT", "Server": "Jetty(9.3.21.v20170918)", "Content-Type": "application/json", "X-ECOMP-RequestID": "e2ddb3c8-994f-47df-b4dc-097d4fb55c08"}
\ No newline at end of file diff --git a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/.file b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/.file new file mode 100644 index 000000000..367d2b5a4 --- /dev/null +++ b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/.file @@ -0,0 +1,160 @@ +tosca_definitions_version: tosca_simple_yaml_1_1_0 +policy_types: + onap.policies.Monitoring: + derived_from: tosca.policies.Root + version: 1.0.0 + name: onap.policies.Monitoring + description: a base policy type for all policies that govern monitoring provisioning + onap.policies.monitoring.tcagen2: + derived_from: onap.policies.Monitoring + version: 1.0.0 + name: onap.policies.monitoring.tcagen2 + properties: + tca.policy: + type: onap.datatypes.monitoring.tca_policy + description: TCA Policy JSON + required: true +data_types: + onap.datatypes.monitoring.metricsPerEventName: + derived_from: tosca.datatypes.Root + properties: + controlLoopSchemaType: + type: string + required: true + description: Specifies Control Loop Schema Type for the event Name e.g. VNF, VM + constraints: + - valid_values: + - VM + - VNF + eventName: + type: string + required: true + description: Event name to which thresholds need to be applied + policyName: + type: string + required: true + description: TCA Policy Scope Name + policyScope: + type: string + required: true + description: TCA Policy Scope + policyVersion: + type: string + required: true + description: TCA Policy Scope Version + thresholds: + type: list + required: true + description: Thresholds associated with eventName + entry_schema: + type: onap.datatypes.monitoring.thresholds + onap.datatypes.monitoring.tca_policy: + derived_from: tosca.datatypes.Root + properties: + domain: + type: string + required: true + description: Domain name to which TCA needs to be applied + default: measurementsForVfScaling + constraints: + - equal: measurementsForVfScaling + metricsPerEventName: + type: list + required: true + description: Contains eventName and threshold details that need to be applied to given eventName + entry_schema: + type: onap.datatypes.monitoring.metricsPerEventName + onap.datatypes.monitoring.thresholds: + derived_from: tosca.datatypes.Root + properties: + closedLoopControlName: + type: string + required: true + description: Closed Loop Control Name associated with the threshold + closedLoopEventStatus: + type: string + required: true + description: Closed Loop Event Status of the threshold + constraints: + - valid_values: + - ONSET + - ABATED + direction: + type: string + required: true + description: Direction of the threshold + constraints: + - valid_values: + - LESS + - LESS_OR_EQUAL + - GREATER + - GREATER_OR_EQUAL + - EQUAL + fieldPath: + type: string + required: true + description: Json field Path as per CEF message which needs to be analyzed for TCA + constraints: + - valid_values: + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsDelta + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsDelta + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsDelta + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsDelta + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsDelta + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsDelta + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsAccumulated + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedOctetsAccumulated + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedUnicastPacketsAccumulated + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedMulticastPacketsAccumulated + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsAccumulated + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedErrorPacketsAccumulated + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsDelta + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsDelta + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsDelta + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsDelta + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsDelta + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsDelta + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsDelta + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedTotalPacketsAccumulated + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedOctetsAccumulated + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedUnicastPacketsAccumulated + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedMulticastPacketsAccumulated + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedBroadcastPacketsAccumulated + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedDiscardedPacketsAccumulated + - $.event.measurementsForVfScalingFields.vNicPerformanceArray[*].transmittedErrorPacketsAccumulated + - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuIdle + - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageInterrupt + - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageNice + - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSoftIrq + - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSteal + - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuUsageSystem + - $.event.measurementsForVfScalingFields.cpuUsageArray[*].cpuWait + - $.event.measurementsForVfScalingFields.cpuUsageArray[*].percentUsage + - $.event.measurementsForVfScalingFields.meanRequestLatency + - $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryBuffered + - $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryCached + - $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryConfigured + - $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryFree + - $.event.measurementsForVfScalingFields.memoryUsageArray[*].memoryUsed + - $.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value + severity: + type: string + required: true + description: Threshold Event Severity + constraints: + - valid_values: + - CRITICAL + - MAJOR + - MINOR + - WARNING + - NORMAL + thresholdValue: + type: integer + required: true + description: Threshold value for the field Path inside CEF message + version: + type: string + required: true + description: Version number associated with the threshold
\ No newline at end of file diff --git a/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/.header b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/.header new file mode 100644 index 000000000..6a280d972 --- /dev/null +++ b/src/test/resources/http-cache/example/policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/.header @@ -0,0 +1 @@ +{"Transfer-Encoding": "chunked", "Set-Cookie": "JSESSIONID=158qxkdtdobkd1umr3ikkgrmlx;Path=/", "Expires": "Thu, 01 Jan 1970 00:00:00 GMT", "Server": "Jetty(9.3.21.v20170918)", "Content-Type": "application/json", "X-ECOMP-RequestID": "e2ddb3c8-994f-47df-b4dc-097d4fb55c08"}
\ No newline at end of file diff --git a/src/test/resources/http-cache/example/policy/pap/v1/pdps/.file b/src/test/resources/http-cache/example/policy/pap/v1/pdps/.file index f16f4e899..af1944c59 100644 --- a/src/test/resources/http-cache/example/policy/pap/v1/pdps/.file +++ b/src/test/resources/http-cache/example/policy/pap/v1/pdps/.file @@ -24,7 +24,12 @@ "desiredInstanceCount": 1, "pdpInstances": [], "pdpType": "drools", - "policies": [], + "policies": [ + { + "name": "OPERATIONAL_vLoadBalancerMS_v1_0_Drools_1_0_0_7xd", + "version": "1.0.0" + } + ], "properties": {}, "supportedPolicyTypes": [ { @@ -64,7 +69,16 @@ "desiredInstanceCount": 1, "pdpInstances": [], "pdpType": "xacml", - "policies": [], + "policies": [ + { + "name": "SDNC_Policy.ONAP_NF_NAMING_TIMESTAMP", + "version": "1.0.0" + }, + { + "name": "MICROSERVICE_vLoadBalancerMS_v1_0_tcagen2_1_0_0_AV0", + "version": "1.0.0" + } + ], "properties": {}, "supportedPolicyTypes": [ { diff --git a/src/test/resources/http-cache/example/policy/pap/v1/pdps/test.json b/src/test/resources/http-cache/example/policy/pap/v1/pdps/test.json new file mode 100644 index 000000000..c22508441 --- /dev/null +++ b/src/test/resources/http-cache/example/policy/pap/v1/pdps/test.json @@ -0,0 +1,152 @@ +{ + "groups": [ + { + "name": "defaultGroup", + "description": "The default group that registers all supported policy types and pdps.", + "pdpGroupState": "ACTIVE", + "properties": {}, + "pdpSubgroups": [ + { + "pdpType": "apex", + "supportedPolicyTypes": [ + { + "name": "onap.policies.controlloop.operational.common.Apex", + "version": "1.0.0" + }, + { + "name": "onap.policies.native.Apex", + "version": "1.0.0" + } + ], + "policies": [], + "currentInstanceCount": 0, + "desiredInstanceCount": 1, + "properties": {}, + "pdpInstances": [] + }, + { + "pdpType": "drools", + "supportedPolicyTypes": [ + { + "name": "onap.policies.controlloop.operational.common.Drools", + "version": "1.0.0" + }, + { + "name": "onap.policies.native.drools.Controller", + "version": "1.0.0" + }, + { + "name": "onap.policies.native.drools.Artifact", + "version": "1.0.0" + } + ], + "policies": [ + { + "name": "OPERATIONAL_vLoadBalancerMS_v1_0_Drools_1_0_0_7xd", + "version": "1.0.0" + } + ], + "currentInstanceCount": 0, + "desiredInstanceCount": 1, + "properties": {}, + "pdpInstances": [] + }, + { + "pdpType": "xacml", + "supportedPolicyTypes": [ + { + "name": "onap.policies.controlloop.guard.common.FrequencyLimiter", + "version": "1.0.0" + }, + { + "name": "onap.policies.controlloop.guard.common.MinMax", + "version": "1.0.0" + }, + { + "name": "onap.policies.controlloop.guard.common.Blacklist", + "version": "1.0.0" + }, + { + "name": "onap.policies.controlloop.guard.common.Filter", + "version": "1.0.0" + }, + { + "name": "onap.policies.controlloop.guard.coordination.FirstBlocksSecond", + "version": "1.0.0" + }, + { + "name": "onap.policies.monitoring.*", + "version": "1.0.0" + }, + { + "name": "onap.policies.optimization.*", + "version": "1.0.0" + }, + { + "name": "onap.policies.optimization.resource.AffinityPolicy", + "version": "1.0.0" + }, + { + "name": "onap.policies.optimization.resource.DistancePolicy", + "version": "1.0.0" + }, + { + "name": "onap.policies.optimization.resource.HpaPolicy", + "version": "1.0.0" + }, + { + "name": "onap.policies.optimization.resource.OptimizationPolicy", + "version": "1.0.0" + }, + { + "name": "onap.policies.optimization.resource.PciPolicy", + "version": "1.0.0" + }, + { + "name": "onap.policies.optimization.service.QueryPolicy", + "version": "1.0.0" + }, + { + "name": "onap.policies.optimization.service.SubscriberPolicy", + "version": "1.0.0" + }, + { + "name": "onap.policies.optimization.resource.Vim_fit", + "version": "1.0.0" + }, + { + "name": "onap.policies.optimization.resource.VnfPolicy", + "version": "1.0.0" + }, + { + "name": "onap.policies.native.Xacml", + "version": "1.0.0" + }, + { + "name": "onap.policies.Naming", + "version": "1.0.0" + }, + { + "name": "onap.policies.match.*", + "version": "1.0.0" + } + ], + "policies": [ + { + "name": "SDNC_Policy.ONAP_NF_NAMING_TIMESTAMP", + "version": "1.0.0" + }, + { + "name": "MICROSERVICE_vLoadBalancerMS_v1_0_tcagen2_1_0_0_AV0", + "version": "1.0.0" + } + ], + "currentInstanceCount": 0, + "desiredInstanceCount": 1, + "properties": {}, + "pdpInstances": [] + } + ] + } + ] +}
\ No newline at end of file |