From bf74c24500acf037e24ff75008bbda83fe1be72b Mon Sep 17 00:00:00 2001 From: Ittay Stern Date: Tue, 29 Oct 2019 14:27:44 +0200 Subject: Test aai_get_service_instance_topology with vf-module placement data Issue-ID: VID-603 Change-Id: I2ce89cac91417ef4b60a3943da80f0ff03f865ad Signed-off-by: Ittay Stern --- .../presetGenerator/presets/aai/Placement.java | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/Placement.java') diff --git a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/Placement.java b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/Placement.java index b665fc30f..3018f5f06 100644 --- a/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/Placement.java +++ b/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/aai/Placement.java @@ -10,5 +10,51 @@ public class Placement { this.lcpRegionId = lcpRegionId; this.tenantId = tenantId; } + + public static class Util { + static String placementRelationship(String relatedTo, Placement placement) { + return "" + + "{" + + " \"related-to\": \"" + relatedTo + "\"," + + " \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," + + " \"related-link\": " + relatedLink(placement) + "," + + " \"relationship-data\": [" + + " {" + + " \"relationship-key\": \"cloud-region.cloud-owner\"," + + " \"relationship-value\": \"" + placement.cloudOwner + "\"" + + " }," + + " {" + + " \"relationship-key\": \"cloud-region.cloud-region-id\"," + + " \"relationship-value\": \"" + placement.lcpRegionId + "\"" + + " }," + + " {" + + " \"relationship-key\": \"tenant.tenant-id\"," + + " \"relationship-value\": \"" + placement.tenantId + "\"" + + " }," + + " {" + + " \"relationship-key\": \"vserver.vserver-id\"," + + " \"relationship-value\": \"5eef9f6d-9933-4bc6-9a1a-862d61309437\"" + + " }" + + " ]," + + " \"related-to-property\": [" + + " {" + + " \"property-key\": \"vserver.vserver-name\"," + + " \"property-value\": \"zolson5bfapn01dns002\"" + + " }" + + " ]" + + "}"; + } + + private static String relatedLink(Placement placement) { + return "" + + "\"" + + "/aai/v12/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/" + + placement.lcpRegionId + + "/tenants/tenant/" + + placement.tenantId + + "/vservers/vserver/5eef9f6d-9933-4bc6-9a1a-862d61309437" + + "\""; + } + } } -- cgit 1.2.3-korg