blackducksoftware / hub-rest-api-python

HUB REST API Python bindings
Apache License 2.0
89 stars 104 forks source link

Get users using new client is not working #243

Closed Ripurwar80 closed 1 year ago

Ripurwar80 commented 1 year ago

Hey guys, I'm trying to use the Blackduck client to fetch the project name and users.

for user in bd.get_resource("users"):
    print(f"User: {user['userName']}, First Name: {user['firstName']}, Last Name: {user['lastName']}")

it's working fine with the projects but while fetching the users it’s giving an error. "KeyError: "resource name 'users' not found in available resources"

Can someone please help on this

OffBy0x01 commented 1 year ago

Double check you have access to it, I've just tested exactly as above and it worked.

When you get that KeyError it should also show you what resources you have access to, if not you can manually query it with the following:

for resource in bd.list_resource():
  print(resource)