diff options
author | Steve McIntyre <steve.mcintyre@linaro.org> | 2014-12-17 16:29:01 +0000 |
---|---|---|
committer | Steve McIntyre <steve.mcintyre@linaro.org> | 2014-12-17 16:29:01 +0000 |
commit | 5076715a68eec83f23dd7f68b0317954206e1968 (patch) | |
tree | b7d8b779177eb0230123a3af102433fed642deb2 | |
parent | c3b659b9a864b610a85c9872df6fdfda5cf13da6 (diff) |
Add vlan_update and vland_api calls
Change-Id: I4152360fe84b7d5746ef1e7a3f31b0b1e5f0f62e
-rw-r--r-- | vland.py | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -150,6 +150,30 @@ while True: print 'FOO?' pass + # Next, calls that may manipulate switch state *as well* as state + # in the database - changes to VLAN setup. + # + # As/when/if we add authentication, use of this function will need + # it. + if json_data['type'] == 'vlan_update': + response['type'] = 'response' + try: + response['data'] = util.perform_vlan_update(state, json_data['command'], json_data['data']) + response['response'] = 'ACK' + except InputError as e: + print e + response['response'] = 'ERROR' + response['error'] = e.__str__() + print 'FOO?' + pass + + # Finally, IPC interface for more complex API calls. + # NOT IMPLEMENTED YET + if json_data['type'] == 'vland_api': + response['type'] = 'response' + response['response'] = 'ERROR' + response['error'] = 'VLANd API not yet implemented...' + print "sending reply:" print response |