Skip to content

Return Continuation Token in response #152

Closed

Description

@eyalag

The continuation token cannot be retrieved from the response- which means that one cannot know if he got all the data.

Activity

  1. tedchamb commented on Jan 2, 2019

    @tedchamb
    Member

    Our http client code generator does not support this feature yet. We will get to it soon.

  2. tedchamb commented on Jan 3, 2019

    @tedchamb
    Member

    eyalag ,
    The general issue should have been addressed in 0.1.21. Which version are you using? Also what method is not working?

    Thanks,
    Ted

  3. tedchamb commented on Jan 10, 2019

    @tedchamb
    Member

    eyalag , i am going to close this for now. If you are still having issues on version 0.1.21+, let me know and I will reopen this. Also let us know which method is not working for you.

  4. phclark commented on Mar 14, 2019

    @phclark

    I'm having issues on version 1.22. Please reopen this ticket, as this bug makes retrieving large lists impossible.

  5. tedchamb commented on Mar 14, 2019

    @tedchamb
    Member

    Philip Clark (@phclark) Can you provide more details? Which method are you having problems with?

  6. phclark commented on Mar 14, 2019

    @phclark

    Sure, a basic example of what I'm trying to do:

    build_client = azure_devops_connection.clients.get_build_client()
    builds = build_client.get_builds(project='Apps', top=500)
    print(type(builds)) # Returns list
    for b in builds:
        print(b) # Prints raw builds
    

    There seems to be no way of retrieving a continuation token, which is returned as expected from the equivalent REST API call.

  7. tedchamb commented on Mar 14, 2019

    @tedchamb
    Member

    Thank you. The client code generator needs to be updated to fix this method.

  8. RolfJordi commented on Mar 18, 2019

    @RolfJordi

    i have the same issue with the method get_projects from core client. There is no way to retrieve the continuation token.

    core_client = azure_devops_connection.clients.get_core_client()
    projects = core_client.get_projects(top=10)
    print(type(projects)) # Returns list
    for p in projects:
        print(p) # Prints raw project
    
  9. phclark commented on Mar 18, 2019

    @phclark

    Interestingly, I'm also having issues with getting continuationTokens to work when using the raw REST API. When I make a GET request like,

    https://{workspace}.visualstudio.com/{project}/_apis/build/builds?%top=100&api-version=5.0

    The token, returned in the header field x-ms-continuationtoken does not vary when the returned continuationToken is included in the next request.
    Has anyone else experienced this?

  10. tedchamb commented on Mar 19, 2019

    @tedchamb
    Member

    Philip Clark (@phclark) Can you try the $top instead of %top, and see if you get the behavior you are expecting.

    https://{workspace}.visualstudio.com/{project}/_apis/build/builds?$top=100&api-version=5.0

  11. phclark commented on Mar 19, 2019

    @phclark

    Sorry, that was a typo. I am using $top.
    For example, the subsequent calls, with urlencode, resolve to
    .../_apis/build/builds?%24top=1000&continuationtoken=2017-12-05T20%3A35%3A46.9163266Z&api-version=5.0

  12. tedchamb commented on Aug 7, 2019

    @tedchamb
    Member

    Duplicate to https://github.com/MicrosoftDocs/vsts-rest-api-specs/issues/178, which sounds like it has been fixed in the service.

  13. tedchamb commented on Aug 7, 2019

    @tedchamb
    Member

    reopening for the broader ContinuatuonToken issue, which should be fixed soon.

  14. tedchamb commented on Aug 12, 2019

    @tedchamb
    Member

    Fixed in #258
    https://github.com/microsoft/azure-devops-python-api/releases/tag/5.1.0b3

    Continuation Token example:

    get_builds_response = build_client.get_builds(project=project_name)
    index = 0
    while get_builds_response is not None:
        for build in get_builds_response.value:
            pprint.pprint("[" + str(index) + "] " + build.build_number)
            index += 1
        if get_builds_response.continuation_token is not None and get_builds_response.continuation_token != "":
            get_builds_response = build_client.get_builds(project=project_name, continuation_token=get_builds_response.continuation_token)
        else:
            get_builds_response = None
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions