aboutsummaryrefslogtreecommitdiffstats
path: root/vid-automation/src/main/java/org/onap/simulator/presetGenerator/presets/mso/changeManagement/PresetMsoVnfUpdate.java
blob: dee51600571f0b9eebc3011907de503d32b17435 (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
package org.onap.simulator.presetGenerator.presets.mso.changeManagement;

import org.onap.simulator.presetGenerator.presets.aai.PresetAAIGetCloudOwnersByCloudRegionId;
import org.springframework.http.HttpMethod;

public class PresetMsoVnfUpdate extends PresetMsoChangeManagementBase {


    public PresetMsoVnfUpdate(String serviceInstanceId, String vnfInstanceId) {
        super(serviceInstanceId, vnfInstanceId, "");
        this.cloudOwner = PresetAAIGetCloudOwnersByCloudRegionId.ATT_NC;
    }

    @Override
    public HttpMethod getReqMethod() {
        return HttpMethod.PUT;
    }

    @Override
    public String getReqPath() {
        return getRootPath() + "/serviceInstantiation/v./serviceInstances/" + serviceInstanceId + "/vnfs/" + vnfInstanceId;
    }

    @Override
    public Object getRequestBody() {
        return "{" +
                "  \"requestDetails\": {" +
                "   \"modelInfo\": {" +
                "      \"modelType\": \"vnf\"," +
                "      \"modelInvariantId\": \"ff5256d1-5a33-55df-13ab-12abad84e7ff\"," +
                "      \"modelVersionId\": \"254583ad-b38c-498b-bdbd-b8de5e07541b\"," +
                "      \"modelName\": \"vSAMP12\"," +
                "      \"modelVersion\": \"2.0\"," +
                // TODO Ask ZITELLA, MICHAEL V if the field is mandatory. Vid currently not send it
                //"      \"modelCustomizationName\": \"vSAMP12 1\"," +
                "      \"modelCustomizationId\": \"c539433a-84a6-4082-a12e-5c9b00c3b960\"" +
                "    }," +
                "    \"cloudConfiguration\": {" +
                "      \"lcpCloudRegionId\": \"mdt1\"," +
                        addCloudOwnerIfNeeded() +
                "      \"tenantId\": \"88a6ca3ee0394ade9403f075db23167e\"" +
                "    }," +
                "    \"requestInfo\": {" +
                "      \"source\": \"VID\"," +
                "      \"suppressRollback\": false," +
                "      \"requestorId\": \"az2016\"" +
                "    }," +
                "    \"relatedInstanceList\": [" +
                "      {" +
                "        \"relatedInstance\": {" +
                "          \"instanceId\": \""+serviceInstanceId+"\"," +
                "          \"modelInfo\": {" +
                "            \"modelType\": \"service\"," +
                "            \"modelInvariantId\": \"ff3514e3-5a33-55df-13ab-12abad84e7ff\"," +
                "            \"modelVersionId\": \"9ebb1521-2e74-47a4-aac7-e71a79f73a79\"," +
                "            \"modelName\": \"fakeModelName\"," +
                "            \"modelVersion\": \"2.0\"" +
                "          }" +
                "        }" +
                "      }" +
                "    ]," +
                "    \"requestParameters\": {" +
                "      \"usePreload\": true" +
                "    }" +
                "}}";
    }
}