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

Support for List Images v2 and continuation tokens #1443

Open
Jille opened this issue Nov 17, 2023 · 0 comments
Open

Support for List Images v2 and continuation tokens #1443

Jille opened this issue Nov 17, 2023 · 0 comments

Comments

@Jille
Copy link

Jille commented Nov 17, 2023

Current cloudflare-go version

0.81.0

Description

https://developers.cloudflare.com/api/operations/cloudflare-images-list-images-v2 describes the new v2 api for listing images.

The current ListImages call doesn't return any pagination info however.

Use cases

I want to list all images, match them against those I still reference, and delete the rest.

Potential cloudflare-go usage

var cursor string
for {
  imgs, info, err := cf.ListImagesV2(ctx, rc, cloudflare.ListImagesParams{Cursor: cursor})
  if err != nil {}
  stuff(imgs)
  if info.Cursor == "" {
    break
  }
  cursor = info.Cursor
}

References

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant