GET Bucket analytics
Description
This implementation of the GET operation returns an analytics configuration (identified by the analytics configuration ID) from the bucket.
To use this operation, you must have permissions to perform the
s3:GetAnalyticsConfiguration action. The bucket owner has this
permission by default. The bucket owner can grant this permission to others. For
more
information about permissions, see Permissions Related to Bucket Subresource Operations and Managing Access Permissions to Your Amazon S3
Resources in the Amazon Simple Storage Service Developer Guide.
For information about Amazon S3 analytics feature, see Amazon S3 Analytics – Storage Class Analysis in the Amazon Simple Storage Service Developer Guide.
Requests
Syntax
GET /?analytics&id=analytics-configuration-IDHTTP/1.1 Host:bucketname.s3.amazonaws.com Date:dateAuthorization:authorization string(see Authenticating Requests (AWS Signature Version 4))
Request Parameters
This implementation of GET uses the parameter in the following
table.
| Parameter | Description | Required |
|---|---|---|
id |
The ID that identifies the analytics configuration. Limited to 64 characters. Type: String Default: None Valid Characters for |
Yes |
Request Headers
This implementation of the operation uses only request headers that are common to all operations. For more information, see Common Request Headers.
Request Elements
This implementation of the operation does not use request elements.
Responses
Response Headers
This implementation of the operation uses only response headers that are common to most responses. For more information, see Common Response Headers.
Response Elements
The Examples section shows an example of an analytics configuration XML. The following
table describes the XML elements in the analytics configuration returned by the
GET request.
| Name | Description |
|---|---|
AnalyticsConfiguration
|
Contains the configuration and any analyses for the analytics filter. Type: Container Children: Ancestor: None |
And
|
A conjunction (logical AND) of predicates, which is used in evaluating an analytics
filter. The operator must have at least two
predicates.
Type: String Children:
Ancestor:
|
Bucket
|
The Amazon Resource Name (ARN) of the bucket where analytics results are published. Type: String Ancestor: |
BucketAccountId
|
The ID of the account that owns the destination bucket where the analytics results are published. Type: String Ancestor: |
DataExport |
A container used to describe how data related to the storage class analysis should be exported. Type: Container Children: Ancestor: |
Destination
|
Contains information about where to publish the analytics results. Type: Container Children: Ancestor: |
Filter
|
Specifies an analytics filter. The analytics only includes objects that meet the
filter's criteria.
Type: Container Children:
Ancestor:
|
Format
|
Specifies the output format of the analytics results. Currently, Amazon S3 supports the comma-separated value (CSV) format. Type: String Ancestor: Valid values: |
Id
|
The ID that identifies the analytics configuration. Type: String Ancestor: |
Key
|
The key for a tag. Type: String Ancestor: |
OutputSchemaVersion
|
The version of the output schema to use when exporting data. Must be V_1. Type: String Ancestor: Valid values: |
Prefix
|
The prefix that an object must have to be included in the analytics results.
Type: String Ancestor:
|
Prefix
|
The prefix that is prepended to all analytics results. Type: String Ancestor: |
StorageClassAnalysis
|
If present, it indicates that data related to access patterns is collected and made available to analyze the tradeoffs between different storage classes. Type: Container Children: Ancestor: |
S3BucketDestination
|
Contains the bucket ARN, file format, bucket owner (optional), and prefix (optional) where analytics results are published. Type: Container Children: Ancestor: |
Tag
|
The tag to use when evaluating an analytics filter. Type: Container Children: Ancestor: |
Value
|
The value for a tag. Type: String Ancestor: |
Special Errors
This implementation of the operation does not return special errors. For general information about Amazon S3 errors and a list of error codes, see Error Responses.
Examples
Example: Configure an Analytics Report
The following GET request for the bucket examplebucket returns the inventory
configuration with the ID list1.
GET /?analytics&id=list1 HTTP/1.1 Host: examplebucket.s3.amazonaws.com Date: Mon, 31 Oct 2016 12:00:00 GMT Authorization:authorization string
The following is a sample response.
HTTP/1.1 200 OK x-amz-id-2: YgIPIfBiKa2bj0KMgUAdQkf3ShJTOOpXUueF6QKo x-amz-request-id: 236A8905248E5A02 Date: Mon, 31 Oct 2016 12:00:00 GMT Server: AmazonS3 Content-Length:length<?xml version="1.0" encoding="UTF-8"?> <AnalyticsConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <Id>list1</Id> <Filter> <And> <Prefix>images/</Prefix> <Tag> <Key>dog</Key> <Value>corgi</Value> </Tag> </And> </Filter> <StorageClassAnalysis> <DataExport> <OutputSchemaVersion>V_1</OutputSchemaVersion> <Destination> <S3BucketDestination> <Format>CSV</Format> <BucketAccountId>123456789012</BucketAccountId> <Bucket>arn:aws:s3:::destination-bucket</Bucket> <Prefix>destination-prefix</Prefix> </S3BucketDestination> </Destination> </DataExport> </StorageClassAnalysis> </AnalyticsConfiguration>


