cloudflare-go
cloudflare-go copied to clipboard
No pagination options for ListOriginCertificates
Confirmation
- [X] My issue isn't already found on the issue tracker.
- [X] I have replicated my issue using the latest version of the library and it is still present.
cloudflare-go version
0.80.0 and 0.86.0
Go environment
GO111MODULE='on'
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/whoami/Library/Caches/go-build'
GOENV='/Users/whoami/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/whoami/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/whoami/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/opt/homebrew/opt/go/libexec'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/opt/homebrew/opt/go/libexec/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.21.5'
GCCGO='gccgo'
AR='ar'
CC='cc'
CXX='c++'
CGO_ENABLED='1'
GOMOD='/Users/whoami/github/ory/cloud/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/cb/tjw9rzkd0y95s9xwkm4gfwlw0000gq/T/go-build195787705=/tmp/go-build -gno-record-gcc-switches -fno-common'
Expected output
When calling ListOriginCACertificates I would prefer to be able to get a list of all certificates, or be able to go page-by-page.
Actual output
When calling ListOriginCACertificates there is no option to add pagination options, which results in only getting 20 results from the API. The ListParams only supports zoneID
Code demonstrating the issue
# client is a wrapper for cloudflare.API
certs, err := client.API.ListOriginCACertificates(ctx, cloudflare.ListOriginCertificatesParams{ZoneID: client.ZoneID})
if err != nil {
cmd.PrintErrf("Could not list certificates: %v\n", err)
return err
}
cmd.Printf("Certs: %d", len(certs))
Steps to reproduce
- Create some sample certs (+20)
- List them in the API
- Only get first 20 results
References
No response
Pagination options are also missing for ListCertificatePacks
cf: https://github.com/cloudflare/cloudflare-go/blob/a410c28b480f97defd30372eb6ef4f91121170e2/certificate_packs.go#L78
Bump, as this is stil missing...
@Demonsthere Have you verified this on a recent version of the SDK? We're happy to investigate if so. Thanks!
I saw that pagination exists for the v4 version of the library, but not the 0.1xx. Not sure if that by design or mistake :)
@Demonsthere We're not maintaining the 0.x versions of the library anymore. Would encourage you to update to a more recent version of the SDK. 4.5 should be dropping today. Thanks!