s3listobjects
s3listobjects |
Purpose
Synopsis
procedure s3listobjects(bucket:s3bucket, prefix:text, delimiter:text, result:s3objectlist)
procedure s3listobjects(bucket:s3bucket, prefix:text, result:s3objectlist)
Arguments
|
bucket
|
The s3bucket object describing the bucket to access
|
|
prefix
|
The object prefix to search for
|
|
delimiter
|
The object delimiter, or "" for no delimiter. If a delimiter is specified, then any objects containing this string after the prefix will not be returned in result.objects, but each unique string between the prefix and the next occurrence of this delimiter will be returned in result.commonprefixes |
|
result
|
Record structure to retrieve
|
Example
declarations
myresult: s3objectlist
end-declarations
repeat
s3listobjects( mybucket, "myprefix/", myresult )
if s3status(mybucket)<>S3_OK then
writeln("Error returned by S3: ",s3getlasterror(mybucket))
exit(1)
end-if
forall (o in myresult.objects) do
writeln('Found object with key ',o.key)
end-do
until not myresult.istruncated
Further information
1. After calling, check the value of
s3status for any errors.
2. As the number of objects in an S3 bucket can be very large, this function may return a truncated list of the keys. If this is the case, the istruncated flag of the
s3objectlist will be set to 'true' and you should call
s3listobjects again, passing the same record, to retrieve the next batch of object keys.
3. If the s3bucket has a configured keyprefix, it will be prepended to the prefix specified by the
s3listobjects request
4. If the s3bucket has a configured keyprefix, it will be stripped from the keys and prefixes returned in the
s3objectlist
Related topics
© 2001-2019 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation ("FICO"). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.
