blob: b5a351a5b49901b9c20ec9becc889b84ee0d8df8 [file] [log] [blame]
Dimitrios Mavrommatisa9df5962017-12-05 15:11:04 -08001#!/bin/bash
2
Dimitrios Mavrommatise1f23ac2017-12-05 22:59:41 -08003if [ "$#" -eq 2 ] && [ $1 == "delete" ]; then
4 echo ""
5 json='{
6 "input": {
7 "op-id": '$2',
8 "targets": [
9 {
10 "target": "/ietf-dmm-fpcagent:tenants/tenant=default/fpc-mobility/contexts='$2'"
11 }
12 ],
13 "client-id": "1",
14 "session-state": "complete",
15 "admin-state": "enabled",
16 "op-type": "'$1'",
17 "op-ref-scope": "none"
18 }
19 }'
20
21 curl -X POST \
22 --header 'Content-Type: application/json' \
23 -u onos:rocks \
24 --header 'Accept: application/json' \
25 -d "$json" \
26 'http://localhost:8181/onos/restconf/operations/ietf-dmm-fpcagent:configure' | python -m json.tool
27elif [ "$#" -eq 3 ] && [ $1 == "create" ]; then
Dimitrios Mavrommatisa9df5962017-12-05 15:11:04 -080028 echo ""
29 json='{
30 "input": {
31 "admin-state": "enabled",
32 "client-id": "1",
33 "contexts": [
34 {
35 "context-id": '$2',
36 "delegating-ip-prefixes": [
37 "192.168.1.5/32"
38 ],
39 "dl": {
40 "dpn-parameters": {},
41 "mobility-tunnel-parameters": {
42 "tunnel-identifier": "2222",
43 "tunnel-type": "gtpv1"
44 },
45 "tunnel-local-address": "192.168.1.1",
46 "tunnel-remote-address": "10.1.1.1"
47 },
48 "dpn-group": "foo",
49 "dpns": [
50 {
51 "direction": "uplink",
52 "dpn-id": '$3',
53 "dpn-parameters": {}
54 }
55 ],
56 "ebi": "5",
57 "imsi": "9135551234",
58 "instructions": {
59 "instr-3gpp-mob": "session uplink"
60 },
61 "lbi": "5",
62 "ul": {
63 "dpn-parameters": {},
64 "mobility-tunnel-parameters": {
65 "tunnel-identifier": "1111",
66 "tunnel-type": "gtpv1"
67 },
68 "tunnel-local-address": "192.168.1.1",
69 "tunnel-remote-address": "10.1.1.1"
70 }
71 }
72 ],
Dimitrios Mavrommatise1f23ac2017-12-05 22:59:41 -080073 "op-id": '$2',
Dimitrios Mavrommatisa9df5962017-12-05 15:11:04 -080074 "op-ref-scope": "op",
75 "op-type": "'$1'",
76 "session-state": "complete"
77 }
78 }'
79
80 curl -X POST \
81 --header 'Content-Type: application/json' \
82 -u onos:rocks \
83 --header 'Accept: application/json' \
84 -d "$json" \
85 'http://localhost:8181/onos/restconf/operations/ietf-dmm-fpcagent:configure' | python -m json.tool
86 echo ""
87else
Dimitrios Mavrommatis7c0ff012017-12-07 00:25:58 -080088 echo "usage: "$0" type (create/delete) contextId (dpnId)"
Dimitrios Mavrommatisa9df5962017-12-05 15:11:04 -080089fi