Dimitrios Mavrommatis | a9df596 | 2017-12-05 15:11:04 -0800 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | |
| 3 | if [ "$#" -eq 2 ]; then |
| 4 | echo "" |
| 5 | json='{ |
| 6 | "input": { |
| 7 | "op-id": "3", |
| 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 |
| 27 | else |
| 28 | echo "usage: "$0" type contextId" |
| 29 | fi |