Merge automation from ECOMP's repository
[vid.git] / vid-automation / src / main / java / org / onap / simulator / presetGenerator / presets / aai / PresetAAIGetHomingForVfModule.java
1 package org.onap.simulator.presetGenerator.presets.aai;
2
3 import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset;
4 import org.springframework.http.HttpMethod;
5
6 public class PresetAAIGetHomingForVfModule extends BaseAAIPreset {
7     private final String vnfInstanceId;
8     private final String vfModuleId;
9     private final String tenantId;
10     private final String lcpRegionId;
11
12     public PresetAAIGetHomingForVfModule(String vnfInstanceId, String vfModuleId, String tenantId, String lcpRegionId) {
13         this.vnfInstanceId = vnfInstanceId;
14         this.vfModuleId = vfModuleId;
15         this.tenantId = tenantId;
16         this.lcpRegionId = lcpRegionId;
17     }
18
19     public PresetAAIGetHomingForVfModule(String vnfInstanceId, String vfModuleId) {
20         this(
21                 vnfInstanceId,
22                 vfModuleId,
23                 "db1818f7f2e34862b378bfb2cc520f91",
24                 "olson5b"
25         );
26     }
27
28     public PresetAAIGetHomingForVfModule() {
29         this(
30             "0846287b-65bf-45a6-88f6-6a1af4149fac",
31             "a9b70ac0-5917-4203-a308-0e6920e6d09b",
32             "db1818f7f2e34862b378bfb2cc520f91",
33             "olson5b"
34         );
35     }
36
37     @Override
38     public Object getResponseBody() {
39         return "{" +
40                 "    \"vf-module-id\": \""+vfModuleId+"\"," +
41                 "    \"vf-module-name\": \"apndns_az_02_module_1\"," +
42                 "    \"heat-stack-id\": \"apndns_az_02_module_1/97a319f3-b095-4fff-befa-c657508ecaf8\"," +
43                 "    \"orchestration-status\": \"active\"," +
44                 "    \"is-base-vf-module\": false," +
45                 "    \"resource-version\": \"1530559380383\"," +
46                 "    \"model-invariant-id\": \"74450b48-0aa0-4743-8314-9163e92b7862\"," +
47                 "    \"model-version-id\": \"6bc01a2b-bc48-4991-b9fe-e22c2215d801\"," +
48                 "    \"model-customization-id\": \"74f638c2-0368-4212-8f73-e961005af17c\"," +
49                 "    \"module-index\": 0," +
50                 "    \"relationship-list\": {" +
51                 "        \"relationship\": [" +
52                 "            {" +
53                 "                \"related-to\": \"l3-network\"," +
54                 "                \"relationship-label\": \"org.onap.relationships.inventory.DependsOn\"," +
55                 "                \"related-link\": \"/aai/v12/network/l3-networks/l3-network/335e62be-73a3-41e8-930b-1a677bcafea5\"," +
56                 "                \"relationship-data\": [" +
57                 "                    {" +
58                 "                        \"relationship-key\": \"l3-network.network-id\"," +
59                 "                        \"relationship-value\": \"335e62be-73a3-41e8-930b-1a677bcafea5\"" +
60                 "                    }" +
61                 "                ]," +
62                 "                \"related-to-property\": [" +
63                 "                    {" +
64                 "                        \"property-key\": \"l3-network.network-name\"," +
65                 "                        \"property-value\": \"MNS-FN-25180-T-02Shared_oam_protected_net_1\"" +
66                 "                    }" +
67                 "                ]" +
68                 "            }," +
69                 "            {" +
70                 "                \"related-to\": \"l3-network\"," +
71                 "                \"relationship-label\": \"org.onap.relationships.inventory.DependsOn\"," +
72                 "                \"related-link\": \"/aai/v12/network/l3-networks/l3-network/2db4ee3e-2ac7-4fc3-8739-ecf53416459e\"," +
73                 "                \"relationship-data\": [" +
74                 "                    {" +
75                 "                        \"relationship-key\": \"l3-network.network-id\"," +
76                 "                        \"relationship-value\": \"2db4ee3e-2ac7-4fc3-8739-ecf53416459e\"" +
77                 "                    }" +
78                 "                ]," +
79                 "                \"related-to-property\": [" +
80                 "                    {" +
81                 "                        \"property-key\": \"l3-network.network-name\"," +
82                 "                        \"property-value\": \"Mobisupport-FN-27099-T-02_int_apn_dns_net_1\"" +
83                 "                    }" +
84                 "                ]" +
85                 "            }," +
86                 "            {" +
87                 "                \"related-to\": \"volume-group\"," +
88                 "                \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," +
89                 "                \"related-link\": \"/aai/v12/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/" +  lcpRegionId + "/volume-groups/volume-group/66013ebe-0c81-44b9-a24f-7c6acba73a39\"," +
90                 "                \"relationship-data\": [" +
91                 "                    {" +
92                 "                        \"relationship-key\": \"cloud-region.cloud-owner\"," +
93                 "                        \"relationship-value\": \"irma-aic\"" +
94                 "                    }," +
95                 "                    {" +
96                 "                        \"relationship-key\": \"cloud-region.cloud-region-id\"," +
97                 "                        \"relationship-value\": \"" +  lcpRegionId + "\"" +
98                 "                    }," +
99                 "                    {" +
100                 "                        \"relationship-key\": \"volume-group.volume-group-id\"," +
101                 "                        \"relationship-value\": \"66013ebe-0c81-44b9-a24f-7c6acba73a39\"" +
102                 "                    }" +
103                 "                ]" +
104                 "            }," +
105                 "            {" +
106                 "                \"related-to\": \"vserver\"," +
107                 "                \"relationship-label\": \"org.onap.relationships.inventory.Uses\"," +
108                 "                \"related-link\": \"/aai/v12/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/" +  lcpRegionId + "/tenants/tenant/" + tenantId+ "/vservers/vserver/5eef9f6d-9933-4bc6-9a1a-862d61309437\"," +
109                 "                \"relationship-data\": [" +
110                 "                    {" +
111                 "                        \"relationship-key\": \"cloud-region.cloud-owner\"," +
112                 "                        \"relationship-value\": \"irma-aic\"" +
113                 "                    }," +
114                 "                    {" +
115                 "                        \"relationship-key\": \"cloud-region.cloud-region-id\"," +
116                 "                        \"relationship-value\": \"" +  lcpRegionId + "\"" +
117                 "                    }," +
118                 "                    {" +
119                 "                        \"relationship-key\": \"tenant.tenant-id\"," +
120                 "                        \"relationship-value\": \"" +  tenantId + "\"" +
121                 "                    }," +
122                 "                    {" +
123                 "                        \"relationship-key\": \"vserver.vserver-id\"," +
124                 "                        \"relationship-value\": \"5eef9f6d-9933-4bc6-9a1a-862d61309437\"" +
125                 "                    }" +
126                 "                ]," +
127                 "                \"related-to-property\": [" +
128                 "                    {" +
129                 "                        \"property-key\": \"vserver.vserver-name\"," +
130                 "                        \"property-value\": \"zolson5bfapn01dns002\"" +
131                 "                    }" +
132                 "                ]" +
133                 "            }" +
134                 "        ]" +
135                 "    }" +
136                 "}";
137     }
138
139     @Override
140     public HttpMethod getReqMethod() {
141         return HttpMethod.GET;
142     }
143
144     @Override
145     public String getReqPath() {
146         return getRootPath() + "/network/generic-vnfs/generic-vnf/" + this.vnfInstanceId + "/vf-modules/vf-module/" + this.vfModuleId;
147     }
148
149
150 }