diff options
author | Ittay Stern <ittay.stern@att.com> | 2019-09-12 14:11:27 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-09-12 14:11:27 +0000 |
commit | ecd0453d3ca7c54d32af7b033f8098e25ca4392b (patch) | |
tree | 0ca21081953862dc813fe57b2452c028d080dcb6 /vid-automation/src | |
parent | 76a44c4f838747b01ef819d2d673b5f680780f3f (diff) | |
parent | c4814252e8ef58dde843824d1c4d57ea708a961e (diff) |
Merge "Reduce vnf data response from A&AI in change management flows"
Diffstat (limited to 'vid-automation/src')
5 files changed, 1052 insertions, 25 deletions
diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetBaseAAICustomQuery.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetBaseAAICustomQuery.java new file mode 100644 index 000000000..a979bae53 --- /dev/null +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/PresetBaseAAICustomQuery.java @@ -0,0 +1,54 @@ +package org.onap.simulator.presetGenerator.presets.aai; + +import com.google.common.collect.ImmutableMap; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset; +import org.springframework.http.HttpMethod; + +public abstract class PresetBaseAAICustomQuery extends BaseAAIPreset { + + private final String requestBodyStart; + private final String requestBodyQuery; + private final FORMAT format; + + public enum FORMAT { + RESOURCE, SIMPLE; + + public String value() { + return this.name().toLowerCase(); + } + } + public PresetBaseAAICustomQuery(FORMAT format, String requestBodyStart, String requestBodyQuery) { + this.format = format; + this.requestBodyStart = requestBodyStart; + this.requestBodyQuery = requestBodyQuery; + } + + @Override + public HttpMethod getReqMethod() { + return HttpMethod.PUT; + } + + @Override + public String getReqPath() { + return getRootPath() + "/query"; + } + + @Override + public Map<String, List> getQueryParams() { + return ImmutableMap.of( + "format", Collections.singletonList(format.value()) + ); + } + + @Override + public Object getRequestBody() { + return ImmutableMap.of( + "start", new String[] {requestBodyStart}, + "query", requestBodyQuery + ); + } + +} diff --git a/vid-automation/src/main/resources/registration_to_simulator/changeManagement/get_vnf_data_by_globalid_and_service_type_reduced_response.json b/vid-automation/src/main/resources/registration_to_simulator/changeManagement/get_vnf_data_by_globalid_and_service_type_reduced_response.json new file mode 100644 index 000000000..d9a120a49 --- /dev/null +++ b/vid-automation/src/main/resources/registration_to_simulator/changeManagement/get_vnf_data_by_globalid_and_service_type_reduced_response.json @@ -0,0 +1,295 @@ +{ + "results": [ + { + "service-instance": { + "service-instance-id": "serviceInstanceID1-369-as988q", + "service-instance-name": "EUd8Test", + "service-type": "xBoJHJbWTest", + "service-role": "sc7OWTest", + "environment-context": "O7OVp5Test", + "workload-context": "VmnxNeJIgWq7HTest", + "model-invariant-id": "modelInvariantValue2-369 -as988q", + "model-version-id": "modelVersionKey2-369-as988q", + "widget-model-id": "HT7KA2FoRKH3cTest", + "widget-model-version": "CsGp5Test", + "bandwidth-total": "1Yijkk1Test", + "vhn-portal-url": "40PzTest", + "service-instance-location-id": "zcAaHJTAt5Hj8Test", + "resource-version": "1563820653329", + "selflink": "mZP2EVvwwHnlTest", + "orchestration-status": "6QvhzNgLudLBTest", + "relationship-list": { + "relationship": [ + { + "related-to": "generic-vnf", + "relationship-label": "org.onap.relationships.inventory.ComposedOf", + "related-link": "/aai/v17/network/generic-vnfs/generic-vnf/test-gvnf2-369-as988q", + "relationship-data": [ + { + "relationship-key": "generic-vnf.vnf-id", + "relationship-value": "test-gvnf2-369-as988q" + } + ], + "related-to-property": [ + { + "property-key": "generic-vnf.vnf-name", + "property-value": "test-name2-gvnf-369" + } + ] + }, + { + "related-to": "generic-vnf", + "relationship-label": "org.onap.relationships.inventory.ComposedOf", + "related-link": "/aai/v17/network/generic-vnfs/generic-vnf/test-gvnf1-369-as988q", + "relationship-data": [ + { + "relationship-key": "generic-vnf.vnf-id", + "relationship-value": "test-gvnf1-369-as988q" + } + ], + "related-to-property": [ + { + "property-key": "generic-vnf.vnf-name", + "property-value": "test-name-gvnf-369" + } + ] + } + ] + } + } + }, + { + "model-ver": { + "model-version-id": "modelVersionKey2-369-as988q", + "model-name": "vnfc8", + "model-version": "1.1", + "resource-version": "1563820653007" + } + }, + { + "model": { + "model-invariant-id": "modelInvariantValue2-369-as988q", + "model-type": "widget3", + "resource-version": "1563820652703", + "model-vers": { + "model-ver": [ + { + "model-version-id": "modelVersionKey2-369-as988q", + "model-name": "vnfc8", + "model-version": "1.1", + "resource-version": "1563820653007" + } + ] + } + } + }, + { + "generic-vnf": { + "vnf-id": "test-gvnf2-369-as988q", + "vnf-name": "test-name2-gvnf-369", + "vnf-type": "SW", + "service-id": "d7bb0a21-66f2-4e6d-87d9-9ef3ced63ae4", + "equipment-role": "UCPE", + "orchestration-status": "created", + "ipv4-oam-address": "12.80.1.18", + "nm-lan-v6-address": "2001:1890:e00e:fffe::33c4", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1563820654611", + "model-invariant-id": "modelInvariantValue-369-as988q", + "model-version-id": "modelVersionKey-369-as988q", + "nf-role": "test360", + "relationship-list": { + "relationship": [ + { + "related-to": "service-instance", + "relationship-label": "org.onap.relationships.inventory.ComposedOf", + "related-link": "/aai/v17/business/customers/customer/globalCustomerId1-369-as988q/service-subscriptions/service-subscription/TEST1-369/service-instances/service-instance/serviceInstanceID1-369-as988q", + "relationship-data": [ + { + "relationship-key": "customer.global-customer-id", + "relationship-value": "globalCustomerId1-369-as988q" + }, + { + "relationship-key": "service-subscription.service-type", + "relationship-value": "TEST1-369" + }, + { + "relationship-key": "service-instance.service-instance-id", + "relationship-value": "serviceInstanceID1-369-as988q" + } + ], + "related-to-property": [ + { + "property-key": "service-instance.service-instance-name", + "property-value": "EUd8Test" + } + ] + } + ] + } + } + }, + { + "model-ver": { + "model-version-id": "modelVersionKey-369-as988q", + "model-name": "vnfc8", + "model-version": "1.1", + "resource-version": "1563820652380" + } + }, + { + "model": { + "model-invariant-id": "modelInvariantValue-369-as988q", + "model-type": "service", + "resource-version": "1563820652072", + "model-vers": { + "model-ver": [ + { + "model-version-id": "modelVersionKey-369-as988q", + "model-name": "vnfc8", + "model-version": "1.1", + "resource-version": "1563820652380" + } + ] + } + } + }, + { + "generic-vnf": { + "vnf-id": "test-gvnf1-369-as988q", + "vnf-name": "test-name-gvnf-369", + "vnf-type": "SW", + "service-id": "d7bb0a21-66f2-4e6d-87d9-9ef3ced63ae4", + "equipment-role": "UCPE", + "orchestration-status": "created", + "ipv4-oam-address": "12.80.1.18", + "nm-lan-v6-address": "2001:1890:e00e:fffe::33c4", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1563820654296", + "model-invariant-id": "modelInvariantValue-369-as988q", + "model-version-id": "modelVersionKey-369-as988q", + "nf-role": "test360", + "relationship-list": { + "relationship": [ + { + "related-to": "service-instance", + "relationship-label": "org.onap.relationships.inventory.ComposedOf", + "related-link": "/aai/v17/business/customers/customer/globalCustomerId1-369-as988q/service-subscriptions/service-subscription/TEST1-369/service-instances/service-instance/serviceInstanceID1-369-as988q", + "relationship-data": [ + { + "relationship-key": "customer.global-customer-id", + "relationship-value": "globalCustomerId1-369-as988q" + }, + { + "relationship-key": "service-subscription.service-type", + "relationship-value": "TEST1-369" + }, + { + "relationship-key": "service-instance.service-instance-id", + "relationship-value": "serviceInstanceID1-369-as988q" + } + ], + "related-to-property": [ + { + "property-key": "service-instance.service-instance-name", + "property-value": "EUd8Test" + } + ] + }, + { + "related-to": "vserver", + "relationship-label": "tosca.relationships.HostedOn", + "related-link": "/aai/v17/cloud-infrastructure/cloud-regions/cloud-region/cloudOwnerKeyValue1-369-as988q/cloudRegionIdKeyValue1-369-as988q/tenants/tenant/tenantID1-369-as988q/vservers/vserver/vserver1-369-test-as988q", + "relationship-data": [ + { + "relationship-key": "cloud-region.cloud-owner", + "relationship-value": "cloudOwnerKeyValue1-369-as988q" + }, + { + "relationship-key": "cloud-region.cloud-region-id", + "relationship-value": "cloudRegionIdKeyValue1-369-as988q" + }, + { + "relationship-key": "tenant.tenant-id", + "relationship-value": "tenantID1-369-as988q" + }, + { + "relationship-key": "vserver.vserver-id", + "relationship-value": "vserver1-369-test-as988q" + } + ], + "related-to-property": [ + { + "property-key": "vserver.vserver-name", + "property-value": "vserver-name11-369-as988q" + } + ] + } + ] + } + } + }, + { + "tenant": { + "tenant-id": "tenantID1-369-as988q", + "tenant-name": "tenant-name1-369-as988q", + "resource-version": "1563820651384", + "vservers": { + "vserver": [ + { + "vserver-id": "vserver1-369-test-as988q", + "vserver-name": "vserver-name11-369-as988q", + "vserver-name2": "vserver-name22-360-as988q", + "prov-status": "ACTIVE", + "vserver-selflink": "TRINITY vserverLink", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1563820654917", + "relationship-list": { + "relationship": [ + { + "related-to": "generic-vnf", + "relationship-label": "tosca.relationships.HostedOn", + "related-link": "/aai/v17/network/generic-vnfs/generic-vnf/test-gvnf1-369-as988q", + "relationship-data": [ + { + "relationship-key": "generic-vnf.vnf-id", + "relationship-value": "test-gvnf1-369-as988q" + } + ], + "related-to-property": [ + { + "property-key": "generic-vnf.vnf-name", + "property-value": "test-name-gvnf-369" + } + ] + } + ] + } + } + ] + } + } + }, + { + "cloud-region": { + "cloud-owner": "cloudOwnerKeyValue1-369-as988q", + "cloud-region-id": "cloudRegionIdKeyValue1-369-as988q", + "resource-version": "1563820651058", + "orchestration-disabled": false, + "in-maint": false, + "tenants": { + "tenant": [ + { + "tenant-id": "tenantID1-369-as988q", + "tenant-name": "tenant-name1-369-as988q", + "resource-version": "1563820651384" + } + ] + } + } + } + ] +}
\ No newline at end of file diff --git a/vid-automation/src/main/resources/registration_to_simulator/changeManagement/get_vnf_data_by_globalid_and_service_type_response.json b/vid-automation/src/main/resources/registration_to_simulator/changeManagement/get_vnf_data_by_globalid_and_service_type_response.json new file mode 100644 index 000000000..258cd0e1a --- /dev/null +++ b/vid-automation/src/main/resources/registration_to_simulator/changeManagement/get_vnf_data_by_globalid_and_service_type_response.json @@ -0,0 +1,614 @@ +{ + "results": [ + { + "id": "3400916992", + "node-type": "service-instance", + "url": "https://aai.onap.org:8443/aai/v10/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/vRichardson/service-instances/service-instance/66b13cb4-b575-449f-aa45-ffbfe005c7b1", + "properties": { + "service-instance-id": "66b13cb4-b575-449f-aa45-ffbfe005c7b1", + "service-instance-name": "CHARLOTTE_preload_1710_0914", + "model-invariant-id": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0", + "model-version-id": "1525f534-99a2-408f-b847-ff636997d352", + "resource-version": "1505856078810", + "orchestration-status": "Active" + }, + "related-to": [ + { + "id": "10207440", + "node-type": "service-subscription", + "url": "https://aai.onap.org:8443/aai/v10/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/vRichardson" + }, + { + "id": "3481829392", + "node-type": "generic-vnf", + "url": "https://aai.onap.org:8443/aai/v10/network/generic-vnfs/generic-vnf/0c465dd3-4151-4da9-92a2-541bb3174cec" + } + ] + }, + { + "id": "3771572432", + "node-type": "service-instance", + "url": "https://aai.onap.org:8443/aai/v10/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/vRichardson/service-instances/service-instance/f195837b-ef28-42c3-8dea-47ad37eaed95", + "properties": { + "service-instance-id": "f195837b-ef28-42c3-8dea-47ad37eaed95", + "service-instance-name": "CHARLOTTE_preload_1710_0914_0920", + "model-invariant-id": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0", + "model-version-id": "3915de55-a904-4cc6-8fc3-86f8bc316616", + "resource-version": "1505964829466", + "orchestration-status": "Active" + }, + "related-to": [ + { + "id": "10207440", + "node-type": "service-subscription", + "url": "https://aai.onap.org:8443/aai/v10/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/vRichardson" + }, + { + "id": "3484520464", + "node-type": "generic-vnf", + "url": "https://aai.onap.org:8443/aai/v10/network/generic-vnfs/generic-vnf/c2d2d389-fa00-4fb4-a269-e46d495719e1" + } + ] + }, + { + "id": "3775807704", + "node-type": "service-instance", + "url": "https://aai.onap.org:8443/aai/v10/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/vRichardson/service-instances/service-instance/9ad4ac55-a5e0-4b49-95c0-b2d846abf700", + "properties": { + "service-instance-id": "9ad4ac55-a5e0-4b49-95c0-b2d846abf700", + "service-instance-name": "CHARLOTTE_preload_1710_0914_100417", + "model-invariant-id": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0", + "model-version-id": "3915de55-a904-4cc6-8fc3-86f8bc316616", + "resource-version": "1507144734087", + "orchestration-status": "Active" + }, + "related-to": [ + { + "id": "10207440", + "node-type": "service-subscription", + "url": "https://aai.onap.org:8443/aai/v10/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/vRichardson" + }, + { + "id": "3783459064", + "node-type": "generic-vnf", + "url": "https://aai.onap.org:8443/aai/v10/network/generic-vnfs/generic-vnf/54626a59-ec0d-4fa9-b0c2-08d008688165" + } + ] + }, + { + "id": "4178862184", + "node-type": "service-instance", + "url": "https://aai.onap.org:8443/aai/v10/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/vRichardson/service-instances/service-instance/599c7247-b083-447c-b6b1-0cdd5170dfd2", + "properties": { + "service-instance-id": "599c7247-b083-447c-b6b1-0cdd5170dfd2", + "service-instance-name": "CHARLOTTE_preload_1710_0914_1010", + "model-invariant-id": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0", + "model-version-id": "3915de55-a904-4cc6-8fc3-86f8bc316616", + "resource-version": "1507664240411", + "orchestration-status": "Active" + }, + "related-to": [ + { + "id": "10207440", + "node-type": "service-subscription", + "url": "https://aai.onap.org:8443/aai/v10/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/vRichardson" + }, + { + "id": "3892133896", + "node-type": "generic-vnf", + "url": "https://aai.onap.org:8443/aai/v10/network/generic-vnfs/generic-vnf/d74503d8-abab-49c6-ba48-a6211eee9b7a" + } + ] + }, + { + "id": "3008335920", + "node-type": "service-instance", + "url": "https://aai.onap.org:8443/aai/v10/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/vRichardson/service-instances/service-instance/97315a05-e6f3-4c47-ae7e-d850c327aa08", + "properties": { + "service-instance-id": "97315a05-e6f3-4c47-ae7e-d850c327aa08", + "service-instance-name": "CHARLOTTE_preload_1710_0914_0927", + "model-invariant-id": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0", + "model-version-id": "3915de55-a904-4cc6-8fc3-86f8bc316616", + "resource-version": "1506527653053", + "orchestration-status": "Active" + }, + "related-to": [ + { + "id": "10207440", + "node-type": "service-subscription", + "url": "https://aai.onap.org:8443/aai/v10/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/vRichardson" + }, + { + "id": "3418898432", + "node-type": "generic-vnf", + "url": "https://aai.onap.org:8443/aai/v10/network/generic-vnfs/generic-vnf/8e5e3ba1-3fe6-4d86-966e-f9f03dab4855" + } + ] + }, + { + "id": "3481829392", + "node-type": "generic-vnf", + "url": "https://aai.onap.org:8443/aai/v10/network/generic-vnfs/generic-vnf/0c465dd3-4151-4da9-92a2-541bb3174cec", + "properties": { + "vnf-id": "0c465dd3-4151-4da9-92a2-541bb3174cec", + "vnf-name": "Eoghan Fausto", + "vnf-type": "CHARLOTTE preload 1710 0914/CHARLOTTE preload 1710 0914 0", + "service-id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "prov-status": "PREPROV", + "orchestration-status": "Created", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1505856137206", + "model-invariant-id": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8", + "model-version-id": "afacccf6-397d-45d6-b5ae-94c39734b168", + "model-customization-id": "b54689f8-45c5-4be2-9e91-f033e028feec", + "nf-type": "DNS", + "nf-function": "Mobile DNS", + "nf-role": "vWheeler", + "nf-naming-code": "null" + }, + "related-to": [ + { + "id": "3285635208", + "node-type": "vf-module", + "url": "https://aai.onap.org:8443/aai/v10/network/generic-vnfs/generic-vnf/0c465dd3-4151-4da9-92a2-541bb3174cec/vf-modules/vf-module/d49713bf-1bff-4eab-bed1-a8f1bb83aa98" + }, + { + "id": "3441209432", + "node-type": "vf-module", + "url": "https://aai.onap.org:8443/aai/v10/network/generic-vnfs/generic-vnf/0c465dd3-4151-4da9-92a2-541bb3174cec/vf-modules/vf-module/b8397fec-cf13-40b3-be8f-7d0912506419" + }, + { + "id": "3687522312", + "node-type": "vf-module", + "url": "https://aai.onap.org:8443/aai/v10/network/generic-vnfs/generic-vnf/0c465dd3-4151-4da9-92a2-541bb3174cec/vf-modules/vf-module/fd098a52-09be-4c48-a9e9-a565d1b39db3" + }, + { + "id": "3400916992", + "node-type": "service-instance", + "url": "https://aai.onap.org:8443/aai/v10/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/vRichardson/service-instances/service-instance/66b13cb4-b575-449f-aa45-ffbfe005c7b1" + }, + { + "id": "3477385312", + "node-type": "vserver", + "url": "https://aai.onap.org:8443/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/olson3/tenants/tenant/eecd15e8e7ee46c3bbc2096f0924f4c4/vservers/vserver/8627b971-1032-420f-a044-6802f0ab6976" + } + ] + }, + { + "id": "3484520464", + "node-type": "generic-vnf", + "url": "https://aai.onap.org:8443/aai/v10/network/generic-vnfs/generic-vnf/c2d2d389-fa00-4fb4-a269-e46d495719e1", + "properties": { + "vnf-id": "c2d2d389-fa00-4fb4-a269-e46d495719e1", + "vnf-name": "Odell Romana", + "vnf-type": "CHARLOTTE preload 1710 0914/CHARLOTTE preload 1710 0914 0", + "service-id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "prov-status": "PREPROV", + "orchestration-status": "Created", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1505964996823", + "model-invariant-id": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8", + "model-version-id": "76e908e0-5201-44d2-a3e2-9e6128d05820", + "model-customization-id": "c00e8fc8-af39-4da8-8c78-a7efc2fe5994", + "nf-type": "DNS", + "nf-function": "Mobile DNS", + "nf-role": "vMobileDNS", + "nf-naming-code": "null" + }, + "related-to": [ + { + "id": "3447107680", + "node-type": "vf-module", + "url": "https://aai.onap.org:8443/aai/v10/network/generic-vnfs/generic-vnf/c2d2d389-fa00-4fb4-a269-e46d495719e1/vf-modules/vf-module/c4711b5c-742e-4d03-8146-bff763f69fbd" + }, + { + "id": "3448307712", + "node-type": "vf-module", + "url": "https://aai.onap.org:8443/aai/v10/network/generic-vnfs/generic-vnf/c2d2d389-fa00-4fb4-a269-e46d495719e1/vf-modules/vf-module/0ba3fcdd-0536-4ac7-a9ec-8d8622db7fb2" + }, + { + "id": "3692179528", + "node-type": "vf-module", + "url": "https://aai.onap.org:8443/aai/v10/network/generic-vnfs/generic-vnf/c2d2d389-fa00-4fb4-a269-e46d495719e1/vf-modules/vf-module/6bb843eb-ef84-43b1-83b4-3154a7f9928c" + }, + { + "id": "3771588816", + "node-type": "vf-module", + "url": "https://aai.onap.org:8443/aai/v10/network/generic-vnfs/generic-vnf/c2d2d389-fa00-4fb4-a269-e46d495719e1/vf-modules/vf-module/a4c008c6-cac0-4e3f-928f-90fa37dc8c4b" + }, + { + "id": "3904077944", + "node-type": "vf-module", + "url": "https://aai.onap.org:8443/aai/v10/network/generic-vnfs/generic-vnf/c2d2d389-fa00-4fb4-a269-e46d495719e1/vf-modules/vf-module/eecb619c-a173-4ead-bf48-d4d09cbbdd5e" + }, + { + "id": "4027855088", + "node-type": "vf-module", + "url": "https://aai.onap.org:8443/aai/v10/network/generic-vnfs/generic-vnf/c2d2d389-fa00-4fb4-a269-e46d495719e1/vf-modules/vf-module/1e29424e-2dca-45ac-b1df-59a8f74d0bc1" + }, + { + "id": "4390871192", + "node-type": "vf-module", + "url": "https://aai.onap.org:8443/aai/v10/network/generic-vnfs/generic-vnf/c2d2d389-fa00-4fb4-a269-e46d495719e1/vf-modules/vf-module/b185220a-7f63-4b29-867d-1452813a4f09" + }, + { + "id": "4450529432", + "node-type": "vf-module", + "url": "https://aai.onap.org:8443/aai/v10/network/generic-vnfs/generic-vnf/c2d2d389-fa00-4fb4-a269-e46d495719e1/vf-modules/vf-module/7a0c4b98-b3cc-490c-bbab-e2d7f169f2d7" + }, + { + "id": "3771572432", + "node-type": "service-instance", + "url": "https://aai.onap.org:8443/aai/v10/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/vRichardson/service-instances/service-instance/f195837b-ef28-42c3-8dea-47ad37eaed95" + } + ] + }, + { + "id": "3783459064", + "node-type": "generic-vnf", + "url": "https://aai.onap.org:8443/aai/v10/network/generic-vnfs/generic-vnf/54626a59-ec0d-4fa9-b0c2-08d008688165", + "properties": { + "vnf-id": "54626a59-ec0d-4fa9-b0c2-08d008688165", + "vnf-name": "Dominika Fionnbharr", + "vnf-type": "CHARLOTTE preload 1710 0914/CHARLOTTE preload 1710 0914 0", + "service-id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "prov-status": "PREPROV", + "orchestration-status": "Created", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1507144948937", + "model-invariant-id": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8", + "model-version-id": "76e908e0-5201-44d2-a3e2-9e6128d05820", + "model-customization-id": "c00e8fc8-af39-4da8-8c78-a7efc2fe5994", + "nf-type": "DNS", + "nf-function": "Mobile DNS", + "nf-role": "vMobileDNS", + "nf-naming-code": "null" + }, + "related-to": [ + { + "id": "3775807704", + "node-type": "service-instance", + "url": "https://aai.onap.org:8443/aai/v10/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/vRichardson/service-instances/service-instance/9ad4ac55-a5e0-4b49-95c0-b2d846abf700" + } + ] + }, + { + "id": "3892133896", + "node-type": "generic-vnf", + "url": "https://aai.onap.org:8443/aai/v10/network/generic-vnfs/generic-vnf/d74503d8-abab-49c6-ba48-a6211eee9b7a", + "properties": { + "vnf-id": "d74503d8-abab-49c6-ba48-a6211eee9b7a", + "vnf-name": "CHARLOTTE_PreloadTest_VNF", + "vnf-type": "CHARLOTTE preload 1710 0914/CHARLOTTE preload 1710 0914 0", + "service-id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "prov-status": "PREPROV", + "orchestration-status": "Created", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1507664288548", + "model-invariant-id": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8", + "model-version-id": "76e908e0-5201-44d2-a3e2-9e6128d05820", + "model-customization-id": "c00e8fc8-af39-4da8-8c78-a7efc2fe5994", + "nf-type": "DNS", + "nf-function": "Mobile DNS", + "nf-role": "vMobileDNS", + "nf-naming-code": "null" + }, + "related-to": [ + { + "id": "4178862184", + "node-type": "service-instance", + "url": "https://aai.onap.org:8443/aai/v10/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/vRichardson/service-instances/service-instance/599c7247-b083-447c-b6b1-0cdd5170dfd2" + } + ] + }, + { + "id": "1507690314", + "node-type": "generic-vnf", + "url": "https://aai.onap.org:8443/aai/v10/network/generic-vnfs/generic-vnf/385548e2-3f31-4900-9437-317d0346e49a", + "properties": { + "vnf-id": "385548e2-3f31-4900-9437-317d0346e49a", + "vnf-name": "Senga Gabrielle", + "vnf-type": "CHARLOTTE preload 1710 0914/CHARLOTTE preload 1710 0914 0", + "service-id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "prov-status": "PREPROV", + "orchestration-status": "Created", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "7788675952902", + "model-invariant-id": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8", + "model-version-id": "b217c612-7fcf-484c-861b-df0a5c4b5bcb", + "model-customization-id": "ce15d245-763c-4079-ac82-fe93007adb69", + "nf-type": "DNS", + "nf-function": "Mobile DNS", + "nf-role": "vMobileDNS", + "nf-naming-code": "null" + }, + "related-to": [ + { + "id": "3664617648", + "node-type": "vf-module", + "url": "https://aai.onap.org:8443/aai/v10/network/generic-vnfs/generic-vnf/8e5e3ba1-3fe6-4d86-966e-f9f03dab4855/vf-modules/vf-module/788cde64-c288-4971-8e8c-77973c5009dc" + }, + { + "id": "3008335920", + "node-type": "service-instance", + "url": "https://aai.onap.org:8443/aai/v10/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/vRichardson/service-instances/service-instance/97315a05-e6f3-4c47-ae7e-d850c327aa08" + }, + { + "id": "3477385312", + "node-type": "vserver", + "url": "https://aai.onap.org:8443/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/olson3/tenants/tenant/eecd15e8e7ee46c3bbc2096f0924f4c4/vservers/vserver/8627b971-1032-420f-a044-6802f0ab6976" + } + ] + }, + { + "id": "5278880615", + "node-type": "generic-vnf", + "url": "https://aai.onap.org:8443/aai/v10/network/generic-vnfs/generic-vnf/0465e048-92a4-4a7f-bfe7-de39b32de4bd", + "properties": { + "vnf-id": "0465e048-92a4-4a7f-bfe7-de39b32de4bd", + "vnf-name": "Constantius Raghu", + "vnf-type": "CHARLOTTE preload 1710 0914/CHARLOTTE preload 1710 0914 0", + "service-id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "prov-status": "PREPROV", + "orchestration-status": "Created", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "7788675952902", + "model-invariant-id": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8", + "model-version-id": "afacccf6-397d-45d6-b5ae-94c39734b168", + "model-customization-id": "ce15d245-763c-4079-ac82-fe93007adb69", + "nf-type": "DNS", + "nf-function": "Mobile DNS", + "nf-role": "vWheeler", + "nf-naming-code": "null" + }, + "related-to": [ + { + "id": "3664617648", + "node-type": "vf-module", + "url": "https://aai.onap.org:8443/aai/v10/network/generic-vnfs/generic-vnf/8e5e3ba1-3fe6-4d86-966e-f9f03dab4855/vf-modules/vf-module/788cde64-c288-4971-8e8c-77973c5009dc" + }, + { + "id": "3008335920", + "node-type": "service-instance", + "url": "https://aai.onap.org:8443/aai/v10/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/vRichardson/service-instances/service-instance/97315a05-e6f3-4c47-ae7e-d850c327aa08" + }, + { + "id": "3477385312", + "node-type": "vserver", + "url": "https://aai.onap.org:8443/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/olson3/tenants/tenant/eecd15e8e7ee46c3bbc2096f0924f4c4/vservers/vserver/8627b971-1032-420f-a044-6802f0ab6976" + } + ] + }, + { + "id": "3418898432", + "node-type": "generic-vnf", + "url": "https://aai.onap.org:8443/aai/v10/network/generic-vnfs/generic-vnf/8e5e3ba1-3fe6-4d86-966e-f9f03dab4855", + "properties": { + "vnf-id": "8e5e3ba1-3fe6-4d86-966e-f9f03dab4855", + "vnf-name": "zolson3amdns02test2", + "vnf-type": "CHARLOTTE preload 1710 0914/CHARLOTTE preload 1710 0914 0", + "service-id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "prov-status": "PREPROV", + "orchestration-status": "Created", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "1507132024933", + "model-invariant-id": "72e465fe-71b1-4e7b-b5ed-9496118ff7a8", + "model-version-id": "76e908e0-5201-44d2-a3e2-9e6128d05820", + "model-customization-id": "c00e8fc8-af39-4da8-8c78-a7efc2fe5994", + "nf-type": "DNS", + "nf-function": "Mobile DNS", + "nf-role": "vMobileDNS", + "nf-naming-code": "null" + }, + "related-to": [ + { + "id": "3664617648", + "node-type": "vf-module", + "url": "https://aai.onap.org:8443/aai/v10/network/generic-vnfs/generic-vnf/8e5e3ba1-3fe6-4d86-966e-f9f03dab4855/vf-modules/vf-module/788cde64-c288-4971-8e8c-77973c5009dc" + }, + { + "id": "3008335920", + "node-type": "service-instance", + "url": "https://aai.onap.org:8443/aai/v10/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/vRichardson/service-instances/service-instance/97315a05-e6f3-4c47-ae7e-d850c327aa08" + }, + { + "id": "3477385312", + "node-type": "vserver", + "url": "https://aai.onap.org:8443/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/olson3/tenants/tenant/eecd15e8e7ee46c3bbc2096f0924f4c4/vservers/vserver/8627b971-1032-420f-a044-6802f0ab6976" + }, + { + "id": "3647635704", + "node-type": "vserver", + "url": "https://aai.onap.org:8443/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/olson3/tenants/tenant/eecd15e8e7ee46c3bbc2096f0924f4c4/vservers/vserver/b30b17e9-10d0-4475-b558-7d18ae0aade0" + }, + { + "id": "3664621744", + "node-type": "vserver", + "url": "https://aai.onap.org:8443/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/mdt1/tenants/tenant/88a6ca3ee0394ade9403f075db23167e/vservers/vserver/d3b293ba-85de-440e-904b-9dad160fbdce" + }, + { + "id": "3975352504", + "node-type": "vserver", + "url": "https://aai.onap.org:8443/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/mdt1/tenants/tenant/88a6ca3ee0394ade9403f075db23167e/vservers/vserver/495a9a72-c9f6-41ed-93eb-065ebc2bfb1f" + }, + { + "id": "4059455552", + "node-type": "vserver", + "url": "https://aai.onap.org:8443/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/mdt1/tenants/tenant/88a6ca3ee0394ade9403f075db23167e/vservers/vserver/b4b9f419-3ed4-4bd8-bb2e-32b0a98e80b7" + }, + { + "id": "4098130088", + "node-type": "vserver", + "url": "https://aai.onap.org:8443/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/mdt1/tenants/tenant/88a6ca3ee0394ade9403f075db23167e/vservers/vserver/94c79f43-e76d-461e-b8df-8af2acb08e1e" + }, + { + "id": "4401291416", + "node-type": "vserver", + "url": "https://aai.onap.org:8443/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/mdt1/tenants/tenant/88a6ca3ee0394ade9403f075db23167e/vservers/vserver/99cad3c6-1301-49c4-ad67-ae3c955de5f1" + }, + { + "id": "4458950808", + "node-type": "vserver", + "url": "https://aai.onap.org:8443/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/mdt1/tenants/tenant/88a6ca3ee0394ade9403f075db23167e/vservers/vserver/047354dc-0244-4241-b24a-7d7b00413b82" + } + ] + }, + { + "id": "1024648346", + "node-type": "generic-vnf", + "url": "https://aai.onap.org:8443/aai/v10/network/generic-vnfs/generic-vnf/a58bf551-a79c-42d1-83b4-ed9288036245", + "properties": { + "vnf-id": "a58bf551-a79c-42d1-83b4-ed9288036245", + "vnf-name": "Harrison Kris", + "vnf-type": "CHARLOTTE preload 1710 0914/CHARLOTTE preload 1710 0914 0", + "service-id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "prov-status": "PREPROV", + "orchestration-status": "Created", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "4679861552759", + "model-invariant-id": "00beb8f9-6d39-452f-816d-c709b9cbb87d", + "model-version-id": "0903e1c0-8e03-4936-b5c2-260653b96413", + "model-customization-id": "14e8057d-b22a-405c-84aa-90b82bfd6e46", + "nf-type": "DNS", + "nf-function": "Mobile DNS", + "nf-role": "vMobileDNS", + "nf-naming-code": "null" + }, + "related-to": [ + { + "id": "3664617648", + "node-type": "vf-module", + "url": "https://aai.onap.org:8443/aai/v10/network/generic-vnfs/generic-vnf/8e5e3ba1-3fe6-4d86-966e-f9f03dab4855/vf-modules/vf-module/788cde64-c288-4971-8e8c-77973c5009dc" + }, + { + "id": "3008335920", + "node-type": "service-instance", + "url": "https://aai.onap.org:8443/aai/v10/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/vRichardson/service-instances/service-instance/97315a05-e6f3-4c47-ae7e-d850c327aa08" + }, + { + "id": "3477385312", + "node-type": "vserver", + "url": "https://aai.onap.org:8443/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/olson3/tenants/tenant/eecd15e8e7ee46c3bbc2096f0924f4c4/vservers/vserver/8627b971-1032-420f-a044-6802f0ab6976" + }, + { + "id": "3647635704", + "node-type": "vserver", + "url": "https://aai.onap.org:8443/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/olson3/tenants/tenant/eecd15e8e7ee46c3bbc2096f0924f4c4/vservers/vserver/b30b17e9-10d0-4475-b558-7d18ae0aade0" + }, + { + "id": "3664621744", + "node-type": "vserver", + "url": "https://aai.onap.org:8443/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/olson3/tenants/tenant/eecd15e8e7ee46c3bbc2096f0924f4c4/vservers/vserver/d3b293ba-85de-440e-904b-9dad160fbdce" + }, + { + "id": "3975352504", + "node-type": "vserver", + "url": "https://aai.onap.org:8443/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/olson3/tenants/tenant/eecd15e8e7ee46c3bbc2096f0924f4c4/vservers/vserver/495a9a72-c9f6-41ed-93eb-065ebc2bfb1f" + }, + { + "id": "4059455552", + "node-type": "vserver", + "url": "https://aai.onap.org:8443/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/olson3/tenants/tenant/eecd15e8e7ee46c3bbc2096f0924f4c4/vservers/vserver/b4b9f419-3ed4-4bd8-bb2e-32b0a98e80b7" + }, + { + "id": "4098130088", + "node-type": "vserver", + "url": "https://aai.onap.org:8443/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/olson3/tenants/tenant/eecd15e8e7ee46c3bbc2096f0924f4c4/vservers/vserver/94c79f43-e76d-461e-b8df-8af2acb08e1e" + }, + { + "id": "4401291416", + "node-type": "vserver", + "url": "https://aai.onap.org:8443/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/olson3/tenants/tenant/eecd15e8e7ee46c3bbc2096f0924f4c4/vservers/vserver/99cad3c6-1301-49c4-ad67-ae3c955de5f1" + }, + { + "id": "4458950808", + "node-type": "vserver", + "url": "https://aai.onap.org:8443/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/olson3/tenants/tenant/eecd15e8e7ee46c3bbc2096f0924f4c4/vservers/vserver/047354dc-0244-4241-b24a-7d7b00413b82" + } + ] + }, + { + "id": "1024648346", + "node-type": "generic-vfmodule", + "url": "https://aai.onap.org:8443/aai/v10/network/generic-vnfs/generic-vnf/a58bf551-a79c-42d1-83b4-ed9288036245", + "properties": { + "vnf-id": "a58bf551-a79c-42d1-83b4-ed9288036245", + "vnf-name": "Harrison Kris", + "vnf-type": "CHARLOTTE preload 1710 0914/CHARLOTTE preload 1710 0914 0", + "service-id": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "prov-status": "PREPROV", + "orchestration-status": "Created", + "in-maint": false, + "is-closed-loop-disabled": false, + "resource-version": "4679861552759", + "model-invariant-id": "00beb8f9-6d39-452f-816d-c709b9cbb87d", + "model-version-id": "0903e1c0-8e03-4936-b5c2-260653b96413", + "model-customization-id": "14e8057d-b22a-405c-84aa-90b82bfd6e46", + "nf-type": "DNS", + "nf-function": "Mobile DNS", + "nf-role": "vMobileDNS", + "nf-naming-code": "null" + }, + "related-to": [ + { + "id": "3664617648", + "node-type": "vf-module", + "url": "https://aai.onap.org:8443/aai/v10/network/generic-vnfs/generic-vnf/8e5e3ba1-3fe6-4d86-966e-f9f03dab4855/vf-modules/vf-module/788cde64-c288-4971-8e8c-77973c5009dc" + }, + { + "id": "3008335920", + "node-type": "service-instance", + "url": "https://aai.onap.org:8443/aai/v10/business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/vRichardson/service-instances/service-instance/97315a05-e6f3-4c47-ae7e-d850c327aa08" + }, + { + "id": "3477385312", + "node-type": "vserver", + "url": "https://aai.onap.org:8443/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/olson3/tenants/tenant/eecd15e8e7ee46c3bbc2096f0924f4c4/vservers/vserver/8627b971-1032-420f-a044-6802f0ab6976" + }, + { + "id": "3647635704", + "node-type": "vserver", + "url": "https://aai.onap.org:8443/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/olson3/tenants/tenant/eecd15e8e7ee46c3bbc2096f0924f4c4/vservers/vserver/b30b17e9-10d0-4475-b558-7d18ae0aade0" + }, + { + "id": "3664621744", + "node-type": "vserver", + "url": "https://aai.onap.org:8443/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/olson3/tenants/tenant/eecd15e8e7ee46c3bbc2096f0924f4c4/vservers/vserver/d3b293ba-85de-440e-904b-9dad160fbdce" + }, + { + "id": "3975352504", + "node-type": "vserver", + "url": "https://aai.onap.org:8443/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/olson3/tenants/tenant/eecd15e8e7ee46c3bbc2096f0924f4c4/vservers/vserver/495a9a72-c9f6-41ed-93eb-065ebc2bfb1f" + }, + { + "id": "4059455552", + "node-type": "vserver", + "url": "https://aai.onap.org:8443/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/olson3/tenants/tenant/eecd15e8e7ee46c3bbc2096f0924f4c4/vservers/vserver/b4b9f419-3ed4-4bd8-bb2e-32b0a98e80b7" + }, + { + "id": "4098130088", + "node-type": "vserver", + "url": "https://aai.onap.org:8443/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/olson3/tenants/tenant/eecd15e8e7ee46c3bbc2096f0924f4c4/vservers/vserver/94c79f43-e76d-461e-b8df-8af2acb08e1e" + }, + { + "id": "4401291416", + "node-type": "vserver", + "url": "https://aai.onap.org:8443/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/olson3/tenants/tenant/eecd15e8e7ee46c3bbc2096f0924f4c4/vservers/vserver/99cad3c6-1301-49c4-ad67-ae3c955de5f1" + }, + { + "id": "4458950808", + "node-type": "vserver", + "url": "https://aai.onap.org:8443/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/olson3/tenants/tenant/eecd15e8e7ee46c3bbc2096f0924f4c4/vservers/vserver/047354dc-0244-4241-b24a-7d7b00413b82" + } + ] + } + ] +}
\ No newline at end of file diff --git a/vid-automation/src/test/java/org/onap/vid/api/AaiApiTest.java b/vid-automation/src/test/java/org/onap/vid/api/AaiApiTest.java index 6b5b08e2b..3d1dfb2ce 100644 --- a/vid-automation/src/test/java/org/onap/vid/api/AaiApiTest.java +++ b/vid-automation/src/test/java/org/onap/vid/api/AaiApiTest.java @@ -1,15 +1,59 @@ package org.onap.vid.api; +import static net.javacrumbs.jsonunit.JsonMatchers.jsonEquals; +import static org.hamcrest.CoreMatchers.containsString; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.core.IsNot.not; +import static org.onap.simulator.presetGenerator.presets.aai.PresetAAIStandardQueryGet.defaultPlacement; +import static org.onap.simulator.presetGenerator.presets.aai.PresetAAIStandardQueryGet.ofL3Network; +import static org.onap.simulator.presetGenerator.presets.aai.PresetAAIStandardQueryGet.ofServiceInstance; +import static org.onap.simulator.presetGenerator.presets.aai.PresetAAIStandardQueryGet.ofVlanTag; +import static org.onap.simulator.presetGenerator.presets.aai.PresetAAIStandardQueryGet.ofVnf; +import static org.onap.simulator.presetGenerator.presets.aai.PresetBaseAAICustomQuery.FORMAT.SIMPLE; +import static org.onap.simulator.presetGenerator.presets.ecompportal_att.EcompPortalPresetsUtils.getEcompPortalPresets; +import static org.testng.Assert.assertNotNull; +import static org.testng.Assert.assertTrue; +import static org.testng.AssertJUnit.assertEquals; +import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.APPEND; +import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.CLEAR_THEN_SET; +import static vid.automation.test.utils.TestHelper.GET_SERVICE_MODELS_BY_DISTRIBUTION_STATUS; + import com.fasterxml.jackson.core.JsonProcessingException; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMultimap; +import java.io.IOException; +import java.lang.reflect.Method; +import java.net.URISyntaxException; +import java.util.List; +import java.util.UUID; import net.javacrumbs.jsonunit.JsonAssert; import net.javacrumbs.jsonunit.core.Configuration; import net.javacrumbs.jsonunit.core.Option; import org.apache.commons.text.StringEscapeUtils; +import org.apache.http.client.utils.URIBuilder; import org.onap.simulator.presetGenerator.presets.BasePresets.BasePreset; -import org.onap.simulator.presetGenerator.presets.aai.*; +import org.onap.simulator.presetGenerator.presets.aai.AAIBaseGetL3NetworksByCloudRegionPreset; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIBadBodyForGetServicesGet; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAICloudRegionAndSourceFromConfigurationPut; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetHomingForVfModule; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetInstanceGroupsByCloudRegion; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetInstanceGroupsByCloudRegionInvalidRequest; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetInstanceGroupsByCloudRegionRequiredMissing; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetL3NetworksByCloudRegion; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetL3NetworksByCloudRegionSpecificState; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetNetworkCollectionDetails; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetNetworkCollectionDetailsInvalidRequest; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetNetworkCollectionDetailsRequiredMissing; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetPortMirroringSourcePorts; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetPortMirroringSourcePortsError; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetRelatedInstanceGroupsByVnfId; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetSubscribersGet; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetVpnsByType; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIModelVersionsByInvariantId; +import org.onap.simulator.presetGenerator.presets.aai.PresetAAIStandardQueryGet; +import org.onap.simulator.presetGenerator.presets.aai.PresetBaseAAICustomQuery; import org.onap.simulator.presetGenerator.presets.sdc.PresetSDCGetServiceMetadataGet; import org.onap.simulator.presetGenerator.presets.sdc.PresetSDCGetServiceToscaModelGet; import org.onap.vid.model.aai.AaiResponse; @@ -22,6 +66,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.client.HttpClientErrorException; import org.springframework.web.client.HttpServerErrorException; import org.springframework.web.util.UriComponentsBuilder; +import org.testng.AssertJUnit; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import vid.automation.test.infra.FeatureTogglingTest; @@ -29,25 +74,6 @@ import vid.automation.test.infra.Features; import vid.automation.test.services.SimulatorApi; import vid.automation.test.utils.TestHelper; -import java.io.IOException; -import java.lang.reflect.Method; -import java.net.URISyntaxException; -import java.util.List; -import java.util.UUID; - -import static net.javacrumbs.jsonunit.JsonMatchers.jsonEquals; -import static org.hamcrest.CoreMatchers.containsString; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.onap.simulator.presetGenerator.presets.aai.PresetAAIStandardQueryGet.*; -import static org.onap.simulator.presetGenerator.presets.ecompportal_att.EcompPortalPresetsUtils.getEcompPortalPresets; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; -import static org.testng.AssertJUnit.assertEquals; -import static org.testng.AssertJUnit.assertNull; -import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.APPEND; -import static vid.automation.test.services.SimulatorApi.RegistrationStrategy.CLEAR_THEN_SET; -import static vid.automation.test.utils.TestHelper.GET_SERVICE_MODELS_BY_DISTRIBUTION_STATUS; - public class AaiApiTest extends BaseApiAaiTest { private static final String AAI_HOMING_DATA_RESPONSE = "viewEdit/aaiHomingDataResponse.json"; @@ -56,6 +82,7 @@ public class AaiApiTest extends BaseApiAaiTest { public static final String[] AAI_GET_SERVICES_ERROR_SIMULATOR_RESPONSES = {"getServicesAaiErrorResp.json", "create_new_instance/aai_get_full_subscribers.json"}; public static final String[] AAI_GET_SERVICES_FINE_SIMULATOR_RESPONSES = {"getServicesAaiFineResp.json", "create_new_instance/aai_get_full_subscribers.json"}; public static final String AAI_VNFS_FOR_CHANGE_MANAGEMENT_JSON = "changeManagement/get_vnf_data_by_globalid_and_service_type.json"; + public static final String AAI_VNFS_FOR_CHANGE_MANAGEMENT_JSON_BY_PARAMS = "registration_to_simulator/changeManagement/get_vnf_data_by_globalid_and_service_type_reduced_response.json"; public static final String OPERATIONAL_ENVIRONMENT_TYPE = "VNF"; public static final String OPERATIONAL_ENVIRONMENT_STATUS = "Activate"; public static final String GET_INSTANCE_GROUPS_BY_CLOUDREGION_EXPECTED_RESPONSE = "{\"results\":[{\"instance-group\":{\"id\":\"AAI-12002-test3-vm230w\",\"description\":\"a9DEa0kpY\",\"instance-group-role\":\"JZmha7QSS4tJ\",\"model-invariant-id\":\"model-id3\",\"model-version-id\":\"a0efd5fc-f7be-4502-936a-a6c6392b958f\",\"instance-group-type\":\"type\",\"resource-version\":\"1520888659539\",\"instance-group-name\":\"wKmBXiO1xm8bK\",\"instance-group-function\":\"testfunction2\",\"relationship-list\":{\"relationship\":[{\"relationDataList\":[{\"relationship-key\":\"cloud-region.cloud-owner\",\"relationship-value\":\"AAI-12002-vm230w\"},{\"relationship-key\":\"cloud-region.cloud-region-id\",\"relationship-value\":\"AAI-region-vm230w\"}],\"relatedToPropertyList\":[{\"property-key\":\"cloud-region.owner-defined-type\",\"property-value\":null}],\"related-to\":\"cloud-region\",\"related-link\":\"/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/AAI-12002-vm230w/AAI-region-vm230w\",\"relationship-label\":\"org.onap.relationships.inventory.Uses\",\"relationship-data\":[{\"relationship-key\":\"cloud-region.cloud-owner\",\"relationship-value\":\"AAI-12002-vm230w\"},{\"relationship-key\":\"cloud-region.cloud-region-id\",\"relationship-value\":\"AAI-region-vm230w\"}],\"related-to-property\":[{\"property-key\":\"cloud-region.owner-defined-type\",\"property-value\":null}]}]}}},{\"instance-group\":{\"id\":\"AAI-12002-test1-vm230w\",\"description\":\"a9DEa0kpY\",\"instance-group-role\":\"JZmha7QSS4tJ\",\"model-invariant-id\":\"model-id1\",\"model-version-id\":\"a0efd5fc-f7be-4502-936a-a6c6392b958f\",\"instance-group-type\":\"type\",\"resource-version\":\"1520886467989\",\"instance-group-name\":\"wKmBXiO1xm8bK\",\"instance-group-function\":\"testfunction2\",\"relationship-list\":{\"relationship\":[{\"relationDataList\":[{\"relationship-key\":\"cloud-region.cloud-owner\",\"relationship-value\":\"AAI-12002-vm230w\"},{\"relationship-key\":\"cloud-region.cloud-region-id\",\"relationship-value\":\"AAI-region-vm230w\"}],\"relatedToPropertyList\":[{\"property-key\":\"cloud-region.owner-defined-type\",\"property-value\":null}],\"related-to\":\"cloud-region\",\"related-link\":\"/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/AAI-12002-vm230w/AAI-region-vm230w\",\"relationship-label\":\"org.onap.relationships.inventory.Uses\",\"relationship-data\":[{\"relationship-key\":\"cloud-region.cloud-owner\",\"relationship-value\":\"AAI-12002-vm230w\"},{\"relationship-key\":\"cloud-region.cloud-region-id\",\"relationship-value\":\"AAI-region-vm230w\"}],\"related-to-property\":[{\"property-key\":\"cloud-region.owner-defined-type\",\"property-value\":null}]}]}}},{\"instance-group\":{\"id\":\"AAI-12002-test2-vm230w\",\"description\":\"a9DEa0kpY\",\"instance-group-role\":\"JZmha7QSS4tJ\",\"model-invariant-id\":\"model-id2\",\"model-version-id\":\"version2\",\"instance-group-type\":\"type\",\"resource-version\":\"1520888629970\",\"instance-group-name\":\"wKmBXiO1xm8bK\",\"instance-group-function\":\"testfunction2\",\"relationship-list\":{\"relationship\":[{\"relationDataList\":[{\"relationship-key\":\"cloud-region.cloud-owner\",\"relationship-value\":\"AAI-12002-vm230w\"},{\"relationship-key\":\"cloud-region.cloud-region-id\",\"relationship-value\":\"AAI-region-vm230w\"}],\"relatedToPropertyList\":[{\"property-key\":\"cloud-region.owner-defined-type\",\"property-value\":null}],\"related-to\":\"cloud-region\",\"related-link\":\"/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/AAI-12002-vm230w/AAI-region-vm230w\",\"relationship-label\":\"org.onap.relationships.inventory.Uses\",\"relationship-data\":[{\"relationship-key\":\"cloud-region.cloud-owner\",\"relationship-value\":\"AAI-12002-vm230w\"},{\"relationship-key\":\"cloud-region.cloud-region-id\",\"relationship-value\":\"AAI-region-vm230w\"}],\"related-to-property\":[{\"property-key\":\"cloud-region.owner-defined-type\",\"property-value\":null}]}]}}}]}\n"; @@ -707,17 +734,26 @@ public class AaiApiTest extends BaseApiAaiTest { @Test public void getVnfDataByGlobalIdAndServiceType() { - SimulatorApi.registerExpectation(AAI_VNFS_FOR_CHANGE_MANAGEMENT_JSON, APPEND); + SimulatorApi.registerExpectationFromPreset(new PresetBaseAAICustomQuery( + SIMPLE, + "business/customers/customer/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/service-subscriptions/service-subscription/vRichardson/service-instances", + "query/vnf-topology-fromServiceInstance" + ) { + @Override + public Object getResponseBody() { + return getResourceAsString( + "registration_to_simulator/changeManagement/get_vnf_data_by_globalid_and_service_type_response.json"); + } + }, CLEAR_THEN_SET); String url = uri + "/get_vnf_data_by_globalid_and_service_type/a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb/vRichardson"; ResponseEntity<String> response = restTemplate.getForEntity(url, String.class); -//reduced_vnf_data_by_globalid_and_service_type.json - assertTrue(false == response.getBody().contains("generic-vfmodule")); + + assertThat(response.getBody(), not(containsString("generic-vfmodule"))); assertResponse(JsonAssert.when(Option.IGNORING_ARRAY_ORDER), getResourceAsString("changeManagement/reduced_vnf_data_by_globalid_and_service_type.json"), response.getBody()); - } @Test @@ -796,7 +832,33 @@ public class AaiApiTest extends BaseApiAaiTest { ResponseEntity<String> response = restTemplate.getForEntity(url, String.class); assertTrue(response.getStatusCode().is2xxSuccessful()); - assertNull(response.getBody()); + AssertJUnit.assertNull(response.getBody()); + } + + @Test + @FeatureTogglingTest(Features.FLAG_FLASH_CLOUD_REGION_AND_NF_ROLE_OPTIONAL_SEARCH) + public void getVnfsWithCustomQueryNewReducedResponse() throws URISyntaxException { + + String globalCustomerId = "globalCustomerId1-360-as988q"; + String serviceType = "TEST1-360"; + String nfRole = "test360"; + SimulatorApi.registerExpectationFromPreset(new PresetBaseAAICustomQuery( + SIMPLE, + "/business/customers/customer/" + globalCustomerId + "/service-subscriptions/service-subscription/" + + serviceType + "/service-instances", + "query/vnfs-fromServiceInstance-filter?nfRole=" + nfRole + ) { + @Override + public Object getResponseBody() { + return getResourceAsString( + AAI_VNFS_FOR_CHANGE_MANAGEMENT_JSON_BY_PARAMS); + } + }, CLEAR_THEN_SET); + URIBuilder urlBuilder = new URIBuilder(uri + "/get_vnf_data_by_globalid_and_service_type/" + globalCustomerId + "/" + serviceType); + urlBuilder.addParameter("nfRole", nfRole); + ResponseEntity<String> response = restTemplate.getForEntity(urlBuilder.build().toString(), String.class); + assertTrue(response.getStatusCode().is2xxSuccessful()); + assertThat(response.getBody(), jsonEquals(getResourceAsString(AAI_VNFS_FOR_CHANGE_MANAGEMENT_JSON_BY_PARAMS))); } private void assertResponse(Object expected, String response) { diff --git a/vid-automation/src/test/resources/features.properties b/vid-automation/src/test/resources/features.properties index 36c72374a..25bdff696 100644 --- a/vid-automation/src/test/resources/features.properties +++ b/vid-automation/src/test/resources/features.properties @@ -33,3 +33,5 @@ FLAG_1908_RESUME_MACRO_SERVICE=true FLAG_1908_RELEASE_TENANT_ISOLATION=true FLAG_1908_MACRO_NOT_TRANSPORT_NEW_VIEW_EDIT=true FLAG_FLASH_CLOUD_REGION_AND_NF_ROLE_OPTIONAL_SEARCH=false +FLAG_FLASH_REDUCED_RESPONSE_CHANGEMG=true + |