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

ValueError: API resource location is not registered #289

Closed
rilooth opened this issue Oct 31, 2019 · 3 comments
Closed

ValueError: API resource location is not registered #289

rilooth opened this issue Oct 31, 2019 · 3 comments
Assignees
Labels

Comments

@rilooth
Copy link

rilooth commented Oct 31, 2019

I want to extract users list from azure devOps using but an error appears:

ValueError: API resource location 229a6a53-b428-4ffb-a835-e8f36b5b4b1e is not registered on https://vssps.dev.azure.com/(my Organization).

I have already tried to extract the projects list and extracting descriptors for the specific user so connection is ok.

here is my code:

from azure.devops.connection import Connection
from msrest.authentication import BasicAuthentication


personal_access_token = 'my personal access token'
organization_url = 'https://dev.azure.com/(my Organization)'

credentials = BasicAuthentication('', personal_access_token)
connection = Connection(base_url=organization_url, creds=credentials)

accounts_client = connection.clients_v5_1.get_accounts_client()
get_acc = accounts_client.get_accounts()

for acc in get_acc:
    print(acc)

I need to get information about the last access and date created account so maybe another way?

tedchamb added a commit that referenced this issue Nov 1, 2019
@tedchamb
Copy link
Member

tedchamb commented Nov 1, 2019

Fixed in #292

Test code:

credentials = BasicAuthentication('', personal_access_token)
connection = Connection(base_url=organization_url, creds=credentials)

location_client = connection.clients_v5_1.get_location_client()
connection_data = location_client.get_connection_data()

accounts_client = connection.clients_v5_1.get_accounts_client()
get_acc = accounts_client.get_accounts(member_id=connection_data.authenticated_user.id)

for acc in get_acc:
    print(acc)

@tedchamb tedchamb added the bug label Nov 1, 2019
@tedchamb tedchamb self-assigned this Nov 1, 2019
@tedchamb
Copy link
Member

tedchamb commented Nov 1, 2019

@rilooth thanks for reporting this issue. On a side note, you mention trying to get a list of users. The accounts clients deals with organizations rather than individual users. You may want to look into the Graph APIs.

tedchamb added a commit that referenced this issue Nov 1, 2019
Fix for issue #289 - check for location at deployment level if it does not exist at the organization level.
@tedchamb
Copy link
Member

tedchamb commented Nov 1, 2019

@tedchamb tedchamb closed this as completed Nov 1, 2019
pull bot pushed a commit to tooniez/azure-devops-python-api that referenced this issue Jul 27, 2024
…if it does not exist at the organization level.
pull bot pushed a commit to tooniez/azure-devops-python-api that referenced this issue Jul 27, 2024
Fix for issue microsoft#289 - check for location at deployment level if it does not exist at the organization level.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants