Bond-async returning error

I’m using:

with Python 3.9.2 (on a linux system)

I ran the Library Usage example program and received the following. Is there a compatibility issue?

Thanks.

Version:
{‘target’: ‘zermatt’, ‘fw_ver’: ‘v3.8.4’, ‘fw_date’: ‘Thu Nov 10 15:16:25 UTC 2022’, ‘uptime_s’: 12343, ‘make’: ‘Olibra’, ‘model’: ‘BD-1000’, ‘branding_profile’: ‘OLIBRA_BD1000’, ‘bondid’: ‘ZZFxxxx’, ‘upgrade_http’: True, ‘api’: 2, ‘_’: ‘xxx’, ‘__’: ‘xxx’}
Device IDs:
Client response error: 401, message=‘Unauthorized’, url=URL(‘http://192.168.1.209/v2/devices’)

Hey @tfcbbond

I’m not sure how this works, but it looks like there is some problem with your authorization.
I tested it over here and I can perform a GET to the version endpoint with an invalid Token, but can’t do it on the devices endpoint.

Can you double-check your Bond Token? If that doesn’t fix it, I can check with @marcio next week (he’s out this week).

Thank you!

Ah, it wasn’t a token issue but rather how I entered the IP address and token.

The sample code includes the line:

bond = Bond(“[your ip or hostname here]”, “[your bond API token here]”)

Not being a Python programmer I simply assumed (bad idea) that the IP address and token were to be inserted between the symbols (as I recall that is a list in Python…could be very wrong). So the solution is quite simple:

bond = Bond(“your ip or hostname here”, “your bond API token here”)

The above works just fine for me.

Thanks.

2 Likes