Merge automation from ECOMP's repository
[vid.git] / vid-automation / src / main / java / org / onap / simulator / presetGenerator / presets / aai / PresetAAIGetRelatedInstanceGroupsByVnfId.java
1 package org.onap.simulator.presetGenerator.presets.aai;
2
3 import com.google.common.collect.ImmutableMap;
4 import java.util.Collections;
5 import java.util.List;
6 import java.util.Map;
7 import org.onap.simulator.presetGenerator.presets.BasePresets.BaseAAIPreset;
8 import org.springframework.http.HttpMethod;
9
10 public class PresetAAIGetRelatedInstanceGroupsByVnfId extends BaseAAIPreset {
11
12     private String vnfId;
13
14
15     public String getVnfId() {
16         return vnfId;
17     }
18
19     public void setVnfId(String vnfId) {
20         this.vnfId = vnfId;
21     }
22
23
24     public PresetAAIGetRelatedInstanceGroupsByVnfId(String vnfId){
25         this.vnfId = vnfId;
26     }
27
28     @Override
29     public HttpMethod getReqMethod() {
30         return HttpMethod.GET;
31     }
32
33     @Override
34     public String getReqPath() {
35         return getRootPath() + "/network/generic-vnfs/generic-vnf/" + getVnfId();
36     }
37
38     @Override
39     public Map<String, List> getQueryParams() {
40         return ImmutableMap.of(
41                 "depth", Collections.singletonList("0")
42         );
43     }
44
45     @Override
46     public Object getResponseBody() {
47         return "{\n" +
48                 "  \"vnf-id\": \"vnf-id-3\",\n" +
49                 "  \"vnf-name\": \"zhvf6nf-code-110\",\n" +
50                 "  \"vnf-type\": \"vnf-type\",\n" +
51                 "  \"prov-status\": \"NVTPROV\",\n" +
52                 "  \"operational-status\": \"out-of-service-path\",\n" +
53                 "  \"equipment-role\": \"nf-role-1\",\n" +
54                 "  \"in-maint\": false,\n" +
55                 "  \"is-closed-loop-disabled\": false,\n" +
56                 "  \"resource-version\": \"1524162037142\",\n" +
57                 "  \"model-invariant-id\": \"inv-id-5000\",\n" +
58                 "  \"model-version-id\": \"ver-id-5000\",\n" +
59                 "  \"model-customization-id\": \"vnf-customization-uuid-1\",\n" +
60                 "  \"selflink\": \"restconf/config/GENERIC-RESOURCE-API:services/service/bgb-instance-2/service-data/vnfs/vnf/vnf-id-3/vnf-data/vnf-topology\",\n" +
61                 "  \"relationship-list\": {\n" +
62                 "    \"relationship\": [\n" +
63                 "      {\n" +
64                 "        \"related-to\": \"instance-group\",\n" +
65                 "        \"relationship-label\": \"org.onap.relationships.inventory.MemberOf\",\n" +
66                 "        \"related-link\": \"/aai/v13/network/instance-groups/instance-group/bgb-net-inst-group-1\",\n" +
67                 "        \"relationship-data\": [\n" +
68                 "          {\n" +
69                 "            \"relationship-key\": \"instance-group.id\",\n" +
70                 "            \"relationship-value\": \"bgb-net-inst-group-1\"\n" +
71                 "          }\n" +
72                 "        ],\n" +
73                 "        \"related-to-property\": [\n" +
74                 "          {\n" +
75                 "            \"property-key\": \"instance-group.description\",\n" +
76                 "            \"property-value\": \"test\"\n" +
77                 "          },\n" +
78                 "          {\n" +
79                 "            \"property-key\": \"instance-group.instance-group-name\",\n" +
80                 "            \"property-value\": \"instance group name\"\n" +
81                 "          }\n" +
82                 "        ]\n" +
83                 "      },\n" +
84                 "      {\n" +
85                 "        \"related-to\": \"instance-group\",\n" +
86                 "        \"relationship-label\": \"org.onap.relationships.inventory.MemberOf\",\n" +
87                 "        \"related-link\": \"/aai/v13/network/instance-groups/instance-group/bgb-net-inst-group-2\",\n" +
88                 "        \"relationship-data\": [\n" +
89                 "          {\n" +
90                 "            \"relationship-key\": \"instance-group.id\",\n" +
91                 "            \"relationship-value\": \"bgb-net-inst-group-2\"\n" +
92                 "          }\n" +
93                 "        ],\n" +
94                 "        \"related-to-property\": [\n" +
95                 "          {\n" +
96                 "            \"property-key\": \"instance-group.description\",\n" +
97                 "            \"property-value\": \"test\"\n" +
98                 "          },\n" +
99                 "          {\n" +
100                 "            \"property-key\": \"instance-group.instance-group-name\",\n" +
101                 "            \"property-value\": \"instance group name\"\n" +
102                 "          }\n" +
103                 "        ]\n" +
104                 "      },\n" +
105                 "      {\n" +
106                 "        \"related-to\": \"availability-zone\",\n" +
107                 "        \"relationship-label\": \"org.onap.relationships.inventory.Uses\",\n" +
108                 "        \"related-link\": \"/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/irma-aic/hvf6/availability-zones/availability-zone/AZ-MN02\",\n" +
109                 "        \"relationship-data\": [\n" +
110                 "          {\n" +
111                 "            \"relationship-key\": \"cloud-region.cloud-owner\",\n" +
112                 "            \"relationship-value\": \"irma-aic\"\n" +
113                 "          },\n" +
114                 "          {\n" +
115                 "            \"relationship-key\": \"cloud-region.cloud-region-id\",\n" +
116                 "            \"relationship-value\": \"hvf6\"\n" +
117                 "          },\n" +
118                 "          {\n" +
119                 "            \"relationship-key\": \"availability-zone.availability-zone-name\",\n" +
120                 "            \"relationship-value\": \"AZ-MN02\"\n" +
121                 "          }\n" +
122                 "        ]\n" +
123                 "      }\n" +
124                 "    ]\n" +
125                 "  }\n" +
126                 "}";
127     }
128 }