Skip to content

Support for List Images v2 and continuation tokens #1443

@Jille

Description

@Jille

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions