aboutsummaryrefslogtreecommitdiffstats
path: root/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/PresetMSOCreateVnfALaCarteOldViewEdit.java
blob: 7947c5b83c1d78c61b14ddbdd0bc67e8c5453bad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package org.onap.simulator.presetGenerator.presets.mso;

public class PresetMSOCreateVnfALaCarteOldViewEdit extends PresetMSOCreateVnfBase {
    private String vnfInstanceName;
    private boolean haveLOB;

    public PresetMSOCreateVnfALaCarteOldViewEdit(String overrideRequestId, String serviceInstanceId,
                                                 String vnfInstanceName, boolean haveLOB, String msoTestApi) {
        super(overrideRequestId, serviceInstanceId);
        this.vnfInstanceName = vnfInstanceName;
        this.haveLOB = haveLOB;
        this.msoTestApi = msoTestApi;
        this.withTestApi = true;
    }

    @Override
    public Object getRequestBody() {
        return  "{" +
                "      \"requestDetails\": {" +
                "        \"requestInfo\": {" +
                "          \"instanceName\": \""+vnfInstanceName+"\"," +
                "          \"source\": \"VID\"," +
                "          \"suppressRollback\": false," +
                "          \"requestorId\": \"mo37915000\"," +
                "          \"productFamilyId\": \"ebc3bc3d-62fd-4a3f-a037-f619df4ff034\"" +
                "        }," +
                "        \"modelInfo\": {" +
                "          \"modelType\": \"vnf\"," +
                "          \"modelInvariantId\": \"e7961100-cde6-4b5a-bcda-b8945086950a\"," +
                "          \"modelVersionId\": \"959a7ba0-89ee-4984-9af6-65d5bdda4b0e\"," +
                "          \"modelName\": \"VSP1710PID298109_vWINIFRED\"," +
                "          \"modelVersion\": \"1.0\"," +
                "          \"modelCustomizationId\": \"6b8fc7dc-2db1-4283-a222-b07d10595495\"," +
                "          \"modelCustomizationName\": \"VSP1710PID298109_vWINIFRED 0\"" +
                "        }," +
                "        \"requestParameters\": {" +
                addTestApi() +
                "          \"userParams\": []" +
                "        }," +
                "        \"cloudConfiguration\": {" +
                "          \"lcpCloudRegionId\": \"some legacy region\"," +
                           addCloudOwnerIfNeeded() +
                "          \"tenantId\": \"092eb9e8e4b7412e8787dd091bc58e86\"" +
                "        }," +
                selectLob("\"lineOfBusiness\": {\"lineOfBusinessName\": \"ECOMP\"},", "") +
                "        \"platform\": {" +
                "          \"platformName\": \"platform\"" +
                "        }," +
                "        \"relatedInstanceList\": [{" +
                "          \"relatedInstance\": {" +
                "            \"instanceId\": \""+serviceInstanceId+"\"," +
                "            \"modelInfo\": {" +
                "              \"modelType\": \"service\"," +
                "              \"modelName\": \"ServicevWINIFREDPID298109\"," +
                "              \"modelInvariantId\": \"a8dcd72d-d44d-44f2-aa85-53aa9ca0c657\"," +
                "              \"modelVersion\": \"1.0\"," +
                "              \"modelVersionId\": \"aa2f8e9c-9e47-4b15-a95c-4a93855ac61b\"" +
                "            }" +
                "          }" +
                "        }" +
                "        ]" +
                "      }"+
                "}";
    }

    private String selectLob(String lob, String noLob) {
        return haveLOB ? lob : noLob;
    }
}