Ray Milkey | a0f983b | 2016-06-23 19:39:55 -0700 | [diff] [blame] | 1 | #! /usr/bin/env python |
| 2 | |
| 3 | import requests |
| 4 | |
| 5 | from requests.auth import HTTPBasicAuth |
| 6 | import sys |
| 7 | |
| 8 | |
| 9 | |
| 10 | if len(sys.argv) != 3: |
| 11 | print "usage: delete-netcfg onos-node config-name" |
| 12 | sys.exit(1) |
| 13 | |
| 14 | node = sys.argv[1] |
| 15 | configName = sys.argv[2] |
| 16 | |
| 17 | intentRequest = requests.delete('http://' + node + ':8181/onos/v1/network/configuration/' + configName, |
| 18 | auth=HTTPBasicAuth('onos', 'rocks')) |
| 19 | |
| 20 | if intentRequest.status_code != 204: |
| 21 | print intentRequest.text |
| 22 | sys.exit(1) |
| 23 | |
| 24 | sys.exit(0) |
| 25 | |
| 26 | |
| 27 | |