blob: 5ce3bbef58f5356f74eace9cb60c09a2d0b69c29 [file] [log] [blame]
Dimitrios Mavrommatisa9df5962017-12-05 15:11:04 -08001#!/bin/bash
2
3if [ "$#" -eq 3 ]; then
4 echo ""
5 json='{
6 "input": {
7 "admin-state": "enabled",
8 "client-id": "1",
9 "contexts": [
10 {
11 "context-id": '$2',
12 "delegating-ip-prefixes": [
13 "192.168.1.5/32"
14 ],
15 "dl": {
16 "dpn-parameters": {},
17 "mobility-tunnel-parameters": {
18 "tunnel-identifier": "2222",
19 "tunnel-type": "gtpv1"
20 },
21 "tunnel-local-address": "192.168.1.1",
22 "tunnel-remote-address": "10.1.1.1"
23 },
24 "dpn-group": "foo",
25 "dpns": [
26 {
27 "direction": "uplink",
28 "dpn-id": '$3',
29 "dpn-parameters": {}
30 }
31 ],
32 "ebi": "5",
33 "imsi": "9135551234",
34 "instructions": {
35 "instr-3gpp-mob": "session uplink"
36 },
37 "lbi": "5",
38 "ul": {
39 "dpn-parameters": {},
40 "mobility-tunnel-parameters": {
41 "tunnel-identifier": "1111",
42 "tunnel-type": "gtpv1"
43 },
44 "tunnel-local-address": "192.168.1.1",
45 "tunnel-remote-address": "10.1.1.1"
46 }
47 }
48 ],
49 "op-id": "1",
50 "op-ref-scope": "op",
51 "op-type": "'$1'",
52 "session-state": "complete"
53 }
54 }'
55
56 curl -X POST \
57 --header 'Content-Type: application/json' \
58 -u onos:rocks \
59 --header 'Accept: application/json' \
60 -d "$json" \
61 'http://localhost:8181/onos/restconf/operations/ietf-dmm-fpcagent:configure' | python -m json.tool
62 echo ""
63else
64 echo "usage: "$0" type contextId dpnId"
65fi