Skip to content

~crosstalk.api.aws.s3.getBucket@v1

tristanls edited this page Dec 26, 2012 · 1 revision

GetBucket. see: http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGET.html

Since Version 1.0.0
Scope
accepts: public responds as: ~crosstalk

Parameters

All parameters are optional, unless otherwise indicated.

awsAccessKeyId AKIAIOSFODNN7EXAMPLE required AWS Access Key Id
bucketName myBucket required AWS S3 Bucket to put object into
delimiter / A delimiter is a character you use to group keys
marker 2012-12-26/24/someObject.txt Specifies the key to start with when listing objects in a bucket
maxKeys 1000 Sets the maximum number of keys returned in the response body
prefix 2012-12-26/24 Limits the response to keys that begin with the specified prefix
secretAccessKey EXAMPLEgqkMoFlcrotaJGlKH82cOA3IyhEXAMPLE required AWS Secret Access Key

Response fields

Response

contents [ METADATA, METADATA, ... ] Metadata about each object returned
commonPrefixes NOT IMPLEMENTED Not Implemented
delimiter / Causes keys that contain the same string between the prefix and the first occurrence of the delimiter to be rolled up into a single result element in the CommonPrefixes collection
isTruncated false Specifies whether (true) or not (false) all of the results were returned
marker myMark Indicates where in the bucket to begin listing
maxKeys 1000 The maximum number of keys returned in the response body
name myBucket The name of the bucket
prefix 2012-12-26/ Keys that begin with the indicated prefix
METADATA
ETag fbacf535f27731c9771645a39863328 ETag returned by AWS S3
key myObject.json The object's key
lastModified 2012-12-23T00:00:00.000Z Date and time the object was last modified
owner OWNER Bucket owner
size 20 Size in bytes of the object
storageClass STANDARD STANDARD | REDUCED_REDUNDANCY | GLACIER
OWNER
displayName account.holder Object owner's name
id EXAMPLEbdEXAMPLE4c5EXAMPLEe03EXAMPLEb805EXAMPLE1635EXAMPLE Object owner's ID

Error

code NoSuchKey Error code returned by AWS S3 API
message The resource you requested does not exist Error message by AWS S3 API
requestId 4442587FB7D0A2F9 Request id returned by AWS S3 API
resource /mybucket/myfoto.jpg Request resource returned by AWS S3 API

Example

Request:

crosstalk.emit( 
  '~crosstalk.api.aws.s3.getBucket@v1', 
  {
    awsAccessKeyId : 'AKIAIOSFODNN7EXAMPLE',
    bucketName : 'myBucket',
    secretAccessKey : 'EXAMPLEgqkMoFlcrotaJGlKH82cOA3IyhEXAMPLE'
  }, 
  '~crosstalk',
  function ( error, response ) { /* ... */ }
);

Response:

{ 
  isTruncated : false,
  maxKeys : "1000",
  name : "myBucket",
  contents : [{ 
    ETag : "7692b681dfb12feaee883e23c3760e47",
    key : "2012-12-26/23/myObject.json",
    lastModified : "2012-12-26T20:02:40.000Z",
    size : "20",
    storageClass : "STANDARD",
    owner : {
      displayName : "aws.production",
      id : "EXAMPLEbdEXAMPLE4c5EXAMPLEe03EXAMPLEb805EXAMPLE1635EXAMPLE"
    }
  }]
}

Error:

{ 
  code : "AccessDenied",
  message : "Access Denied",
  requestId : "4442587FB7D0A2F9"
}