azure-sdk-for-go: Error on List function of Consumption Usagedetails
import path ‘services/consumption/mgmt/2018-03-31/consumption’
–pseudo code
List, err := usageClient.List(ctx, expand, filter, skipToken, &top, "")
if err != nil {
log.Println("Error In Getting Usage List : ")
log.Println(err.Error())
log.Println("")
break
}
getting this error after first iterations using next token. using top value as 1000
consumption.UsageDetailsClient#List: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="400" Message="id query parameter is not a valid Guid (Request ID: 80c46708-2afa-4d1a-b155-f1c692bd0fa6)"
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 22 (10 by maintainers)
So to summarize I think there are several issues here.
ListAPI taking just a skip token isn’t sufficient (you need to pass the ID and likely the skip token version as well).skiptokenvalue directly from the HTTP response object but it’s still not ideal).nextLinkURL provided by the service doesn’t encode the query params so it’s effectively useless.I would like to avoid having to always round-trip the
nextLinkURL like this as most services return a valid URL so I will follow up with the service team about getting it fixed. I’ll also bring up the other points to see what can be done about them. As for a more immediate fix it will depend on how fast the service team can turn around fixing thenextLinkURL. I’ll discuss with my team and follow up.That did the work! Thanks. So how does this work … will a new version come out with the fix ?