Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getting exceptions.KeyError: 'changeto' on API call /api/partition?changeTo=2 #22

Open
unixgeex opened this issue Sep 26, 2017 · 2 comments

Comments

@unixgeex
Copy link

Hi,

I am trying to use the API call to change the partition as documented :
http://ip_address:8111/api/partition?changeTo=2

And I am getting that:

web.Server Traceback (most recent call last): exceptions.KeyError: 'changeto' /usr/lib/python2.7/dist-packages/twisted/web/server.py:189 in process 188 self._encoder = encoder 189 self.render(resrc) 190 except: /usr/lib/python2.7/dist-packages/twisted/web/server.py:238 in render 237 try: 238 body = resrc.render(self) 239 except UnsupportedMethod as e: /usr/lib/python2.7/dist-packages/twisted/web/resource.py:250 in render 249 raise UnsupportedMethod(allowedMethods) 250 return m(request) 251 ./alarmserver.py:702 in render_GET 701 elif myPath == '/api/partition': 702 changeTo = query_array['changeto'][0] 703 if not changeTo.isdigit(): exceptions.KeyError: 'changeto'

Everything else works perfectly... please help.
thanks
David

@unixgeex
Copy link
Author

seems to work better with lowercase :
http://ip_address:8111/api/partition?changeto=2
received:
{"response": "Request to change current partition to 2 was received."}
but the subsequent calls to /api does not take effect on partition 2, but keeps on returning information for partition1 ... any idea ?
I need to access partition 2 because I have a device in zone 17.

many thanks in advance!
David

@unixgeex
Copy link
Author

I just figured out the the alarmserver.cfg file add only zone[1-16] defined... I added definition for zone[17-32], restarted alaserver process, voilà!
I get status from zone 17 now, no need to change partition... =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant