Listing the Objects of a Bucket

You can list the objects contained in your buckets or in the buckets for which you have the appropriate permissions. For more information, see Configuring an Object ACL.

This action also returns information about the date and time at which you uploaded or copied an object to your bucket.

If you organized a virtual architecture in your bucket using the keys of the objects, you can retrieve the resources that you named according to a xxx/yyy format, using the prefix and delimiter attributes. For more information, see About OOS > Objects.

This feature is not available from Cockpit. This documentation only describes the procedure using AWS CLI.

To list the objects contained in a bucket, use the list-objects command following this syntax:

Request sample
$ aws s3api list-objects \
    --profile YOUR_PROFILE \
    --bucket BUCKET \
    --prefix PREFIX/OBJECT \
    [--delimiter NOT_SPECIFIED] \
    --endpoint https://oos.eu-west-2.outscale.com

This command contains the following attributes that you need to specify:

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • bucket: The name of the bucket whose objects you want to list.

  • (optional) prefix: A letter or a string of characters to filter your objects. It displays the objects that begin with the letter or the characters you specify.

  • (optional) delimiter: A letter to filter your objects. It excludes the objects that begin or contain the letter you specify.

  • endpoint: The endpoint corresponding to the Region you want to send the request to.

The list-objects command returns the following elements:

  • CommonPrefixes: Information about the common prefixes. This element contains the following information:

    • Prefix: The delimiter you specified, or the string of characters from your prefix to your delimiter. For more information, see About OOS > Objects.

  • Contents: Information about the contents of your bucket. This element contains the following information:

    • LastModified: The date and time when the object was uploaded or copied into the bucket.

    • ETag: The ETag of the object.

    • StorageClass: The storage class of your object (always STANDARD)

    • Key: The name of the object in the bucket.

    • Owner: Information about the owner of the object. This element contains the following information:

      • DisplayName: The OUTSCALE account ID of the owner of the object.

      • ID: The S3 user ID of the owner of the object.

    • Size: The size of your object, in bytes.

Result Sample
{
    "CommonPrefixes": [
        {
            "Prefix": "PREFIX/OBJECT"
        }
    ],
    "Contents": [
        {
            "LastModified": "2017-02-02T09:31:25.790Z",
            "ETag": "\"93494ed0663d6a689b5e1f90d9e29d41\"",
            "StorageClass": "STANDARD",
            "Key": "PREFIX/OBJECT_1",
            "Owner": {
                "DisplayName": "ACCOUNT_ID",
                "ID": "USER_ID"
            },
            "Size": 42
        },

        {
            "LastModified": "2017-03-02T14:12:41.173Z",
            "ETag": "\"a9e872119bfa18db39ed9207c3c5b81f\"",
            "StorageClass": "STANDARD",
            "Key": "PREFIX/OBJECT_2",
            "Owner": {
                "DisplayName": "ACCOUNT_ID",
                "ID": "USER_ID"
            },
            "Size": 200
        }
    ]
}
  • You can also perform this action using an s3 command following this syntax:

    $ aws s3 ls --profile YOUR_PROFILE s3://YOUR_BUCKET --endpoint https://oos.eu-west-2.outscale.com
  • You can also manage your object storage resources using s3cmd commands. For more information, see s3cmd.

Related Page

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.