1 __author__ = "Jan Medved"
2 __copyright__ = "Copyright(c) 2014, Cisco Systems, Inc."
3 __license__ = "New-style BSD"
4 __email__ = "jmedved@cisco.com"
11 CONFIGURL = 'restconf/config/opendaylight-inventory:nodes'
12 getheaders = {'Accept': 'application/json'}
15 if __name__ == "__main__":
17 parser = argparse.ArgumentParser(description='Cleans up the config space')
18 parser.add_argument('--odlhost', default='127.0.0.1', help='host where '
19 'odl controller is running (default is 127.0.0.1)')
20 parser.add_argument('--odlport', default='8080', help='port on '
21 'which odl\'s RESTCONF is listening (default is 8080)')
23 in_args = parser.parse_args()
25 url = 'http://' + in_args.odlhost + ":" + in_args.odlport + '/' + CONFIGURL
26 s = requests.Session()
27 r = s.delete(url, headers=getheaders)
29 if r.status_code != 200:
30 print 'Failed to delete nodes in the config space, code %d' % r.status_code
32 print 'Nodes in config space deleted.'