Add script for Change Management
[demo.git] / vnfs / vCPE / scripts / inPlaceSoftwareUpgrade_vGW.sh
1 root@onap-so:~# cat /root/inPlaceSoftwareUpgrade_vGW.sh
2 #!/bin/bash
3
4 tmp=/tmp/send$$
5 trap "rm -f $tmp.*; exit 1" 0 1 2 15
6
7 user="InfraPortalClient:password1$"
8 serviceInstance="a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb"
9 vnf="1ae8197f-8496-41e1-9695-dce9fd77315a"
10 apiVer=v6
11
12 url="http://localhost:8080/ecomp/mso/infra/serviceInstances/$apiVer/$serviceInstance/vnfs/$vnf/inPlaceSoftwareUpdate"
13
14 (
15 cat << 'XEOF'
16 {
17   "requestDetails": {
18     "requestInfo": {
19       "source": "VID",
20       "suppressRollback": false,
21       "requestorId": "ek1439"
22     },
23     "cloudConfiguration": {
24       "tenantId": "d570c718cbc545029f40e50b75eb13df",
25       "lcpCloudRegionId": "RegionOne"
26     },
27     "requestParameters": {
28       "payload": "{\"existing-software-version\": \"3.1\",\"new-software-version\": \"3.2\", \"operations-timeout\": \"3600\"}",
29       "controllerType": "sdnc"
30     }
31   },
32   "serviceInstanceId": "$serviceInstance",
33   "vnfInstanceId": "$vnf"
34 }
35
36 XEOF
37 ) > $tmp.content || exit 1
38
39 # Enabling debug logging for API-Handler-Infra . . .
40 curl -o /dev/null -w '%{http_code}' --user 'MSOClient:password1$' 'http://mso:8080/ecomp/mso/infra/logging/debug?enable=true'
41
42 # Enabling debug logging for BPMN . . .
43 curl -o /dev/null -w '%{http_code}' 'http://mso:8080/mso/logging/debug?enable=true'
44
45 # Enabling debug logging for SDNC-Adapter . . .
46 curl -o /dev/null -w '%{http_code}' --user 'MSOClient:password1$' 'http://mso:8080/adapters/rest/logging/debug?enable=true'
47
48 # Send the request
49 curl -v -X POST -d @$tmp.content --user "$user" "$url" --header "Content-Type:application/json"