diff options
author | Prudence Au <prudence.au@amdocs.com> | 2018-08-13 17:06:59 -0400 |
---|---|---|
committer | Pierre Rioux <pierre.rioux@amdocs.com> | 2018-08-21 11:21:26 -0400 |
commit | c604f64b971491f8c9b953adce54b847d7946e26 (patch) | |
tree | 134f7fc91b4da9e04c564c92337d44df420c8df0 /src/test/resources/rule-driven-validator | |
parent | 3baa3ebd0000b15f1c54c736f4a307731b16b923 (diff) |
Initial submission for validation service
Change-Id: I9372430f1ae347373d5a9a0c7a427d7bd393d61e
Issue-ID: LOG-427
Signed-off-by: Prudence Au (prudence.au@amdocs.com)
Signed-off-by: Geora Barsky <georab@amdocs.com>
Signed-off-by: Pierre Rioux <pierre.rioux@amdocs.com>
Diffstat (limited to 'src/test/resources/rule-driven-validator')
24 files changed, 1847 insertions, 0 deletions
diff --git a/src/test/resources/rule-driven-validator/results/expected/generic-vnf-create-event.exp.json b/src/test/resources/rule-driven-validator/results/expected/generic-vnf-create-event.exp.json new file mode 100644 index 0000000..ef0848a --- /dev/null +++ b/src/test/resources/rule-driven-validator/results/expected/generic-vnf-create-event.exp.json @@ -0,0 +1,35 @@ +{ + "validationId": "", + "validationTimestamp": "", + "entityId": { + "vnf-id": "e5365951-9d90-4853-afae-c34a0707e3b6" + }, + "entityType": "generic-vnf", + "entityLink": "network/generic-vnfs/generic-vnf/e5365951-9d90-4853-afae-c34a0707e3b6", + "resourceVersion": "1476736914", + "entity":"fkdlfkdl", + "violations": [ + { + "violationId": "f47ce3b89d92659086e986f674cec4a7bed54601b8007aac69c6157101973b90", + "category": "INVALID_VALUE", + "severity": "CRITICAL", + "violationType": "Rule", + "validationRule": "prov-status", + "violationDetails": { + "prov-status": null + }, + "errorMessage": "Invalid prov-status value. Must be PREPROV, NVTPROV, PROV, CAPPED, DECOM, or RETIRED" + }, + { + "violationId": "227d68c5fb944636cc9b8a08e8fcefadf13bfd1ba2c40547d664b7150f1ebc14", + "category": "INVALID_VALUE", + "severity": "MINOR", + "violationType": "Rule", + "validationRule": "valid_ipv4_addr", + "violationDetails": { + "ipv4-oam-address": "" + }, + "errorMessage": "Invalid value - attribute is not a valid IPv4 address" + } + ] +}
\ No newline at end of file diff --git a/src/test/resources/rule-driven-validator/results/expected/gizmo-pserver-create-event-invalid-ipaddress.exp.json b/src/test/resources/rule-driven-validator/results/expected/gizmo-pserver-create-event-invalid-ipaddress.exp.json new file mode 100644 index 0000000..b6b851c --- /dev/null +++ b/src/test/resources/rule-driven-validator/results/expected/gizmo-pserver-create-event-invalid-ipaddress.exp.json @@ -0,0 +1,24 @@ +{ + "validationId":"5d37dd63-8289-4e0c-8da0-9007c1de4e39", + "validationTimestamp":"20180220T173524Z", + "entityId":{ + "hostname":"myhost" + }, + "entityType":"pserver", + "entityLink":"", + "resourceVersion":"1477013499", + "violations":[ + { + "violationId":"f0c12d0f91779de43034ca5be323d0e0b076d228f49a998a910127af0da0009b", + "modelName":null, + "category":"INVALID_VALUE", + "severity":"MINOR", + "violationType":"Rule", + "validationRule":"valid_ipv4_addr", + "violationDetails":{ + "vertex.properties.ipv4-oam-address":"1.2.3." + }, + "errorMessage":"Invalid value - attribute is not a valid IPv4 address" + } + ] +}
\ No newline at end of file diff --git a/src/test/resources/rule-driven-validator/results/expected/gizmo-pserver-create-event.exp.json b/src/test/resources/rule-driven-validator/results/expected/gizmo-pserver-create-event.exp.json new file mode 100644 index 0000000..256a488 --- /dev/null +++ b/src/test/resources/rule-driven-validator/results/expected/gizmo-pserver-create-event.exp.json @@ -0,0 +1,13 @@ +{ + "validationId":"f7c28a16-2bdf-40a9-9414-ad430e2550c8", + "validationTimestamp":"20180220T172745Z", + "entityId":{ + "hostname":"myhost" + }, + "entityType":"pserver", + "entityLink":"", + "resourceVersion":"1477013499", + "violations":[ + + ] +}
\ No newline at end of file diff --git a/src/test/resources/rule-driven-validator/results/expected/vserver-create-AAI-EVENT-devINT1-TRINITY-VNF-NAME-BAD.exp.json b/src/test/resources/rule-driven-validator/results/expected/vserver-create-AAI-EVENT-devINT1-TRINITY-VNF-NAME-BAD.exp.json new file mode 100644 index 0000000..a8a4ae2 --- /dev/null +++ b/src/test/resources/rule-driven-validator/results/expected/vserver-create-AAI-EVENT-devINT1-TRINITY-VNF-NAME-BAD.exp.json @@ -0,0 +1,128 @@ +{ + "validationId": "VALIDATIONID", + "validationTimestamp": "TIMESTAMP", + "entityId": { + "vserver-id": "c385bb3e-6ebd-4898-bc92-792e0ac2db50" + }, + "entityType": "vserver", + "entityLink": "cloud-infrastructure/cloud-regions/cloud-region/region1/AAIregion1/tenants/tenant/example-tenant-id-val-88551/vservers/vserver/example-vserver-id-val-34666", + "resourceVersion": "1475160142", + "violations": [ + { + "violationId": "3855354af5e3da4383dd39beac0c814e5125e0afa3bf0332f9289aa6178db5d6", + "category": "INVALID_VALUE", + "severity": "CRITICAL", + "violationType": "Rule", + "validationRule": "prov-status", + "violationDetails": { + "prov-status": "ACTIVE" + }, + "errorMessage": "Invalid prov-status value. Must be PREPROV, NVTPROV, PROV, CAPPED, DECOM, or RETIRED" + }, + { + "violationId": "2adb3dbf7ab2acb68033608ab5641962a953f720a76a7fe8c143792851ca0901", + "category": "INVALID_NAME", + "severity": "MINOR", + "violationType": "Rule", + "validationRule": "vserver related to TRINITY image and generic-vnf.vnf-name matches naming convention", + "violationDetails": { + "relationship-list.relationship[*]": [ + { + "related-to": "generic-vnf", + "related-link": "https://dummy-host.onap.org:8443/aai/v8/network/generic-vnfs/generic-vnf/ctpx12345v/", + "relationship-data": [ + { + "relationship-key": "generic-vnf.vnf-id", + "relationship-value": "ctpx12345v" + } + ], + "related-to-property": [ + { + "property-key": "generic-vnf.vnf-name", + "property-value": "ctpx12345v" + } + ] + }, + { + "related-to": "vf-module", + "related-link": "https://dummy-host.onap.org:8443/aai/v8/network/generic-vnfs/generic-vnf/ctpx12345v/vf-modules/vf-module/ctpx12345v/", + "relationship-data": [ + { + "relationship-key": "generic-vnf.vnf-id", + "relationship-value": "ctpx12345v" + }, + { + "relationship-key": "vf-module.vf-module-id", + "relationship-value": "ctpx12345v" + } + ] + }, + { + "related-to": "image", + "related-link": "https://dummy-host.onap.org:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/region1/AAIregion1/images/image/TRINITY-IMAGE/", + "relationship-data": [ + { + "relationship-key": "cloud-region.cloud-owner", + "relationship-value": "region1" + }, + { + "relationship-key": "cloud-region.cloud-region-id", + "relationship-value": "AAIregion1" + }, + { + "relationship-key": "image.image-id", + "relationship-value": "TRINITY-IMAGE" + } + ], + "related-to-property": [ + { + "property-key": "image.image-name", + "property-value": "TRINITY IMAGE" + } + ] + }, + { + "related-to": "pserver", + "related-link": "https://dummy-host.onap.org:8443/aai/v8/cloud-infrastructure/pservers/pserver/TRINITY-PSERVER/", + "relationship-data": [ + { + "relationship-key": "pserver.hostname", + "relationship-value": "TRINITY-PSERVER" + } + ], + "related-to-property": [ + { + "property-key": "pserver.pserver-name2" + } + ] + }, + { + "related-to": "flavor", + "related-link": "https://dummy-host.onap.org:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/region1/AAIregion1/flavors/flavor/TRINITY-Flavor/", + "relationship-data": [ + { + "relationship-key": "cloud-region.cloud-owner", + "relationship-value": "region1" + }, + { + "relationship-key": "cloud-region.cloud-region-id", + "relationship-value": "AAIregion1" + }, + { + "relationship-key": "flavor.flavor-id", + "relationship-value": "TRINITY-Flavor" + } + ], + "related-to-property": [ + { + "property-key": "flavor.flavor-name", + "property-value": "TRINITY Flavor" + } + ] + } + ] + }, + "errorMessage": "Invalid name - if vserver is related to an image named TRINITY, then the related generic-vnf name must match xxxxnnnnv (where x = character and n = number)" + } + ] +}
\ No newline at end of file diff --git a/src/test/resources/rule-driven-validator/results/expected/vserver-create-AAI-EVENT-devINT1-TRINITY-VNF-NAME-GOOD.exp.json b/src/test/resources/rule-driven-validator/results/expected/vserver-create-AAI-EVENT-devINT1-TRINITY-VNF-NAME-GOOD.exp.json new file mode 100644 index 0000000..6e63d7f --- /dev/null +++ b/src/test/resources/rule-driven-validator/results/expected/vserver-create-AAI-EVENT-devINT1-TRINITY-VNF-NAME-GOOD.exp.json @@ -0,0 +1,23 @@ +{ + "validationId": "VALIDATIONID", + "validationTimestamp": "TIMESTAMP", + "entityId": { + "vserver-id": "c385bb3e-6ebd-4898-bc92-792e0ac2db50" + }, + "entityType": "vserver", + "entityLink": "cloud-infrastructure/cloud-regions/cloud-region/region1/AAIregion1/tenants/tenant/example-tenant-id-val-88551/vservers/vserver/example-vserver-id-val-34666", + "resourceVersion": "1475160142", + "violations": [ + { + "violationId": "3855354af5e3da4383dd39beac0c814e5125e0afa3bf0332f9289aa6178db5d6", + "category": "INVALID_VALUE", + "severity": "CRITICAL", + "violationType": "Rule", + "validationRule": "prov-status", + "violationDetails": { + "prov-status": "ACTIVE" + }, + "errorMessage": "Invalid prov-status value. Must be PREPROV, NVTPROV, PROV, CAPPED, DECOM, or RETIRED" + } + ] +}
\ No newline at end of file diff --git a/src/test/resources/rule-driven-validator/results/expected/vserver-create-event.exp.json b/src/test/resources/rule-driven-validator/results/expected/vserver-create-event.exp.json new file mode 100644 index 0000000..7042c13 --- /dev/null +++ b/src/test/resources/rule-driven-validator/results/expected/vserver-create-event.exp.json @@ -0,0 +1,208 @@ +{ + "validationId": "VALIDATIONID", + "validationTimestamp": "TIMESTAMP", + "entityId": { + "vserver-id": "example-vserver-id-val-34666" + }, + "entityType": "vserver", + "entityLink": "cloud-infrastructure/cloud-regions/cloud-region/region1/AAIregion1/tenants/tenant/example-tenant-id-val-88551/vservers/vserver/example-vserver-id-val-34666", + "resourceVersion": "1464193654", + "violations": [ + { + "violationId": "312ed832aed6adfff008732d5d3c4e03d46195ea38f2c305c4e58c9779e4721f", + "category": "INVALID_VALUE", + "severity": "CRITICAL", + "violationType": "Rule", + "validationRule": "prov-status", + "violationDetails": { + "prov-status": "INVALID" + }, + "errorMessage": "Invalid prov-status value. Must be PREPROV, NVTPROV, PROV, CAPPED, DECOM, or RETIRED" + }, + { + "violationId": "819a20606acf8eefa64ea06ddb1041edebdec7eb18c5695860eda5e3d1729460", + "modelName": null, + "category": "INVALID_NAME", + "severity": "MINOR", + "violationType": "Rule", + "validationRule": "vserver related to TRINITY image and generic-vnf.vnf-name matches naming convention", + "violationDetails": { + "relationship-list.relationship[*]": [ + { + "related-to": "generic-vnf", + "related-link": "https://dummy-host.onap.org:8443/aai/v8/network/generic-vnfs/generic-vnf/bmsx0001v-1661/", + "relationship-data": [ + { + "relationship-key": "generic-vnf.vnf-id", + "relationship-value": "bmsx0001v-1661" + } + ], + "related-to-property": [ + { + "property-key": "generic-vnf.vnf-name", + "property-value": "bmsx000x" + } + ] + }, + { + "related-to": "image", + "related-link": "https://dummy-host.onap.org:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/region1/AAIregion1/images/image/ee49d429-283d-4f79-9c58-e11cc38d8856/", + "relationship-data": [ + { + "relationship-key": "cloud-region.cloud-owner", + "relationship-value": "region1" + }, + { + "relationship-key": "cloud-region.cloud-region-id", + "relationship-value": "AAIregion1" + }, + { + "relationship-key": "image.image-id", + "relationship-value": "ee49d429-283d-4f79-9c58-e11cc38d8856" + } + ], + "related-to-property": [ + { + "property-key": "image.image-name", + "property-value": "TRINITY" + } + ] + }, + { + "related-to": "pserver", + "related-link": "https://dummy-host.onap.org:8443/aai/v8/cloud-infrastructure/pservers/pserver/dpa2r03c007/", + "relationship-data": [ + { + "relationship-key": "pserver.hostname", + "relationship-value": "dpa2r03c007" + } + ], + "related-to-property": [ + { + "property-key": "pserver.pserver-name2" + } + ] + }, + { + "related-to": "flavor", + "related-link": "https://dummy-host.onap.org:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/region1/AAIregion1/flavors/flavor/5288f576-d9c6-46fc-9dcb-f6946a2b3597/", + "relationship-data": [ + { + "relationship-key": "cloud-region.cloud-owner", + "relationship-value": "region1" + }, + { + "relationship-key": "cloud-region.cloud-region-id", + "relationship-value": "AAIregion1" + }, + { + "relationship-key": "flavor.flavor-id", + "relationship-value": "5288f576-d9c6-46fc-9dcb-f6946a2b3597" + } + ], + "related-to-property": [ + { + "property-key": "flavor.flavor-name", + "property-value": "l5.xLarge" + } + ] + } + ] + }, + "errorMessage": "Invalid name - if vserver is related to an image named TRINITY, then the related generic-vnf name must match xxxxnnnnv (where x = character and n = number)" + }, + { + "violationId": "50819193f02c57e6878573dbe4d8d43942ee0b20cb539aed817c067072733f6e", + "modelName": null, + "category": "INVALID_NAME", + "severity": "MINOR", + "violationType": "Rule", + "validationRule": "vserver is related to a TRINITY image and vserver-name matches naming convention", + "violationDetails": { + "relationship-list.relationship[*]": [ + { + "related-to": "generic-vnf", + "related-link": "https://dummy-host.onap.org:8443/aai/v8/network/generic-vnfs/generic-vnf/bmsx0001v-1661/", + "relationship-data": [ + { + "relationship-key": "generic-vnf.vnf-id", + "relationship-value": "bmsx0001v-1661" + } + ], + "related-to-property": [ + { + "property-key": "generic-vnf.vnf-name", + "property-value": "bmsx000x" + } + ] + }, + { + "related-to": "image", + "related-link": "https://dummy-host.onap.org:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/region1/AAIregion1/images/image/ee49d429-283d-4f79-9c58-e11cc38d8856/", + "relationship-data": [ + { + "relationship-key": "cloud-region.cloud-owner", + "relationship-value": "region1" + }, + { + "relationship-key": "cloud-region.cloud-region-id", + "relationship-value": "AAIregion1" + }, + { + "relationship-key": "image.image-id", + "relationship-value": "ee49d429-283d-4f79-9c58-e11cc38d8856" + } + ], + "related-to-property": [ + { + "property-key": "image.image-name", + "property-value": "TRINITY" + } + ] + }, + { + "related-to": "pserver", + "related-link": "https://dummy-host.onap.org:8443/aai/v8/cloud-infrastructure/pservers/pserver/dpa2r03c007/", + "relationship-data": [ + { + "relationship-key": "pserver.hostname", + "relationship-value": "dpa2r03c007" + } + ], + "related-to-property": [ + { + "property-key": "pserver.pserver-name2" + } + ] + }, + { + "related-to": "flavor", + "related-link": "https://dummy-host.onap.org:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/region1/AAIregion1/flavors/flavor/5288f576-d9c6-46fc-9dcb-f6946a2b3597/", + "relationship-data": [ + { + "relationship-key": "cloud-region.cloud-owner", + "relationship-value": "region1" + }, + { + "relationship-key": "cloud-region.cloud-region-id", + "relationship-value": "AAIregion1" + }, + { + "relationship-key": "flavor.flavor-id", + "relationship-value": "5288f576-d9c6-46fc-9dcb-f6946a2b3597" + } + ], + "related-to-property": [ + { + "property-key": "flavor.flavor-name", + "property-value": "l5.xLarge" + } + ] + } + ], + "vserver-name": "example-vserver-name-val-34666" + }, + "errorMessage": "Invalid name - if vserver is related to an image named TRINITY, then the vserver name must match xxxxnnnnvmnnn (where x = character and n = number)" + } + ] +}
\ No newline at end of file diff --git a/src/test/resources/rule-driven-validator/results/expected/vserver-update-AAI-EVENT-devINT1.exp.json b/src/test/resources/rule-driven-validator/results/expected/vserver-update-AAI-EVENT-devINT1.exp.json new file mode 100644 index 0000000..4cf7264 --- /dev/null +++ b/src/test/resources/rule-driven-validator/results/expected/vserver-update-AAI-EVENT-devINT1.exp.json @@ -0,0 +1,38 @@ +{ + "validationId": "VALIDATIONID", + "validationTimestamp": "TIMESTAMP", + "entityId": { + "vserver-id": "fd280243-cd5c-424e-b629-533cabe2a164" + }, + "entityType": "vserver", + "entityLink": "cloud-infrastructure/cloud-regions/cloud-region/region1/AAIregion1/tenants/tenant/d52b9dea5d0f4e5d90be3590ac8c78a9/vservers/vserver/fd280243-cd5c-424e-b629-533cabe2a164", + "resourceVersion": "1476735222", + "violations": [ + { + "violationId": "af7226e6b786fb8ad20e1ef088c1b04fd0408093405ca51559f001607ab758e0", + "category": "INVALID_VALUE", + "severity": "CRITICAL", + "violationType": "Rule", + "validationRule": "prov-status", + "violationDetails": { + "prov-status": null + }, + "errorMessage": "Invalid prov-status value. Must be PREPROV, NVTPROV, PROV, CAPPED, DECOM, or RETIRED" + }, + { + "violationId": "daf1c3d071651c081f05f913e0fe2ba4750d2a1fa1699d60a7693126615c4a07", + "category": "MISSING_REL", + "severity": "MINOR", + "violationType": "Rule", + "validationRule": "vserver is related to a vnf (vce or newvce or vpe or generic-vnf)", + "violationDetails": { + "relationship-list.relationship[*].related-to": [ + "image", + "pserver", + "flavor" + ] + }, + "errorMessage": "Missing relationship - a vserver must be related to a vnf (vce or newvce or vpe or generic-vnf)" + } + ] +}
\ No newline at end of file diff --git a/src/test/resources/rule-driven-validator/rules/aai-event/common_rules.groovy b/src/test/resources/rule-driven-validator/rules/aai-event/common_rules.groovy new file mode 100644 index 0000000..70980fe --- /dev/null +++ b/src/test/resources/rule-driven-validator/rules/aai-event/common_rules.groovy @@ -0,0 +1,69 @@ +/* + * ============LICENSE_START=================================================== + * Copyright (c) 2018 Amdocs + * ============================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END===================================================== + */ + +rule { + name 'prov-status' + category 'INVALID_VALUE' + description 'prov-status value restricted to one of PREPROV, NVTPROV, PROV, CAPPED, DECOM, RETIRED' + errorText 'Invalid prov-status value. Must be PREPROV, NVTPROV, PROV, CAPPED, DECOM, or RETIRED' + severity 'CRITICAL' + attributes 'status' + validate '''switch (status) { + case "PREPROV": + case "NVTPROV": + case "PROV": + case "CAPPED": + case "DECOM": + case "RETIRED": + return true + default: return false + }''' +} + +// The following are used by both vce and newvce + +rule { + name 'vnf-name' + category 'INVALID_NAME' + description 'Invalid naming convention' + errorText 'Invalid name - attribute does not match xxxxxnnnvbc (where x = alphanumeric and n = numeric)' + severity 'MINOR' + attributes 'name' + validate 'name != null && name.matches("[a-z,0-9]{5}[0-9]{3}vbc")' +} + +rule { + name 'vnf-type' + category 'INVALID_VALUE' + description 'Invalid value' + errorText 'Invalid value - attribute must equal esx-vce' + severity 'MINOR' + attributes 'name' + validate 'name != null && name.matches("esx-vce")' +} + +rule { + name 'heat-stack-id equals first 11 bytes of vnf-name' + category 'INVALID_VALUE' + description 'The value of heat-stack-id must equal the first 11 bytes of vnf-name' + errorText 'Invalid value - the value of heat-stack-id must equal the first 11 bytes of vnf-name' + severity 'MINOR' + attributes 'heatstackid', 'vnfname' + validate '''def firstEleven = { str -> str ? str.take(11) : null } + heatstackid.equals(firstEleven(vnfname))''' +} diff --git a/src/test/resources/rule-driven-validator/rules/aai-event/entity-complex.groovy b/src/test/resources/rule-driven-validator/rules/aai-event/entity-complex.groovy new file mode 100644 index 0000000..48d2f26 --- /dev/null +++ b/src/test/resources/rule-driven-validator/rules/aai-event/entity-complex.groovy @@ -0,0 +1,146 @@ +/* + * ============LICENSE_START=================================================== + * Copyright (c) 2018 Amdocs + * ============================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END===================================================== + */ + +entity { + type 'complex' + validation { + useRule { + name 'CLLI' + attributes 'physical-location-id' + } + useRule { + name 'not AAI default' + attributes 'street1' + } + useRule { + name 'not AAI default' + attributes 'city' + } + useRule { + name 'not AAI default' + attributes 'state' + } + useRule { + name 'not AAI default' + attributes 'postal-code' + } + useRule { + name 'not AAI default' + attributes 'region' + } + useRule { + name 'not AAI default' + attributes 'country' + } + useRule { + name 'critical not AAI default' + attributes 'physical-location-type' + } + useRule { + name 'length five or null' + attributes 'complex-name' + } + useRule {name 'complex is related to availability zone' } + useRule {name 'complex is related to 1 oam-network' } + useRule { + name 'if a customer is related to an oam-network then oam-network.network-name must match naming convention' + attributes 'relationship-list.relationship[*]' + } + } +} + +rule { + name 'CLLI' + category 'FIELD_LENGTH' + description 'Field must be 8 or 11 characters long' + errorText 'Invalid length - field must be 8 or 11 characters long' + severity 'CRITICAL' + attributes 'field' + validate 'field.size() == 8 || field.size() == 11' +} + +rule { + name 'not AAI default' + category 'FIELD_LENGTH' + description 'Invalid length - field must not be AAIDEFAULT or null' + errorText 'Invalid Value - must not be AAIDEFAULT or null' + severity 'MINOR' + attributes 'field' + validate 'field != null && field.size() > 0 && !field.equalsIgnoreCase("AAIDEFAULT")' +} + +rule { + name 'length five or null' + category 'FIELD_LENGTH' + description 'Field must be 5 characters long or null' + errorText 'Invalid Length - field must be 5 characters long or null' + severity 'MINOR' + attributes 'field' + validate 'field == null || field.size() == 5' +} + +rule { + name 'critical not AAI default' + category 'INVALID_VALUE' + description 'Field must not be AAIDEFAULT or null' + errorText 'Invalid Value - must not be AAIDEFAULT or null' + severity 'CRITICAL' + attributes 'field' + validate 'field != null && field.size() > 0 && !field.equalsIgnoreCase("AAIDEFAULT")' +} + +rule { + name 'complex is related to availability zone' + category 'MISSING_REL' + description 'Validates that a complex is related to an availability zone' + errorText 'Missing relationship - a complex must be related to an availability zone' + severity 'CRITICAL' + attributes 'relationship-list.relationship[*].related-to' + validate 'related-to != null && related-to.contains("availability-zone")' +} + +rule { + name 'complex is related to 1 oam-network' + category 'MISSING_REL' + description 'Validates that a complex is related to 1 oam-network (and not more than 1 oam-network)' + errorText 'Missing relationship - complex must be related to 1 oam-network' + severity 'MAJOR' + attributes 'relationship-list.relationship[*].related-to' + validate 'related-to != null && related-to.count("oam-network") == 1' +} + +rule { + name 'if a customer is related to an oam-network then oam-network.network-name must match naming convention' + category 'INVALID_NAME' + description 'validates that if a customer is related to an oam-network then oam-network.network-name must match naming convention' + errorText 'Invalid name - if a customer is related to an oam-network then network-name must start with VLAN' + severity 'MINOR' + attributes 'relationships' + validate ''' + def getStringProperty = { jsonObject, propertyName -> jsonObject.get(propertyName).getAsString() } + + relatedToOamNetwork = relationships.findAll { getStringProperty(it, "related-to") == "oam-network" } + + networkNameIsValid = relationships.findAll { getStringProperty(it, "related-to") == "oam-network" } + .collect { it."related-to-property".get(0) } + .findAll { getStringProperty(it, "property-key") == "oam-network.network-name" } + .find { getStringProperty(it, "property-value").startsWith("VLAN") } + + return !relatedToOamNetwork || networkNameIsValid + ''' +} diff --git a/src/test/resources/rule-driven-validator/rules/aai-event/entity-newvce.groovy b/src/test/resources/rule-driven-validator/rules/aai-event/entity-newvce.groovy new file mode 100644 index 0000000..dce812a --- /dev/null +++ b/src/test/resources/rule-driven-validator/rules/aai-event/entity-newvce.groovy @@ -0,0 +1,43 @@ +/* + * ============LICENSE_START=================================================== + * Copyright (c) 2018 Amdocs + * ============================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END===================================================== + */ + +entity { + type 'newvce' + validation { + useRule { + name 'prov-status' + attributes 'prov-status' + } + useRule { + name 'vnf-name' + attributes 'vnf-name' + } + useRule { + name 'vnf-type' + attributes 'vnf-type' + } + useRule { + name 'valid_ipv4_addr' + attributes 'ipv4-oam-address' + } + useRule { + name 'heat-stack-id equals first 11 bytes of vnf-name' + attributes 'heat-stack-id', 'vnf-name' + } + } +} diff --git a/src/test/resources/rule-driven-validator/rules/aai-event/generic-vnf-rules.groovy b/src/test/resources/rule-driven-validator/rules/aai-event/generic-vnf-rules.groovy new file mode 100644 index 0000000..d890c36 --- /dev/null +++ b/src/test/resources/rule-driven-validator/rules/aai-event/generic-vnf-rules.groovy @@ -0,0 +1,56 @@ +/* + * ============LICENSE_START=================================================== + * Copyright (c) 2018 Amdocs + * ============================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END===================================================== + */ + +entity { + type 'generic-vnf' + validation { + useRule { + name 'prov-status' + attributes 'prov-status' + } + useRule { + name 'valid_ipv4_addr' + attributes 'ipv4-oam-address' + } + useRule { + name 'ipv4_addr_present' + attributes 'equipment-role', 'l-interfaces.l-interface[*].l3-interface-ipv4-address-list' + } + } +} + +rule { + name 'valid_ipv4_addr' + category 'INVALID_VALUE' + description 'Validate an IPv4 address' + errorText 'Invalid value - attribute is not a valid IPv4 address' + severity 'MINOR' + attributes 'ipaddr' + validate 'ipaddr != null && ipaddr.matches("^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])")' +} + +// If generic-vnf.equipment-role="UCPE" and there is an l-interface - then there must be an IPV4 address related to the l-interface +rule { + name 'ipv4_addr_present' + category 'MISSING_REL' + description 'Validates that ICPE equipment has a related IPv4 address' + errorText 'UCPE l-interface missing the IPv4 relationship' + severity 'MINOR' + attributes 'equipment', 'ipv4' + validate 'equipment != "UCPE" || ipv4 != null' +} diff --git a/src/test/resources/rule-driven-validator/rules/aai-event/rule-vserver-all_others.groovy b/src/test/resources/rule-driven-validator/rules/aai-event/rule-vserver-all_others.groovy new file mode 100644 index 0000000..d922df9 --- /dev/null +++ b/src/test/resources/rule-driven-validator/rules/aai-event/rule-vserver-all_others.groovy @@ -0,0 +1,118 @@ +/* + * ============LICENSE_START=================================================== + * Copyright (c) 2018 Amdocs + * ============================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END===================================================== + */ + +rule { + name 'vserver is related to a vnf (vce or newvce or vpe or generic-vnf)' + category 'MISSING_REL' + description 'Validates that a vserver is related to a vnf (vce or newvce or vpe or generic-vnf)' + errorText 'Missing relationship - a vserver must be related to a vnf (vce or newvce or vpe or generic-vnf)' + severity 'MINOR' + attributes 'related-to' + validate 'related-to != null && (related-to.contains("vce") || related-to.contains("newvce") || related-to.contains("vpe") || related-to.contains("generic-vnf"))' +} + +rule { + name 'vserver is related to 1 pserver' + category 'MISSING_REL' + description 'Validates that a vserver is related to 1 pserver (and not more than 1 pserver)' + errorText 'Missing relationship - vserver must be related to 1 pserver' + severity 'MINOR' + attributes 'relationship-list.relationship[*].related-to' + validate 'related-to == null || related-to.count("pserver") == 1' +} + +rule { + name 'vserver is related to 0 or 1 image' + category 'MISSING_REL' + description 'Validates that a vserver is either not related to an image or related to only 1 image' + errorText 'Missing relationship - vserver must be related to 0 or 1 image' + severity 'MINOR' + attributes 'relationship-list.relationship[*].related-to' + validate 'related-to == null || related-to.count("image") <= 1' +} + +rule { + name 'vserver is related to 0 or 1 flavor' + category 'MISSING_REL' + description 'Validates that a vserver is either not related to a flavor or related to only 1 flavor' + errorText 'Missing relationship - vserver must be related to 0 or 1 flavor' + severity 'MINOR' + attributes 'relationship-list.relationship[*].related-to' + validate 'related-to == null || related-to.count("flavor") <= 1' +} + +rule { + name 'vserver is related to vpe and vserver-name matches naming convention' + category 'INVALID_NAME' + description 'Validates that if a vserver is related to a vpe then vserver-name must contain me6' + errorText 'Invalid name - if vserver is related to vpe then vserver-name must contain me6' + severity 'MINOR' + attributes 'relationship-list.relationship[*].related-to', 'vserver-name' + validate '!related-to.contains("vpe") || vserver-name =~ "me6"' +} + +rule { + name 'vserver is related to vce and vserver-name matches naming convention' + category 'INVALID_NAME' + description 'Validates that if a vserver is related to a vce then vserver-name must match naming convention' + errorText 'Invalid name - if vserver is related to vce then vserver-name must match xxxxxxxxvbcnnceb (where x = alphanumeric and n = numeric)' + severity 'MINOR' + attributes 'relationship-list.relationship[*].related-to', 'vserver-name' + validate '!related-to.contains("vce") || vserver-name =~ "[a-z0-9]{8}vbc[0-9]{2}ceb"' +} + +rule { + name 'vserver is related to a TRINITY image and vserver-name matches naming convention' + category 'INVALID_NAME' + description 'Validates that if vserver is related to an image named TRINITY, then the vserver name matches naming convention' + errorText 'Invalid name - if vserver is related to an image named TRINITY, then the vserver name must match xxxxnnnnvmnnn (where x = character and n = number)' + severity 'MINOR' + attributes 'relationships', 'vservername' + validate ''' + def getStringProperty = { jsonObject, propertyName -> jsonObject.get(propertyName)?.getAsString() } + + relatedToTrinity = relationships.findAll { getStringProperty(it, "related-to") == "image" } + .findAll { it."related-to-property" != null } + .collect { it."related-to-property".get(0) } + .findAll { getStringProperty(it, "property-key") == "image.image-name" } + .find { getStringProperty(it, "property-value").startsWith("TRINITY") } + + // If (and only if) related to TRINITY then check the vserver name + return !relatedToTrinity || vservername != null && vservername ==~ "[a-z]{4}[0-9]{4}vm[0-9]{3}" + ''' +} + +rule { + name 'availability-zone must be related to a service-capability and service-capability.service-type matches naming convention' + category 'INVALID_NAME' + description 'Validates that an availability-zone is related to a service-capability and service-capability.service-type matches naming convention' + errorText 'Invalid name - availability-zone must be related to a service-capability and service-capability.service-type must be set to SDN-ETHERNET-INTERNET' + severity 'CRITICAL' + attributes 'relationships' + validate ''' + def getStringProperty = { jsonObject, propertyName -> jsonObject.get(propertyName)?.getAsString() } + + if (!relationships.find { getStringProperty(it, "related-to") == "service-capability" }) { return true } + + return relationships.findAll { getStringProperty(it, "related-to") == "service-capability" } + .findAll { it."related-to-property" != null } + .collect { it."relationship-data".get(0) } + .findAll { getStringProperty(it, "relationship-key") == "service-capability.service-type" } + .find { getStringProperty(it, "relationship-value") == "SDN-ETHERNET-INTERNET" } + ''' +} diff --git a/src/test/resources/rule-driven-validator/rules/aai-event/rule-vserver-related-generic-vnf.groovy b/src/test/resources/rule-driven-validator/rules/aai-event/rule-vserver-related-generic-vnf.groovy new file mode 100644 index 0000000..feeffa8 --- /dev/null +++ b/src/test/resources/rule-driven-validator/rules/aai-event/rule-vserver-related-generic-vnf.groovy @@ -0,0 +1,42 @@ +/* + * ============LICENSE_START=================================================== + * Copyright (c) 2018 Amdocs + * ============================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END===================================================== + */ + +rule { + name 'vserver related to TRINITY image and generic-vnf.vnf-name matches naming convention' + category 'INVALID_NAME' + description 'Validates that if vserver is related to an image named TRINITY, then the related generic-vnf name matches naming convention' + errorText 'Invalid name - if vserver is related to an image named TRINITY, then the related generic-vnf name must match xxxxnnnnv (where x = character and n = number)' + severity 'MINOR' + attributes 'relationships' + validate ''' + def getStringProperty = { jsonObject, propertyName -> jsonObject.get(propertyName).getAsString() } + + vnf_name = relationships.findAll { getStringProperty(it, "related-to") == "generic-vnf" } + .collect { it."related-to-property".get(0) } + .find { getStringProperty(it, "property-key") == "generic-vnf.vnf-name" } + .findResult { getStringProperty(it, "property-value") } + + relatedToTrinity = relationships.findAll { getStringProperty(it, "related-to") == "image" } + .collect { it."related-to-property".get(0) } + .findAll { getStringProperty(it, "property-key") == "image.image-name" } + .find { getStringProperty(it, "property-value").startsWith("TRINITY") } + + // If (and only if) related to TRINITY then check the generic-vnf name + return !relatedToTrinity || vnf_name?.matches("[a-z]{4}[0-9]{4}v") + ''' +}
\ No newline at end of file diff --git a/src/test/resources/rule-driven-validator/rules/aai-event/vserver-rules.groovy b/src/test/resources/rule-driven-validator/rules/aai-event/vserver-rules.groovy new file mode 100644 index 0000000..d379e17 --- /dev/null +++ b/src/test/resources/rule-driven-validator/rules/aai-event/vserver-rules.groovy @@ -0,0 +1,44 @@ +/* + * ============LICENSE_START=================================================== + * Copyright (c) 2018 Amdocs + * ============================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END===================================================== + */ + +entity { + type 'vserver' + validation { + useRule { + name 'prov-status' + attributes 'prov-status' + } + useRule {name 'vserver is related to 0 or 1 image' } + useRule {name 'vserver is related to 0 or 1 flavor' } + useRule {name 'vserver is related to 1 pserver' } + useRule {name 'vserver is related to vpe and vserver-name matches naming convention' } + useRule {name 'vserver is related to vce and vserver-name matches naming convention' } + useRule { + name 'vserver related to TRINITY image and generic-vnf.vnf-name matches naming convention' + attributes 'relationship-list.relationship[*]' + } + useRule { + name 'vserver is related to a TRINITY image and vserver-name matches naming convention' + attributes 'relationship-list.relationship[*]', 'vserver-name' + } + useRule { + name 'vserver is related to a vnf (vce or newvce or vpe or generic-vnf)' + attributes 'relationship-list.relationship[*].related-to' + } + } +} diff --git a/src/test/resources/rule-driven-validator/rules/gizmo-event/common_rules.groovy b/src/test/resources/rule-driven-validator/rules/gizmo-event/common_rules.groovy new file mode 100644 index 0000000..b30816e --- /dev/null +++ b/src/test/resources/rule-driven-validator/rules/gizmo-event/common_rules.groovy @@ -0,0 +1,27 @@ +/* + * ============LICENSE_START=================================================== + * Copyright (c) 2018 Amdocs + * ============================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END===================================================== + */ + +rule { + name 'valid_ipv4_addr' + category 'INVALID_VALUE' + description 'Validate an IPv4 address' + errorText 'Invalid value - attribute is not a valid IPv4 address' + severity 'MINOR' + attributes 'ipaddr' + validate 'ipaddr != null && ipaddr.matches("^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])")' +} diff --git a/src/test/resources/rule-driven-validator/rules/gizmo-event/pserver-rules.groovy b/src/test/resources/rule-driven-validator/rules/gizmo-event/pserver-rules.groovy new file mode 100644 index 0000000..79b3cc2 --- /dev/null +++ b/src/test/resources/rule-driven-validator/rules/gizmo-event/pserver-rules.groovy @@ -0,0 +1,27 @@ +/* + * ============LICENSE_START=================================================== + * Copyright (c) 2018 Amdocs + * ============================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END===================================================== + */ + +entity { + type 'pserver' + validation { + useRule { + name 'valid_ipv4_addr' + attributes 'vertex.properties.ipv4-oam-address' + } + } +} diff --git a/src/test/resources/rule-driven-validator/test-rule-driven-validator-beans.xml b/src/test/resources/rule-driven-validator/test-rule-driven-validator-beans.xml new file mode 100644 index 0000000..b087680 --- /dev/null +++ b/src/test/resources/rule-driven-validator/test-rule-driven-validator-beans.xml @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +============LICENSE_START=================================================== +Copyright (c) 2018 Amdocs +============================================================================ +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +============LICENSE_END===================================================== +--> +<beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation=" + http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd + http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> + + <import resource="../oxm-reader/oxm-reader-beans.xml" /> + + <!-- PROPERTY FILES --> + <context:property-placeholder location="classpath:event-reader.properties" ignore-unresolvable="true" /> + + <!-- CONFIG BEANS --> + <bean id="eventReaderConfig" class="org.onap.aai.validation.config.EventReaderConfig" /> + + <!-- READER BEANS --> + <bean id="jsonReader" class="org.onap.aai.validation.reader.JsonReader" /> + + <bean id="eventReader" class="org.onap.aai.validation.reader.EventReader"> + <constructor-arg ref="eventReaderConfig" /> + <constructor-arg ref="jsonReader" /> + <constructor-arg ref="oxmReader" /> + </bean> + + <bean id="rulesConfigurationPath" class="java.nio.file.Paths" factory-method="get"> + <constructor-arg value="src/test/resources/rule-driven-validator/rules/" /> + <constructor-arg><array /></constructor-arg> + </bean> + + <bean id="ruleDrivenValidator" class="org.onap.aai.validation.ruledriven.RuleDrivenValidator"> + <constructor-arg ref="rulesConfigurationPath" /> + <constructor-arg ref="oxmReader" /> + <constructor-arg ref="eventReader" /> + <constructor-arg name="ruleIndexingConfig"> + <null /> + </constructor-arg> + </bean> + +</beans> diff --git a/src/test/resources/rule-driven-validator/test_events/generic-vnf-create-event.json b/src/test/resources/rule-driven-validator/test_events/generic-vnf-create-event.json new file mode 100644 index 0000000..e1e5618 --- /dev/null +++ b/src/test/resources/rule-driven-validator/test_events/generic-vnf-create-event.json @@ -0,0 +1,46 @@ +{ + "cambria.partition": "AAI", + "entity": { + "resource-version": "1476736914", + "equipment-role": "UCPE", + "ipv4-oam-address": "", + "is-closed-loop-disabled": false, + "vnf-name": "USETEJORLFL0154UJTE08", + "vnf-type": "TE", + "nm-lan-v6-address": "2001:1890:e00e:fffe::943", + "vnf-id": "e5365951-9d90-4853-afae-c34a0707e3b6", + "in-maint": false, + "ipv4-loopback0-address": "", + "management-option": "ATT", + "orchestration-status": "created", + "service-id": "d7bb0a21-66f2-4e6d-87d9-9ef3ced63ae4", + "management-v6-address": "", + "relationship-list": { + "relationship": [{ + "relationship-data":[{ + "relationship-key": "service-instance.service-instance-id", + "relationship-value": "USETEJORLFL0154UJZZ01" + }], + "related-to-property": [{ + "property-key": "service-instance.service-instance-name" + }], + "related-link": "https://aai-app-e2e.test.onap.org:8443/aai/v8/business/customers/customer/300DLE/service-subscriptions/service-subscription/uCPE-VMS/service-instances/service-instance/USETEJORLFL0154UJZZ01/", + "related-to": "service-instance" + }] + } + }, + "event-header": { + "timestamp": "20161017-20:41:55:044", + "id": "20161017204155-be84d9c2-909c-427c-9ad5-0bdcdb498a06", + "action": "CREATE", + "domain": "e2e1", + "source-name": "SDNC", + "entity-link": "https://aai-app.test.onap.org:8443/aai/v8/network/generic-vnfs/generic-vnf/e5365951-9d90-4853-afae-c34a0707e3b6", + "entity-type": "generic-vnf", + "sequence-number": "0", + "severity": "NORMAL", + "event-type": "AAI-EVENT", + "top-entity-type": "generic-vnf", + "version": "v8" + } +} diff --git a/src/test/resources/rule-driven-validator/test_events/gizmo-pserver-create-event-invalid-ipaddress.json b/src/test/resources/rule-driven-validator/test_events/gizmo-pserver-create-event-invalid-ipaddress.json new file mode 100644 index 0000000..0be90fe --- /dev/null +++ b/src/test/resources/rule-driven-validator/test_events/gizmo-pserver-create-event-invalid-ipaddress.json @@ -0,0 +1,33 @@ +{ + "cambria.partition":"AAI", + "entity":{ + "timestamp":1514927928167, + "operation":"CREATE", + "vertex":{ + "properties":{ + "ipv4-oam-address":"1.2.3.", + "resource-version":"1477013499", + "purpose":"my-purpose", + "fqdn":"myhost.onap.net", + "in-maint":false, + "equip-model":"DL380p-nd", + "equip-vendor":"HP", + "equip-type":"server", + "hostname":"myhost", + "ptnii-equip-name":"e-name" + }, + "key":"", + "type":"pserver", + "schema-version":"vX" + }, + "transaction-id":"c0a81fa7-5ef4-49cd-ab39-e42c53c9b9a4", + "database-transaction-id":"b3e2853e-f643-47a3-a0c3-cb54cc997ad3" + }, + "event-header":{ + "timestamp":"1514927928167", + "id":"c0a81fa7-5ef4-49cd-ab39-e42c53c9b9a4", + "source-name":"GIZMO", + "entity-type":"pserver", + "event-type":"GIZMO-EVENT" + } +}
\ No newline at end of file diff --git a/src/test/resources/rule-driven-validator/test_events/gizmo-pserver-create-event.json b/src/test/resources/rule-driven-validator/test_events/gizmo-pserver-create-event.json new file mode 100644 index 0000000..2ba5550 --- /dev/null +++ b/src/test/resources/rule-driven-validator/test_events/gizmo-pserver-create-event.json @@ -0,0 +1,33 @@ +{ + "cambria.partition":"AAI", + "entity":{ + "timestamp":1514927928167, + "operation":"CREATE", + "vertex":{ + "properties":{ + "ipv4-oam-address":"1.2.3.4", + "resource-version":"1477013499", + "purpose":"my-purpose", + "fqdn":"myhost.onap.net", + "in-maint":false, + "equip-model":"DL380p-nd", + "equip-vendor":"HP", + "equip-type":"server", + "hostname":"myhost", + "ptnii-equip-name":"e-name" + }, + "key":"", + "type":"pserver", + "schema-version":"vX" + }, + "transaction-id":"c0a81fa7-5ef4-49cd-ab39-e42c53c9b9a4", + "database-transaction-id":"b3e2853e-f643-47a3-a0c3-cb54cc997ad3" + }, + "event-header":{ + "timestamp":"1514927928167", + "id":"c0a81fa7-5ef4-49cd-ab39-e42c53c9b9a4", + "source-name":"GIZMO", + "entity-type":"pserver", + "event-type":"GIZMO-EVENT" + } +}
\ No newline at end of file diff --git a/src/test/resources/rule-driven-validator/test_events/vserver-create-AAI-EVENT-devINT1-TRINITY-VNF-NAME-BAD.json b/src/test/resources/rule-driven-validator/test_events/vserver-create-AAI-EVENT-devINT1-TRINITY-VNF-NAME-BAD.json new file mode 100644 index 0000000..b5c0a31 --- /dev/null +++ b/src/test/resources/rule-driven-validator/test_events/vserver-create-AAI-EVENT-devINT1-TRINITY-VNF-NAME-BAD.json @@ -0,0 +1,144 @@ +{ + "cambria.partition": "AAI", + "event-header": { + "id": "20160525162737-61c49d41-5338-4755-af54-06cee9fe4acf", + "timestamp": "20160525-16:27:37:353", + "source-name": "RO", + "domain": "devINT1", + "sequence-number": "0", + "severity": "NORMAL", + "event-type": "AAI-EVENT", + "version": "v7", + "action": "CREATE", + "entity-type": "vserver", + "top-entity-type": "cloud-region", + "entity-link": "https://dummy-host.onap.org:8443/aai/v7/cloud-infrastructure/cloud-regions/cloud-region/region1/AAIregion1/tenants/tenant/example-tenant-id-val-88551/vservers/vserver/example-vserver-id-val-34666" + }, + "entity": { + "cloud-owner": "region1", + "cloud-region-id": "AAIregion1", + "tenants": { + "tenant": [{ + "tenant-id": "example-tenant-id-val-88551", + "tenant-name": "example-tenant-name-val-88551", + "vservers": { + "vserver": [{ + "vserver-id": "c385bb3e-6ebd-4898-bc92-792e0ac2db50", + "vserver-name": "bems0001vm001", + "vserver-name2": "bems0001vm001bem001-1452", + "prov-status": "ACTIVE", + "vserver-selflink": "TRINITY vserverLink", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1475160142", + "relationship-list": { + "relationship": [{ + "related-to": "generic-vnf", + "related-link": "https://dummy-host.onap.org:8443/aai/v8/network/generic-vnfs/generic-vnf/ctpx12345v/", + "relationship-data": [{ + "relationship-key": "generic-vnf.vnf-id", + "relationship-value": "ctpx12345v" + }], + "related-to-property": [{ + "property-key": "generic-vnf.vnf-name", + "property-value": "ctpx12345v" + }] + }, + { + "related-to": "vf-module", + "related-link": "https://dummy-host.onap.org:8443/aai/v8/network/generic-vnfs/generic-vnf/ctpx12345v/vf-modules/vf-module/ctpx12345v/", + "relationship-data": [{ + "relationship-key": "generic-vnf.vnf-id", + "relationship-value": "ctpx12345v" + }, + { + "relationship-key": "vf-module.vf-module-id", + "relationship-value": "ctpx12345v" + }] + }, + { + "related-to": "image", + "related-link": "https://dummy-host.onap.org:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/region1/AAIregion1/images/image/TRINITY-IMAGE/", + "relationship-data": [{ + "relationship-key": "cloud-region.cloud-owner", + "relationship-value": "region1" + }, + { + "relationship-key": "cloud-region.cloud-region-id", + "relationship-value": "AAIregion1" + }, + { + "relationship-key": "image.image-id", + "relationship-value": "TRINITY-IMAGE" + }], + "related-to-property": [{ + "property-key": "image.image-name", + "property-value": "TRINITY IMAGE" + }] + }, + { + "related-to": "pserver", + "related-link": "https://dummy-host.onap.org:8443/aai/v8/cloud-infrastructure/pservers/pserver/TRINITY-PSERVER/", + "relationship-data": [{ + "relationship-key": "pserver.hostname", + "relationship-value": "TRINITY-PSERVER" + }], + "related-to-property": [{ + "property-key": "pserver.pserver-name2" + }] + }, + { + "related-to": "flavor", + "related-link": "https://dummy-host.onap.org:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/region1/AAIregion1/flavors/flavor/TRINITY-Flavor/", + "relationship-data": [{ + "relationship-key": "cloud-region.cloud-owner", + "relationship-value": "region1" + }, + { + "relationship-key": "cloud-region.cloud-region-id", + "relationship-value": "AAIregion1" + }, + { + "relationship-key": "flavor.flavor-id", + "relationship-value": "TRINITY-Flavor" + }], + "related-to-property": [{ + "property-key": "flavor.flavor-name", + "property-value": "TRINITY Flavor" + }] + }] + }, + "l-interfaces": { + "l-interface": [{ + "interface-name": "BSFT-EMS-VMVNIC1", + "resource-version": "1455590484", + "l3-interface-ipv4-address-list": [{ + "l3-interface-ipv4-address": "130.3.148.14", + "l3-interface-ipv4-prefix-length": 32, + "resource-version": "1455590484", + "relationship-list": { + "relationship": [{ + "related-to": "subnet", + "related-link": "https://dummy-host.onap.org:8443/aai/v8/network/l3-networks/l3-network/AIC_SBG_NSDNet_Trinity_OAMP_3900-1234-1/subnets/subnet/AIC_SBG_NSDNet_Trinity_OAMP_3900-1234-1-ipv4/", + "relationship-data": [{ + "relationship-key": "l3-network.network-id", + "relationship-value": "AIC_SBG_NSDNet_Trinity_OAMP_3900-1234-1" + }, + { + "relationship-key": "subnet.subnet-id", + "relationship-value": "AIC_SBG_NSDNet_Trinity_OAMP_3900-1234-1-ipv4" + }], + "related-to-property": [{ + "property-key": "subnet.subnet-name" + }] + }] + } + }] + }] + } + }] + } + }] + } + } +} diff --git a/src/test/resources/rule-driven-validator/test_events/vserver-create-AAI-EVENT-devINT1-TRINITY-VNF-NAME-GOOD.json b/src/test/resources/rule-driven-validator/test_events/vserver-create-AAI-EVENT-devINT1-TRINITY-VNF-NAME-GOOD.json new file mode 100644 index 0000000..962210a --- /dev/null +++ b/src/test/resources/rule-driven-validator/test_events/vserver-create-AAI-EVENT-devINT1-TRINITY-VNF-NAME-GOOD.json @@ -0,0 +1,144 @@ +{ + "cambria.partition": "AAI", + "event-header": { + "id": "20160525162737-61c49d41-5338-4755-af54-06cee9fe4acf", + "timestamp": "20160525-16:27:37:353", + "source-name": "RO", + "domain": "devINT1", + "sequence-number": "0", + "severity": "NORMAL", + "event-type": "AAI-EVENT", + "version": "v7", + "action": "CREATE", + "entity-type": "vserver", + "top-entity-type": "cloud-region", + "entity-link": "https://dummy-host.test.onap.org:8443/aai/v7/cloud-infrastructure/cloud-regions/cloud-region/region1/AAIregion1/tenants/tenant/example-tenant-id-val-88551/vservers/vserver/example-vserver-id-val-34666" + }, + "entity": { + "cloud-owner": "region1", + "cloud-region-id": "AAIregion1", + "tenants": { + "tenant": [{ + "tenant-id": "example-tenant-id-val-88551", + "tenant-name": "example-tenant-name-val-88551", + "vservers": { + "vserver": [{ + "vserver-id": "c385bb3e-6ebd-4898-bc92-792e0ac2db50", + "vserver-name": "bems0001vm001", + "vserver-name2": "bems0001vm001bem001-1452", + "prov-status": "ACTIVE", + "vserver-selflink": "TRINITY vserverLink", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1475160142", + "relationship-list": { + "relationship": [{ + "related-to": "generic-vnf", + "related-link": "https://dummy-host.onap.org:8443/aai/v8/network/generic-vnfs/generic-vnf/ctpx0001v/", + "relationship-data": [{ + "relationship-key": "generic-vnf.vnf-id", + "relationship-value": "ctpx0001v" + }], + "related-to-property": [{ + "property-key": "generic-vnf.vnf-name", + "property-value": "ctpx0001v" + }] + }, + { + "related-to": "vf-module", + "related-link": "https://dummy-host.onap.org:8443/aai/v8/network/generic-vnfs/generic-vnf/ctpx0001v/vf-modules/vf-module/ctpx0001v/", + "relationship-data": [{ + "relationship-key": "generic-vnf.vnf-id", + "relationship-value": "ctpx0001v" + }, + { + "relationship-key": "vf-module.vf-module-id", + "relationship-value": "ctpx0001v" + }] + }, + { + "related-to": "image", + "related-link": "https://dummy-host.onap.org:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/region1/AAIregion1/images/image/TRINITY-IMAGE/", + "relationship-data": [{ + "relationship-key": "cloud-region.cloud-owner", + "relationship-value": "region1" + }, + { + "relationship-key": "cloud-region.cloud-region-id", + "relationship-value": "AAIregion1" + }, + { + "relationship-key": "image.image-id", + "relationship-value": "TRINITY-IMAGE" + }], + "related-to-property": [{ + "property-key": "image.image-name", + "property-value": "TRINITY IMAGE" + }] + }, + { + "related-to": "pserver", + "related-link": "https://dummy-host.onap.org:8443/aai/v8/cloud-infrastructure/pservers/pserver/TRINITY-PSERVER/", + "relationship-data": [{ + "relationship-key": "pserver.hostname", + "relationship-value": "TRINITY-PSERVER" + }], + "related-to-property": [{ + "property-key": "pserver.pserver-name2" + }] + }, + { + "related-to": "flavor", + "related-link": "https://dummy-host.onap.org:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/region1/AAIregion1/flavors/flavor/TRINITY-Flavor/", + "relationship-data": [{ + "relationship-key": "cloud-region.cloud-owner", + "relationship-value": "region1" + }, + { + "relationship-key": "cloud-region.cloud-region-id", + "relationship-value": "AAIregion1" + }, + { + "relationship-key": "flavor.flavor-id", + "relationship-value": "TRINITY-Flavor" + }], + "related-to-property": [{ + "property-key": "flavor.flavor-name", + "property-value": "TRINITY Flavor" + }] + }] + }, + "l-interfaces": { + "l-interface": [{ + "interface-name": "BSFT-EMS-VMVNIC1", + "resource-version": "1455590484", + "l3-interface-ipv4-address-list": [{ + "l3-interface-ipv4-address": "130.3.148.14", + "l3-interface-ipv4-prefix-length": 32, + "resource-version": "1455590484", + "relationship-list": { + "relationship": [{ + "related-to": "subnet", + "related-link": "https://dummy-host.onap.org:8443/aai/v8/network/l3-networks/l3-network/VendorCloud_Trinity_OAMP_3900-1234-1/subnets/subnet/VendorCloud_Trinity_OAMP_3900-1234-1-ipv4/", + "relationship-data": [{ + "relationship-key": "l3-network.network-id", + "relationship-value": "VendorCloud_Trinity_OAMP_3900-1234-1" + }, + { + "relationship-key": "subnet.subnet-id", + "relationship-value": "VendorCloud_Trinity_OAMP_3900-1234-1-ipv4" + }], + "related-to-property": [{ + "property-key": "subnet.subnet-name" + }] + }] + } + }] + }] + } + }] + } + }] + } + } +} diff --git a/src/test/resources/rule-driven-validator/test_events/vserver-create-event.json b/src/test/resources/rule-driven-validator/test_events/vserver-create-event.json new file mode 100644 index 0000000..85bcdf3 --- /dev/null +++ b/src/test/resources/rule-driven-validator/test_events/vserver-create-event.json @@ -0,0 +1,243 @@ +{ + "cambria.partition": "AAI", + "event-header": { + "id": "20160525162737-61c49d41-5338-4755-af54-06cee9fe4acf", + "timestamp": "20160525-16:27:37:353", + "source-name": "RO", + "domain": "devINT1", + "sequence-number": "0", + "severity": "NORMAL", + "event-type": "AAI-EVENT", + "version": "v7", + "action": "CREATE", + "entity-type": "vserver", + "top-entity-type": "cloud-region", + "entity-link": "https://dummy-host.test.onap.org:8443/aai/v7/cloud-infrastructure/cloud-regions/cloud-region/region1/AAIregion1/tenants/tenant/example-tenant-id-val-88551/vservers/vserver/example-vserver-id-val-34666" + }, + "entity": { + "cloud-owner": "region1", + "cloud-region-id": "AAIregion1", + "tenants": { + "tenant": [ + { + "tenant-id": "example-tenant-id-val-88551", + "tenant-name": "example-tenant-name-val-88551", + "vservers": { + "vserver": [ + { + "vserver-id": "example-vserver-id-val-34666", + "vserver-name": "example-vserver-name-val-34666", + "vserver-name2": "example-vserver-name2-val-34666", + "prov-status": "INVALID", + "vserver-selflink": "example-vserver-selflink-val-34666", + "in-maint": true, + "is-closed-loop-disabled": true, + "resource-version": "1464193654", + "volumes": { + "volume": [ + { + "volume-id": "example-volume-id-val-79195", + "volume-selflink": "example-volume-selflink-val-79195", + "resource-version": "1464193654", + "relationship-list": { + + } + } + ] + }, + "relationship-list": { + "relationship": [ + { + "related-to": "generic-vnf", + "related-link": "https://dummy-host.onap.org:8443/aai/v8/network/generic-vnfs/generic-vnf/bmsx0001v-1661/", + "relationship-data": [ + { + "relationship-key": "generic-vnf.vnf-id", + "relationship-value": "bmsx0001v-1661" + } + ], + "related-to-property": [ + { + "property-key": "generic-vnf.vnf-name", + "property-value": "bmsx000x" + } + ] + }, + { + "related-to": "image", + "related-link": "https://dummy-host.onap.org:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/region1/AAIregion1/images/image/ee49d429-283d-4f79-9c58-e11cc38d8856/", + "relationship-data": [ + { + "relationship-key": "cloud-region.cloud-owner", + "relationship-value": "region1" + }, + { + "relationship-key": "cloud-region.cloud-region-id", + "relationship-value": "AAIregion1" + }, + { + "relationship-key": "image.image-id", + "relationship-value": "ee49d429-283d-4f79-9c58-e11cc38d8856" + } + ], + "related-to-property": [ + { + "property-key": "image.image-name", + "property-value": "TRINITY" + } + ] + }, + { + "related-to": "pserver", + "related-link": "https://dummy-host.onap.org:8443/aai/v8/cloud-infrastructure/pservers/pserver/dpa2r03c007/", + "relationship-data": [ + { + "relationship-key": "pserver.hostname", + "relationship-value": "dpa2r03c007" + } + ], + "related-to-property": [ + { + "property-key": "pserver.pserver-name2" + } + ] + }, + { + "related-to": "flavor", + "related-link": "https://dummy-host.onap.org:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/region1/AAIregion1/flavors/flavor/5288f576-d9c6-46fc-9dcb-f6946a2b3597/", + "relationship-data": [ + { + "relationship-key": "cloud-region.cloud-owner", + "relationship-value": "region1" + }, + { + "relationship-key": "cloud-region.cloud-region-id", + "relationship-value": "AAIregion1" + }, + { + "relationship-key": "flavor.flavor-id", + "relationship-value": "5288f576-d9c6-46fc-9dcb-f6946a2b3597" + } + ], + "related-to-property": [ + { + "property-key": "flavor.flavor-name", + "property-value": "l5.xLarge" + } + ] + } + ] + }, + "l-interfaces": { + "l-interface": [ + { + "interface-name": "example-interface-name-val-25679", + "interface-role": "example-interface-role-val-25679", + "v6-wan-link-ip": "example-v6-wan-link-ip-val-25679", + "selflink": "example-selflink-val-25679", + "interface-id": "example-interface-id-val-25679", + "macaddr": "example-macaddr-val-25679", + "network-name": "example-network-name-val-25679", + "resource-version": "1464193654", + "vlans": { + "vlan": [ + { + "vlan-interface": "example-vlan-interface-val-28675", + "vlan-id-inner": 22278797, + "vlan-id-outer": 22278797, + "resource-version": "1464193654", + "speed-value": "example-speed-value-val-28675", + "speed-units": "example-speed-units-val-28675", + "vlan-description": "example-vlan-description-val-28675", + "relationship-list": { + + }, + "l3-interface-ipv4-address-list": [ + { + "l3-interface-ipv4-address": "example-l3-interface-ipv4-address-val-39271", + "l3-interface-ipv4-prefix-length": 78868308, + "vlan-id-inner": 78868308, + "vlan-id-outer": 78868308, + "is-floating": true, + "resource-version": "1464193654", + "relationship-list": { + + } + } + ], + "l3-interface-ipv6-address-list": [ + { + "l3-interface-ipv6-address": "example-l3-interface-ipv6-address-val-4005", + "l3-interface-ipv6-prefix-length": 78340763, + "vlan-id-inner": 78340763, + "vlan-id-outer": 78340763, + "is-floating": true, + "resource-version": "1464193654", + "relationship-list": { + + } + } + ] + } + ] + }, + "sriov-vfs": { + "sriov-vf": [ + { + "pci-id": "example-pci-id-val-85354", + "vf-vlan-filter": "example-vf-vlan-filter-val-85354", + "vf-mac-filter": "example-vf-mac-filter-val-85354", + "vf-vlan-strip": true, + "vf-vlan-anti-spoof-check": true, + "vf-mac-anti-spoof-check": true, + "vf-mirrors": "example-vf-mirrors-val-85354", + "vf-broadcast-allow": true, + "vf-unknown-multicast-allow": true, + "vf-unknown-unicast-allow": true, + "resource-version": "1464193654", + "relationship-list": { + + } + } + ] + }, + "relationship-list": { + + }, + "l3-interface-ipv4-address-list": [ + { + "l3-interface-ipv4-address": "example-l3-interface-ipv4-address-val-21446", + "l3-interface-ipv4-prefix-length": 71127022, + "vlan-id-inner": 71127022, + "vlan-id-outer": 71127022, + "is-floating": true, + "resource-version": "1464193654", + "relationship-list": { + + } + } + ], + "l3-interface-ipv6-address-list": [ + { + "l3-interface-ipv6-address": "example-l3-interface-ipv6-address-val-88071", + "l3-interface-ipv6-prefix-length": 55080281, + "vlan-id-inner": 55080281, + "vlan-id-outer": 55080281, + "is-floating": true, + "resource-version": "1464193654", + "relationship-list": { + + } + } + ] + } + ] + } + } + ] + } + } + ] + } + } +}
\ No newline at end of file diff --git a/src/test/resources/rule-driven-validator/test_events/vserver-update-AAI-EVENT-devINT1.json b/src/test/resources/rule-driven-validator/test_events/vserver-update-AAI-EVENT-devINT1.json new file mode 100644 index 0000000..92bec16 --- /dev/null +++ b/src/test/resources/rule-driven-validator/test_events/vserver-update-AAI-EVENT-devINT1.json @@ -0,0 +1,108 @@ +{ + "cambria.partition": "AAI", + "entity": { + "cloud-region-id": "AAIregion1", + "cloud-owner": "region1", + "tenants": { + "tenant": [{ + "vservers": { + "vserver": [{ + "resource-version": "1476735222", + "is-closed-loop-disabled": false, + "vserver-selflink": "http://compute.test.onap.org:8774/v2/d52b9dea5d0f4e5d90be3590ac8c78a9/servers/fd280243-cd5c-424e-b629-533cabe2a164", + "vserver-name": "vm-54", + "vserver-id": "fd280243-cd5c-424e-b629-533cabe2a164", + "in-maint": false, + "vserver-name2": "VM_54", + "l-interfaces": { + "l-interface": [{ + "resource-version": "1452288058", + "macaddr": "02:fd:59:37:be:3c", + "selflink": "http://network.test.onap.org:9696/v2.0/ports/fd5937be-3ca4-4db0-89c9-e210bf8bf31f", + "interface-id": "fd5937be-3ca4-4db0-89c9-e210bf8bf31f", + "l3-interface-ipv4-address-list": [{ + "resource-version": "1452288058", + "l3-interface-ipv4-address": "192.168.112.56", + "neutron-network-id": "a2e5433f-38c7-420e-9c06-134ee893de3f", + "neutron-subnet-id": "b58a5b21-1f3b-42b8-93a6-109b2a700fdb", + "is-floating": false, + "l3-interface-ipv4-prefix-length": 24 + }], + "interface-name": "fd5937be-3ca4-4db0-89c9-e210bf8bf31f", + "network-name": "CinderVolumeNetwork" + }] + }, + "relationship-list": { + "relationship": [{ + "relationship-data": [{ + "relationship-key": "cloud-region.cloud-owner", + "relationship-value": "region1" + }, + { + "relationship-key": "cloud-region.cloud-region-id", + "relationship-value": "AAIregion1" + }, + { + "relationship-key": "image.image-id", + "relationship-value": "fc2b5df5-0e28-4c05-9e8c-75cebbd537e5" + }], + "related-to-property": [{ + "property-value": "TestVM", + "property-key": "image.image-name" + }], + "related-link": "https://aai-app-e2e.test.onap.org:8443/aai/v7/cloud-infrastructure/cloud-regions/cloud-region/region1/AAIregion1/images/image/fc2b5df5-0e28-4c05-9e8c-75cebbd537e5/", + "related-to": "image" + }, + { + "relationship-data": [{ + "relationship-key": "pserver.hostname", + "relationship-value": "dummy-host.test.onap.org" + }], + "related-to-property": [{ + "property-key": "pserver.pserver-name2" + }], + "related-link": "https://aai-app-e2e.test.onap.org:8443/aai/v7/cloud-infrastructure/pservers/pserver/dummy-host.test.onap.org/", + "related-to": "pserver" + }, + { + "relationship-data": [{ + "relationship-key": "cloud-region.cloud-owner", + "relationship-value": "region1" + }, + { + "relationship-key": "cloud-region.cloud-region-id", + "relationship-value": "AAIregion1" + }, + { + "relationship-key": "flavor.flavor-id", + "relationship-value": "31" + }], + "related-to-property": [{ + "property-value": "m1.small", + "property-key": "flavor.flavor-name" + }], + "related-link": "https://aai-app-e2e.test.onap.org:8443/aai/v7/cloud-infrastructure/cloud-regions/cloud-region/region1/AAIregion1/flavors/flavor/31/", + "related-to": "flavor" + }] + } + }] + }, + "tenant-id": "d52b9dea5d0f4e5d90be3590ac8c78a9" + }] + } + }, + "event-header": { + "timestamp": "20161017-20:13:45:472", + "id": "20161017201345-af157723-3835-4619-b6d8-dc16c19308bb", + "action": "UPDATE", + "domain": "devINT1", + "source-name": "RO", + "entity-link": "https://aai-app.test.onap.org:8443/aai/v8/cloud-infrastructure/cloud-regions/cloud-region/region1/AAIregion1/tenants/tenant/d52b9dea5d0f4e5d90be3590ac8c78a9/vservers/vserver/fd280243-cd5c-424e-b629-533cabe2a164", + "entity-type": "vserver", + "sequence-number": "0", + "severity": "NORMAL", + "event-type": "AAI-EVENT", + "top-entity-type": "cloud-region", + "version": "v8" + } +} |