Skip to content

Loading…

Error when using API's nodebalancer_node_update() #4

Closed
asavoy opened this Issue · 1 comment

1 participant

@asavoy

I'm getting an error using linode-python to manipulate Linode's NodeBalancer API.
Even though support is not documented, it works with the list() functions, but throws an ApiError() when trying to use update(). It seems like an error is being sent from the API back-end. I've tried different parameters to no avail.

I don't suppose many people are using the nodebalancer API yet, so this ticket is more of a note to myself. Hopefully I'll get round to finding the cause on the weekend.

Here's a console log, which shows everything is fine until trying nodebalancer_node_update(). I've removed identifying information.

>>> from linode import api
>>> linode = api.Api('my_api_key')
>>> linode.test_echo(HELLO='world') # Test the connection
{u'HELLO': u'world'}

>>> linode.nodebalancer_list() # List my node balancers
[{u'ADDRESS4': u'12.34.56.78,
  u'ADDRESS6': u'ip6-goes-here',
  u'CLIENTCONNTHROTTLE': 0,
  u'HOSTNAME': u'nb-12-34-56-78.fremont.nodebalancer.linode.com',
  u'LABEL': u'nodebalancer_label',
  u'NODEBALANCERID': 123,
  u'STATUS': u'active'}]

>>> linode.nodebalancer_config_list(NODEBALANCERID=123) # Show config for nodebalancer #123
[{u'ALGORITHM': u'roundrobin',
  u'CHECK': u'http_body',
  u'CHECK_ATTEMPTS': 1,
  u'CHECK_BODY': u'OK',
  u'CHECK_INTERVAL': 15,
  u'CHECK_PATH': u'/check/path',
  u'CHECK_TIMEOUT': 5,
  u'CONFIGID': 321,
  u'NODEBALANCERID': 123,
  u'PORT': 80,
  u'PROTOCOL': u'http',
  u'STICKINESS': u'none'}]

>>> linode.nodebalancer_node_list(CONFIGID=321) # Show nodes in my config #321
[{u'ADDRESS': u'192.168.11.11:80',
  u'CONFIGID': 321,
  u'LABEL': u'web1',
  u'MODE': u'accept',
  u'NODEBALANCERID': 123,
  u'NODEID': 1111,
  u'STATUS': u'UP',
  u'WEIGHT': 100},
 {u'ADDRESS': u'192.168.22.22:80',
  u'CONFIGID': 321,
  u'LABEL': u'web2',
  u'MODE': u'accept',
  u'NODEBALANCERID': 123,
  u'NODEID': 2222,
  u'STATUS': u'UP',
  u'WEIGHT': 100}]

>>> linode.nodebalancer_node_update(NODEID=1111, MODE='drain') # Set node #1111 to drain mode
[{u'ERRORCODE': 500, u'ERRORMESSAGE': u"Something wasn't handled well. Logged."}]
@asavoy

Turned out to be an issue on Linode's side:

http://forum.linode.com/viewtopic.php?p=44068

@asavoy asavoy closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.