Skip to content

AWSSDK.S3.list_objects_v2 continuation token does not paginate #16

@tclements

Description

@tclements

AWSSDK.S3.list_objects_v2 cannot use continuation-token when making paginating requests. This seems similar to #10

Relevant package versions

(@v1.4) pkg> st
Status `~/.julia/environments/v1.4/Project.toml`
  [4f1ea46c] AWSCore v0.6.14
  [1c724243] AWSS3 v0.6.12
  [0d499d91] AWSSDK v0.5.0

MWE using AWSSDK.S3.list_objects_v2

using AWSCore, AWSSDK.S3
aws = aws_config(region="us-east-1")
bucket = "XXXX"
prefix = "XXX/XX=XXX/XXX=XXX/XX=XXXX"
s3req = AWSSDK.S3.list_objects_v2( aws,Bucket=bucket,prefix=prefix)
# returns 1000 keys 

# next request try with continuation 
s3req = AWSSDK.S3.list_objects_v2(
    aws,
    Bucket=bucket,
    prefix=prefix,
    continuation-token=string(s3req["NextContinuationToken"]),
)
ERROR: syntax: invalid keyword argument name "(continuation - token)"
Stacktrace:
 [1] top-level scope at REPL[469]:1

which is not a valid keyword in Julia. Trying the what was suggested in #10 with headers

# next request
d = ["prefix"=>prefix,"Bucket"=>bucket,"headers"=>["continuation-token"=>string(s3req["NextContinuationToken"])]]
s3req = AWSSDK.S3.list_objects_v2(aws,d)

just returns the first 1000 keys of the original request. I've tried every combination of ContinuationToken, Continuation_Token, continuation_token, etc.. to get pagination working.

Please let me know if I am missing something obvious in using the continuation-token option.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions