update MSO configuration URL
[vid.git] / vid-automation / src / main / java / org / onap / simulator / presetGenerator / presets / mso / configuration / PresetMsoEnableDisablePort.java
1 package org.onap.simulator.presetGenerator.presets.mso.configuration;
2
3 import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId;
4 import org.onap.simulator.presetGenerator.presets.mso.PresetMSOBaseCreateInstancePost;
5 import org.springframework.http.HttpMethod;
6
7 public class PresetMsoEnableDisablePort extends PresetMSOBaseCreateInstancePost {
8
9     private final String serviceInstanceId;
10     private final String configurationId;
11     private final String action;
12
13
14     public PresetMsoEnableDisablePort(String serviceInstanceId, String configurationId, String action) {
15         super("314cc766-b673-4a50-b9c5-471f68914585", serviceInstanceId);
16         this.serviceInstanceId = serviceInstanceId;
17         this.configurationId = configurationId;
18         this.action = action;
19         this.cloudOwner = PresetAAIGetCloudOwnersByCloudRegionId.ATT_NC;
20     }
21
22     @Override
23     public HttpMethod getReqMethod() {
24         return HttpMethod.POST;
25     }
26
27     @Override
28     public String getReqPath() {
29         return getRootPath() + "/serviceInstantiation/v./serviceInstances/"+serviceInstanceId+"/configurations/"+configurationId+"/" + action;
30     }
31
32     @Override
33     public Object getRequestBody() {
34         return "{" +
35                 "      \"requestDetails\": {" +
36                 "        \"cloudConfiguration\": {" +
37                             addCloudOwnerIfNeeded() +
38                 "          \"lcpCloudRegionId\": \"mdt1\"" +
39                 "        }," +
40                 "        \"modelInfo\": {" +
41                 "          \"modelCustomizationId\": \"08a181aa-72eb-435f-9593-e88a3ad0a86b\"," +
42                 "          \"modelInvariantId\": \"model-invariant-id-9533\"," +
43                 "          \"modelVersionId\": \"model-version-id-9533\"," +
44                 "          \"modelType\": \"configuration\"" +
45                 "        }," +
46                 "        \"requestInfo\": {" +
47                 "          \"source\": \"VID\"," +
48                 "          \"requestorId\": \"us16807000\"" +
49                 "        }," +
50                 "        \"relatedInstanceList\": [" +
51                 "          {" +
52                 "            \"relatedInstance\": {" +
53                 "              \"instanceId\": \""+serviceInstanceId+"\"," +
54                 "              \"modelInfo\": {" +
55                 "                \"modelType\": \"service\"," +
56                 "                \"modelInvariantId\": \"b7d923c9-6175-41f1-91ba-4565c4953408\"," +
57                 "                \"modelName\": \"ServiceContainerMultiplepProbes\"," +
58                 "                \"modelVersionId\": \"ee6d61be-4841-4f98-8f23-5de9da846ca7\"," +
59                 "                \"modelVersion\": \"1.0\"" +
60                 "              }" +
61                 "            }" +
62                 "          }," +
63                 "          {" +
64                 "            \"relatedInstance\": {" +
65                 "              \"instanceId\": \"d35bf534-7d8e-4cb4-87f9-0a8bb6cd47b2\"," +
66                 "              \"instanceDirection\": \"source\"," +
67                 "              \"modelInfo\": {" +
68                 "                \"modelType\": \"connectionPoint\"" +
69                 "              }" +
70                 "            }" +
71                 "          }" +
72                 "        ]" +
73                 "      }" +
74                 "    }";
75     }
76 }