update MSO configuration URL
[vid.git] / vid-automation / src / main / java / org / onap / simulator / presetGenerator / presets / mso / configuration / PresetMSOCreateConfiguration.java
1 package org.onap.simulator.presetGenerator.presets.mso.configuration;
2
3 import org.onap.simulator.presetGenerator.presets.mso.PresetMSOBaseCreateInstancePost;
4
5 public class PresetMSOCreateConfiguration extends PresetMSOBaseCreateInstancePost {
6
7     protected final String serviceInstanceId;
8     protected final boolean isError;
9     private final int errorCode;
10     private final String errorPayload;
11
12     public PresetMSOCreateConfiguration(String serviceInstanceId) {
13         super("b6dc9806-b094-42f7-9386-a48de8218ce8", "f36f5734-e9df-4fbf-9f35-61be13f028a1");
14         this.serviceInstanceId = serviceInstanceId;
15         this.cloudOwner = "irma-aic";
16         this.isError = false;
17         this.errorCode = 0;
18         this.errorPayload = null;
19     }
20
21     public PresetMSOCreateConfiguration(String serviceInstanceId, int errorCode, String errorPayload) {
22         super("b6dc9806-b094-42f7-9386-a48de8218ce8", "f36f5734-e9df-4fbf-9f35-61be13f028a1");
23         this.serviceInstanceId = serviceInstanceId;
24         this.cloudOwner = "irma-aic";
25         this.isError = true;
26         this.errorCode = errorCode;
27         this.errorPayload = errorPayload;
28     }
29
30     @Override
31     public boolean isStrictMatch() {
32         return true;
33     }
34
35     @Override
36     public int getResponseCode() {
37         return isError ? errorCode : super.getResponseCode();
38     }
39
40     @Override
41     public Object getResponseBody() {
42         return isError ? errorPayload : super.getResponseBody();
43     }
44
45     @Override
46     public String getReqPath() {
47         return getRootPath() + "/serviceInstantiation/v./serviceInstances/" + this.serviceInstanceId + "/configurations";
48     }
49
50     @Override
51     public Object getRequestBody() {
52         return "" +
53                 "{" +
54                 " \"requestDetails\": {" +
55                 "    \"modelInfo\": {" +
56                 "      \"modelType\": \"configuration\"," +
57                 "      \"modelInvariantId\": \"c30a024e-a6c6-4670-b73c-3df64eb57ff6\"," +
58                 "      \"modelVersionId\": \"f58d039d-4cfc-40ec-bd75-1f05f0458a6c\"," +
59                 "      \"modelName\": \"Port Mirroring Configuration By Policy\"," +
60                 "      \"modelVersion\": \"1.0\"," +
61                 "      \"modelCustomizationId\": \"4b7ebace-bad6-4526-9be6-bf248e20fc5f\"," +
62                 "      \"modelCustomizationName\": \"Port Mirroring Configuration By Policy 1\"" +
63                 "    }," +
64                 "    \"cloudConfiguration\": {" +
65                 addCloudOwnerIfNeeded() +
66                 "      \"lcpCloudRegionId\": \"AAIAIC25\"" +
67                 "    }," +
68                 "    \"requestInfo\": {" +
69                 "      \"instanceName\": \"dummy_instance\"," +
70                 "      \"source\": \"VID\"," +
71                 "      \"requestorId\": \"us16807000\"" +
72                 "    }," +
73                 "    \"relatedInstanceList\": [" +
74                 "      {" +
75                 "        \"relatedInstance\": {" +
76                 "          \"instanceId\": \"c187e9fe-40c3-4862-b73e-84ff056205f6\"," +
77                 "          \"modelInfo\": {" +
78                 "            \"modelType\": \"service\"," +
79                 "            \"modelInvariantId\": \"b7d923c9-6175-41f1-91ba-4565c4953408\"," +
80                 "            \"modelVersionId\": \"ee6d61be-4841-4f98-8f23-5de9da846ca7\"," +
81                 "            \"modelName\": \"ServiceContainerMultiplepProbes\"," +
82                 "            \"modelVersion\": \"1.0\"" +
83                 "          }" +
84                 "        }" +
85                 "      }," +
86                 "      {" +
87                 "        \"relatedInstance\": {" +
88                 "          \"instanceId\": \"9be14a4f-7367-4cf9-96a1-f08f10f485a7\"," +
89                 "          \"instanceDirection\": \"source\"," +
90                 "          \"modelInfo\": {" +
91                 "            \"modelType\": \"vnf\"," +
92                 "            \"modelInvariantId\": \"51f2c559-1aba-4fd4-bbf9-8cbbef85ff2a\"," +
93                 "            \"modelVersionId\": \"cb05b259-9f26-4b33-b96c-13c2c202c091\"," +
94                 "            \"modelName\": \"vf_vEPDG\"," +
95                 "            \"modelVersion\": \"2.0\"," +
96                 "            \"modelCustomizationId\": \"35aeaae9-74f7-4b6a-adda-65edb0110361\"" +
97                 "          }" +
98                 "        }" +
99                 "      }," +
100                 "      {" +
101                 "        \"relatedInstance\": {" +
102                 "          \"instanceName\": \"AS-pnf2-10219--as988q\"," +
103                 "          \"instanceDirection\": \"destination\"," +
104                 "          \"modelInfo\": {" +
105                 "            \"modelType\": \"pnf\"" +
106                 "          }" +
107                 "        }" +
108                 "      }" +
109                 "    ]," +
110                 "    \"requestParameters\": {" +
111                 "      \"userParams\": []" +
112                 "    }" +
113                 "  }" +
114                 "}";
115     }
116
117 }