go-pagerduty icon indicating copy to clipboard operation
go-pagerduty copied to clipboard

List* methods should not be paginated by default; create paginated versions

Open theckman opened this issue 4 years ago • 3 comments

In v1 of the API we do not disambiguate between methods that do the pagination for us, and those that do it on our behalf. A good example is ListBusinessServices().

For v2 we should probably update ListBusinessServices() to not automatically do pagination, and create a ListBusinessServicesPaginated() version instead.

We should probably adopt this naming scheme in v1 for anything that we add that is going to do pagination on the behalf of the user. One example of us already doing this: https://github.com/PagerDuty/go-pagerduty/blob/1a0c44e17d3ec590336e5d5b256ee123ac6cc023/service.go#L125

theckman avatar Feb 27 '21 08:02 theckman

Others to fix: https://github.com/PagerDuty/go-pagerduty/blob/77a73c9d16987b91549d60d76d5a075e91400df9/ruleset.go#L142-L154

https://github.com/PagerDuty/go-pagerduty/blob/77a73c9d16987b91549d60d76d5a075e91400df9/ruleset.go#L265-L278

theckman avatar Jan 16 '22 23:01 theckman

is there any way when using the cli to specify we want more than 25 results?

./pd service list -team-id TeamId

jparram avatar Apr 28 '23 15:04 jparram

is there any way when using the cli to specify we want more than 25 results?

./pd service list -team-id TeamId

No, but I did see another issue asking for that feature to be added....

andrewwatson avatar Jun 09 '23 17:06 andrewwatson