2.2.1.2. Controlling a Large List of Objects

The system returns a maximum of 10,000 object names per request. To retrieve subsequent object names, another request must be made with the 'marker' parameter. The marker indicates where the last list left off and the system returns object names greater than this marker, up to 10,000 again. Note that the ‘marker’ value should be URL encoded prior to sending the HTTP request.

If 10,000 is larger than desired, a 'limit' parameter may be given.

If the number of object names returned equals the limit given (or 10,000 if no limit is given), it can be assumed there are more object names to be listed. If the container name list is exactly divisible by the limit, the last request has no content.

 

Example 2.23. List Large Number of Objects

For an example, let's use a listing of five object names:

gala
grannysmith
honeycrisp
jonagold
reddelicious

We'll use a limit of two to show how things work:

GET /<api version>/<account>/<container>?limit=2
Host: storage.swiftdrive.com
X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb
                    

gala
grannysmith

Because we received two items back, we can assume there are more object names to list. So, we make another request with a marker of the last item returned:

GET /<api version>/<account>/<container>?limit=2&marker=grannysmith
Host: storage.swiftdrive.com
X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb
                    

honeycrisp
jonagold

Again we have two items returned; there might be more:

GET /<api version>/<account>/<container>?limit=2&marker=jonagold
Host: storage.swiftdrive.com
X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb
                    

reddelicious

Now we received less than the limit number of object names, indicating that we have the complete list.

By using end_marker we can limit the result set to object names less than the given value.

GET /<api version><account>/<container>?end_marker=jonagold
Host: storage.swiftdrive.com
X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb
              

gala
grannysmith
honeycrisp



loading table of contents...