1 package org.onap.simulator.presetGenerator.presets.mso.configuration;
3 import org.onap.simulator.presetGenerator.presets.mso.PresetMSOBaseCreateInstancePost;
5 public class PresetMSOCreateConfiguration extends PresetMSOBaseCreateInstancePost {
7 protected final String serviceInstanceId;
8 protected final boolean isError;
9 private final int errorCode;
10 private final String errorPayload;
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";
18 this.errorPayload = null;
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";
26 this.errorCode = errorCode;
27 this.errorPayload = errorPayload;
31 public boolean isStrictMatch() {
36 public int getResponseCode() {
37 return isError ? errorCode : super.getResponseCode();
41 public Object getResponseBody() {
42 return isError ? errorPayload : super.getResponseBody();
46 public String getReqPath() {
47 return getRootPath() + "/serviceInstances/v./" + this.serviceInstanceId + "/configurations";
51 public Object getRequestBody() {
54 " \"requestDetails\": {" +
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\"" +
64 " \"cloudConfiguration\": {" +
65 addCloudOwnerIfNeeded() +
66 " \"lcpCloudRegionId\": \"JANET25\"" +
68 " \"requestInfo\": {" +
69 " \"instanceName\": \"dummy_instance\"," +
70 " \"source\": \"VID\"," +
71 " \"requestorId\": \"us16807000\"" +
73 " \"relatedInstanceList\": [" +
75 " \"relatedInstance\": {" +
76 " \"instanceId\": \"c187e9fe-40c3-4862-b73e-84ff056205f6\"," +
78 " \"modelType\": \"service\"," +
79 " \"modelInvariantId\": \"b7d923c9-6175-41f1-91ba-4565c4953408\"," +
80 " \"modelVersionId\": \"ee6d61be-4841-4f98-8f23-5de9da846ca7\"," +
81 " \"modelName\": \"ServiceContainerMultiplepProbes\"," +
82 " \"modelVersion\": \"1.0\"" +
87 " \"relatedInstance\": {" +
88 " \"instanceId\": \"9be14a4f-7367-4cf9-96a1-f08f10f485a7\"," +
89 " \"instanceDirection\": \"source\"," +
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\"" +
101 " \"relatedInstance\": {" +
102 " \"instanceName\": \"AS-pnf2-10219--as988q\"," +
103 " \"instanceDirection\": \"destination\"," +
104 " \"modelInfo\": {" +
105 " \"modelType\": \"pnf\"" +
110 " \"requestParameters\": {" +
111 " \"userParams\": []" +